acpi: Move PCI functions to separate file
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Change-Id: Idc96b99da9f9037267c0bec2c839014b13ceb8cc Reviewed-on: https://review.coreboot.org/c/coreboot/+/51106 Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Lance Zhao Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
committed by
Patrick Georgi
parent
740cd31858
commit
d40a4c2bb4
@ -6,6 +6,7 @@ ramstage-y += acpi.c
|
||||
ramstage-y += acpigen.c
|
||||
ramstage-y += acpigen_dptf.c
|
||||
ramstage-y += acpigen_dsm.c
|
||||
ramstage-$(CONFIG_PCI) += acpigen_pci.c
|
||||
ramstage-y += acpigen_ps2_keybd.c
|
||||
ramstage-y += acpigen_usb.c
|
||||
ramstage-y += device.c
|
||||
|
@ -18,8 +18,6 @@
|
||||
#include <assert.h>
|
||||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci_def.h>
|
||||
#include <device/pci_type.h>
|
||||
#include <device/soundwire.h>
|
||||
#include <types.h>
|
||||
|
||||
@ -2033,23 +2031,6 @@ void acpigen_write_ADR(uint64_t adr)
|
||||
acpigen_write_name_qword("_ADR", adr);
|
||||
}
|
||||
|
||||
void acpigen_write_ADR_pci_devfn(pci_devfn_t devfn)
|
||||
{
|
||||
/*
|
||||
* _ADR for PCI Bus is encoded as follows:
|
||||
* [63:32] - unused
|
||||
* [31:16] - device #
|
||||
* [15:0] - function #
|
||||
*/
|
||||
acpigen_write_ADR(PCI_SLOT(devfn) << 16 | PCI_FUNC(devfn));
|
||||
}
|
||||
|
||||
void acpigen_write_ADR_pci_device(const struct device *dev)
|
||||
{
|
||||
assert(dev->path.type == DEVICE_PATH_PCI);
|
||||
acpigen_write_ADR_pci_devfn(dev->path.pci.devfn);
|
||||
}
|
||||
|
||||
/**
|
||||
* acpigen_write_ADR_soundwire_device() - SoundWire ACPI Device Address Encoding.
|
||||
* @address: SoundWire device address properties.
|
||||
|
26
src/acpi/acpigen_pci.c
Normal file
26
src/acpi/acpigen_pci.c
Normal file
@ -0,0 +1,26 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <acpi/acpigen.h>
|
||||
#include <acpi/acpigen_pci.h>
|
||||
#include <assert.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci_def.h>
|
||||
#include <device/pci_type.h>
|
||||
#include <types.h>
|
||||
|
||||
void acpigen_write_ADR_pci_devfn(pci_devfn_t devfn)
|
||||
{
|
||||
/*
|
||||
* _ADR for PCI Bus is encoded as follows:
|
||||
* [63:32] - unused
|
||||
* [31:16] - device #
|
||||
* [15:0] - function #
|
||||
*/
|
||||
acpigen_write_ADR(PCI_SLOT(devfn) << 16 | PCI_FUNC(devfn));
|
||||
}
|
||||
|
||||
void acpigen_write_ADR_pci_device(const struct device *dev)
|
||||
{
|
||||
assert(dev->path.type == DEVICE_PATH_PCI);
|
||||
acpigen_write_ADR_pci_devfn(dev->path.pci.devfn);
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
#include <acpi/acpi.h>
|
||||
#include <acpi/acpi_device.h>
|
||||
#include <acpi/acpigen.h>
|
||||
#include <acpi/acpigen_pci.h>
|
||||
#include <device/device.h>
|
||||
#include <device/path.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <acpi/acpigen.h>
|
||||
#include <acpi/acpigen_pci.h>
|
||||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include "chip.h"
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <acpi/acpi.h>
|
||||
#include <acpi/acpi_device.h>
|
||||
#include <acpi/acpigen.h>
|
||||
#include <acpi/acpigen_pci.h>
|
||||
#include <console/console.h>
|
||||
#include <device/i2c_simple.h>
|
||||
#include <device/device.h>
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include "pci_xhci.h"
|
||||
#include <acpi/acpigen.h>
|
||||
#include <acpi/acpigen_pci.h>
|
||||
#include <console/console.h>
|
||||
#include <device/pci.h>
|
||||
#include <device/pci_ids.h>
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <acpi/acpi_device.h>
|
||||
#include <acpi/acpigen.h>
|
||||
#include <acpi/acpigen_pci.h>
|
||||
#include <console/console.h>
|
||||
#include <device/pci_ids.h>
|
||||
#include <sar.h>
|
||||
|
@ -394,8 +394,6 @@ void acpigen_write_return_byte(uint8_t arg);
|
||||
void acpigen_write_upc(enum acpi_upc_type type);
|
||||
void acpigen_write_pld(const struct acpi_pld *pld);
|
||||
void acpigen_write_ADR(uint64_t adr);
|
||||
void acpigen_write_ADR_pci_devfn(pci_devfn_t devfn);
|
||||
void acpigen_write_ADR_pci_device(const struct device *dev);
|
||||
struct soundwire_address;
|
||||
void acpigen_write_ADR_soundwire_device(const struct soundwire_address *address);
|
||||
void acpigen_write_create_byte_field(uint8_t op, size_t byte_offset, const char *name);
|
||||
|
13
src/include/acpi/acpigen_pci.h
Normal file
13
src/include/acpi/acpigen_pci.h
Normal file
@ -0,0 +1,13 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#ifndef ACPIGEN_PCI_H
|
||||
#define ACPIGEN_PCI_H
|
||||
|
||||
#include <device/device.h>
|
||||
#include <device/pci_def.h>
|
||||
#include <device/pci_type.h>
|
||||
|
||||
void acpigen_write_ADR_pci_devfn(pci_devfn_t devfn);
|
||||
void acpigen_write_ADR_pci_device(const struct device *dev);
|
||||
|
||||
#endif /* ACPIGEN_PCI_H */
|
@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <acpi/acpigen.h>
|
||||
#include <acpi/acpigen_pci.h>
|
||||
#include <arch/ioapic.h>
|
||||
#include <assert.h>
|
||||
#include <amdblocks/amd_pci_util.h>
|
||||
|
Reference in New Issue
Block a user