Skip to content

Commit

Permalink
acpi: Fix ACPI PCI bus handle
Browse files Browse the repository at this point in the history
The PRT bus name for most (especially older) platforms is _SB.PCI0. Only
newer platforms use something else (like _SB.PC00).

Signed-off-by: Johan Hedberg <[email protected]>
(cherry picked from commit ff0b803)
  • Loading branch information
Johan Hedberg authored and github-actions[bot] committed Oct 31, 2023
1 parent 848a3ee commit 2ad95ce
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions boards/x86/intel_adl/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ config HEAP_MEM_POOL_SIZE
default 64000000
config MAIN_STACK_SIZE
default 320000
config ACPI_PRT_BUS_NAME
default "_SB.PC00"

if SHELL
config SHELL_STACK_SIZE
Expand Down
4 changes: 4 additions & 0 deletions boards/x86/intel_ehl/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ config SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN
default n
endif

config ACPI_PRT_BUS_NAME
depends on ACPI
default "_SB.PC00"

config HEAP_MEM_POOL_SIZE
default 2097152 if ACPI
depends on KERNEL_MEM_POOL
Expand Down
4 changes: 4 additions & 0 deletions boards/x86/intel_rpl/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ endif
config ACPI
default y

config ACPI_PRT_BUS_NAME
depends on ACPI
default "_SB.PC00"

if DMA
config DMA_64BIT
default y
Expand Down
6 changes: 6 additions & 0 deletions lib/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ module = ACPI
module-str = acpi
source "subsys/logging/Kconfig.template.log_config"

config ACPI_PRT_BUS_NAME
string "ACPI name of PCI bus"
default "_SB.PCI0"
help
ACPI name of PCI bus.

config ACPI_MAX_PRT_ENTRY
int "Size of PRT buffer"
default 4096
Expand Down
3 changes: 2 additions & 1 deletion lib/acpi/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ static int acpi_get_irq_table(struct acpi *bus, char *bus_name,
static int acpi_retrieve_legacy_irq(struct acpi *bus)
{
/* TODO: assume platform have only one PCH with single PCI bus (bus 0). */
return acpi_get_irq_table(bus, "_SB.PC00", bus->pci_prt_table, sizeof(bus->pci_prt_table));
return acpi_get_irq_table(bus, CONFIG_ACPI_PRT_BUS_NAME,
bus->pci_prt_table, sizeof(bus->pci_prt_table));
}

static ACPI_STATUS dev_resource_enum_callback(ACPI_HANDLE obj_handle, UINT32 level, void *ctx,
Expand Down

0 comments on commit 2ad95ce

Please sign in to comment.