问题
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