From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/4]: arm: Kirkwood: See to it that sent data is 8-byte aligned
Date: Wed, 8 Jul 2009 14:35:25 +0200 [thread overview]
Message-ID: <200907081435.26019.sr@denx.de> (raw)
In-Reply-To: <20090708130542.321f7951@marrow.netinsight.se>
On Wednesday 08 July 2009 13:05:42 Simon Kagstrom 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.
>
> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
> ---
> drivers/net/kirkwood_egiga.c | 26 ++++++++++++++++++++------
> 1 files changed, 20 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/kirkwood_egiga.c b/drivers/net/kirkwood_egiga.c
> index 537343f..24269c1 100644
> --- a/drivers/net/kirkwood_egiga.c
> +++ b/drivers/net/kirkwood_egiga.c
> @@ -481,7 +481,7 @@ static int kwgbe_halt(struct eth_device *dev)
> return 0;
> }
>
> -static int kwgbe_send(struct eth_device *dev, volatile void *dataptr,
> +static int kwgbe_send_aligned(struct eth_device *dev, volatile void
> *dataptr, int datasize)
> {
> struct kwgbe_device *dkwgbe = to_dkwgbe(dev);
> @@ -489,11 +489,6 @@ static int kwgbe_send(struct eth_device *dev, volatile
> void *dataptr, struct kwgbe_txdesc *p_txdesc = dkwgbe->p_txdesc;
> u32 cmd_sts;
>
> - if ((u32) dataptr & 0x07) {
> - printf("Err..(%s) xmit dataptr not 64bit aligned\n",
> - __FUNCTION__);
> - return -1;
> - }
> p_txdesc->cmd_sts = KWGBE_ZERO_PADDING | KWGBE_GEN_CRC;
> p_txdesc->cmd_sts |= KWGBE_TX_FIRST_DESC | KWGBE_TX_LAST_DESC;
> p_txdesc->cmd_sts |= KWGBE_BUFFER_OWNED_BY_DMA;
> @@ -522,6 +517,25 @@ static int kwgbe_send(struct eth_device *dev, volatile
> void *dataptr, return 0;
> }
>
> +static int kwgbe_send(struct eth_device *dev, volatile void *dataptr,
> + int datasize)
> +{
> + static u8 __attribute__((aligned(8))) aligned_buf[9000];
I would prefer to malloc such big area's.
And I second Prafulla's comment, that this should be handled by the upper
network layer.
Thanks.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
next prev parent reply other threads:[~2009-07-08 12:35 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-08 11:01 [U-Boot] [PATCH 0/4]: arm: Kirkwood: Various egiga fixes Simon Kagstrom
2009-07-08 11:02 ` [U-Boot] [PATCH 1/4]: arm: Kirkwood: Set MAC address during registration for kirkwood egiga Simon Kagstrom
2009-07-09 8:49 ` Prafulla Wadaskar
2009-07-10 5:44 ` Ben Warren
2009-07-10 7:24 ` Simon Kagstrom
2009-07-10 8:15 ` Prafulla Wadaskar
2009-07-11 9:27 ` Wolfgang Denk
2009-07-13 8:13 ` Simon Kagstrom
2009-07-17 18:50 ` Wolfgang Denk
2009-07-11 9:25 ` Wolfgang Denk
2009-07-08 11:03 ` [U-Boot] [PATCH 2/4]: arm: Kirkwood: Fix compiler optimization bug for kwgbe_send Simon Kagstrom
2009-07-21 5:40 ` Ben Warren
2009-07-21 5:41 ` Ben Warren
2009-07-08 11:05 ` [U-Boot] [PATCH 3/4]: arm: Kirkwood: Check the error summary bit for error detection Simon Kagstrom
2009-07-21 5:42 ` Ben Warren
2009-07-08 11:05 ` [U-Boot] [PATCH 4/4]: arm: Kirkwood: See to it that sent data is 8-byte aligned Simon Kagstrom
2009-07-08 12:17 ` Prafulla Wadaskar
2009-07-08 12:44 ` Simon Kagstrom
2009-07-08 21:03 ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-08 12:35 ` Stefan Roese [this message]
2009-07-08 13:04 ` Simon Kagstrom
2009-07-21 5:47 ` Ben Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907081435.26019.sr@denx.de \
--to=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox