public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/9] ARM: cache-cp15: Use unsigned long for address and size
Date: Fri, 22 Aug 2014 10:29:32 +0200	[thread overview]
Message-ID: <20140822082931.GB24156@ulmo> (raw)
In-Reply-To: <53F4F3C3.4000809@wwwdotorg.org>

On Wed, Aug 20, 2014 at 01:15:15PM -0600, Stephen Warren wrote:
> On 08/18/2014 02:00 AM, Thierry Reding wrote:
> >From: Thierry Reding <treding@nvidia.com>
> >
> >size is always non-negative, so it should be unsigned, whereas the
> >address and size can be larger than 32 bit on 64-bit architectures.
> >Change the mmu_set_region_dcache_behaviour() to use these types in
> >anticipation of making the API available on other architectures.
> 
> >diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
> 
> >-void mmu_set_region_dcache_behaviour(u32 start, int size,
> >+void mmu_set_region_dcache_behaviour(unsigned long start, unsigned long size,
> >  				     enum dcache_option option);
> 
> If we were to use LPAE on a 32-bit system, physical addresses could be more
> than 32-bit. That would imply we should create a physaddr_t type rather than
> relying on unsigned long. Still, I suppose since U-Boot just maps RAM (and
> everything else) 1:1, we'd never use RAM beyond 4GiB, so LPAE actually isn't
> that interesting...

Interestingly there is already a phys_addr_t type defined (as opposed to
Linux it's defined in arch/*/include/asm/types.h). It doesn't currently
take into account things like LPAE, but then again there's no standard
configuration option to select that (Linux has CONFIG_PHYS_ADDR_T_64BIT
for this). CONFIG_PHYS_64BIT seems to come close, but it's currently
only defined by true 64-bit architectures.

I took a stab at unifying the various definitions in linux/types.h, but
that resulted in all kinds of weird build errors all over the place, so
at some point I gave up and kept the definitions as they are. Still, for
this series I've tried to use the existing phys_addr_t where appropriate
so it should just be a matter of properly redefining in for LPAE if
support for it ever gets added.

I've refrained from using phys_size_t since I don't see why it would be
useful and instead used size_t consistently where a size is involved. If
anyone feels strongly about using phys_size_t I can use it instead,
though.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140822/f581a37f/attachment.pgp>

  reply	other threads:[~2014-08-22  8:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-18  8:00 [U-Boot] [PATCH 0/9] net: rtl8169: Fix cache maintenance issues Thierry Reding
2014-08-18  8:00 ` [U-Boot] [PATCH 1/9] ARM: cache_v7: Various minor cleanups Thierry Reding
2014-08-18  8:00 ` [U-Boot] [PATCH 2/9] ARM: cache-cp15: Use unsigned long for address and size Thierry Reding
2014-08-20 19:15   ` Stephen Warren
2014-08-22  8:29     ` Thierry Reding [this message]
2014-08-18  8:00 ` [U-Boot] [PATCH 3/9] malloc: Output region when debugging Thierry Reding
2014-08-18  8:00 ` [U-Boot] [PATCH 4/9] ARM: Implement non-cached memory support Thierry Reding
2014-08-20 19:23   ` Stephen Warren
2014-08-21 15:31     ` Thierry Reding
2014-08-22  8:31     ` Thierry Reding
2014-08-18  8:00 ` [U-Boot] [PATCH 5/9] ARM: tegra: Enable non-cached memory Thierry Reding
2014-08-20 19:24   ` Stephen Warren
2014-08-18  8:00 ` [U-Boot] [PATCH 6/9] net: rtl8169: Honor CONFIG_SYS_RX_ETH_BUFFER Thierry Reding
2014-08-18  8:00 ` [U-Boot] [PATCH 7/9] net: rtl8169: Properly align buffers Thierry Reding
2014-08-20 19:29   ` Stephen Warren
2014-08-22  9:15     ` Thierry Reding
2014-11-12 16:23       ` Simon Glass
2014-11-12 23:38         ` Nobuhiro Iwamatsu
2014-11-13  1:22           ` Simon Glass
2014-08-18  8:00 ` [U-Boot] [PATCH 8/9] net: rtl8169: Use non-cached memory if available Thierry Reding
2014-08-20 19:33   ` Stephen Warren
2014-08-22  9:29     ` Thierry Reding
2014-08-18  8:00 ` [U-Boot] [PATCH 9/9] net: rtl8169: Add support for RTL-8168/8111g Thierry Reding
2014-08-20 19:12 ` [U-Boot] [PATCH 0/9] net: rtl8169: Fix cache maintenance issues Stephen Warren
2014-08-21 14:11   ` Thierry Reding

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=20140822082931.GB24156@ulmo \
    --to=thierry.reding@gmail.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