David Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34789 )
Change subject: mb/google/hatch/var/kindred: Disable SATA and config gpios for eMMC SKUs ......................................................................
mb/google/hatch/var/kindred: Disable SATA and config gpios for eMMC SKUs
1. Disable SATA controller and SATA port 1 2. Config GPIOs for eMMC SKUs
BUG=b:132918661 TEST=Verify SSD is disabled when SKU ID = 2/4/21/22
Change-Id: I6d95ff94b079a564f74c19739370101899843f00 Signed-off-by: David Wu david_wu@quanta.corp-partner.google.com --- M src/mainboard/google/hatch/variants/kindred/gpio.c M src/mainboard/google/hatch/variants/kindred/variant.c 2 files changed, 33 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/34789/1
diff --git a/src/mainboard/google/hatch/variants/kindred/gpio.c b/src/mainboard/google/hatch/variants/kindred/gpio.c index 86db690..ad0dda1 100644 --- a/src/mainboard/google/hatch/variants/kindred/gpio.c +++ b/src/mainboard/google/hatch/variants/kindred/gpio.c @@ -81,6 +81,16 @@ PAD_NC(GPP_F22, NONE), };
+/* Config GPIOs for eMMC SKUs */ +static const struct pad_config emmc_sku_gpio_table[] = { + /* E1 : M2_SSD_PEDET */ + PAD_NC(GPP_E1, NONE), + /* E4 : M2_SSD_PE_WAKE_ODL */ + PAD_NC(GPP_E4, NONE), + /* E5 : SATA_DEVSLP1 */ + PAD_NC(GPP_E5, NONE), +}; + static const struct pad_config default_sku_gpio_table[] = { /* F11 : EMMC_CMD ==> EMMC_CMD */ PAD_CFG_NF(GPP_F11, NONE, DEEP, NF1), @@ -118,13 +128,25 @@ board_gpio_tables = ssd_sku_gpio_table; break; case 2: + *num = ARRAY_SIZE(emmc_sku_gpio_table); + board_gpio_tables = emmc_sku_gpio_table; + break; case 3: *num = ARRAY_SIZE(ssd_sku_gpio_table); board_gpio_tables = ssd_sku_gpio_table; break; case 4: + *num = ARRAY_SIZE(emmc_sku_gpio_table); + board_gpio_tables = emmc_sku_gpio_table; + break; case 21: + *num = ARRAY_SIZE(emmc_sku_gpio_table); + board_gpio_tables = emmc_sku_gpio_table; + break; case 22: + *num = ARRAY_SIZE(emmc_sku_gpio_table); + board_gpio_tables = emmc_sku_gpio_table; + break; case 23: *num = ARRAY_SIZE(ssd_sku_gpio_table); board_gpio_tables = ssd_sku_gpio_table; diff --git a/src/mainboard/google/hatch/variants/kindred/variant.c b/src/mainboard/google/hatch/variants/kindred/variant.c index 5405947..45cef7e 100644 --- a/src/mainboard/google/hatch/variants/kindred/variant.c +++ b/src/mainboard/google/hatch/variants/kindred/variant.c @@ -22,11 +22,10 @@ { uint32_t sku_id; struct device *emmc_host; + struct device *ssd_host; config_t *cfg = config_of_path(SA_DEVFN_ROOT); emmc_host = pcidev_path_on_root(PCH_DEVFN_EMMC); - - if (emmc_host == NULL) - return; + ssd_host = pcidev_path_on_root(PCH_DEVFN_SATA);
/* SKU ID 1/3/23/24 doesn't have a eMMC device, hence disable it. */ sku_id = get_board_sku(); @@ -34,4 +33,13 @@ emmc_host->enabled = 0; cfg->ScsEmmcHs400Enabled = 0; } + /* SKU ID 2/4/21/22 doesn't have a SSD device, hence disable it. */ + if (sku_id == 2 || sku_id == 4 || sku_id == 21 || sku_id == 22) { + ssd_host->enabled = 0; + cfg->SataSalpSupport = 0; + cfg->SataMode = 0; + cfg->SataPortsEnable[1] = 0; + cfg->SataPortsDevSlp[1] = 0; + cfg->satapwroptimize = 0; + } }