summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-08-05 20:59:25 -0700
committerFurquan Shaikh <furquan@google.com>2018-08-07 02:38:53 +0000
commitfb10ceb8a71f0c6d2bc3866562f946c04bcd1211 (patch)
tree4f0d8435f4ff4587d5bbb048297d521dcd50e57f /src
parentefc71c8059a269d2a0e9b22df905941c275ed3a3 (diff)
mb/google/poppy: Add variant callback for romstage GPIO configuration
This change adds variant callback to get GPIO configuration table in romstage and configures these GPIOs before memory training is performed. BUG=b:111860510 BRANCH=poppy Change-Id: I1eb51356fb3f4c0f4ff29b22dbcde6dbece303ad Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/27863 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/poppy/romstage.c8
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/Makefile.inc1
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/gpio.c6
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h6
4 files changed, 21 insertions, 0 deletions
diff --git a/src/mainboard/google/poppy/romstage.c b/src/mainboard/google/poppy/romstage.c
index f49fbf423f..af4f70b4a3 100644
--- a/src/mainboard/google/poppy/romstage.c
+++ b/src/mainboard/google/poppy/romstage.c
@@ -17,8 +17,10 @@
#include <baseboard/variants.h>
#include <cbfs.h>
#include <console/console.h>
+#include <soc/gpio.h>
#include <soc/romstage.h>
#include <string.h>
+#include <variant/gpio.h>
#include <fsp/soc_binding.h>
@@ -147,6 +149,12 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
FSP_M_CONFIG *mem_cfg = &mupd->FspmConfig;
struct memory_params p;
+ const struct pad_config *pads;
+ size_t num;
+
+ pads = variant_romstage_gpio_table(&num);
+ gpio_configure_pads(pads, num);
+
memset(&p, 0, sizeof(p));
variant_memory_params(&p);
diff --git a/src/mainboard/google/poppy/variants/baseboard/Makefile.inc b/src/mainboard/google/poppy/variants/baseboard/Makefile.inc
index 1d25510dff..41669f2114 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 += memory.c
+romstage-y += gpio.c
ramstage-y += gpio.c
ramstage-y += nhlt.c
diff --git a/src/mainboard/google/poppy/variants/baseboard/gpio.c b/src/mainboard/google/poppy/variants/baseboard/gpio.c
index 25202e6139..c1b8e4ce55 100644
--- a/src/mainboard/google/poppy/variants/baseboard/gpio.c
+++ b/src/mainboard/google/poppy/variants/baseboard/gpio.c
@@ -403,3 +403,9 @@ const struct cros_gpio * __weak variant_cros_gpios(size_t *num)
*num = ARRAY_SIZE(cros_gpios);
return cros_gpios;
}
+
+const struct pad_config * __weak variant_romstage_gpio_table(size_t *num)
+{
+ *num = 0;
+ return NULL;
+}
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 7e850b6e78..391f809c16 100644
--- a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
@@ -27,6 +27,12 @@
const struct pad_config *variant_gpio_table(size_t *num);
const struct pad_config *variant_early_gpio_table(size_t *num);
+/*
+ * Callback to get GPIOs to configure in romstage before memory training is
+ * performed.
+ */
+const struct pad_config *variant_romstage_gpio_table(size_t *num);
+
const struct cros_gpio *variant_cros_gpios(size_t *num);
/* Config gpio by different sku id */
const struct pad_config *variant_sku_gpio_table(size_t *num);