[coreboot] [PATCH] cs5536/nand: Allow setting of NAND timing values in the dts.

Mart Raudsepp mart.raudsepp at artecdesign.ee
Mon Feb 9 17:21:37 CET 2009

Ühel kenal päeval, E, 2009-02-09 kell 08:04, kirjutas ron minnich:
> nice to see people using the dts now!

It's a bit hard to use it for the LBAR setup as well (the code in
chipset_flash_setup() in cs5536.c), as it needs to happen before VSA
init, and VSA init is done in northbridge domain phase2_fixup - so we
don't have a phase for NAND device to run before VSA is inited.
Otherwise I'd use the NAND initialization from chipsetinit() to some
nand_phase1 as well.

> Acked-by: Ronald G. Minnich <rminnich at gmail.com>

I'm going to have to NAK this myself, as it doesn't compile with my gcc
if there is no NAND device in the mainboard dts, as there is no
southbridge_amd_cs5536_nand_config in statictree.h then, and gcc
complains about
/home/leio/dev/coreboot-v3/southbridge/amd/cs5536/cs5536.c:119: error:
dereferencing pointer to incomplete type

So the problem here is that while this code is only ran if the static
dts has a NAND device (and it goes inside the conditional where the
struct is dereferenced only if the device is enabled), it is always
compiled in.
Therefore we can't really dereference things in this manner if the
device can ever be missing from statictree.h, which is the case if
omitted from mainboard dts as it is right now.

How should I approach this?
Add dummy NAND devices to all boards that say "disabled;"?
Access the config structure some other way?
Introduce a dirty HAVE_CS5536_NAND that duplicates dts NAND device
Have dtc emit a structure for it even if nothing sources the southbridge
nand.dts? (that's quite surely a "no" though, just bringing out all
possibilities I can imagine)

On another note, can we cleanly avoid compiling all this NAND init code
in for the boards that surely do not have a NAND device as it can't be a
dynamic device? Same deal with IDE code on boards using NAND. Less
important though, as the code footprint is probably negligible.

Mart Raudsepp

More information about the coreboot mailing list