* [U-Boot] [PATCH 1/2] net: smc911x: Add pkt_data_pull and pkt_data_push function
@ 2008-08-28 4:40 Nobuhiro Iwamatsu
2008-09-01 21:54 ` Ben Warren
0 siblings, 1 reply; 2+ messages in thread
From: Nobuhiro Iwamatsu @ 2008-08-28 4:40 UTC (permalink / raw)
To: u-boot
The RSK7203 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.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
---
drivers/net/smc911x.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 0fff820..648c94c 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -57,6 +57,11 @@ static inline void reg_write(u32 addr, u32 val)
#error "SMC911X: undefined bus width"
#endif /* CONFIG_DRIVER_SMC911X_16_BIT */
+u32 pkt_data_pull(u32 addr) \
+ __attribute__ ((weak, alias ("reg_read")));
+void pkt_data_push(u32 addr, u32 val) \
+ __attribute__ ((weak, alias ("reg_write")));
+
#define mdelay(n) udelay((n)*1000)
/* Below are the register offsets and bit definitions
@@ -641,7 +646,7 @@ int eth_send(volatile void *packet, int length)
tmplen = (length + 3) / 4;
while (tmplen--)
- reg_write(TX_DATA_FIFO, *data++);
+ pkt_data_push(TX_DATA_FIFO, *data++);
/* wait for transmission */
while (!((reg_read(TX_FIFO_INF) & TX_FIFO_INF_TSUSED) >> 16));
@@ -684,7 +689,7 @@ int eth_rx(void)
tmplen = (pktlen + 2+ 3) / 4;
while (tmplen--)
- *data++ = reg_read(RX_DATA_FIFO);
+ *data++ = pkt_data_pull(RX_DATA_FIFO);
if (status & RX_STS_ES)
printf(DRIVERNAME
--
1.5.6.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH 1/2] net: smc911x: Add pkt_data_pull and pkt_data_push function
2008-08-28 4:40 [U-Boot] [PATCH 1/2] net: smc911x: Add pkt_data_pull and pkt_data_push function Nobuhiro Iwamatsu
@ 2008-09-01 21:54 ` Ben Warren
0 siblings, 0 replies; 2+ messages in thread
From: Ben Warren @ 2008-09-01 21:54 UTC (permalink / raw)
To: u-boot
Nobuhiro Iwamatsu wrote:
> The RSK7203 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.
>
> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
> ---
Thanks. Applied to net repo.
regards,
Ben
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-01 21:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-28 4:40 [U-Boot] [PATCH 1/2] net: smc911x: Add pkt_data_pull and pkt_data_push function Nobuhiro Iwamatsu
2008-09-01 21:54 ` Ben Warren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox