Chinaunix首页 | 论坛 | 博客
  • 博客访问: 861446
  • 博文数量: 133
  • 博客积分: 7117
  • 博客等级: 少将
  • 技术积分: 1846
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-16 21:30
文章分类

全部博文(133)

文章存档

2012年(1)

2011年(4)

2010年(2)

2009年(57)

2008年(69)

分类: LINUX

2008-09-23 17:43:39

1. 出错信息:error: void value not ignored as it ought to be
   解决方案:头文件声明的函数类型和函数实际类型不一致。
2. 出错信息: 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")。
 
    方法三、查看arch/arm/boot/compressed目录下是否存在head_at91rm9200.S并且支持at91rm9200架构。

    只要U-boot和Linux kernel一致即可。
3. C compiler cannot create executables问题
   gcc编译环境没用配好, 直接apt-get install gcc libc6-dev就可以解决
4. tar: bzip2: Cannot exec: No such file or directory"
   apt-get install bzip2
5. 问题:如果你在uboot保存环境变量时saveenv,出现Error: end address not on sector boundary
 解 决办法:/include/configs/at91rm9200dk.h(smdk2410.h)中 #define CFG_ENV_ADDR (PHYS_FLASH_1+0X20000) #define CFG_ENV_SIZE 0X20000(将环境变量放到了0x10040000,大家也可以根据具体情况改变你的地址,即修改CFG_ENV_ADDR)
6.make menuconfig需要libncurses库,直接安装libncurses5-dev
阅读(2487) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:Linux 中断分析

给主人留下些什么吧!~~