]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/renesas/rsk7203/rsk7203.c
Merge git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / board / renesas / rsk7203 / rsk7203.c
index 2cbd45e043fb9ce81fd137ecd9d2843d0180a589..8800371b00427b5bf0f4cc08c97adcc3bdbcb0aa 100644 (file)
@@ -4,26 +4,17 @@
  *
  * u-boot/board/rsk7203/rsk7203.c
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #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 +28,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 +46,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;
+}