Tristan Hsieh has uploaded this change for review. ( https://review.coreboot.org/28438
Change subject: google/kukui: Initialize DRAM from romstage ......................................................................
google/kukui: Initialize DRAM from romstage
Add DRAM support for google kukui.
BUG=b:80501386 BRANCH=none TEST=Boots correctly on Kukui
Change-Id: I1ed01404343745c883b22a648966327bdcabc5c2 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/romstage.c A src/mainboard/google/kukui/sdram_configs.c A src/mainboard/google/kukui/sdram_inf/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.inc 4 files changed, 53 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/28438/1
diff --git a/src/mainboard/google/kukui/Makefile.inc b/src/mainboard/google/kukui/Makefile.inc index aa6bf11..e077358 100644 --- a/src/mainboard/google/kukui/Makefile.inc +++ b/src/mainboard/google/kukui/Makefile.inc @@ -9,6 +9,7 @@ romstage-y += chromeos.c romstage-y += memlayout.ld romstage-y += romstage.c +romstage-y += sdram_configs.c
ramstage-y += chromeos.c ramstage-y += mainboard.c diff --git a/src/mainboard/google/kukui/romstage.c b/src/mainboard/google/kukui/romstage.c index 9eeaa68..7c5a70d 100644 --- a/src/mainboard/google/kukui/romstage.c +++ b/src/mainboard/google/kukui/romstage.c @@ -15,8 +15,10 @@
#include <arch/stages.h> #include <soc/mmu_operations.h> +#include <soc/emi.h>
void platform_romstage_main(void) { + mt_mem_init(get_sdram_config()); mtk_mmu_after_dram(); } diff --git a/src/mainboard/google/kukui/sdram_configs.c b/src/mainboard/google/kukui/sdram_configs.c new file mode 100644 index 0000000..00a38c4 --- /dev/null +++ b/src/mainboard/google/kukui/sdram_configs.c @@ -0,0 +1,25 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2017 MediaTek Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <soc/emi.h> + +static const struct sdram_params sdram_configs[] = { +#include "sdram_inf/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.inc" +}; + +const struct sdram_params *get_sdram_config(void) +{ + return &sdram_configs[0]; +} diff --git a/src/mainboard/google/kukui/sdram_inf/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.inc b/src/mainboard/google/kukui/sdram_inf/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.inc new file mode 100644 index 0000000..13ac4b8 --- /dev/null +++ b/src/mainboard/google/kukui/sdram_inf/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.inc @@ -0,0 +1,25 @@ +{ + .impedance = { + [ODT_OFF] = {0x7, 0x6, 0x0, 0xF}, + [ODT_ON] = {0x9, 0x9, 0x0, 0xF} + }, + .wr_level = { + [CHANNEL_A] = {{0x22, 0x1b}, {0x22, 0x19}}, + [CHANNEL_B] = {{0x24, 0x20}, {0x25, 0x20}} + }, + .cbt_cs = { + [CHANNEL_A] = {0x0, 0x0}, + [CHANNEL_B] = {0x0, 0x0} + }, + .cbt_mr12 = { + [CHANNEL_A] = {0x52, 0x52}, + [CHANNEL_B] = {0x52, 0x52} + }, + .clk_delay = 0x0, + .dqs_delay = {0x1, -2}, + .EMI_CONA_VAL = 0xF053F154, + .EMI_CONH_VAL = 0x44440003, + .EMI_CONF_VAL = 0x00421000, + .CHN_EMI_CONA_VAL = {0x0444F051, 0x0444F051}, + .cbt_mode_extern = CBT_NORMAL_MODE, +},