summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorSammy He <r62914@freescale.com>2009-11-16 11:59:54 +0800
committerSammy He <r62914@freescale.com>2009-11-20 17:14:44 +0800
commit1701c3caa7ed7d183a57301f6513c1f5fb4102cd (patch)
tree6146e2b73d560b8b5225047cc922b6ce6fd2037d /drivers/net
parentcbee64d544a2bd8b5e2ae17bcfdfe79480690292 (diff)
downloadu-boot-imx-1701c3caa7ed7d183a57301f6513c1f5fb4102cd.zip
u-boot-imx-1701c3caa7ed7d183a57301f6513c1f5fb4102cd.tar.gz
u-boot-imx-1701c3caa7ed7d183a57301f6513c1f5fb4102cd.tar.bz2
ENGR00118576 MX25: Support Smc911x ethernet
1. Add imx cspi support for cpld access. 2. Add smc911x ethernet support from cpld. Signed-off-by: Sammy He <r62914@freescale.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/smc911x.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
index 05e007c..02c33b3 100644
--- a/drivers/net/smc911x.h
+++ b/drivers/net/smc911x.h
@@ -30,7 +30,8 @@
#define DRIVERNAME "smc911x"
#if defined (CONFIG_SMC911X_32_BIT) && \
- defined (CONFIG_SMC911X_16_BIT)
+ defined (CONFIG_SMC911X_16_BIT) && \
+ defined(CONFIG_SMC911X_CPLD)
#error "SMC911X: Only one of CONFIG_SMC911X_32_BIT and \
CONFIG_SMC911X_16_BIT shall be set"
#endif
@@ -62,6 +63,19 @@ static inline void smc911x_reg_write(struct eth_device *dev,
*(volatile u16 *)(dev->iobase + offset) = (u16)val;
*(volatile u16 *)(dev->iobase + offset + 2) = (u16)(val >> 16);
}
+#elif defined(CONFIG_SMC911X_CPLD)
+#include <asm/arch/imx_spi_cpld.h>
+static inline u32 smc911x_reg_read(struct eth_device *dev, u32 offset)
+{
+ return cpld_reg_xfer(offset, 0x0, 1) | \
+ (cpld_reg_xfer(offset + 0x2, 0x0, 1) << 16);
+}
+static void smc911x_reg_write(struct eth_device *dev,
+ u32 offset, u32 val)
+{
+ cpld_reg_xfer(offset, val, 0);
+ cpld_reg_xfer(offset + 0x2, (val >> 16), 0);
+}
#else
#error "SMC911X: undefined bus width"
#endif /* CONFIG_SMC911X_16_BIT */