summaryrefslogtreecommitdiff
path: root/src/mainboard/google/gru/sdram_configs.c
diff options
context:
space:
mode:
authorLin Huang <hl@rock-chips.com>2016-06-16 10:44:30 +0800
committerMartin Roth <martinroth@google.com>2016-06-24 20:54:01 +0200
commit627c27bb921127d8b384840d89f9f1d7ab1c68a3 (patch)
tree73b6e40c78f06338fea8d541cf9488d1294a67a7 /src/mainboard/google/gru/sdram_configs.c
parentad6960c45a6ad9bb9dae2780b8b178920c7f5fff (diff)
downloadcoreboot-627c27bb921127d8b384840d89f9f1d7ab1c68a3.tar.xz
rockchip/rk3399: provide multiple SDRAM configurations
We want to be able to easily change SDRAM clock rate for debugging purposes. This patch adds configurations for 4 different clock rates. Same configs are used for all rk3399 boards at 200, 666 and 800 MHz. Kevin board does not run reliably at 666 MHz, an option for it is added to run at 300 MHz, this option is available to Kevin only. There is not much room left in the coreboot romstage section, this is why the config file for 928 MHz is being added with this patch but is not included in the code, one of the lower frequency options will have to be dropped for the higher frequency option to be added. BRANCH=none BUG=chrome-os-partner:54144 TEST=run "stressapptest -M 1024 -s 3600" and pass on both kevin and gru. Verified that on Kevin the firmware reports starting up SDRAM at 300 MHz and on Gru at 800 MHz. Change-Id: Ie24c1813d5a0e9f0f9bfc781cade9e28fb6eb2f1 Signed-off-by: Martin Roth <martinroth@chromium.org> Original-Commit-Id: ef5e4551b79c3f0531f9af35491f2c593f8482f1 Original-Change-Id: I08bccd40147ad89d851b995a8aab4d2b6da8258a Original-Signed-off-by: Lin Huang <hl@rock-chips.com> Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/353493 Original-Reviewed-by: Derek Basehore <dbasehore@chromium.org> Reviewed-on: https://review.coreboot.org/15309 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/mainboard/google/gru/sdram_configs.c')
-rw-r--r--src/mainboard/google/gru/sdram_configs.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/src/mainboard/google/gru/sdram_configs.c b/src/mainboard/google/gru/sdram_configs.c
index 8674590300..92e00efdba 100644
--- a/src/mainboard/google/gru/sdram_configs.c
+++ b/src/mainboard/google/gru/sdram_configs.c
@@ -22,21 +22,35 @@
#include <types.h>
static struct rk3399_sdram_params sdram_configs[] = {
-#if IS_ENABLED(CONFIG_BOARD_GOOGLE_GRU)
-#include "sdram_inf/gru-sdram-lpddr3-hynix-4GB.inc"
-#elif IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN)
+#include "sdram_inf/sdram-lpddr3-hynix-4GB-200.inc"
+/* THIS IS FOR KEVIN ONLY! crosbug.com/p/54144 */
#include "sdram_inf/kevin-sdram-lpddr3-hynix-4GB.inc"
-#else
-#error "What is your board name?"
-#endif
+#include "sdram_inf/sdram-lpddr3-hynix-4GB-666.inc"
+#include "sdram_inf/sdram-lpddr3-hynix-4GB-800.inc"
+/* #include "sdram_inf/sdram-lpddr3-hynix-4GB-928.inc" */
+};
+
+enum dram_speeds {
+ dram_200MHz = 0,
+ dram_300MHz = 1,
+ dram_666MHz = 2,
+ dram_800MHz = 3,
+/* dram_928MHz = 4, */
};
const struct rk3399_sdram_params *get_sdram_config()
{
- u32 ramcode = ram_code();
+ enum dram_speeds speed;
+
+ if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN))
+ speed = dram_300MHz;
+ else if (IS_ENABLED(CONFIG_BOARD_GOOGLE_GRU))
+ speed = dram_800MHz;
+ else
+ speed = dram_200MHz;
+
+ printk(BIOS_INFO, "Using SDRAM configuration for %d MHz\n",
+ sdram_configs[speed].ddr_freq / (1000 * 1000));
- if (ramcode >= ARRAY_SIZE(sdram_configs)
- || sdram_configs[ramcode].dramtype == UNUSED)
- die("Invalid RAMCODE.");
- return &sdram_configs[ramcode];
+ return &sdram_configs[speed];
}