aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/volteer/variants/baseboard/memory.c
diff options
context:
space:
mode:
authorNick Vaccaro <nvaccaro@google.com>2020-02-04 20:40:47 -0800
committerPatrick Georgi <pgeorgi@google.com>2020-02-11 07:52:47 +0000
commit75f0124c44a26aa2d71bb3cba7cdc42e224980ce (patch)
treefe7b07bb3fd2a8d42010de683ae180e5f3282acb /src/mainboard/google/volteer/variants/baseboard/memory.c
parent5b43484db3b41ec2b9664ef73b7e613eed813374 (diff)
mb/google/volteer: use new Tiger Lake memory config
Some of the common memory code that was being performed in mainboard has moved into the soc to reduce redundant code. This change adapts volteer to use Tiger Lake's new common code. BUG=b:145642089, b:145238504, b:145564831 BRANCH=none TEST="emerge-volteer coreboot chromeos-bootimage", flash and boot volteer, boot to kernel, "cat /proc/meminfo" and verify it reports "MemTotal: 8038196 kB". Change-Id: I32c9b8a040728d44565806eece6cf60b6b6073b6 Signed-off-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38715 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/mainboard/google/volteer/variants/baseboard/memory.c')
-rw-r--r--src/mainboard/google/volteer/variants/baseboard/memory.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/mainboard/google/volteer/variants/baseboard/memory.c b/src/mainboard/google/volteer/variants/baseboard/memory.c
new file mode 100644
index 0000000000..111719871d
--- /dev/null
+++ b/src/mainboard/google/volteer/variants/baseboard/memory.c
@@ -0,0 +1,59 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2020 The coreboot project Authors.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <baseboard/gpio.h>
+#include <baseboard/variants.h>
+#include <gpio.h>
+
+static const struct mb_lpddr4x_cfg baseboard_memcfg = {
+ /* DQ byte map */
+ .dq_map = {
+ { 0, 1, 2, 3, 4, 5, 6, 7, /* Byte 0 */
+ 12, 13, 14, 15, 11, 10, 9, 8 }, /* Byte 1 */
+ { 7, 2, 6, 3, 5, 1, 4, 0, /* Byte 2 */
+ 10, 8, 9, 11, 15, 12, 14, 13 }, /* Byte 3 */
+ { 3, 2, 1, 0, 4, 5, 6, 7, /* Byte 4 */
+ 12, 13, 14, 15, 11, 10, 9, 8 }, /* Byte 5 */
+ { 7, 0, 1, 6, 5, 4, 2, 3, /* Byte 6 */
+ 15, 14, 8, 9, 10, 12, 11, 13 }, /* Byte 7 */
+ { 3, 2, 1, 0, 4, 5, 6, 7, /* Byte 0 */
+ 12, 13, 14, 15, 11, 10, 9, 8 }, /* Byte 1 */
+ { 3, 4, 2, 5, 0, 6, 1, 7, /* Byte 2 */
+ 13, 12, 11, 10, 14, 15, 9, 8 }, /* Byte 3 */
+ { 3, 2, 1, 0, 7, 4, 5, 6, /* Byte 4 */
+ 15, 14, 13, 12, 8, 9, 10, 11 }, /* Byte 5 */
+ { 3, 4, 2, 5, 1, 0, 7, 6, /* Byte 6 */
+ 15, 14, 9, 8, 12, 10, 11, 13 } /* Byte 7 */
+ },
+
+ /* DQS CPU<>DRAM map */
+ .dqs_map = {
+ /* Ch 0 1 2 3 */
+ { 0, 1 }, { 0, 1 }, { 0, 1 }, { 0, 1 },
+ { 0, 1 }, { 0, 1 }, { 0, 1 }, { 0, 1 }
+ },
+
+ .ect = 0, /* Disable Early Command Training */
+};
+
+const struct mb_lpddr4x_cfg *__weak variant_memory_params(void)
+{
+ return &baseboard_memcfg;
+}
+
+int __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));
+}