diff options
author | Stefan Roese <sr@denx.de> | 2008-09-22 15:26:49 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2008-09-22 15:26:49 +0200 |
commit | 5289feadb7857e2eaf81848aa632afa4a07bc0cc (patch) | |
tree | e35f1a35b711e5b2e6a881cfc01feae63b74f0ad /board/rsk7203 | |
parent | 023824549a370bd185d7129d9a6c86f9be7b86a8 (diff) | |
parent | 3a9a000d9fba5a127786c8a859d654ba3721917b (diff) |
Merge branch 'master' of /home/stefan/git/u-boot/u-boot
Diffstat (limited to 'board/rsk7203')
-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 beb943e85b..2d74359437 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)); +} |