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 device/mmio.h: Add include file for MMIO ops 2019-03-04 15:57:39 +00:00
cardbus_device.c device/pci: Fix PCI accessor headers 2019-03-01 20:32:15 +00:00
cpu_device.c device/cpu_device.c: Use 'unsigned int' instead of 'unsigned' 2019-06-14 19:55:09 +00:00
device.c src/device: Prevent attack on null pointer dereference 2019-06-03 13:25:25 +00:00
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 Reinvent I2C ops 2017-08-18 15:33:45 +00:00
i2c_bus.c device/i2c_bus: allow i2c_bus and i2c_simple to coexist 2018-01-24 05:02:50 +00:00
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 src: Drop unused 'include <device/pciexp.h>' 2019-03-16 11:46:38 +00:00
pci_device.c device/pci_ops: Make PCI_BDF() available in all stages 2019-08-02 15:47:53 +00:00
pci_early.c device/pci_ops: Define pci_find_capability() just once 2019-07-04 09:36:19 +00:00
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 coreboot: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-08 08:33:24 +00:00
pcix_device.c device/pci: Fix PCI accessor headers 2019-03-01 20:32:15 +00:00
pnp_device.c src: Use 'include <string.h>' when appropriate 2019-03-20 20:27:51 +00:00
root_device.c coreboot: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-08 08:33:24 +00:00
smbus_ops.c device/smbus_ops.c: Get rid of device_t 2018-05-04 10:17:08 +00:00
software_i2c.c software_i2c: Improve error behavior 2018-05-02 00:23:30 +00:00