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: Thu, 12 Aug 2010 17:04:28 +0200 [thread overview]
Message-ID: <m21va3yirn.fsf@ohwell.denx.de> (raw)
In-Reply-To: <1281595974-32279-3-git-send-email-haavard.skinnemoen@atmel.com> (Haavard Skinnemoen's message of "Thu, 12 Aug 2010 13:52:53 +0700")
Hi Haavard,
> 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.
>
> The avr32-specific uncached() macro will return an address which will
> always cause uncached accessed to be made. Since this happens in the
> board code, using avr32-specific features should be ok, and will allow
> the SDRAM initialization to keep working.
>
> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
> ---
> board/atmel/atngw100/atngw100.c | 4 +---
> board/atmel/atstk1000/atstk1000.c | 4 +---
> board/earthlcd/favr-32-ezkit/favr-32-ezkit.c | 4 +---
> board/mimc/mimc200/mimc200.c | 4 +---
> board/miromico/hammerhead/hammerhead.c | 4 +---
> 5 files changed, 5 insertions(+), 15 deletions(-)
>
> diff --git a/board/atmel/atngw100/atngw100.c b/board/atmel/atngw100/atngw100.c
> index 004d8da..4580f55 100644
> --- a/board/atmel/atngw100/atngw100.c
> +++ b/board/atmel/atngw100/atngw100.c
> @@ -75,13 +75,11 @@ phys_size_t initdram(int board_type)
> unsigned long actual_size;
> void *sdram_base;
>
> - sdram_base = map_physmem(EBI_SDRAM_BASE, EBI_SDRAM_SIZE, MAP_NOCACHE);
> + sdram_base = uncached(EBI_SDRAM_BASE);
>
> expected_size = sdram_init(sdram_base, &sdram_config);
> actual_size = get_ram_size(sdram_base, expected_size);
>
> - unmap_physmem(sdram_base, EBI_SDRAM_SIZE);
> -
So this patch replaces a construct which seems to be valid over all
architectures by a construct which is only used in avr32, right? It
also deletes the explicit statement that such a mapping is not needed
any further.
Isn't this a step backward? Can't you put the functionality inside the
map function and leave the unmap a noop?
Cheers
Detlev
--
Man against god... God against Man... Man against nature... Nature against
man... God against nature... Nature against god... a very, very funny
religion. -- Zen Master D.T. Suzuki commenting on Christianity
--
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-12 15:04 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 [this message]
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
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=m21va3yirn.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox