]> git.sur5r.net Git - u-boot/blobdiff - board/renesas/rsk7203/rsk7203.c
Move DECLARE_GLOBAL_DATA_PTR to file scope
[u-boot] / board / renesas / rsk7203 / rsk7203.c
index 2cbd45e043fb9ce81fd137ecd9d2843d0180a589..06552c08180aaadda25572507cbbc66b03501a19 100644 (file)
  */
 
 #include <common.h>
+#include <net.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int checkboard(void)
 {
        puts("BOARD: Renesas Technology RSK7203\n");
@@ -37,8 +41,6 @@ int board_init(void)
 
 int dram_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
        printf("DRAM:  %dMB\n", CONFIG_SYS_SDRAM_SIZE / (1024 * 1024));
@@ -57,15 +59,25 @@ void led_set_state(unsigned short value)
  * And this has problem by FIFO access only. pkt_data_pull/pkt_data_push
  * functions necessary to solve this problem.
  */
-u32 pkt_data_pull(u32 addr)
+u32 pkt_data_pull(struct eth_device *dev, u32 addr)
 {
-       volatile u16 *addr_16 = (u16 *)addr;
+       volatile u16 *addr_16 = (u16 *)(dev->iobase + addr);
        return (u32)((swab16(*addr_16) << 16) & 0xFFFF0000)\
                                | swab16(*(addr_16 + 1));
 }
 
-void pkt_data_push(u32 addr, u32 val)
+void pkt_data_push(struct eth_device *dev, u32 addr, u32 val)
 {
+       addr += dev->iobase;
        *(volatile u16 *)(addr + 2) = swab16((u16)val);
        *(volatile u16 *)(addr) = swab16((u16)(val >> 16));
 }
+
+int board_eth_init(bd_t *bis)
+{
+       int rc = 0;
+#ifdef CONFIG_SMC911X
+       rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+       return rc;
+}