Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/85958?usp=email )
Change subject: mb/google/fatcat/var/fatcat: Refactor GPIO programming for UFS support ......................................................................
mb/google/fatcat/var/fatcat: Refactor GPIO programming for UFS support
Refactor GPIO programming to support UFS storage on the fatcat platform.
- Add pad configurations for UFS in `fw_config.c`. - Update `fw_config_configure_pre_mem_gpio()` and `fw_config_gpio_padbased_override()` to include UFS support. - Remove redundant UFS pad configuration from `gpio.c`.
TEST=Able to build and boot from UFS device on google/fatcat.
Change-Id: I09331d75501977d89592d1a70d5b0dca271f8747 Signed-off-by: Subrata Banik subratabanik@google.com --- M src/mainboard/google/fatcat/variants/fatcat/fw_config.c M src/mainboard/google/fatcat/variants/fatcat/gpio.c 2 files changed, 10 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/58/85958/1
diff --git a/src/mainboard/google/fatcat/variants/fatcat/fw_config.c b/src/mainboard/google/fatcat/variants/fatcat/fw_config.c index ac2155f..0ba6048 100644 --- a/src/mainboard/google/fatcat/variants/fatcat/fw_config.c +++ b/src/mainboard/google/fatcat/variants/fatcat/fw_config.c @@ -210,6 +210,11 @@ PAD_CFG_GPO(GPP_B09, 1, PLTRST), };
+static const struct pad_config ufs_enable_pads[] = { + /* GPP_D21: GPP_D21_UFS_REFCLK */ + PAD_CFG_NF(GPP_D21, NONE, DEEP, NF1), +}; + /* Gen5 NVME: at the bottom M.2 slot */ static const struct pad_config pre_mem_gen5_ssd_pwr_pads[] = { /* GPP_B16: GEN5_SSD_PWREN */ @@ -484,12 +489,9 @@ GPIO_CONFIGURE_PADS(pre_mem_gen4_ssd_pwr_pads); } else if (fw_config_probe(FW_CONFIG(STORAGE, STORAGE_NVME_GEN5))) { GPIO_CONFIGURE_PADS(pre_mem_gen5_ssd_pwr_pads); - /* TODO: else if (fw_config_probe(FW_CONFIG(STORAGE, STORAGE_UFS))) - */ } else if (fw_config_probe(FW_CONFIG(STORAGE, STORAGE_UNKNOWN))) { GPIO_CONFIGURE_PADS(pre_mem_gen4_ssd_pwr_pads); GPIO_CONFIGURE_PADS(pre_mem_gen5_ssd_pwr_pads); - /* TODO for UFS */ }
if (!fw_config_probe(FW_CONFIG(SD, SD_NONE))) @@ -524,12 +526,12 @@ GPIO_PADBASED_OVERRIDE(padbased_table, gen4_ssd_pads); } else if (fw_config_probe(FW_CONFIG(STORAGE, STORAGE_NVME_GEN5))) { GPIO_PADBASED_OVERRIDE(padbased_table, gen5_ssd_pads); - /* TODO: else if (fw_config_probe(FW_CONFIG(STORAGE, STORAGE_UFS))) - */ + } else if (fw_config_probe(FW_CONFIG(STORAGE, STORAGE_UFS))) { + GPIO_PADBASED_OVERRIDE(padbased_table, ufs_enable_pads); } else if (fw_config_probe(FW_CONFIG(STORAGE, STORAGE_UNKNOWN))) { GPIO_PADBASED_OVERRIDE(padbased_table, gen4_ssd_pads); GPIO_PADBASED_OVERRIDE(padbased_table, gen5_ssd_pads); - /* TODO for UFS */ + GPIO_PADBASED_OVERRIDE(padbased_table, ufs_enable_pads); }
if (fw_config_probe(FW_CONFIG(AUDIO, AUDIO_NONE))) diff --git a/src/mainboard/google/fatcat/variants/fatcat/gpio.c b/src/mainboard/google/fatcat/variants/fatcat/gpio.c index d6fea09..cf1e040 100644 --- a/src/mainboard/google/fatcat/variants/fatcat/gpio.c +++ b/src/mainboard/google/fatcat/variants/fatcat/gpio.c @@ -175,8 +175,8 @@ PAD_CFG_NF(GPP_D18, NONE, DEEP, NF1), /* GPP_D20: CSE_EARLY_SW */ PAD_CFG_GPI_SCI_HIGH(GPP_D20, NONE, DEEP, LEVEL), - /* GPP_D21: GPP_D21_UFS_REFCLK */ - PAD_CFG_NF(GPP_D21, NONE, DEEP, NF1), + /* GPP_D21: NC */ + PAD_NC(GPP_D21, NONE), /* GPP_D22: BPKI3C_SDA */ PAD_CFG_NF(GPP_D22, NONE, DEEP, NF1), /* GPP_D23: BPKI3C_SCL */