coreboot/src/device
Julius Werner db7f6fb752 Add buffer_to/from_fifo32(_prefix) helpers
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>
2019-08-22 10:36:22 +00:00
..
dram dram: Add basic DDR4 SPD parsing 2019-08-14 03:35:29 +00:00
oprom device/oprom: Drop unnecessary AMD headers 2019-08-20 08:39:27 +00:00
azalia_device.c
cardbus_device.c
cpu_device.c
device.c
device_const.c devicetree: Add accessors for chip_info 2019-07-18 15:22:09 +00:00
device_util.c device: Constify dev argument to (probe|find)_resource() 2019-07-31 09:10:28 +00:00
hypertransport.c device/hypertransport.c: Remove dead assignment 2019-07-13 18:37:31 +00:00
i2c.c
i2c_bus.c
Kconfig device: Default to VESA/linear framebuffer for ChromeOS 2019-07-24 06:13:02 +00:00
Makefile.inc Add buffer_to/from_fifo32(_prefix) helpers 2019-08-22 10:36:22 +00:00
mmio.c Add buffer_to/from_fifo32(_prefix) helpers 2019-08-22 10:36:22 +00:00
pci_class.c
pci_device.c device/pci_ops: Make PCI_BDF() available in all stages 2019-08-02 15:47:53 +00:00
pci_early.c
pci_ops.c device/pci_ops: Make PCI_BDF() available in all stages 2019-08-02 15:47:53 +00:00
pci_rom.c device/pci_rom.c: Fix out of bounds read 2019-07-19 10:02:04 +00:00
pciexp_device.c
pcix_device.c
pnp_device.c
root_device.c
smbus_ops.c
software_i2c.c