Many peripheral drivers across different SoCs regularly face the same task of piping a transfer buffer into (or reading it out of) a 32-bit FIFO register. Sometimes it's just one register, sometimes a whole array of registers. Sometimes you actually transfer 4 bytes per register read/write, sometimes only 2 (or even 1). Sometimes writes need to be prefixed with one or two command bytes which makes the actual payload buffer "misaligned" in relation to the FIFO and requires a bunch of tricky bit packing logic to get right. Most of the times transfer lengths are not guaranteed to be divisible by 4, which also requires a bunch of logic to treat the potential unaligned end of the transfer correctly. We have a dozen different implementations of this same pattern across coreboot. This patch introduces a new family of helper functions that aims to solve all these use cases once and for all (*fingers crossed*). Change-Id: Ia71f66c1cee530afa4c77c46a838b4de646ffcfb Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/34850 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
60 lines
1.6 KiB
Makefile
60 lines
1.6 KiB
Makefile
ramstage-y += device.c
|
|
ramstage-y += root_device.c
|
|
ramstage-y += cpu_device.c
|
|
ramstage-y += device_util.c
|
|
ramstage-$(CONFIG_AZALIA_PLUGIN_SUPPORT) += azalia_device.c
|
|
ramstage-$(CONFIG_ARCH_RAMSTAGE_X86_32) += pnp_device.c
|
|
ramstage-$(CONFIG_ARCH_RAMSTAGE_X86_64) += pnp_device.c
|
|
ramstage-y += smbus_ops.c
|
|
|
|
ifeq ($(CONFIG_AZALIA_PLUGIN_SUPPORT),y)
|
|
ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/hda_verb.c
|
|
endif
|
|
|
|
bootblock-y += device_const.c
|
|
postcar-y += device_const.c
|
|
smm-y += device_const.c
|
|
verstage-y += device_const.c
|
|
romstage-y += device_const.c
|
|
ramstage-y += device_const.c
|
|
|
|
ifeq ($(CONFIG_PCI),y)
|
|
bootblock-y += pci_early.c
|
|
verstage-y += pci_early.c
|
|
romstage-y += pci_early.c
|
|
postcar-y += pci_early.c
|
|
|
|
ramstage-y += pci_class.c
|
|
ramstage-y += pci_device.c
|
|
ramstage-y += pci_rom.c
|
|
|
|
bootblock-y += pci_ops.c
|
|
verstage-y += pci_ops.c
|
|
romstage-y += pci_ops.c
|
|
postcar-y += pci_ops.c
|
|
ramstage-y += pci_ops.c
|
|
smm-y += pci_ops.c
|
|
|
|
ramstage-$(CONFIG_HYPERTRANSPORT_PLUGIN_SUPPORT) += hypertransport.c
|
|
ramstage-$(CONFIG_PCIX_PLUGIN_SUPPORT) += pcix_device.c
|
|
ramstage-$(CONFIG_PCIEXP_PLUGIN_SUPPORT) += pciexp_device.c
|
|
ramstage-$(CONFIG_CARDBUS_PLUGIN_SUPPORT) += cardbus_device.c
|
|
endif
|
|
|
|
subdirs-y += oprom dram
|
|
|
|
bootblock-$(CONFIG_SOFTWARE_I2C) += software_i2c.c
|
|
verstage-$(CONFIG_SOFTWARE_I2C) += software_i2c.c
|
|
romstage-$(CONFIG_SOFTWARE_I2C) += software_i2c.c
|
|
ramstage-$(CONFIG_SOFTWARE_I2C) += software_i2c.c
|
|
|
|
bootblock-y += i2c.c
|
|
verstage-y += i2c.c
|
|
romstage-y += i2c.c
|
|
ramstage-y += i2c.c
|
|
ramstage-y += i2c_bus.c
|
|
|
|
bootblock-y += mmio.c
|
|
verstage-y += mmio.c
|
|
romstage-y += mmio.c
|
|
ramstage-y += mmio.c
|