summaryrefslogtreecommitdiff
path: root/drivers/lan91c96.h
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.(none)>2005-09-26 00:29:53 +0200
committerWolfgang Denk <wd@pollux.(none)>2005-09-26 00:29:53 +0200
commitf2af3eb55ec53f4c050fcf10653a8df450ca7298 (patch)
treed3c952333462db55b354e4390ce348695439803c /drivers/lan91c96.h
parent8e6f1a8ec2b081c01a542ccbf333ddb6bca13c01 (diff)
Fixes to the Lubbock (PXA 25x) support:
- Resolve the FIXME with respect to saving the u-boot environment. - Make the default load address land in real memory. - Fix lan91c96 SMC_{in,out}{b,w,l}() macros Patch by David Brownell, 10 Mar 2005
Diffstat (limited to 'drivers/lan91c96.h')
-rw-r--r--drivers/lan91c96.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/lan91c96.h b/drivers/lan91c96.h
index 5c2afcef23..b7d7455b9d 100644
--- a/drivers/lan91c96.h
+++ b/drivers/lan91c96.h
@@ -78,17 +78,27 @@ typedef unsigned long int dword;
#ifdef CONFIG_PXA250
-#define SMC_inl(r) (*((volatile dword *)(SMC_BASE_ADDRESS+( r * 4 ))))
-#define SMC_inw(r) (*((volatile word *)(SMC_BASE_ADDRESS+( r * 4 ))))
-#define SMC_inb(p) ({ \
- unsigned int __p = (unsigned int)(SMC_BASE_ADDRESS + (p * 4)); \
- unsigned int __v = *(volatile unsigned short *)((__p) & ~1); \
+#ifdef CONFIG_LUBBOCK
+#define SMC_IO_SHIFT 2
+#undef USE_32_BIT
+
+#else
+#define SMC_IO_SHIFT 0
+#endif
+
+#define SMCREG(r) (SMC_BASE_ADDRESS+((r)<<SMC_IO_SHIFT))
+
+#define SMC_inl(r) (*((volatile dword *)SMCREG(r)))
+#define SMC_inw(r) (*((volatile word *)SMCREG(r)))
+#define SMC_inb(p) ({ \
+ unsigned int __p = p; \
+ unsigned int __v = SMC_inw(__p & ~1); \
if (__p & 1) __v >>= 8; \
else __v &= 0xff; \
__v; })
-#define SMC_outl(d,r) (*((volatile dword *)(SMC_BASE_ADDRESS+(r * 4))) = d)
-#define SMC_outw(d,r) (*((volatile word *)(SMC_BASE_ADDRESS+(r * 4))) = d)
+#define SMC_outl(d,r) (*((volatile dword *)SMCREG(r)) = d)
+#define SMC_outw(d,r) (*((volatile word *)SMCREG(r)) = d)
#define SMC_outb(d,r) ({ word __d = (byte)(d); \
word __w = SMC_inw((r)&~1); \
__w &= ((r)&1) ? 0x00FF : 0xFF00; \