tree: 0f2e45b3d891c04f8ed70672e28d224ad0db535b [path history] [tgz]
  1. bin/
  2. drivers/
  3. testing/
  4. BUILD.gn
  5. METADATA.textproto
  6. OWNERS
  7. 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.