Description
In some peripherals, a register offset is defined by reading the value of another register at runtime.
For example, the USB XHCI op
and run
registers:
op
: https://elixir.bootlin.com/linux/latest/source/drivers/usb/host/xhci.c#L5221run
: https://elixir.bootlin.com/linux/latest/source/drivers/usb/host/xhci.c#L5223
The structure of the register clusters are static, and it looks like the value for those registers is likely to be static per actual implementation.
Is there a way to define these type of registers in SVD?
Something like leaving the addressOffset
empty, and requiring the generated code to supply the offset as a parameter?
Another alternative I guess would be to run code on the board to query the values of the relevant registers, and use the result in the SVD per-implementation.
It may just be that higher-level abstractions (like actual drivers or HALs) are a better place to handle register definitions like those above.