summaryrefslogtreecommitdiffstats
path: root/src/mainboard/google/brya/variants/nereid
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/brya/variants/nereid')
-rw-r--r--src/mainboard/google/brya/variants/nereid/Makefile.inc3
-rw-r--r--src/mainboard/google/brya/variants/nereid/memory.c29
2 files changed, 32 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/variants/nereid/Makefile.inc b/src/mainboard/google/brya/variants/nereid/Makefile.inc
index 58c4d79e0251..defb592f2f6d 100644
--- a/src/mainboard/google/brya/variants/nereid/Makefile.inc
+++ b/src/mainboard/google/brya/variants/nereid/Makefile.inc
@@ -1,4 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
bootblock-y += gpio.c
+
romstage-y += gpio.c
+romstage-y += memory.c
+
ramstage-y += gpio.c
diff --git a/src/mainboard/google/brya/variants/nereid/memory.c b/src/mainboard/google/brya/variants/nereid/memory.c
new file mode 100644
index 000000000000..0453cf1748a1
--- /dev/null
+++ b/src/mainboard/google/brya/variants/nereid/memory.c
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <baseboard/variants.h>
+#include <boardid.h>
+#include <gpio.h>
+
+int variant_memory_sku(void)
+{
+ /*
+ * The memory straps in the P0 build don't match those generated by
+ * spd_tools, so override the memory ID to 0.
+ */
+ if (board_id() == 0)
+ return 0;
+
+ /*
+ * Memory configuration board straps
+ * GPIO_MEM_CONFIG_0 GPP_E1
+ * GPIO_MEM_CONFIG_1 GPP_E2
+ * GPIO_MEM_CONFIG_2 GPP_E3
+ */
+ gpio_t spd_gpios[] = {
+ GPP_E1,
+ GPP_E2,
+ GPP_E3,
+ };
+
+ return gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios));
+}