ts-7000
[Top] [All Lists]

[ts-7000] Re: help in loading linux kernel from sdcard.

To:
Subject: [ts-7000] Re: help in loading linux kernel from sdcard.
From: "pritam" <>
Date: Wed, 17 Nov 2010 10:37:07 -0000
Hi Breton,

Thanks for your reply and posting the source code. How do you program linux 
zimage and file system on your board. 

I am trying to implement fat16 file system along with spi_bootloader. So that 
the processors boots from spi eeprom=> this will load sdcard initialization 
source code and fat16 file system. Then it will look for linux kernel and load 
it. 

The reason for doing this ways so that we can update the code on site and it 
also reduces the programming time. 

I had a fat16 file system source code for arm7 processor, i am trying to port 
that to EP93070 but ran into problems while compiling. 

 make
make -C main
make[1]: Entering directory 
`/home/pritam/spi_boot_example/SDcard_bootloader_fat16/main'
arm-linux-gcc -MM -O2 -Wall -fPIC -mcpu=arm9tdmi -I../include -nostdlib head.S 
main.c print.c spi.c sd_raw.c delay.c rootdir.c partition.c fat16.c    1>.depend
arm-linux-gcc -O2 -Wall -fPIC -mcpu=arm9tdmi -I../include -nostdlib -r -o 
mainrom.o head.o main.o print.o spi.o sd_raw.o delay.o rootdir.o partition.o 
fat16.o   
make[1]: Leaving directory 
`/home/pritam/spi_boot_example/SDcard_bootloader_fat16/main'
arm-linux-ld -nostdlib -T SDcard_bootloader_fat16.lnk -Map 
SDcard_bootloader_fat16.map -L/usr/local/arm/3.4/lib -lc  -o 
SDcard_bootloader_fat16.elf main/mainrom.o
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
/usr/local/arm/3.4/lib/libc.so: undefined reference to `main'
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5013
arm-linux-ld: BFD 2.16.1 assertion fail 
/opt/buildroot/toolchain_build_arm_nofpu/binutils-2.16.1/bfd/elf32-arm.c:5203
make: *** [SDcard_bootloader] Segmentation fault

Could you please shade some light on it. 



--- In  "Breton M. Saunders" <> 
wrote:
>
> 
> 
> I wrote my own boot strap loader for the TS7400.  It fit within the 2kb 
> spi flash on the board, and would directly load linux without requiring 
> an additional loader stage (like TS's nand loader).
> 
> I was going to try and get an SD card loader inside the same space; but 
> I don't think its possible to fit all the codes in - NAND is far easier 
> to work with.
> 
> ATAGs is pretty simple.  Its just a linked list of parameters that tell 
> the kernel things about the system - like where pages of memory are 
> located, and what kernel command line options should be used.
> 
> The code that I used to start the kernel is pretty trivial, I'll cut and 
> paste it here for you.
> 
> To use this code, you must copy the kernel into physical memory at 
> address 0x04000000.  Load your ramdisk at 0x01000000.  Set your machine 
> id appropriately, I used 0x163 for this board.  Because you're using an 
> ep93xx, you will be limited to 8 megabytes for both the kernel image and 
> 8 megabytes for the ramdisk.
> 
> Once you've done this, call linux_start, and good luck.
> 
> I don't think Linux pays any attention to the ATAGS address - this is 
> likely a loader bug.  From memory it has to be 0x1000.  No other 
> address  will work.  My loader initially attempted to use 0x05000000; 
> but things didn't work at that address.
> 
> 
> Good luck,
> 
>      -Brett
> 
> // linux ATAG definitions from include/asm-arm/setup.h
> #define ATAG_NONE       0x00000000
> #define ATAG_CORE       0x54410001
> #define ATAG_MEM        0x54410002
> #define ATAG_VIDEOTEXT  0x54410003
> #define ATAG_RAMDISK    0x54410004
> #define ATAG_INITRD2    0x54420005
> #define ATAG_SERIAL     0x54410006
> #define ATAG_REVISION   0x54410007
> #define ATAG_VIDEOLFB   0x54410008
> #define ATAG_CMDLINE    0x54410009
> #define ATAG_ACORN      0x41000101
> #define ATAG_MEMCLK     0x41000402
> 
> 
> linux_start:
>          @ copy atags to 0x0000 1000     @ a location where they won't 
> be trashed
>          mov     r1, #0x01
>          lsl     r1, #8                  @ target address to r1
>          adr     r2, atags
>          adr     r3, atags_fin           @ fetch addresses
> 1:      ldr     r0, [r2]                @ fetch address from r2
>          str     r0, [r1]                @ write word
>          add     r1, #4
>          add     r2, #4
>          cmp     r2, r3
>          bne     1b
> 
>          mov     r2, #0x01
>          lsl     r2, #8                  @ 0x0500 0000 to r2 (atags pointer)
> 
>          mov     r1, #0x16
>          lsl     r1, #4
>          add     r1, #0x3                @ 355 machine id (163 hex)
> 
>          mov     r0, #0                  @ clear r0
> 
>          mov     r3, #04                 @ target address in r3
>          lsl     r3, #24                 @ 0x0400 0000
>          bx      r3                      @ branch to address 0 - start linux
> 
> 
> 
> 
>          .align 4
> atags:          .word   5
>                  .word   ATAG_CORE
>                  .word   0               @flags
>                  .word   4096            @pagesize
>                  .word   0               @rootdev - unknown...
> 
>                  .word   4               @ size of memory tag
>                  .word   ATAG_MEM
>                  .word   0x00800000      @ size
>                  .word   0x00000000      @ start
> 
>                  .word   4               @ size of memory tag
>                  .word   ATAG_MEM
>                  .word   0x00800000      @ size
>                  .word   0x01000000      @ start
> 
>                  .word   4               @ size of memory tag
>                  .word   ATAG_MEM
>                  .word   0x00800000      @ size
>                  .word   0x04000000      @ start
> 
>                  .word   4               @ size of memory tag
>                  .word   ATAG_MEM
>                  .word   0x00800000      @ size
>                  .word   0x05000000      @ start
> 
>                  .word   4
>                  .word   ATAG_INITRD2    @ second rev, physical mapped 
> initrd
>                  .word   0x01000000      @ start in second physical page
> initrd_size:    .word   0x00000000      @ filled in by loader!
> 
> cmdln_start:    .word   (cmdln_fin-cmdln_start)/4
>                  .word   ATAG_CMDLINE
>                  .asciz  "console=ttyAM0,230400 root=/dev/ram"
>                  .align  4
> cmdln_fin:      .word   0               @ buggy terminator criterion in 
> setup.h
>                  .word   ATAG_NONE
> 
> 
>                  .word   0x00000000
> atags_fin:      .word   0x00000000
> 
> 
> On 11/10/2010 10:17 AM, pritam wrote:
> > Hi Guys,
> >
> > I have a EP9307 (Arm 920T) based board. The design is based on Cirrus logic
> > EP9307 development board.  At present the boot sequence is first stage
> > bootloader (com port) =>  redboot (com port) =>  Zimage (ethernet) =>  
> > Ramdisk
> > (ethernet).
> >
> > I want to load Zimage directly from SDcard without using redboot. I have
> > modified first stage bootloader to boot from spi eeprom. This in turn loads
> > a second stage bootloader which initializes Sdcard. At present I have not
> > implemented a file system in second stage bootloader.  I will have to stick
> > to FAT file system as the users would be copying binaries from windows
> > machine so that they can upgrade the firmware.
> >
> > I have been reading about arm kernel boot process on following links.
> >
> > http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html
> >
> > http://www.webworldarticles.com/e/a/title/Loading-the-kernel-into-memory-and-starting-a-Linux-system/
> >
> >
> > One of the kernel boot requirments is boot parameters Atag List. At 
> > presentredboot sets these parameters. Is there any way to see what these 
> > parameters are. How to create this list and how to load the kernel from 
> > sdcard.
> >
> > Can some please share more info on how booting from sdcard is implemented 
> > in TS-7xxx series boards.
> >
> > Has any one done anything similar. Can some one please share there 
> > inputs/provide some pointers on this.
> >
> > Thanks
> > Tama
> >
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU