Forum Discussion

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

uClinux boot from epcs ?

If someone like me wants to run uCLinux on a Nios2 but the fpga must not be a bga type then the biggest fpga available is EP2C20 with QFP 240 pins. That one can be handsoldered http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif (Done that several times before)

To have a lot of memory a would like to include sdram and of course a compact flash. as i would like to get rid of the cfi as the fpga will boot from epcs i asked myself if it could be possible to have only fpga + sdram + a big epcs + cf. after an AS configuration from the epcs nios could boot from epcs.

now my question has anybody done this ? booting uCLinux from epcs. but not the whole uclinux. i think of a smal bootloader like lilo (grub under debian) that loads the rest from a compact flash card that can&#39;t be big enough :-)

Regards Michael

7 Replies

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

    Hi Michael,

    > booting uCLinux from epcs. but not the whole uclinux. i think of a smal bootloader

    > like lilo (grub under debian) that loads the rest from a compact flash card that

    > can&#39;t be big enough

    You can use u-boot in such a design ... as it supports CF as well as epcs. If your

    epcs is large enough, you could fit the entire kernel ... u-boot can load, decompress,

    and boot a gzip/bzip kernel image (same goes for CF of course).

    Currently, I load u-boot from epcs and then boot a gzipped kernel image (~520 KB)

    either from parallel flash, a tftp server, or an NFS server. Same goes for the cramfs

    filesystem (which gets stuffed into SDRAM as well).

    Regards,

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

    --- Quote Start ---

    originally posted by smcnutt@Feb 22 2006, 04:43 PM

    hi michael,

    > booting uclinux from epcs. but not the whole uclinux. i think of a smal bootloader

    > like lilo (grub under debian) that loads the rest from a compact flash card that

    > can&#39;t be big enough

    you can use u-boot in such a design ... as it supports cf as well as epcs. if your

    epcs is large enough, you could fit the entire kernel ... u-boot can load, decompress,

    and boot a gzip/bzip kernel image (same goes for cf of course).

    currently, i load u-boot from epcs and then boot a gzipped kernel image (~520 kb)

    either from parallel flash, a tftp server, or an nfs server. same goes for the cramfs

    filesystem (which gets stuffed into sdram as well).

    regards,

    --scott

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

    --- quote end ---

    --- Quote End ---

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

    Related to this, what are the advantages of using U-boot? I mean, Altera seems to have included a nice little boot copier that copies code from either CFI or EPCS to RAM and then boots, along with their flash programming utility. So to boot a kernel from EPCS, it should be as simple as downloading it to the config device and pointing to the altera boot copier.

    Are there any advantages of U boot?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by jdhar@Feb 28 2006, 01:46 AM

    related to this, what are the advantages of using u-boot? i mean, altera seems to have included a nice little boot copier that copies code from either cfi or epcs to ram and then boots, along with their flash programming utility. so to boot a kernel from epcs, it should be as simple as downloading it to the config device and pointing to the altera boot copier.

    are there any advantages of u boot?

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

    --- quote end ---

    --- Quote End ---

    I boot from EPCS with the Altera boot copier and it works perfectly (Only with Quartus 5.1 and NiosII 5.1, the 5.0 versions had a bug which made it VERY slow). But if you want more control, load the kernel over the network, change parameters, choose a different kernel each time you boot etc. you need u-boot.

    I personally don&#39;t need it since I just use one kernel which I stored in EPCS. But the Altera bootcopier gives you zero flexibility.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I gotcha, makes sense. Do you know why Alteras flash programmer doesn&#39;t verify the contents of the EPCS when it programs? It just says "Did not attempt to verify device contents, leaving target processor paused"... when programming the EPCS.

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

    Hi jdhar,

    The Altera boot copier is a bare-bones crt0 implementation. It does exactly what you

    need it to do ... in only a handful of instructions ... nothing more. u-boot however, is

    a full-featured boot-loader, not just a "a nice little boot copier". In addition

    to the features wgoossens mentioned, u-boot also supports the following:

    - Command line interface via JTAG/UART.

    - Full epcs support read/write/program/protect.

    - Serial port download using kermit.

    - File download via Ethernet using TFTP and/or NFS.

    - Scripting (scripts can be run automatically at startup).

    - Flash programming (e.g. download your file via NFS, then program into your flash).

    - BOOTP/DHCP client support.

    - Memory read, write, fill, compare and tesing (several test flavors available).

    - RARP

    - Support for JFFS2, CRAMFS, DOS, etc. (including multiple partitions).

    - Support for SPI, MMC, CompactFlash, etc.

    The list goes on ... but you get the picture ... if all you need is crt0 -- use the Altera

    boot-copier. If you want (or need) to do more than that you can use u-boot ... or

    redboot ... or something similar.

    In any case, I highly recommend you give u-boot (and/or redboot) a test drive.

    There are many features you may find very handy ... and there&#39;s lots of code you

    can hoist into your own loaders as well.

    Regards,

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

    --- Quote Start ---

    originally posted by smcnutt@Feb 28 2006, 09:33 AM

    hi jdhar,

    the altera boot copier is a bare-bones crt0 implementation. it does exactly what you

    need it to do ... in only a handful of instructions ... nothing more. u-boot however, is

    a full-featured boot-loader[/b], not just a "a nice little boot copier". In addition

    to the features wgoossens mentioned, u-boot also supports the following:

    - Command line interface via JTAG/UART.

    - Full epcs support read/write/program/protect.

    - Serial port download using kermit.

    - File download via Ethernet using TFTP and/or NFS.

    - Scripting (scripts can be run automatically at startup).

    - Flash programming (e.g. download your file via NFS, then program into your flash).

    - BOOTP/DHCP client support.

    - Memory read, write, fill, compare and tesing (several test flavors available).

    - RARP

    - Support for JFFS2, CRAMFS, DOS, etc. (including multiple partitions).

    - Support for SPI, MMC, CompactFlash, etc.

    The list goes on ... but you get the picture ... if all you need is crt0 -- use the Altera

    boot-copier. If you want (or need) to do more than that you can use u-boot ... or

    redboot ... or something similar.

    In any case, I highly recommend you give u-boot (and/or redboot) a test drive.

    There are many features you may find very handy ... and there&#39;s lots of code you

    can hoist into your own loaders as well.

    Regards,

    --Scott

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

    --- Quote End ---

    [/b]

    --- Quote End ---

    Excellent info smcnutt; I believe the reason I didn&#39;t give Uboot a try before is because I saw a lot of board-specific stuff (meant for the Altera Eval boards), while I mostly work in custom hardware. I will admit that I didn&#39;t look in that much detail, so I could have missed it, but I will search around and give it a try. There&#39;s no such thing as too many options in my book http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif