diff options
author | Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> | 2008-08-28 13:40:52 +0900 |
---|---|---|
committer | Nobuhiro Iwamatsu <iwamatsu@nigauri.org> | 2008-09-19 11:05:22 +0900 |
commit | ce9f99ddb59628f41dc534e892368a7d66dfc774 (patch) | |
tree | 577db9629eb1ddcd28f212f9a6c3bd03ee8982f9 /board | |
parent | dd820b03a2f45e86e7960e26729a3b58e3dda44a (diff) | |
download | u-boot-imx-ce9f99ddb59628f41dc534e892368a7d66dfc774.zip u-boot-imx-ce9f99ddb59628f41dc534e892368a7d66dfc774.tar.gz u-boot-imx-ce9f99ddb59628f41dc534e892368a7d66dfc774.tar.bz2 |
sh: rsk7203: Add support pkt_data_pull and pkt_data_push function
Add function of smc911x, pkt_data_pull and pkt_data_push.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/rsk7203/rsk7203.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/board/rsk7203/rsk7203.c b/board/rsk7203/rsk7203.c index beb943e..2d74359 100644 --- a/board/rsk7203/rsk7203.c +++ b/board/rsk7203/rsk7203.c @@ -48,3 +48,24 @@ int dram_init(void) void led_set_state(unsigned short value) { } + +/* + * 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. + */ +u32 pkt_data_pull(u32 addr) +{ + volatile u16 *addr_16 = (u16 *)addr; + return (u32)((swab16(*addr_16) << 16) & 0xFFFF0000)\ + | swab16(*(addr_16 + 1)); +} + +void pkt_data_push(u32 addr, u32 val) +{ + *(volatile u16 *)(addr + 2) = swab16((u16)val); + *(volatile u16 *)(addr) = swab16((u16)(val >> 16)); +} |