Boot在华恒S3C2410EDU板子上的移植(4)


DAILY2410 # cp.b 30008000 0 20000
Copy to Flash...        *******************************************************
       #
done


 
7.出现新的问题,用这个uboot虽然能下载内核,说明网卡驱动正常,但是无法go,也不能正常bootm。
如果用go命令出现:
## Starting application at 0x30008000 ...
Uncompressing Linux.............................................................                                                                               
Error: unrecognized/unsupported machine ID (r1 = 0x33f4fc88).
                                                                              
Available machine support:
                                                                              
ID (hex)        NAME
000000c1        SMDK2410
                                                                              
Please check your kernel config and/or bootloader.
或者大多数时候就停在
## Starting application at 0x30008000 ...
Uncompressing Linux.............................................................     不动了。。
这是uboot传递给内核的参数发生错误。
解决方法是参照ppcboot源码中的go指令的运行方式修改。
只要修改两个文件即可:lib_arm/armlinux.c和common/cmd_boot.c。                                                                           在armlinux.c中加入
static inline void cpu_arm920_cache_clean_invalidate_all(void)
{
__asm__(
"movr1, #0/n"
"movr1, #7 << 5/n"  /* 8 segments */
"1:orrr3, r1, #63 << 26/n"  /* 64 entries */
"2:mcrp15, 0, r3, c7, c14, 2/n" /* clean & invalidate D index */
"subsr3, r3, #1 << 26/n"
"bcs2b/n"  /* entries 64 to 0 */
"subsr1, r1, #1 << 5/n"
"bcs1b/n"  /* segments 7 to 0 */
"mcrp15, 0, r1, c7, c5, 0/n"  /* invalidate I cache */
"mcrp15, 0, r1, c7, c10, 4/n" /* drain WB */
);
}

static inline void cpu_arm920_tlb_invalidate_all(void)
{
__asm__(
"movr0, #0/n"
"mcrp15, 0, r0, c7, c10, 4/n"/* drain WB */
"mcrp15, 0, r0, c8, c7, 0/n"/* invalidate I & D TLBs */
);
}

void  call_linux(long a0, long a1, long a2)
{
__asm__(
"movr0, %0/n"
"movr1, %1/n"
"movr2, %2/n"
"movip, #0/n"
"mcrp15, 0, ip, c13, c0, 0/n"/* zero PID */
"mcrp15, 0, ip, c7, c7, 0/n"/* invalidate I,D caches */
"mcrp15, 0, ip, c7, c10, 4/n"/* drain write buffer */
"mcrp15, 0, ip, c8, c7, 0/n"/* invalidate I,D TLBs */
"mrcp15, 0, ip, c1, c0, 0/n"/* get control register */
"bicip, ip, #0x0001/n"/* disable MMU */
"mcrp15, 0, ip, c1, c0, 0/n"/* write control register */
"movpc, r2/n"
"nop/n"
"nop/n"
: /* no outpus */
: "r" (a0), "r" (a1), "r" (a2)
);
#define RAMDISK 1
/*static*/ void setup_linux_param(ulong param_base)
{
struct param_struct *params = (struct param_struct *)param_base;
#ifdef RAMDISK
char linux_cmd[] = "initrd=0x30800000,0x440000 mem=64M  root=/dev/ram init=/linuxrc console=ttyS0";
#endif
#ifdef CRAMFS
char linux_cmd[] = "root=/dev/mtdblock/2 rw mem=32M";
#endif
printf("Setup linux parameters at 0x%08lx/n", param_base);
memset(params, 0, sizeof(struct param_struct));

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwgyfy.html