All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Santini <luca.santini@spesonline.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] smc91x support for edosk7760 (smc91c96 ethernet chip)
Date: Wed, 27 Aug 2008 10:44:37 +0000	[thread overview]
Message-ID: <48B53015.9000203@spesonline.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: smc91x.patch --]
[-- Type: text/x-diff, Size: 1715 bytes --]

--- a/drivers/net/smc91x.h	2008-07-13 23:51:29.000000000 +0200
+++ b/drivers/net/smc91x.h	2008-08-27 10:40:01.000000000 +0200
@@ -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_ */

             reply	other threads:[~2008-08-27 10:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-27 10:44 Luca Santini [this message]
2008-08-27 14:45 ` [PATCH] smc91x support for edosk7760 (smc91c96 ethernet chip) Paul Mundt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48B53015.9000203@spesonline.com \
    --to=luca.santini@spesonline.com \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.