Booting a Linux Kernel Natively on the J6

Back to Xen J6 Main Page

Overview
This wiki describes how to boot a 3.14 Linux kernel natively (without virtualization) onto the J6 board. For booting a virtualized Linux kernel with Xen, see Booting with Xen on the J6.

Prerequisites
Your system must be setup according to the method outlined in Xen J6 System Setup.

System Overview
These instructions were run and tested with the following software and hardware:
 * Board: J6 Eco
 * Chip: DRA72x
 * Laptop OS: Ubuntu 12.04 (64-bit)
 * Board OS: Ubuntu 14.04 (32-bit)
 * Cross-Compiler GCC Version: 4.6.3


 * UBoot:
 * Version: 2014.07-dirty
 * Release: 6AL.1.0
 * Linux Kernel:
 * Version: 3.14
 * Release: 6AL.1.0

For reference, we assume that the following environment variables are defined:

Build U-Boot
Build the U-Boot software:

Build Linux
Build the Linux 3.14 kernel and the ARM device tree for J6:

Setup the Serial Console
As discussed in Setup Serial Console, we need to make sure that the ttyO0 console service is enabled, and the hvc0 console service is disabled:

Create the SD Card Image
Insert some micro SD card into your computer. For reference, we assume the root filesystem partition is mounted at /media/rootfs, and the boot partition is mounted at /media/boot, but this can vary based on your settings.

Copy the uboot image to the flash card:

Copy the Linux kernel and device tree to the flash card:

Copy the core filesystem over:

Unmount the SD card paritions:

Boot the System
To communicate with the J6 board, we need to setup a serial console between our host machine and the board. Insert a micro USB into the J1 connector. This is located right next to the PWR_CYCLE button (SW9), and near the power supply for the board.

Depending on the setup of your system, the J6 board may appear as a different numbered USB device, but it will be /dev/ttyUSB, followed by some integer. For reference, we're going to say that the USB is mounted at /dev/ttyUSB0.

Create a serial console on your machine:

On the J6 board press the PWR_RESET button (SW4) to reset the system and begin the boot. From the serial console, hit any key to prevent automatic booting.

Enter the following commands on the Minicom serial console to boot:

You should know see printk messages from the kernel, and eventually you should be prompted for login. Simply type root as the username to login.

Automatic Booting
It can quickly become very tedious to enter all of those commands every time you want to boot the kernel, especially if you're doing rapid development. Fortunately, U-Boot provides methods for overriding the default boot commands.

One such method is to specify the appropriate environment variables in a file called uEnv.txt on the boot partition of the SD card. During boot, the U-Boot will read from this file and override any environment variables saved in persistent memory. Unfortunately, this method does not work with the current U-Boot and J6 board configuration.

Instead, a one-time overwriting of the environment variables in persistent memory can be performed. After overwriting, U-Boot will then run the new boot commands for every subsequent automatic boot. U-Boot has a special environment variable, bootcmd, that contains the command that it will run when performing an automatic boot. This is the variable that must be modified to enable automatic booting.

U-Boot has several other special environment variables, such as bootargs, which are passed to the kernel once U-Boot has finished bootstrapping.

Enter the following commands in a Minicom serial console (after resetting the system and stopping automatic booting):

linux_boot.script

Then, reset the system by hitting the reset button. Now, everytime you boot, it should automatically boot the Linux kernel.