Does anyone know where to define the hardware, revision and serial no. fields of /proc/cpuinfo?

大兔子大兔子 提交于 2020-01-13 09:17:06

问题


I want to ensure my /proc/cpuinfo is accurate. It currently outputs

Hardware        : am335xevm
Revision        : 0000
Serial          : 0000000000000000

where in the code can I change this to give real values?


回答1:


It depends on the version of Linux and processor architecture. Since this is a TI ARM, you can start with: arch/arm/kernel/setup.c.

Look for static int c_show().

The Revision and Serial values are set with ATAG_REVISION and ATAG_SERIAL, so an appropriate boot loader can pass them to Linux. Typically you do not set these in the code but use them as conditionals to handle hardware variations that can not be detected at run time in a machine file or driver.



来源:https://stackoverflow.com/questions/16866436/does-anyone-know-where-to-define-the-hardware-revision-and-serial-no-fields-of

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!