Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Generate csr offset header files #1979

Open
AndrewD opened this issue Jun 4, 2024 · 1 comment
Open

Proposal: Generate csr offset header files #1979

AndrewD opened this issue Jun 4, 2024 · 1 comment

Comments

@AndrewD
Copy link
Collaborator

AndrewD commented Jun 4, 2024

In #548 the reason for fixing CSR locations was described quite well. In addition to this it would be helpful to generate a header per device which contains CSR offsets and field information.

These headers should change rarely as they define the ABI of the peripheral, but they could be copied into device drivers and avoiding needing to manually generate this information.

For example, Linux and Nuttx drivers currently will have manually hard coded register offsets and bit definitions which are used in conjunction with dynamic information from a device tree. It would be nice to guarantee the accuracy of this hard coded information by having it originally be generated from the gateware. CI tests can also validate that newly generated headers do not break the existing ABI used in public drivers.

Ideally one header would be generated per-class, vs the per-instance definitions in csr.h.

Even for bare metal code like the bios supporting multiple instances of a peripheral via csr.h is not ideal. So code like this tends to be hard coded to a single instance.

This would be helpful for any device drivers using the device tree to manage instances in a dynamic way as discussed in #1960 instead of relying on csr.h.

@AndrewD
Copy link
Collaborator Author

AndrewD commented Jun 4, 2024

@enjoy-digital @trabucayre see above for a proposal to discuss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant