Alexey Guskov Posted June 1, 2022 Posted June 1, 2022 (edited) Hey guys, looks like there's no support for board serial number in latest images for Station M2. Serial number on rk356x is coming from otp memory, so: 1) there are no bindings for `otp` and `cpuinfo` devices in .dts, like here 2) there are no kernel driver to extract data from otp memory, like here I'm ready to contribute, but not sure what's the future plan for those. Edited June 1, 2022 by Alexey Guskov adding links
Myron Posted June 1, 2022 Posted June 1, 2022 What does this command report on your system: cat /proc/cpuinfo As far as I know there is no /dev/cpuinfo.
balbes150 Posted June 1, 2022 Posted June 1, 2022 There is no support for this driver in the main kernel, it is only in the old BSP.
Alexey Guskov Posted June 1, 2022 Author Posted June 1, 2022 2 часа назад, Myron сказал: What does this command report on your system: cat /proc/cpuinfo As far as I know there is no /dev/cpuinfo. sorry, a typo. Of course i meant /proc/cpuinfo
Alexey Guskov Posted June 1, 2022 Author Posted June 1, 2022 2 часа назад, balbes150 сказал: There is no support for this driver in the main kernel, it is only in the old BSP. I know there's no support, I checked the sources. But the driver seems to be simple enough and .dts changes are trivial. I can port the code from firefly kernel and create PR, but will probably need some help.
balbes150 Posted June 1, 2022 Posted June 1, 2022 20 минут назад, Alexey Guskov сказал: I can port the code from firefly kernel and create PR, but will probably need some help. Ok
Alexey Guskov Posted June 1, 2022 Author Posted June 1, 2022 16 минут назад, balbes150 сказал: Ok I'll start with questions then: 1) i got the armbian 5.17 kernel, patched the dts file, built a new .dtd, tried that on my device 2) Now i can see OTP device: # find /sys/firmware/devicetree/base/otp\@fe38c000/ /sys/firmware/devicetree/base/otp@fe38c000/ /sys/firmware/devicetree/base/otp@fe38c000/#address-cells /sys/firmware/devicetree/base/otp@fe38c000/cpu-leakage@1a /sys/firmware/devicetree/base/otp@fe38c000/cpu-leakage@1a/reg .... and cpuinfo device: # find /sys/firmware/devicetree/base/cpuinfo /sys/firmware/devicetree/base/cpuinfo /sys/firmware/devicetree/base/cpuinfo/nvmem-cells /sys/firmware/devicetree/base/cpuinfo/compatible /sys/firmware/devicetree/base/cpuinfo/nvmem-cell-names /sys/firmware/devicetree/base/cpuinfo/name But if I understand correctly, devices with NVMEM cells should be exposed to userspace as /sys/bus/nvmem/devices/somethingsomething/nvmem, but i got nothing there: # find /sys/bus/nvmem/ /sys/bus/nvmem/ /sys/bus/nvmem/uevent /sys/bus/nvmem/drivers_autoprobe /sys/bus/nvmem/devices /sys/bus/nvmem/drivers_probe /sys/bus/nvmem/drivers So, am I doing something wrong or this is expected behaviour? Do I need a loaded and active device driver for nvmem cells to be available via /sys/bus/nvmem or correct device tree definition should be enough?
9bx154 Posted June 1, 2022 Posted June 1, 2022 This should work: # cat /proc/device-tree/serial-number
Alexey Guskov Posted June 1, 2022 Author Posted June 1, 2022 16 минут назад, 9bx154 сказал: This should work: # cat /proc/device-tree/serial-number Nope # find /proc/device-tree/serial-number find: ‘/proc/device-tree/serial-number’: No such file or directory Don't see a 'serial-number' device in .dts files for rk356x, are you sure it works on Station M2 for you?
Alexey Guskov Posted June 1, 2022 Author Posted June 1, 2022 Okay, silly me, of course a device wont work if there's no driver for it
Myron Posted June 1, 2022 Posted June 1, 2022 4 hours ago, Alexey Guskov said: sorry, a typo. Of course i meant /proc/cpuinfo 4 hours ago, Alexey Guskov said: sorry, a typo. Of course i meant /proc/cpuinfo I've corrected the topic subject for you.
Recommended Posts