CPU Manufacture Info

Post Reply
additude
Posts: 73
Joined: Sat Dec 02, 2017 8:02 pm
languages_spoken: english
ODROIDs: .
8-XU4's
11-MC1's
6 - N2's
Has thanked: 10 times
Been thanked: 1 time
Contact:

CPU Manufacture Info

Unread post by additude » Sat Nov 02, 2019 7:13 pm

Is there an equivalent for "ARMv7 Processor rev 3 (v7l)" with the N2?
In my XU4's and MC1's I derive this from:

Code: Select all

CPUinfo=$(more /proc/cpuinfo | grep 'model name' | head -n 1)
However /proc/cpuinfo for the N2 doesn't have this info and I can't locate it on the N2 anywhere.
Thanks

User avatar
tobetter
Posts: 4265
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 59 times
Been thanked: 235 times
Contact:

Re: CPU Manufacture Info

Unread post by tobetter » Tue Nov 05, 2019 12:39 pm

You can access both to hardware model and they are matched as defined in the device-tree file.

Code: Select all

/proc/device-tree/model
/sys/firmware/devicetree/base/model

blu
Posts: 78
Joined: Wed Mar 08, 2017 11:30 pm
languages_spoken: english
ODROIDs: XU4, N2
Has thanked: 3 times
Been thanked: 20 times
Contact:

Re: CPU Manufacture Info

Unread post by blu » Tue Nov 05, 2019 6:31 pm

Actually /proc/cpuinfo already reports almost everything practically interesting (log copied from the wiki -- shown record just for the 1st core)

Code: Select all

