http://armadeus.org/wiki/api.php?action=feedcontributions&feedformat=atom&user=FlorianGa ArmadeusWiki - User contributions [en] 2026-06-29T12:57:06Z User contributions MediaWiki 1.26.3 http://armadeus.org/wiki/index.php?title=Target_Software_Installation&diff=4460 Target Software Installation 2008-07-26T22:35:51Z <p>FlorianGa: /* Linux kernel building and installation */</p> <hr /> <div>===Flash memory partitions (APF9328)===<br /> {| border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; summary=&quot;Signal connections&quot;<br /> |- style=&quot;background:#efefef;&quot;<br /> ! width=&quot;66%&quot; | Address range (index from FLASH physical @ 0x10000000) !! Type<br /> |- align=&quot;center&quot;<br /> |0x000000 - 0x03FFFF ( 256KB )<br /> | U-Boot<br /> |- align=&quot;center&quot;<br /> |0x040000 - 0x5FFFF ( 128KB )<br /> | U-Boot environment variables<br /> |- align=&quot;center&quot;<br /> |0x060000 - 0x9FFFF ( 256KB )<br /> | FPGA bitfile<br /> |- align=&quot;center&quot;<br /> |0x0A0000 - 0x21FFFF ( 1.5MB )<br /> | Linux kernel image<br /> |- align=&quot;center&quot;<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 &quot;environment variables/scripts&quot;.<br /> The command '''printenv''' shows you most of them and their current value:<br /> BIOS&gt; 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&gt; 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&gt; 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&gt; setenv netmask 255.255.255.0 (this default value should be fine in most situations)<br /> BIOS&gt; setenv ipaddr 192.168.0.3 <br /> BIOS&gt; setenv serverip 192.168.0.5 (the IP address of your tftp server/PC hosting the files to download)<br /> BIOS&gt; setenv rootpath &quot;/tftpboot/root&quot; (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&gt; 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&gt; setenv serverip 192.168.0.5<br /> BIOS&gt; saveenv<br /> <br /> Do not forget to save your changes in FLASH, to have them available at next power up:<br /> BIOS&gt; saveenv<br /> In case of troubles you can use the following U-Boot script to reset the variables to the &quot;factory&quot;/default settings:<br /> BIOS&gt; 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&gt; tftp 08000000 /tftpboot/linux-kernel-2.6.23.1-arm.bin<br /> or with the serial line:<br /> BIOS&gt; 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 /> &lt;span style=&quot;color:red&quot;&gt;<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 /> &lt;/span&gt;&lt;br&gt;<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&gt; bootm 08000000<br /> <br /> ----<br /> <br /> * Unprotect flash sectors bank 1 sectors 0 to 127:<br /> BIOS&gt; protect off 1:0-127<br /> <br /> ----<br /> <br /> * Flash kernel image with:<br /> BIOS&gt; run flash_kernel<br /> <br /> * To make it easier next time, you can write a small U-Boot script:<br /> BIOS&gt; setenv kernel_img linux-kernel-2.6.23.1-arm.bin<br /> BIOS&gt; setenv update_kernel_tftp if tftp 08000000 \${kernel_img}\; then run flash_kernel\; fi<br /> * So next time you will only launch:<br /> BIOS&gt; 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&gt; 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&gt; tftp 08000000 /tftpboot/rootfs.arm.jffs2<br /> or serial line:<br /> BIOS&gt; 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&gt; run flash_rootfs<br /> <br /> * Now you should be ready to test Linux:<br /> BIOS&gt; boot<br /> <br /> * To make it easier next time, you can write a small U-Boot script:<br /> BIOS&gt; setenv rootfs_img rootfs.arm.jffs2<br /> BIOS&gt; setenv update_rootfs_tftp if tftp 08000000 \${rootfs_img}\; then run flash_rootfs\; fi<br /> BIOS&gt; saveenv<br /> <br /> * So next time you will only launch: <br /> BIOS&gt; 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.&lt;br&gt;<br /> &lt;br&gt;<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 /> &lt;br&gt;<br /> <br /> * Load FPGA firmware image file with U-Boot through:&lt;br&gt;<br /> Ethernet:<br /> BIOS&gt; 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&gt; loadb 08000000<br /> Ctrl+Altgr+\+c to access kermit command line then...<br /> C-Kermit&gt; 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&gt; run flash_firmware<br /> <br /> * Test your new FPGA firmware:<br /> BIOS&gt; fpga load 0 ${firmware_addr} ${firmware_len}<br /> <br /> * When your are satisfied with your firmware you can make it &quot;autoloaded&quot; at power up:<br /> BIOS&gt; setenv firmware_autoload 1<br /> BIOS&gt; 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:&lt;br&gt;<br /> With Ethernet and a TFTP server:<br /> BIOS&gt; tftp 08000000 /tftpboot_path_to_buildroot/u-boot.bin<br /> With Ethernet and a NFS server:<br /> BIOS&gt; nfs 08000000 host_ip_addr:/nfs_path_to_buildroot/u-boot.bin<br /> With the kermit and a serial line<br /> BIOS&gt; loadb 08000000<br /> &lt;CTRL&gt;&lt;ALT GR&gt;\<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&gt; run flash_uboot<br /> <br /> Advanced informations can be found at the [[BootLoader]] wiki page.</div> FlorianGa