From: Aaron Williams <Aaron.Williams@cavium.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 19/21] Use uintptr_t for 32/64-bit compatibility
Date: Mon, 10 Oct 2011 19:46:10 -0700 [thread overview]
Message-ID: <201110101946.10971.Aaron.Williams@cavium.com> (raw)
In-Reply-To: <201110092254.51554.vapier@gentoo.org>
Our OCTEON platform is a 64-bit SOC and we run it in the MIPS N32 ABI mode
(64-bit registers, 32-bit address space). In our case we use virtual memory so
we can move U-Boot to the top of memory which is often above 4GB. The only
changes we had to make to U-Boot was that drivers need to use the proper
mapping functions and support 64-bit physical addresses. Generally the
hardware devices support this and the driver changes have been minimal. Some
of our boards have over 8GB of RAM installed and 4GB is common for us. With
the hole we create for our boot bus (flash, etc.) that means that in many
cases U-Boot is loaded above the 32-bit boundary. By using a couple of TLB
entries on MIPS we always map U-Boot to 0xC0000000 no matter where it is
executing from. While a 64-bit U-Boot would be nice, we don't really need it
since the TLB solves all of our issues. I would rather see drivers better make
use of the proper mapping functions and support 64-bit physical addresses as
well as use wrappers for accessing the PCI register space. (in our case all of
our SOC registers require 64-bit addresses).
-Aaron
On Sunday, October 09, 2011 07:54:50 PM Mike Frysinger wrote:
> On Tuesday 04 October 2011 01:24:56 Simon Glass wrote:
> > On Mon, Oct 3, 2011 at 11:57 AM, Mike Frysinger wrote:
> > > On Monday, September 26, 2011 20:10:53 Simon Glass wrote:
> > >> --- a/common/cmd_mem.c
> > >> +++ b/common/cmd_mem.c
> > >>
> > >> printf ("\nMem error @ 0x%08X: "
> > >>
> > >> "found %08lX, expected %08lX\n",
> > >>
> > >> - (uint)addr, readback, val);
> > >> + (uint)(uintptr_t)addr, readback,
> > >> val);
> > >
> > > could you change the printf format to %#p instead (and drop the casts
> > > completely for "addr") ?
> >
> > Well it's not complete clear where we want to go with this. My current
> > thinking is that the emulated memory will be small (in 2011 terms) -
> > maybe 128MB. The real memory of the machine is not accessible since it
> > doesn't make sense. So perhaps just because the host happens to be a
> > 64-bit machine we don't suddenly want to be printing 64-bit addresses.
> >
> > So the answer is 'yes' but for now I'm not sure that's the right thing
> > to do. I have another patch which enables 'md', etc. but of course
> > only within the 128MB 'emulated' memory area.
> >
> > It actually brings up a question - does U-Boot run on 64-machines?
>
> i don't believe u-boot runs on any 64bit system (or at least, in 64bit
> mode). there's quite a lot of random assumptions all over the tree where
> pointers are stored in 32bits, so for making sandbox work on 64bit stuff,
> i would focus on making stuff work with minimal intrusion for 32bit
> systems.
>
> although thinking about this a bit more, %p will not zero pad its output (i
> think even if you specify like "08" it'll get ignored). but maybe people
> don't care as normally this output shouldn't occur ?
> -mike
--
Aaron Williams <Aaron.Williams@cavium.com>
(408) 943-7198
next prev parent reply other threads:[~2011-10-11 2:46 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 0:10 [U-Boot] [PATCH v3 0/21] New 'sandbox' test architecture for U-Boot Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 01/21] sandbox: Add architecture header files Simon Glass
2011-10-03 5:56 ` Mike Frysinger
2011-10-04 0:10 ` Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 02/21] Fix use of int as pointer in image.c Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 03/21] sandbox: Add architecture image support Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 04/21] sandbox: Add compiler defines to support a 64-bit x86_64 platform Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 05/21] sandbox: Add cpu files Simon Glass
2011-10-03 6:10 ` Mike Frysinger
2011-10-03 19:25 ` Mike Frysinger
2011-09-27 0:10 ` [U-Boot] [PATCH v3 06/21] sandbox: Add architecture lib files Simon Glass
2011-10-03 6:15 ` Mike Frysinger
2011-10-04 0:02 ` Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 07/21] sandbox: Add sandbox board Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 08/21] sandbox: Add board info for architecture Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 09/21] sandbox: Add bootm support Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 10/21] sandbox: Disable built-in malloc Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 11/21] sandbox: Disable standalone/API support Simon Glass
2011-10-03 19:37 ` Mike Frysinger
2011-10-04 0:13 ` Simon Glass
2011-10-04 0:40 ` Mike Frysinger
2011-10-04 0:54 ` Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 12/21] sandbox: Force command sections to be 4-byte aligned Simon Glass
2011-10-03 19:34 ` Mike Frysinger
2011-10-04 0:05 ` Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 13/21] sandbox: Add OS dependent layer Simon Glass
2011-10-03 19:27 ` Mike Frysinger
2011-10-03 23:44 ` Simon Glass
2011-10-03 23:49 ` Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 14/21] sandbox: Add board_init() Simon Glass
2011-10-03 19:33 ` Mike Frysinger
2011-10-04 0:17 ` Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 15/21] sandbox: Add main program Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 16/21] sandbox: Add serial uart Simon Glass
2011-10-03 19:42 ` Mike Frysinger
2011-10-04 0:21 ` Simon Glass
2011-10-04 1:10 ` Mike Frysinger
2011-09-27 0:10 ` [U-Boot] [PATCH v3 17/21] sandbox: Add basic config file Simon Glass
2011-10-03 19:42 ` Mike Frysinger
2011-10-04 0:23 ` Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 18/21] Remove unused variable warnings in cmd_mem, cmd_nvedit Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 19/21] Use uintptr_t for 32/64-bit compatibility Simon Glass
2011-10-03 18:57 ` Mike Frysinger
2011-10-04 5:24 ` Simon Glass
2011-10-10 2:54 ` Mike Frysinger
2011-10-10 3:49 ` Simon Glass
2011-10-11 2:46 ` Aaron Williams [this message]
2011-10-11 4:52 ` Mike Frysinger
2011-10-11 5:41 ` Aaron Williams
2011-10-14 4:18 ` Mike Frysinger
2011-09-27 0:10 ` [U-Boot] [PATCH v3 20/21] Adjust dependency rules to permit per-file flags Simon Glass
2011-10-04 1:10 ` Simon Glass
2011-10-10 2:50 ` Mike Frysinger
2011-10-10 3:45 ` Simon Glass
2011-09-27 0:10 ` [U-Boot] [PATCH v3 21/21] sandbox: Makefile changes to build sandbox architecture Simon Glass
2011-10-03 19:31 ` Mike Frysinger
2011-10-04 0:51 ` Simon Glass
2011-10-04 1:05 ` Mike Frysinger
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=201110101946.10971.Aaron.Williams@cavium.com \
--to=aaron.williams@cavium.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