Twitter E-mail RSS
formats

Building a kernel 3.13-rc4 for the imx23-olinuxino

This is kernel 3.13-rc4 build for imx233-olinuxino boards. Build contain patches for i2c support. Mainline kernel missing audio, video and power management driver for i.MX23 SoC.

Hardware requirements

SD card with two partition:

  • boot partition for kernel, and –
  • rootfs partition with your prefered linux distribution.

See Make bootable SD-Card for instructions how to make card with two partition.

Getting the code

$: git clone -b 3.13-rc4  https://github.com/koliqi/imx23-olinuxino

This package contain:

Freescale imx-bootlets, utility elftosb2 and respective patches for imx23-board.

Freescale imx-bootlets and utility elftosb2 are from Freescale package L2.6.31_10.05.02_ER_source.
Utility elftosb2 is distributed in binary form. Sources can be found at the following link:
http://repository.timesys.com/buildsources/e/elftosb/elftosb-10.12.01/

I. Building a kernel from sources

Switch into directory kernel and download kernel sources:

$: cd imx23-olinuxino/kernel
$: wget https://www.kernel.org/pub/linux/kernel/v3.x/testing/linux-3.13-rc4.tar.bz2
$: tar xvjf linux-3.13-rc4.tar.bz2
$: mv linux-3.13-rc4  linux-mainline

Switch into directory linux-mainline to apply  i2c patches for imx23-olinuxino board.

$: cd linux-mainline
$: patch -p1 <../0001-ARM-imx23-olinuxino-Add-i2c-support.patch

Configure kernel

Start from supplied default mxs_defconfig configuration:

$: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- mxs_defconfig
$: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig

Select Boot options —> and select following options:

[*] Use appended device tree blob to zImage (EXPERIMENTAL)
[*] Supplement the appended DTB with traditional ATAG information
(console=ttyAMA0,115200 root=/dev/mmcblk0p2 rw rootwait) Default kernel command string

Save and exit from menuconfig application.

Compile kernel

$: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- zImage modules

Kernel is ready at arch/arm/boot/zImage.

Create device tree blob .dtb file:

$: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- imx23-olinuxino.dtb

Join zImage and imx23-olinuxino.dtb into a new file zImage_dtb:

$: cat arch/arm/boot/zImage arch/arm/boot/dts/imx23-olinuxino.dtb > arch/arm/boot/zImage_dtb

If you want to repeat this procedure, start with clean-up:

$: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- distclean
$: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- clean

II. Bootlets

The iMX23 SoC contains a built-in ROM firmware capable of loading and executing binary images in special format from different locations including MMC/SD card and NAND flash. Binary image is called a boot stream (.bs). Boot stream consists of a series of smaller bootable images (bootlets) such clock bootlet, power bootlet etc. Linking bootlets with kernel and converting from elf format to raw boot stream is done with utility elftobs. In this package, utility elftobs2 is located in directory elftosb-0.3.

Switch into directory boot/elftosb-0.3 and make symbolic link into compilers default PATH:

$: sudo ln -s `pwd`/elftosb2 /usr/sbin/

Check with locate:

$: locate elftosb2

elftosb2 should be located at /usr/sbin/elftosb2.

Next, switch into directory boot and untar archive imx-bootlets-src-10.05.02.tar.gz

$: tar xvzf imx-bootlets-src-10.05.02.tar.gz

then switch into directory boot/imx-bootlets-src-10.05.02 and apply patches:

$: patch -p1 <../imx23_olinuxino_bootlets.patch

This patched package require zImage in this directory. We have created zImage_dtb instead, so make symbolic link as:

$: ln -s ../../kernel/linux-mainline/arch/arm/boot/zImage_dtb  ./zImage

Make boot stream file:

$: make CROSS_COMPILE=arm-linux-gnueabi- clean
$: make CROSS_COMPILE=arm-linux-gnueabi-

Final response would be:
To install bootstream onto SD/MMC card, type: sudo dd if=sd_mmc_bootstream.raw of=/dev/sdXY
where X is the correct letter for your sd or mmc device (to check, do a ls /dev/sd*) and Y is the partition number

If SD device is /dev/sdb1, then writing bootstream file in card is done by:

$: sudo dd if=sd_mmc_bootstream.raw of=/dev/sdb1

