Skip to content

RFC: Discussion around describing driver/file metadata #49431

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

Open
galak opened this issue Aug 23, 2022 · 7 comments
Open

RFC: Discussion around describing driver/file metadata #49431

galak opened this issue Aug 23, 2022 · 7 comments
Assignees
Labels
area: Device Model RFC Request For Comments: want input from the community

Comments

@galak
Copy link
Collaborator

galak commented Aug 23, 2022

There are a number of cases in which we need metadata associated with files in the Zephyr source tree. This data needs to be "machine" parseable to build various tools, build systems, etc around.

This issue is to capture discussion around the topic, of both needs and how to implement such a metadata system.

@galak galak added RFC Request For Comments: want input from the community area: Device Model labels Aug 23, 2022
@galak
Copy link
Collaborator Author

galak commented Aug 23, 2022

[REQ] For multi-API support for a single device we need to be able to know what APIs are associated with what device (and what DT compatible).

See #49374

@galak
Copy link
Collaborator Author

galak commented Aug 23, 2022

Some possible solutions for metadata tracking:

  • Devicetree
  • Kconfig
  • CMake
  • YAML
  • source code

@mbolivar-nordic
Copy link
Contributor

Assuming "[REQ]" means "requirement":

[REQ] For tracking people responsible for individual drivers, we need to be able to know what source code files are considered part of what drivers. Note that drivers files like adc_common.c and clock_stm32_ll_common.c complicate the situation somewhat.

[REQ] For usability and documentation, we need to know the devicetree compatibles that are handled by each driver (e.g. bosch,bme280 is handled by the bme280 sensor driver)

[REQ] For usability and documentation, we need to know the Kconfig symbols that are associated with each driver (e.g. BME280_MODE_NORMAL is associated with the bme280 sensor driver)

@galak
Copy link
Collaborator Author

galak commented Aug 24, 2022

Assuming "[REQ]" means "requirement":

yeah, was just trying to hopefully make it a little easier to separate requirements from discussion on proposed ideas/solutions.

[REQ] For tracking people responsible for individual drivers, we need to be able to know what source code files are considered part of what drivers. Note that drivers files like adc_common.c and clock_stm32_ll_common.c complicate the situation somewhat.

[REQ] For usability and documentation, we need to know the devicetree compatibles that are handled by each driver (e.g. bosch,bme280 is handled by the bme280 sensor driver)

[REQ] For usability and documentation, we need to know the Kconfig symbols that are associated with each driver (e.g. BME280_MODE_NORMAL is associated with the bme280 sensor driver)

Can you expand on this. I can see the need/value for associating "top-level" Kconfig symbol for a driver, what's the usecase for having awareness of the driver specific features like (BME280_MODE_NORMAL)?

@nashif
Copy link
Member

nashif commented Aug 24, 2022

same topic #38725 (comment)

@mbolivar-nordic
Copy link
Contributor

Can you expand on this. I can see the need/value for associating "top-level" Kconfig symbol for a driver, what's the usecase for having awareness of the driver specific features like (BME280_MODE_NORMAL)?

Consider the alternatives:

  1. "just grep the source code for config.TOP_LEVEL_SYMBOL and figure it out for yourself"
  2. "just dig around in menuconfig and figure it out for yourself"

These are what Linux provides. I think they are self evidently pretty gross from a user perspective, but maybe I'm alone in that. I think programming interfaces should be able to have documentation that explains how to use them that doesn't require people to RTFS.

@bjarki-andreasen
Copy link
Collaborator

The properties files and associated scripts have been isolated and moved to this PR #50441

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Device Model RFC Request For Comments: want input from the community
Projects
Status: No status
Development

No branches or pull requests

6 participants