Difference between revisions of "Target Software Installation"
m |
(beautifying) |
||
Line 30: | Line 30: | ||
U-Boot can be customized in a flexible way with the use of "environment variables/scripts". | U-Boot can be customized in a flexible way with the use of "environment variables/scripts". | ||
The command '''printenv''' shows you most of them and their current value: | The command '''printenv''' shows you most of them and their current value: | ||
+ | <pre class="apf"> | ||
BIOS> printenv | BIOS> printenv | ||
bootcmd=run jffsboot | bootcmd=run jffsboot | ||
Line 37: | Line 38: | ||
autoload=no | autoload=no | ||
... | ... | ||
− | + | </pre> | |
Use the command '''setenv''' to change these variables. For example, to set the IP address: | Use the command '''setenv''' to change these variables. For example, to set the IP address: | ||
+ | <pre class="apf"> | ||
BIOS> setenv ipaddr 192.168.0.10 | BIOS> setenv ipaddr 192.168.0.10 | ||
− | + | </pre> | |
Use the command '''saveenv''' to save the state of your environment variables in FLASH memory: | Use the command '''saveenv''' to save the state of your environment variables in FLASH memory: | ||
+ | <pre class="apf"> | ||
BIOS> saveenv | BIOS> saveenv | ||
Saving Environment to Flash... | Saving Environment to Flash... | ||
Line 52: | Line 55: | ||
. done | . done | ||
Protected 1 sectors | Protected 1 sectors | ||
− | + | </pre> | |
===Network configuration=== | ===Network configuration=== | ||
In order to use the U-Boot's network features, you have to set the network environment variables: | In order to use the U-Boot's network features, you have to set the network environment variables: | ||
+ | <pre class="apf"> | ||
BIOS> setenv netmask 255.255.255.0 (this default value should be fine in most situations) | BIOS> setenv netmask 255.255.255.0 (this default value should be fine in most situations) | ||
BIOS> setenv ipaddr 192.168.0.10 | BIOS> setenv ipaddr 192.168.0.10 | ||
BIOS> setenv serverip 192.168.0.2 (the IP address of your tftp server/PC hosting the files to download) | BIOS> setenv serverip 192.168.0.2 (the IP address of your tftp server/PC hosting the files to download) | ||
BIOS> setenv rootpath "/tftpboot/apf9328-root" (to boot Linux over NFS) | BIOS> setenv rootpath "/tftpboot/apf9328-root" (to boot Linux over NFS) | ||
− | + | </pre> | |
You can use the '''dhcp''' command to configure these variables from your DHCP server. You probably will have to adjust the '''serverip''' variable manually. | You can use the '''dhcp''' command to configure these variables from your DHCP server. You probably will have to adjust the '''serverip''' variable manually. | ||
− | + | <pre class="apf"> | |
BIOS> dhcp | BIOS> dhcp | ||
dm9000 i/o: 0x15c00000, id: 0x90000a46 | dm9000 i/o: 0x15c00000, id: 0x90000a46 | ||
Line 70: | Line 74: | ||
BIOS> setenv serverip 192.168.0.2 | BIOS> setenv serverip 192.168.0.2 | ||
BIOS> saveenv | BIOS> saveenv | ||
− | + | </pre> | |
Do not forget to save your changes in FLASH, to have them available at next power up: | Do not forget to save your changes in FLASH, to have them available at next power up: | ||
+ | <pre class="apf"> | ||
BIOS> saveenv | BIOS> saveenv | ||
+ | </pre> | ||
In case of troubles you can use the following U-Boot script to reset the variables to the "factory"/default settings: | In case of troubles you can use the following U-Boot script to reset the variables to the "factory"/default settings: | ||
+ | <pre class="apf"> | ||
BIOS> run flash_reset_env | BIOS> run flash_reset_env | ||
+ | </pre> | ||
===Linux kernel building and installation=== | ===Linux kernel building and installation=== | ||
Line 91: | Line 99: | ||
* Load kernel image with U-Boot through network: | * Load kernel image with U-Boot through network: | ||
+ | <pre class="apf"> | ||
BIOS> tftpboot 08000000 apf9328-linux.bin | BIOS> tftpboot 08000000 apf9328-linux.bin | ||
+ | </pre> | ||
or with the serial line: | or with the serial line: | ||
+ | <pre class="apf"> | ||
BIOS> loadb 08000000 | BIOS> loadb 08000000 | ||
''Ctrl+Altgr+\+c to access kermit command line then:'' | ''Ctrl+Altgr+\+c to access kermit command line then:'' | ||
Line 106: | Line 117: | ||
## Start Addr = 0x08000000 | ## Start Addr = 0x08000000 | ||
BIOS> | BIOS> | ||
+ | </pre> | ||
---- | ---- | ||
− | + | {{Warning|If the loaded kernel image is too large, the following operation can destroy data that are stored after the partition limits (e.g. RootFS)}} | |
− | + | ||
− | + | ||
Check that transfered size value is less than 2097152 (0x200000 hex) with armadeus 3 | Check that transfered size value is less than 2097152 (0x200000 hex) with armadeus 3 | ||
− | Bytes transferred = 1313216 (1409c0 hex) | + | <pre class="apf"> |
+ | Bytes transferred = 1313216 (1409c0 hex) | ||
+ | </pre> | ||
---- | ---- | ||
* You can test your new kernel image without flashing it with: | * You can test your new kernel image without flashing it with: | ||
+ | <pre class="apf"> | ||
BIOS> bootm 08000000 | BIOS> bootm 08000000 | ||
− | + | </pre> | |
---- | ---- | ||
* Flash kernel image with: | * Flash kernel image with: | ||
+ | <pre class="apf"> | ||
BIOS> run flash_kernel | BIOS> run flash_kernel | ||
− | + | </pre> | |
* To make it easier, you can use automatic scripts. So next time you will only launch: | * To make it easier, you can use automatic scripts. So next time you will only launch: | ||
+ | <pre class="apf"> | ||
BIOS> run update_kernel | BIOS> run update_kernel | ||
− | + | </pre> | |
* If you only want to try a new kernel without flashing the kernel image you can launch it directly from RAM: | * If you only want to try a new kernel without flashing the kernel image you can launch it directly from RAM: | ||
+ | <pre class="apf"> | ||
BIOS> setenv bootargs ${console} ${mtdparts}; run addjffsargs addipargs; bootm | BIOS> setenv bootargs ${console} ${mtdparts}; run addjffsargs addipargs; bootm | ||
(the kernel image you want to try must have been loaded at 0x08000000) | (the kernel image you want to try must have been loaded at 0x08000000) | ||
− | + | </pre> | |
===Linux RootFS installation=== | ===Linux RootFS installation=== | ||
Line 140: | Line 156: | ||
* Load RootFS image with U-Boot through network: | * Load RootFS image with U-Boot through network: | ||
+ | <pre class="apf"> | ||
BIOS> tftpboot 08000000 apf9328-rootfs.arm.jffs2 | BIOS> tftpboot 08000000 apf9328-rootfs.arm.jffs2 | ||
+ | </pre> | ||
or serial line: | or serial line: | ||
+ | <pre class="apf"> | ||
BIOS> loadb 08000000 | BIOS> loadb 08000000 | ||
Ctrl+Altgr+\+c to access kermit command line then... | Ctrl+Altgr+\+c to access kermit command line then... | ||
send pathtoyourhostedbuildrootdir/rootfs.arm.jffs2 | send pathtoyourhostedbuildrootdir/rootfs.arm.jffs2 | ||
+ | </pre> | ||
then you can type the c command to reconnect to the terminal | then you can type the c command to reconnect to the terminal | ||
* Flash RootFS image with: | * Flash RootFS image with: | ||
− | + | <pre class="apf"> | |
− | + | BIOS> run flash_rootfs | |
+ | </pre> | ||
* Now you should be ready to test Linux: | * Now you should be ready to test Linux: | ||
− | + | <pre class="apf"> | |
− | + | BIOS> boot | |
+ | </pre> | ||
* To make it easier, you can use automatic scripts. So next time you will only launch: | * To make it easier, you can use automatic scripts. So next time you will only launch: | ||
+ | <pre class="apf"> | ||
BIOS> run update_rootfs | BIOS> run update_rootfs | ||
− | + | </pre> | |
===FPGA firmware installation=== | ===FPGA firmware installation=== | ||
Line 163: | Line 186: | ||
You can make some trials with the ''firmware/PS2/ps2_top.bit'' file.<br> | You can make some trials with the ''firmware/PS2/ps2_top.bit'' file.<br> | ||
<br> | <br> | ||
− | + | ||
− | + | {{Warning| Check that your bitfile size is smaller than the firmware partition size (256KB) before trying the following commands or you may corrupt your Linux kernel FLASH partition !!!}} | |
− | + | ||
− | + | ||
* Load FPGA firmware image file with U-Boot through:<br> | * Load FPGA firmware image file with U-Boot through:<br> | ||
Ethernet: | Ethernet: | ||
− | + | <pre class="apf"> | |
+ | BIOS> tftpboot 08000000 fpgafirmware.bit | ||
+ | </pre> | ||
fpgafirmware.bit is of course the name of your bitfile stored in your TFTP shared directory (/tftpboot/) | fpgafirmware.bit is of course the name of your bitfile stored in your TFTP shared directory (/tftpboot/) | ||
or serial line: | or serial line: | ||
+ | <pre class="apf"> | ||
BIOS> loadb 08000000 | BIOS> loadb 08000000 | ||
Ctrl+Altgr+\+c to access kermit command line then... | Ctrl+Altgr+\+c to access kermit command line then... | ||
C-Kermit> send path_to_your_tftp/fpgafirmware.bit | C-Kermit> send path_to_your_tftp/fpgafirmware.bit | ||
+ | </pre> | ||
then you can type the c command to reconnect to the terminal | then you can type the c command to reconnect to the terminal | ||
* Flash your firmware image with: | * Flash your firmware image with: | ||
− | + | <pre class="apf"> | |
− | + | BIOS> run flash_firmware | |
+ | </pre> | ||
* Test your new FPGA firmware: | * Test your new FPGA firmware: | ||
− | + | <pre class="apf"> | |
− | + | BIOS> fpga load 0 ${firmware_addr} ${firmware_len} | |
+ | </pre> | ||
* When your are satisfied with your firmware you can make it "autoloaded" at power up: | * When your are satisfied with your firmware you can make it "autoloaded" at power up: | ||
− | + | <pre class="apf"> | |
− | + | BIOS> setenv firmware_autoload 1 | |
+ | BIOS> saveenv | ||
+ | </pre> | ||
==Update U-Boot== | ==Update U-Boot== |
Revision as of 19:17, 25 February 2009
Contents
Flash memory partitions (APF9328)
Armadeus 2.x address range (index from FLASH physical @ 0x10000000) |
Armadeus 3 address range (index from FLASH physical @ 0x10000000) |
Type |
---|---|---|
0x000000 - 0x03FFFF ( 256KB ) | 0x000000 - 0x03FFFF ( 256KB ) | U-Boot |
0x040000 - 0x5FFFF ( 128KB ) | 0x040000 - 0x5FFFF ( 128KB ) | U-Boot environment variables |
0x060000 - 0x9FFFF ( 256KB ) | 0x060000 - 0x9FFFF ( 256KB ) | FPGA bitfile |
0x0A0000 - 0x21FFFF ( 1.5MB ) | 0x0A0000 - 0x29FFFF ( 2MB ) | Linux kernel image |
0x220000 - End of FLASH ( ~6 MB or ~14MB ) | 0x2A0000 - End of FLASH ( ~5.5 MB or ~13.5MB ) | Root filesystem |
Configure U-Boot
Environment variables
U-Boot can be customized in a flexible way with the use of "environment variables/scripts". The command printenv shows you most of them and their current value:
BIOS> printenv bootcmd=run jffsboot bootdelay=20 baudrate=115200 ethaddr= autoload=no ...
Use the command setenv to change these variables. For example, to set the IP address:
BIOS> setenv ipaddr 192.168.0.10
Use the command saveenv to save the state of your environment variables in FLASH memory:
BIOS> saveenv Saving Environment to Flash... . done Un-Protected 1 sectors Erasing Flash... . done Erased 1 sectors Writing to Flash... done . done Protected 1 sectors
Network configuration
In order to use the U-Boot's network features, you have to set the network environment variables:
BIOS> setenv netmask 255.255.255.0 (this default value should be fine in most situations) BIOS> setenv ipaddr 192.168.0.10 BIOS> setenv serverip 192.168.0.2 (the IP address of your tftp server/PC hosting the files to download) BIOS> setenv rootpath "/tftpboot/apf9328-root" (to boot Linux over NFS)
You can use the dhcp command to configure these variables from your DHCP server. You probably will have to adjust the serverip variable manually.
BIOS> dhcp dm9000 i/o: 0x15c00000, id: 0x90000a46 MAC: 00:0e:32:00:00:01 operating at 100M full duplex mode BOOTP broadcast 1 DHCP client bound to address 192.168.0.10 BIOS> setenv serverip 192.168.0.2 BIOS> saveenv
Do not forget to save your changes in FLASH, to have them available at next power up:
BIOS> saveenv
In case of troubles you can use the following U-Boot script to reset the variables to the "factory"/default settings:
BIOS> run flash_reset_env
Linux kernel building and installation
- configure your Linux kernel:
On your host: [armadeus]$ make linux26-menuconfig (previously linux-menuconfig)
- save your configuration and then rebuild your kernel image:
[armadeus]$ make linux26 (previously make linux)
- check that your Armadeus kernel image size is smaller than the U-Boot partition (2MB with Armadeus 3):
[armadeus]$ ls -al buildroot/binaries/apf9328/ ... [armadeus]$ cp buildroot/binaries/armadeus/apf9328-linux.bin /tftpboot/
- Load kernel image with U-Boot through network:
BIOS> tftpboot 08000000 apf9328-linux.bin
or with the serial line:
BIOS> loadb 08000000 ''Ctrl+Altgr+\+c to access kermit command line then:'' (/home/.../) C-Kermit>send /tftpboot/apf9328-linux.bin ''After download is completed, you can type the c command to reconnect to the terminal:'' (/home/.../) C-Kermit>c Connecting to /dev/ttyUSB0, speed 115200 Escape character: Ctrl-\ (ASCII 28, FS): enabled Type the escape character followed by C to get back, or followed by ? to see other options. ---------------------------------------------------- ## Total Size = 0x0013d0b0 = 1298608 Bytes ## Start Addr = 0x08000000 BIOS>
Warning: If the loaded kernel image is too large, the following operation can destroy data that are stored after the partition limits (e.g. RootFS) |
Check that transfered size value is less than 2097152 (0x200000 hex) with armadeus 3
Bytes transferred = 1313216 (1409c0 hex)
- You can test your new kernel image without flashing it with:
BIOS> bootm 08000000
- Flash kernel image with:
BIOS> run flash_kernel
- To make it easier, you can use automatic scripts. So next time you will only launch:
BIOS> run update_kernel
- If you only want to try a new kernel without flashing the kernel image you can launch it directly from RAM:
BIOS> setenv bootargs ${console} ${mtdparts}; run addjffsargs addipargs; bootm (the kernel image you want to try must have been loaded at 0x08000000)
Linux RootFS installation
- check that your Armadeus RootFS image size is smaller than the RootFS partition :
[armadeus]$ ls -al buildroot/binaries/apf9328/ ... [armadeus]$ cp buildroot/binaries/apf9328/apf9328-rootfs.arm.jffs2 /tftpboot/
- Load RootFS image with U-Boot through network:
BIOS> tftpboot 08000000 apf9328-rootfs.arm.jffs2
or serial line:
BIOS> loadb 08000000 Ctrl+Altgr+\+c to access kermit command line then... send pathtoyourhostedbuildrootdir/rootfs.arm.jffs2
then you can type the c command to reconnect to the terminal
- Flash RootFS image with:
BIOS> run flash_rootfs
- Now you should be ready to test Linux:
BIOS> boot
- To make it easier, you can use automatic scripts. So next time you will only launch:
BIOS> run update_rootfs
FPGA firmware installation
The FPGA firmwares are all located in the firmware/ directory of your Armadeus view:
[armadeus]$ ls firmware/ apf_pkg BRAMTest bus_led led PS2 PS2_Opencore servo sram_test wishbone_example Xtools
You can make some trials with the firmware/PS2/ps2_top.bit file.
Warning: Check that your bitfile size is smaller than the firmware partition size (256KB) before trying the following commands or you may corrupt your Linux kernel FLASH partition !!! |
- Load FPGA firmware image file with U-Boot through:
Ethernet:
BIOS> tftpboot 08000000 fpgafirmware.bit
fpgafirmware.bit is of course the name of your bitfile stored in your TFTP shared directory (/tftpboot/)
or serial line:
BIOS> loadb 08000000 Ctrl+Altgr+\+c to access kermit command line then... C-Kermit> send path_to_your_tftp/fpgafirmware.bit
then you can type the c command to reconnect to the terminal
- Flash your firmware image with:
BIOS> run flash_firmware
- Test your new FPGA firmware:
BIOS> fpga load 0 ${firmware_addr} ${firmware_len}
- When your are satisfied with your firmware you can make it "autoloaded" at power up:
BIOS> setenv firmware_autoload 1 BIOS> saveenv
Update U-Boot
There are two steps to update U-Boot:
- 1] Load the new U-Boot code in RAM
You can use the following commands to download U-boot:
With Ethernet and a TFTP server:
BIOS> tftpboot 08000000 apf9328-u-boot.bin
With Ethernet and a NFS server:
BIOS> nfs 08000000 host_ip_addr:/nfs_path_to_buildroot/apf9328-u-boot.bin
With the kermit and a serial line
BIOS> loadb 08000000 <CTRL><ALT GR>\ c send path_to_buildroot/apf9328-u-boot.bin c
- 2] Transfer code from RAM to Flash memory
There is a simple U-Boot command/script to do that:
BIOS> run flash_uboot
Advanced informations can be found at the BootLoader wiki page.