Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1146185
  • 博文数量: 241
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 2279
  • 用 户 组: 普通用户
  • 注册时间: 2012-11-27 19:53
个人简介

JustForFun

文章分类

全部博文(241)

文章存档

2023年(8)

2022年(2)

2021年(3)

2020年(30)

2019年(11)

2018年(27)

2017年(54)

2016年(83)

2015年(23)

我的朋友

分类: LINUX

2016-07-20 17:19:03

Uboot输出,无内核信息输出

## Booting kernel from Legacy Image at 32000000 ...

Image Name: Linux-2.6.13-utulinux2440

Created: 2007-11-04 7:12:20 UTC

Image Type: ARM Linux Kernel Image (gzip compressed)

Data Size: 1479835 Bytes = 1.4 MB

Load Address: 30008000

Entry Point: 30008000

Verifying Checksum ... OK

Uncompressing Kernel Image ... OK

Starting kernel ...

不能确定是linux内核没有跑起来,还是已经跑起来了而没有串口打印信息,基本上有三种情况:

1> U-boot中的参数(console)没有传到内核。
2> U-boot的时钟设置不在405MHz,与Kernel的不一致。
3> U-boot中的Machine ID设置的与Kernel不一致。

逐个检查,其中第一项参数传递要求U-boot中有如下宏即可,该情况排除。

u-boot-2009.03/include/configs/mini2440.h

#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_INITRD_TAG
#define CONFIG_CMDLINE_TAG



第二项时钟设置查看U-boot中的配置,也没有问题。
u-boot-2009.03/board/xxx/mini2440/mini2440.c

#if defined(CONFIG_S3C2440)
/* Fout = 405MHz */
#define M_MDIV 0x7f
#define M_PDIV 0x2
#define M_SDIV 0x1
#endif



再查下 Machine ID 。zwolf 提到方法,打开内核的Debug选项

make menuconfig
Kernel hacking --->
[*] Kernel debugging
[*] Kernel low-level debugging functions
[*] Kernel low-level debugging messages via S3C UART


编译运行得到如下提示:

Starting kernel ... Uncompressing Linux................................................................................................................................... done, booting the kernel. Error: unrecognized/unsupported machine ID (r1 = 0x0000016a). Available machine support: ID (hex) NAME 000007cf FriendlyARM Mini2440 development board Please check your kernel config and/or bootloader.


用bdinfo命令查看u-boot端的ID :
bdinfo
[u-boot@MINI2440]# bdinfo
arch_number = 0x0000016A
env_t       = 0x00000000
boot_params = 0x30000100
DRAM bank   = 0x00000000
-> start     = 0x30000000
-> size     = 0x04000000
ethaddr     = 08:08:11:18:12:27
ip_addr     = 192.168.10.172
baudrate     = 115200 bps

基本上可以确定从U-boot得到的ID为 362 (0x0000016a), 而内核中的ID为 1999 (000007cf)。分别查找。

内核中的 Machine ID 为:
linux-2.6.29/include/asm-arm/mach-types.h
#define MACH_TYPE_MINI2440             1999

U-boot中对应也有该定义:
u-boot-2009.03/include/asm-arm/mach-types.h
#define MACH_TYPE_MINI2440             1999

二者是一致的,再查找一下ID为362的Machine是 MACH_TYPE_S3C2440,看来是u-boot没有传递正确的ID。grep一下MACH_TYPE_S3C2440,在如下位置找到原因:
u-boot-2009.03/board/xxx/mini2440/mini2440.c
#if defined(CONFIG_S3C2440)
/* arch number of S3C2440-Board */
     gd->bd->bi_arch_number = MACH_TYPE_S3C2440 ;
#endif
把这里的 MACH_TYPE_S3C2440 改为 MACH_TYPE_MINI2440 就OK了。

另外如果不动U-boot端,在Linux端临时试验的话,可以在Linux启动代码中手动加入该参数,使其与mach-types.h中的值统一起来,方法参考 
这个帖子,注意mov指令操作数的要求。
linux-2.6.29/arch/arm/kernel/head.S
ENTRY(stext)
/*---------add begin----------/
     mov     r0, #0
     mov     r1, #0xc1
     ldr     r2, =0x30000100
/*---------add end-----------*/
     msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode

在u-boot的include/configs/zynq_common.h文件中决定了内核、文件系统和设备树编译后的文件名。如Kernel_image决定了u-boot引导zImage还是uImage
阅读(6022) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~