From: Arnd Bergmann <arnd@arndb.de>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>,
"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: Booting bcm47xx (bcma & stuff), sharing code with bcm53xx
Date: Mon, 01 Sep 2014 16:57:18 +0200 [thread overview]
Message-ID: <4072992.6HB7sP7z87@wuerfel> (raw)
In-Reply-To: <CACna6rwMovK133ZoFYsLcsnH39umU7=UAoyG6jmgM8ZVq0AYRA@mail.gmail.com>
On Monday 01 September 2014 09:48:48 Rafał Miłecki wrote:
> On 31 August 2014 11:20, Rafał Miłecki <zajec5@gmail.com> wrote:
> > On 29 August 2014 22:04, Arnd Bergmann <arnd@arndb.de> wrote:
> >> You mentioned that the 'boot_device' variable in your code snippet
> >> comes from a hardware register that can be accessed easily, right?
> >> A possible way to handle it would then be to have two DT entries
> >> like
> >>
> >> nvram@1c000000 {
> >> compatible = "bcm,bcm4710-nvram";
> >> reg = <0x1c000000 0x1000000>;
> >> bcm,boot-device = BCMA_BOOT_DEV_NAND;
> >> };
> >>
> >> nvram@1c000000 {
> >> compatible = "bcm,bcm4710-nvram";
> >> reg = <0x1e000000 0x1000000>;
> >> bcm,boot-device = BCMA_BOOT_DEV_SERIAL;
> >> };
> >
> > This sounds like a nice consensus for me! Actually it seems to be
> > similar to what we already do for other hardware parts.
> >
> > E.g. in bcm4708.dtsi Hauke put registers location of 4 Ethernet cores
> > (gmac@0, gmac@1, gmac@2, gmac@3). I believe this board is ready for 4
> > Ethernet cores so DT matches hardware capabilities. Then most vendors
> > use/activate only one (maybe up to 2?) Ethernet cores. It's up to the
> > driver to detect if core is activated/used.
Actually we normally list in the board-specific dts file which ones
are available on a particular machine.
> > AFAIU having two flash mappings (as suggested above) would follow this
> > logic. It would match hardware capabilities. And then it would be up
> > to driver to detect which one mapping is really in use for this
> > particular board.
> >
> > Does it make sense?
I mainly showed the example above for how it could be done, not saying
it's my preferred way. I think both Hauke and I said it would be betted
to do it explicitly in the dts file using the 'status="disabled"' property
instead of the 'brcm,boot-device = BCMA_BOOT_DEV_NAND' property.
For me this is mainly a question of whether we need a per-board
dts file or not. Hauke said he thinks we do need it, and (without
knowing anything about the platform), I would assume the same. If
we did not need that, and the nvram location was in fact the only
think we need to know, then the autoconfiguration based on the
brcm,boot-device property would become much more attractive.
> I've just realized something. When Broadcom's code reads NVRAM content
> it uses "hndnand_checkbadb" to skip bad blocks. It seems NVRAM doesn't
> lay in 100% reliable flash sectors.
>
> Above function comes from shared/ which (the directory) provides tons
> of low level stuff without using any kernel API. OFC it won't be
> acceptable for us to implement low level NAND stuff in the nvram
> driver (this would mean duplicating NAND driver code). It seems we
> won't be able to use NAND flash mapping to the memory (this magic
> 0x1c000000) at all...
Hmm
> So I think we'll need to change our vision of flash access in
> bcm74xx_nvram driver. I guess we will have to:
> 1) Register NAND core early
> 2) Initialize NAND driver
> 3) Use mtd/nand API in bcm47xx_nvram
This would mean it's available really late. Is that a problem?
A possible solution for this would be to use the boot wrapper
I mentioned earlier, to put all the data from nvram into DT
properties before the kernel gets started.
Arnd
next prev parent reply other threads:[~2014-09-01 14:57 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-26 16:42 Booting bcm47xx (bcma & stuff), sharing code with bcm53xx Rafał Miłecki
2014-08-26 20:32 ` Hauke Mehrtens
2014-08-26 21:14 ` Arend van Spriel
2014-08-27 6:07 ` Rafał Miłecki
2014-08-28 10:13 ` Arnd Bergmann
2014-08-28 10:47 ` Rafał Miłecki
2014-08-28 11:02 ` Arnd Bergmann
2014-08-28 11:39 ` Rafał Miłecki
2014-08-28 11:56 ` Arnd Bergmann
2014-08-28 12:37 ` Rafał Miłecki
2014-08-28 15:32 ` Arnd Bergmann
2014-08-28 16:00 ` Rafał Miłecki
2014-08-28 16:03 ` Rafał Miłecki
2014-08-28 21:22 ` Hauke Mehrtens
2014-08-29 7:12 ` Arnd Bergmann
2014-08-29 15:21 ` Rafał Miłecki
2014-08-29 20:04 ` Arnd Bergmann
2014-08-30 13:33 ` Hauke Mehrtens
2014-08-31 9:20 ` Rafał Miłecki
2014-09-01 7:48 ` Rafał Miłecki
2014-09-01 14:57 ` Arnd Bergmann [this message]
2014-09-01 20:45 ` Jonas Gorski
2014-09-01 20:57 ` Arnd Bergmann
2014-08-31 19:49 ` Florian Fainelli
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=4072992.6HB7sP7z87@wuerfel \
--to=arnd@arndb.de \
--cc=hauke@hauke-m.de \
--cc=linux-mips@linux-mips.org \
--cc=linux-wireless@vger.kernel.org \
--cc=zajec5@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).