From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] mpc5200, digsy_mtc: add support for rev5 board version
Date: Wed, 12 Jan 2011 11:26:11 +0100 [thread overview]
Message-ID: <4D2D81C3.7010807@denx.de> (raw)
In-Reply-To: <20110112093711.35C7ACEFAB6@gemini.denx.de>
Hello Wolfgang,
Wolfgang Denk wrote:
> In message <4D2D7122.60909@denx.de> you wrote:
>>> Global question: do we really need an CONFIG_DIGSY_REV5? Is there not
>>> a way to determine the revision by probing the hardware? For example,
>>> the RTC's show up at different addresses on the bus - but ther emight
>>> be even easier ways?
>> Good question ... as I know, there is no possibility to detect the
>> hardware on an other way then over the RTC ... and I don;t want to
>> go this way ... what if the RTC is not responding?
>
> Maybe you can ask the hardware guys again?
Ok. done. As Detlev mentioned in the meantime the "LOWBOOT" cases
can be removed, done.
>>>> + for (i = 0; i < 2; i++) {
>>>> + dev = &flash_info[i];
>>>> +
>>>> + if (dev->size) {
>>>> + /* calculate new base addr for this chipselect */
>>>> + base -= dev->size;
>>>> + out_be32(cs_reg, START_REG(base));
>>>> + cs_reg++;
>>>> + out_be32(cs_reg, STOP_REG(base, dev->size));
>>>> + cs_reg++;
>>>> + /* recalculate the sectoraddr in the cfi driver */
>>>> + size += flash_get_size(base, i);
>>>> + }
>>>> + }
>>>> +#if defined(CONFIG_DIGSY_REV5)
>>>> + gd->bd->bi_flashstart = base;
>>>> +#endif
>>> Why is this #if needed? Why not always set bi_flashstart ?
>> It is set in arch/powerpc/lib/board.c before calling update_flash_size(),
>> so this adaption is only needed, if the baseaddr is changing on different
>> flash sizes, what is valid for the rev5 board ...
>
> It may not be needed, but I think it should compute the same result,
> so you should be able to omit the "#if" and the "#endif".
>
> If you should compute a different result, then I'd wonder if the code
> is actually correct?
Yep, you are right, the "#if ... #endif" is not needed here.
>>>> -#endif /* CONFIG_CMD_IDE */
>>> Ah! So this is a bug fix?
>> Yep. Should I seperate this in an extra patch?
>
> At least mention it in the commit message.
Ok, add this to the commit message.
>> Hmm.. I have only one flash on the !rev5 board, so I need this
>> differentiation here, or?
>
> Yes.
>
>> Hmm.. after looking in code, can your proposal work?:
>> Is flash_info[0].size valid, when the cfi driver detects the flash?
>
> For the probing, a temporary address can be used. You set up the
> final mapping only after the sizes are knows, similar to what we do
> when we have several banks of RAM.
But thats exactly what I do with the defines in include/configs/digsy_mtc.h
#define CONFIG_SYS_FLASH_BASE 0xFE000000
#define CONFIG_SYS_FLASH_BASE_CS1 0xFC000000
#define CONFIG_SYS_MAX_FLASH_BANKS 2
#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE_CS1, \
CONFIG_SYS_FLASH_BASE}
and after detecting the real size through the cfi driver on this
temporary addresses, the flash_info gets updated with the new baseaddr
through the call:
int update_flash_size (int flash_size)
[...]
if (dev->size) {
/* calculate new base addr for this chipselect */
base -= dev->size;
[...]
/* recalculate the sectoraddr in the cfi driver */
size += flash_get_size(base, i);
so after that, flash_info has the right values and I update the chip
selects in board specific code ...
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2011-01-12 10:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-12 7:20 [U-Boot] [PATCH 1/2] rtc: add support for Micro Crystal RV-3029-C2 RTC Heiko Schocher
2011-01-12 7:20 ` [U-Boot] [PATCH 2/2] mpc5200, digsy_mtc: add support for rev5 board version Heiko Schocher
2011-01-12 7:59 ` Wolfgang Denk
2011-01-12 9:15 ` Heiko Schocher
2011-01-12 9:37 ` Wolfgang Denk
2011-01-12 10:00 ` Detlev Zundel
2011-01-12 10:26 ` Heiko Schocher [this message]
2011-01-12 13:42 ` Wolfgang Denk
2011-01-12 10:20 ` Detlev Zundel
2011-01-12 13:39 ` Stefan Roese
2011-01-13 7:25 ` [U-Boot] [PATCH 2/2 v2] " Heiko Schocher
2011-01-14 10:42 ` Detlev Zundel
2011-01-18 22:35 ` Wolfgang Denk
2011-01-18 22:35 ` [U-Boot] [PATCH 1/2] rtc: add support for Micro Crystal RV-3029-C2 RTC Wolfgang Denk
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=4D2D81C3.7010807@denx.de \
--to=hs@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