Card is ready, insert on your board and boot system. Here is boot log for imx23-olinuxino board:

root@imx233-olinuxino-maxi:~# HTLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFC
PowerPrep start initialize power…
Battery Voltage = 1.79V
No battery or bad battery                                       detected!!!.Disabling battery                                   voltage measure2
EMI_CTRL 0x1C084040
FRAC 0x92926192
init_ddr_mt46v32m16_133Mhz
power 0x00820710
Frac 0x92926192
start change cpu freq
hbus 0x00000003
cpu 0x00010001
LLLLLLLFCLJ[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 3.13.0-rc4 (devel@laptop) (gcc version 4.4.5 (Debian 4.4.5-8) ) #1 Mon Dec 23 16:37:09 EST 2013
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine model: i.MX23 Olinuxino Low Cost Board
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: noinitrd console=ttyAMA0,115200 root=/dev/mmcblk0p2 rw rootwait ssp1=mmc
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 52304K/65536K available (4759K kernel code, 292K rwdata, 1788K rodata, 226K init, 5490K bss, 13232K reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 – 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 – 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xc4800000 – 0xff000000   ( 936 MB)
[    0.000000]     lowmem  : 0xc0000000 – 0xc4000000   (  64 MB)
[    0.000000]     modules : 0xbf000000 – 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 – 0xc066d010   (6549 kB)
[    0.000000]       .init : 0xc066e000 – 0xc06a6a8c   ( 227 kB)
[    0.000000]       .data : 0xc06a8000 – 0xc06f1178   ( 293 kB)
[    0.000000]        .bss : 0xc06f1178 – 0xc0c4db98   (5491 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] of_irq_init: children remain, but no parents
[    0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836480000000ns
[    0.000000] Console: colour dummy device 80×30
[    0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
[    0.000000] … MAX_LOCKDEP_SUBCLASSES:  8
[    0.000000] … MAX_LOCK_DEPTH:          48
[    0.000000] … MAX_LOCKDEP_KEYS:        8191
[    0.000000] … CLASSHASH_SIZE:          4096
[    0.000000] … MAX_LOCKDEP_ENTRIES:     16384
[    0.000000] … MAX_LOCKDEP_CHAINS:      32768
[    0.000000] … CHAINHASH_SIZE:          16384
[    0.000000]  memory used by lock dependency info: 3695 kB
[    0.000000]  per task-struct memory footprint: 1152 bytes
[    0.070000] Calibrating delay loop… 226.09 BogoMIPS (lpj=1130496)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.070000] Mount-cache hash table entries: 512
[    0.080000] CPU: Testing write buffer coherency: ok
[    0.080000] Setting up static identity map for 0x4048bf78 – 0x4048bfd0
[    0.100000] devtmpfs: initialized
[    0.110000] pinctrl core: initialized pinctrl subsystem
[    0.120000] regulator-dummy: no parameters
[    0.120000] NET: Registered protocol family 16
[    0.120000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.180000] Serial: AMBA PL011 UART driver
[    0.190000] 80070000.serial: ttyAMA0 at MMIO 0x80070000 (irq = 17, base_baud = 0) is a PL011 rev2
[    0.370000] console [ttyAMA0] enabled
[    0.410000] bio: create slab <bio-0> at 0
[    0.430000] mxs-dma 80004000.dma-apbh: initialized
[    0.440000] mxs-dma 80024000.dma-apbx: initialized
[    0.450000] usb0_vbus: 5000 mV
[    0.450000] SCSI subsystem initialized
[    0.460000] usbcore: registered new interface driver usbfs
[    0.460000] usbcore: registered new interface driver hub
[    0.470000] usbcore: registered new device driver usb
[    0.480000] pps_core: LinuxPPS API ver. 1 registered
[    0.480000] pps_core: Software ver. 5.3.6 – Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.490000] PTP clock support registered
[    0.490000] Advanced Linux Sound Architecture Driver Initialized.
[    0.500000] Switched to clocksource mxs_timer
[    0.870000] NET: Registered protocol family 2
[    0.880000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.890000] TCP bind hash table entries: 1024 (order: 3, 36864 bytes)
[    0.900000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.910000] TCP: reno registered
[    0.910000] UDP hash table entries: 256 (order: 2, 20480 bytes)
[    0.920000] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
[    0.930000] NET: Registered protocol family 1
[    0.940000] RPC: Registered named UNIX socket transport module.
[    0.940000] RPC: Registered udp transport module.
[    0.950000] RPC: Registered tcp transport module.
[    0.950000] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.050000] NFS: Registering the id_resolver key type
[    1.050000] Key type id_resolver registered
[    1.060000] Key type id_legacy registered
[    1.060000] jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
[    1.070000] msgmni has been set to 102
[    1.090000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    1.100000] io scheduler noop registered (default)
[    1.110000] of_dma_request_slave_channel: dma-names property of node ‘/apb@80000000/apbx@80040000/serial@80070000’ missing or empty
[    1.130000] uart-pl011 80070000.serial: no DMA platform data
[    1.130000] 8006c000.serial: ttyAPP0 at MMIO 0x8006c000 (irq = 145, base_baud = 1500000) is a 8006c000.serial
[    1.140000] mxs-auart 8006c000.serial: Found APPUART 3.0.0
[    1.170000] usbcore: registered new interface driver asix
[    1.180000] usbcore: registered new interface driver ax88179_178a
[    1.180000] usbcore: registered new interface driver cdc_ether
[    1.190000] usbcore: registered new interface driver r815x
[    1.200000] usbcore: registered new interface driver smsc95xx
[    1.200000] usbcore: registered new interface driver net1080
[    1.210000] usbcore: registered new interface driver cdc_subset
[    1.210000] usbcore: registered new interface driver zaurus
[    1.220000] usbcore: registered new interface driver cdc_ncm
[    1.230000] ehci_hcd: USB 2.0 ‘Enhanced’ Host Controller (EHCI) Driver
[    1.230000] usbcore: registered new interface driver usb-storage
[    1.260000] ci_hdrc ci_hdrc.0: EHCI Host Controller
[    1.260000] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[    1.290000] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[    1.310000] hub 1-0:1.0: USB hub found
[    1.310000] hub 1-0:1.0: 1 port detected
[    1.320000] mousedev: PS/2 mouse device common for all mice
[    1.340000] stmp3xxx-rtc 8005c000.rtc: rtc core: registered 8005c000.rtc as rtc0
[    1.340000] i2c /dev entries driver
[    1.360000] stmp3xxx_rtc_wdt stmp3xxx_rtc_wdt: initialized watchdog with heartbeat 19s
[    1.370000] 80010000.ssp supply vmmc not found, using dummy regulator
[    1.420000] mxs-mmc 80010000.ssp: initialized
[    1.440000] ci_hdrc ci_hdrc.0: remove, state 1
[    1.440000] usb usb1: USB disconnect, device number 1
[    1.460000] usbcore: registered new interface driver usbhid
[    1.460000] usbhid: USB HID core driver
[    1.510000] mmc0: host does not support reading read-only switch. assuming write-enable.
[    1.520000] TCP: cubic registered
[    1.520000] NET: Registered protocol family 17
[    1.530000] mmc0: new high speed SDHC card at address b368
[    1.550000] Key type dns_resolver registered
[    1.560000] mmcblk0: mmc0:b368       3.73 GiB
[    1.580000] registered taskstats version 1
[    1.600000] ci_hdrc ci_hdrc.0: USB bus 1 deregistered
[    1.620000] stmp3xxx-rtc 8005c000.rtc: setting system clock to 2012-08-08 02:45:42 UTC (1344393942)
[    1.630000]  mmcblk0: p1 p2
[    1.670000] ALSA device list:
[    1.670000]   No soundcards found.
[    1.740000] kjournald starting.  Commit interval 5 seconds
[    1.750000] EXT3-fs (mmcblk0p2): using internal journal
[    1.760000] EXT3-fs (mmcblk0p2): recovery complete
[    1.760000] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
[    1.770000] VFS: Mounted root (ext3 filesystem) on device 179:2.
[    1.780000] devtmpfs: mounted
[    1.790000] Freeing unused kernel memory: 224K (c066e000 – c06a6000)
INIT: version 2.88 booting

Creative Commons License
This work by http://g-lab.ca is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License

Home imx23-olinuxino kernel 3.x Building a kernel 3.13-rc4 for the imx23-olinuxino