Jump to content
  • 0

No way to get device serial number from /proc/cpuinfo or elsewhere.


Alexey Guskov
 Share

Question

Posted (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 by Alexey Guskov
adding links
Link to comment
Share on other sites

10 answers to this question

Recommended Posts

Open source development is fun. Join Armbian Linux development team today!

  • 0
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.

Link to comment
Share on other sites

  • 0
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?

Link to comment
Share on other sites

  • 0
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? 

Link to comment
Share on other sites

  • 0
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...