summaryrefslogtreecommitdiff
path: root/src/mainboard/google/rex/variants/baseboard
diff options
context:
space:
mode:
authorEric Lai <eric_lai@quanta.corp-partner.google.com>2022-06-01 11:19:39 +0800
committerSubrata Banik <subratabanik@google.com>2022-07-01 07:24:16 +0000
commit67219f73316f7b9f2bb91d195a6f95aa4e1f9e5d (patch)
treea9efc310bd403ab086ead8408c3f1baa9edc0574 /src/mainboard/google/rex/variants/baseboard
parent8481056a53f5a42bfece355595c6dad21f2fd8f4 (diff)
mb/google/rex: Add memory init
Add memory init with placeholder to fill in required memory configuration parameters. DQ map and Rcomp can be auto probed by the FSP-M hence, kept it as default. BUG=b:224325352 TEST=util/abuild/abuild -p none -t google/rex -a -c max Able to boot till FSP-M/MRC using MTL simics. Signed-off-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I5baa87411c28a20602eb5a7077f00664ccab3ade Reviewed-on: https://review.coreboot.org/c/coreboot/+/64850 Reviewed-by: Tarun Tuli <taruntuli@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/rex/variants/baseboard')
-rw-r--r--src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h6
-rw-r--r--src/mainboard/google/rex/variants/baseboard/rex/Makefile.inc1
-rw-r--r--src/mainboard/google/rex/variants/baseboard/rex/memory.c32
3 files changed, 39 insertions, 0 deletions
diff --git a/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h
index c2dbe5401d..6fd64c9246 100644
--- a/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h
@@ -4,6 +4,7 @@
#define __BASEBOARD_VARIANTS_H__
#include <soc/gpio.h>
+#include <soc/meminit.h>
#include <stdint.h>
#include <vendorcode/google/chromeos/chromeos.h>
@@ -15,4 +16,9 @@ const struct pad_config *variant_gpio_table(size_t *num);
const struct pad_config *variant_early_gpio_table(size_t *num);
const struct pad_config *variant_romstage_gpio_table(size_t *num);
+const struct mb_cfg *variant_memory_params(void);
+void variant_get_spd_info(struct mem_spd *spd_info);
+int variant_memory_sku(void);
+bool variant_is_half_populated(void);
+
#endif /*__BASEBOARD_VARIANTS_H__ */
diff --git a/src/mainboard/google/rex/variants/baseboard/rex/Makefile.inc b/src/mainboard/google/rex/variants/baseboard/rex/Makefile.inc
index 6c29346470..7d1f88652d 100644
--- a/src/mainboard/google/rex/variants/baseboard/rex/Makefile.inc
+++ b/src/mainboard/google/rex/variants/baseboard/rex/Makefile.inc
@@ -1,5 +1,6 @@
bootblock-y += gpio.c
romstage-y += gpio.c
+romstage-y += memory.c
ramstage-y += gpio.c
diff --git a/src/mainboard/google/rex/variants/baseboard/rex/memory.c b/src/mainboard/google/rex/variants/baseboard/rex/memory.c
new file mode 100644
index 0000000000..0fb80e94af
--- /dev/null
+++ b/src/mainboard/google/rex/variants/baseboard/rex/memory.c
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <baseboard/gpio.h>
+#include <baseboard/variants.h>
+#include <gpio.h>
+
+static const struct mb_cfg baseboard_memcfg = {
+ .type = MEM_TYPE_LP5X,
+ /* TODO: Add Memory configuration */
+ .ect = 1, /* Enable Early Command Training */
+};
+
+const struct mb_cfg *__weak variant_memory_params(void)
+{
+ return &baseboard_memcfg;
+}
+
+int __weak variant_memory_sku(void)
+{
+ return 0;
+}
+
+bool __weak variant_is_half_populated(void)
+{
+ return 0;
+}
+
+void __weak variant_get_spd_info(struct mem_spd *spd_info)
+{
+ spd_info->topo = MEM_TOPO_MEMORY_DOWN;
+ spd_info->cbfs_index = variant_memory_sku();
+}