From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/9] Switch internal registers address to 0xF1 on Armada 370/XP
Date: Thu, 23 May 2013 19:39:42 +0200 [thread overview]
Message-ID: <201305231939.42359.arnd@arndb.de> (raw)
In-Reply-To: <20130523164736.610fc55d@skate>
On Thursday 23 May 2013, Thomas Petazzoni wrote:
>
> On Thu, 23 May 2013 16:12:42 +0200, Arnd Bergmann wrote:
>
> > Well, the main reason I see now is that Marvell screwed it up by
> > having two incompatible versions of u-boot. Using a different base
> > address on new machines would have been no problem at all, but
> > supporting the same machine with different addresses depending on the
> > boot loader version is madness. As you say, it's too late to change
> > that now, so maybe the best solution is to make the registers always
> > get reassigned. 5 trick.
>
> Not sure what you mean by '5 trick', and what I should understand from
> this :(
I have no idea myself how that got there, don't remember typing it.
Very odd.
> > > What do you mean by "we know what boot loader we have when we pass
> > > the devicetree" ?
> > >
> > > The mere user of the kernel just does:
> > >
> > > make ARCH=arm mvebu_defconfig
> > > make ARCH=arm CROSS_COMPILE=...
> > > cat arch/arm/boot/zImage
> > > arch/arm/boot/dts/armada-370-mirabox.dtb > zImage.mirabox ...
> > > prepare uImage ...
> > >
> > > and he certainly doesn't want to understand the gory details of
> > > which internal register base address to chose depending on which
> > > bootloader version he is using. This is really asking normal users
> > > to have a too much intimate knowledge of the hardware details.
> >
> > Right, appended device tree is a problem, but if a user does that, I
> > think we can rightfully expect them to know what they are doing.
>
> Unfortunately, not really. Appended Device Tree is the only way to go
> for old bootloaders, and we don't want users of such bootloaders to
> have to modify their Device Tree to change the base address of the
> internal registers.
But then the old boot loaders surely wouldn't use the new address either.
> > I think we should consequently make sure we never get a production
> > u-boot for Mirabox or OpenBlocks that changes the internal register
> > address and also allows ATAGS based booting.
>
> It is impossible to prevent that. U-Boot always supports ATAGs booting
> for ARM, and optionally Device Tree based booting.
>
> And once again, you believe we have an enormous control over what is
> happening at the bootloader level. So when you say "we should
> consequently make sure ..", this is simply not possible: we have no
> control over this.
The control you have over it is to ensure that it's impossible to
boot an upstream kernel using a broken boot loader. This seems to have
worked rather well to get all Kirkwood/Orion5x/mv78xx0/Dove boards
to use an address that is different from the power-on default.
If we see Mirabox or OpenBlocks machines (or any new ones) get out
in the wild with different addresses and no DT support, that would
be rather unfortunate, but it's not the end of the world, we could
call add a trivial .dts file that includes the original one and puts
in the correct address into the ranges property.
> > Since you explained that we want to move the internal registers to get
> > more available memory, I think what you also want to do is to
> > dynamically reassign the internal register mapping when the mbus
> > driver gets loaded, just like all the other mbus mappings.
>
> Ideally, it should be like this. Unfortunately, moving the internal
> register mapping is really a painful operation: you have to know where
> is the address to change the internal register base address (which
> itself changes when the internal register base address changes), and all
> code interacting with peripherals before the change of the address must
> be synchronized so that after the switch it uses the new address.
But you are proposing a patch set that does exactly this, so it's
clearly possible, right?
> Switching the internal registers address at runtime after a lot of
> things have booted is *painful* and we really don't want to do that.
> Sebastian Hesselbarth, who has worked on the topic, will confirm this.
It can still be done really early, e.g. from map_io(), since that is
run at a time when we have access to the DT and are not using any
devices other than the debug_ll code that is already a hack.
> We've gone through great lengths to find a solution that does not
> touch *any* ARM generic code (even though it would have been much
> simpler!). At least one Marvell maintainer (Andrew Lunn) is fine with
> this temporary solution, and since the issue is very SoC-specific, and
> completely self-contained in the SoC-specific code, would it be
> possible to be pragmatic and let us merge such a workaround?
Maybe you can put the hack into a separate board file that gets used
only for the two boards that need it and is enabled optionally?
The part that is really worrying about your patch is that you essentially
make an undocumented extension to the boot protocol to silently ignore
the information from the official interface and use a hardcoded value
instead, for all boards in that platform.
If you make a hack there, at least make it blatently obvious that
something is wrong when you work around it:
* allow the hack only for known broken machines (e.g. OpenBlocks
with the internal registers at 0xf1), on all other machines
trust the DT information.
* When you detect a mismatch between DT and the hardware setup
as passed by the boot loader, print a fat warning.
* Fix it up by modifying the DT in memory to match the actual
hardware configuration, not by making the hardware match the DT.
* If you ever want to get rid of the hack, put a time-bomb it in
right away, like "BUG_ON(LINUX_VERSION_CODE > KERNEL_VERSION(3,14,0))"
Arnd
next prev parent reply other threads:[~2013-05-23 17:39 UTC|newest]
Thread overview: 91+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-21 10:33 [PATCH 0/9] Switch internal registers address to 0xF1 on Armada 370/XP Thomas Petazzoni
2013-05-21 10:33 ` [PATCH 1/9] arm: mvebu: fix length of SATA registers area in .dtsi Thomas Petazzoni
2013-05-21 13:42 ` Jason Cooper
2013-05-21 10:33 ` [PATCH 2/9] arm: mvebu: fix length of Ethernet " Thomas Petazzoni
2013-05-21 13:43 ` Jason Cooper
2013-05-21 10:33 ` [PATCH 3/9] arm: mvebu: mark functions of armada-370-xp.c as static Thomas Petazzoni
2013-05-21 13:45 ` Jason Cooper
2013-05-21 10:33 ` [PATCH 4/9] arm: mvebu: remove dependency of SMP init on static I/O mapping Thomas Petazzoni
2013-05-21 10:33 ` [PATCH 5/9] arm: mvebu: avoid hardcoded virtual address in coherency code Thomas Petazzoni
2013-05-21 10:33 ` [PATCH 6/9] arm: mvebu: move cache and mvebu-mbus initialization later Thomas Petazzoni
2013-05-21 14:16 ` Jason Cooper
2013-05-21 15:37 ` Thomas Petazzoni
2013-05-21 15:43 ` Jason Cooper
2013-05-21 16:10 ` Thomas Petazzoni
2013-05-21 16:37 ` Jason Cooper
2013-05-21 16:44 ` Thomas Petazzoni
2013-05-21 10:33 ` [PATCH 7/9] arm: mvebu: remove hardcoded static I/O mapping Thomas Petazzoni
2013-05-21 10:33 ` [PATCH 8/9] arm: mvebu: don't hardcode a physical address in headsmp.S Thomas Petazzoni
2013-05-21 10:33 ` [PATCH 9/9] arm: mvebu: switch internal register address at runtime if needed Thomas Petazzoni
2013-05-22 13:27 ` Thomas Petazzoni
2013-05-22 14:04 ` Andrew Lunn
2013-05-22 14:16 ` Thomas Petazzoni
2013-05-22 14:17 ` Sebastian Hesselbarth
2013-05-22 17:42 ` Andrew Lunn
2013-05-22 17:59 ` Thomas Petazzoni
2013-05-22 18:31 ` Andrew Lunn
2013-05-21 19:38 ` [PATCH 0/9] Switch internal registers address to 0xF1 on Armada 370/XP Willy Tarreau
2013-05-21 20:12 ` Thomas Petazzoni
2013-05-21 20:26 ` Willy Tarreau
2013-05-22 10:01 ` Sebastian Hesselbarth
2013-05-22 11:46 ` Greg
2013-05-22 13:43 ` Russell King - ARM Linux
2013-05-22 13:52 ` Thomas Petazzoni
2013-05-22 14:11 ` Arnd Bergmann
2013-05-22 14:17 ` Russell King - ARM Linux
2013-05-22 14:23 ` Sebastian Hesselbarth
2013-05-22 14:33 ` Arnd Bergmann
2013-05-22 14:41 ` Gregory CLEMENT
2013-05-22 15:18 ` Arnd Bergmann
2013-05-22 15:37 ` Gregory CLEMENT
2013-05-22 15:43 ` Arnd Bergmann
2013-05-22 15:56 ` Gregory CLEMENT
2013-05-22 20:30 ` Arnd Bergmann
2013-05-22 15:06 ` Thomas Petazzoni
2013-05-22 15:35 ` Arnd Bergmann
2013-05-22 15:51 ` Andrew Lunn
2013-05-22 16:22 ` Thomas Petazzoni
2013-05-22 20:36 ` Arnd Bergmann
2013-05-23 10:02 ` Thomas Petazzoni
2013-05-23 14:12 ` Arnd Bergmann
2013-05-23 14:47 ` Thomas Petazzoni
2013-05-23 17:39 ` Arnd Bergmann [this message]
2013-05-22 16:08 ` Thomas Petazzoni
2013-05-22 16:35 ` Willy Tarreau
2013-05-22 16:42 ` Thomas Petazzoni
2013-05-22 16:49 ` Willy Tarreau
2013-05-22 17:00 ` Thomas Petazzoni
2013-05-22 17:08 ` Willy Tarreau
2013-05-22 17:14 ` Thomas Petazzoni
2013-05-22 20:47 ` Sebastian Hesselbarth
2013-05-22 16:49 ` Jason Cooper
2013-05-22 16:57 ` Thomas Petazzoni
2013-05-22 17:13 ` Jason Cooper
2013-05-22 18:05 ` Thomas Petazzoni
2013-05-22 18:09 ` Jason Cooper
2013-05-22 18:13 ` Thomas Petazzoni
2013-05-22 18:19 ` Jason Gunthorpe
2013-05-22 18:55 ` Andrew Lunn
2013-05-22 19:36 ` Jason Gunthorpe
2013-05-22 20:31 ` Andrew Lunn
2013-05-23 9:53 ` Thomas Petazzoni
2013-05-23 17:27 ` Jason Gunthorpe
2013-05-22 20:40 ` Arnd Bergmann
2013-05-22 21:31 ` Thomas Petazzoni
2013-05-23 5:53 ` Andrew Lunn
2013-05-23 7:53 ` Russell King - ARM Linux
2013-05-23 12:23 ` Thomas Petazzoni
2013-05-23 14:14 ` Arnd Bergmann
2013-05-23 14:50 ` Thomas Petazzoni
2013-05-23 20:26 ` Russell King - ARM Linux
2013-05-23 20:40 ` Arnd Bergmann
2013-05-23 23:09 ` Russell King - ARM Linux
2013-05-23 23:17 ` Thomas Petazzoni
2013-05-23 23:40 ` Russell King - ARM Linux
2013-05-24 10:25 ` Greg
2013-05-24 7:15 ` Arnd Bergmann
2013-05-24 7:43 ` Thomas Petazzoni
2013-05-24 9:16 ` Arnd Bergmann
2013-05-24 7:46 ` Russell King - ARM Linux
2013-05-24 8:07 ` Thomas Petazzoni
2013-05-24 10:57 ` Arnd Bergmann
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=201305231939.42359.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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).