Forum Discussion
Minimal MMU linux hangs on DE1 board
Hi all, when trying to build my first MMU linux on a DE1 board system hangs just after nios2-terminal with:
nios2-terminal: connected to hardware target using JTAG UART on cable nios2-terminal: "USB-Blaster [USB 6-1.1]", device 1, instance 0 nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) Linux version 2.6.34-00692-g5bc7853-dirty ([email protected]) (gcc version 4.1.2)# 62 Wed Jun 23 19:31:26 CEST 2010 bootconsole [early0] enabled and that's all. The system is a bare minimum one comprising only:- linux_cpu (JTAG_debug at 0x07ff_f800)
- linux_timer_1ms (0x0840_0000, IRQ 11)
- fast_tlb_miss_ram_1k (0x07ff_f400, both slaves)
- cfi_flash (thru tsb_cpu_cfi, 0x0000_0000, 4MB)
- sdram (0x1000_0000, 8MB)
- jtag_uart (0x0840_0020, IRQ 1)
23 Replies
- Altera_Forum
Honored Contributor
Don't know if it is insufficient memory. It hangs but what error reports do you get?
1.- I store in flash both OS Image and filesystem 2.- See whole thread 3.- modified DE2 4.- The wiki (carefully) - Altera_Forum
Honored Contributor
Hello, i am having similar problem.
I've done everything Hippio said (Edit the RC file and the blackfin option), however my linux hangs after:
(Before i saw this thread it was hangin on the first paragraph) I am using a DE2 , my design has a NIOS(f), onchipmemory, 8 MB SDRAM, JTAG UART, EPCS and a flash. Really simple. Any suggestions?Linux version 2.6.34-00692-g5bc7853-dirty ([email protected]) (gcc version 4.1.2)# 37 Mon Nov 1 15:54:39 BRST 2010 bootconsole enabled early_console initialized at 0xe1801440 Linux/Nios II-MMU init_bootmem_node(?,0xce6, 0x800, 0x1000) free_bootmem(0xce6000, 0x31a000) reserve_bootmem(0xce6000, 0x100) - Altera_Forum
Honored Contributor
I can download rootfs.jffs2 to flash but don't know how to tell it kernel to use it. Pls help
- Altera_Forum
Honored Contributor
Hi ,
We are also using the same method to bring up DE1 board with bare minimum MMU support on the uClinux. And tried compiling uclinux by taking a refrence board 3c120 and it gets compiled properly with our own mmu project. When i load the image on the board it gets hangs giving below error Uncompressing Linux... ERROR bad gzip magic numbers Please provide a solution to move further Thanks and regards Tejeshwar - Altera_Forum
Honored Contributor
Now i am done with uncompressing. But before booting the kernel after uncompressing system hangs while flushing the data cache. Below is the assembly code being used to flush dcache.
movia r1, NIOS2_DCACHE_SIZE movui r2, NIOS2_DCACHE_LINE_SIZE 1: flushd 0(r1) sub r1, r1, r2 call debug_print bgt r1, r0, 1b NIOS2_DCACHE_SIZE = 2k NIOS2_DCACHE_LINE_SIZE = 32 I am not able to figure out . Please help. Thanks Tejeshwar - Altera_Forum
Honored Contributor
Not sure you want a print call in that loop!
I'd expect r2 to have the value 32 (line size) r0 initialised to some cache address. r1 initialised to r2 + cache size. - Altera_Forum
Honored Contributor
That print debug_print i have put it for debug purpose.
This is the code which executes before starting the linux /* * linux/arch/nios2/boot/compressed/head.S * * This code can be loaded anywhere, eg FLASH ROM as reset vector, * as long as output does not overlap it. */ # include <asm/asm-offsets.h> # include <asm/asm-macros.h> .text .set noat .global _start _start: wrctl status, r0 /* disable interrupt */ /* invalidate all instruction cache */ movia r1, NIOS2_ICACHE_SIZE movui r2, NIOS2_ICACHE_LINE_SIZE 1: initi r1 sub r1, r1, r2 bgt r1, r0, 1b /* invalidate all data cache */ movia r1, NIOS2_DCACHE_SIZE movui r2, NIOS2_DCACHE_LINE_SIZE 1: initd 0(r1) sub r1, r1, r2 bgt r1, r0, 1b nextpc r1 /* Find out where we are */ chkadr: movia r2, chkadr beq r1, r2, finish_move /* We are running in correct address, done */ /* move code, r1: src, r2: dest, r3: last dest */ addi r1, r1, (_start - chkadr) /* Source */ movia r2, _start /* Destination */ movia r3, __bss_start /* End of copy */ 1: ldw r8, 0(r1) /* load a word from [r1] */ stw r8, 0(r2) /* stort a word to dest [r2] */ addi r1, r1, 4 /* inc the src addr */ addi r2, r2, 4 /* inc the dest addr */ blt r2, r3, 1b /* flush the data cache after moving */ movia r1, NIOS2_DCACHE_SIZE movui r2, NIOS2_DCACHE_LINE_SIZE 1: flushd 0(r1) sub r1, r1, r2 call debug_print bgt r1, r0, 1b movia r1, finish_move jmp r1 /* jmp to linked address */ finish_move: /* zero out the .bss segment (uninitialized common data) */ movia r2, __bss_start /* presume nothing is between */ movia r1, _end /* the .bss and _end. */ 1: stb r0, 0(r2) addi r2, r2, 1 bne r1, r2, 1b /* * set up the stack pointer, some where higher than _end. * The stack space must be greater than 32K for decompress. */ movia sp, 0x10000 add sp, sp, r2 /* save args passed from u-boot, maybe */ addi sp, sp, -16 stw r4, 0(sp) stw r5, 4(sp) stw r6, 8(sp) stw r7, 12(sp) /* decompress the kernel */ call decompress_kernel /* pass saved args to kernel */ ldw r4, 0(sp) ldw r5, 4(sp) ldw r6, 8(sp) ldw r7, 12(sp) /* flush all data cache after decompressing */ movia r1, NIOS2_DCACHE_SIZE movui r2, NIOS2_DCACHE_LINE_SIZE 1: flushd 0(r1) sub r1, r1, r2 call debug_print bgt r1, r0, 1b /* flush all instruction cache */ movia r1, NIOS2_ICACHE_SIZE movui r2, NIOS2_ICACHE_LINE_SIZE 1: flushi r1 sub r1, r1, r2 bgt r1, r0, 1b flushp /* jump to start real kernel */ movia r1, (LINUX_SDRAM_START | KERNEL_REGION_BASE_ASM) call debug_print jmp r1 data cache flush is happening in the subroutine chkadr and there its working fine , but in the subroutine finish_move the same thing flushing of data cache is going in an infinite loop. Pls help me out what could be the issue. - Altera_Forum
Honored Contributor
Unless you debug_print code saves all the registers, remove all the calls - it will break that code.
- Altera_Forum
Honored Contributor
Now uncompress is happening . but linux is not booting . What could be the issue ??
On the console i see .. Uncompressing Linux... Ok, booting the kernel. It stops here. Please help me how to debug or what can the issue Thanks and regards Tejeshwar - Altera_Forum
Honored Contributor
--- Quote Start --- Not sure you want a print call in that loop! I'd expect r2 to have the value 32 (line size) r0 initialised to some cache address. r1 initialised to r2 + cache size. --- Quote End --- Hi , I am following the steps for compiling the linux as explained in the below address, http://www.alterawiki.com/wiki/uclinuxdist But the uclinux hangs after uncompressing , on the console i get Uncompressing linux ... Ok booting kernel , and stops here. I have attached sopcinfo, ptf and sof file . Can u help me is there any problem in the design. Regards, Tejeshwar K