From: Wolfgang Denk <wd@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 10:37:11 +0100 [thread overview]
Message-ID: <20110112093711.35C7ACEFAB6@gemini.denx.de> (raw)
In-Reply-To: <4D2D7122.60909@denx.de>
Dear Heiko Schocher,
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?
> >> + 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?
> >> -#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.
> 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.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
People are always a lot more complicated than you think. It's very
important to remember that. - Terry Pratchett, _Truckers_
next prev parent reply other threads:[~2011-01-12 9:37 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 [this message]
2011-01-12 10:00 ` Detlev Zundel
2011-01-12 10:26 ` Heiko Schocher
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=20110112093711.35C7ACEFAB6@gemini.denx.de \
--to=wd@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