Attention is currently required from: Hung-Te Lin. Hello Hung-Te Lin,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/51202
to review the following change.
Change subject: mb/google/asurada: Add generic DRAM groups ......................................................................
mb/google/asurada: Add generic DRAM groups
To reduce qualification effort, we want to pre-populate DRAM by their size, package type and geometry so when a new DRAM is introduced we don't need to spin off a new firmware release.
Signed-off-by: Hung-Te Lin hungte@chromium.org Signed-off-by: Xi Chen xixi.chen@mediatek.com Change-Id: I42ee170c159e551e840ab4e748f18f5149506b4f --- M src/mainboard/google/asurada/boardid.c M src/mainboard/google/asurada/sdram_configs.c M src/mainboard/google/asurada/sdram_params/Makefile.inc A src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-1RANK-4GB.c A src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-4GB.c A src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE.c A src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-8GB.c A src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-1RANK-4GB.c A src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-2RANK-4GB.c A src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-2RANK-8GB.c A src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c A src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-MT29VZZZAD8GQFSL-046-4GB.c M src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-MT29VZZZBD9DQKPR-046-6GB.c 14 files changed, 209 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/51202/1
diff --git a/src/mainboard/google/asurada/boardid.c b/src/mainboard/google/asurada/boardid.c index cb91812..06c21ec 100644 --- a/src/mainboard/google/asurada/boardid.c +++ b/src/mainboard/google/asurada/boardid.c @@ -10,7 +10,8 @@ #define ADC_LEVELS 15
enum { - RAM_ID_CHANNEL = 3, + RAM_ID_HIGH_CHANNEL = 4, + RAM_ID_LOW_CHANNEL = 3, };
static const unsigned int ram_voltages[ADC_LEVELS] = { @@ -33,7 +34,8 @@ };
static const unsigned int *adc_voltages[] = { - [RAM_ID_CHANNEL] = ram_voltages, + [RAM_ID_HIGH_CHANNEL] = ram_voltages, + [RAM_ID_LOW_CHANNEL] = ram_voltages, };
static uint32_t get_adc_index(unsigned int channel) @@ -63,8 +65,11 @@ { static uint32_t cached_ram_code = BOARD_ID_INIT;
- if (cached_ram_code == BOARD_ID_INIT) - cached_ram_code = get_adc_index(RAM_ID_CHANNEL); + if (cached_ram_code == BOARD_ID_INIT) { + cached_ram_code = (get_adc_index(RAM_ID_HIGH_CHANNEL) << 4 | + get_adc_index(RAM_ID_LOW_CHANNEL)); + printk(BIOS_DEBUG, "RAM Code: %#02x\n", cached_ram_code); + }
return cached_ram_code; } diff --git a/src/mainboard/google/asurada/sdram_configs.c b/src/mainboard/google/asurada/sdram_configs.c index e1eb527..9a0133f 100644 --- a/src/mainboard/google/asurada/sdram_configs.c +++ b/src/mainboard/google/asurada/sdram_configs.c @@ -5,9 +5,121 @@ #include <console/console.h> #include <soc/dramc_param.h>
+/* Reference: go/asurada-id */ static const char *const sdram_configs[] = { - [0] = "sdram-lpddr4x-MT29VZZZBD9DQKPR-046-6GB", - [1] = "sdram-lpddr4x-MT29VZZZAD8GQFSL-046-4GB", + /* Exceptional legacy module */ + [0x00] = "sdram-lpddr4x-MT29VZZZBD9DQKPR-046-6GB", + [0x01] = "sdram-lpddr4x-MT29VZZZAD8GQFSL-046-4GB", + [0x02] = "sdram-lpddr4x-KMDP6001DA-B425-4GB", + [0x03] = "sdram-lpddr4x-KMDV6001DA-B620-4GB", + + /* Group 0x0: eMCP 4GB single rank. */ + [0x04] = "sdram-lpddr4x-EMCP-1RANK-4GB", + [0x05] = "sdram-lpddr4x-EMCP-1RANK-4GB", + [0x06] = "sdram-lpddr4x-EMCP-1RANK-4GB", + [0x07] = "sdram-lpddr4x-EMCP-1RANK-4GB", + [0x08] = "sdram-lpddr4x-EMCP-1RANK-4GB", + [0x09] = "sdram-lpddr4x-EMCP-1RANK-4GB", + [0x0a] = "sdram-lpddr4x-EMCP-1RANK-4GB", + [0x0b] = "sdram-lpddr4x-EMCP-1RANK-4GB", + + /* Group 0x1: eMCP 4GB dual rank. */ + [0x10] = "sdram-lpddr4x-EMCP-2RANK-4GB", + [0x11] = "sdram-lpddr4x-EMCP-2RANK-4GB", + [0x12] = "sdram-lpddr4x-EMCP-2RANK-4GB", + [0x13] = "sdram-lpddr4x-EMCP-2RANK-4GB", + [0x14] = "sdram-lpddr4x-EMCP-2RANK-4GB", + [0x15] = "sdram-lpddr4x-EMCP-2RANK-4GB", + [0x16] = "sdram-lpddr4x-EMCP-2RANK-4GB", + [0x17] = "sdram-lpddr4x-EMCP-2RANK-4GB", + [0x18] = "sdram-lpddr4x-EMCP-2RANK-4GB", + [0x19] = "sdram-lpddr4x-EMCP-2RANK-4GB", + [0x1a] = "sdram-lpddr4x-EMCP-2RANK-4GB", + [0x1b] = "sdram-lpddr4x-EMCP-2RANK-4GB", + + /* Group 0x2: eMCP 8GB dual rank. */ + [0x20] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x21] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x22] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x23] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x24] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x25] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x26] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x27] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x28] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x29] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x2a] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x2b] = "sdram-lpddr4x-EMCP-2RANK-8GB", + + /* Group 0x3: eMCP 8GB dual rank. */ + [0x30] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x31] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x32] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x33] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x34] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x35] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x36] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x37] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x38] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x39] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x3a] = "sdram-lpddr4x-EMCP-2RANK-8GB", + [0x3b] = "sdram-lpddr4x-EMCP-2RANK-8GB", + + /* Group 0x4: discrete 4GB single rank. */ + [0x40] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + [0x41] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + [0x42] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + [0x43] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + [0x44] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + [0x45] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + [0x46] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + [0x47] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + [0x48] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + [0x49] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + [0x4a] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + [0x4b] = "sdram-lpddr4x-DISCRETE-1RANK-4GB", + + /* Group 0x5: discrete 4GB dual rank. */ + [0x50] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + [0x51] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + [0x52] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + [0x53] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + [0x54] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + [0x55] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + [0x56] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + [0x57] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + [0x58] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + [0x59] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + [0x5a] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + [0x5b] = "sdram-lpddr4x-DISCRETE-2RANK-4GB", + + /* Group 0x6: discrete 8GB dual rank. */ + [0x60] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + [0x61] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + [0x62] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + [0x63] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + [0x64] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + [0x65] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + [0x66] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + [0x67] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + [0x68] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + [0x69] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + [0x6a] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + [0x6b] = "sdram-lpddr4x-DISCRETE-2RANK-8GB", + + /* Group 0x7: discrete 8GB dual rank byte mode. */ + [0x70] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", + [0x71] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", + [0x72] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", + [0x73] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", + [0x74] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", + [0x75] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", + [0x76] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", + [0x77] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", + [0x78] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", + [0x79] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", + [0x7a] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", + [0x7b] = "sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE", };
static struct sdram_info params; diff --git a/src/mainboard/google/asurada/sdram_params/Makefile.inc b/src/mainboard/google/asurada/sdram_params/Makefile.inc index acc8b58..20df2ba 100644 --- a/src/mainboard/google/asurada/sdram_params/Makefile.inc +++ b/src/mainboard/google/asurada/sdram_params/Makefile.inc @@ -1,6 +1,18 @@ sdram-params := + +# Generic parameters +sdram-params += sdram-lpddr4x-EMCP-1RANK-4GB +sdram-params += sdram-lpddr4x-EMCP-2RANK-4GB +sdram-params += sdram-lpddr4x-EMCP-2RANK-8GB +sdram-params += sdram-lpddr4x-DISCRETE-1RANK-4GB +sdram-params += sdram-lpddr4x-DISCRETE-2RANK-4GB +sdram-params += sdram-lpddr4x-DISCRETE-2RANK-8GB +sdram-params += sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE + sdram-params += sdram-lpddr4x-MT29VZZZBD9DQKPR-046-6GB sdram-params += sdram-lpddr4x-MT29VZZZAD8GQFSL-046-4GB +sdram-params += sdram-lpddr4x-KMDP6001DA-B425-4GB +sdram-params += sdram-lpddr4x-KMDV6001DA-B620-4GB
$(foreach params,$(sdram-params), \ $(eval cbfs-files-y += $(params)) \ diff --git a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-1RANK-4GB.c b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-1RANK-4GB.c new file mode 100644 index 0000000..aef8512 --- /dev/null +++ b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-1RANK-4GB.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <soc/dramc_param.h> + +struct sdram_info params = { + .ddr_geometry = DDR_TYPE_2CH_1RK_4GB_4_0, + .ddr_type = DDR_TYPE_DISCRETE, +}; diff --git a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-4GB.c b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-4GB.c new file mode 100644 index 0000000..5735df5 --- /dev/null +++ b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-4GB.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <soc/dramc_param.h> + +struct sdram_info params = { + .ddr_geometry = DDR_TYPE_2CH_2RK_4GB_2_2, + .ddr_type = DDR_TYPE_DISCRETE, +}; diff --git a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE.c b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE.c new file mode 100644 index 0000000..51e8a6f --- /dev/null +++ b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-8GB-BYTE-MODE.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <soc/dramc_param.h> + +struct sdram_info params = { + .ddr_geometry = DDR_TYPE_2CH_2RK_8GB_4_4_BYTE, + .ddr_type = DDR_TYPE_DISCRETE, +}; diff --git a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-8GB.c b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-8GB.c new file mode 100644 index 0000000..3d12588 --- /dev/null +++ b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-DISCRETE-2RANK-8GB.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <soc/dramc_param.h> + +struct sdram_info params = { + .ddr_geometry = DDR_TYPE_2CH_2RK_8GB_4_4, + .ddr_type = DDR_TYPE_DISCRETE, +}; diff --git a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-1RANK-4GB.c b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-1RANK-4GB.c new file mode 100644 index 0000000..15217f0 --- /dev/null +++ b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-1RANK-4GB.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <soc/dramc_param.h> + +struct sdram_info params = { + .ddr_geometry = DDR_TYPE_2CH_1RK_4GB_4_0, + .ddr_type = DDR_TYPE_EMCP, +}; diff --git a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-2RANK-4GB.c b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-2RANK-4GB.c new file mode 100644 index 0000000..bed9418 --- /dev/null +++ b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-2RANK-4GB.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <soc/dramc_param.h> + +struct sdram_info params = { + .ddr_geometry = DDR_TYPE_2CH_2RK_4GB_2_2, + .ddr_type = DDR_TYPE_EMCP, +}; diff --git a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-2RANK-8GB.c b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-2RANK-8GB.c new file mode 100644 index 0000000..17c954c --- /dev/null +++ b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-EMCP-2RANK-8GB.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <soc/dramc_param.h> + +struct sdram_info params = { + .ddr_geometry = DDR_TYPE_2CH_2RK_8GB_4_4, + .ddr_type = DDR_TYPE_EMCP, +}; diff --git a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c new file mode 100644 index 0000000..bed9418 --- /dev/null +++ b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <soc/dramc_param.h> + +struct sdram_info params = { + .ddr_geometry = DDR_TYPE_2CH_2RK_4GB_2_2, + .ddr_type = DDR_TYPE_EMCP, +}; diff --git a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c new file mode 100644 index 0000000..bed9418 --- /dev/null +++ b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <soc/dramc_param.h> + +struct sdram_info params = { + .ddr_geometry = DDR_TYPE_2CH_2RK_4GB_2_2, + .ddr_type = DDR_TYPE_EMCP, +}; diff --git a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-MT29VZZZAD8GQFSL-046-4GB.c b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-MT29VZZZAD8GQFSL-046-4GB.c index 8ae9b69..15217f0 100644 --- a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-MT29VZZZAD8GQFSL-046-4GB.c +++ b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-MT29VZZZAD8GQFSL-046-4GB.c @@ -4,4 +4,5 @@
struct sdram_info params = { .ddr_geometry = DDR_TYPE_2CH_1RK_4GB_4_0, + .ddr_type = DDR_TYPE_EMCP, }; diff --git a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-MT29VZZZBD9DQKPR-046-6GB.c b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-MT29VZZZBD9DQKPR-046-6GB.c index 36fc0a2..bfd2720 100644 --- a/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-MT29VZZZBD9DQKPR-046-6GB.c +++ b/src/mainboard/google/asurada/sdram_params/sdram-lpddr4x-MT29VZZZBD9DQKPR-046-6GB.c @@ -4,4 +4,5 @@
struct sdram_info params = { .ddr_geometry = DDR_TYPE_2CH_2RK_6GB_3_3, + .ddr_type = DDR_TYPE_EMCP, };