Community
cancel
Showing results for 
Search instead for 
Did you mean: 

Guide to 3C120 with u-boot

Guide to 3C120 with u-boot



Please setup DasUBoot first. 

in u-boot dir, put 3C120.h in include/configs/, put 3c120_fpga.h in board/altera/nios2-generic/. Then add an entry 3C120 to the NIOS2_GENERIC list in Makefile.

make 3C120_config

make

You will get u-boot elf and u-boot.bin.

 

In uClinux-dist, make menuconfig, enable MTD command line partition table parsing,fs jffs2 support,

Add, "MKFS_JFFS2_FLAGS = -l -p -e 128" to your vendor/product Makefile.

Make and the images/rootfs.jffs2 will be built. Copy the rootfs.jffs2 to your tftpboot dir.

 

 

1. configure the sof 

nios2-configure-sof nios2_linux_3c120_125mhz_top.sof


2. download u-boot elf

nios2-download -g u-boot

nios2-terminal

 

3. set env

==> setenv ethaddr 08:00:3e:26:0a:5b # set MAC of nios2 board

==> setenv ipaddr 192.168.4.2 # set ip of nios2 board

==> setenv serverip 192.168.4.254 # set to your tftp server

==> saveenv


 

4. program sof to flash

quartus_cpf -c

nios2_linux_3c120_125mhz_top.sof 3c120.rbf

==> protect off all

==> tftp d1000000 3c120.rbf

==> erase e3500000 +380000

==> cp.b d1000000 e3500000

$filesize

 

5. program zImage to flash. boot

linux without u-boot.

You may convert an elf

executable to binary for flashing with this command, 

nios2-elf-objcopy -O binary

zImage zImage.bin

==> tftp d1000000 zImage.bin

==> erase e2800000 +400000

==> cp.b d1000000 e2800000 $filesize

Copy to Flash... done


6.

close nios2-terminal, disconnect jtag cable, power off and power on, Then the D0 LED will blink slowly, this is the heart-beat of nios2-linux. Reconnect the jtag cable, and start nios2-terminal. You can access the shell of

nios2-linux.


 7. program u-boot to flash, this will overwrite the image we wrote in step 5.

==> tftp d1000000 u-boot

==> erase e2800000 +40000

==> cp.b d1000000 e2800000 $filesize

Reboot, then you can access the u-boot prompt.

 

8. program kernel image to

flash.

==> tftp d1000000 vmImage

==> erase e2900000 +200000

==> cp.b d1000000 e2900000 $filesize

 

9. program jffs2 to flash

==>tftp d1000000 rootfs.jffs2 rootfs_(2).jffs2

==> erase e0000000 +2800000

==> cp.b d1000000 e0000000 $filesize

 

10. Set the env as,

==> setenv bootcmd 'set bootargs root=/dev/mtdblock0 rootfstype=jffs2 ip=dhcp;bootm e2900000'

==> saveenv

Boot linux with jffs2 

==> run bootcmd


Additional Download


Attachments
Version history
Revision #:
1 of 1
Last update:
‎06-27-2019 03:48 PM
Updated by:
 
Contributors