coreboot-kgpe-d16/util/sconfig
Nico Huber c0fc38eed8 sconfig: Allow to specify device operations
Currently we only have runtime mechanisms to assign device operations to
a node in our devicetree (with one exception: the root device). The most
common method is to map PCI IDs to the device operations with a `struct
pci_driver`. Another accustomed way is to let a chip driver assign them.

For very common drivers, e.g. those in soc/intel/common/blocks/, the PCI
ID lists grew very large and are incredibly error-prone. Often, IDs are
missing and sometimes IDs are added almost mechanically without checking
the code for compatibility. Maintaining these lists in a central place
also reduces flexibility.

Now, for onboard devices it is actually unnecessary to assign the device
operations at runtime. We already know exactly what operations should be
assigned. And since we are using chipset devicetrees, we have a perfect
place to put that information.

This patch adds a simple mechanism to `sconfig`. It allows us to speci-
fy operations per device, e.g.

  device pci 00.0 alias system_agent on
          ops system_agent_ops
  end

The operations are given as a C identifier. In this example, we simply
assume that a global `struct device_operations system_agent_ops` exists.

Change-Id: I2833d2f2450fde3206c33393f58b86fd4280b566
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66483
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2022-09-15 13:06:47 +00:00
..
Makefile.inc
description.md
lex.yy.c_shipped sconfig: Allow to specify device operations 2022-09-15 13:06:47 +00:00
main.c sconfig: Allow to specify device operations 2022-09-15 13:06:47 +00:00
sconfig.h sconfig: Allow to specify device operations 2022-09-15 13:06:47 +00:00
sconfig.l sconfig: Allow to specify device operations 2022-09-15 13:06:47 +00:00
sconfig.tab.c_shipped sconfig: Allow to specify device operations 2022-09-15 13:06:47 +00:00
sconfig.tab.h_shipped sconfig: Allow to specify device operations 2022-09-15 13:06:47 +00:00
sconfig.y sconfig: Allow to specify device operations 2022-09-15 13:06:47 +00:00