Skip to contentSkip to conversation

smc91x support for edosk7760 (smc91c96 ethernet chip)

PATCH In review Luca Santini 2 participants 2 messages Aug 27, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smc91x support for edosk7760 (smc91c96 ethernet chip)

drivers/net/smc91x.h +38 -3
@@ -429,6 +429,36 @@
 
 #include <asm/unit/smc91111.h>
 
+
+
+#elif defined(CONFIG_SH_EDOSK7760) //SPES
+
+/* SMC91C96 registers are 4 byte aligned rather than the
+ * usual 2 byte!
+ */
+#define SMC_IO_SHIFT 1 //SPES
+
+#define SMC_CAN_USE_8BIT	1
+#define SMC_CAN_USE_16BIT	1
+#define SMC_CAN_USE_32BIT	1
+#define SMC_NOWAIT		1
+
+#define SMC_inb(a, r)		readb((a) + (r))
+#define SMC_inw(a, r)		readw((a) + (r))
+#define SMC_inl(a, r)		readl((a) + (r))
+#define SMC_outb(v, a, r)	writeb(v, (a) + (r))
+#define SMC_outw(v, a, r)	writew(v, (a) + (r))
+#define SMC_outl(v, a, r)	writel(v, (a) + (r))
+#define SMC_insw(a, r, p, l)	readsw((a) + (r), p, l)
+#define SMC_outsw(a, r, p, l)	writesw((a) + (r), p, l)
+#define SMC_insl(a, r, p, l)	readsl((a) + (r), p, l)
+#define SMC_outsl(a, r, p, l)	writesl((a) + (r), p, l)
+
+#define RPC_LSA_DEFAULT		RPC_LED_100_10
+#define RPC_LSB_DEFAULT		RPC_LED_TX_RX
+
+#define SMC_DYNAMIC_BUS_CONFIG
+
 #else
 
 /*
@@ -702,7 +732,6 @@
 */
 #define BANK_SELECT		(14 << SMC_IO_SHIFT)
 
-
 // Transmit Control Register
 /* BANK 0  */
 #define TCR_REG(lp) 	SMC_REG(lp, 0x0000, 0)
@@ -1252,9 +1281,9 @@
 
 #define SMC_PUT_PKT_HDR(lp, status, length)				\
 	do {								\
-		if (SMC_32BIT(lp))					\
+		if (SMC_32BIT(lp)){					\
 			SMC_outl((status) | (length)<<16, ioaddr,	\
-				 DATA_REG(lp));			\
+				 DATA_REG(lp));	}		\
 		else {							\
 			SMC_outw(status, ioaddr, DATA_REG(lp));	\
 			SMC_outw(length, ioaddr, DATA_REG(lp));	\
@@ -1334,4 +1363,10 @@
 			SMC_insb(ioaddr, DATA_REG(lp), p, l);		\
 	} while (0)
 
+
+
+
+
+
+
 #endif  /* _SMC91X_H_ */
#1 lore raw

In the future, please send patches inline, or at the very least, using a text/plain mime type. Whoever came up with text/x-diff was an idiot.

Quoted 28 lines · Luca Santini
drivers/net/smc91x.h +22 -0
@@ -429,6 +429,36 @@
 
 #include <asm/unit/smc91111.h>
 
+
+
+#elif defined(CONFIG_SH_EDOSK7760) //SPES
+
+/* SMC91C96 registers are 4 byte aligned rather than the
+ * usual 2 byte!
+ */
+#define SMC_IO_SHIFT 1 //SPES
+
+#define SMC_CAN_USE_8BIT	1
+#define SMC_CAN_USE_16BIT	1
+#define SMC_CAN_USE_32BIT	1
+#define SMC_NOWAIT		1
+
+#define SMC_inb(a, r)		readb((a) + (r))
+#define SMC_inw(a, r)		readw((a) + (r))
+#define SMC_inl(a, r)		readl((a) + (r))
+#define SMC_outb(v, a, r)	writeb(v, (a) + (r))
+#define SMC_outw(v, a, r)	writew(v, (a) + (r))
+#define SMC_outl(v, a, r)	writel(v, (a) + (r))
+#define SMC_insw(a, r, p, l)	readsw((a) + (r), p, l)
+#define SMC_outsw(a, r, p, l)	writesw((a) + (r), p, l)

drivers/net/smc91x.h line 463

Quoted 10 lines
drivers/net/smc91x.h +8 -0
+#define SMC_insl(a, r, p, l)	readsl((a) + (r), p, l)
+#define SMC_outsl(a, r, p, l)	writesl((a) + (r), p, l)
+
+#define RPC_LSA_DEFAULT		RPC_LED_100_10
+#define RPC_LSB_DEFAULT		RPC_LED_TX_RX
+
+#define SMC_DYNAMIC_BUS_CONFIG
+
 #else
 

I think you've totally missed the point of the "dynamic" bus configuration. Please explain why you need to hardcode things here for your platform rather than using the platform data, as all new platforms should be doing. If there is something insufficient in the current dynamic bus configuration data, we should fix that, not add back in more of this hardcoded board support damage.

Quoted 22 lines
drivers/net/smc91x.h +2 -3
 /*
@@ -702,7 +732,6 @@
 */
 #define BANK_SELECT		(14 << SMC_IO_SHIFT)
 
-
 // Transmit Control Register
 /* BANK 0  */
 #define TCR_REG(lp) 	SMC_REG(lp, 0x0000, 0)
@@ -1252,9 +1281,9 @@
 
 #define SMC_PUT_PKT_HDR(lp, status, length)				\
 	do {								\
-		if (SMC_32BIT(lp))					\
+		if (SMC_32BIT(lp)){					\
 			SMC_outl((status) | (length)<<16, ioaddr,	\
-				 DATA_REG(lp));			\
+				 DATA_REG(lp));	}		\
 		else {							\
 			SMC_outw(status, ioaddr, DATA_REG(lp));	\
 			SMC_outw(length, ioaddr, DATA_REG(lp));	\

drivers/net/smc91x.h line 1372

Quoted 10 lines
drivers/net/smc91x.h +6 -0
@@ -1334,4 +1363,10 @@
 			SMC_insb(ioaddr, DATA_REG(lp), p, l);		\
 	} while (0)
 
+
+
+
+
+
+
 #endif  /* _SMC91X_H_ */

This part of the patch is nothing but whitespace damage. Please be more careful and make sure you are only patching useful things in the future, as this adds a lot of noise that has to be manually removed otherwise.