Skip to contentSkip to conversation

cubieboard: new set of patches for mainline kernel

PATCH New Carlo Caione 2 participants 4 messages May 16, 2013 – May 26, 2013

lore
Share & tools
lore
#0 lore raw

cover cubieboard: new set of patches for mainline kernel

Hi,
the following two patches are again for cubieboard but using the mainline kernel and limiting as much as possible the usage of tools from sunxi-repository.

Carlo Caione (2):
cubieboard: defconfig for mainline kernel
cubieboard: board specific files and script

 board/cubietech/cubieboard_mainline/mksdcard.sh   | 73 +++++++++++++++++++++
 board/cubietech/cubieboard_mainline/readme.txt    | 77 +++++++++++++++++++++++
 board/cubietech/cubieboard_mainline/uEnv-tftp.txt |  4 ++
 board/cubietech/cubieboard_mainline/uEnv.txt      |  1 +
 configs/cubieboard_mainline_defconfig             | 27 ++++++++
 5 files changed, 182 insertions(+)
 create mode 100755 board/cubietech/cubieboard_mainline/mksdcard.sh
 create mode 100644 board/cubietech/cubieboard_mainline/readme.txt
 create mode 100644 board/cubietech/cubieboard_mainline/uEnv-tftp.txt
 create mode 100644 board/cubietech/cubieboard_mainline/uEnv.txt
 create mode 100644 configs/cubieboard_mainline_defconfig
Signature · 1 line
1.8.2.3
#1 lore raw

PATCH 1/2 cubieboard: defconfig for mainline kernel

This is a new defconfig supporting the cubieboard. Differently from the previous defconfig (cubieboard_defconfig) using kernel and tools directly taken from the linux-sunxi repository, this defconfig uses the mainline kernel that already partially supports the board.
The only sunxi-specific package is sunxi-uboot that will be replaced as soon as a mainline version is released.

---
 configs/cubieboard_mainline_defconfig | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 configs/cubieboard_mainline_defconfig
configs/cubieboard_mainline_defconfig new file +27 -0
new file mode 100644
index 0000000..169fdb0
@@ -0,0 +1,27 @@
+BR2_arm=y
+BR2_cortex_a8=y
+
+# Bootloaders
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARDNAME="cubieboard"
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_VERSION="sunxi-current"
+BR2_TARGET_UBOOT_CUSTOM_GIT_REPO_URL="https://github.com/linux-sunxi/u-boot-sunxi.git"
+BR2_TARGET_UBOOT_CUSTOM_GIT_VERSION="3b3cb912783a51cae12b09a5c0f42c076c555c91"
+BR2_TARGET_UBOOT_FORMAT_BIN=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="spl/sunxi-spl.bin"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="multi_v7"
+BR2_LINUX_KERNEL_UBOOT_IMAGE=y
+BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x40008000"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_USE_INTREE_DTS=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun4i-a10-cubieboard"
+
+# Filesystem images
+BR2_TARGET_ROOTFS_CPIO=y
+BR2_TARGET_ROOTFS_CPIO_NONE=y
+BR2_TARGET_ROOTFS_INITRAMFS=y
Signature · 1 line
1.8.2.3
#2 lore raw

PATCH 1/2 cubieboard: defconfig for mainline kernel

Dear Carlo Caione,

configs/cubieboard_mainline_defconfig line 22

Quoted 8 lines · Carlo Caione
configs/cubieboard_mainline_defconfig new file +8 -0
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="multi_v7"
+BR2_LINUX_KERNEL_UBOOT_IMAGE=y
+BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x40008000"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_USE_INTREE_DTS=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun4i-a10-cubieboard"

You should specify a version for the Linux kernel. Otherwise, it will automatically get bumped to the latest version, which is not what we want for our defconfig: we want them to build a well-known version of the various components such as the kernel, U-Boot, etc.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH 2/2 cubieboard: board specific files and script

In reply to Carlo Caione

This set of files contains:
- readme.txt
- mksdcard.sh: scritp to create the SD card for cubieboard
- uEnv*.txt: different uEnv for u-boot (to boot using TFTP or using the SD card to host uImage and DTB)

