summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKapil Porwal <kapilporwal@google.com>2023-02-21 18:36:31 +0530
committerFelix Held <felix-coreboot@felixheld.de>2023-02-23 12:19:35 +0000
commit8c1075a592f6bd8eae1e0aefb0257b767696c997 (patch)
tree9269248f4d1fc19d5a0041fff4ebb7606b4a9e71 /src
parentecfdb43afacfb32c3a632288747afd705c89ba87 (diff)
mb/google/rex: Use 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. Port of commit 7aef2b1294f2 ("mb/google/nissa: Apply gpio padbased table override") BUG=none TEST=Verify devbeep at depthcharge console Signed-off-by: Kapil Porwal <kapilporwal@google.com> Change-Id: I2ee86bbec7d25a35d726f29ad79891f1054bf52c Reviewed-on: https://review.coreboot.org/c/coreboot/+/73182 Reviewed-by: Subrata Banik <subratabanik@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/rex/mainboard.c20
-rw-r--r--src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h1
2 files changed, 17 insertions, 4 deletions
diff --git a/src/mainboard/google/rex/mainboard.c b/src/mainboard/google/rex/mainboard.c
index bb64c6380f..c1c22dba50 100644
--- a/src/mainboard/google/rex/mainboard.c
+++ b/src/mainboard/google/rex/mainboard.c
@@ -8,16 +8,28 @@
#include <drivers/wwan/fm/chip.h>
#include <ec/ec.h>
#include <fw_config.h>
+#include <stdlib.h>
#include <vendorcode/google/chromeos/chromeos.h>
WEAK_DEV_PTR(rp6_wwan);
+void __weak fw_config_gpio_padbased_override(struct pad_config *padbased_table)
+{
+ /* default implementation does nothing */
+}
+
static void mainboard_init(void *chip_info)
{
- const struct pad_config *pads;
- size_t num;
- pads = variant_gpio_table(&num);
- gpio_configure_pads(pads, num);
+ struct pad_config *padbased_table;
+ const struct pad_config *base_pads;
+ size_t base_num;
+
+ padbased_table = new_padbased_table();
+ base_pads = variant_gpio_table(&base_num);
+ gpio_padbased_override(padbased_table, base_pads, base_num);
+ fw_config_gpio_padbased_override(padbased_table);
+ gpio_configure_pads_with_padbased(padbased_table);
+ free(padbased_table);
}
void __weak variant_generate_s0ix_hook(enum s0ix_entry entry)
diff --git a/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h
index f3ace8a3f7..b51517c403 100644
--- a/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h
@@ -15,6 +15,7 @@
const struct pad_config *variant_gpio_table(size_t *num);
const struct pad_config *variant_early_gpio_table(size_t *num);
const struct pad_config *variant_romstage_gpio_table(size_t *num);
+void fw_config_gpio_padbased_override(struct pad_config *padbased_table);
const struct mb_cfg *variant_memory_params(void);
void variant_get_spd_info(struct mem_spd *spd_info);