Skip to content

drivers: hwinfo: litex: add warning and infos #89240

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maass-hamburg
Copy link
Collaborator

adds warning and info about the LiteX hwinfo
driver, that the returned device id is not unique.

Signed-off-by: Fin Maaß f.maass@vogl-electronic.com

adds warning and info about the LiteX hwinfo
driver, that the returned device id is not unique.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>

if (CONFIG_HWINFO_LITEX)
message(WARNING "
Warning: CONFIG_HWINFO_LITEX does not return a unique device id. It is shared
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's kind of weird to have it as a warning at this level -- there's several other things that this Kconfig being enabled potentially gives access to. In the future the driver might e.g. implement hwinfo_get_reset_cause and at this point warning people who couldn't care less about device ID seems odd.

How about making it a __WARN(...) right in the z_impl_hwinfo_get_device_id of the driver?

@@ -191,7 +191,9 @@ config HWINFO_LITEX
depends on DT_HAS_LITEX_DNA0_ENABLED
select HWINFO_HAS_DRIVER
help
Enable LiteX hwinfo driver
Enable LiteX hwinfo driver. It does not return a unique device id. It is shared
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same remark -- I understand you want to warn people but that KConfig can in theory be for more than just getting device ID. FWIW I think documenting this hardware limitation in the binding might make more sense.

@maass-hamburg
Copy link
Collaborator Author

@kartben

IMO this driver is useless, it's only benefit is, that hwinfo_get_device_id don't fails.

That is the implementation on litex side:
https://github.com/enjoy-digital/litex/blob/b7066532a16183ddd186b698c865fc36f205cf1c/litex/soc/integration/soc.py#L1531-L1541

It's just a constant with the build time of the litex fpga bitstream.

Removal would be the best IMO, due to the following reasons:

  • it's not unique (optional, according to the api description)
  • it's not guaranteed to stay the same on one board, as it includes the build time of the fpga bitstream, so changing that also changes the device_id

@mateusz-holenko you contributed this driver in #18649, can you say why and what was the use-case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: HWINFO Hardware Information Driver platform: LiteX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants