Difference between revisions of "Target Software Installation"

From ArmadeusWiki
Jump to: navigation, search
(Configure U-Boot)
Line 22: Line 22:
 
==Configure U-Boot==
 
==Configure U-Boot==
  
There is a set of variables you can customize to your needs.
+
===Environment variables===
The commande '''printenv''' show you most of them and their current state.
+
U-Boot has a flexible way to customize it with the use of ''environment variables/scripts''.
Use the command '''setenv''' to change one of these variable.
+
The command '''printenv''' show you most of them and their current state:
For instance:
+
BIOS> printenv
  setenv ipaddr 192.168.0.3
+
bootcmd=run jffsboot
Use the command '''saveenv''' to save the state of your environment variables in flash memory.
+
bootdelay=20
 +
baudrate=115200
 +
ethaddr=00:0E:32:00:00:01
 +
autoload=no
 +
  ...
  
In order to use network features with u-boot you have to set the network environment variables:
+
Use the command '''setenv''' to change these variables. For example, to set the IP address:
  setenv netmask=255.255.255.0 (default value should be fine in most situations)
+
BIOS> setenv ipaddr 192.168.0.3
  setenv ipaddr 192.168.0.3  
+
 
  setenv serverip=192.168.0.5 (the IP adresse of your tftp host server to download update files )
+
Use the command '''saveenv''' to save the state of your environment variables in FLASH memory:
  setenv rootpath "/tftpboot/root" (to boot linux over nfs)
+
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.3  
 +
  BIOS> setenv serverip=192.168.0.5 (the IP address of your tftp server/PC hosting the files to download)
 +
  BIOS> setenv rootpath "/tftpboot/root" (to boot linux over nfs)
  
 
You can use the '''dhcp''' command to configure these variable from your dhcp server. Probably you will have to adjust the '''serverip''' variable manually.
 
You can use the '''dhcp''' command to configure these variable from your dhcp server. Probably you will have to adjust the '''serverip''' variable manually.
Line 43: Line 63:
 
  BOOTP broadcast 1
 
  BOOTP broadcast 1
 
  DHCP client bound to address 192.168.0.3
 
  DHCP client bound to address 192.168.0.3
  BIOS>setenv serverip=192.168.0.5
+
  BIOS> setenv serverip=192.168.0.5
  BIOS>saveenv
+
  BIOS> saveenv
  
Do not forget to save your changes in flash with '''saveenv''' to have them available at power up. In case of troubleshoots you can use the script '''run flash_reset_env''' to reset the variables to the factory settings.
+
Do not forget to save your changes in FLASH with '''saveenv''' to have them available at next power up. In case of troubleshoots you can use the script '''run flash_reset_env''' to reset the variables to the factory settings.
  
 
===Linux kernel installation===
 
===Linux kernel installation===
  
First check your kernel size is smaller than the armadeus kernel partiiton (ex 1MB) How ??????????????????????????
+
First check your kernel size is smaller than the Armadeus kernel partition (ex 1MB) How ??????????????????????????
 
Load kernel image with u-boot through network:
 
Load kernel image with u-boot through network:
 
     BIOS> tftpboot 08000000 pathtoyourhostedbuildrootdir/linux-kernel-2.6.12-arm.bin
 
     BIOS> tftpboot 08000000 pathtoyourhostedbuildrootdir/linux-kernel-2.6.12-arm.bin

Revision as of 20:26, 19 October 2007

Flash memory partitions

Address range type
0x10000000 - 0x10040000 ( 256KB ) U-Boot
0x10040000 - 0x10060000 ( 128KB ) U-Boot environment variables
0x10060000 - 0x100A0000 ( 256KB ) FPGA bitfile
0x100A0000 - 0x10220000 ( 1.5MB ) Linux kernel image
0x10220000 - 0x10800000 ( ~6 MB ) Root filesystem

Configure U-Boot

Environment variables

U-Boot has a flexible way to customize it with the use of environment variables/scripts. The command printenv show you most of them and their current state:

BIOS> printenv
bootcmd=run jffsboot
bootdelay=20
baudrate=115200
ethaddr=00:0E:32:00:00:01
autoload=no
...

Use the command setenv to change these variables. For example, to set the IP address:

BIOS> setenv ipaddr 192.168.0.3

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.3 
BIOS> setenv serverip=192.168.0.5 (the IP address of your tftp server/PC hosting the files to download)
BIOS> setenv rootpath "/tftpboot/root" (to boot linux over nfs)

You can use the dhcp command to configure these variable from your dhcp server. Probably you 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.3
BIOS> setenv serverip=192.168.0.5
BIOS> saveenv

Do not forget to save your changes in FLASH with saveenv to have them available at next power up. In case of troubleshoots you can use the script run flash_reset_env to reset the variables to the factory settings.

Linux kernel installation

First check your kernel size is smaller than the Armadeus kernel partition (ex 1MB) How ?????????????????????????? Load kernel image with u-boot through network:

   BIOS> tftpboot 08000000 pathtoyourhostedbuildrootdir/linux-kernel-2.6.12-arm.bin

or serial line:

   BIOS> loadb 08000000
   Ctrl+Altgr+\+c to access kermit command line then...
   send pathtoyourhostedbuildrootdir/linux-kernel-2.6.12-arm.bin
   the you can type the c command to reconnect to the terminal

Flash kernel image with:

   BIOS> run flash_kernel

!!! WARNING!! If the new kernel is too large, this operation can destroy data that is stored behind the kernel (e.g. rootfs) !!! Check that Bytes transferred = 1040676 (fe124 hex) value is less than 0xfffff  ????????????????????????,


Linux rootfs installation

Load rootfs image with u-boot through network:

   BIOS> tftpboot 08000000 pathtoyourhostedbuildrootdir/rootfs.arm_nofpu.jffs2

or serial line:

   BIOS> loadb 08000000
   Ctrl+Altgr+\+c to access kermit command line then...
   send pathtoyourhostedbuildrootdir/rootfs.arm_nofpu.jffs2

the 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

FPGA firmware installation

The FPGA firmwares are in the armadeus/software/firmware tree You can make some trials with the armadeus/software/firmware/ps2/ps2_top.bin file !!! check your file size is smaller than the firmware partition size (AKA 256KB)

Load FPGA firmware image file with u-boot through network:

   BIOS> tftpboot 08000000 pathtoyourhostedfirmwaredir/fpgafirmware.bin

or serial line:

   BIOS> loadb 08000000
   Ctrl+Altgr+\+c to access kermit command line then...
   C-Kermit> send pathtoyourhostedfirmwaredir/fpgafirmware.bin

then you can type the c command to reconnect to the terminal

Flash 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 tftpboot server:

   tftpboot 08000000 /tftpboot_path_to_buildroot/u-boot.bin

With ethernet and a nfs server:

   nfs 08000000 host_ip_addr:/nfs_path_to_buildroot/u-boot.bin

With the kermit and a serial line

   loadb 08000000
   <CTRL><ALT GR>\
   c
   send path_to_buildroot/u_boot.bin
   c
  • 2] Transfer code from RAM to Flash memory

There is a simple u-boot command/script to do that:

   run flash_uboot

advanced information can be found at the BootLoader wiki page.