2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2008-08-31 14:02:04 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2008 Nobuhiro Iwamatsu
|
|
|
|
* Copyright (C) 2008 Renesas Solutions Corp.
|
|
|
|
*
|
|
|
|
* u-boot/board/rsk7203/rsk7203.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2009-08-23 12:14:52 +00:00
|
|
|
#include <net.h>
|
2009-07-21 05:01:11 +00:00
|
|
|
#include <netdev.h>
|
2008-08-31 14:02:04 +00:00
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/processor.h>
|
|
|
|
|
|
|
|
int checkboard(void)
|
|
|
|
{
|
|
|
|
puts("BOARD: Renesas Technology RSK7203\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int board_init(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void led_set_state(unsigned short value)
|
|
|
|
{
|
|
|
|
}
|
2008-08-28 04:40:52 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The RSK board has the SMSC9118 wired up 'incorrectly'.
|
|
|
|
* Byte-swapping is necessary, and so poor performance is inevitable.
|
|
|
|
* This problem cannot evade by the swap function of CHIP, this can
|
|
|
|
* evade by software Byte-swapping.
|
|
|
|
* And this has problem by FIFO access only. pkt_data_pull/pkt_data_push
|
|
|
|
* functions necessary to solve this problem.
|
|
|
|
*/
|
2009-07-21 05:01:11 +00:00
|
|
|
u32 pkt_data_pull(struct eth_device *dev, u32 addr)
|
2008-08-28 04:40:52 +00:00
|
|
|
{
|
2009-07-21 05:01:11 +00:00
|
|
|
volatile u16 *addr_16 = (u16 *)(dev->iobase + addr);
|
2008-08-28 04:40:52 +00:00
|
|
|
return (u32)((swab16(*addr_16) << 16) & 0xFFFF0000)\
|
|
|
|
| swab16(*(addr_16 + 1));
|
|
|
|
}
|
|
|
|
|
2009-07-21 05:01:11 +00:00
|
|
|
void pkt_data_push(struct eth_device *dev, u32 addr, u32 val)
|
2008-08-28 04:40:52 +00:00
|
|
|
{
|
2009-07-21 05:01:11 +00:00
|
|
|
addr += dev->iobase;
|
2008-08-28 04:40:52 +00:00
|
|
|
*(volatile u16 *)(addr + 2) = swab16((u16)val);
|
|
|
|
*(volatile u16 *)(addr) = swab16((u16)(val >> 16));
|
|
|
|
}
|
2009-07-21 05:01:11 +00:00
|
|
|
|
|
|
|
int board_eth_init(bd_t *bis)
|
|
|
|
{
|
|
|
|
int rc = 0;
|
|
|
|
#ifdef CONFIG_SMC911X
|
|
|
|
rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
|
|
|
|
#endif
|
|
|
|
return rc;
|
|
|
|
}
|