From d7ddcf262a321f06289c4f2b2a6b43982dd96377 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 21 Nov 2013 00:50:53 -0800 Subject: [PATCH] nyan: Create kconfig variables for each SDRAM config. Instead of choosing between SDRAM configurations for rev0 nyans and everything else (currently only rev1), we should create a kconfig for each possible config and put them inside a "choice" block. That way we can have an arbitrarily large number of choices without them getting to be hard to manage or accidentally not being mutually exclusive. This also makes the choice of SDRAM config more explicit instead of it being implied by what rev you're compiled for. One tradeoff of this approach is that you need to know which config goes with which rev. Unfortunately we can't decide using the board ID like we can for most other things because the BCT is consumed by code we don't control before any of our own code runs. We default to the slower config for safety's sake, because it will work on both boards, and because it's the right config for the norrin which we were going to transition to soon anyway. Also, we can eliminate the NYAN_IN_A_PIXEL kconfig variable. Alas, we hardly knew ye. BUG=None TEST=Built and booted on both types of nyan. BRANCH=None Change-Id: I9a630189e001e95c740c6741057511bf5939fdbb Signed-off-by: Gabe Black Reviewed-on: https://chromium-review.googlesource.com/177580 Reviewed-by: Julius Werner Reviewed-by: David Hendricks Reviewed-by: Tom Warren Reviewed-by: Ronald Minnich Commit-Queue: Gabe Black Tested-by: Gabe Black --- configs/config.nyan | 1 - src/mainboard/google/nyan/Kconfig | 16 +++++++++++++--- src/mainboard/google/nyan/bct/Makefile.inc | 7 ++----- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/configs/config.nyan b/configs/config.nyan index 5eb2054473..430c690c83 100644 --- a/configs/config.nyan +++ b/configs/config.nyan @@ -1,6 +1,5 @@ CONFIG_VENDOR_GOOGLE=y CONFIG_BOARD_GOOGLE_NYAN=y -CONFIG_NYAN_IN_A_PIXEL=y CONFIG_COREBOOT_ROMSIZE_KB_1024=y # CONFIG_CONSOLE_SERIAL is not set CONFIG_COLLECT_TIMESTAMPS=y diff --git a/src/mainboard/google/nyan/Kconfig b/src/mainboard/google/nyan/Kconfig index 270e7e1cf3..8ffd1a59c6 100644 --- a/src/mainboard/google/nyan/Kconfig +++ b/src/mainboard/google/nyan/Kconfig @@ -88,8 +88,18 @@ config EC_GOOGLE_CHROMEEC_SPI_BUS hex default 1 -config NYAN_IN_A_PIXEL - bool "Nyan in a pixel case" - default n +choice + prompt "BCT sdram configuration" + default BCT_SDRAM_792 + help + The SDRAM configuration to put in the BCT. + +config BCT_SDRAM_792 + bool "792 MHz" + +config BCT_SDRAM_924 + bool "924 MHz" + +endchoice endif # BOARD_GOOGLE_NYAN diff --git a/src/mainboard/google/nyan/bct/Makefile.inc b/src/mainboard/google/nyan/bct/Makefile.inc index 460e2fdb7f..52251c4f2b 100644 --- a/src/mainboard/google/nyan/bct/Makefile.inc +++ b/src/mainboard/google/nyan/bct/Makefile.inc @@ -20,8 +20,5 @@ bct-cfg-$(CONFIG_BCT_CFG_EMMC) += emmc.cfg bct-cfg-$(CONFIG_BCT_CFG_SPI) += spi.cfg bct-cfg-y += odmdata.cfg -ifeq ($(CONFIG_NYAN_IN_A_PIXEL),y) - bct-cfg-y += sdram-924.cfg -else - bct-cfg-y += sdram-792.cfg -endif +bct-cfg-$(CONFIG_BCT_SDRAM_924) += sdram-924.cfg +bct-cfg-$(CONFIG_BCT_SDRAM_792) += sdram-792.cfg