diff options
author | Wolfgang Denk <wd@pollux.denx.de> | 2005-10-09 00:33:37 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@pollux.denx.de> | 2005-10-09 00:33:37 +0200 |
commit | 95f9dda2165f045a7e1708885ee589878cc6f20b (patch) | |
tree | 4277d76deb33ba149865d4c0996f758b1991e8cc | |
parent | 47340a46f6ff8be4f148b07bf42986c9054d8436 (diff) | |
download | u-boot-95f9dda2165f045a7e1708885ee589878cc6f20b.zip u-boot-95f9dda2165f045a7e1708885ee589878cc6f20b.tar.gz u-boot-95f9dda2165f045a7e1708885ee589878cc6f20b.tar.bz2 |
Eliminate hard-coded address of Ethernet transfer buffer on at91rm9200
Patch by Anders Larsen, 07 Oct 2005
The Atmel errata #11 states that the transfer buffer descriptor
table must be aligned on a 16-word boundary. As it turned out, this
is insufficient - it seems the table must be aligned on a boundary
at least as large as the table itself (in Linux this is not an
issue - the table is aligned on a PAGE_SIZE (4096) boundary).
-rw-r--r-- | CHANGELOG | 9 | ||||
-rw-r--r-- | board/csb637/config.mk | 2 | ||||
-rw-r--r-- | cpu/arm920t/at91rm9200/ether.c | 22 |
3 files changed, 18 insertions, 15 deletions
@@ -2,6 +2,15 @@ Changes for U-Boot 1.1.4: ====================================================================== +* Eliminate hard-coded address of Ethernet transfer buffer on at91rm9200 + Patch by Anders Larsen, 07 Oct 2005 + + The Atmel errata #11 states that the transfer buffer descriptor + table must be aligned on a 16-word boundary. As it turned out, this + is insufficient - it seems the table must be aligned on a boundary + at least as large as the table itself (in Linux this is not an + issue - the table is aligned on a PAGE_SIZE (4096) boundary). + * Fixed compilation for ARM when using a (standard) hard-FP toolchain Patch by Anders Larsen, 07 Oct 2005 diff --git a/board/csb637/config.mk b/board/csb637/config.mk index 7e1457d..4c6f631 100644 --- a/board/csb637/config.mk +++ b/board/csb637/config.mk @@ -1 +1 @@ -TEXT_BASE = 0x23fe0000 +TEXT_BASE = 0x23fc0000 diff --git a/cpu/arm920t/at91rm9200/ether.c b/cpu/arm920t/at91rm9200/ether.c index bff95b6..d88517f 100644 --- a/cpu/arm920t/at91rm9200/ether.c +++ b/cpu/arm920t/at91rm9200/ether.c @@ -44,21 +44,19 @@ typedef struct { #define RBF_LOCAL2 (1<<24) #define RBF_LOCAL1 (1<<23) -/* Emac Buffers in last 512KBytes of SDRAM*/ -/* Be careful, buffer size is limited to 512KBytes !!! */ -#define RBF_FRAMEMAX 100 -/*#define RBF_FRAMEMEM 0x200000 */ -#define RBF_FRAMEMEM 0x21F80000 +#define RBF_FRAMEMAX 64 #define RBF_FRAMELEN 0x600 -#define RBF_FRAMEBTD RBF_FRAMEMEM -#define RBF_FRAMEBUF (RBF_FRAMEMEM + RBF_FRAMEMAX*sizeof(rbf_t)) - - #ifdef CONFIG_DRIVER_ETHER #if (CONFIG_COMMANDS & CFG_CMD_NET) +/* alignment as per Errata #11 (64 bytes) is insufficient! */ +rbf_t rbfdt[RBF_FRAMEMAX] __attribute((aligned(512))); +rbf_t *rbfp; + +unsigned char rbf_framebuf[RBF_FRAMEMAX][RBF_FRAMELEN] __attribute((aligned(4))); + /* structure to interface the PHY */ AT91S_PhyOps PhyOps; @@ -153,9 +151,6 @@ UCHAR at91rm9200_EmacWritePhy (AT91PS_EMAC p_mac, } -rbf_t *rbfdt; -rbf_t *rbfp; - int eth_init (bd_t * bd) { int ret; @@ -188,9 +183,8 @@ int eth_init (bd_t * bd) p_mac->EMAC_CFG |= AT91C_EMAC_CSR; /* Clear statistics */ /* Init Ehternet buffers */ - rbfdt = (rbf_t *) RBF_FRAMEBTD; for (i = 0; i < RBF_FRAMEMAX; i++) { - rbfdt[i].addr = RBF_FRAMEBUF + RBF_FRAMELEN * i; + rbfdt[i].addr = rbf_framebuf[i]; rbfdt[i].size = 0; } rbfdt[RBF_FRAMEMAX - 1].addr |= RBF_WRAP; |