From: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] atngw100: Use virtual address in CONFIG_ENV_ADDR
Date: Sun, 30 Aug 2009 17:36:40 +0200 [thread overview]
Message-ID: <20090830173640.2af9ce3c@siona> (raw)
In-Reply-To: <C93C19B9-5220-4917-8D62-CC54A0795D0B@freescale.com>
On Fri, 28 Aug 2009 14:58:15 -0500
Becky Bruce <becky.bruce@freescale.com> wrote:
> FYI, before the patch, the CFI driver was sometimes doing the map,
> but IIRC it was also abusing the "physical" address, treating it as
> a virtual address without mapping it.
In that case, those places should have been fixed, no?
> The only way for that to work
> is when VA=PA (or, depending on what you were doing with the address,
> you just got lucky). The CFI driver was the outlier - all the other
> flash code was treating the start field as a VA already. So I don't
> think just reverting the patch is the answer.
Except for everything _outside_ the flash code which still deals with
physical addresses, like the environment stuff and JFFS2. The flash
code takes those addresses and compares them with the virtual addresses
in the start array, and things break.
> > So...which config symbols are supposed to be virtual now, and how
> > are you supposed to know how the virtual-to-physical mappings are
> > set up in
> > advance?
>
> Everything is treated as virtual unless it's being used for hardware
> setup.
Exactly what constitutes "hardware setup"?
> If you use something to do memory accesses, it's virtual.
Yes, but then the address should also be in a pointer, not an unsigned
long which the flash 'start' array is.
> A
> lot of code had been just using the PA as a VA, because things were
> always mapped 1-1.
Yes, there's lots of code which is broken in that respect...
> Can you point me at an example in your scenario of code that
> interacts with the flash?
CONFIG_ENV_ADDR is used to store the environment in CFI flash. Reading
the environment works OK-ish since the flash is accessible through a
cacheable 1:1 mapping from virtual/physical address 0. However, when
writing and erasing, the physical address stored in CONFIG_ENV_ADDR
appears to be outside of the virtual sector addresses stored in the
'start' array, so the flash code throws an error.
There are basically two ways to fix it: Either go back to using
physical addresses in the flash API, or make CONFIG_ENV_ADDR virtual
(and from what I hear, the jffs2 code needs a similar fix.) This patch
does the latter, but it seems like it doesn't fix things
completely, and Wolfgang didn't appear very happy about it.
Haavard
next prev parent reply other threads:[~2009-08-30 15:36 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-28 8:42 [U-Boot] [PATCH] atngw100: Use virtual address in CONFIG_ENV_ADDR Haavard Skinnemoen
2009-08-28 9:16 ` Mark Jackson
2009-08-28 9:34 ` Haavard Skinnemoen
2009-08-28 10:16 ` Mark Jackson
2009-08-28 10:27 ` Haavard Skinnemoen
2009-08-28 10:35 ` Mark Jackson
2009-08-28 11:58 ` Wolfgang Denk
2009-08-28 11:56 ` Wolfgang Denk
2009-08-28 12:14 ` Haavard Skinnemoen
2009-08-28 13:42 ` Kumar Gala
2009-08-28 13:49 ` Haavard Skinnemoen
2009-08-28 19:58 ` Becky Bruce
2009-08-29 11:39 ` Stefan Roese
2009-08-30 15:52 ` Haavard Skinnemoen
2009-08-30 15:36 ` Haavard Skinnemoen [this message]
2009-08-30 18:11 ` Wolfgang Denk
2009-08-30 20:42 ` Haavard Skinnemoen
2009-08-31 11:57 ` Wolfgang Denk
2009-08-31 13:53 ` Haavard Skinnemoen
2009-08-31 17:46 ` Wolfgang Denk
2009-09-01 8:57 ` Haavard Skinnemoen
2009-09-01 9:16 ` Stefan Roese
2009-09-01 10:18 ` Haavard Skinnemoen
2009-09-01 9:47 ` Wolfgang Denk
2009-09-01 10:38 ` Haavard Skinnemoen
2009-09-01 11:05 ` Wolfgang Denk
2009-09-01 11:42 ` Haavard Skinnemoen
2009-09-01 13:04 ` Wolfgang Denk
2009-09-01 13:23 ` Haavard Skinnemoen
2009-09-01 13:47 ` Wolfgang Denk
2009-09-01 13:52 ` Haavard Skinnemoen
2009-09-01 14:49 ` Thiago A. Corrêa
2009-09-01 15:20 ` Haavard Skinnemoen
2009-09-01 15:56 ` Mark Jackson
2009-09-01 17:50 ` [U-Boot] Virtual addresses, u-boot, and the MMU J. William Campbell
2009-09-01 19:21 ` Wolfgang Denk
2009-09-01 22:01 ` J. William Campbell
2009-09-02 7:59 ` Wolfgang Denk
2009-09-03 16:09 ` Becky Bruce
2009-09-03 17:25 ` J. William Campbell
2009-09-03 17:32 ` Andrew Dyer
2009-09-04 8:34 ` Mark Jackson
2009-09-04 8:58 ` Haavard Skinnemoen
2009-09-04 8:44 ` Haavard Skinnemoen
2009-08-31 20:05 ` [U-Boot] [PATCH] atngw100: Use virtual address in CONFIG_ENV_ADDR Becky Bruce
2009-09-01 9:15 ` Haavard Skinnemoen
2009-08-31 19:17 ` Becky Bruce
2009-09-01 10:15 ` Haavard Skinnemoen
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=20090830173640.2af9ce3c@siona \
--to=haavard.skinnemoen@atmel.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