Skip to content

Instantly share code, notes, and snippets.

@ThomasKaiser
Last active April 2, 2024 09:10
Show Gist options
  • Save ThomasKaiser/d99228ac986378c41f4f8e6bc3f5cb70 to your computer and use it in GitHub Desktop.
Save ThomasKaiser/d99228ac986378c41f4f8e6bc3f5cb70 to your computer and use it in GitHub Desktop.
https://github.com/CoreELEC/bl301/blob/1b435f3e20160d50fc01c3ef616f1dbd9ff26be8/arch/arm/include/asm/cpu_id.h#L21-L42
https://www.kernel.org/doc/Documentation/devicetree/bindings/arm/amlogic.txt
Amlogic chip ids: https://github.com/CoreELEC/linux-amlogic/blob/ab1ab097d1a7b01d644d09625c9e4c7e31e35fb4/arch/arm64/kernel/cpuinfo.c#L135-L158
More cpuinfo: http://tessy.org/wiki/index.php?Arm#ae54e1d6 (archived at https://archive.md/nf6kL)
https://github.com/pytorch/cpuinfo/tree/master/src/arm/linux/
With ARMv7 SoCs (or ARMv8 SoCs booting a 32-bit kernel) dmesg output starts with a line identifying core type and stepping of cpu0:
CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c5387d <- Cortex-A5 / r0p1 / Amlogic S805
CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=10c5387d <- Cortex-A7 / r0p3 / Exynos 5422
CPU: ARMv7 Processor [410fc072] revision 2 (ARMv7), cr=10c5387d <- Cortex-A7 / r0p2 / MediaTek MT6589/TMK6588
CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=50c5387d <- Cortex-A7 / r0p3 / Banana Pi M2 (Allwinner A31s), Odroid XU4 (Exynos 5422)
CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d <- Cortex-A7 / r0p4 / Allwinner A20: Banana Pi
CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=50c5387d <- Cortex-A7 / r0p4 / Allwinner A20: Banana Pi, Banana Pi Pro, Cubieboard 2, Cubietruck, Lamobo R1, Lime 2, OLinuXino-A20, pcDuino3 Nano
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d <- Cortex-A7 / r0p5 / Beelink X2, Orange Pi+ 2E, Orange Pi One, Orange Pi PC, Orange Pi PC +, Orange Pi Zero, rk322x-box, BCM2836 (BCM2709), Generic RK322x TV Box board, Nexbox A95X R1, Rockchip RV1108 MINIEVB V10, Firefly Core-RV1126-JD4 Board
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d <- Cortex-A7 / r0p5 / HiSilicon Hi351x, Freescale/NXP i.MX7D, Freescale i.MX6 ULL, BCM2836 (BCM2709), Qualcomm MDM9607 (Snapdragon X5 LTE Modem)
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=30c5387d <- Cortex-A7 / r0p5 / Renesas RZ/N1S
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=50c5387d <- Cortex-A7 / r0p5 / Banana Pi M2+, Banana Pi M2U, Banana Pi M2 Zero, Banana Pi M3, Beelink X2, Cubietruck+, NanoPi Air, NanoPi Duo, NanoPi Duo2, NanoPi M1, NanoPi Neo, NanoPi R1, Orange Pi+, Orange Pi+ 2E, Orange Pi Lite, Orange Pi One, Orange Pi PC, Orange Pi PC +, Orange Pi R1, Orange Pi Zero, Orange Pi Zero LTS, Orange Pi Zero Plus 2, PineCube, ZeroPi
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=70c5387d <- Cortex-A7 / r0p5 / STMicroelectronics STM32MP157C-DK2 Discovery Board
CPU: ARMv7 Processor [410fc0d1] revision 1 (ARMv7), cr=10c5387d <- Cortex-A17 / r0p1 / RK3288
CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d <- Cortex-A53 / r0p4 / Raspberry Pi 3 Model B Rev 1.2 (BCM2837/BCM2709)
CPU: ARMv7 Processor [410fd083] revision 3 (ARMv7), cr=30c5383d <- Cortex-A72 / r0p3 / BCM2711
CPU: ARMv7 Processor [411fc087] revision 7 (ARMv7), cr=10c53c7f <- Cortex-A8 / r1p7 / TI Sitara AM3517
CPU: ARMv7 Processor [411fc092] revision 2 (ARMv7), cr=10c5387f <- Cortex-A9 / r1p2 / TI OMAP 4460
CPU: ARMv7 Processor [412fc091] revision 1 (ARMv7), cr=10c5387d <- Cortex-A9 / r2p1 / NXP QorIQ LS1024A
CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d <- Cortex-A9 / r2p10 / Freescale/NXP i.MX6
CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=10c5387d <- Cortex-A15 / r2p2 / TI Sitara AM572x
CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f <- Cortex-A8 / r3p2 / Beagleboard-xm
CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=50c5387d <- Cortex-A8 / r3p2 / Allwinner A10
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d <- Cortex-A9 / r3p0 / RK3066 / RK3188 / Cyclone V FPGA SoC / Exynos 4412
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c53c7f <- Cortex-A9 / r3p0 / Amlogic 8726-MX
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=50c5387d <- Cortex-A9 / r3p0 / Calxeda Highbank
CPU: ARMv7 Processor [413fc0f2] revision 2 (ARMv7), cr=10c5347d <- Cortex-A15 / r3p2 / Renesas R8A7790 SoC
CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d <- Cortex-A9 / r4p1 / Amlogic S812
CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c53c7d <- Cortex-A9 / r4p1 / Marvell Armada 385 Development Board / Freescale/NXP i.MX6SLL (Kindle Paperwhite 4)
CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=18c5387d <- Cortex-A9 / r4p1 / Triductor TR6560
CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=50c5387d <- Cortex-A9 / r4p1 / Armada 375/38x
CPU: ARMv7 Processor [511f04d0] revision 0 (ARMv7), cr=10c5387d <- Qualcomm Krait / r1p0 / Qualcomm MSM8960 (Snapdragon S4 Plus)
CPU: ARMv7 Processor [512f04d0] revision 0 (ARMv7), cr=10c5787d <- Qualcomm Krait / r2p0 / Qualcomm IPQ806x
CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d <- ARM1176 / r0p7: Broadcom BCM2835/BCM2708
(MIDR_EL1: https://archive.ph/q80BH –– for vendor and core ID see GetARMCore
function above, e.g. Vendor ID 41 is ARM, 48 is HiSilicon, 51 Qualcomm and so on)
410fc051
| | |
| | +- 1 -> p1
| +--- 41/c05 -> Cortex-A5 / r0p1
+------ 0 -> r0
410fc074
| | +- 4 -> p4
| +--- 41/c07 -> Cortex-A7 / r0p4
+------ 0 -> r0
412fc09a
| | +- a (hex) -> p10
| +--- 41/c09 -> Cortex-A9 / r2p10
+------ 2 -> r2
410fc0d1
| | +- 1 -> p1
| +--- 41/c0d -> Cortex-A17 / r0p1
+------ 0 -> r0
481fd010
| | +- 0 -> p0
| +--- 48/d01 -> HiSilicon TaiShan v110 / r1p0
+------ 1 -> r1
511f04d0
| | +- 0 -> p0
| +--- 51/04d -> Qualcomm Krait / r1p0
+------ 1 -> r1
With ARMv8 cores some 4.x (BSP) kernels expose type of cpu0 like this in dmesg output:
4.9.280-sun50iw9: Boot CPU: AArch64 Processor [410fd034] <- Cortex-A53 / r0p4
4.9.272-meson64: Boot CPU: AArch64 Processor [411fd050] <- Cortex-A55 / r1p0 (S905X3)
4.4.213-rk3399: Boot CPU: AArch64 Processor [410fd034] <- Cortex-A53 / r0p4
4.9.140-l4t: Boot CPU: AArch64 Processor [4e0f0040] <- NVidia Carmel / r0p0 (Nvidia Tegra Xavier)
4.9.0-yocto: Boot CPU: AArch64 Processor [411fd073] <- Cortex-A57 / r1p3 (Renesas R8A7795/R-Car H3)
...while starting with later 4.1x kernels and 5.x it looks like this:
Booting Linux on physical CPU 0x0000000000 [0x411fd040] <- Cortex-A35 / r1p0 (Amlogic S905Y4)
Booting Linux on physical CPU 0x0000000000 [0x410fd030] <- Cortex-A53 / r0p0 (Snapdragon 410 / MSM8916)
Booting Linux on physical CPU 0x0000000000 [0x410fd032] <- Cortex-A53 / r0p2 (Snapdragon 810 / MSM8994)
Booting Linux on physical CPU 0x0000000000 [0x410fd034] <- Cortex-A53 / r0p4
Booting Linux on physical CPU 0x0000000000 [0x411fd050] <- Cortex-A55 / r1p0 (S905X3)
Booting Linux on physical CPU 0x0000000000 [0x412fd050] <- Cortex-A55 / r2p0 (RK3566/RK3568 or RK3588/RK3588s or S905X4/S905C2)
Booting Linux on physical CPU 0x0000000000 [0x411fd071] <- Cortex-A57 / r1p1 (Tegra TX1)
Booting Linux on physical CPU 0x0000000000 [0x411fd072] <- Cortex-A57 / r1p2 (AMD Opteron A1100)
Booting Linux on physical CPU 0x0000000000 [0x410fd083] <- Cortex-A72 / r0p3 (BCM2711 or LX2xx0A or Marvell Armada3900-A1 or AWS Graviton or Xilinx Versal)
Booting Linux on physical CPU 0x0000080000 [0x481fd010] <- HiSilicon TaiShan v110 / r1p0
Booting Linux on physical CPU 0x0000000000 [0x51df805e] <- Qualcomm Kryo 4XX Silver / r13p14 (Snapdragon 8cx)
Booting Linux on physical CPU 0x0000000000 [0x413fd0c1] <- Neoverse-N1 / r3p1 (Ampere Altra)
Booting Linux on physical CPU 0x0000000000 [0x411fd401] <- Neoverse-V1 / r1p1 (AWS Graviton3)
Booting Linux on physical CPU 0x0000000000 [0x410fd421] <- Cortex-A78AE / r0p1 (Nvidia Jetson Orin NX / AGX Orin)
Booting Linux on physical CPU 0x0000000000 [0x611f0221] <- Apple Icestorm / r1p1 (Apple M1)
Booting Linux on physical CPU 0x0000000000 [0x611f0320] <- Apple Blizzard / r1p0 (Apple M2)
Booting Linux on physical CPU 0x0000000000 [0x412fd050] <- Cortex-A55 / r2p0 (Allwinner T527)
Additional ARMv8 cores show up in dmesg output like this (always exposing MIDR_EL1 except for 5.4 kernels, e.g. Amlogic's for S4/T7):
CPU4: Booted secondary processor [410fd082] <- Cortex-A72 / r0p2 (RK3399 or i.MX8QM or Kunpeng-916 or LD20 or LS2088A)
CPU2: Booted secondary processor 0x0000000100 [0x410fd092] <- Cortex-A73 / r0p2 (S922X/A311D)
CPU7: Booted secondary processor 0x0000000700 [0x51df804e] <- Qualcomm Kryo 4XX Gold / r13p14 (Snapdragon 8cx)
CPU7: Booted secondary processor 0x0000010103 [0x611f0330] <- Apple Avalanche / r1p0 (Apple M2)
If the kernel is recent enough MIDR_EL1 can be read out at runtime per core via
/sys/devices/system/cpu/cpuN/regs/identification/midr_el1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment