From: Simon Horman <horms@verge.net.au>
To: linux-sh@vger.kernel.org
Subject: Re: [RFC] sh: Take into account the base of physical memory in
Date: Sat, 17 Sep 2011 08:11:36 +0000 [thread overview]
Message-ID: <20110917081129.GB22218@verge.net.au> (raw)
In-Reply-To: <1316085179-4207-1-git-send-email-horms@verge.net.au>
On Fri, Sep 16, 2011 at 07:59:21PM +0900, Magnus Damm wrote:
> On Thu, Sep 15, 2011 at 8:12 PM, Simon Horman <horms@verge.net.au> wrote:
> > Previously virt_to_phys() assumed that physical memory always started
> > at address 0. This is not always the case.
>
> I think most boards have NOR Flash or ROM mapped at physical address 0.
>
> For more information please have a look at: arch/sh/boards/mach-ecovec24/setup.c
>
> > --- a/kexec/arch/sh/kexec-sh.c
> > +++ b/kexec/arch/sh/kexec-sh.c
> > @@ -188,10 +188,18 @@ void kexec_sh_setup_zero_page(char *zero_page_buf, size_t zero_page_size,
> > unsigned long virt_to_phys(unsigned long addr)
> > {
> > unsigned long seg = addr & 0xe0000000;
> > + unsigned long long start, end;
> > + int ret;
> > +
> > + /* Assume there is only one "System RAM" region */
> > + ret = parse_iomem_single("System RAM\n", &start, &end);
> > + if (ret)
> > + die("Could not parse System RAM region in /proc/iomem\n");
> > +
> > if (seg != 0x80000000 && seg != 0xc0000000)
> > die("Virtual address %p is not in P1 or P2\n", (void *)addr);
> >
> > - return addr - seg;
> > + return addr - seg + start;
> > }
>
> This will most likely also change how 29-bit platforms translate their
> addresses, not sure if that's what you want to do.
I am also unsure about the 29bit case. Do you have any thoughts on
what a good approach might look like?
next prev parent reply other threads:[~2011-09-17 8:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-15 11:12 [RFC] sh: Take into account the base of physical memory in virt_to_phys() Simon Horman
2011-09-16 10:59 ` Magnus Damm
2011-09-17 8:11 ` Simon Horman [this message]
2011-09-20 4:44 ` Nobuhiro Iwamatsu
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=20110917081129.GB22218@verge.net.au \
--to=horms@verge.net.au \
--cc=linux-sh@vger.kernel.org \
/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