soc/amd: report I3C controller MMIO to resource allocator

Add minimal common AMD I3C controller code that reports the MMIO region
used by the different I3C controllers to the resource allocator. For
this to work, select the introduced SOC_AMD_COMMON_BLOCK_I3C Kconfig
option and add the 'soc_amd_i3c_mmio_ops' device operations to the I3C
device devicetree entries on all SoCs that include I3C controllers.

Change-Id: Iebf709d2548f2535b2a2a03a4f6da9531559c238
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87277
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
This commit is contained in:
Felix Held 2025-04-11 15:00:24 +02:00
commit a527d13080
13 changed files with 47 additions and 24 deletions

View file

@ -27,3 +27,8 @@ config SOC_AMD_COMMON_BLOCK_I2C3_TPM_SHARED_WITH_PSP
connected, which is shared between x86 and PSP. This is necessary to
ensure proper communication with I2C peripherals connected to such
bus.
config SOC_AMD_COMMON_BLOCK_I3C
bool
help
Select this option to add FCH I3C controller functions to the build.

View file

@ -2,3 +2,4 @@
all-$(CONFIG_SOC_AMD_COMMON_BLOCK_I2C) += i2c.c
all-$(CONFIG_SOC_AMD_COMMON_BLOCK_I2C_PAD_CTRL) += i2c_pad_ctrl.c
all-$(CONFIG_SOC_AMD_COMMON_BLOCK_I23C_PAD_CTRL) += i23c_pad_ctrl.c
all_x86-$(CONFIG_SOC_AMD_COMMON_BLOCK_I3C) += i3c.c

View file

@ -0,0 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/device.h>
static void i3c_read_resources(struct device *dev)
{
mmio_range(dev, 0, dev->path.mmio.addr, 4 * KiB);
}
struct device_operations soc_amd_i3c_mmio_ops = {
.read_resources = i3c_read_resources,
.set_resources = noop_set_resources,
};

View file

@ -29,6 +29,7 @@ config SOC_SPECIFIC_OPTIONS
select SOC_AMD_COMMON_BLOCK_DATA_FABRIC_EXTENDED_MMIO
select SOC_AMD_COMMON_BLOCK_HAS_ESPI
select SOC_AMD_COMMON_BLOCK_I2C
select SOC_AMD_COMMON_BLOCK_I3C
select SOC_AMD_COMMON_BLOCK_IOMMU
select SOC_AMD_COMMON_BLOCK_LPC
select SOC_AMD_COMMON_BLOCK_MCAX

View file

@ -386,9 +386,9 @@ chip soc/amd/genoa_poc
device mmio 0xfedc9000 alias uart_0 off ops amd_uart_mmio_ops end
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 0xfedd2000 alias i3c_0 off end
device mmio 0xfedd3000 alias i3c_1 off end
device mmio 0xfedd4000 alias i3c_2 off end
device mmio 0xfedd6000 alias i3c_3 off end
device mmio 0xfedd2000 alias i3c_0 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd3000 alias i3c_1 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd4000 alias i3c_2 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd6000 alias i3c_3 off ops soc_amd_i3c_mmio_ops end
end

View file

@ -53,6 +53,7 @@ config SOC_AMD_GLINDA
select SOC_AMD_COMMON_BLOCK_HAS_ESPI_ALERT_ENABLE # TODO: Check if this is still correct
select SOC_AMD_COMMON_BLOCK_I2C # TODO: Check if this is still correct
select SOC_AMD_COMMON_BLOCK_I23C_PAD_CTRL # TODO: Check if this is still correct
select SOC_AMD_COMMON_BLOCK_I3C
select SOC_AMD_COMMON_BLOCK_IOMMU # TODO: Check if this is still correct
select SOC_AMD_COMMON_BLOCK_LPC # TODO: Check if this is still correct
select SOC_AMD_COMMON_BLOCK_MCAX # TODO: Check if this is still correct

View file

