diff options
author | Huayang Duan <huayang.duan@mediatek.com> | 2020-06-22 19:36:14 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-08-26 07:35:59 +0000 |
commit | a0ef67879802f47c4e6e979fa0dd5a872960efc0 (patch) | |
tree | f5831fc0c6e3e2f43f18cfdc26e64e862d8a7db1 /src/mainboard/google/asurada/sdram_configs.c | |
parent | 3c16fe4fade9f1c695a52e756fa638cb8cd0e9f6 (diff) | |
download | coreboot-a0ef67879802f47c4e6e979fa0dd5a872960efc0.tar.xz |
mb/google/asurada: Load dram params from sdram config
Signed-off-by: Huayang Duan <huayang.duan@mediatek.com>
Change-Id: I2cc38115c27cbbe157fc850bbd88b10ae8001f52
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44567
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'src/mainboard/google/asurada/sdram_configs.c')
-rw-r--r-- | src/mainboard/google/asurada/sdram_configs.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mainboard/google/asurada/sdram_configs.c b/src/mainboard/google/asurada/sdram_configs.c new file mode 100644 index 0000000000..9efcb32dae --- /dev/null +++ b/src/mainboard/google/asurada/sdram_configs.c @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <boardid.h> +#include <cbfs.h> +#include <console/console.h> +#include <soc/dramc_param.h> + +static const char *const sdram_configs[] = { + [0] = "sdram-lpddr4x-MT29VZZZBD9DQKPR-046-6GB", + [1] = "sdram-lpddr4x-MT29VZZZAD8GQFSL-046-4GB", +}; + +static struct sdram_info params; + +const struct sdram_info *get_sdram_config(void) +{ + uint32_t ramcode = ram_code(); + + if (ramcode >= ARRAY_SIZE(sdram_configs) || + cbfs_boot_load_file(sdram_configs[ramcode], ¶ms, sizeof(params), + CBFS_TYPE_STRUCT) != sizeof(params)) + die("Cannot load SDRAM parameter file for RAM code: %#x", ramcode); + + return ¶ms; +} |