Closed Popolon closed 2 years ago
Thanks for the idea and the webpage.
Looks good but there is an issue with this. The most important part of the code is to detect the SoC. Filling the name, technology, etc is easy, but the hard thing is to actually detect the SoC. To do so, cpufetch will look at /proc/cpuinfo
and read the Hardware
line, and will try to match it against the string that you use in match_xxx
.
For example, let's look at the Pinephone, which has Allwinner A64 (see this link). The reported hardware in this case is sun50iw1p1
which could be shortened to sun50i
. Following the URL that you posted we can build a function like yours and actually match the CPU against the sun50i
string. But here is the thing. There are a lot of SoCs that can be matched with sun50i
. In the webpage (see this table), if we use sun50iw1p1
, it can be either A64, H64, or R18...
So it seems that it is impossible to unequivocally detect a Allwiner SoC by its name in /proc/cpuinfo
Thanks for your answer. If /proc/cpuinfo is used, so here is the full answer for my Allwinner A20 as reference (I masked the serial number). The Hardware field contains : "Allwinner $family ($model) Family"
Hardware : Allwinner sun7i (A20) Family
processor : 0 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 50.52 Features : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 4 processor : 1 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 50.52 Features : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 4 Hardware : Allwinner sun7i (A20) Family Revision : 0000 Serial : xxxxxxxxxxxxxxxxx
Alright, I have just pushed a commit to feat2
branch to include Allwinner SoCs. Can you test the new commit in your machine/s and report your results here? Remember to do git checkout feat2
after downloading the code to test the latest commit.
I'm worried about this since there may be SoCs that may not be detected using this code (because the naming scheme change). But at least this should work for some SoCs. Let's see.
I made a :
git pull git checkout feat2 make ./cpufetch
works well, but still doesn't display the "Technology":
SoC: Allwinner sun7i (A20) Family Technology: Unknown Microarchitecture: Cortex-A7 Max Frequency: 960 MHz Cores: 2 cores Features: NEON Peak Performance: 7.68 GFLOP/s
Also among features, this one has edsp as returned by cat /proc/cpuinfo: Features : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
https://developer.arm.com/architectures/instruction-sets/dsp-extensions
That's really strange. Can you run the program with -v
? (run cpufetch -v
)
./cpufetch -v [WARNING]: SoC detection failed using /proc/cpuinfo: Found 'Allwinner sun7i (A20) Family' string
Looks like something went wrong during the previous checkout. when I type git branch, I'm on master;
So I removed my copy of the repository, created a new one, made a new checkout feat2 and now git branch display I'm in feat2 branch.
And that's now OK :). Thank you very much.
#################
.######## ##### ####
###### #######
#####. ## ..## ####. SoC: Allwinner A20
.#### #### ##### #### Technology: 40nm
#### ## ### ###. ##### . Microarchitecture: Cortex-A7
#### ## ## #### .###### ####* . Max Frequency: 960 MHz
### ## ##.### ## #### .###### Cores: 2 cores
### #.## ### ##### ##### . Features: NEON
### ### ### .### ### . Peak Performance: 7.68 GFLOP/s
#### ### #### #.
#### #*
##### ##.
###########.
Nice! I'll merge the changes into the master branch.
Thanks for the feedback. For now I'm closing the issue. I will consider which reported ARM features should cpufetch display for future enhancements.
I wrote this but I'm not sure about the syntax, with: Name, Series, ENUM, soc, "technology"/"process" I only put SoC where the technology is known from the page in link. This is a wiki of people working on open source driver for AllWinner SoCs, mainly by reverse engineering.