summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Lai <eric_lai@quanta.corp-partner.google.com>2022-05-27 09:32:06 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-06-27 13:40:00 +0000
commit7aef2b1294f2da607b5e6b85dcf75fac4664ddd3 (patch)
tree1e13cdbdf578773b517e9f8bc687b51c2eae315b /src
parentce026c93658d05c8cb7086c71153f357b4628dcf (diff)
mb/google/nissa: Apply gpio padbased table override
In order to improve gpio merge mechanism. Change iteration override to padbased table override. And the following patch will change fw config override with ramstage gpio table override. BUG=b:231690996 TEST=check gpios in pinctrl are the same. Signed-off-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Change-Id: I3d0beabc2c185405cb0af31e5506b6df94e9522c Reviewed-on: https://review.coreboot.org/c/coreboot/+/64713 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/brya/mainboard.c6
-rw-r--r--src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h1
-rw-r--r--src/mainboard/google/brya/variants/baseboard/nissa/Makefile.inc1
-rw-r--r--src/mainboard/google/brya/variants/baseboard/nissa/ramstage.c23
4 files changed, 30 insertions, 1 deletions
diff --git a/src/mainboard/google/brya/mainboard.c b/src/mainboard/google/brya/mainboard.c
index 3c5b2c39c9..7e933f359c 100644
--- a/src/mainboard/google/brya/mainboard.c
+++ b/src/mainboard/google/brya/mainboard.c
@@ -69,7 +69,7 @@ void __weak variant_init(void)
/* default implementation does nothing */
}
-static void mainboard_init(void *chip_info)
+void __weak variant_configure_pads(void)
{
const struct pad_config *base_pads;
const struct pad_config *override_pads;
@@ -78,7 +78,11 @@ static void mainboard_init(void *chip_info)
base_pads = variant_gpio_table(&base_num);
override_pads = variant_gpio_override_table(&override_num);
gpio_configure_pads_with_override(base_pads, base_num, override_pads, override_num);
+}
+static void mainboard_init(void *chip_info)
+{
+ variant_configure_pads();
variant_init();
variant_devtree_update();
}
diff --git a/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h
index 42e76227b6..ce849d0521 100644
--- a/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h
@@ -23,6 +23,7 @@ int variant_memory_sku(void);
bool variant_is_half_populated(void);
void variant_update_soc_chip_config(struct soc_intel_alderlake_config *config);
void variant_fill_ssdt(const struct device *dev);
+void variant_configure_pads(void);
enum s0ix_entry {
S0IX_EXIT,
diff --git a/src/mainboard/google/brya/variants/baseboard/nissa/Makefile.inc b/src/mainboard/google/brya/variants/baseboard/nissa/Makefile.inc
index 1693d2e263..8a4b2acfaa 100644
--- a/src/mainboard/google/brya/variants/baseboard/nissa/Makefile.inc
+++ b/src/mainboard/google/brya/variants/baseboard/nissa/Makefile.inc
@@ -4,3 +4,4 @@ romstage-y += memory.c
romstage-y += gpio.c
ramstage-y += gpio.c
+ramstage-y += ramstage.c
diff --git a/src/mainboard/google/brya/variants/baseboard/nissa/ramstage.c b/src/mainboard/google/brya/variants/baseboard/nissa/ramstage.c
new file mode 100644
index 0000000000..7f4e291abc
--- /dev/null
+++ b/src/mainboard/google/brya/variants/baseboard/nissa/ramstage.c
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <baseboard/gpio.h>
+#include <baseboard/variants.h>
+#include <gpio.h>
+#include <soc/gpio.h>
+#include <soc/ramstage.h>
+
+void variant_configure_pads(void)
+{
+ const struct pad_config *base_pads;
+ const struct pad_config *override_pads;
+ struct pad_config *padbased_table;
+ size_t base_num, override_num;
+
+ padbased_table = new_padbased_table();
+ base_pads = variant_gpio_table(&base_num);
+ gpio_padbased_override(padbased_table, base_pads, base_num);
+ override_pads = variant_gpio_override_table(&override_num);
+ gpio_padbased_override(padbased_table, override_pads, override_num);
+ gpio_configure_pads_with_padbased(padbased_table);
+ free(padbased_table);
+}