diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-09-07 16:33:26 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-09-19 16:58:38 +0000 |
commit | 850b6c6254ab34cdbda24818cb0ecca484c01c86 (patch) | |
tree | 8052c9bf7cc7b18e5ab86acab82383391fd03bd3 /src | |
parent | 8c178910221ea59936dd31644bde68a66d586dce (diff) |
soc/amd/picasso: add eMMC MMIO device to devicetree
Add the eMMC MMIO device to the devicetree and make it use the common
AMD eMMC driver. Since there is now a device for this in the devicetree,
also use this device to determine if the FSP should be told if the eMMC
controller is supposed to be disabled.
TEST=On Mandolin the eMMC controller both disappears in the Windows 10
device manager and in dmesg on Ubuntu 2022.04 LTS
TEST=Morphius with NVMe SSD still works
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I5453b69df776d2ce1f3be11e37cd26c8c64f0cd5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77990
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mainboard/amd/bilby/devicetree.cb | 4 | ||||
-rw-r--r-- | src/mainboard/amd/mandolin/variants/cereme/devicetree.cb | 4 | ||||
-rw-r--r-- | src/mainboard/amd/mandolin/variants/mandolin/devicetree.cb | 4 | ||||
-rw-r--r-- | src/mainboard/google/zork/variants/baseboard/dalboz/devicetree.cb | 2 | ||||
-rw-r--r-- | src/mainboard/google/zork/variants/baseboard/trembyle/devicetree.cb | 2 | ||||
-rw-r--r-- | src/mainboard/google/zork/variants/berknip/variant.c | 6 | ||||
-rw-r--r-- | src/mainboard/google/zork/variants/dalboz/variant.c | 2 | ||||
-rw-r--r-- | src/mainboard/google/zork/variants/ezkinil/variant.c | 6 | ||||
-rw-r--r-- | src/mainboard/google/zork/variants/morphius/variant.c | 6 | ||||
-rw-r--r-- | src/soc/amd/picasso/Kconfig | 1 | ||||
-rw-r--r-- | src/soc/amd/picasso/acpi/mmio.asl | 3 | ||||
-rw-r--r-- | src/soc/amd/picasso/chip.h | 3 | ||||
-rw-r--r-- | src/soc/amd/picasso/chipset.cb | 1 | ||||
-rw-r--r-- | src/soc/amd/picasso/fsp_s_params.c | 5 |
14 files changed, 20 insertions, 29 deletions
diff --git a/src/mainboard/amd/bilby/devicetree.cb b/src/mainboard/amd/bilby/devicetree.cb index c3ba99c905..9d112db9ea 100644 --- a/src/mainboard/amd/bilby/devicetree.cb +++ b/src/mainboard/amd/bilby/devicetree.cb @@ -8,10 +8,6 @@ chip soc/amd/picasso register "common_config.fadt_boot_arch" = "ACPI_FADT_LEGACY_DEVICES | ACPI_FADT_8042" register "common_config.fadt_flags" = "ACPI_FADT_SLEEP_BUTTON" # See table 5-34 ACPI 6.3 spec - register "emmc_config" = "{ - .timing = SD_EMMC_DISABLE, - }" - register "has_usb2_phy_tune_params" = "1" # Controller0 Port0 Default diff --git a/src/mainboard/amd/mandolin/variants/cereme/devicetree.cb b/src/mainboard/amd/mandolin/variants/cereme/devicetree.cb index 167c3667ab..20595e8d77 100644 --- a/src/mainboard/amd/mandolin/variants/cereme/devicetree.cb +++ b/src/mainboard/amd/mandolin/variants/cereme/devicetree.cb @@ -8,10 +8,6 @@ chip soc/amd/picasso register "common_config.fadt_boot_arch" = "ACPI_FADT_LEGACY_DEVICES | ACPI_FADT_8042" register "common_config.fadt_flags" = "ACPI_FADT_SLEEP_BUTTON" # See table 5-34 ACPI 6.3 spec - register "emmc_config" = "{ - .timing = SD_EMMC_DISABLE, - }" - register "has_usb2_phy_tune_params" = "1" # Controller0 Port0 Default diff --git a/src/mainboard/amd/mandolin/variants/mandolin/devicetree.cb b/src/mainboard/amd/mandolin/variants/mandolin/devicetree.cb index 1bc5498e3c..9628992857 100644 --- a/src/mainboard/amd/mandolin/variants/mandolin/devicetree.cb +++ b/src/mainboard/amd/mandolin/variants/mandolin/devicetree.cb @@ -8,10 +8,6 @@ chip soc/amd/picasso register "common_config.fadt_boot_arch" = "ACPI_FADT_LEGACY_DEVICES | ACPI_FADT_8042" register "common_config.fadt_flags" = "ACPI_FADT_SLEEP_BUTTON" # See table 5-34 ACPI 6.3 spec - register "emmc_config" = "{ - .timing = SD_EMMC_DISABLE, - }" - register "has_usb2_phy_tune_params" = "1" # Controller0 Port0 Default diff --git a/src/mainboard/google/zork/variants/baseboard/dalboz/devicetree.cb b/src/mainboard/google/zork/variants/baseboard/dalboz/devicetree.cb index ac4bdcf6d8..bff91fcf99 100644 --- a/src/mainboard/google/zork/variants/baseboard/dalboz/devicetree.cb +++ b/src/mainboard/google/zork/variants/baseboard/dalboz/devicetree.cb @@ -388,4 +388,6 @@ chip soc/amd/picasso device ref uart_0 on end # console + device ref emmc on end + end # chip soc/amd/picasso diff --git a/src/mainboard/google/zork/variants/baseboard/trembyle/devicetree.cb b/src/mainboard/google/zork/variants/baseboard/trembyle/devicetree.cb index 572427e5f8..448982a311 100644 --- a/src/mainboard/google/zork/variants/baseboard/trembyle/devicetree.cb +++ b/src/mainboard/google/zork/variants/baseboard/trembyle/devicetree.cb @@ -436,4 +436,6 @@ chip soc/amd/picasso device ref uart_0 on end # console + device ref emmc on end + end # chip soc/amd/picasso diff --git a/src/mainboard/google/zork/variants/berknip/variant.c b/src/mainboard/google/zork/variants/berknip/variant.c index 092ff260b3..1810a666bf 100644 --- a/src/mainboard/google/zork/variants/berknip/variant.c +++ b/src/mainboard/google/zork/variants/berknip/variant.c @@ -4,13 +4,9 @@ void variant_devtree_update(void) { - struct soc_amd_picasso_config *cfg; - - cfg = config_of_soc(); - /* * Enable eMMC if eMMC bit is set in FW_CONFIG or device is unprovisioned. */ if (!(variant_has_emmc() || boot_is_factory_unprovisioned())) - cfg->emmc_config.timing = SD_EMMC_DISABLE; + DEV_PTR(emmc)->enabled = 0; } diff --git a/src/mainboard/google/zork/variants/dalboz/variant.c b/src/mainboard/google/zork/variants/dalboz/variant.c index 6bf8678404..6260cfc02e 100644 --- a/src/mainboard/google/zork/variants/dalboz/variant.c +++ b/src/mainboard/google/zork/variants/dalboz/variant.c @@ -59,7 +59,7 @@ void variant_devtree_update(void) cfg->emmc_config.timing = SD_EMMC_EMMC_HS200; } } else { - cfg->emmc_config.timing = SD_EMMC_DISABLE; + DEV_PTR(emmc)->enabled = 0; } update_audio_configuration(); diff --git a/src/mainboard/google/zork/variants/ezkinil/variant.c b/src/mainboard/google/zork/variants/ezkinil/variant.c index f76ab62035..142aa21bd8 100644 --- a/src/mainboard/google/zork/variants/ezkinil/variant.c +++ b/src/mainboard/google/zork/variants/ezkinil/variant.c @@ -7,13 +7,9 @@ void variant_devtree_update(void) { - struct soc_amd_picasso_config *cfg; - - cfg = config_of_soc(); - /* * Enable eMMC if eMMC bit is set in FW_CONFIG or device is unprovisioned. */ if (!(variant_has_emmc() || boot_is_factory_unprovisioned())) - cfg->emmc_config.timing = SD_EMMC_DISABLE; + DEV_PTR(emmc)->enabled = 0; } diff --git a/src/mainboard/google/zork/variants/morphius/variant.c b/src/mainboard/google/zork/variants/morphius/variant.c index 092ff260b3..1810a666bf 100644 --- a/src/mainboard/google/zork/variants/morphius/variant.c +++ b/src/mainboard/google/zork/variants/morphius/variant.c @@ -4,13 +4,9 @@ void variant_devtree_update(void) { - struct soc_amd_picasso_config *cfg; - - cfg = config_of_soc(); - /* * Enable eMMC if eMMC bit is set in FW_CONFIG or device is unprovisioned. */ if (!(variant_has_emmc() || boot_is_factory_unprovisioned())) - cfg->emmc_config.timing = SD_EMMC_DISABLE; + DEV_PTR(emmc)->enabled = 0; } diff --git a/src/soc/amd/picasso/Kconfig b/src/soc/amd/picasso/Kconfig index 79f60cece7..796fe4eb13 100644 --- a/src/soc/amd/picasso/Kconfig +++ b/src/soc/amd/picasso/Kconfig @@ -37,6 +37,7 @@ config SOC_AMD_PICASSO select SOC_AMD_COMMON_BLOCK_DATA_FABRIC select SOC_AMD_COMMON_BLOCK_DATA_FABRIC_DOMAIN select SOC_AMD_COMMON_BLOCK_DATA_FABRIC_NP_REGION + select SOC_AMD_COMMON_BLOCK_EMMC select SOC_AMD_COMMON_BLOCK_GRAPHICS select SOC_AMD_COMMON_BLOCK_HAS_ESPI select SOC_AMD_COMMON_BLOCK_HDA diff --git a/src/soc/amd/picasso/acpi/mmio.asl b/src/soc/amd/picasso/acpi/mmio.asl index f8f9d35489..8adc87d6d0 100644 --- a/src/soc/amd/picasso/acpi/mmio.asl +++ b/src/soc/amd/picasso/acpi/mmio.asl @@ -87,9 +87,10 @@ Device (MMC0) } } + Name (STAT, 0x0) Method (_STA, 0x0, NotSerialized) { - Return (0x0F) + Return (STAT) } } diff --git a/src/soc/amd/picasso/chip.h b/src/soc/amd/picasso/chip.h index 3320350ee1..0b6596090c 100644 --- a/src/soc/amd/picasso/chip.h +++ b/src/soc/amd/picasso/chip.h @@ -177,6 +177,9 @@ struct soc_amd_picasso_config { * HS400 -> NONE (0x05) * * The kernel driver uses a heuristic to determine if HS400 is supported. + * + * If the eMMC MMIO device is disabled in the devicetree, + * fsps_update_emmc_config will set timing to SD_EMMC_DISABLE. */ enum { SD_EMMC_DISABLE, diff --git a/src/soc/amd/picasso/chipset.cb b/src/soc/amd/picasso/chipset.cb index bf2c879a23..ed545638e8 100644 --- a/src/soc/amd/picasso/chipset.cb +++ b/src/soc/amd/picasso/chipset.cb @@ -57,4 +57,5 @@ chip soc/amd/picasso device mmio 0xfedca000 alias uart_1 off ops amd_uart_mmio_ops end device mmio 0xfedce000 alias uart_2 off ops amd_uart_mmio_ops end device mmio 0xfedcf000 alias uart_3 off ops amd_uart_mmio_ops end + device mmio 0xfedd5000 alias emmc off ops amd_emmc_mmio_ops end end diff --git a/src/soc/amd/picasso/fsp_s_params.c b/src/soc/amd/picasso/fsp_s_params.c index 2e1055592a..f69245d0c8 100644 --- a/src/soc/amd/picasso/fsp_s_params.c +++ b/src/soc/amd/picasso/fsp_s_params.c @@ -56,6 +56,11 @@ static void fsps_update_emmc_config(FSP_S_CONFIG *scfg, break; } + /* Make sure that the FSP knows that the EMMC controller should be disabled when the + corresponding MMIO device is disabled */ + if (!DEV_PTR(emmc)->enabled) + val = SD_DISABLE; + scfg->emmc0_mode = val; scfg->emmc0_sdr104_hs400_driver_strength = cfg->emmc_config.sdr104_hs400_driver_strength; |