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; + } }
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34789 )
Change subject: mb/google/hatch/var/kindred: Disable SATA and config gpios for eMMC SKUs ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34789/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34789/1//COMMIT_MSG@7 PS1, Line 7: mb/google/hatch/var/kindred: Disable SATA and config gpios for eMMC SKUs Please make that two commits.
Hello Paul Fagerburg, Tim Wawrzynczak, Philip Chen, Shelley Chen, build bot (Jenkins), Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34789
to look at the new patch set (#2).
Change subject: mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs ......................................................................
mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs
Disable SATA controller and SATA port 1 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/variant.c 1 file changed, 11 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/34789/2
David Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34789 )
Change subject: mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34789/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34789/1//COMMIT_MSG@7 PS1, Line 7: mb/google/hatch/var/kindred: Disable SATA and config gpios for eMMC SKUs
Please make that two commits.
Done
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34789 )
Change subject: mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34789/2/src/mainboard/google/hatch/... File src/mainboard/google/hatch/variants/kindred/variant.c:
https://review.coreboot.org/c/coreboot/+/34789/2/src/mainboard/google/hatch/... PS2, Line 33: emmc_host->enabled = 0; Check for NULL before dereferencing
https://review.coreboot.org/c/coreboot/+/34789/2/src/mainboard/google/hatch/... PS2, Line 38: ssd_host->enabled = 0; Check for NULL before dereferencing
Hello Paul Fagerburg, Tim Wawrzynczak, Philip Chen, Shelley Chen, build bot (Jenkins), Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34789
to look at the new patch set (#3).
Change subject: mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs ......................................................................
mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs
Disable SATA controller and SATA port 1 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/variant.c 1 file changed, 15 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/34789/3
David Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34789 )
Change subject: mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34789/2/src/mainboard/google/hatch/... File src/mainboard/google/hatch/variants/kindred/variant.c:
https://review.coreboot.org/c/coreboot/+/34789/2/src/mainboard/google/hatch/... PS2, Line 33: emmc_host->enabled = 0;
Check for NULL before dereferencing
Done
https://review.coreboot.org/c/coreboot/+/34789/2/src/mainboard/google/hatch/... PS2, Line 38: ssd_host->enabled = 0;
Check for NULL before dereferencing
Done
Paul Fagerburg has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34789 )
Change subject: mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs ......................................................................
Patch Set 3: Code-Review+1
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34789 )
Change subject: mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs ......................................................................
Patch Set 3: Code-Review+1
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34789 )
Change subject: mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs ......................................................................
Patch Set 5: Code-Review+2
Furquan Shaikh has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/34789 )
Change subject: mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs ......................................................................
mb/google/hatch/var/kindred: Disable SATA controller for eMMC SKUs
Disable SATA controller and SATA port 1 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/34789 Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org Reviewed-by: Paul Fagerburg pfagerburg@chromium.org Reviewed-by: Paul Menzel paulepanter@users.sourceforge.net Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/hatch/variants/kindred/variant.c 1 file changed, 15 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve Tim Wawrzynczak: Looks good to me, approved Paul Fagerburg: Looks good to me, but someone else must approve
diff --git a/src/mainboard/google/hatch/variants/kindred/variant.c b/src/mainboard/google/hatch/variants/kindred/variant.c index 5405947..6cd017b 100644 --- a/src/mainboard/google/hatch/variants/kindred/variant.c +++ b/src/mainboard/google/hatch/variants/kindred/variant.c @@ -22,16 +22,28 @@ { 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(); if (sku_id == 1 || sku_id == 3 || sku_id == 23 || sku_id == 24) { + if (emmc_host == NULL) + return; 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) { + if (ssd_host == NULL) + return; + ssd_host->enabled = 0; + cfg->SataSalpSupport = 0; + cfg->SataMode = 0; + cfg->SataPortsEnable[1] = 0; + cfg->SataPortsDevSlp[1] = 0; + cfg->satapwroptimize = 0; + } }