Introduction
This article provides an introduction on how to install the Linux kernel and the example root filesystem image on the CompuLab CL-SOM-AM57x System-on-Module / Computer-on-Module eMMC internal storage using one of the following sources:
- SD card
- USB storage device
- Network interface
Preparation steps
- Obtain a PC workstation with a serial communication port.
- Download the Linux package for CL-SOM-AM57x from CompuLab website. Unzip the package to a directory on your host workstation.
- All image files mentioned below can be found in the install subdirectory.
- Connect the host PC to the SBC-AM57x base-board (connector P8) via the serial cable supplied with the evaluation kit.
|
For networked installation you need to install a TFTP and NFS servers on the host PC
|
Preparing installation media
- Obtain an SD card or USB storage with minimum capacity of 1GB.
- Create a first partition on the installation media. The partition can be formatted either ext2/3/4 or FAT16/32 file system.
- Copy the content of the install directory from the unzipped Linux package to the root directory on the first partition of the installation media.
|
Installation storage media must contain a partition table. Use fdisk (or alike) utility to create a partition table.
|
|
For networked installation
- Connect the CL-SOM-AM57x Ethernet port (connector P21 on the SBC-AM57x) to your local network using the standard Ethernet cable.
- Make sure the dedicated TFTP server as well as NFS server (may be the same machine) are connected to the local network too.
- Copy the content of the install directory from the unzipped Linux package in a location accessible by the TFTP server.
- Copy the content of the install directory from the unzipped Linux package to a directory exported through NFS.
|
Boot into the installation environment (ramdisk)
- Start terminal emulation software on your PC with the following serial port settings:
Baud Rate
|
Data Bits
|
Stop Bits
|
Parity
|
Flow Control
|
115200
|
8
|
1
|
none
|
none
|
- Insert the installation media into the MMC/SD socket (P9) or USB connector (P6) on the SBC-AM57x.
- Make sure no other removable media is plugged.
- Turn on the device. Press a key to prevent a possible autoboot and get into the U-Boot command prompt.
|
If the boot settings of your device are different than the default, you may need to press and hold Ctrl-C while turning the device on, in order to get command prompt.
|
- Use the following U-Boot commands to boot the installation environment from the installation SD card:
U-Boot# mmc dev 0 && mmc rescan
U-Boot# load mmc 0 0x88000000 ramdisk.dtb && load mmc 0 0x82000000 kernel.img && load mmc 0 0x88080000 ramdisk.img
U-Boot# setenv bootargs "root=/dev/ram0 rw ramdisk_size=16384 console=ttyO2,115200n8 vram=16M"
U-Boot# bootz 0x82000000 0x88080000 0x88000000
- Use the following U-Boot commands to boot the installation environment from the installation USB storage:
U-Boot # usb start
U-Boot # load usb 0 0x88000000 ramdisk.dtb && load usb 0 0x82000000 kernel.img && load usb 0 0x88080000 ramdisk.img
U-Boot # setenv bootargs "root=/dev/ram0 rw ramdisk_size=16384 console=ttyO2,115200n8 vram=16M"
U-Boot # bootz 0x82000000 0x88080000 0x88000000
|
For networked installation
Use the following U-Boot commands to boot the installation environment from a TFTP and NFS servers:
U-Boot# dhcp; setenv serverip <tftp server ip address>
U-Boot# setenv bootargs "root=/dev/ram0 rw ramdisk_size=16384 console=ttyO2,115200n8 vram=16M ip=dhcp"
U-Boot# tftpboot 0x88000000 ramdisk.dtb; tftpboot 0x82000000 kernel.img; U-Boot# tftpboot 0x88080000 ramdisk.img
U-Boot# bootz 0x82000000 0x88080000 0x88000000
|
Mount installation source
- Use the following mount command to mount the installation SD card.
- The character X should be replaced with the SD card device block number:
root@cl-ramdisk:~# mkdir -p /media/install && mount /dev/mmcblkXp1 /media/install
- Use the following mount command to mount the installation USB storage.
- The character X should be replaced with the USB drive letter
root@cl-ramdisk:~# mkdir -p /media/install && mount /dev/sdX1 /media/install
|
For networked installation
- Copy the content of the install directory from the unzipped Linux package to a directory exported through NFS.
- Mount the NFS share:
root@cl-ramdisk:~# ifup eth1
root@cl-ramdisk:~# mkdir -p /media/install && mount -o nolock <host ip>:/path/to/nfs/share /media/install
|
Install Images
- Unmount all eMMC partitions:
root@cl-ramdisk:~# umount -l /dev/mmcblk0p*
root@cl-ramdisk:~# dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=1
root@cl-ramdisk:~# hdparm -z /dev/mmcblk0
- Create two partitions for the Linux kernel (EXT2 100M) and root file system (EXT4 the rest of the disk) on the eMMC flash:
root@cl-ramdisk:~# echo -e "n\np\n1\n\n+100M\nn\np\n2\n\n\nw\neof\n" | fdisk /dev/mmcblk0
- Format the first partition with EXT2 file system:
root@cl-ramdisk:~# mkfs.ext2 -L boot /dev/mmcblk0p1
- Format the second partition with EXT4 file system:
root@cl-ramdisk:~# mkfs.ext4 -L rootfs /dev/mmcblk0p2
root@cl-ramdisk:~# mkdir -p /media/boot && mount /dev/mmcblk0p1 /media/boot
root@cl-ramdisk:~# mkdir -p /media/rootfs && mount /dev/mmcblk0p2 /media/rootfs
- Copy zImage-cl-som-am57x and *.dtb to the first (EXT2) partition:
root@cl-ramdisk:~# cp /media/install/zImage-cl-som-am57x /media/install/*.dtb /media/boot && sync
- Extract the content of rootfs.tar.bz2 onto the second partition:
root@cl-ramdisk:~# tar --numeric-owner -xpf /media/install/rootfs.tar.bz2 -C /media/rootfs && sync
root@cl-ramdisk:~# umount /dev/mmcblk0p1
root@cl-ramdisk:~# umount /dev/mmcblk0p2
After Installation
- Remove the installation media and reboot the device
- Press a key to prevent a possible autoboot and get into the U-Boot command prompt.
- Set default U-Boot environment:
U-Boot# env default -a
- Select the eMMC as the boot storage
U-Boot# setenv bootcmd 'run emmcboot'
Select video output
CL-SOM-AM57x evaluation platform (SBC-AM57x) has four video output interfaces: LCD, DVI, LVDS and HDMI. Current version of Xorg driver of CL-SOM-AM57x example root file system supports mirror video output mode only. It causes last registered video output device (LCD) resolution to be propagated to other devices.
In order to force a specific video output device to be selected as a primary device the U-Boot environment variables should be adjusted.
- To enable HDMI video output:
U-Boot# setenv displaytype hdmi
- To enable LCD video output:
U-Boot# setenv displaytype lcd
- To enable LVDS video output:
U-Boot# setenv displaytype lvds
- To enable DVI video output:
U-Boot# setenv displaytype dvi
Boot the module
U-Boot # saveenv
U-Boot # reset
See also