[PATCH v2 0/5] ARM: add support for Zynq

Josh Cartwright joshc at eso.teric.us
Tue Mar 19 08:59:27 EDT 2013


On Tue, Mar 19, 2013 at 10:21:55AM +0100, Steffen Trumtrar wrote:
> Hi!
> 
> Still nothing fancy. Boots a little faster from SD and has a console.
> For ethernet the macb-driver works fine,

I've also found the macb driver works, but it does require a change to
prevent byteswapping during DMA, have you run into this on the ZedBoard?
(patch below).

Also, have you thought about how you'll handle the OCM mapping?  For my
testing, I'm using a PBL image (which contains the lowlevel init), but I
still need some hook into the decompressed image to remove the OCM
mapping from the lower address space.  This can't be done during the
execution of the PBL image, since it's running from OCM.

As far as I could tell, there was no good way to hook in early to the
decompressed image.

I ran into this trying to boot the 14.4 release uImage, since it has a
load address of 0x8000, and spans the 'hole' at 0x30000 configured out
of BootROM to be 'Reserved' (writes to here trigger a Data Abort).

> but needs to be "freed" from its at91 heritage (meaning: the struct
> at91_ether_platform_data should be renamed first and defined someplace
> else than a board.h)

I'm assuming you've done this, but if not, I've made this change in my
tree.  For what it's worth, I went with 'struct macb_platform_data' and
moved it into include/platform_data/macb.h.

>
> Changelog:
> 	- addressed all comments by Sascha and Josh
> 	  (some uart stuff, defines, endianess, ...)
> 	- squashed a little
> 
> Regards,
> Steffen

-- 8< --
Subject: [PATCH] macb: disable byte-order translation through DMA

Packet data already exists in memory in network byte-order.  Prevent the
GEM from performing endianness translation through DMA.

Signed-off-by: Josh Cartwright <joshc at eso.teric.us>
---
 drivers/net/macb.c | 1 +
 drivers/net/macb.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 14a0689..25d1b9f 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -307,6 +307,7 @@ static void macb_configure_dma(struct macb_device *bp)
 		dmacfg |= GEM_BF(FBLDO, 16);
 		dmacfg |= GEM_BIT(TXPBMS) | GEM_BF(RXBMS, -1L);
 		dmacfg |= GEM_BIT(DDRP);
+		dmacfg &= ~GEM_BIT(ENDIAN);
 		gem_writel(bp, DMACFG, dmacfg);
 	}
 }
diff --git a/drivers/net/macb.h b/drivers/net/macb.h
index cadd561..fc4d1a9 100644
--- a/drivers/net/macb.h
+++ b/drivers/net/macb.h
@@ -168,6 +168,8 @@
 /* Bitfields in DMACFG. */
 #define GEM_FBLDO_OFFSET			0
 #define GEM_FBLDO_SIZE				5
+#define GEM_ENDIAN_OFFSET			7
+#define GEM_ENDIAN_SIZE				1
 #define GEM_RXBMS_OFFSET			8
 #define GEM_RXBMS_SIZE				2
 #define GEM_TXPBMS_OFFSET			10
-- 
1.8.1.5




More information about the barebox mailing list