From: Simon Kagstrom Date: Wed, 8 Jul 2009 14:44:39 +0200 Subject: [U-Boot] [PATCH 4/4]: arm: Kirkwood: See to it that sent data is 8-byte aligned In-Reply-To: <73173D32E9439E4ABB5151606C3E19E202DD54DE20@SC-VEXCH1.marvell.com> References: <20090708130542.321f7951@marrow.netinsight.se> <73173D32E9439E4ABB5151606C3E19E202DD54DE20@SC-VEXCH1.marvell.com> Message-ID: <20090708144439.4f7e3331@marrow.netinsight.se> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 8 Jul 2009 05:17:08 -0700 Prafulla Wadaskar wrote: > > U-boot might use non-8-byte-aligned addresses for sending > > data, which the kwgbe_send doesn't accept (bootp does this > > for me). This patch copies the data to be sent to a temporary > > buffer if it is non-aligned. > Kirkwood egiga driver may not be the only client for this kind of requirements. Any Ethernet controller using DMA will require aligned data pointer. > I would suggest either upper layers should pass the aligned buffer pointers > Or > this patch should go in net/ethic, so that other drivers can benefit Well, I've looked around a bit and other drivers also handle it this way - see greth.c for example. I agree that it would be nice to handle it at an upper layer, but that would require a good code review to find the potential places where this problem could occur. I feel I'm a bit too U-boot green to do that as of now :-) I'll submit a new patch with this malloc'ed though. // Simon