Linux Kernel

the ci20-v3.0.8 kernel branch as shipped by default in the Debian NAND image derived directly from the Ingenic kernel source code releases.

the latest kernel branch (ci20-v3.16 as of 08-08-2014) tracking mainline which is a nearly complete work in progress of upstreamable quality code to be soon pushed towards kernel.org. See details about this branch here CI20_upstream

Patches for the CI20 kernel and u-boot should be submitted to the CI20 mailing list for now.

Once the CI20 code is accepted into upstream repositories and mainline kernel.org then patches should go via the appropriate upstream mailing lists and maintainers as suggested by ./scripts/get_maintainer.pl.

Mailing list and Forum

IRC

NAND Flashing SD card

The NAND Flashing SD image creates an SD card that boots via mmc and writes the NAND of the CI20.

This can be used to restore the NAND on your CI20 to the factory default state, or upgrade the NAND image to a newer factory image file.

Note: Any changes you have made to your NAND (installed programs etc) will be irrecoverably lost during the NAND flash process. This will restore the CI20 NAND OS to the clean factory image state.

Making a NAND flashing SD card from the sd card image on Linux

1. Open a terminal

2. To determine the device name of the SD card, run lsblk which will list all block devices. Then insert the SD card, wait a few seconds, and run lsblk again. A new device plus any partitions should have appeared compared to
the original list, the SD card will be the new top level device. Be sure that you have the right device name!

3. Unmount all partitions on the SD card. If the device name were sdx, this would be done with:

umount /dev/sdx*

4. Write the image file with the following (replacing sdb with the correct device name):

dd if=debian6-20130815.img of=/dev/sdx

5. When it completes (note that dd will give no progress indication), run:

sync

6. Remove the SD card.

7. Put SD card in CI20

8. Check the boot_sel switch is on the mmc boot mode.

9. Boot and wait for the LED to go from red to blue (nand writing) and then red!

10. The NAND has been flashed to factory default state. Power off the board. Remove the SD card. change the boot_sel switch to NAND boot mode. And boot the board.

Making a NAND flashing SD card from the sd card image on Windows

2. Insert the SD card, and select the image file and the drive letter for the SD card in Win32DiskImager. Win32DiskImager may not be able to see built-in SD card slots, so if it doesn't show up, use a USB adapter instead.

4. Click Write and wait for it to complete.

5. Close the imager and then remove the SD card.

6. Put SD card in CI20

7. Check the boot_sel switch is on the mmc boot mode.

8. Boot and wait for the LED to go from red to blue (nand writing) and then red!

9. The NAND has been flashed to factory default state. Power off the board. Remove the SD card. change the boot_sel switch to NAND boot mode. And boot the board.

Toolchain

To build the Kernel and U-Boot from sources you will need a MIPS toolchain, e.g. the Sourcery CodeBench toolchain, and u-boot-tools for mkimage

For the toolchain, use Sourcery CodeBench Lite 2013.11-36 for MIPS GNU/Linux available here

Note, the CROSS_COMPILE for the toolchain path must be set in your environment.

This will generate 2 files, spl/u-boot-spl.bin and u-boot.img. We will use them in the next sections.

Building Linux Kernel from sources

For the Linux kernel, there are 2 branches that you can use:

ci20-v3.0.8: Default 3.0.8 kernel. All hardware supported.
ci20-v3.xx: the latest kernel branch (3.16 as of 08-08-2014) tracking mainline which is a nearly complete work in progress of upstreamable quality code to be soon pushed towards kernel.orgFor details on driver support, check the github branch readme page.
Note: various other branches might have wip-updates.

Clone the repository from github
To build the kernel for 3.0.8 (change branch name accordingly):

Note, the CROSS_COMPILE for the toolchain path must be set in your environment.
This will give you a uImage for the kernel (arch/mips/boot/uImage for 3.15 onwards, arch/mips/boot/compressed/uImage for 3.0.8).

Making a bootable SD card from sources

To make a bootable SD card, first partition your card with an MBR such that the first partition starts at an offset of no less than 270KB.
To do that,

Run

lsblk

before and after plugging your sd card writer, to check which device is your sd card.

The following example considers the sd card writer to be loaded on /dev/sdx

The following command partitions your SD card (MAKE SURE GET THE SD CARD WRITER DEVICE CORRECT!). Paste it as is