树莓派是一款来源于英国慈善组织“Raspberry Pi 基金会”的卡片电脑,至今已经发行在售了 9 个型号:
- Pi 4 Model B
- Pi 3 Model A+
- Pi 3 Model B+
- Pi 3 Model B
- Pi 2 Model B
- Pi 1 Model B+
- Pi 1 Model A+
- Pi Zero W
- Pi Zero
不同型号之间的功能和性能都有比较大的差别。
通常,我们可以从树莓派板卡外观直接分辨型号,但是有些型号外观差异比较小,不是特别容易区分,比如 3B+ 和 3B:
当从外观区分不出来,或者接触不到树莓派真实板卡(比如远程登录)的情况下,官方介绍了一种命令行方法,可以非常精确地知道板卡信息。
在命令行中输入:
cat /proc/cpuinfo
会打印类似下面的信息:
Revision : a03111Model: Raspberry Pi 4 Model B Rev 1.1
Revision 是板卡型号编码,Model 是型号名称。编码对应表如下:
这里贴一张我的树莓派的 /proc/cpuinfo 信息截图(正在远程登录中):
注意事项
cat /proc/cpuinfo 打印的信息里面,包含 Hardware: BCM2835 硬件架构码,但这并不是 CPU 型号,而是 Linux 内核内置的,代表树莓派系列的硬件架构码。
这个官方也解释过了:
Why does cpuinfo report I have a BCM2835? The upstream Linux kernel developers had decided that all models of Raspberry Pi return bcm2835 as the SoC name. At Raspberry Pi we like to use as much upstream kernel code as possible, as it makes software maintenance much easier, so we use this code. Unfortunately it means that cat /proc/cpuinfo is inaccurate for the Raspberry Pi 2, Raspberry Pi 3 and Raspberry Pi 4, which use the bcm2836/bcm2837, bcm2837 and bcm2711 respectively. You can use cat /proc/device-tree/model to get an accurate description of the SoC on your Raspberry Pi model.
FAQs - Raspberry Pi Documentation
参考资料
- RPi HardwareHistory - eLinux.org
- Buy a Raspberry Pi – Raspberry Pi
- FAQs - Raspberry Pi Documentation
- cat /proc/cpuinfo | grep Hardware on a Pi 4 returns BCM2835, should be BCM2711? · Issue #3022 · raspberrypi/linux
- Raspberry Pi revision codes - Raspberry Pi Documentation