diff options
author | Duncan Laurie <dlaurie@chromium.org> | 2016-05-10 15:56:16 -0700 |
---|---|---|
committer | Duncan Laurie <dlaurie@chromium.org> | 2016-05-31 18:46:39 +0200 |
commit | b25a45ca46478bb5b0989f7e3f3aa5bdd8b36ef2 (patch) | |
tree | 127f57edb659d790e91b4cfb3b048e83a1788432 /src/soc/intel/skylake/chip.h | |
parent | 98d69c0627f47d79554f33893ca332d37d974799 (diff) |
skylake: Add SD card device to configure card detect GPIO
Add a PCI driver for the skylake SD card device and have it generate
an entry in the SSDT for the card detect GPIO if it is provided by the
mainboard in devicetree.
This sets up a card detect GPIO configuration that will trigger an
interrupt on both edges with a 100ms debounce timeout and can wake the
SD controller from D3 state.
The GpioInt() entry is bound to the "cd-gpio" device property which will
be consumed by the kernel driver.
The resulting ACPI output in the SSDT will be combined with the SDXC
device declaration in the DSDT.
Example:
Scope (\_SB.PCI0.SDXC)
{
Name (_CRS, ResourceTemplate () {
GpioInt (Edge, ActiveBoth, SharedAndWake, PullNone, 10000,
"\\_SB.PCI0.GPIO", 0, ResourceConsumer) { 35 }
})
Name (_DSD, Package () {
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package () {
Package () { "cd-gpio", Package () { \_SB.PCI0.SDXC, 0, 0, 1 } }
}
})
}
Change-Id: Ie4c1bfadd962cf55a987edb9ef86e92174205770
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14995
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/intel/skylake/chip.h')
-rw-r--r-- | src/soc/intel/skylake/chip.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/soc/intel/skylake/chip.h b/src/soc/intel/skylake/chip.h index 891047971c..2db84b7f25 100644 --- a/src/soc/intel/skylake/chip.h +++ b/src/soc/intel/skylake/chip.h @@ -19,6 +19,7 @@ #ifndef _SOC_CHIP_H_ #define _SOC_CHIP_H_ +#include <arch/acpi_device.h> #include <stdint.h> #include <soc/gpio_defs.h> #include <soc/gpe.h> @@ -339,6 +340,23 @@ struct soc_intel_skylake_config { u8 SendVrMbxCmd; /* Statically clock gate 8254 PIT. */ u8 clock_gate_8254; + + /* + * Use SD card detect GPIO with default config: + * - Edge triggered + * - No internal pull + * - Active both (high + low) + * - Can wake device from D3 + * - 100ms debounce timeout + * + * GpioInt (Edge, ActiveBoth, SharedAndWake, PullNone, 10000, + * "\\_SB.PCI0.GPIO", 0, ResourceConsumer) + * { sdcard_cd_gpio_default } + */ + unsigned sdcard_cd_gpio_default; + + /* Use custom SD card detect GPIO configuration */ + struct acpi_gpio sdcard_cd_gpio; }; typedef struct soc_intel_skylake_config config_t; |