您的位置 首页 应用

ARM MACHINE_TYPE_XXXX问题

1.MachinesID分配表参考:http://www.arm.linux.org.uk/developer/machines/193(0xC1)smdk2410362(0x16A)S3C24402

1. Machines ID分配表

参阅:http://www.arm.linux.org.uk/developer/machines/

193(0xC1) smdk2410

362(0x16A) S3C2440

2928 WM8505

3472WonderMedia WM8650 Reference Board

——————————————————————————————————-

The ArcNumber parameter references a particular mach-type/machine from the kernelsArm machine table, telling the kernel which specific piece of hardware its on.

Its presumed that the bundled kernel is hardcoded and doesnt need this parameter, but if you are building your own kernel, you need to set this parameter in uBoot , so the kernel knows what to boot. Leaving it set appears to be perfectly OK for botting the bundled kernels.

========================================================================================

The machine type number is obtained via the ARM Linux websiteMachine Registry. A machine type should be obtained as early in a

projects life as possible, it has a number of ramifications for the kernel port itself (machine definitions etc.) and changing definitions

afterwards may lead to a number of undesirable issues. These values are represented by a list of defines within the kernel source

(linux/arch/arm/tools/mach-types).

2. 作者遇到的问题

在<<移植linux 2.6.31到OK2440V3开发板(1)---bootm手动引导>>一文中,履行完第6步的操作后,发动u-boot后,用bootm 指令来引导内核(履行bootm 0x30008000),可是履行后,卡住了,无法发动内核,现象如下:

Starting kernel …

Uncompressing Linux…………………………………………………….

Error: unrecognized/unsupported machine ID (r1 = 0x000000c1).

Available machine support:

ID (hex) NAME
000000a8 SMDK2440

从这儿的提示信息可知,是u-boot的Machine Type和linux的不相同形成的,u-boot是0x000000c1(193),内核是 0x0000016A(362)。

网上大多数都是修正linux内核的机器码,在arch/arm/tools/mach-types.h中,让它们共同,详细修正哪一方,我觉得要看状况而定。

咱们先看u-boot的机器码和linux的机器码是在什么地方决议的。

u-boot的机器码是在u-boot的board/samsung/ok2440v3/ok2440v3.c文件里决议的:
/* arch number of SMDK2410-Board */
gd->bd->bi_arch_number = MACH_TYPE_SMDK2410;

检查u-boot/include/asm-arm/mach-types.h文件,有:
#define MACH_TYPE_SMDK2410 193
#define MACH_TYPE_S3C2440 362
这便是咱们上面看到r1 = 0x000000c1(193)的原因。

linux的机器码是由arch/arm/mach-s3c2440/mach-smdk2440.c下面的MACHINE_START(S3C2440, “SMDK2440”)中的第一个参数S3C2440(关键字)决议的:

MACHINE_START(S3C2440, “SMDK2440”)
/* Maintainer: Ben Dooks */
.phys_io = S3C2410_PA_UART,
.io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
.boot_params = S3C2410_SDRAM_PA + 0x100,

.init_irq = s3c24xx_init_irq,
.map_io = smdk2440_map_io,
.init_machine = smdk2440_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END

检查内核目录下的arch/arm/tools/mach-types.h文件,有:
smdk2410 ARCH_SMDK2410 SMDK2410 193
s3c2440 ARCH_S3C2440 S3C2440 362
smdk2440 MACH_SMDK2440 SMDK2440 1008

关键字是s3c2440,所以咱们上面看到的是0x000000a8(362)。

所以,咱们这儿不去修正内核,而是直接修正u-boot 的 board/samsung/ok2440v3/ok2440v3.c文件,如下:
/* arch number of SMDK2410-Board */
gd->bd->bi_arch_number = MACH_TYPE_S3C2440;

从头编译u-boot后,下载到nand中,完结<<移植linux 2.6.31到OK2440V3开发板(1)---bootm手动引导>>一文中的第8步后,就可以手动成功引导内核了。

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/yingyong/275639.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部