diff options
authorJohannes Schmitz <>2018-01-09 16:08:28 (GMT)
committerThomas Petazzoni <>2018-01-12 21:43:19 (GMT)
commit523688ae5c647313ceb1c76c7443b1bc2e060e6e (patch)
parent735158d55aed36167df4195afe509779bc9a7535 (diff)
board/ci20: create a SD card image
Add a genimage.cfg to create a working sdcard.img for the ci20 hardware. We also need a uboot-env.txt to create the partition for the uboot environment. Update the board/ci20/readme.txt with the related information. Remove the tftp netboot description from the readme as it is already to complicated for a basic bootable example. Signed-off-by: Johannes Schmitz <> Signed-off-by: Thomas Petazzoni <>
4 files changed, 79 insertions, 25 deletions
diff --git a/board/ci20/genimage.cfg b/board/ci20/genimage.cfg
new file mode 100644
index 0000000..fa3e736
--- /dev/null
+++ b/board/ci20/genimage.cfg
@@ -0,0 +1,29 @@
+image sdcard.img {
+ hdimage {
+ }
+ partition uboot-spl {
+ in-partition-table = "no"
+ image = "u-boot-spl.bin"
+ offset = 512
+ }
+ partition uboot {
+ in-partition-table = "no"
+ image = "u-boot.img"
+ offset = 14k
+ }
+ partition uboot-env {
+ in-partition-table = "no"
+ image = "uboot-env.bin"
+ offset = 526k
+ }
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext4"
+ offset = 2M
+ size = 60M
+ }
diff --git a/board/ci20/readme.txt b/board/ci20/readme.txt
index ca7bb52..71d5070 100644
--- a/board/ci20/readme.txt
+++ b/board/ci20/readme.txt
@@ -2,41 +2,45 @@
* MIPS Creator CI20 *
The 'ci20_defconfig' will create a root filesystem and a kernel image
under the 'output/images/' directory. This document will try to explain how
to use them in order to run Buildroot in the MIPS Creator CI20 board.
-Assuming you are at the U-Boot prompt of the MIPS Creator CI20, you have to
-load the generated kernel image by using the 'tftpboot' command. In
-order to do that, you will need to get the network working. Here you
-have the instructions to set the ip address, netmask and gateway:
+How to build it
+Configure Buildroot
+ $ make ci20_defconfig
+Build the rootfs
+Note: you will need to have access to the network, since Buildroot will
+download the packages' sources.
- setenv ipaddr x.x.x.x
- setenv netmask x.x.x.x
- setenv gatewayip x.x.x.x
+You may now build your rootfs with:
-Now you have to set the ip for the TFTP server you are going to load the
-kernel image from, and also the name of the kernel image file (we use
-'uImage' as a filename in this example):
+ $ make
- setenv serverip x.x.x.x
- setenv bootfile uImage
+(This may take a while, consider getting yourself a coffee ;-) )
-And finally load the kernel image:
+How to write the SD card
- tftpboot
+Once the build process is finished you will have an image called
+"sdcard.img" in the output/images/ directory.
-Now you have to extract the generated root filesystem into a USB drive
-or SD-Card. Here you have the instructions to boot from the two of them.
-You have to choose the one your prefer:
+Make sure the SD card is not mounted then copy the bootable "sdcard.img" onto
+it with "dd":
-From USB
- setenv bootargs console=ttyS4,115200 console=tty0 mem=256M@0x0
-mem=768M@0x30000000 root=/dev/sda1
+ $ sudo dd if=output/images/sdcard.img of=/dev/sdX
-From SD-Card
- setenv bootargs console=ttyS4,115200 console=tty0 mem=256M@0x0
-mem=768M@0x30000000 root=/dev/mmcblk0p1
+Insert the SDcard into your ci20, and power it up. Your new system
+should come up now and start a console on the UART HEADER.
-And finally run this command to boot the board:
- bootm
diff --git a/board/ci20/uboot-env.txt b/board/ci20/uboot-env.txt
new file mode 100644
index 0000000..3093496
--- /dev/null
+++ b/board/ci20/uboot-env.txt
@@ -0,0 +1,10 @@
+bootargs=console=ttyS4,115200 console=tty0 mem=256M@0x0 mem=768M@0x30000000 rootwait root=/dev/mmcblk0p1 devtmpfs.mount=1 ip=dhcp
+bootcmd=run ethargs; ext4load mmc 0:1 0x88000000 /boot/uImage; bootm 0x88000000
+ethargs=env set bootargs ${bootargs}
diff --git a/configs/ci20_defconfig b/configs/ci20_defconfig
index 6de6394..f28dd4d 100644
--- a/configs/ci20_defconfig
+++ b/configs/ci20_defconfig
# system
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/ci20/genimage.cfg"
# kernel
@@ -15,6 +19,7 @@ BR2_LINUX_KERNEL_CUSTOM_GIT=y
# u-boot
@@ -26,3 +31,9 @@ BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="dd3c1b95dac7d10b2ca5806f65e5c1050d7dd0fa"
+# host