Timesys Getting Started Guide for Marvell 88PA6270


Contents

Introduction

This document will describe in detail the procedures for booting a Linux kernel image and mounting a root file system from an SD Card on the Marvell 88PA6270.

Prerequisites

Host Requirements

To properly boot the Marvell 88PA6270 using software from Timesys, your host machine must meet the following requirements:

  • Modern GNU/Linux Distribution. Timesys recommends one of the following distributions:
    • Ubuntu (Most recent release or LTS)
    • Fedora (Most recent release)
  • Root or sudo permission on the Development Host.
  • A copy of the Linux Kernel (uImage-4.2-ts-armv7l), bootloader files, and Root File System (rootfs.tar.gz) for the Target Board downloaded from Factory. These are found in the output directory of your online build, or in the directory build_armv7l-timesys-linux-<libc>/images/ on the command line.
  • A microSD card slot or adapter on your Development Host.

Target Requirements

To boot the Marvell 88PA6270, you will need the following items:

  • Marvell 88PA6270
  • USB TTL Serial Cable (Such as the FTDI TTL-232RG-VIP-WE)
  • microSD Card
  • 5V Power Supply

Once you have all of the necessary components, you should perform the following steps:

  1. Connect the USB TTL serial cable to J12. The following connections are relevant:
    Pin Color Function
    1 Orange TX
    2 Black GND
    3 Red VCC
    4 Yellow RX
  2. Set aside the microSD card, you will need to intialize it from the Development Host before booting the board.

Preparing the Target

Configuring Serial Communication

The pa6270 uses a serial debug port to communicate with the host machine. The commands discussed in this section are meant to be performed by a privileged user account. This requires the root login or prepending each command with sudo.

Using Minicom

  1. Start minicom on your host machine in configuration mode. As root:

    # minicom -o -s -w

  2. A menu of configuration should appear. Use the Down-arrow key to scroll down and select the Serial port setup option, and press Enter.
  3. Verify that the listed serial port is the same one that is connected to the target board. If it is not, press A, and enter the correct device. This is /dev/ttyUSB0 on most Linux distributions.
  4. Set the Bps/Par/Bits option by pressing the letter E and using the next menu to set the appropriate values. You press the key that corresponds to the value 115200, then press Enter.
  5. Set Hardware flow control to No using the F key.
  6. Set Software flow control to No using the G key.
  7. Press Enter to return to the main configuration menu, and then press Esc to exit this menu.
  8. Reset the board, and wait for a moment. If you do not see output from the board, press Enter several times until you see the prompt. If you do not see any output from the board, and have verified that the serial terminal connection is setup correctly, contact your board vendor.

TIP: If you experience an error similar to Device /dev/ttyUSB0 is locked when starting minicom, it usually means that another process is using the serial port (which is usually another instance of minicom). You can find the process that is currently using the serial port by executing the following:

# fuser /dev/ttyUSB0
/dev/ttyUSB0:         28358

# ps 28358
  PID TTY      STAT  TIME COMMAND
  28923 pts/0    S+    0:00 minicom

This process can also be killed directly with fuser as root. Please use this command with caution:

# fuser -k /dev/ttyUSB0

Using GNU Screen

To quickly connect to a board using Gnu Screen, execute the following:

# screen /dev/ttyUSB0 115200

For more information about using screen, please consult the man page, or view the manual online at http://www.gnu.org/software/screen/manual/screen.html

Preparing the Secure Digital Card

