From bee5429ba647a0f29d98530f57ef1771939ceb30 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Mon, 23 Feb 2009 18:42:44 +0000 Subject: cs5536: Make NAND code optional and implement timing setting The reset value for NAND timings is the slowest possible for Flash interface. Implement optionally setting it to a different value inside the NAND device. Set it to appropriate values for Artec Group DBE61 and DBE62. This results in a roughly two times quicker read time as measured by hdparm for these boards. Because we can not cast to southbridge_amd_cs5536_nand_config if the board dts does not have an entry for the NAND device, this change proposes a method for reasonably clean way to only optionally compile in support for certain devices: If a board wants to support an optional device, its Kconfig entry can select that configuration. If it's optional even across the same board, it can expose a subconfig option of the board, that describes it and if chosen selects the device config. The source code for that device is conditionally compiled only if the Kconfig option gets enabled by the configuration for the board. A requirement is that if the board configuration can enable a device, it is contained in the boards dts file as well. A perhaps better long-term alternative for this could be making dtc generate preprocessor definitions for each device_configuration struct that it creates. Then the source code file is always enabled, but that file can be wrapped around a simple #ifdef check in its entirety. Conversion to the alternative approach from the short-term Kconfig approach proposed here should be relatively easy, as to not block inclusion of the Kconfig approach in the short term. Signed-off-by: Mart Raudsepp Acked-by: Marc Jones git-svn-id: svn://coreboot.org/repository/coreboot-v3@1138 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- mainboard/artecgroup/dbe61/dts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mainboard/artecgroup/dbe61/dts') diff --git a/mainboard/artecgroup/dbe61/dts b/mainboard/artecgroup/dbe61/dts index a6995cee9374..cb462922090f 100644 --- a/mainboard/artecgroup/dbe61/dts +++ b/mainboard/artecgroup/dbe61/dts @@ -109,8 +109,11 @@ end /* USB Port Power Handling setting. */ pph = "0xf5"; }; - pci@f,1 { + pci@f,1 { /* NAND Flash */ /config/("southbridge/amd/cs5536/nand"); + /* Timings */ + nandf_data = "0x01200120"; + nandf_ctl = "0x00000120"; }; }; }; -- cgit v1.2.3