tree: f6de446057e934f9ac8bf1a3cba2faf3ea97042a [path history] [tgz]
  1. drivers/
  2. testing/
  3. BUILD.gn
  4. OWNERS
  5. README.md
src/devices/registers/README.md

The registers drivers are used for shared registers across drivers to provide isolation and prevent race conditions. Often, different drivers want to access different bits on the same register. For example, often there is are a set of RESET drivers where each bit on the registers resets a different set of hardware, i.e. bit 0 resets camera related hardware and registers, bit 1 resets audio related hardware and registers, ... The registers driver allows us to allocate a set of bits on the register to one driver and another set of bits to another driver, while managing that each driver is only allowed to touch the bits it was allocated and dealing with any lock contention.

It's also perhaps more common that multiple drivers share different registers on a shared page. We want to strive to map all MMIO pages in a single driver, and the register driver also provides us the ability to split these pages into more granular regions.

The mock-registers library can be used for testing.