Difference between revisions of "Target Software Installation"
m (→Load the new U-Boot code in RAM) |
(→Flash memory partitions: Add U-Boot 2011.12 new partition model and also add the APF28 flash memory partition) |
||
Line 243: | Line 243: | ||
==Flash memory partitions== | ==Flash memory partitions== | ||
− | ===APF9328 Flash memory partitions=== | + | ===APF9328 / U-Boot 1.3.4 Flash memory partitions=== |
{| border="1" cellpadding="5" cellspacing="0" summary="APF9328 Flash memory partitions" | {| border="1" cellpadding="5" cellspacing="0" summary="APF9328 Flash memory partitions" | ||
|- style="background:#efefef;" align="center" | |- style="background:#efefef;" align="center" | ||
Line 270: | Line 270: | ||
<br> | <br> | ||
− | ===APF27 Flash memory partitions=== | + | ===APF9328 / U-Boot 2011.12 Flash memory partitions=== |
+ | {| border="1" cellpadding="5" cellspacing="0" summary="APF9328 Flash memory partitions" | ||
+ | |- style="background:#efefef;" align="center" | ||
+ | ! width="40%" | Armadeus 5.x address range <br>(index from FLASH physical @ 0x10000000) !! Type | ||
+ | |- align="center" | ||
+ | |0x000000 - 0x03FFFF ( 256KB ) | ||
+ | | u-boot | ||
+ | |- align="center" | ||
+ | |0x040000 - 0x5FFFF ( 128KB ) | ||
+ | | U-Boot environment variables (primary partition: env) | ||
+ | |- align="center" | ||
+ | |0x060000 - 0x7FFFF ( 128KB ) | ||
+ | | U-Boot environment variables (redundant partition: env2) | ||
+ | |- align="center" | ||
+ | |0x080000 - 0xBFFFF ( 256KB ) | ||
+ | | FPGA bitfile (firmware) | ||
+ | |- align="center" | ||
+ | |0x0C0000 - 0x2BFFFF ( 2MB ) | ||
+ | | Linux kernel image (kernel) | ||
+ | |- align="center" | ||
+ | |0x2C0000 - End of FLASH ( ~5.5 MB or ~13.5 MB ) | ||
+ | | Root filesystem (rootfs) | ||
+ | |} | ||
+ | <br> | ||
+ | |||
+ | ===APF27 / U-Boot 1.3.4 Flash memory partitions=== | ||
{| border="1" cellpadding="5" cellspacing="0" summary="APF27 Flash memory partitions" | {| border="1" cellpadding="5" cellspacing="0" summary="APF27 Flash memory partitions" | ||
|- style="background:#efefef;" align="center" | |- style="background:#efefef;" align="center" | ||
Line 292: | Line 317: | ||
<br> | <br> | ||
− | ===APF51 Flash memory partitions=== | + | ===APF27 / U-Boot 2011.12 Flash memory partitions=== |
+ | {| border="1" cellpadding="5" cellspacing="0" summary="APF27 Flash memory partitions" | ||
+ | |- style="background:#efefef;" align="center" | ||
+ | ! width="80%" | NAND flash address range !! Type | ||
+ | |- align="center" | ||
+ | |0x00000000 - 0x000FFFFF (1MiB, including NAND SPL and spare memory for bad blocks) | ||
+ | | u-boot | ||
+ | |- align="center" | ||
+ | |0x00100000 - 0x0017FFFF (512kB) | ||
+ | | U-Boot environment variables (primary partition: env) | ||
+ | |- align="center" | ||
+ | |0x00180000 - 0x001FFFFF (512kB) | ||
+ | | U-Boot environment variables (redundant partition: env2) | ||
+ | |- align="center" | ||
+ | | 0x00200000 - 0x0027FFFF (512KB) | ||
+ | | FPGA bitfile (firmware) | ||
+ | |- align="center" | ||
+ | | 0x00280000 - 0x002FFFFF (512kB) | ||
+ | | DeviceTree Block partition (dtb) | ||
+ | |- align="center" | ||
+ | | 0x00300000 - 0x007FFFFF (5MB) | ||
+ | | Linux kernel image (kernel) | ||
+ | |- align="center" | ||
+ | | 0x00800000 - End of FLASH (>~248MB) | ||
+ | | Root filesystem (rootfs) | ||
+ | |} | ||
+ | <br> | ||
+ | |||
+ | ===APF28 / U-Boot 2011.12 Flash memory partitions=== | ||
+ | {| border="1" cellpadding="5" cellspacing="0" summary="APF28 Flash memory partitions" | ||
+ | |- style="background:#efefef;" align="center" | ||
+ | ! width="80%" | NAND flash address range !! Type | ||
+ | |- align="center" | ||
+ | |0x00000000 - 0x002FFFFF (3MB, including NAND SPL and spare memory for bad blocks) | ||
+ | | u-boot | ||
+ | |- align="center" | ||
+ | |0x00300000 - 0x0037FFFF (512kB) | ||
+ | | U-Boot environment variables (primary partition: env) | ||
+ | |- align="center" | ||
+ | |0x00380000 - 0x003FFFFF (512kB) | ||
+ | | U-Boot environment variables (redundant partition: env2) | ||
+ | |- align="center" | ||
+ | | 0x00400000 - 0x0047FFFF (512kB) | ||
+ | | DeviceTree Block partition (dtb) | ||
+ | |- align="center" | ||
+ | | 0x00480000 - 0x004FFFFF (512kB) | ||
+ | | Reserved for a futur splash screen (splash) | ||
+ | |- align="center" | ||
+ | | 0x00500000 - 0x00CFFFFF (8MB) | ||
+ | | Linux kernel image (kernel) | ||
+ | |- align="center" | ||
+ | | 0x00D00000 - End of FLASH (>~243MB) | ||
+ | | Root filesystem (rootfs) | ||
+ | |} | ||
+ | <br> | ||
+ | |||
+ | ===APF51 / U-Boot 2010.03 Flash memory partitions=== | ||
{| border="1" cellpadding="5" cellspacing="0" summary="APF51 Flash memory partitions" | {| border="1" cellpadding="5" cellspacing="0" summary="APF51 Flash memory partitions" | ||
|- style="background:#efefef;" align="center" | |- style="background:#efefef;" align="center" | ||
Line 311: | Line 392: | ||
| 0x00b00000 - End of FLASH (>~500MB) | | 0x00b00000 - End of FLASH (>~500MB) | ||
| Root filesystem | | Root filesystem | ||
+ | |} | ||
+ | <br> | ||
+ | |||
+ | ===APF51 / U-Boot 2011.12 Flash memory partitions=== | ||
+ | {| border="1" cellpadding="5" cellspacing="0" summary="APF51 Flash memory partitions" | ||
+ | |- style="background:#efefef;" align="center" | ||
+ | ! width="80%" | NAND flash address range !! Type | ||
+ | |- align="center" | ||
+ | |0x00000000 - 0x000FFFFF (1MB, including NAND SPL and spare memory for bad blocks) | ||
+ | | u-boot | ||
+ | |- align="center" | ||
+ | |0x00100000 - 0x0017FFFF (512kB) | ||
+ | | U-Boot environment variables (primary partition: env) | ||
+ | |- align="center" | ||
+ | |0x00180000 - 0x001FFFFF (512kB) | ||
+ | | U-Boot environment variables (redundant partition: env2) | ||
+ | |- align="center" | ||
+ | | 0x00200000 - 0x002fffff (1MB) | ||
+ | | FPGA bitfile | ||
+ | |- align="center" | ||
+ | | 0x00300000 - 0x0037FFFF (512kB) | ||
+ | | DeviceTree Block partition (dtb) | ||
+ | |- align="center" | ||
+ | | 0x00380000 - 0x003FFFFF (512kB) | ||
+ | | Reserved for a futur splash screen (splash) | ||
+ | |- align="center" | ||
+ | | 0x00400000 - 0x00BFFFFF (8MB) | ||
+ | | Linux kernel image (kernel) | ||
+ | |- align="center" | ||
+ | | 0x00C00000 - End of FLASH (>~500MB) | ||
+ | | Root filesystem (rootfs) | ||
|} | |} | ||
<br> | <br> |
Revision as of 01:47, 19 April 2012
On this page you will learn how to flash new U-Boot, Linux and rootfs images on your APF module.
Contents
- 1 Configure U-Boot
- 2 Linux kernel installation
- 3 rootfs installation
- 4 FPGA firmware test
- 5 FPGA firmware installation
- 6 Update U-Boot
- 7 Flash memory partitions
- 7.1 APF9328 / U-Boot 1.3.4 Flash memory partitions
- 7.2 APF9328 / U-Boot 2011.12 Flash memory partitions
- 7.3 APF27 / U-Boot 1.3.4 Flash memory partitions
- 7.4 APF27 / U-Boot 2011.12 Flash memory partitions
- 7.5 APF28 / U-Boot 2011.12 Flash memory partitions
- 7.6 APF51 / U-Boot 2010.03 Flash memory partitions
- 7.7 APF51 / U-Boot 2011.12 Flash memory partitions
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 ...
The command setenv is used to change these variables. For example, to set the IP address (don't do it yet):
BIOS> setenv ipaddr 192.168.0.10
The command saveenv is used to save the state of your environment variables in FLASH memory; that way they will be available at next boot:
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 installation
XX, in the following chapters, has to be replaced by your board name
- Check that your Armadeus kernel image size is smaller than the U-Boot partition (see Flash Memory Partitions for size allowances):
[armadeus]$ ls -al buildroot//output/images/
- If yes, copy it to your TFTP server directory (here /tftpboot/):
[armadeus]$ cp buildroot//output/images/XX-linux.bin /tftpboot/
- Load kernel image with U-Boot through network:
BIOS> run download_kernel
or with the serial line:
BIOS> loadb ${loadaddr} ''Ctrl+Altgr+\+c to access kermit command line then:'' (/home/.../) C-Kermit>send /tftpboot/XX-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 the ones specified here Flash Memory Partitions
Bytes transferred = 1313216 (1409c0 hex)
- You can test your new kernel image without flashing it with; if so you will have to reload it again after test:
- Please note: The bootm command is not supported by APF51 boards yet; directly flash the kernel with the below commands instead
BIOS> bootm
- a U-Boot script exists to ease kernel image loading through Ethernet:
BIOS> run download_kernel
- After kernel image has been downloaded into RAM memory, you can flash it with:
BIOS> run flash_kernel
- To make it easier, you can use automatic scripts that will download the image and flash it in the same go. So next time you will only launch:
BIOS> run update_kernel
- To know what update_kernel script is doing you can display its content:
BIOS> printenv 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 ${loadaddr})
rootfs installation
- Check that your Armadeus rootfs image size is smaller than the rootfs partition (see Flash Memory Partitions for size allowances):
[armadeus]$ ls -al buildroot/output/images/ ... [armadeus]$ cp buildroot/output/images/XX-rootfs.ubi /tftpboot/ (apf9328-rootfs.jffs2 on [[APF9328]]
- Load rootfs image with U-Boot through network:
BIOS> run download_rootfs
For large rootfs (bigger than the available RAM on your system) please use this method (not supported on the APF9328):
BIOS> tftpboot ${rootfs_offset} XX-rootfs.ubi nand
or serial line:
BIOS> loadb ${loadaddr} ''Ctrl+Altgr+\+c to access kermit command line then...'' (/home/.../) C-Kermit>send path_to_your_host_buildroot_dir/XX-rootfs.ubi ''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 = 0x........ ## Start Addr = 0x........ BIOS>
- 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 U-Boot scripts we defined. So next time you will only launch:
BIOS> run update_rootfs
FPGA firmware test
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.bin file.
- Load FPGA firmware image file with U-Boot through:
Ethernet:
BIOS> tftpboot ${loadaddr} fpgafirmware.bin
fpgafirmware.bin is of course the name of your bitfile stored in your TFTP shared directory (/tftpboot/)
then you can type the c command to reconnect to the terminal
- Test your new FPGA firmware's downloading:
BIOS> fpga load 0 ${loadaddr} ${filesize}
FPGA firmware installation
- Flash your firmware image with:
BIOS> run flash_firmware
- When you 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:
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> run download_uboot
- With Ethernet and a NFS server:
BIOS> nfs ${loadaddr} host_ip_addr:/nfs_path_to_buildroot/apf9328-u-boot.bin
- With kermit and the serial/RS232 line
BIOS> loadb ${loadaddr} <CTRL><ALT GR>\ c send path_to_buildroot/apf9328-u-boot.bin c<ENTER>
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.
Flash memory partitions
APF9328 / U-Boot 1.3.4 Flash memory partitions
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 |
APF9328 / U-Boot 2011.12 Flash memory partitions
Armadeus 5.x address range (index from FLASH physical @ 0x10000000) |
Type |
---|---|
0x000000 - 0x03FFFF ( 256KB ) | u-boot |
0x040000 - 0x5FFFF ( 128KB ) | U-Boot environment variables (primary partition: env) |
0x060000 - 0x7FFFF ( 128KB ) | U-Boot environment variables (redundant partition: env2) |
0x080000 - 0xBFFFF ( 256KB ) | FPGA bitfile (firmware) |
0x0C0000 - 0x2BFFFF ( 2MB ) | Linux kernel image (kernel) |
0x2C0000 - End of FLASH ( ~5.5 MB or ~13.5 MB ) | Root filesystem (rootfs) |
APF27 / U-Boot 1.3.4 Flash memory partitions
NAND flash address range | Type |
---|---|
0x00000000 - 0x0009FFFF (640KB, including NAND SPL and 384KB spare memory for bad blocks) | U-Boot |
0x000A0000 - 0x000FFFFF (384KB) | U-Boot environment variables |
0x00100000 - 0x0017FFFF (512KB) | FPGA bitfile |
0x00180000 - 0x0067FFFF (5MB) | Linux kernel image |
0x00680000 - End of FLASH (>~250MB) | Root filesystem |
APF27 / U-Boot 2011.12 Flash memory partitions
NAND flash address range | Type |
---|---|
0x00000000 - 0x000FFFFF (1MiB, including NAND SPL and spare memory for bad blocks) | u-boot |
0x00100000 - 0x0017FFFF (512kB) | U-Boot environment variables (primary partition: env) |
0x00180000 - 0x001FFFFF (512kB) | U-Boot environment variables (redundant partition: env2) |
0x00200000 - 0x0027FFFF (512KB) | FPGA bitfile (firmware) |
0x00280000 - 0x002FFFFF (512kB) | DeviceTree Block partition (dtb) |
0x00300000 - 0x007FFFFF (5MB) | Linux kernel image (kernel) |
0x00800000 - End of FLASH (>~248MB) | Root filesystem (rootfs) |
APF28 / U-Boot 2011.12 Flash memory partitions
NAND flash address range | Type |
---|---|
0x00000000 - 0x002FFFFF (3MB, including NAND SPL and spare memory for bad blocks) | u-boot |
0x00300000 - 0x0037FFFF (512kB) | U-Boot environment variables (primary partition: env) |
0x00380000 - 0x003FFFFF (512kB) | U-Boot environment variables (redundant partition: env2) |
0x00400000 - 0x0047FFFF (512kB) | DeviceTree Block partition (dtb) |
0x00480000 - 0x004FFFFF (512kB) | Reserved for a futur splash screen (splash) |
0x00500000 - 0x00CFFFFF (8MB) | Linux kernel image (kernel) |
0x00D00000 - End of FLASH (>~243MB) | Root filesystem (rootfs) |
APF51 / U-Boot 2010.03 Flash memory partitions
NAND flash address range | Type |
---|---|
0x00000000 - 0x000fffff (1MB, including NAND SPL and spare memory for bad blocks) | U-Boot |
0x00100000 - 0x001fffff (1MB) | U-Boot environment variables |
0x00200000 - 0x002fffff (1MB) | FPGA bitfile |
0x00300000 - 0x00afffff (8MB) | Linux kernel image |
0x00b00000 - End of FLASH (>~500MB) | Root filesystem |
APF51 / U-Boot 2011.12 Flash memory partitions
NAND flash address range | Type |
---|---|
0x00000000 - 0x000FFFFF (1MB, including NAND SPL and spare memory for bad blocks) | u-boot |
0x00100000 - 0x0017FFFF (512kB) | U-Boot environment variables (primary partition: env) |
0x00180000 - 0x001FFFFF (512kB) | U-Boot environment variables (redundant partition: env2) |
0x00200000 - 0x002fffff (1MB) | FPGA bitfile |
0x00300000 - 0x0037FFFF (512kB) | DeviceTree Block partition (dtb) |
0x00380000 - 0x003FFFFF (512kB) | Reserved for a futur splash screen (splash) |
0x00400000 - 0x00BFFFFF (8MB) | Linux kernel image (kernel) |
0x00C00000 - End of FLASH (>~500MB) | Root filesystem (rootfs) |