Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

booting uclinux from u-boot

hi all

I am trying to boot uclinux from u-boot on 2s60 board.

I have one doubt regarding Exception vector table entry point address.

What I have observed in uclinux (head.S) that exception vector table entry point jump instruction sits at Base Addr of RAM + 0x20 offset, same information I have given in Hardware configuration file in sopc builder (.sof).

And same location is used for u-boot's Execption vector table (specified in the u-boot config file).

My SDRAM start address is 0x0100_0000.

So exception vector table sits at 0x0100_0020 in both the cases of u-boot and uclinux.

The kernel image has entry_address at 0x0100_0000.

Now if I download kernel image through u-boot, then Exception table gets overwritten by kernel image and u-boot hangs.

Please share your experience with how you deal with this issue. I mean when you boot kernel from u-boot then which address is given for exception vector table. Or it's ok to use same addr there is some other issue ?

thanks

Ankur

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by ankur@May 29 2006, 04:24 AM

    hi all

    i am trying to boot uclinux from u-boot on 2s60 board.

    i have one doubt regarding exception vector table entry point address.

    what i have observed in uclinux (head.s) that exception vector table entry point jump instruction sits at base addr of ram + 0x20 offset, same information i have given in hardware configuration file in sopc builder (.sof).

    and same location is used for u-boot's execption vector table (specified in the u-boot config file).

    my sdram start address is 0x0100_0000.

    so exception vector table sits at 0x0100_0020 in both the cases of u-boot and uclinux.

    the kernel image has entry_address at 0x0100_0000.

    now if i download kernel image through u-boot, then exception table gets overwritten by kernel image and u-boot hangs.

    please share your experience with how you deal with this issue. i mean when you boot kernel from u-boot then which address is given for exception vector table. or it's ok to use same addr there is some other issue ?

    thanks

    ankur

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=15652)

    --- quote end ---

    --- Quote End ---

    hi all,

    I can download my kernel image file in the sdram. There were some misunderstanding with CFG_NIOS_CPU_VEC_BASE and CFG_EXCEPTION_ADDR.

    Now both I made equal to 0x0100_0020.

    But still I can&#39;t boot my kernel.

    I am downloading uncompressed kernel through tftpboot at 0x0100_0000.

    Then I give bootm 0x0100_0000

    Is it fine or should I change the location ??

    thanks

    Ankur
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by ankur+may 29 2006, 08:18 am--><div class='quotetop'>quote (ankur @ may 29 2006, 08:18 am)</div>

    --- quote start ---

    <!--quotebegin-ankur@May 29 2006, 04:24 AM

    hi all

    i am trying to boot uclinux from u-boot on 2s60 board.

    i have one doubt regarding exception vector table entry point address.

    what i have observed in uclinux (head.s) that exception vector table entry point jump instruction sits at base addr of ram + 0x20 offset, same information i have given in hardware configuration file in sopc builder (.sof).

    and same location is used for u-boot&#39;s execption vector table (specified in the u-boot config file).

    my sdram start address is 0x0100_0000.

    so exception vector table sits at 0x0100_0020 in both the cases of u-boot and uclinux.

    the kernel image has entry_address at 0x0100_0000.

    now if i download kernel image through u-boot, then exception table gets overwritten by kernel image and u-boot hangs.

    please share your experience with how you deal with this issue. i mean when you boot kernel from u-boot then which address is given for exception vector table. or it&#39;s ok to use same addr there is some other issue ?

    thanks

    ankur

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=15652)

    --- quote end ---

    --- Quote End ---

    hi all,

    I can download my kernel image file in the sdram. There were some misunderstanding with CFG_NIOS_CPU_VEC_BASE and CFG_EXCEPTION_ADDR.

    Now both I made equal to 0x0100_0020.

    But still I can&#39;t boot my kernel.

    I am downloading uncompressed kernel through tftpboot at 0x0100_0000.

    Then I give bootm 0x0100_0000

    Is it fine or should I change the location ??

    thanks

    Ankur

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=15664)</div>

    [/b]

    --- Quote End ---

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Ankur,

    > There were some misunderstanding with CFG_NIOS_CPU_VEC_BASE and

    > CFG_EXCEPTION_ADDR.

    > Now both I made equal to 0x0100_0020.

    First, don&#39;t use CFG_NIOS_CPU_VEC_BASE ... this is an old (and totally brain-damaged) obfuscation

    that was foolishly added to some Nios-32 u-boot board configurations -- it is not used in the

    Nios II sources. And please don&#39;t ask for any details about CFG_NIOS_CPU_VEC_BASE

    -- I&#39;ll just end up embarrassing myself with an endless rant ;-)

    Second, please use the code from: http://www.psyent.com/download (http://www.psyent.com/download) -- it contains all of the patches

    that have been submitted to the u-boot project (and are still pending). If you&#39;re using code directly

    from the u-boot project you will likely have problems without the patches.

    > am downloading uncompressed kernel through tftpboot at 0x0100_0000.

    > Then I give bootm 0x0100_0000

    > Is it fine or should I change the location ??

    Change this -- you are overwriting your exception trampoline during download. The first

    interrupt will put the CPU in the weeds. Load the image somewhere higher in memory.

    The &#39;bootm&#39; command will copy (and optionally decompress) the image to the load

    address you specified with mkimage, after disabling interrupts. Try downloading to

    0140_0000 for example (but leave the load address and entry point at 0100_0000). Then,

    ==> bootm 1400000

    Regards,

    --Scott
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by smcnutt@May 30 2006, 07:39 PM

    hi ankur,

    > there were some misunderstanding with cfg_nios_cpu_vec_base and

    > cfg_exception_addr.

    > now both i made equal to 0x0100_0020.

    first, don&#39;t use cfg_nios_cpu_vec_base ... this is an old (and totally brain-damaged) obfuscation

    that was foolishly added to some nios-32 u-boot board configurations -- it is not used in the

    nios ii sources. and please don&#39;t ask for any details about cfg_nios_cpu_vec_base

    -- i&#39;ll just end up embarrassing myself with an endless rant ;-)

    second, please use the code from: http://www.psyent.com/download (http://www.psyent.com/download) -- it contains all of the patches

    that have been submitted to the u-boot project (and are still pending). if you&#39;re using code directly

    from the u-boot project you will likely have problems without the patches.

    > am downloading uncompressed kernel through tftpboot at 0x0100_0000.

    > then i give bootm 0x0100_0000

    > is it fine or should i change the location ??

    change this -- you are overwriting your exception trampoline during download. the first

    interrupt will put the cpu in the weeds. load the image somewhere higher in memory.

    the &#39;bootm&#39; command will copy (and optionally decompress) the image to the load

    address you specified with mkimage, after disabling interrupts.[/b] Try downloading to

    0140_0000 for example (but leave the load address and entry point at 0100_0000). Then,

    ==> bootm 1400000

    Regards,

    --Scott

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=15700)

    --- Quote End ---

    [/b]

    --- Quote End ---

    hi Scott,

    thanks, for the reply. Actually I was using u-boot -1.1.2 taken from source forge. (I know its old now). But after following your instructions uclinux is booting now.

    thanks once again

    Ankur