projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.denx.de/u-boot-dm
[oweals/u-boot.git]
/
drivers
/
net
/
lpc32xx_eth.c
diff --git
a/drivers/net/lpc32xx_eth.c
b/drivers/net/lpc32xx_eth.c
index f3ab0f4bf0754f3e8d8e66c4168ecba3d0fa19a7..6cc273c33c81f046b1ce4f555d590213eddaa77a 100644
(file)
--- a/
drivers/net/lpc32xx_eth.c
+++ b/
drivers/net/lpc32xx_eth.c
@@
-304,6
+304,13
@@
static int mii_reg_write(const char *devname, u8 phy_adr, u8 reg_ofs, u16 data)
return -EFAULT;
}
return -EFAULT;
}
+ /* write the phy and reg addressse into the MII address reg */
+ writel((phy_adr << MADR_PHY_OFFSET) | (reg_ofs << MADR_REG_OFFSET),
+ ®s->madr);
+
+ /* write data to the MII write register */
+ writel(data, ®s->mwtd);
+
/* wait till the MII is not busy */
timeout = MII_TIMEOUT;
do {
/* wait till the MII is not busy */
timeout = MII_TIMEOUT;
do {
@@
-319,13
+326,6
@@
static int mii_reg_write(const char *devname, u8 phy_adr, u8 reg_ofs, u16 data)
return -EFAULT;
}
return -EFAULT;
}
- /* write the phy and reg addressse into the MII address reg */
- writel((phy_adr << MADR_PHY_OFFSET) | (reg_ofs << MADR_REG_OFFSET),
- ®s->madr);
-
- /* write data to the MII write register */
- writel(data, ®s->mwtd);
-
/*debug("%s:(adr %d, off %d) <= %04x\n", __func__, phy_adr,
reg_ofs, data);*/
/*debug("%s:(adr %d, off %d) <= %04x\n", __func__, phy_adr,
reg_ofs, data);*/
@@
-353,15
+353,17
@@
int lpc32xx_eth_phy_write(struct mii_dev *bus, int phy_addr, int dev_addr,
#endif
/*
#endif
/*
+ * Provide default Ethernet buffers base address if target did not.
* Locate buffers in SRAM at 0x00001000 to avoid cache issues and
* maximize throughput.
*/
* Locate buffers in SRAM at 0x00001000 to avoid cache issues and
* maximize throughput.
*/
-
-#define LPC32XX_ETH_BUFS 0x00001000
+#if !defined(CONFIG_LPC32XX_ETH_BUFS_BASE)
+#define CONFIG_LPC32XX_ETH_BUFS_BASE 0x00001000
+#endif
static struct lpc32xx_eth_device lpc32xx_eth = {
.regs = (struct lpc32xx_eth_registers *)LPC32XX_ETH_BASE,
static struct lpc32xx_eth_device lpc32xx_eth = {
.regs = (struct lpc32xx_eth_registers *)LPC32XX_ETH_BASE,
- .bufs = (struct lpc32xx_eth_buffers *)
LPC32XX_ETH_BUFS
,
+ .bufs = (struct lpc32xx_eth_buffers *)
CONFIG_LPC32XX_ETH_BUFS_BASE
,
#if defined(CONFIG_RMII)
.phy_rmii = true,
#endif
#if defined(CONFIG_RMII)
.phy_rmii = true,
#endif
@@
-580,7
+582,7
@@
int lpc32xx_eth_phylib_init(struct eth_device *dev, int phyid)
}
bus->read = lpc32xx_eth_phy_read;
bus->write = lpc32xx_eth_phy_write;
}
bus->read = lpc32xx_eth_phy_read;
bus->write = lpc32xx_eth_phy_write;
- s
printf
(bus->name, dev->name);
+ s
trcpy
(bus->name, dev->name);
ret = mdio_register(bus);
if (ret) {
ret = mdio_register(bus);
if (ret) {