...
Info | ||
---|---|---|
| ||
$ make ARCH=arm CROSS_COMPILE=${CC} distclean $ make ARCH=arm CROSS_COMPILE=${CC} smarct335x_evm_uart3_defconfig $ make ARCH=arm CROSS_COMPILE=${CC} |
Note | ||
---|---|---|
| ||
The uartx in u-boot config (defconfig) file is to specify the debug console outputs. |
Linux Kernel
...
Download:
For 3.2 (AMSDK6, Stable, LTS release):
...
Info | ||||
---|---|---|---|---|
| ||||
optargs="consoleblank=0 mem=512M" loadaddr=0x82000000 initrd_high=0xffffffff loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${kernel_file} ##Un-comment to enable systemd in Debian Wheezy console=ttyO3,115200n8 mmcargs=setenv bootargs console=${console} root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs} #zImage: #zImage + uInitrd: where uInitrd has to be generated on the running system. ###Begin Rootfs from NFS ###Begin Load kernel from TFTP |
Note |
---|
For kernel 3.14.y and after, the serial port device descriptor changes from ttyO to ttyS The above uEnv.txt file needs to change accordingly. (ttyO3 --> ttyS3) SD card will always be emulated as /dev/mmcblk1 at kernel 3.12 and newer version |
Copy uEnv.txt to the boot partition:
...
Info | ||||
---|---|---|---|---|
| ||||
$ sudo tar xvfz smarct335x-rootfs-image-smarct335x-sdk6.tar.gz -C /media/rootfs |
Ubuntu 1214.04:
Info | ||||
---|---|---|---|---|
| ||||
$ sudo tar xvfzubuntu smarc-12 ubuntu14.04-minimal-armhf-2012-11-29 .tar.gz -C /media/rootfs |
Copy Kernel Modules:
Info | ||||
---|---|---|---|---|
| ||||
$ sudo make ARCH=arm INSTALL_MOD_PATH=/media/rootfs modules_install |
...
Info | ||
---|---|---|
| ||
$ sync $ sudo umount /media/boot $ sudo umount /media/rootfs |
Note | ||
---|---|---|
| ||
If your rootfs is ubuntu, before un-mounting it, check /media/rootfs/etc/fstab to see if the mounting point is /dev/mmcblk1p2 and /media/rootfs/etc/init/serial.conf to see if your console port device descriptor correct or not. |
Setup eMMC
...
Setting up eMMC usually is the last step at development stage after the development work is done at your SD card or NFS environments. From software point of view, eMMC is nothing but a non-removable SD card on board. When booting from eMMC and SD card is present, SD card is emulated as /dev/mmcblk0 and eMMC is emulated as /dev/mmcblk1. On the other hand, when booting from eMMC and SD card is absent, eMMC will be on module will be always emulated as /dev/mmcblk0 now. eMMC could be /dev/mmcblk0 or /dev/mmcblk1 depending on if SD card is inserted and the boot device become dynamic when booting from eMMC.
Initramfs is the successor of initrd and has many advantages over initrd. Linux kernel here will mount it as a temperately rootfs and starts the init process from here. The init script will check if the partition 2 of eMMC is exist and them mount the real rootfs.
Setting up eMMC now is nothing but changing the device descriptor.
This section gives a step-by-step procedure to setup eMMC flash. Users can write a shell script your own at production to simplify the steps.
Get initramfs (assuming the home directory is /home/developer here)
Info | ||
---|---|---|
| ||
$ cd ~/ $ wget http://developer.embedian.com/download/attachments/2883656/initramfs.tar.gz $ mkdir initramfs $ sudo tar xvfz initramfs.tar.gz -C initramfs/ |
Note: Regarding to how to generate initramfs, users can refer to Yocto build.
Prepare for initramfs zImage
Info | ||
---|---|---|
| ||
$ cd <kernel source directory> $ export CC=/opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin/arm-linux-gnueabihf- $ make ARCH=arm CROSS_COMPILE=${CC} smarc_t335x_defconfig $ make ARCH=arm CROSS_COMPILE=${CC} menuconfig |
Select
General setup -->
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
() Initramfs source file(s)
Enter the directory where your initramfs is. In this example
/home/developer/initramfs
Save the kernel config.
Build for kernel 3.2:
Info | ||
---|---|---|
| ||
$ make ARCH=arm CROSS_COMPILE=${CC} uImage modules |
Build for kernel 3.12.y or later:
Info | ||
---|---|---|
| ||
$ make ARCH=arm CROSS_COMPILE=${CC} zImage modules am335x-smarct335x.dtb |
...
First, we need to backup the final firmware from your SD card or NFS.
Prepare for eMMC binaries from SD card (or NFS):
Insert SD card into your Linux PC. For these instructions, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
For these instruction, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
Info | ||
---|---|---|
| ||
$ export DISK=/dev/mmcblk0 |
Mount Partitions:
On some systems, these partitions may be auto-mounted...
Info | ||
---|---|---|
| ||
$ sudo mkdir -p /media/boot/dtbs $ sudo mkdir -p /media/rootfs/ for : DISK=/dev/mmcblk0 $ sudo mount ${DISK}p1 /media/boot/ $ sudo mount ${DISK}p2 /media/rootfs/ for : DISK=/dev/sdX $ sudo mount ${DISK} 1 /media/boot/ $ sudo mount ${DISK} 2 /media/rootfs/ |
Copy MLO zImage to rootfs partition:
Info | ||
---|---|---|
| ||
$ sudo cp -v /media/boot/MLO zImage /media/rootfs/home/root |
Copy u-boot.img to rootfs partition:
Info | ||
---|---|---|
| ||
Note | ||
| ||
|
Copy initramfs zImage to rootfs partition:
...
Info | ||
---|---|---|
| ||
optargs="consoleblank=0 mem=512M" #To boot old v3.2.x based kernel enable: (SMARC T335X and BeagleBone) #For u-boot 13.10 ###Begin Rootfs from NFS ###Begin Load kernel from TFTP |
...
Info | ||
---|---|---|
| ||
optargs="consoleblank=0 mem=512M" loadaddr=0x82000000 initrd_high=0xffffffff loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${kernel_file} ##Un-comment to enable systemd in Debian Wheezy console=ttyO3,115200n8 mmcroot=/dev/ram0 console=${console} root=${mmcroot} initramfs=0x81000000, 8M #zImage + uInitrd: where uInitrd has to be generated on the running system. ###Begin Rootfs from NFS ###Begin Load kernel from TFTP |
Note |
---|
For kernel 3.14.y and after, the serial port device descriptor changes from ttyO to ttyS The above uEnv.txt file needs to change accordingly. (ttyO3 --> ttyS3) The uEnv.txt file only changes mmcroot from /dev/mmcblk1 (SD) to /dev/mmcblk0 (eMMC) |
Copy real rootfs to rootfs partition:
...
Now it will be almost the same as you did when setup your SD card, but the eMMC device descriptor is /dev/mmcblk1 mmcblk0 now.
Info | ||
---|---|---|
| ||
$ export DISK=/dev/mmcblk1mmcblk0 |
Erase SD card:
Info | ||
---|---|---|
| ||
$ |
...
In SDK6, Arago rootfs will mount partition2 as /media/mmcblk1p2 mmcblk0p2 automatically after executing the above command. Umount the partition first.
Info | ||
---|---|---|
| ||
$ |
Format Partitions:
Info | ||
---|---|---|
| ||
$ sudo mkfs.vfat -F 16 ${DISK}p1 -n boot $ sudo mkfs.ext4 ${DISK}p2 -L rootfs |
...
Unmount eMMC:
Info | ||
---|---|---|
| ||
$ sync $ sudo umount /media/boot $ sudo umount /media/rootfs |
Note |
---|
If your rootfs id Ubuntu, you need to modify /media/rootfs/etc/fstab and change the mount point from /dev/mmcblk1p2 to /dev/mmcblk0p2 before un-mounting it. |
Switch your Boot Select to eMMC and you will be able to boot up from eMMC now.
Last updated 2015-10-22