Error: unrecognized/unsupported machine ID(2)

Error: unrecognized/unsupported machine ID

    原因:

This kind of error message happens if the machine ID which is set in U-Boot doesn't match the kernel's ID(s). Unfortunately a standard U-Boot sets the machine ID on AT91RM9200DK boards not to MACH_TYPE_AT91RM9200DK but to the generic MACH_TYPE_AT91RM9200. You can either this in board/at91rm9200dk/at91rm9200dk.c; I would recommend to obtain a new machine ID and create your own U-Boot board type, using board/at91rm9200dk as a template. The list of machine IDs can be found in include/asm-arm/mach-types.h.

The Linux kernel has to be changed accordingly to the above machine ID. There you can find the information in arch/arm/tools/mach-types arch/arm/boot/compressed/head-at91rm9200.S arch/arm/mach-at91rm9200/board-dk.c

    具体资料如下:

    U-boot端include/asm-arm/mach-types.h支持的at91rm9200的machine类型有:

#define MACH_TYPE_AT91RM9200           251
#define MACH_TYPE_AT91RM9200DK         262

    但是在board/at91rm9200dk/at91rm9200dk.c中,虽然注释中说明使用的是AT91RM9200DK-Board,但是实际使用的是MACH_TYPE_AT91RM9200。

int board_init (void)
{
    /* Enable Ctrlc */
    console_init_f ();

    /* Correct IRDA resistor problem */
    /* Set PA23_TXD in Output */
    ((AT91PS_PIO) AT91C_BASE_PIOA)->PIO_OER = AT91C_PA23_TXD2;

    /* memory and cpu-speed are setup before relocation */
    /* so we do _nothing_ here */

    /* arch number of AT91RM9200DK-Board */
    gd->bd->bi_arch_number = MACH_TYPE_AT91RM9200;
    /* adress of boot parameters */
    gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;

    return 0;
}


Linux内核端:
arch/arm/tools/mach-types支持的at91rm9200的machine的ID有:
at91rm9200              ARCH_AT91RM9200         AT91RM9200              251
at91rm9200dk            ARCH_AT91RM9200DK       AT91RM9200DK            262
at91rm9200tb            ARCH_AT91RM9200TB       AT91RM9200TB            380
at91rm9200kr            MACH_AT91RM9200KR       AT91RM9200KR            450
at91rm9200ek            MACH_AT91RM9200EK       AT91RM9200EK            705
at91rm9200utl           MACH_AT91RM9200UTL      AT91RM9200UTL           821
at91rm9200kg            MACH_AT91RM9200KG       AT91RM9200KG            975
at91rm9200rb            MACH_AT91RM9200RB       AT91RM9200RB            1060
at91rm9200df            MACH_AT91RM9200DF       AT91RM9200DF            1119

    arch/arm/boot/compressed/head-at91rm9200.S支持的有:

.section ".start", "ax"

                @ Atmel AT91RM9200-DK : 262
                mov r3, #(MACH_TYPE_AT91RM9200DK & 0xff)
                orr r3, r3, #(MACH_TYPE_AT91RM9200DK & 0xff00)
                cmp r7, r3
                beq 99f

                @ Cogent CSB337 : 399
                mov r3, #(MACH_TYPE_CSB337 & 0xff)
                orr r3, r3, #(MACH_TYPE_CSB337 & 0xff00)
                cmp r7, r3
                beq 99f

                @ Cogent CSB637 : 648
                mov r3, #(MACH_TYPE_CSB637 & 0xff)
                orr r3, r3, #(MACH_TYPE_CSB637 & 0xff00)
                cmp r7, r3
                beq 99f

                @ Atmel AT91RM9200-EK : 705
                mov r3, #(MACH_TYPE_AT91RM9200EK & 0xff)
                orr r3, r3, #(MACH_TYPE_AT91RM9200EK & 0xff00)
                cmp r7, r3
                beq 99f

                @ Conitec Carmeva : 769
                mov r3, #(MACH_TYPE_CARMEVA & 0xff)
                orr r3, r3, #(MACH_TYPE_CARMEVA & 0xff00)
                cmp r7, r3
                beq 99f

                @ KwikByte KB920x : 612
                mov r3, #(MACH_TYPE_KB9200 & 0xff)
                orr r3, r3, #(MACH_TYPE_KB9200 & 0xff00)
                cmp r7, r3
                beq 99f

                @ Embest ATEB9200 : 923
                mov r3, #(MACH_TYPE_ATEB9200 & 0xff)
                orr r3, r3, #(MACH_TYPE_ATEB9200 & 0xff00)
                cmp r7, r3
                beq 99f

                @ Sperry-Sun KAFA : 662
                mov r3, #(MACH_TYPE_KAFA & 0xff)
                orr r3, r3, #(MACH_TYPE_KAFA & 0xff00)
                cmp r7, r3
                beq 99f

                @ Ajeco 1ARM : 1075
                mov r3, #(MACH_TYPE_ONEARM & 0xff)
                orr r3, r3, #(MACH_TYPE_ONEARM & 0xff00)
                cmp r7, r3
                beq 99f

                @ Unknown board, use the AT91RM9200DK board
                @ mov r7, #MACH_TYPE_AT91RM9200
                mov r7, #(MACH_TYPE_AT91RM9200DK & 0xff)
                orr r7, r7, #(MACH_TYPE_AT91RM9200DK & 0xff00)

99:


    真正的配置信息是在arch/arm/mach-at91rm9200/board-dk.c中。

MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
        /* Maintainer: SAN People/Atmel */
        .phys_io = AT91_BASE_SYS,
        .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
        .boot_params = AT91_SDRAM_BASE + 0x100,
        .timer = &at91rm9200_timer,
        .map_io = dk_map_io,
        .init_irq = dk_init_irq,
        .init_machine = dk_board_init,
MACHINE_END


    由此可以看出,Uboot使用的AT91RM9200的machine ID,而内核配置的是at91rm9200 dk的machine
ID,在这种情况下就出现了不一致。所以更改的方法:

    方法一、把Uboot中board init中更改为MACH_TYPE_AT91RM9200DK

    方法二、把MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")更改为MACHINE_START(AT91RM9200, "Atmel AT91RM9200-DK")。

    只要U-boot和Linux kernel一致即可。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值