coreboot/src/include/device
Felix Held 32c38ca221 device: introduce and use dev_get_domain_id
To avoid having constructs like 'dev->path.domain.domain' in the SoC
code, create the 'dev_get_domain_id' helper function that returns the
domain ID of either that device if it's a domain device or the
corresponding domain device's domain ID, and use it in the code.

If this function is called with a device other than PCI or domain type,
it won't have a domain number. In order to not need to call 'die',
'dev_get_domain_id' will print an error and return 0 which is a valid
domain number. In that case, the calling code should be fixed.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I3d79f19846cea49609f848a4c42747ac1052c288
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83644
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-07-31 14:32:19 +00:00
..
dram tree: Use <console/console.h> only when used 2024-07-03 04:39:42 +00:00
azalia_device.h device/azalia: Separate codec checking and initialization 2024-06-25 20:58:35 +00:00
cardbus.h
device.h device: introduce and use dev_get_domain_id 2024-07-31 14:32:19 +00:00
gpio.h
i2c.h
i2c_bus.h
i2c_simple.h
mdio.h
mmio.h
path.h acpi: Add functions to declare ARM GIC V3 hardware 2023-09-18 13:34:47 +00:00
pci.h tree: Drop duplicated <device/{path,resource}.h> 2024-04-12 04:24:20 +00:00
pci_def.h device: Add support for multiple PCI segment groups 2024-01-16 22:59:55 +00:00
pci_ehci.h
pci_ids.h device/pci_ids: Add new Intel PTL device IDs for CNVi 2024-07-19 03:56:13 +00:00
pci_mmio_cfg.h include/device/pci_mmio_cfg: assert CONFIG_ECAM_MMCONF_BUS_NUMBER != 0 2024-01-15 21:15:36 +00:00
pci_ops.h device/device.h: Rename busses for clarity 2024-01-31 10:36:39 +00:00
pci_rom.h device: drop unnecessary CHECK_REV_IN_OPROM_NAME option 2024-05-23 21:54:26 +00:00
pci_type.h
pciexp.h
pcix.h
pnp.h
pnp_def.h
pnp_ops.h
pnp_type.h
resource.h include/device/resource: drop unused IORESOURCE_* definitions 2023-08-10 21:48:46 +00:00
smbus.h
smbus_def.h
smbus_host.h
soundwire.h acpi/soundwire.[ch]: Fix dpn entry array overrun 2023-09-13 15:26:01 +00:00
spi.h
usbc_mux.h ec/google/chromeec: Split wait-loop for DP and HPD flags 2023-07-15 12:47:51 +00:00
xhci.h