Skip to contentSkip to conversation

ppc32: 8xx board-specific platform stuff for fs_enet

PATCH In review Vitaly Bordug 2 participants 2 messages Nov 18, 2005 – Nov 23, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc32: 8xx board-specific platform stuff for fs_enet

This adds board-specific files needed to utilize fs_enet Ethernet driver for MPC885ADS and MPC866ADS.

---

 arch/ppc/Kconfig                     |   47 ++++
 arch/ppc/platforms/Makefile          |    2
 arch/ppc/platforms/fads.h            |    2
 arch/ppc/platforms/mpc866ads_setup.c |  283 ++++++++++++++++++++++++
 arch/ppc/platforms/mpc885ads_setup.c |  400 ++++++++++++++++++++++++++++++++++
 include/asm-ppc/io.h                 |    7 +
 6 files changed, 740 insertions(+), 1 deletions(-)
 create mode 100644 arch/ppc/platforms/mpc866ads_setup.c
 create mode 100644 arch/ppc/platforms/mpc885ads_setup.c

applies-to: d2cd86c706af9e6ad47e2dda6b24df0d93f6f98f fa40f206175e866edd27507148c61a90b665c8db

arch/ppc/Kconfig +47 -0
index 8fa51b0..8e6fcb2 100644
@@ -506,6 +506,53 @@ config WINCEPT
 
 endchoice
 
+menu "Freescale Ethernet driver platform-specific options"
+	depends on FS_ENET
+
+	config MPC8xx_SECOND_ETH
+	bool "Second Ethernet channel"
+	depends on (MPC885ADS || MPC86XADS)
+	default y
+	help
+	  This enables support for second Ethernet on MPC885ADS and MPC86xADS boards.
+	  The latter will use SCC1, for 885ADS you can select it below.
+
+	choice
+		prompt "Second Ethernet channel"
+		depends on MPC8xx_SECOND_ETH
+		default MPC8xx_SECOND_ETH_FEC2
+
+		config MPC8xx_SECOND_ETH_FEC2
+		bool "FEC2"
+		depends on MPC885ADS
+		help
+		  Enable FEC2 to serve as 2-nd Ethernet channel. Note that SMC2
+		  (often 2-nd UART) will not work if this is enabled.
+
+		config MPC8xx_SECOND_ETH_SCC1
+		bool "SCC1"
+		depends on MPC86XADS
+		select MPC8xx_SCC_ENET_FIXED
+		help
+		  Enable SCC1 to serve as 2-nd Ethernet channel. Note that SMC1
+		  (often 1-nd UART) will not work if this is enabled.
+
+		config MPC8xx_SECOND_ETH_SCC3
+		bool "SCC3"
+		depends on MPC885ADS
+		help
+		  Enable SCC3 to serve as 2-nd Ethernet channel. Note that SMC1
+		  (often 1-nd UART) will not work if this is enabled.
+
+	endchoice
+
+	config MPC8xx_SCC_ENET_FIXED
+	depends on MPC8xx_SECOND_ETH_SCC
+	default n
+	bool "Use fixed MII-less mode for SCC Ethernet"
+
+endmenu
+
 choice
 	prompt "Machine Type"
 	depends on 6xx || POWER3 || POWER4
arch/ppc/platforms/Makefile +2 -0
index 7c5cdab..cce6487 100644
@@ -45,6 +45,8 @@ obj-$(CONFIG_SBC82xx)		+= sbc82xx.o
 obj-$(CONFIG_SPRUCE)		+= spruce.o
 obj-$(CONFIG_LITE5200)		+= lite5200.o
 obj-$(CONFIG_EV64360)		+= ev64360.o
+obj-$(CONFIG_MPC86XADS)		+= mpc866ads_setup.o
+obj-$(CONFIG_MPC885ADS)		+= mpc885ads_setup.o
 
 ifeq ($(CONFIG_SMP),y)
 obj-$(CONFIG_PPC_PMAC)		+= pmac_smp.o
arch/ppc/platforms/fads.h +1 -1
index a48fb8d..e1c0b1b 100644
@@ -112,7 +112,7 @@
 
 /* CPM Ethernet through SCC1 or SCC2 */
 
-#ifdef CONFIG_SCC1_ENET		/* Probably 860 variant */
+#if defined(CONFIG_SCC1_ENET) || defined(CONFIG_MPC8xx_SECOND_ETH_SCC1)		/* Probably 860 variant */
 /* Bits in parallel I/O port registers that have to be set/cleared
  * to configure the pins for SCC1 use.
  * TCLK - CLK1, RCLK - CLK2.
arch/ppc/platforms/mpc866ads_setup.c new file +283 -0

283 lines not on this page · raw message

arch/ppc/platforms/mpc885ads_setup.c new file +400 -0

400 lines not on this page · raw message

include/asm-ppc/io.h +7 -0
index 2bfdf9c..0ff4395 100644
@@ -556,4 +556,11 @@ extern void pci_iounmap(struct pci_dev *
  */
 #define xlate_dev_kmem_ptr(p)	p
 
+/* access ports */
+#define setbits32(_addr, _v) out_be32((_addr), in_be32(_addr) |  (_v))
+#define clrbits32(_addr, _v) out_be32((_addr), in_be32(_addr) & ~(_v))
+
+#define setbits16(_addr, _v) out_be16((_addr), in_be16(_addr) |  (_v))
+#define clrbits16(_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v))
+
 #endif /* __KERNEL__ */

---
Sincerely,
Vitaly

#1 lore raw

Hi Vitaly,

Quoted 4 lines · Vitaly Bordug

This adds board-specific files needed to utilize fs_enet Ethernet driver for MPC885ADS and MPC866ADS.

Looks nice.

Just one thing: Would mind separating the setbits/clearbits patch, and while you're at it, convert the current read-and-modify operations to setbits/clearbits?

They have been switched to use IO accessors with GIT commit e37b0c9670fed2264661ade1beb5c228dec29c96

Thanks