[coreboot] Supporting boards with NAND flash on other chip selects than CS0

Mart Raudsepp mart.raudsepp at artecdesign.ee
Thu Nov 6 13:13:09 CET 2008


Hello,

Currently southbridge/amd/cs5536/cs5536.c:chipset_flash_setup() sets up
NAND flash if enable_ide_nand_flash is set to "1" in the device tree
based on a static const structure in the same file - FlashInitTable.

The code itself supports having different NAND interfaces, specify extra
NOR for the setup and so on, based on the struct values. However in
practice this can't be used, because the struct is defined in the
southbridge code, and can't be overriden by board specific dts files
through any means - effectively telling things like "This board has NAND
on CS1" is not possible.

Due to that the ArtecGroup ThinCan DBE61 and DBE62 do not set up NAND
flash properly in coreboot-v3. They could have (and DBE62 does)
enable_ide_nand_flash enabled in dts, but that enables it on CS0, and
not on CS1.

I don't know how it's best to solve this.
I think the most generic way would be to make the whole 4 member array
struct definable or overridable in dts, but I don't think our dtc code
supports anything like that - at best we could have a variable length
array (cells) that is used for unwanted_vpci as well, telling that it
has to come in three member chunks, where first tells the type, second
the interface and third the (page size?) mask. But that is very
suboptimal too - a zero would terminate the array immediately, the type
is really an enum, not a 4 byte cell, etc.

Another option is to just assume there is only one NAND to enable, and
give the chip select location in dts - this doesn't regress what is in
practice currently supported, while being the minimum necessary to setup
up NAND for ThinCan boards properly. An initial patch for that is
attached.

Or maybe the call to chipset_flash_setup() should be pushed down to be
the responsibility of board specific C code, so it could pass in its own
FlashInitTable, after chipset_flash_setup is modified to take such a
struct instead of using the file global const struct defined in the
southbridge file?

Thoughts?


Mart Raudsepp
Artec Design LLC
-------------- next part --------------
An embedded message was scrubbed...
From: Mart Raudsepp <mart.raudsepp at artecdesign.ee>
Subject: [PATCH] cs5536: Support NAND flash on other locations than CS0
Date: Thu, 6 Nov 2008 13:36:20 +0200
Size: 6907
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20081106/99cdcd3e/attachment.mht>


More information about the coreboot mailing list