---
 board/cubietech/cubieboard_mainline/mksdcard.sh   | 73 +++++++++++++++++++++
 board/cubietech/cubieboard_mainline/readme.txt    | 77 +++++++++++++++++++++++
 board/cubietech/cubieboard_mainline/uEnv-tftp.txt |  4 ++
 board/cubietech/cubieboard_mainline/uEnv.txt      |  1 +
 4 files changed, 155 insertions(+)
 create mode 100755 board/cubietech/cubieboard_mainline/mksdcard.sh
 create mode 100644 board/cubietech/cubieboard_mainline/readme.txt
 create mode 100644 board/cubietech/cubieboard_mainline/uEnv-tftp.txt
 create mode 100644 board/cubietech/cubieboard_mainline/uEnv.txt
board/cubietech/cubieboard_mainline/mksdcard.sh new file +73 -0
new file mode 100755
index 0000000..28d48bd
@@ -0,0 +1,73 @@
+#! /bin/sh
+# 2013, Carlo Caione <[email protected]>
+
+IMAGES_DIR=$1
+UENV=$2
+SPL_IMG=$IMAGES_DIR/sunxi-spl.bin
+UBOOT_IMG=$IMAGES_DIR/u-boot.bin
+UIMAGE=$IMAGES_DIR/uImage
+DTB=$IMAGES_DIR/sun4i-a10-cubieboard.dtb
+
+export LC_ALL=C
+
+if [ $# -ne 3 ]; then
+	echo "Usage: $0 <images_dir> <uEnv> <drive>"
+	exit 1;
+fi
+
+if [ $EUID -ne 0 ]; then
+	echo "This script must be run as root" 1>&2
+	exit 1
+fi
+
+if [ ! -f $SPL_IMG ] ||
+   [ ! -f $UBOOT_IMG ] ||
+   [ ! -f $UENV ] ||
+   [ ! -f $UIMAGE ] ||
+   [ ! -f $DTB ]; then
+	echo "File(s) missing."
+	exit 1
+fi
+
+DRIVE=$3
+PART1=`mktemp -d`
+
+dd if=/dev/zero of=$DRIVE bs=1M count=3
+
+# ~2048, 16MB, FAT, bootable
+# ~rest of drive, Ext4
+{
+echo 32,,0x0C,-
+} | sfdisk -D $DRIVE
+
+sleep 1
+
+if [ -b ${DRIVE}1 ]; then
+	D1=${DRIVE}1
+	umount ${DRIVE}1
+	mkfs.vfat -n "boot" ${DRIVE}1
+else
+	if [ -b ${DRIVE}p1 ]; then
+		D1=${DRIVE}p1
+		umount ${DRIVE}p1
+		mkfs.vfat -n "boot" ${DRIVE}p1
+	else
+		echo "Cant find boot partition in /dev"
+		exit 1
+	fi
+fi
+
+mount $D1 $PART1
+
+cp -v $UENV $PART1/uEnv.txt
+cp -v $UIMAGE $PART1
+cp -v $DTB $PART1
+
+sync
+
+umount $D1
+
+rm -fr $P1
+
+dd if=$SPL_IMG of=$DRIVE bs=1024 seek=8
+dd if=$UBOOT_IMG of=$DRIVE bs=1024 seek=32
board/cubietech/cubieboard_mainline/readme.txt new file +77 -0

77 lines not on this page · raw message

board/cubietech/cubieboard_mainline/uEnv-tftp.txt new file +4 -0
new file mode 100644
index 0000000..27bd417
@@ -0,0 +1,4 @@
+ethaddr=12:34:56:78:99:aa
+autoload=no
+serverip=10.0.0.1
+uenvcmd=dhcp; tftpboot 0x40000000 sun4i-a10-cubieboard.dtb; tftpboot 0x48000000 uImage; bootm 0x48000000 - 0x40000000 
board/cubietech/cubieboard_mainline/uEnv.txt new file +1 -0
new file mode 100644
index 0000000..3a50ec0
@@ -0,0 +1 @@
+uenvcmd=fatload mmc 0 0x48000000 uImage; fatload mmc 0 0x40000000 sun4i-a10-cubieboard.dtb; bootm 0x48000000 - 0x40000000
Signature · 1 line
1.8.2.3