@ -148,8 +148,8 @@ chip soc/amd/glinda
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 0xfedd1000 alias uart_4 off ops amd_uart_mmio_ops end
device mmio 0xfedd2000 alias i3c_0 off end
device mmio 0xfedd3000 alias i3c_1 off end
device mmio 0xfedd4000 alias i3c_2 off end
device mmio 0xfedd6000 alias i3c_3 off end
device mmio 0xfedd2000 alias i3c_0 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd3000 alias i3c_1 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd4000 alias i3c_2 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd6000 alias i3c_3 off ops soc_amd_i3c_mmio_ops end
end

View file

@ -53,6 +53,7 @@ config SOC_AMD_REMBRANDT_BASE
select SOC_AMD_COMMON_BLOCK_HAS_ESPI_ALERT_ENABLE
select SOC_AMD_COMMON_BLOCK_I2C
select SOC_AMD_COMMON_BLOCK_I23C_PAD_CTRL
select SOC_AMD_COMMON_BLOCK_I3C
select SOC_AMD_COMMON_BLOCK_IOMMU
select SOC_AMD_COMMON_BLOCK_LPC
select SOC_AMD_COMMON_BLOCK_LPC_SPI_DMA

View file

@ -93,8 +93,8 @@ chip soc/amd/mendocino
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 0xfedd1000 alias uart_4 off ops amd_uart_mmio_ops end
device mmio 0xfedd2000 alias i3c_0 off end
device mmio 0xfedd3000 alias i3c_1 off end
device mmio 0xfedd4000 alias i3c_2 off end
device mmio 0xfedd6000 alias i3c_3 off end
device mmio 0xfedd2000 alias i3c_0 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd3000 alias i3c_1 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd4000 alias i3c_2 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd6000 alias i3c_3 off ops soc_amd_i3c_mmio_ops end
end

View file

@ -96,8 +96,8 @@ chip soc/amd/mendocino
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 0xfedd1000 alias uart_4 off ops amd_uart_mmio_ops end
device mmio 0xfedd2000 alias i3c_0 off end
device mmio 0xfedd3000 alias i3c_1 off end
device mmio 0xfedd4000 alias i3c_2 off end
device mmio 0xfedd6000 alias i3c_3 off end
device mmio 0xfedd2000 alias i3c_0 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd3000 alias i3c_1 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd4000 alias i3c_2 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd6000 alias i3c_3 off ops soc_amd_i3c_mmio_ops end
end

View file

@ -49,6 +49,7 @@ config SOC_AMD_PHOENIX_BASE
select SOC_AMD_COMMON_BLOCK_HAS_ESPI_ALERT_ENABLE
select SOC_AMD_COMMON_BLOCK_I2C
select SOC_AMD_COMMON_BLOCK_I23C_PAD_CTRL
select SOC_AMD_COMMON_BLOCK_I3C
select SOC_AMD_COMMON_BLOCK_IOMMU
select SOC_AMD_COMMON_BLOCK_LPC
select SOC_AMD_COMMON_BLOCK_MCAX

View file

@ -145,8 +145,8 @@ chip soc/amd/phoenix
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 0xfedd1000 alias uart_4 off ops amd_uart_mmio_ops end
device mmio 0xfedd2000 alias i3c_0 off end
device mmio 0xfedd3000 alias i3c_1 off end
device mmio 0xfedd4000 alias i3c_2 off end
device mmio 0xfedd6000 alias i3c_3 off end
device mmio 0xfedd2000 alias i3c_0 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd3000 alias i3c_1 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd4000 alias i3c_2 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd6000 alias i3c_3 off ops soc_amd_i3c_mmio_ops end
end

View file

@ -165,8 +165,8 @@ chip soc/amd/phoenix
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 0xfedd1000 alias uart_4 off ops amd_uart_mmio_ops end
device mmio 0xfedd2000 alias i3c_0 off end
device mmio 0xfedd3000 alias i3c_1 off end
device mmio 0xfedd4000 alias i3c_2 off end
device mmio 0xfedd6000 alias i3c_3 off end
device mmio 0xfedd2000 alias i3c_0 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd3000 alias i3c_1 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd4000 alias i3c_2 off ops soc_amd_i3c_mmio_ops end
device mmio 0xfedd6000 alias i3c_3 off ops soc_amd_i3c_mmio_ops end
end