blob: 0066f9f6d016e1e971ccc9becbde51c471f30f8f [file] [log] [blame]
Phil Edworthy99744b72012-05-15 22:15:51 +00001/*
2 * Copyright (C) 2012 Renesas Electronics Europe Ltd.
3 * Copyright (C) 2012 Phil Edworthy
4 * Copyright (C) 2008 Renesas Solutions Corp.
5 * Copyright (C) 2008 Nobuhiro Iwamatsu
6 *
7 * Based on u-boot/board/rsk7264/rsk7264.c
8 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02009 * SPDX-License-Identifier: GPL-2.0+
Phil Edworthy99744b72012-05-15 22:15:51 +000010 */
11
12#include <common.h>
13#include <net.h>
14#include <netdev.h>
15#include <asm/io.h>
16#include <asm/processor.h>
17
Phil Edworthy99744b72012-05-15 22:15:51 +000018int checkboard(void)
19{
20 puts("BOARD: Renesas RSK7269\n");
21 return 0;
22}
23
24int board_init(void)
25{
26 return 0;
27}
28
Phil Edworthy99744b72012-05-15 22:15:51 +000029void led_set_state(unsigned short value)
30{
31}
32
33/*
34 * The RSK board has the SMSC89218 wired up 'incorrectly'.
35 * Byte-swapping is necessary, and so poor performance is inevitable.
36 * This problem cannot evade by the swap function of CHIP, this can
37 * evade by software Byte-swapping.
38 * And this has problem by FIFO access only. pkt_data_pull/pkt_data_push
39 * functions necessary to solve this problem.
40 */
41u32 pkt_data_pull(struct eth_device *dev, u32 addr)
42{
43 volatile u16 *addr_16 = (u16 *)(dev->iobase + addr);
44 return (u32)((swab16(*addr_16) << 16) & 0xFFFF0000)\
45 | swab16(*(addr_16 + 1));
46}
47
48void pkt_data_push(struct eth_device *dev, u32 addr, u32 val)
49{
50 addr += dev->iobase;
51 *(volatile u16 *)(addr + 2) = swab16((u16)val);
52 *(volatile u16 *)(addr) = swab16((u16)(val >> 16));
53}
54
55int board_eth_init(bd_t *bis)
56{
57 int rc = 0;
58#ifdef CONFIG_SMC911X
59 rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
60#endif
61 return rc;
62}