Angel Pons has submitted this change. ( https://review.coreboot.org/c/coreboot/+/50963 )
Change subject: soc/intel/skylake: Clean up SD GPIO handling ......................................................................
soc/intel/skylake: Clean up SD GPIO handling
This is to align with newer platforms.
Change-Id: If33ea3a7835ec071be3fd060f9712c47678bd6bf Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/50963 Reviewed-by: Michael Niewöhner foss@mniewoehner.de Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/fizz/variants/fizz/overridetree.cb M src/mainboard/google/glados/variants/cave/overridetree.cb M src/mainboard/google/glados/variants/sentry/overridetree.cb M src/mainboard/google/poppy/variants/baseboard/devicetree.cb M src/mainboard/google/poppy/variants/nautilus/devicetree.cb M src/mainboard/google/poppy/variants/rammus/devicetree.cb M src/mainboard/google/poppy/variants/soraka/devicetree.cb M src/mainboard/intel/kblrvp/variants/rvp7/overridetree.cb M src/mainboard/intel/kblrvp/variants/rvp8/overridetree.cb M src/mainboard/intel/kunimitsu/devicetree.cb M src/mainboard/intel/saddlebrook/devicetree.cb M src/soc/intel/skylake/chip.h M src/soc/intel/skylake/sd.c 13 files changed, 24 insertions(+), 31 deletions(-)
Approvals: build bot (Jenkins): Verified Tim Wawrzynczak: Looks good to me, approved Michael Niewöhner: Looks good to me, but someone else must approve
diff --git a/src/mainboard/google/fizz/variants/fizz/overridetree.cb b/src/mainboard/google/fizz/variants/fizz/overridetree.cb index 2b30905..3394bdf 100644 --- a/src/mainboard/google/fizz/variants/fizz/overridetree.cb +++ b/src/mainboard/google/fizz/variants/fizz/overridetree.cb @@ -1,7 +1,7 @@ chip soc/intel/skylake
# Use default SD card detect GPIO configuration - register "sdcard_cd_gpio_default" = "GPP_A7" + register "sdcard_cd_gpio" = "GPP_A7"
device domain 0 on device pci 14.0 on diff --git a/src/mainboard/google/glados/variants/cave/overridetree.cb b/src/mainboard/google/glados/variants/cave/overridetree.cb index e77a2b4..bd3c139 100644 --- a/src/mainboard/google/glados/variants/cave/overridetree.cb +++ b/src/mainboard/google/glados/variants/cave/overridetree.cb @@ -23,7 +23,7 @@ register "tcc_offset" = "10"
# Use default SD card detect GPIO configuration - register "sdcard_cd_gpio_default" = "GPP_A7" + register "sdcard_cd_gpio" = "GPP_A7"
device domain 0 on device pci 15.0 on diff --git a/src/mainboard/google/glados/variants/sentry/overridetree.cb b/src/mainboard/google/glados/variants/sentry/overridetree.cb index 36575f8..28bc2fb 100644 --- a/src/mainboard/google/glados/variants/sentry/overridetree.cb +++ b/src/mainboard/google/glados/variants/sentry/overridetree.cb @@ -16,7 +16,7 @@ register "i2c_voltage[0]" = "I2C_VOLTAGE_3V3"
# Use default SD card detect GPIO configuration - register "sdcard_cd_gpio_default" = "GPP_A7" + register "sdcard_cd_gpio" = "GPP_A7"
device domain 0 on device pci 15.0 on diff --git a/src/mainboard/google/poppy/variants/baseboard/devicetree.cb b/src/mainboard/google/poppy/variants/baseboard/devicetree.cb index 4bfac6d..09bdac4 100644 --- a/src/mainboard/google/poppy/variants/baseboard/devicetree.cb +++ b/src/mainboard/google/poppy/variants/baseboard/devicetree.cb @@ -251,7 +251,7 @@ register "tcc_offset" = "10" # TCC of 90C
# Use default SD card detect GPIO configuration - register "sdcard_cd_gpio_default" = "GPP_E15" + register "sdcard_cd_gpio" = "GPP_E15"
device cpu_cluster 0 on device lapic 0 on end diff --git a/src/mainboard/google/poppy/variants/nautilus/devicetree.cb b/src/mainboard/google/poppy/variants/nautilus/devicetree.cb index 9563298..6eb83ac 100644 --- a/src/mainboard/google/poppy/variants/nautilus/devicetree.cb +++ b/src/mainboard/google/poppy/variants/nautilus/devicetree.cb @@ -273,7 +273,7 @@ register "tcc_offset" = "10" # TCC of 90C
# Use default SD card detect GPIO configuration - register "sdcard_cd_gpio_default" = "GPP_E15" + register "sdcard_cd_gpio" = "GPP_E15"
device cpu_cluster 0 on device lapic 0 on end diff --git a/src/mainboard/google/poppy/variants/rammus/devicetree.cb b/src/mainboard/google/poppy/variants/rammus/devicetree.cb index 162b437..05f62e7 100644 --- a/src/mainboard/google/poppy/variants/rammus/devicetree.cb +++ b/src/mainboard/google/poppy/variants/rammus/devicetree.cb @@ -232,7 +232,7 @@ register "tcc_offset" = "10" # TCC of 90C
# Use default SD card detect GPIO configuration - register "sdcard_cd_gpio_default" = "GPP_E15" + register "sdcard_cd_gpio" = "GPP_E15"
device cpu_cluster 0 on device lapic 0 on end diff --git a/src/mainboard/google/poppy/variants/soraka/devicetree.cb b/src/mainboard/google/poppy/variants/soraka/devicetree.cb index 6a37b8a..ac8fbc9 100644 --- a/src/mainboard/google/poppy/variants/soraka/devicetree.cb +++ b/src/mainboard/google/poppy/variants/soraka/devicetree.cb @@ -252,7 +252,7 @@ register "tcc_offset" = "10" # TCC of 90C
# Use default SD card detect GPIO configuration - register "sdcard_cd_gpio_default" = "GPP_E15" + register "sdcard_cd_gpio" = "GPP_E15"
device cpu_cluster 0 on device lapic 0 on end diff --git a/src/mainboard/intel/kblrvp/variants/rvp7/overridetree.cb b/src/mainboard/intel/kblrvp/variants/rvp7/overridetree.cb index e649ed7..20c147c 100644 --- a/src/mainboard/intel/kblrvp/variants/rvp7/overridetree.cb +++ b/src/mainboard/intel/kblrvp/variants/rvp7/overridetree.cb @@ -150,7 +150,7 @@
# Use default SD card detect GPIO configuration - register "sdcard_cd_gpio_default" = "GPP_G5" + register "sdcard_cd_gpio" = "GPP_G5"
# Lock Down register "common_soc_config" = "{ diff --git a/src/mainboard/intel/kblrvp/variants/rvp8/overridetree.cb b/src/mainboard/intel/kblrvp/variants/rvp8/overridetree.cb index 115e338..a76159b 100644 --- a/src/mainboard/intel/kblrvp/variants/rvp8/overridetree.cb +++ b/src/mainboard/intel/kblrvp/variants/rvp8/overridetree.cb @@ -156,7 +156,7 @@ }"
# Use default SD card detect GPIO configuration - #register "sdcard_cd_gpio_default" = "GPP_D10" + #register "sdcard_cd_gpio" = "GPP_D10"
device domain 0 on device pci 17.0 on end # SATA diff --git a/src/mainboard/intel/kunimitsu/devicetree.cb b/src/mainboard/intel/kunimitsu/devicetree.cb index 85586cb..505a598 100644 --- a/src/mainboard/intel/kunimitsu/devicetree.cb +++ b/src/mainboard/intel/kunimitsu/devicetree.cb @@ -156,7 +156,7 @@ register "SendVrMbxCmd" = "2"
# Use default SD card detect GPIO configuration - register "sdcard_cd_gpio_default" = "GPP_A7" + register "sdcard_cd_gpio" = "GPP_A7"
# Lock Down register "common_soc_config" = "{ diff --git a/src/mainboard/intel/saddlebrook/devicetree.cb b/src/mainboard/intel/saddlebrook/devicetree.cb index 0da097f..d049db1 100644 --- a/src/mainboard/intel/saddlebrook/devicetree.cb +++ b/src/mainboard/intel/saddlebrook/devicetree.cb @@ -197,7 +197,7 @@ register "SendVrMbxCmd" = "2"
# Use default SD card detect GPIO configuration - #register "sdcard_cd_gpio_default" = "GPP_A7" + #register "sdcard_cd_gpio" = "GPP_A7"
device cpu_cluster 0 on device lapic 0 on end diff --git a/src/soc/intel/skylake/chip.h b/src/soc/intel/skylake/chip.h index bef0f12..99eb8e6 100644 --- a/src/soc/intel/skylake/chip.h +++ b/src/soc/intel/skylake/chip.h @@ -427,12 +427,9 @@ * * GpioInt (Edge, ActiveBoth, SharedAndWake, PullNone, 10000, * "\_SB.PCI0.GPIO", 0, ResourceConsumer) - * { sdcard_cd_gpio_default } + * { sdcard_cd_gpio } */ - unsigned int sdcard_cd_gpio_default; - - /* Use custom SD card detect GPIO configuration */ - struct acpi_gpio sdcard_cd_gpio; + unsigned int sdcard_cd_gpio;
/* Wake Enable Bitmap for USB2 ports */ u16 usb2_wake_enable_bitmap; diff --git a/src/soc/intel/skylake/sd.c b/src/soc/intel/skylake/sd.c index ba56182..46d3852 100644 --- a/src/soc/intel/skylake/sd.c +++ b/src/soc/intel/skylake/sd.c @@ -3,26 +3,22 @@ #include <intelblocks/sd.h> #include "chip.h"
-int sd_fill_soc_gpio_info(struct acpi_gpio* gpio, const struct device *dev) +int sd_fill_soc_gpio_info(struct acpi_gpio *gpio, const struct device *dev) { config_t *config = config_of(dev);
- /* Nothing to write if GPIO is not set in devicetree */ - if (!config->sdcard_cd_gpio_default && !config->sdcard_cd_gpio.pins[0]) + if (!config->sdcard_cd_gpio) return -1;
- if (config->sdcard_cd_gpio_default) { - gpio->type = ACPI_GPIO_TYPE_INTERRUPT; - gpio->pull = ACPI_GPIO_PULL_NONE; - gpio->irq.mode = ACPI_IRQ_EDGE_TRIGGERED; - gpio->irq.polarity = ACPI_IRQ_ACTIVE_BOTH; - gpio->irq.shared = ACPI_IRQ_SHARED; - gpio->irq.wake = ACPI_IRQ_WAKE; - gpio->interrupt_debounce_timeout = 10000; /* 100ms */ - gpio->pin_count = 1; - gpio->pins[0] = config->sdcard_cd_gpio_default; - } else - *gpio = config->sdcard_cd_gpio; + gpio->type = ACPI_GPIO_TYPE_INTERRUPT; + gpio->pull = ACPI_GPIO_PULL_NONE; + gpio->irq.mode = ACPI_IRQ_EDGE_TRIGGERED; + gpio->irq.polarity = ACPI_IRQ_ACTIVE_BOTH; + gpio->irq.shared = ACPI_IRQ_SHARED; + gpio->irq.wake = ACPI_IRQ_WAKE; + gpio->interrupt_debounce_timeout = 10000; /* 100ms */ + gpio->pin_count = 1; + gpio->pins[0] = config->sdcard_cd_gpio;
return 0; }