Timesys Getting Started Guide for Samsung Arndale


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 Samsung Arndale.

Prerequisites

Host Requirements

To properly boot a board using software from Timesys, your host machine must meet the following requirements:

  • Modern GNU/Linux Distribution. While you can use nearly any modern Linux distribution released in the last 24 months, Timesys recommends one of the following:
    • Ubuntu (Most recent release or LTS)
    • Fedora (Most recent release)
  • An internet connection on the Development Host.
  • Root or sudo permission on the Development Host.
  • A copy of the Linux Kernel (uImage-3.12-ts-armv7l) 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.
  • If you are booting your root file system over the network, you will need two network cards installed and configured in the Development Host. One to communicate normally with your LAN/WAN while installing host packages, the other to communicate solely with the target board.
  • An available serial port on your Development Host.

Target Requirements

To boot the Samsung Arndale, you will need the following items:

  • Samsung Arndale Board
  • RS232 Straight Cable
  • MicroSD card
  • 5V Power Supply

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

  1. Connect the RS232 Cable to the CON7 port of the Samsung Arndale. Connect the other side to your host machine.
  2. Connect the power supply to your board.

Preparing the Target

Preparing the Secure Digital Card

The Arndale 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 a Linux partition 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 -uS /dev/sdX « EOF
    8192,,-
    EOF

  3. Format the first partition of the SD card with an ext4 filesystem using the mkfs.ext4 tool.

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

Writing Boot Files to the SD Card

We will write the bootloader, kernel, and rfs files to the SD card.

  1. Write the first stage bootloader, arndale-bl1.bin, to the SD card device.

    $ sudo dd if=arndale-bl1.bin of=/dev/sdX bs=512 seek=1
  2. Write the second stage bootloader, arndale-spl.bin, to the SD card device.

    $ sudo dd if=arndale-spl.bin of=/dev/sdX bs=512 seek=17
  3. Write u-boot, u-boot-dtb.bin, to the SD card device.

    $ sudo dd if=u-boot-dtb.bin of=/dev/sdX bs=512 seek=49
  4. Mount the SD Card 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/sdX1 /media/rfs
  5. Copy the root files system rootfs.tar.gz to the SD card.

    $ sudo tar xf rootfs.tar.gz -C /media/rfs
  6. Next, copy the kernel file to the boot directory on the SD card.

    $ sudo cp uImage-3.12-ts-armv7l /media/rfs/uImage-3.12-ts-armv7l
  7. Next, copy the dtb file to the boot directory on the SD card.

    $ sudo cp arndale.dtb /media/rfs/arndale.dtb
  8. As root, umount the SD Card.

    $ sudo umount /media/rfs
  9. Remove the SD Card from the host machine, and insert it into the SD Card slot on the target board.

Preparing the Host

No additional host setup is required to boot from SD.

Booting the Board

Set Environment Variables

You must set a few environment variables in order to boot the board from the SD card. This is done with the setenv and saveenv commands in U-Boot.

On the target, set the following environment variables:

Variable Value
bootargs console=ttySAC2,115200 rootfstype=ext4 rootwait root=/dev/mmcblk1p1 rw drm_kms_helper.edid_firmware=edid-1920x1080.fw
load_kernel ext2load mmc 1:1 40007000 uImage-3.12-ts-armv7l
load_dtb ext2load mmc 1:1 42000000 arndale.dtb
bootcmd mmc rescan\; run load_kernel load_dtb\; bootm 40007000 - 42000000

Example

> setenv bootargs console=ttySAC2,115200 rootfstype=ext4 rootwait root=/dev/mmcblk1p1 rw drm_kms_helper.edid_firmware=edid-1920x1080.fw
> setenv load_kernel ext2load mmc 1:1 40007000 uImage-3.12-ts-armv7l
> setenv load_dtb ext2load mmc 1:1 42000000 arndale.dtb
> setenv bootcmd mmc rescan\; run load_kernel load_dtb\; bootm 40007000 - 42000000
> saveenv

Load The Kernel

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

Example

> mmc rescan
> ext2load mmc 1:1 40007000 uImage-3.12-ts-armv7l
reading uImage-3.12-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 rescan
> ext2load mmc 1:1 42000000 arndale.dtb
reading arndale.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 40007000 - 42000000
## Booting kernel from Legacy Image at 40007000 ..
   Image Name:   Linux-3.12
   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 42000000
   Booting using the fdt blob at 42000000
   Loading Kernel Image ... OK
OK

Additional Information

Factory Documentation