The pa6270 boots from an SD card. Some kits may be shipped with one that contains a sample kernel and RFS preloaded. We will be replacing these with the kernel and RFS from Factory. If you are using a blank SD card or have trouble replacing the software on the preloaded one, see Partitioning the SD Card. Otherwise, skip directly to Writing Boot Files to the SD Card. Before you begin, you should determine the name of your SD card on your host system. To do so:
  1. Connect the SD card to your host system. Many modern systems have SD card slots on the case, or you can purchase a USB SD Card Reader for around $15 US.
  2. Determine the device name of the SD Card. This can be done using dmesg. In the following example, the device is /dev/sdX, which contains one partition sdX1.
    $ dmesg | tail
    [88050.184080] sd 4:0:0:0: [sdX] 1990656 512-byte hardware sectors: (1.01 GB/972 MiB)
    [88050.184821] sd 4:0:0:0: [sdX] Write Protect is off
    [88050.184824] sd 4:0:0:0: [sdX] Mode Sense: 03 00 00 00
    [88050.184827] sd 4:0:0:0: [sdX] Assuming drive cache: write through
    [88050.185575] sd 4:0:0:0: [sdX] 1990656 512-byte hardware sectors: (1.01 GB/972 MiB)
    [88050.186323] sd 4:0:0:0: [sdX] Write Protect is off
    [88050.186325] sd 4:0:0:0: [sdX] Mode Sense: 03 00 00 00
    [88050.186327] sd 4:0:0:0: [sdX] Assuming drive cache: write through
    [88050.186330]  sdX: sdX1

Partitioning the SD card

If you want to use a different SD card or its contents become corrupted, you can use the sfdisk tool to create the partition layout on your SD card. Please note that all data on the card will be lost upon completion of these steps.
  1. Unmount the partition if it was automounted by using the umount command.
    $ umount /dev/sdX1
  2. As root, run the following sfdisk command on the drive.

    $ sudo sfdisk $target < bootloader/part_table

  3. Place the NTIM binary onto the SD card at location 0x200.

    $ sudo dd if=bootloader/ntim.bin of=sdX bs=1 seek=$((0x200))

  4. Place the MiniLoader binary onto the SD card at location 0xA00.

    $ sudo dd if=bootloader/miniloader.bin of=sdX bs=1 seek=$((0xa00))

  5. Place the U-Boot binary onto the SD card at the location of the first partition.

    $ sudo dd if=bootloader/u-boot.bin of=sdX1

  6. Format the second partition of the SD card with an ext4 filesystem using the mkfs.ext4 tool.

    $ sudo /sbin/mkfs.ext4 -L rfs /dev/sdX2

Writing Boot Files to the SD Card

  1. Mount the partition. You can remove and reinsert the card to trigger the automount, or you can use the mount command to mount the partition to an arbitrary location.

    $ sudo mount /dev/sdX2 /media/rfs

  2. As root, extract the rootfs.tar.gz archive to the RFS partition.

    $ sudo tar xzf rootfs.tar.gz -C /media/rfs

  3. Copy the kernel image into the ext4 partition. Do the same for the device tree.

    $ sudo cp uImage-4.2-ts-armv7l /media/rfs/
    $ sudo cp 88pa6270.dtb /media/rfs/

  4. Unmount the partition before removing the card from the Development Host. Then place the card in the SD slot on the pa6270.

    $ sudo umount /dev/sdX2

Preparing the Host

No additional host setup is required to boot from microSD.

Booting the Board

Load The Kernel

You can use the mmc subsystem to load the kernel from the SD card.

Example

> mmc dev 2
> ext2load mmc 2:2 0x400000 uImage-4.2-ts-armv7l
reading uImage-4.2-ts-armv7l

3008612 bytes read

Load The Device Tree

You can use the mmc subsystem to load the device tree file (dtb) from the SD card.

Example

> mmc dev 2
> ext2load mmc 2:2 0xf00000 88pa6270.dtb
reading 88pa6270.dtb

24612 bytes read

Boot the Kernel

The bootm command is used to boot the kernel. It loads the file that was previously loaded using the ext2load command.

Example

> bootm 0x400000 - 0xf00000
## Booting kernel from Legacy Image at 0x400000 ..
   Image Name:   Linux-4.2
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3008548 Bytes =  2.9 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
## Flattened Device Tree blob at 0xf00000
   Booting using the fdt blob at 0xf00000
   Loading Kernel Image ... OK
OK

Additional Information

Factory Documentation