Skip to content

Software Setup

brandonhamilton edited this page Nov 25, 2011 · 14 revisions

Note on upgrading

If you are upgrading from a previous version of the bootloader, all sections of the NAND will need to be reflashed due to a change in the ECC scheme used in the latest version.

Important changes from the previous version:

  1. The NAND driver now uses 1-bit Hardware ECC by default
  2. The serial console is now named ttyOn (instead of ttySn). This change is reflected in the kernel bootargs. The /etc/inittab file on the root filesystem should be modified accordingly.

USB Serial access

  1. Connect a usb cable between the USB port on the Rhino board and your computer. Download the FTDI Driver if necessary.
  2. Run a terminal program (e.g. minicom), set to 115200 8N1 with no flow control. Connect to the third serial device (/dev/ttyUSB2) that was created by the FTDI driver.

Bootloader

Download the X-Loader and U-boot binary files.

Booting from MMC card

  1. Format an SD/MMC card to allow for OMAP3 booting as described here: http://processors.wiki.ti.com/index.php/SD/MMC_format_for_OMAP3_boot
  2. Copy the X-Loader and U-boot binary files to the SD/MMC card from any computer, and then insert into the MMC slot on the Rhino
  3. Make sure the BOOT ORDER board jumpers are set to boot from MMC (SW1 = OFF, SW2 = ON). Turn on the power.

Booting from NAND flash

Once booted into u-boot from the MMC card, the bootloader can be written to the onboard NAND flash. Place the binary files on a TFTP server accessible by the Rhino board over the network.

Setting environment variables

  1. Select the correct ECC scheme
    nandecc hw 1

  2. Set the appropriate environment variables (change according to your own network setup)
    setenv ipaddr 192.168.0.2
    setenv netmask 255.255.255.0
    setenv serverip 192.168.0.1
    setenv gatewayip 192.168.0.254

  3. Note: You may need to set a MAC address for the board if the u-boot environment does not have one (you might see a message such as ERROR: 'ethaddr' not set). To do so, run the 'tools/gen_eth_addr' program found in the u-boot directory to obtain an address, and then apply it u-boot:
    setenv ethaddr <insert_address_here>

  4. Save the environment variables
    saveenv

Writing X-Loader to NAND flash

  1. Erase all data in RAM
    mw.b 0x82000000 0xff 0x2000000
  2. Erase NAND area for X-Loader
    nand erase 0x0 0x50000
  3. Copy X-Loader binary into memory over tftp
    tftp 0x82000000 MLO
  4. Set the NAND ECC scheme
    nandecc hw 2
  5. Write X-Loader into NAND flash
    nand write 0x82000000 0x0 0x50000

Writing U-boot to NAND flash

  1. Erase all data in RAM
    mw.b 0x82000000 0xff 0x2000000
  2. Erase NAND area for U-boot
    nand erase 0x80000 0x1C0000
  3. Copy U-boot binary into memory over tftp
    tftp 0x82000000 u-boot.bin
  4. Set the NAND ECC scheme
    nandecc hw 2
  5. Write U-boot into NAND flash
    nand write 0x82000000 0x80000 0x1C0000

BORPH kernel

Download the BORPH kernel and Root filesystem binary files. Place them on the TFTP server for access from Rhino

Write the kernel into NAND flash

  1. Erase all data in RAM
    mw.b 0x82000000 0xff 0x2000000
  2. Erase NAND area for kernel
    nand erase 0x280000 0x500000
  3. Copy kernel image into memory over tftp
    tftp 0x82000000 uImage
  4. Set the NAND ECC scheme
    nandecc hw 1
  5. Write U-boot into NAND flash
    nand write 0x82000000 0x280000 0x500000

Copy Root filesystem to NAND flash

  1. Erase all data in RAM
    mw.b 0x82000000 0xff 0x2000000
  2. Erase NAND area for filesystem
    nand erase 0x780000 0x2000000
  3. Copy filesystem into memory over tftp
    tftp 0x82000000 rhinofs.jffs2
  4. Set the NAND ECC scheme
    nandecc hw 1
  5. Write filesystem into NAND flash
    nand write 0x82000000 0x780000 0x2000000

Setting boot parameters

  1. Set the boot parameters for the kernel in u-boot
    setenv nandargs 'setenv bootargs mem=256M console=ttyO0,115200n8 noinitrd root=/dev/mtdblock4 rw rootfstype=jffs2 ip=\${ipaddr}:\${serverip}:\${gatewayip}:\${netmask}:rhino:eth0:on'

    `setenv nfsargs 'setenv bootargs mem=256M console=ttyO0,115200n8 noinitrd ip=\${ipaddr}:\${serverip}:\${gatewayip}:\${netmask}:rhino:eth0:on rw root=/dev/nfs nfsroot=\${serverip}:/opt/rhinofs,nolock panic=2'`  
    
    `setenv nfsboot 'echo Booting from nfs ...; run nfsargs; nand read \${loadaddr} 280000 400000; bootm \${loadaddr}'`
    
  2. Set the default boot commands
    setenv bootcmd 'run nandargs; nand read.i 0x82000000 280000 500000; bootm 0x82000000'
    setenv bootdelay 10
    setenv bootkernel
    setenv bootkernel_1

  3. Save the boot parameters
    nandecc hw 1
    saveenv

Booting from NAND

  1. Make sure the BOOT ORDER board jumpers are set to boot from NAND (SW1 = OFF, SW2 = OFF). Turn the power off and back on.
  2. By default, the board will boot from the root filesystem contained on the NAND. If you wish to boot the filesystem over NFS, ensure the environment settings match your NFS configuration (by default assumes the filesystem is exported at /opt/rhinofs). Interrupt the boot process and run nfsboot.

Login and access

The default username/password is: root/rhino

By default, the root filesystem will start an openssh server on startup. Connect to the Rhino board over the network from your computer
ssh [email protected]