Linux on the i.MX6 sabre sd platform in a few commands
来源:互联网 发布:产品效果图制作软件 编辑:程序博客网 时间:2024/06/11 05:36
Linux on the i.MX6 sabre sd platform in a few commands
Here is a quick summary at booting Linux on the i.MX 6 sabre sd platform.
This assumes you already have u-boot working on your platform as described here. This implies you already have a "working" Linux development environment with some ARM cross-compilers at hand (e.g. Debian +Emdebian).
Get Linux sources
We will use git to fetchLinux sources:
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
This should create a linux directory with all the latest sources (after a while).
Note that for more stability you might want to checkout a release instead of the latest version; to do so, list the available release tags with e.g. git tag -l 'v3.*', and git checkout <the-desired-tag>.
Compile
Assuming your cross compiler is called e.g. arm-linux-gnueabihf-gcc, you can compile by doing:
$ cd linux
$ export ARCH=arm
$ export CROSS_COMPILE=arm-linux-gnueabihf-
$ make imx_v6_v7_defconfig
$ make
$ make uImage
This should create a number of files, including arch/arm/boot/uImage and arch/arm/boot/dts/imx6q-sabresd.dtb.
Put on SD
We need a proper FAT partition on the SD card, from which u-boot will be able to load the kernel and dtb. Also, we need to make sure we leave some space foru-boot starting from offset 1024B. Here is an example SD card layout:
+-----+------+--------+-----+----------------
| MBR | ... | u-boot | ... | FAT partition ...
+-----+------+--------+-----+----------------
0 512 1024 1M
(offsets in bytes)
Here is an example SD card layout, as displayed by fdisk:
Device Boot Start End Blocks Id System
/dev/sdc1 2048 8054783 4026368 c W95 FAT32 (LBA)
(units: 512B sectors)
You can format the FAT partition, mount, copy and unmount with:
$ mkfs.vfat /dev/<your-sd-card-first-partition>
$ mount /dev/<your-sd-card-first-partition> /mnt
$ umount /mnt
Your SD card first partition is typically something in/dev/sd<X>1 or/dev/mmcblk<X>p1. Note that you need write permissions on the SD card for the command to succeed, so you might need to su - as root, or use sudo,or do achmod a+w asroot on the SD card device node to grant permissions to users.
Boot!
That's it; u-boot already knows how to deal with your kernel by default so you are good to go.Insert the SD card into the SD card slot of your i.MX6 sabre sd platform, connect to the USB to UART port with a serial terminal set to 115200 baud, no parity, 8bit data and power up the platform. You should see u-boot messages:
U-Boot 2013.07-rc1-00014-g74771f4 (Jun 21 2013 - 16:27:39)
u-boot should load theuImage and dtb from SD card and boot the kernel:
(...)
reading uImage
4215344 bytes read in 449 ms (9 MiB/s)
Booting from mmc ...
reading imx6q-sabresd.dtb
22818 bytes read in 22 ms (1012.7 KiB/s)
## Booting kernel from Legacy Image at 12000000 ...
Image Name: Linux-3.10.0-rc6
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4215280 Bytes = 4 MiB
Load Address: 10008000
Entry Point: 10008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 11000000
Booting using the fdt blob at 0x11000000
Loading Kernel Image ... OK
OK
Using Device Tree in place at 11000000, end 11008921
Starting kernel ...
The kernel should boot:
Booting Linux on physical CPU 0x0
Linux version 3.10.0-rc6 (vstehle@debian) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP Fri Jun 21 18:09:26 CEST 2013
By default, the kernel will try to mount a root filesystem from the SD card second partition, as can be read in the default kernel command line:
(...)
Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk1p2 rootwait rw
...but we did not prepare a root filesystem partition, so after a number of boot messages the kernel will wait indefinitely:
(...)
mmc1: new SDHC card at address b368
(...)
mmcblk0: p1
(...)
Waiting for root device /dev/mmcblk1p2...
We will see in another post how to prepare this root filesystem on the second SD card partition. Enjoy!
See also...
- If you plan to compile Linux often, you might want to use a C compiler cache; seethis post.
- Once you have Linux booting on your platform the next step is to give it a root filesystem. Seethis post for a Debian root filesystem, and this post for a minimal busybox filesystem.
- Linux on the i.MX6 sabre sd platform in a few commands
- Linux on the i.MX6 sabre sd platform in a few commands
- I.MX6 SABRE SD L3.0.35
- Here are a few guidelines to keep in mind regarding C data types on the C6000?
- A few game in Linux terminal operation
- The useful commands in linux
- A few notes about the CommDb (use in Symbian OS)
- Linaro on Freescale i.MX6Q Sabre Lite Board
- How can I run Perl system commands in the background
- linux build-in commands && become root on Ubuntu
- OpenJFX on Freescale i.MX6----QT4.8.5 x11 base
- Hadoop Platform as a Service in the Cloud
- The steps on install the VMware Tools in a linux Guest.
- How to compile VLC on Linux Platform (From the authority)
- arm-linux-gcc compile the cross-platform mpich2 on ubuntu
- Enabling Software BCH ECC on a Linux Platform
- Some linux commands I used
- nmake.exe - builds projects based on commands contained in a description file.
- android BroadcastReceiver学习
- window server2003开机提示系统启动时至少有一个服务或驱动程序产生错误
- 强连通分支及kosaraju算法
- 对电子产品代工企业向研发转型的看法
- JDOM操作XML
- Linux on the i.MX6 sabre sd platform in a few commands
- hdu 4081 Qin Shi Huang's National Road System (最小生成树变形 两种解法 1.Prim 2.dfs)
- Matlab的text显示变量
- js table鼠标移动高亮显示
- uva 10340 All in All
- 非静态的字段,方法或属性。。。。。。要求对象引用
- Android修炼之路
- 使用JDK自带jvisualvm监控tomcat
- stack overflow的问题