summaryrefslogtreecommitdiff
path: root/src/mainboard/google/poppy/variants
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2017-04-14 22:11:13 -0700
committerFurquan Shaikh <furquan@google.com>2017-04-19 19:18:32 +0200
commitcbed0c26d0949489e7430013fd01c8f9ea1e3a88 (patch)
tree526de3c862432ef4641c906afac918ca6cb498e4 /src/mainboard/google/poppy/variants
parent374d1ff8aacba5fc872b76bed6daf97da55e997a (diff)
mainboard/google/poppy: Provide memory configuration variant API
Add support for memory configuration by providing weak implementation from the baseboard. All SPD files are present under spd/ directory. SPD_SOURCES must be provided by the variants to ensure that required SPD hex files are included in the SPD binary. BUG=b:37375693 Change-Id: Ic9bcc03d5a35bebd14061680f264ac072b3c0634 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/19325 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/mainboard/google/poppy/variants')
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/Makefile.inc1
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h14
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/memory.c62
-rw-r--r--src/mainboard/google/poppy/variants/poppy/Makefile.inc8
4 files changed, 85 insertions, 0 deletions
diff --git a/src/mainboard/google/poppy/variants/baseboard/Makefile.inc b/src/mainboard/google/poppy/variants/baseboard/Makefile.inc
index 37a60a41a5..160b0f84bc 100644
--- a/src/mainboard/google/poppy/variants/baseboard/Makefile.inc
+++ b/src/mainboard/google/poppy/variants/baseboard/Makefile.inc
@@ -1,6 +1,7 @@
bootblock-y += gpio.c
romstage-y += boardid.c
+romstage-y += memory.c
ramstage-y += boardid.c
ramstage-y += gpio.c
diff --git a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
index 0b7cf3519b..bf73585c2d 100644
--- a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
@@ -32,4 +32,18 @@ const struct pad_config *variant_early_gpio_table(size_t *num);
const struct cros_gpio *variant_cros_gpios(size_t *num);
+struct memory_params {
+ const void *dq_map;
+ size_t dq_map_size;
+ const void *dqs_map;
+ size_t dqs_map_size;
+ const void *rcomp_resistor;
+ size_t rcomp_resistor_size;
+ const void *rcomp_target;
+ size_t rcomp_target_size;
+};
+
+void variant_memory_params(struct memory_params *p);
+int variant_memory_sku(void);
+
#endif /* __BASEBOARD_VARIANTS_H__ */
diff --git a/src/mainboard/google/poppy/variants/baseboard/memory.c b/src/mainboard/google/poppy/variants/baseboard/memory.c
new file mode 100644
index 0000000000..d3f1286716
--- /dev/null
+++ b/src/mainboard/google/poppy/variants/baseboard/memory.c
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2017 Google 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 <baseboard/variants.h>
+#include <gpio.h>
+#include <variant/gpio.h>
+
+/* DQ byte map */
+static const u8 dq_map[][12] = {
+ { 0x0F, 0xF0, 0x00, 0xF0, 0x0F, 0xF0,
+ 0x0F, 0x00, 0xFF, 0x00, 0xFF, 0x00 },
+ { 0xCC, 0x33, 0x00, 0x33, 0xCC, 0x33,
+ 0xCC, 0x00, 0xFF, 0x00, 0xFF, 0x00 }
+};
+
+/* DQS CPU<>DRAM map */
+static const u8 dqs_map[][8] = {
+ { 2, 3, 1, 0, 4, 7, 6, 5 },
+ { 5, 6, 0, 3, 4, 7, 2, 1 },
+};
+
+/* Rcomp resistor */
+static const u16 rcomp_resistor[] = { 200, 81, 162 };
+
+/* Rcomp target */
+static const u16 rcomp_target[] = { 100, 40, 40, 23, 40 };
+
+void __attribute__((weak)) variant_memory_params(struct memory_params *p)
+{
+ p->dq_map = dq_map;
+ p->dq_map_size = sizeof(dq_map);
+ p->dqs_map = dqs_map;
+ p->dqs_map_size = sizeof(dqs_map);
+ p->rcomp_resistor = rcomp_resistor;
+ p->rcomp_resistor_size = sizeof(rcomp_resistor);
+ p->rcomp_target = rcomp_target;
+ p->rcomp_target_size = sizeof(rcomp_target);
+}
+
+int __attribute__((weak)) variant_memory_sku(void)
+{
+ gpio_t spd_gpios[] = {
+ GPIO_MEM_CONFIG_0,
+ GPIO_MEM_CONFIG_1,
+ GPIO_MEM_CONFIG_2,
+ GPIO_MEM_CONFIG_3,
+ };
+
+ return gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios));
+}
diff --git a/src/mainboard/google/poppy/variants/poppy/Makefile.inc b/src/mainboard/google/poppy/variants/poppy/Makefile.inc
new file mode 100644
index 0000000000..41e40f7ee7
--- /dev/null
+++ b/src/mainboard/google/poppy/variants/poppy/Makefile.inc
@@ -0,0 +1,8 @@
+
+SPD_SOURCES = empty # 0b0000
+SPD_SOURCES += empty # 0b0001
+SPD_SOURCES += empty # 0b0010
+SPD_SOURCES += micron_dimm_MT52L512M64D4PQ-107 # 0b0011
+SPD_SOURCES += hynix_dimm_H9CCNNNCPTALBR-NUD # 0b0100
+SPD_SOURCES += micron_dimm_MT52L1G64D8QC-107 # 0b0101
+SPD_SOURCES += hynix_dimm_H9CCNNNFAGMLLR-NUD # 0b0110