[PATCH 2/2] ARM: Kirkwood: DT board setup for LaPlug

Ezequiel Garcia ezequiel.garcia at free-electrons.com
Mon Dec 23 11:48:27 EST 2013


Hi Maxime,

On Mon, Dec 23, 2013 at 04:47:34PM +0100, Maxime Hadjinlian wrote:
> I have a slight issue which I could not resolve regarding the Hynix
> NAND on this platform. Although it worked perfectly well with 3.12,
> the device is not detected  anymore with the current head of master.
>

If you do a "git log v3.12..v3.13-rc4 -- drivers/mtd/nand/orion_nand.c"
you'll see that no changes have been made.

So maybe this new dts v2 is the problem. And if you look in detail you'll
find you've been bitten by the subtleties of the devicetree!

See below...

> > +       mbus {
> > +               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
> > +               pcie-controller {
> > +                       status = "okay";
> > +                       pcie at 1,0 {
> > +                               status = "okay";
> > +                       };
> > +               };
> > +       };

^^^^
Here's the problem: there's two wrong things with the above:

1. You can't do this... a ranges properties doesn't add on the included
(dtsi) ranges properties. Instead it replaces the included one, so you have
to write the entries all over again.

Yes, we know: it sucks! And given we know it sucks, there was a nice
message warning you about this. From the kirkwood.dtsi

	/* If a board file needs to change this ranges it must replace it completely */
	ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000	/* internal-regs */
		  MBUS_ID(0x01, 0x2f) 0 0xf4000000 0x10000	/* nand flash */
		  MBUS_ID(0x03, 0x01) 0 0xf5000000 0x10000	/* crypto sram */
	  >;

2. Looking in yet more detail, you're re-adding the internal-regs window.
I guess it's just a typo, no?

Anyway, I *think* that's what prevented you from getting the NAND to
work. The correct mbus node should be:

	mbus {
		pcie-controller {
			status = "okay";
			pcie at 1,0 {
				status = "okay";
			};
		};
	};

> > +&nand {
> > +       /* Total size : 512MB */
> > +       status = "okay";
> > +

And here: don't you need to add the pinmuxing? Maybe you don't need it,
but I guess it's the right thing to do.

I hope this helps!

Merry Christmas...
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com



More information about the linux-arm-kernel mailing list