Skip to content
Snippets Groups Projects
Commit ce9f99dd authored by Nobuhiro Iwamatsu's avatar Nobuhiro Iwamatsu Committed by Nobuhiro Iwamatsu
Browse files

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: default avatarNobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: default avatarNobuhiro Iwamatsu <iwamatsu@nigauri.org>
parent dd820b03
No related branches found
No related tags found
No related merge requests found
...@@ -48,3 +48,24 @@ int dram_init(void) ...@@ -48,3 +48,24 @@ int dram_init(void)
void led_set_state(unsigned short value) 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));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment