arm - U-boot 将在单核上运行?

标签 arm embedded-linux u-boot smp

我正在研究基于 TI Jacinto6(ARM CortexA15)的电路板。我正在了解 U-boot 源代码。 根据 start.S 文件,执行以下汇编指令以禁用 L1 I/D 缓存和 TLB。这条指令来自start.s( http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/cpu/armv7/start.S;h=fedd7c8f7e00d0427405173849e6c0743d6b886f;hb=524123a70761110c5cf3ccc5f52f6d4da071b959 )

 mov     r0, #0                  @ set up for MCR
 mcr     p15, 0, r0, c8, c7, 0   @ invalidate TLBs
 mcr     p15, 0, r0, c7, c5, 0   @ invalidate icache
 mcr     p15, 0, r0, c7, c5, 6   @ invalidate BP array
 mcr     p15, 0, r0, c7, c10, 4  @ DSB
 mcr     p15, 0, r0, c7, c5, 4   @ ISB

根据 ARM 文档,CortexA15 有 4 个内核。 上面的代码将禁用它正在运行的核心上的缓存和 TLB,然后其他核心的缓存和 TLB 将如何处理。 U-boot 源代码只能在一个内核上运行吗?如果是这样,那么其他内核将如何被禁用?

最佳答案

Will the U-boot source runs on only one core?

U-Boot 二进制文件(不是源代码)仅在一个处理器内核上执行。
引导加载程序的功能不需要并行处理。
此外,Linux 内核希望在启动时只启用一个内核。

If so then how other cores will be disabled?

通常在处理器/系统重置后,只有一个核心被启用;其他一切都是静止的或禁用的。

So Kernel will enable the other cores while booting?

操作系统,假设它支持 SMP(对称多处理器),将启用其他内核作为其初始化的一部分。

can you please share the kernel source link(git) which enables the other cores.

对于 ARM Cortex-A9 四核(A15 类似),Linux 内核输出:

Booting Linux on physical CPU 0x0
Linux version 3.10.60+wandboard_1.0.2+1.0.0-wandboard (root@host) (gcc version 4.8.3 (crosstool-NG 1.19.0) ) #7 SMP Mon Dec 29 18:49:06 PST 2014
CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Freescale i.MX6 Quad/DualLite (Device Tree), model: Wandboard Quad based on Freescale i.MX6 Quad
...  
L310 cache controller enabled
l2x0: 16 ways, CACHE_ID 0x410000c7, AUX_CTRL 0x32070000, Cache size: 1048576 B
...
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x804bdd30 - 0x804bdd88
CPU1: Booted secondary processor
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU2: Booted secondary processor
CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
CPU3: Booted secondary processor
CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
Brought up 4 CPUs
SMP: Total of 4 processors activated (6324.22 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
...

Linux 内核在 init/main.c 中的 start_kernel() 中开始执行其 C 代码.
调用的第二个过程是 smp_setup_processor_id() 的 ARM 版本,它负责 Booting Linux on physical CPU ... 消息文本。

start_kernel() 结束时,check_bugs() 的 ARM 版本将调用 check_writebuffer_bugs() , 它负责 CPU: Testing write buffer coherency: ... 消息文本。

start_kernel() 结束时,rest_init()最终通过secondary_start_kernel()的ARM版本初始化其他处理器内核(CPUn:已启动的辅助处理器),通过 smp_init() 以某种方式调用(调出 N 个 CPU)。

关于arm - U-boot 将在单核上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32893745/

相关文章:

linux - 从 RaspberryPi3 上的 U-boot 获取 SD 卡序列号/oemid

arm - clang ARM NEON 支持

c - gcc 和 arm-linux-gcc 之间的关系是什么

linux - 如何使用串口与RFID阅读器通信

ARM 嵌入式板的 C# .NET Core IoT 错误 : Unhandled exception. System.IO.IOException:设备或资源繁忙

linux-kernel - 了解 U-Boot 内存占用

ios - 如何在 Xcode 中使用 C 代码进行优化

linux - 在 x64 Ubuntu 主机上获取 arm 的开发库包?

c++ - Busybox 编译失败 - 网络/nslookup.c 错误

linux-kernel - 使用 LOADADDR 构建内核 uImage