http://armadeus.org/wiki/api.php?action=feedcontributions&feedformat=atom&user=FlorianGaArmadeusWiki - User contributions [en]2026-06-29T12:57:06ZUser contributionsMediaWiki 1.26.3http://armadeus.org/wiki/index.php?title=Target_Software_Installation&diff=4460Target Software Installation2008-07-26T22:35:51Z<p>FlorianGa: /* Linux kernel building and installation */</p>
<hr />
<div>===Flash memory partitions (APF9328)===<br />
{| border="1" cellpadding="5" cellspacing="0" summary="Signal connections"<br />
|- style="background:#efefef;"<br />
! width="66%" | Address range (index from FLASH physical @ 0x10000000) !! Type<br />
|- align="center"<br />
|0x000000 - 0x03FFFF ( 256KB )<br />
| U-Boot<br />
|- align="center"<br />
|0x040000 - 0x5FFFF ( 128KB )<br />
| U-Boot environment variables<br />
|- align="center"<br />
|0x060000 - 0x9FFFF ( 256KB )<br />
| FPGA bitfile<br />
|- align="center"<br />
|0x0A0000 - 0x21FFFF ( 1.5MB )<br />
| Linux kernel image<br />
|- align="center"<br />
|0x220000 - End of FLASH ( ~6 MB or ~14MB )<br />
| Root filesystem<br />
|}<br />
<br />
==Configure U-Boot==<br />
<br />
===Environment variables===<br />
U-Boot can be customized in a flexible way with the use of "environment variables/scripts".<br />
The command '''printenv''' shows you most of them and their current value:<br />
BIOS> printenv<br />
bootcmd=run jffsboot<br />
bootdelay=20<br />
baudrate=115200<br />
ethaddr=00:0E:32:00:00:01<br />
autoload=no<br />
...<br />
<br />
Use the command '''setenv''' to change these variables. For example, to set the IP address:<br />
BIOS> setenv ipaddr 192.168.0.3<br />
<br />
Use the command '''saveenv''' to save the state of your environment variables in FLASH memory:<br />
BIOS> saveenv<br />
Saving Environment to Flash...<br />
. done<br />
Un-Protected 1 sectors<br />
Erasing Flash...<br />
. done<br />
Erased 1 sectors<br />
Writing to Flash... done<br />
. done<br />
Protected 1 sectors<br />
<br />
===Network configuration===<br />
In order to use the U-Boot's network features, you have to set the network environment variables:<br />
BIOS> setenv netmask 255.255.255.0 (this default value should be fine in most situations)<br />
BIOS> setenv ipaddr 192.168.0.3 <br />
BIOS> setenv serverip 192.168.0.5 (the IP address of your tftp server/PC hosting the files to download)<br />
BIOS> setenv rootpath "/tftpboot/root" (to boot Linux over NFS)<br />
<br />
You can use the '''dhcp''' command to configure these variables from your DHCP server. You probably will have to adjust the '''serverip''' variable manually.<br />
<br />
BIOS> dhcp<br />
dm9000 i/o: 0x15c00000, id: 0x90000a46<br />
MAC: 00:0e:32:00:00:01<br />
operating at 100M full duplex mode<br />
BOOTP broadcast 1<br />
DHCP client bound to address 192.168.0.3<br />
BIOS> setenv serverip 192.168.0.5<br />
BIOS> saveenv<br />
<br />
Do not forget to save your changes in FLASH, to have them available at next power up:<br />
BIOS> saveenv<br />
In case of troubles you can use the following U-Boot script to reset the variables to the "factory"/default settings:<br />
BIOS> run flash_reset_env<br />
<br />
===Linux kernel building and installation===<br />
<br />
* configure your Linux kernel:<br />
[armadeus]$ make linux-menuconfig<br />
<br />
* save your configuration and then rebuild your kernel image:<br />
[armadeus]$ make linux<br />
<br />
* check that your Armadeus kernel image size is smaller than the U-Boot partition (1,5MB):<br />
[armadeus]$ ls -al buildroot/binaries/armadeus/<br />
...<br />
[armadeus]$ cp buildroot/binaries/armadeus/linux-kernel-2.6.23.1-arm.bin /tftpboot/<br />
<br />
* Load kernel image with U-Boot through network:<br />
BIOS> tftp 08000000 /tftpboot/linux-kernel-2.6.23.1-arm.bin<br />
or with the serial line:<br />
BIOS> loadb 08000000<br />
Ctrl+Altgr+\+c to access kermit command line then...<br />
send pathtoyourhostedbuildrootdir/linux-kernel-2.6.23.1-arm.bin<br />
the you can type the c command to reconnect to the terminal<br />
----<br />
<span style="color:red"><br />
'''!!! 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) !!!'''<br />
</span><br><br />
Check that transfered size value is less than 1572864 (0x180000 hex)<br />
Bytes transferred = 1313216 (1409c0 hex) <br />
----<br />
<br />
* You can test your new kernel image without flashing it with:<br />
BIOS> bootm 08000000<br />
<br />
----<br />
<br />
* Unprotect flash sectors bank 1 sectors 0 to 127:<br />
BIOS> protect off 1:0-127<br />
<br />
----<br />
<br />
* Flash kernel image with:<br />
BIOS> run flash_kernel<br />
<br />
* To make it easier next time, you can write a small U-Boot script:<br />
BIOS> setenv kernel_img linux-kernel-2.6.23.1-arm.bin<br />
BIOS> setenv update_kernel_tftp if tftp 08000000 \${kernel_img}\; then run flash_kernel\; fi<br />
* So next time you will only launch:<br />
BIOS> run update_kernel_tftp<br />
<br />
* If you only want to try a new kernel without flashing the kernel image you can launch it directly from RAM:<br />
BIOS> setenv bootargs ${console} ${mtdparts}; run addjffsargs addipargs; bootm<br />
(the kernel image you want to try must have been loaded at 0x08000000)<br />
<br />
===Linux RootFS installation===<br />
<br />
<br />
* check that your Armadeus RootFS image size is smaller than the RootFS partition :<br />
[armadeus]$ ls -al buildroot/binaries/armadeus/<br />
...<br />
[armadeus]$ cp buildroot/binaries/armadeus/rootfs.arm.jffs2 /tftpboot/<br />
<br />
<br />
* Load RootFS image with U-Boot through network:<br />
BIOS> tftp 08000000 /tftpboot/rootfs.arm.jffs2<br />
or serial line:<br />
BIOS> loadb 08000000<br />
Ctrl+Altgr+\+c to access kermit command line then...<br />
send pathtoyourhostedbuildrootdir/rootfs.arm.jffs2<br />
then you can type the c command to reconnect to the terminal<br />
<br />
* Flash RootFS image with:<br />
BIOS> run flash_rootfs<br />
<br />
* Now you should be ready to test Linux:<br />
BIOS> boot<br />
<br />
* To make it easier next time, you can write a small U-Boot script:<br />
BIOS> setenv rootfs_img rootfs.arm.jffs2<br />
BIOS> setenv update_rootfs_tftp if tftp 08000000 \${rootfs_img}\; then run flash_rootfs\; fi<br />
BIOS> saveenv<br />
<br />
* So next time you will only launch: <br />
BIOS> run update_rootfs_tftp<br />
<br />
===FPGA firmware installation===<br />
<br />
The FPGA firmwares are all located in the ''firmware/'' directory of your Armadeus view:<br />
[armadeus]$ ls firmware/<br />
BRAMTest led PS2 PS2_Opencore sram_test<br />
You can make some trials with the ''firmware/PS2/ps2_top.bit'' file.<br><br />
<br><br />
----<br />
'''!!! 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 !!!'''<br />
----<br />
<br><br />
<br />
* Load FPGA firmware image file with U-Boot through:<br><br />
Ethernet:<br />
BIOS> tftp 08000000 fpgafirmware.bit<br />
fpgafirmware.bit is of course the name of your bitfile stored in your TFTP shared directory (/tftpboot/)<br />
<br />
or serial line:<br />
BIOS> loadb 08000000<br />
Ctrl+Altgr+\+c to access kermit command line then...<br />
C-Kermit> send path_to_your_tftp/fpgafirmware.bit<br />
then you can type the c command to reconnect to the terminal<br />
<br />
* Flash your firmware image with:<br />
BIOS> run flash_firmware<br />
<br />
* Test your new FPGA firmware:<br />
BIOS> fpga load 0 ${firmware_addr} ${firmware_len}<br />
<br />
* When your are satisfied with your firmware you can make it "autoloaded" at power up:<br />
BIOS> setenv firmware_autoload 1<br />
BIOS> saveenv<br />
<br />
==Update U-Boot==<br />
<br />
There are two steps to update U-Boot:<br />
*1] Load the new U-Boot code in RAM<br />
You can use the following commands to download U-boot:<br><br />
With Ethernet and a TFTP server:<br />
BIOS> tftp 08000000 /tftpboot_path_to_buildroot/u-boot.bin<br />
With Ethernet and a NFS server:<br />
BIOS> nfs 08000000 host_ip_addr:/nfs_path_to_buildroot/u-boot.bin<br />
With the kermit and a serial line<br />
BIOS> loadb 08000000<br />
<CTRL><ALT GR>\<br />
c<br />
send path_to_buildroot/u_boot.bin<br />
c<br />
<br />
*2] Transfer code from RAM to Flash memory<br />
There is a simple U-Boot command/script to do that:<br />
BIOS> run flash_uboot<br />
<br />
Advanced informations can be found at the [[BootLoader]] wiki page.</div>FlorianGa