]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
c655fad0 NI |
2 | /* |
3 | * Copyright (C) 2008 Nobuhiro Iwamatsu | |
4 | * Copyright (C) 2008 Renesas Solutions Corp. | |
5 | * | |
6 | * u-boot/board/rsk7203/rsk7203.c | |
c655fad0 NI |
7 | */ |
8 | ||
9 | #include <common.h> | |
a794f59a | 10 | #include <net.h> |
736fead8 | 11 | #include <netdev.h> |
c655fad0 NI |
12 | #include <asm/io.h> |
13 | #include <asm/processor.h> | |
14 | ||
15 | int checkboard(void) | |
16 | { | |
17 | puts("BOARD: Renesas Technology RSK7203\n"); | |
18 | return 0; | |
19 | } | |
20 | ||
21 | int board_init(void) | |
22 | { | |
23 | return 0; | |
24 | } | |
25 | ||
c655fad0 NI |
26 | void led_set_state(unsigned short value) |
27 | { | |
28 | } | |
ce9f99dd NI |
29 | |
30 | /* | |
31 | * The RSK board has the SMSC9118 wired up 'incorrectly'. | |
32 | * Byte-swapping is necessary, and so poor performance is inevitable. | |
33 | * This problem cannot evade by the swap function of CHIP, this can | |
34 | * evade by software Byte-swapping. | |
35 | * And this has problem by FIFO access only. pkt_data_pull/pkt_data_push | |
36 | * functions necessary to solve this problem. | |
37 | */ | |
736fead8 | 38 | u32 pkt_data_pull(struct eth_device *dev, u32 addr) |
ce9f99dd | 39 | { |
736fead8 | 40 | volatile u16 *addr_16 = (u16 *)(dev->iobase + addr); |
ce9f99dd NI |
41 | return (u32)((swab16(*addr_16) << 16) & 0xFFFF0000)\ |
42 | | swab16(*(addr_16 + 1)); | |
43 | } | |
44 | ||
736fead8 | 45 | void pkt_data_push(struct eth_device *dev, u32 addr, u32 val) |
ce9f99dd | 46 | { |
736fead8 | 47 | addr += dev->iobase; |
ce9f99dd NI |
48 | *(volatile u16 *)(addr + 2) = swab16((u16)val); |
49 | *(volatile u16 *)(addr) = swab16((u16)(val >> 16)); | |
50 | } | |
736fead8 BW |
51 | |
52 | int board_eth_init(bd_t *bis) | |
53 | { | |
54 | int rc = 0; | |
55 | #ifdef CONFIG_SMC911X | |
56 | rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); | |
57 | #endif | |
58 | return rc; | |
59 | } |