From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 3/5] OneNAND support
Date: Mon, 10 Sep 2007 09:06:55 +0200 [thread overview]
Message-ID: <20070910070655.4553D247CE@gemini.denx.de> (raw)
In-Reply-To: Your message of "Mon, 10 Sep 2007 10:14:01 +0900." <002501c7f347$e1d579c0$e1ac580a@swcenter.sec.samsung.co.kr>
In message <002501c7f347$e1d579c0$e1ac580a@swcenter.sec.samsung.co.kr> you wrote:
> > ...
> > > +#ifdef __ARM__
> > > +extern void memcpy32(void *, void *, size_t);
> > > +
> > > +static void *memcpy(void *dest, const void *src, size_t count)
> > > +{
> > > + if (count < 32) {
> > > + unsigned short *_s = (unsigned short *)(src);
> > > + unsigned short *_d = (unsigned short *)(dest);
> > > + count >>= 1;
> > > + while (count--)
> > > + *_d++ = *_s++;
> > > + return _d;
> > > + }
> > > +
> > > + memcpy32(dest, (void *)src, count);
> > > +
> > > + return (void *)count;
> > > +}
> > > +#endif
> >
> > Why exactly do we need this? And why do we need an additonal special
> > function memcpy32?
>
> It's for performance. Now ARM used the char-based memcpy. Even though it's working with current char-based memcpy, I want to use the
> optimized memcpy.
How much difference does this optimization make in real life? Do you
have any time measurements at hand?
I'm concerned about correctness. What happens in your coide when I
write
memcpy (dst, src, 5);
How many bytes will be copied?
What happens when src or dst or both are pointing to odd addresses,
i. e. in case of unaligned accesses?
> And basically OneNAND uses the 16-bit buswidth so we don't sure the correct behavior in OneNAND BufferRAM if we use the char-based
> memcpy.
I remember that ARM is terribly broken there... :-(
> Memcpy32 is 32-bytes aligned optimized. Since we know the memcpy usages in OneNAND driver, we guarantee the usage of memcpy32.
But the memcpy() you provide will also be used in all other partrs of
U-Boot, won't it?
> > Using a dynamic buffer and a memset() call in the init code may helpt
> > to reduce the memory footprint. What do you think?
>
> At first I want to sync between the linux OneNAND code and u-boot one.
> The current code of u-boot patch is the first implementation of linux OneNAND.
> There are a lot of works to sync.
> So after committing of patches, I will modify it.
Agreed.
> Also others are same. Some functions are don't needed at u-boot. But it was remained for easy adaptation from linux to u-boot.
Understood and agreed.
> Thank you,
Thank *you*.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Deliver yesterday, code today, think tomorrow."
next prev parent reply other threads:[~2007-09-10 7:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-07 0:59 [U-Boot-Users] [PATCH 3/5] OneNAND support Kyungmin Park
2007-09-08 23:02 ` Wolfgang Denk
2007-09-10 1:14 ` Kyungmin Park
2007-09-10 7:06 ` Wolfgang Denk [this message]
2007-09-10 7:49 ` Kyungmin Park
2007-09-10 20:18 ` Wolfgang Denk
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=20070910070655.4553D247CE@gemini.denx.de \
--to=wd@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