royhenderson
Posts: 34
Joined: Sat Apr 09, 2016 1:56 pm

cpuinfo reports Pi3B as BCM2835 ...

Fri Mar 23, 2018 10:43 am

Why does cpuinfo report my Pi3B as BCM2835 with ARMv7?

I would expect BCM2837 with ARMv8 ...

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23065
Joined: Sat Jul 30, 2011 7:41 pm

Re: cpuinfo reports Pi3B as BCM2835 ...

Fri Mar 23, 2018 10:50 am

We use upstream code wherever possible (ie kernel code that we don't change), and in their infinite wisdom, they (kernel maintainers) don't think having it report the actual chip correctly is something worth doing. I do not know why.

There are better ways of determining the platform you are running from if you need it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

royhenderson
Posts: 34
Joined: Sat Apr 09, 2016 1:56 pm

Re: cpuinfo reports Pi3B as BCM2835 ...

Fri Mar 23, 2018 11:01 am

.. and here was me thinking you guys were running a recycling scam!

More seriously, thanks for the explanation James - appreciated.

el_grappaduro
Posts: 14
Joined: Thu Mar 22, 2018 7:06 pm

Re: cpuinfo reports Pi3B as BCM2835 ...

Fri Mar 23, 2018 11:20 am

royhenderson wrote:
Fri Mar 23, 2018 10:43 am
I would expect BCM2837 with ARMv8 ...
You can't expect ARMv8 with a 32-bit kernel :)

I always use /proc/device-tree/model since more precise than cpuinfo (where output depends on kernel version and in which state CPU has been brought up)

User avatar
Paeryn
Posts: 2604
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: cpuinfo reports Pi3B as BCM2835 ...

Fri Mar 23, 2018 12:58 pm

el_grappaduro wrote:
Fri Mar 23, 2018 11:20 am
royhenderson wrote:
Fri Mar 23, 2018 10:43 am
I would expect BCM2837 with ARMv8 ...
You can't expect ARMv8 with a 32-bit kernel :)
Why ever not, it is what we have, ARMv8-A which the A53 is supports both AArch32 and AArch64. There are ARMv8 (-R) processors that don't have AArch64.
She who travels light — forgot something.

el_grappaduro
Posts: 14
Joined: Thu Mar 22, 2018 7:06 pm

Re: cpuinfo reports Pi3B as BCM2835 ...

Fri Mar 23, 2018 1:25 pm

Paeryn wrote:
Fri Mar 23, 2018 12:58 pm
ARMv8-A which the A53 is supports both AArch32 and AArch64.
You need 'arm_control=0x200' in config.txt and 64-bit kernel otherwise CPU is hiding ARMv8 features and behaves like ARMv7. So cpuinfo is correct. No idea how to switch from ARMv7 to ARMv8/Aarch32. I only know either ARMv7 or ARMv8/Aarch64 mode on Pi.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23065
Joined: Sat Jul 30, 2011 7:41 pm

Re: cpuinfo reports Pi3B as BCM2835 ...

Fri Mar 23, 2018 2:29 pm

el_grappaduro wrote:
Fri Mar 23, 2018 1:25 pm
Paeryn wrote:
Fri Mar 23, 2018 12:58 pm
ARMv8-A which the A53 is supports both AArch32 and AArch64.
You need 'arm_control=0x200' in config.txt and 64-bit kernel otherwise CPU is hiding ARMv8 features and behaves like ARMv7. So cpuinfo is correct. No idea how to switch from ARMv7 to ARMv8/Aarch32. I only know either ARMv7 or ARMv8/Aarch64 mode on Pi.
Except the 2835 is ARMv6...so in that respect cpuinfo is wrong.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

el_grappaduro
Posts: 14
Joined: Thu Mar 22, 2018 7:06 pm

Re: cpuinfo reports Pi3B as BCM2835 ...

Fri Mar 23, 2018 3:25 pm

jamesh wrote:
Fri Mar 23, 2018 2:29 pm
Except the 2835 is ARMv6...so in that respect cpuinfo is wrong.
Yes, it should better read bcm28xx. I was trying to explain that you won't get

Code: Select all

Features	: fp asimd evtstrm crc32
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4
instead of

Code: Select all

Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
unless you bring up the CPU in 64-bit mode. It is in an ARMv7 compatible mode the way for example Raspbian brings up the CPU.

User avatar
Paeryn
Posts: 2604
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: cpuinfo reports Pi3B as BCM2835 ...

Sat Mar 24, 2018 4:40 am

The kernel's setup for ARM (32-bit) which /proc/cpuinfo shows will always identify the cpu as CPU architecture: 7 so long as Memory Model Feature Register 0 shows either the Virtual System Memory Architecture or the Protected System Memory Architecture is set to at least ARMv7 level, which the ARMv8 does (VSMA is at least 3 for ARMv7-A and always 5 for ARMv8-A). There is no possibility for the 32-bit code to show any higher architecture number.

The AArch64 setup is the only place where the cpu will be identified as CPU architecture: 8.
el_grappaduro wrote: You need 'arm_control=0x200' in config.txt and 64-bit kernel otherwise CPU is hiding ARMv8 features and behaves like ARMv7.
What ARMv8 features is it hiding? Yes, some ARMv8 features are only available in AArch64 but that's because AArch32 is, by design, backwards compatible with ARMv7 and there isn't a (realistically) feasible way to provide most of those things like the extra registers. It doesn't hide the crc32 instructions which were never part of ARMv7. The A53 is an ARMv8-A device at all times.

You can't switch an A53 from ARMv7 to ARMv8/AArch32 because the is no such ARMv7 mode, it is always ARMv8-A with the choice of being in either AArch32 or AArch64 state. If you want the AArch64 goodies you have to boot it in that mode first as there isn't any way to switch from AArch32 to AArch64 without going up an exception level (and hence needing to have started there originally to set that up).
She who travels light — forgot something.

Return to “General discussion”