前言
最近玩树莓派和编译内核的时候,经常发现树莓派官方和内核开发者对CPU的称呼有两种
- BCM2708/BCM2709
- BCM2835/BCM2836
内核开发者喜欢称之为BCM2708/9,而树莓派和博通则喜欢称为BCM2835/6
被搞的晕晕呼呼,所以花了几个小时找资料,看手册,弄清楚了二者的区别
友情提醒
本文部分链接,需要翻墙访问,请自备梯子
二者区别
google了很多资料,发现
- BCM2708/9 属于处理器的家族
- BCM2835/6 属于处理的具体型号
树莓派内核开发者在github上有相关讨论
摘录部分如下
1 | Q: What's the correct device model to reference as the machine type and in any device drivers? A: Technically 2708 is the family, and 2835 is a specific implementation. We now know that 2835 is the only implementation in the family that can run linux, (and there won't be new models of this family), so it probably doesn't matter which model is used, although it should be consistent. Q: So it would be reasonable to name all the drivers 2708 but the specific device tree file 2835? (assuming that if there is ever another model of that family that can run linux it would need a different list of devices) A: That sounds reasonable. |
网上的更进一步讨论,请访问why-is-the-cpu-sometimes-referred-to-as-bcm2708-sometimes-bcm2835
另外,从wiki得知,
博通联合树莓派已经完全开放BCM2835这颗CPU的资料,所以网上说的没有资料的情况,可以忽略
1 | The Broadcom YouTube page has videos demonstrating the video processing capability, but their website only goes as far as providing product briefs. Detailed data and development tools are only available under NDA, and then only for manufacturers with a market for very many units. However, on 28 February 2014, on the day of the second anniversary of the Raspberry PI Broadcom, together with the Raspberry PI foundation, announced the release of full documentation for the VideoCore IV graphics core, and a complete source release of the graphics stack under a 3-clause BSD license. |
树莓派BCM2835/6资料链接
- https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/README.md
- https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2836/README.md
对于博通BCM设计架构,他是将GPU作为MCU来使用,在启动时,加载bootloader,初始化RAM,外设等,然后启动ARM内核,开始全速运行状态
这样设计的好处是,ARM11或者ARM-A内核,完全作为运算核心;GPU处理视频和外设,系统可以无缝升级CPU,而对外设部分影响很小
就像这次的BCM升级到BCM2836,外设驱动,仅仅需要修改一下GPIO和DMA的偏移量,现有驱动代码,可以继续使用
实际验证
怎么知道我们的CPU型号和IO映射关系呢?
安装系统后,可以输入 sudo cat /proc/cpuinfo
可以查看当前CPU的信息
输入sudo cat /proc/iomem
,可以查看当前IO映射的信息,也就是GPU内部的信息
注意观察CPU核的数量,以及Hardware是否为BCM2709
1 | root@raspberrypi:/etc/init.d# cat /proc/cpuinfo processor : 0 model name : ARMv7 Processor rev 5 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 processor : 1 model name : ARMv7 Processor rev 5 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 processor : 2 model name : ARMv7 Processor rev 5 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 processor : 3 model name : ARMv7 Processor rev 5 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 Hardware : BCM2709 Revision : a21041 Serial : 00000000db3edacc root@raspberrypi:/etc/init.d# cat /proc/iomem 00000000-36ffffff : System RAM 00008000-00775d0b : Kernel code 007de000-0092378b : Kernel data 3f006000-3f006fff : dwc_otg 3f007000-3f007eff : /soc/dma@7e007000 3f00b840-3f00b84e : /soc/vchiq 3f00b880-3f00b8bf : /soc/mailbox@7e00b800 3f200000-3f2000b3 : /soc/gpio@7e200000 3f201000-3f201fff : /soc/uart@7e201000 3f201000-3f201fff : uart-pl011 3f204000-3f204fff : /soc/spi@7e204000 3f300000-3f3000ff : /soc/mmc@7e300000 3f980000-3f98ffff : dwc_otg root@raspberrypi:/etc/init.d# exit exit pi@raspberrypi ~ $ exit |