]> git.sur5r.net Git - u-boot/blobdiff - drivers/dm9000x.c
PXA270: Added support for TrizepsIV board.
[u-boot] / drivers / dm9000x.c
index e0d531bd917c9a772577a07d719a7a848adf3322..6131b5c35708c107219310e52dfeae7df20f782a 100644 (file)
@@ -99,7 +99,7 @@ void eth_halt(void);
 static int dm9000_probe(void);
 static u16 phy_read(int);
 static void phy_write(int, u16);
-static u16 read_srom_word(int);
+u16 read_srom_word(int);
 static u8 DM9000_ior(int);
 static void DM9000_iow(int reg, u8 value);
 
@@ -537,7 +537,7 @@ eth_rx(void)
 /*
   Read a word data from SROM
 */
-static u16
+u16
 read_srom_word(int offset)
 {
        DM9000_iow(DM9000_EPAR, offset);
@@ -547,6 +547,18 @@ read_srom_word(int offset)
        return (DM9000_ior(DM9000_EPDRL) + (DM9000_ior(DM9000_EPDRH) << 8));
 }
 
+void
+write_srom_word(int offset, u16 val)
+{
+       DM9000_iow(DM9000_EPAR, offset);
+       DM9000_iow(DM9000_EPDRH, ((val >> 8) & 0xff));
+       DM9000_iow(DM9000_EPDRL, (val & 0xff));
+       DM9000_iow(DM9000_EPCR, 0x12);
+       udelay(8000);
+       DM9000_iow(DM9000_EPCR, 0);
+}
+
+
 /*
    Read a byte from I/O port
 */