From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] armv7:cache: D cache line size read method
Date: Fri, 12 Aug 2011 11:46:58 +0200 [thread overview]
Message-ID: <20110812114658.3a6e46b8@lmajewski.digital.local> (raw)
In-Reply-To: <4E44EC3C.5010808@ti.com>
Hi Anessh,
On Fri, 12 Aug 2011 14:32:52 +0530
Aneesh V <aneesh@ti.com> wrote:
> > +
> > +int get_dcache_line_size(void)
> > +{
> > + return 0;
> > +}
>
> Does memalign() take 0 as input and if so what is the output. The GNU
> C library seems to mandate only that it's a power of 2. But the
> following man page seems to says that "The value of alignment must be
> a power of two and must be greater than or equal to the size of a
> word."
>
> http://www.s-gms.ms.edus.si/cgi-bin/man-cgi?memalign+3C
Documentation is one thing, and I was initially planning to return 8
when the CONFIG_DCACHE_OFF is defined (when dcache is disabled).
But then I've looked in the implementation of this function
(common/dlmalloc.c) and discover, that it's smallest alignment is 8
bytes. When number passed to memalign is smaller than 8, then anyway
the alignment is set to this default value.
On the other hand I've realized than it is more natural to return 0
than 8, and assumed that this will not harm the current implementation.
For the sake of documentation conformance, the value of 8 shall be
returned in this case.
>
> Also, you seem to be using get_dcache_line_size() in MMC driver. Is
> this function defined for all platforms. Maybe, you must implement a
> weakly linked default function for all platforms?
>
> best regards,
> Aneesh
Yes, you are right, now the get_dcache_line_size() is defined in the
arch/arm/cpu/armv7/cache_v7.c, so other boards will be broken.
Next version will use the weakly linked default function.
--
Best regards,
Lukasz Majewski
Samsung Poland R&D Center
Platform Group
next prev parent reply other threads:[~2011-08-12 9:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-12 8:24 [U-Boot] [PATCH] armv7:cache: D cache line size read method Lukasz Majewski
2011-08-12 8:58 ` Albert ARIBAUD
2011-08-12 9:16 ` Aneesh V
2011-08-12 9:48 ` Albert ARIBAUD
2011-08-16 18:32 ` Anton Staaf
2011-08-12 9:02 ` Aneesh V
2011-08-12 9:46 ` Lukasz Majewski [this message]
2011-08-16 10:31 ` [U-Boot] [PATCH v2] " Lukasz Majewski
2011-08-16 11:24 ` Sergei Shtylyov
2011-08-16 12:01 ` [U-Boot] [RESEND PATCH " Lukasz Majewski
2011-08-17 8:51 ` [U-Boot] [PATCH v3] " Lukasz Majewski
2011-08-17 16:28 ` Albert ARIBAUD
2011-08-18 6:46 ` [U-Boot] [RESEND PATCH " Lukasz Majewski
2011-08-23 6:13 ` [U-Boot] [PATCH v4] dcache: " Lukasz Majewski
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=20110812114658.3a6e46b8@lmajewski.digital.local \
--to=l.majewski@samsung.com \
--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