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 include: Add SPDX-License-Identifiers to files missing them 2022-08-01 13:59:11 +00:00
device.h device: introduce and use dev_get_domain_id 2024-07-31 14:32:19 +00:00
gpio.h device + util/sconfig: introduce new device gpio 2020-12-28 17:47:04 +00:00
i2c.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
i2c_bus.h device/i2c_bus: Add routines to read and write multiple bytes 2022-09-04 14:55:59 +00:00
i2c_simple.h include/device/i2c_simple: add i2c_2ba_read_bytes function 2022-04-27 16:07:29 +00:00
mdio.h device/mdio: Provide helper functions for read and write 2022-11-24 05:58:28 +00:00
mmio.h treewide: Add 'IWYU pragma: export' comment 2022-11-03 13:05:17 +00:00
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 src/include: Add missing includes 2020-07-26 21:37:35 +00:00
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 soc/intel/*: drop UART pad configuration from common code 2021-03-12 08:48:03 +00:00
pciexp.h device/pciexp: add pcie_find_dsn() 2022-11-20 17:37:09 +00:00
pcix.h include: Add SPDX-License-Identifiers to files missing them 2022-08-01 13:59:11 +00:00
pnp.h treewide: Add 'IWYU pragma: export' comment 2022-11-03 13:05:17 +00:00
pnp_def.h include: Add SPDX-License-Identifiers to files missing them 2022-08-01 13:59:11 +00:00
pnp_ops.h src: Include <arch/io.h> when appropriate 2020-10-26 06:44:40 +00:00
pnp_type.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
resource.h include/device/resource: drop unused IORESOURCE_* definitions 2023-08-10 21:48:46 +00:00
smbus.h include: Add SPDX-License-Identifiers to files missing them 2022-08-01 13:59:11 +00:00
smbus_def.h include: Add SPDX-License-Identifiers to files missing them 2022-08-01 13:59:11 +00:00
smbus_host.h src/include: Add missing includes 2020-07-26 21:37:35 +00:00
soundwire.h acpi/soundwire.[ch]: Fix dpn entry array overrun 2023-09-13 15:26:01 +00:00
spi.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
usbc_mux.h ec/google/chromeec: Split wait-loop for DP and HPD flags 2023-07-15 12:47:51 +00:00
xhci.h device/xhci: Add struct for capability registers 2023-03-07 17:11:58 +00:00