LinuxDev 板


LINE

我也遇到了类似的问题~ 我的板子是AT2440EVB-II使用s3c2440的soc~ bootloader是我自己写的~(第一次写bootloader...@@) 我已经可以boot到如下的画面了~ 可是在booting the kernel的时候~就卡住了 我的console显示如下: Uncompressing Linux................................. done, booting the kernel. 到此处就永远停住不动了~ 请问各位大大~这有可能是什麽原因呢? 我附上我的程式码给大家参考好了~ 问题是出在初始化DRAM controller的参数不对吗? 还是我copy memory超出范围? 还是其他CPU的参数设定不对? 我是将boot loader烧到0x0的位址~ Linux kernel烧到0x10000的位址~ kernel的大小约为1.4Mb~ boot loader会将之拷贝到0x30030000的位址执行~ 板子的规格书上写NOR flash是2Mb~SDRAM是64Mb~ 我找了很久找不出原因..非常感谢各位大大的帮忙!....@@ ======================================================================== 档名: start_vector.S # define pWTCON 0x53000000 # define INTMSK 0x4A000008 /* Interupt-Controller base addresses */ # define INTSUBMSK 0x4A00001C # define CLKDIVN 0x4C000014 /* clock divisor register */ .global _start _start: b reset ldr pc, _undefined_instruction ldr pc, _software_interrupt ldr pc, _prefetch_abort ldr pc, _data_abort ldr pc, _not_used ldr pc, _irq ldr pc, _fiq _undefined_instruction: b _undefined_instruction _software_interrupt: b _software_interrupt _prefetch_abort: b _prefetch_abort _data_abort: b _data_abort _not_used: b _not_used _irq: b _irq _fiq: b _fiq reset: /* * set the cpu to SVC32 mode */ mrs r0,cpsr bic r0,r0,#0x1f orr r0,r0,#0xd3 msr cpsr,r0 ldr r0, =pWTCON mov r1, #0x0 str r1, [r0] turn_off_interrupt: mov r1, #0xffffffff ldr r0, =INTMSK str r1, [r0] ldr r1, =0x7fff ldr r0, =INTSUBMSK str r1, [r0] setup_clock: ldr r0, =CLKDIVN mov r1, #0x7 str r1, [r0] mrc p15, 0, r0, c1, c0, 0 orr r0, r0, #(1<<31 | 1<<30) mcr p15, 0, r0, c1, c0, 0 sdram_init: ldr r0, =0x48000000 ldr r1, =(0x2 << 28 | 0x2 << 24 | 0x1 << 1) str r1,[r0] ldr r0, =0x48000004 mov r1, #0x00000700 str r1,[r0] ldr r0, =0x48000008 mov r1, #0x00000700 str r1,[r0] ldr r0, =0x4800000C mov r1, #0x00000700 str r1,[r0] ldr r0, =0x48000010 mov r1, #0x00000700 str r1,[r0] ldr r0, =0x48000014 mov r1, #0x00000700 str r1,[r0] ldr r0, =0x48000018 mov r1, #0x00000700 str r1,[r0] ldr r0, =0x4800001c ldr r1, =(0x3 <<15 | 1<<2 |1) str r1, [r0] ldr r0, =0x48000020 ldr r1, =(0x3 <<15 | 1<<2 |1) str r1,[r0] ldr r0, =0x48000024 mov r1, #(1<<23 | 3 <<18) str r1, [r0] ldr r0, =0x48000028 mov r1, #(1<<5 | 1 <<4 | 1) str r1, [r0] ldr r0, =0x4800002c mov r1, #0x30 str r1, [r0] ldr r0, =0x48000030 mov r1, #0x30 str r1, [r0] ldr sp,=0x33ff0000 ldr pc,_start_armboot _start_armboot: .word start_armboot ============================================================ 档名: main.c #define GPBCON ((volatile unsigned *)0x56000010) #define GPBDAT ((volatile unsigned *)0x56000014) #define GPBUP ((volatile unsigned *)0x56000018) #define GPHCON ((volatile unsigned *)0x56000070) #define GPHDAT ((volatile unsigned *)0x56000074) #define GPHUP ((volatile unsigned *)0x56000078) #define UPLLCON ((volatile unsigned *)0x4C000008) #define MPLLCON ((volatile unsigned *)0x4C000004) #define CLKDIVN ((volatile unsigned *)0x4C000014) #define CAMDIVN ((volatile unsigned *)0x4C000018) #define LED1_ON() (*GPBDAT &= ~(0x1)) #define LED2_ON() (*GPBDAT &= ~(0x2)) #define LED1_OFF() (*GPBDAT |= (0x1)) #define LED2_OFF() (*GPBDAT |= (0x2)) void delay(int time) { int i; for( i = 0; i < time; i ++); } void __div0() { while(1); } #define MDIV 0x6e #define PDIV 0x3 #define SDIV 0x1 #define CONFIG_SYS_CLK_FREQ 16934400 /* AT2440-II uses a 16.9344MHz oscillator.*/ void setup_clock() { *MPLLCON = (MDIV<<12)+(PDIV<<4)+(SDIV); } void setup_serial() { unsigned volatile long *ULCON,*UCON,*UFCON,*UMCON,*UBRDIV; unsigned int Fin; unsigned int MPLL; unsigned int reg; Fin=CONFIG_SYS_CLK_FREQ; MPLL=2*(Fin)*(MDIV+8)/(PDIV+2)/(2); reg = (MPLL/6) / (16* 115200) -1; UFCON=(unsigned long *)0x50000008; *(UFCON)=0x7; /*enble FIFO*/ UMCON=(unsigned long *)0x5000000C; *(UMCON)=0x0; ULCON=(unsigned long *)0x50000000; *(ULCON)=(( 0<<3)|(0)<<2|3); /* 8-n-1 */ UCON=(unsigned long *)0x50000004; *(UCON)=0x5; UBRDIV=(unsigned long *)0x50000028; *(UBRDIV)=reg; /* gpio UART0 init */ *GPHCON=0xAA; *GPHUP=0x7ff; delay(0xffff); } void putc(const char c) { unsigned volatile long *UTRSTAT; unsigned volatile char *UTXH; UTRSTAT=(unsigned long*)0x50000010; while( !(*UTRSTAT & 0x2)); UTXH=(unsigned char *)0x50000020; *UTXH=c; } int getc (void) { unsigned volatile long *UTRSTAT; unsigned volatile char *URXH; UTRSTAT=(unsigned long*)0x50000010; URXH=(unsigned char*)0x50000024; while (!(*UTRSTAT & 0x1)); return (*URXH) & 0xff; } void putstr(char *p) { while(*p!=0) { putc(*p); p++; } putc('\r'); } /* See also ARM920T Technical reference Manual */ #define C1_MMU (1<<0) /* mmu off/on */ #define C1_ALIGN (1<<1) /* alignment faults off/on */ #define C1_DC (1<<2) /* dcache off/on */ #define C1_BIG_ENDIAN (1<<7) /* big endian off/on */ #define C1_SYS_PROT (1<<8) /* system protection */ #define C1_ROM_PROT (1<<9) /* ROM protection */ #define C1_IC (1<<12) /* icache off/on */ #define C1_HIGH_VECTORS (1<<13) /* location of vectors: low/high addresses */ int cleanup_before_linux (void) { /* * this function is called just before we call linux * it prepares the processor for linux * * we turn off caches etc ... */ unsigned long i; /* turn off I/D-cache */ asm ("mrc p15, 0, %0, c1, c0, 0":"=r" (i)); i &= ~(C1_DC | C1_IC); asm ("mcr p15, 0, %0, c1, c0, 0": :"r" (i)); /* flush I/D-cache */ i = 0; asm ("mcr p15, 0, %0, c7, c7, 0": :"r" (i)); return (0); } void cp_mem() { unsigned long *dst; unsigned long *src; int (*f)(void *); dst=(unsigned long *)0x30030000; src=(unsigned long *)0x10000; while (src < (unsigned long *)0x200000) { *dst = *src; dst++; src++; } cleanup_before_linux(); putstr("image ready, any key continue\n"); getc(); f=(int *)0x30030000; f(1); } void start_armboot (void) { setup_clock(); setup_serial(); putstr("Hello\n"); putstr("Any key to continue\n"); getc(); putstr("Yes\n"); cp_mem(); } --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.160.188.71 ※ 编辑: BlueAlaska 来自: 218.160.188.71 (03/03 01:19) ※ 编辑: BlueAlaska 来自: 218.160.188.71 (03/03 01:20)
1F:→ fxxkboss:R1 是 machine ID...你没设 03/03 23:44







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:iOS站内搜寻

TOP