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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions drivers/hwinfo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ zephyr_library_sources_ifdef(CONFIG_HWINFO_SILABS_S2 hwinfo_silabs_series2.c)
zephyr_library_sources_ifdef(CONFIG_HWINFO_SMARTBOND hwinfo_smartbond.c)
zephyr_library_sources_ifdef(CONFIG_HWINFO_STM32 hwinfo_stm32.c)
# zephyr-keep-sorted-stop

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?

across all devices with the same bitstream.")
endif()
4 changes: 3 additions & 1 deletion drivers/hwinfo/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.

across all devices with the same bitstream. See litex/soc/cores/identifier.py in the
LiteX repository for more information.

config HWINFO_PSOC6
bool "Cypress PSOC 6 unique device ID"
Expand Down