cat /proc/cpuinfo 
processor       : 0
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
From the above we know it's a stock ARM uarch ('implementer' filed) compliant to armv8 ('architecture' field), it's a ca53 ('part' field), its revision is r0p4 ('variant' filed + 'revision" field).

More interesting is the 'features' set, though -- there's vfp4 ('fp' flag), asimd/neon2 ('asimd' flag), the generic timer is set to fire periodic events ('evtstrm' flag), there's AES, SHA1, SHA2 and CRC2 crypto features ('aes', 'sha1', 'sha2' and 'crc32' flags, respectively), and polynomial multiplication neon ops ('pmull' flag), which, again, has crypto applications.

additude
Posts: 73
Joined: Sat Dec 02, 2017 8:02 pm
languages_spoken: english
ODROIDs: .
8-XU4's
11-MC1's
6 - N2's
Has thanked: 10 times
Been thanked: 1 time
Contact:

Re: CPU Manufacture Info

Unread post by additude » Tue Nov 05, 2019 9:45 pm

Thanks tobetter and blu, but I am not looking for the device model name, I'm looking for the CPU info.

In the XU4 and MC1 I can locate CPU info with:

Code: Select all

cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 90.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 3
That model name "ARMv7 Processor rev 3 (v7l)" is what I am looking for.

But for the N2 I get:

Code: Select all

cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
I'm looking for this exact line, which is hard coded and resides somewhere in the N2:

Code: Select all

Hardkernel ODROID-N2 [Impl 0x41 Arch 8 Variant 0x0 Part 0xd03 Rev 4]
It seems to be quite elusive....

blu
Posts: 78
Joined: Wed Mar 08, 2017 11:30 pm
languages_spoken: english
ODROIDs: XU4, N2
Has thanked: 3 times
Been thanked: 20 times
Contact:

Re: CPU Manufacture Info

Unread post by blu » Tue Nov 05, 2019 10:14 pm

additude wrote:
Tue Nov 05, 2019 9:45 pm
I'm looking for this exact line, which is hard coded and resides somewhere in the N2:

Code: Select all

Hardkernel ODROID-N2 [Impl 0x41 Arch 8 Variant 0x0 Part 0xd03 Rev 4]
It seems to be quite elusive....
Sorry, I should've been clearer. That one line equivalent to the XU4 cpuinfo you're looking for can be composed by simply concatenating (and expanding to the full name, where needed):

1. The ISA version from /proc/cpuinfo -- 'architecture' field equals '8' on armv8.
2. The revision number from /proc/cpuinfo, translating to r0p4 on the ca53 cores (different for the ca73 cores).

This set in particular

Code: Select all

[Impl 0x41 Arch 8 Variant 0x0 Part 0xd03 Rev 4]
is precisely a combination of those respective fields from /proc/cpuinfo. The part that says

Code: Select all

Hardkernel ODROID-N2
can also be extracted from /proc/cpuinfo -- look at the bottom of the output (see here for /proc/cpuinfo on N2: https://wiki.odroid.com/odroid-n2/appli ... t_cpu_freq)

So I wouldn't bet that the N2 line you're looking for is hardcoded anywhere in the N2 kernel -- those could be just stats collected from /proc/cpuinfo.

additude
Posts: 73
Joined: Sat Dec 02, 2017 8:02 pm
languages_spoken: english
ODROIDs: .
8-XU4's
11-MC1's
6 - N2's
Has thanked: 10 times
Been thanked: 1 time
Contact:

Re: CPU Manufacture Info

Unread post by additude » Tue Nov 05, 2019 10:48 pm

blu,
I need to include this information in a bash utility script that I am composing.
I do understand what you are saying, however this approach means that it needs to be somehow deciphered or interpreted with possibly an associative array that would need a list of references and their human meanings. I'm sure that would end up being an exhaustive list of references.
One of the programs/apps (Written in C) that I am currently running on my N2 will successfully report the information string exactly as I showed it, so I am confident that string of information exits as is, somewhere on the N2.
I could just call to that other app and grep the results but I want to avoid a call to that C app and then grep it from my bash script because that makes my bash script dependent on that other app, when I am sure that other app grabs that info straight off in whole from somewhere on the N2.
Just finding out where is proving to be a challenge.
Thanks.

User avatar
rooted
Posts: 6924
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 278 times
Been thanked: 71 times
Contact:

Re: CPU Manufacture Info

Unread post by rooted » Tue Nov 05, 2019 10:49 pm

I get a bit different on CoreELEC, it contains a model name but not what you are looking for.

Code: Select all

processor       : 5
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd09
CPU revision    : 2

Serial          : *snip*
model name      : Amlogic S922X rev a
Hardware        : Hardkernel ODROID-N2
Revision        : 0400

additude
Posts: 73
Joined: Sat Dec 02, 2017 8:02 pm
languages_spoken: english
ODROIDs: .
8-XU4's
11-MC1's
6 - N2's
Has thanked: 10 times
Been thanked: 1 time
Contact:

Re: CPU Manufacture Info

Unread post by additude » Tue Nov 05, 2019 11:19 pm

That's interesting.....

I wish I was getting that on Ubuntu.....

elatllat
Posts: 1590
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2
Has thanked: 25 times
Been thanked: 75 times
Contact:

Re: CPU Manufacture Info

Unread post by elatllat » Wed Nov 06, 2019 2:23 am

Code: Select all

CPUinfo="$(grep -m 1 'model name' /proc/cpuinfo)"
if [ "CPUinfo" = "" ] && grep g12b /proc/device-tree/compatible >/dev/null ; then
    CPUinfo="model name	: Amlogic S922X 4 A73 @ 1.8GHz, 2 A53 @ 1.9GHz"
fi
or submit a pull request to add that information to the dts.... or wherever it's pulled from.

additude
Posts: 73
Joined: Sat Dec 02, 2017 8:02 pm
languages_spoken: english
ODROIDs: .
8-XU4's
11-MC1's
6 - N2's
Has thanked: 10 times
Been thanked: 1 time
Contact:

Re: CPU Manufacture Info

Unread post by additude » Wed Nov 06, 2019 6:21 am

Hi elatllat,
I appreciate the if code....
I have previously already created this condition:

Code: Select all

if [[ $CPUinfo == "" ]]; then # Because cpu model is not present
    CPUinfo=$(boinccmd --get_host_info | grep 'CPU model' | head -n 1) # Get info from call to other app
    CPUinfo=${CPUinfo//"CPU model: "/""}
    if [[ $CPUinfo =~ N2 ]]; then
      # CPUinfo="Arch 8 Variant Rev 4" # Choose This One
      CPUinfo="Amlogic S922X rev a" # or Choose the other
    fi
  fi
I'd love to pluck what I need right out off the top...
I've even tried back referencing the c boinc code to see where boinc HOST_INFO() "boinccmd --get_host_info" comes from but I can't track it back down on GitHub.
https://github.com/BOINC/boinc/blob/f14 ... hostinfo.h

I think I'm close... but something is beyond me.

additude
Posts: 73
Joined: Sat Dec 02, 2017 8:02 pm
languages_spoken: english
ODROIDs: .
8-XU4's
11-MC1's
6 - N2's
Has thanked: 10 times
Been thanked: 1 time
Contact:

Re: CPU Manufacture Info

Unread post by additude » Tue Nov 12, 2019 11:26 pm

rooted wrote:
Tue Nov 05, 2019 10:49 pm
I get a bit different on CoreELEC, it contains a model name but not what you are looking for.

Code: Select all

processor       : 5
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd09
CPU revision    : 2

Serial          : *snip*
model name      : Amlogic S922X rev a
Hardware        : Hardkernel ODROID-N2
Revision        : 0400
I'm curious, what do you get when you run uname -a ?

From what I have been able to figure out, all of the data displayed for /proc/cpuinfo is built from the kernel on request.
When I run uname -a I get:

Code: Select all

Linux n2-node1-1 4.9.196-63 #1 SMP PREEMPT Thu Oct 17 00:44:03 -03 2019 aarch64 aarch64 aarch64 GNU/Linux
Also, if you don't mind, what do you get for lscpu ?

I'm just curious if the ENV variables are being reported differently/correctly in your CoreELEC

Thanks.

elatllat
Posts: 1590
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1, N2
Has thanked: 25 times
Been thanked: 75 times
Contact:

Re: CPU Manufacture Info

Unread post by elatllat » Tue Nov 12, 2019 11:32 pm

additude wrote:
Tue Nov 12, 2019 11:26 pm
...uname...lscpu...
There is nothing Odroid or AMLogic specific in the output of either of those commands (for me).
device-tree is the most reliable indicator.
These users thanked the author elatllat for the post:
additude (Sun Nov 17, 2019 8:05 pm)

User avatar
mad_ady
Posts: 6888
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 248 times
Been thanked: 181 times
Contact:

Re: CPU Manufacture Info

Unread post by mad_ady » Wed Nov 13, 2019 12:24 am

If you want to see where that command gets its info you can run it with strace and see what files it opens or what other commands it runs...
These users thanked the author mad_ady for the post:
additude (Sun Nov 17, 2019 8:05 pm)

User avatar
rooted
Posts: 6924
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 278 times
Been thanked: 71 times
Contact:

Re: CPU Manufacture Info

Unread post by rooted » Fri Nov 15, 2019 12:55 am


additude wrote:
rooted wrote:
Tue Nov 05, 2019 10:49 pm
I get a bit different on CoreELEC, it contains a model name but not what you are looking for.

Code: Select all

processor       : 5
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd09
CPU revision    : 2

Serial          : *snip*
model name      : Amlogic S922X rev a
Hardware        : Hardkernel ODROID-N2
Revision        : 0400
I'm curious, what do you get when you run uname -a ?

From what I have been able to figure out, all of the data displayed for /proc/cpuinfo is built from the kernel on request.
When I run uname -a I get:

Code: Select all

Linux n2-node1-1 4.9.196-63 #1 SMP PREEMPT Thu Oct 17 00:44:03 -03 2019 aarch64 aarch64 aarch64 GNU/Linux
Also, if you don't mind, what do you get for lscpu ?

I'm just curious if the ENV variables are being reported differently/correctly in your CoreELEC

Thanks.

Code: Select all

uname -a

Code: Select all

 Linux CoreELEC 4.9.190 #1 SMP PREEMPT Wed Nov 13 02:25:44 CET 2019 aarch64 GNU/Linux 

Code: Select all

env

Code: Select all

USER=root
MAIL=/var/mail/root
SSH_CLIENT=192.168.1.166 47517 22
HOSTNAME=CoreELEC
SHLVL=1
LD_LIBRARY_PATH=/usr/lib:/storage/.kodi/addons/script.module.beautifulsoup/lib:/storage/.kodi/addons/script.module.certifi/lib:/storage/.kodi/addons/script.module.chardet/lib:/storage/.kodi/addons/script.module.dateutil/lib:/storage/.kodi/addons/script.module.idna/lib:/storage/.kodi/addons/script.module.inputstreamhelper/lib:/storage/.kodi/addons/script.module.mechanize/lib:/storage/.kodi/addons/script.module.pydes/lib:/storage/.kodi/addons/script.module.pyxbmct/lib:/storage/.kodi/addons/script.module.requests/lib:/storage/.kodi/addons/script.module.simplejson/lib:/storage/.kodi/addons/script.module.six/lib:/storage/.kodi/addons/script.module.urllib3/lib:/storage/.kodi/addons/virtual.system-tools/lib:/usr/lib/pulseaudio
HOME=/storage
SSH_TTY=/dev/pts/0
PS1=\[\e[1;32m\]\h\[\e[1;32m\]:\[\e[1;34m\]\w \[\e[0m\]\$
LOGNAME=root
TERM=xterm
PATH=/usr/bin:/usr/sbin:/storage/.kodi/addons/virtual.system-tools/bin
SYSTEMD_COLORS=0
SSH_AUTH_SOCK=/tmp/ssh-y832ng99Fe/agent.4364
SHELL=/bin/sh
PWD=/storage
SSH_CONNECTION=192.168.1.166 47517 192.168.1.142 22
EDITOR=nano

Code: Select all

lscpu

Code: Select all

Architecture:        aarch64
Byte Order:          Little Endian
CPU(s):              6
On-line CPU(s) list: 0-5
Thread(s) per core:  1
Core(s) per socket:  3
Socket(s):           2
Vendor ID:           ARM
Model:               4
Model name:          Cortex-A53
Stepping:            r0p4
CPU max MHz:         1896.0000
CPU min MHz:         100.0000
BogoMIPS:            48.00
Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32
These users thanked the author rooted for the post:
additude (Sun Nov 17, 2019 8:05 pm)

User avatar
cdu13a
Posts: 202
Joined: Tue Jan 20, 2015 3:33 pm
languages_spoken: english
ODROIDs: C1, C2, XU4, HC1, N2
Has thanked: 0
Been thanked: 20 times
Contact:

Re: CPU Manufacture Info

Unread post by cdu13a » Fri Nov 15, 2019 11:50 am

additude wrote:
Tue Nov 05, 2019 11:19 pm
That's interesting.....

I wish I was getting that on Ubuntu.....
/proc/cpuinfo is not a reliable source of information. It can be drastically different what info is available there on different systems.

Is your script going to just display the CPU info or is it going to do something with it?

If you want to get the cpu model info for the N2 like you get on CoreELEC here is the commit that adds that to the kernel.
https://github.com/CoreELEC/linux-amlog ... a548e41160
These users thanked the author cdu13a for the post:
additude (Sun Nov 17, 2019 8:05 pm)

additude
Posts: 73
Joined: Sat Dec 02, 2017 8:02 pm
languages_spoken: english
ODROIDs: .
8-XU4's
11-MC1's
6 - N2's
Has thanked: 10 times
Been thanked: 1 time
Contact:

Re: CPU Manufacture Info

Unread post by additude » Sun Nov 17, 2019 8:01 pm

Thanks for that feedback everyone.
I am displaying this info to the terminal as part of a bash utility that I've created which includes other things such as temps, governors, clock speeds, cpu load, processes, etc.
At first, not thinking that this would be something so involved, but I have learned some very interesting things.
cdu13a, it looks like you submitted that commit Sept 18th..... but just for the CoreELEC OS ?

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: kirik and 1 guest