From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/3] avr32: Use uncached() macro to get an address for SDRAM init
Date: Fri, 13 Aug 2010 15:01:29 +0200 [thread overview]
Message-ID: <m21va2wtsm.fsf@ohwell.denx.de> (raw)
In-Reply-To: <20100813191241.7b9b9061@hskinnemoen-d830> (Haavard Skinnemoen's message of "Fri, 13 Aug 2010 19:12:41 +0700")
Hi Haavard,
> Detlev Zundel <dzu@denx.de> wrote:
>> > Problem is that in order to make the CFI driver work on avr32, we need
>> > to change the map_physmem() macro to return the physical address
>> > unchanged.
>>
>> I see. And I presume you cannot tell the situation apart inside
>> map_physmem?
>
> I don't think so. How do you propose we do that?
I don't know, that's why I'm asking.
Let's take a step back and please excuse my ignorant question - why
exactly does the CFI driver need the physical address unchanged? Isn't
the real constraint that the address requested by CFI is uncached? Why
can't this be done by map_physmem()?
>> > The map_physmem() macro currently does exactly the same thing as the
>> > uncached() macro, and the unmap is a noop, but the next patch changes
>> > it in order to fix the CFI driver. If the next patch is applied without
>> > this patch being applied first, the SDRAM driver will do cached
>> > accesses during initialization, and that may cause the initialization
>> > to fail.
>>
>> Why not include a note to this extent into the git commit message? This
>> would be a great help for other people to later understand why this
>> change has been done the "backward way" that it was.
>
> The commit message already contains this:
>
> The paging system which is required to set up caching properties has not
> yet been initialized when the SDRAM is initialized. So when the
> map_physmem() function is converted to return the physical address
> unchanged, the SDRAM initialization will break on some boards.
>
> which is essentially the same thing, isn't it?
For me this is not the same - it does not include a word why the change
which you agree "looks backward" is something that we want to do. For
me something like this would give me more information:
Unfortunately we cannot make "map_physmem()/unmap_physmem()" on the
AVR32 platform work with the CFI driver as it works on other
platforms. [I don't understand why this is the case, so your
explanation would go here ;) ] To still fix the issue we deliberately
replace these generic routines by AVR32 specific routines. If someone
can fix this using the generic patterns, patches are welcome.
I believe that good docmumentation should include such pro- and con
reasoning so that code changes can be comprehended even after the fact.
Cheers
Detlev
--
Emacs seems a more likely candidate to contain a mail system than the
mail system to contain an Emacs, so this is the way it was done.
-- Bernard S. Greenberg
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
next prev parent reply other threads:[~2010-08-13 13:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-12 6:52 [U-Boot] [PATCH v2 0/3] avr32: simple paging support Haavard Skinnemoen
2010-08-12 6:52 ` [U-Boot] [PATCH v2 1/3] avr32: Print unrelocated PC on exception Haavard Skinnemoen
2010-09-03 11:51 ` Reinhard Meyer
2010-09-03 13:19 ` Andreas Bießmann
2010-09-03 14:37 ` Reinhard Meyer
2010-08-12 6:52 ` [U-Boot] [PATCH v2 2/3] avr32: Use uncached() macro to get an address for SDRAM init Haavard Skinnemoen
2010-08-12 15:04 ` Detlev Zundel
2010-08-13 3:56 ` Haavard Skinnemoen
2010-08-13 11:01 ` Detlev Zundel
2010-08-13 12:12 ` Haavard Skinnemoen
2010-08-13 13:01 ` Detlev Zundel [this message]
2010-09-03 11:16 ` Andreas Bießmann
2010-09-03 14:37 ` Reinhard Meyer
2010-08-12 6:52 ` [U-Boot] [PATCH v2 3/3] avr32: Add simple paging support Haavard Skinnemoen
2010-09-03 11:10 ` Andreas Bießmann
2010-09-03 14:38 ` Reinhard Meyer
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=m21va2wtsm.fsf@ohwell.denx.de \
--to=dzu@denx.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.