aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/8xx_io/enet.c
diff options
context:
space:
mode:
authorAndrei Konovalov <akonovalov@ru.mvista.com>2005-07-05 21:54:43 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-05 22:18:59 -0400
commite6b6239f8e8e5bd9ba0192a854652abf14e28ce4 (patch)
tree8cb580d70757ee3ef3231be410ad35917f0fadb7 /arch/ppc/8xx_io/enet.c
parent5432ebb5f67f0be3264feb646f6f8f6c326899c9 (diff)
[PATCH] ppc32: add Freescale MPC885ADS board support
This patch adds the Freescale MPC86xADS board support. The supported devices are SMC UART and 10Mbit ethernet on SCC1. The manual for the board says that it "is compatible with the MPC8xxFADS for software point of view". That's why this patch extends FADS instead of introducing a new platform. FEC is not supported as the "combined FCC/FEC ethernet driver" driver by Pantelis Antoniou should replace the current FEC driver. Signed-off-by: Gennadiy Kurtsman <gkurtsman@ru.mvista.com> Signed-off-by: Andrei Konovalov <akonovalov@ru.mvista.com> Acked-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc/8xx_io/enet.c')
-rw-r--r--arch/ppc/8xx_io/enet.c52
1 files changed, 44 insertions, 8 deletions
diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c
index 4ea7158e5062..ece6a9fbe09b 100644
--- a/arch/ppc/8xx_io/enet.c
+++ b/arch/ppc/8xx_io/enet.c
@@ -714,16 +714,24 @@ static int __init scc_enet_init(void)
714 immap->im_ioport.iop_pcdat &= ~PC_ENET_LBK; /* Disable Loopback */ 714 immap->im_ioport.iop_pcdat &= ~PC_ENET_LBK; /* Disable Loopback */
715#endif /* PC_ENET_LBK */ 715#endif /* PC_ENET_LBK */
716 716
717 /* Configure port C pins to enable CLSN and RENA. 717#ifdef PE_ENET_TCLK
718 /* Configure port E for TCLK and RCLK.
718 */ 719 */
719 immap->im_ioport.iop_pcpar &= ~(PC_ENET_CLSN | PC_ENET_RENA); 720 cp->cp_pepar |= (PE_ENET_TCLK | PE_ENET_RCLK);
720 immap->im_ioport.iop_pcdir &= ~(PC_ENET_CLSN | PC_ENET_RENA); 721 cp->cp_pedir &= ~(PE_ENET_TCLK | PE_ENET_RCLK);
721 immap->im_ioport.iop_pcso |= (PC_ENET_CLSN | PC_ENET_RENA); 722 cp->cp_peso &= ~(PE_ENET_TCLK | PE_ENET_RCLK);
722 723#else
723 /* Configure port A for TCLK and RCLK. 724 /* Configure port A for TCLK and RCLK.
724 */ 725 */
725 immap->im_ioport.iop_papar |= (PA_ENET_TCLK | PA_ENET_RCLK); 726 immap->im_ioport.iop_papar |= (PA_ENET_TCLK | PA_ENET_RCLK);
726 immap->im_ioport.iop_padir &= ~(PA_ENET_TCLK | PA_ENET_RCLK); 727 immap->im_ioport.iop_padir &= ~(PA_ENET_TCLK | PA_ENET_RCLK);
728#endif
729
730 /* Configure port C pins to enable CLSN and RENA.
731 */
732 immap->im_ioport.iop_pcpar &= ~(PC_ENET_CLSN | PC_ENET_RENA);
733 immap->im_ioport.iop_pcdir &= ~(PC_ENET_CLSN | PC_ENET_RENA);
734 immap->im_ioport.iop_pcso |= (PC_ENET_CLSN | PC_ENET_RENA);
727 735
728 /* Configure Serial Interface clock routing. 736 /* Configure Serial Interface clock routing.
729 * First, clear all SCC bits to zero, then set the ones we want. 737 * First, clear all SCC bits to zero, then set the ones we want.
@@ -896,14 +904,18 @@ static int __init scc_enet_init(void)
896 /* It is now OK to enable the Ethernet transmitter. 904 /* It is now OK to enable the Ethernet transmitter.
897 * Unfortunately, there are board implementation differences here. 905 * Unfortunately, there are board implementation differences here.
898 */ 906 */
899#if (!defined (PB_ENET_TENA) && defined (PC_ENET_TENA)) 907#if (!defined (PB_ENET_TENA) && defined (PC_ENET_TENA) && !defined (PE_ENET_TENA))
900 immap->im_ioport.iop_pcpar |= PC_ENET_TENA; 908 immap->im_ioport.iop_pcpar |= PC_ENET_TENA;
901 immap->im_ioport.iop_pcdir &= ~PC_ENET_TENA; 909 immap->im_ioport.iop_pcdir &= ~PC_ENET_TENA;
902#elif ( defined (PB_ENET_TENA) && !defined (PC_ENET_TENA)) 910#elif ( defined (PB_ENET_TENA) && !defined (PC_ENET_TENA) && !defined (PE_ENET_TENA))
903 cp->cp_pbpar |= PB_ENET_TENA; 911 cp->cp_pbpar |= PB_ENET_TENA;
904 cp->cp_pbdir |= PB_ENET_TENA; 912 cp->cp_pbdir |= PB_ENET_TENA;
913#elif ( !defined (PB_ENET_TENA) && !defined (PC_ENET_TENA) && defined (PE_ENET_TENA))
914 cp->cp_pepar |= PE_ENET_TENA;
915 cp->cp_pedir &= ~PE_ENET_TENA;
916 cp->cp_peso |= PE_ENET_TENA;
905#else 917#else
906#error Configuration Error: define exactly ONE of PB_ENET_TENA, PC_ENET_TENA 918#error Configuration Error: define exactly ONE of PB_ENET_TENA, PC_ENET_TENA, PE_ENET_TENA
907#endif 919#endif
908 920
909#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) 921#if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC)
@@ -936,6 +948,29 @@ static int __init scc_enet_init(void)
936 *((volatile uint *)BCSR1) &= ~BCSR1_ETHEN; 948 *((volatile uint *)BCSR1) &= ~BCSR1_ETHEN;
937#endif 949#endif
938 950
951#ifdef CONFIG_MPC885ADS
952
953 /* Deassert PHY reset and enable the PHY.
954 */
955 {
956 volatile uint __iomem *bcsr = ioremap(BCSR_ADDR, BCSR_SIZE);
957 uint tmp;
958
959 tmp = in_be32(bcsr + 1 /* BCSR1 */);
960 tmp |= BCSR1_ETHEN;
961 out_be32(bcsr + 1, tmp);
962 tmp = in_be32(bcsr + 4 /* BCSR4 */);
963 tmp |= BCSR4_ETH10_RST;
964 out_be32(bcsr + 4, tmp);
965 iounmap(bcsr);
966 }
967
968 /* On MPC885ADS SCC ethernet PHY defaults to the full duplex mode
969 * upon reset. SCC is set to half duplex by default. So this
970 * inconsistency should be better fixed by the software.
971 */
972#endif
973
939 dev->base_addr = (unsigned long)ep; 974 dev->base_addr = (unsigned long)ep;
940#if 0 975#if 0
941 dev->name = "CPM_ENET"; 976 dev->name = "CPM_ENET";
@@ -969,3 +1004,4 @@ static int __init scc_enet_init(void)
969} 1004}
970 1005
971module_init(scc_enet_init); 1006module_init(scc_enet_init);
1007