All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/3] OrangePi Plus: Add support
@ 2016-05-14 23:33 Troy Dack
  2016-05-14 23:33 ` [Buildroot] [PATCH 1/3] OrangePi Plus rootfs-overlay files Troy Dack
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Troy Dack @ 2016-05-14 23:33 UTC (permalink / raw)
  To: buildroot

Add support for the OrangePi Plus board.

Generates a self-extracting fel-boot.bsx file that can boot an OrangePi Plus
connected via USB-OTG. Root filesystem is loaded via initrd.

Also generates a bootable SD card image.

Signed-off-by: Troy Dack <troy@dack.com.au>

---
Troy Dack (3):
  OrangePi Plus rootfs-overlay files
  OrangePi Plus files required to generate SD card image and a self    
    extracting fel-boot command for booting from RAM using USB-OTG and  
      sunxi-fel
  Default config for OrangePi Plus.     Generates kernel using
    sunxi/for-next branch of git.kernel.org/git/mripard     U-boot built
    from git tag v2016.05-rc3

 board/orangepi/orangepi_plus/boot-fel.cmd          |  4 ++
 board/orangepi/orangepi_plus/boot-sdcard.cmd       |  8 +++
 board/orangepi/orangepi_plus/boot.cmd              |  4 ++
 board/orangepi/orangepi_plus/decompress            | 21 +++++++
 board/orangepi/orangepi_plus/genimage.cfg          | 35 ++++++++++++
 board/orangepi/orangepi_plus/payload.sh            | 21 +++++++
 board/orangepi/orangepi_plus/post-build.sh         | 15 +++++
 board/orangepi/orangepi_plus/post-image.sh         | 54 ++++++++++++++++++
 board/orangepi/orangepi_plus/readme.txt            | 35 ++++++++++++
 .../orangepi_plus/rootfs-overlay/etc/profile       | 21 +++++++
 configs/orangepi_plus_defconfig                    | 64 ++++++++++++++++++++++
 11 files changed, 282 insertions(+)
 create mode 100644 board/orangepi/orangepi_plus/boot-fel.cmd
 create mode 100644 board/orangepi/orangepi_plus/boot-sdcard.cmd
 create mode 100644 board/orangepi/orangepi_plus/boot.cmd
 create mode 100644 board/orangepi/orangepi_plus/decompress
 create mode 100644 board/orangepi/orangepi_plus/genimage.cfg
 create mode 100644 board/orangepi/orangepi_plus/payload.sh
 create mode 100755 board/orangepi/orangepi_plus/post-build.sh
 create mode 100755 board/orangepi/orangepi_plus/post-image.sh
 create mode 100644 board/orangepi/orangepi_plus/readme.txt
 create mode 100644 board/orangepi/orangepi_plus/rootfs-overlay/etc/profile
 create mode 100644 configs/orangepi_plus_defconfig

-- 
2.7.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/3] OrangePi Plus rootfs-overlay files
  2016-05-14 23:33 [Buildroot] [PATCH 0/3] OrangePi Plus: Add support Troy Dack
@ 2016-05-14 23:33 ` Troy Dack
  2016-05-15 21:06   ` Peter Korsgaard
  2016-05-14 23:33 ` [Buildroot] [PATCH 2/3] OrangePi Plus files required to generate SD card image and a self extracting fel-boot command for booting from RAM using USB-OTG and sunxi-fel Troy Dack
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Troy Dack @ 2016-05-14 23:33 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Troy Dack <troy@dack.com.au>
---
 .../orangepi_plus/rootfs-overlay/etc/profile        | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 board/orangepi/orangepi_plus/rootfs-overlay/etc/profile

diff --git a/board/orangepi/orangepi_plus/rootfs-overlay/etc/profile b/board/orangepi/orangepi_plus/rootfs-overlay/etc/profile
new file mode 100644
index 0000000..a4ddccd
--- /dev/null
+++ b/board/orangepi/orangepi_plus/rootfs-overlay/etc/profile
@@ -0,0 +1,21 @@
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+if [ "$PS1" ]; then
+        if [ "`id -u`" -eq 0 ]; then
+                export PS1='\h:\w\# '
+        else
+                export PS1='\h:\w\$ '
+        fi
+fi
+
+export PAGER='/bin/more '
+export EDITOR='/bin/vi'
+
+# Source configuration files from /etc/profile.d
+for i in /etc/profile.d/*.sh ; do
+        if [ -r "$i" ]; then
+                . $i
+        fi
+        unset i
+done
+
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] OrangePi Plus files required to generate SD card image and a self extracting fel-boot command for booting from RAM using USB-OTG and sunxi-fel
  2016-05-14 23:33 [Buildroot] [PATCH 0/3] OrangePi Plus: Add support Troy Dack
  2016-05-14 23:33 ` [Buildroot] [PATCH 1/3] OrangePi Plus rootfs-overlay files Troy Dack
@ 2016-05-14 23:33 ` Troy Dack
  2016-05-15 21:56   ` Peter Korsgaard
  2016-05-14 23:33 ` [Buildroot] [PATCH 3/3] Default config for OrangePi Plus. Generates kernel using sunxi/for-next branch of git.kernel.org/git/mripard U-boot built from git tag v2016.05-rc3 Troy Dack
  2016-05-15 21:10 ` [Buildroot] [PATCH 0/3] OrangePi Plus: Add support Peter Korsgaard
  3 siblings, 1 reply; 10+ messages in thread
From: Troy Dack @ 2016-05-14 23:33 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Troy Dack <troy@dack.com.au>
---
 board/orangepi/orangepi_plus/boot-fel.cmd    |  4 +++
 board/orangepi/orangepi_plus/boot-sdcard.cmd |  8 +++++
 board/orangepi/orangepi_plus/boot.cmd        |  4 +++
 board/orangepi/orangepi_plus/decompress      | 21 +++++++++++
 board/orangepi/orangepi_plus/genimage.cfg    | 35 ++++++++++++++++++
 board/orangepi/orangepi_plus/payload.sh      | 21 +++++++++++
 board/orangepi/orangepi_plus/post-build.sh   | 15 ++++++++
 board/orangepi/orangepi_plus/post-image.sh   | 54 ++++++++++++++++++++++++++++
 board/orangepi/orangepi_plus/readme.txt      | 35 ++++++++++++++++++
 9 files changed, 197 insertions(+)
 create mode 100644 board/orangepi/orangepi_plus/boot-fel.cmd
 create mode 100644 board/orangepi/orangepi_plus/boot-sdcard.cmd
 create mode 100644 board/orangepi/orangepi_plus/boot.cmd
 create mode 100644 board/orangepi/orangepi_plus/decompress
 create mode 100644 board/orangepi/orangepi_plus/genimage.cfg
 create mode 100644 board/orangepi/orangepi_plus/payload.sh
 create mode 100755 board/orangepi/orangepi_plus/post-build.sh
 create mode 100755 board/orangepi/orangepi_plus/post-image.sh
 create mode 100644 board/orangepi/orangepi_plus/readme.txt

diff --git a/board/orangepi/orangepi_plus/boot-fel.cmd b/board/orangepi/orangepi_plus/boot-fel.cmd
new file mode 100644
index 0000000..50e80a3
--- /dev/null
+++ b/board/orangepi/orangepi_plus/boot-fel.cmd
@@ -0,0 +1,4 @@
+setenv fdt_high ffffffff
+setenv bootargs console=ttyS0,115200 earlyprintk rootwait
+
+bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r
diff --git a/board/orangepi/orangepi_plus/boot-sdcard.cmd b/board/orangepi/orangepi_plus/boot-sdcard.cmd
new file mode 100644
index 0000000..5fe9920
--- /dev/null
+++ b/board/orangepi/orangepi_plus/boot-sdcard.cmd
@@ -0,0 +1,8 @@
+setenv fdt_high ffffffff
+
+setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
+
+fatload mmc 0 $kernel_addr_r uImage
+fatload mmc 0 $fdt_addr_r sun8i-h3-orangepi-plus.dtb
+
+bootm $kernel_addr_r - $fdt_addr_r
diff --git a/board/orangepi/orangepi_plus/boot.cmd b/board/orangepi/orangepi_plus/boot.cmd
new file mode 100644
index 0000000..50e80a3
--- /dev/null
+++ b/board/orangepi/orangepi_plus/boot.cmd
@@ -0,0 +1,4 @@
+setenv fdt_high ffffffff
+setenv bootargs console=ttyS0,115200 earlyprintk rootwait
+
+bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r
diff --git a/board/orangepi/orangepi_plus/decompress b/board/orangepi/orangepi_plus/decompress
new file mode 100644
index 0000000..5f10737
--- /dev/null
+++ b/board/orangepi/orangepi_plus/decompress
@@ -0,0 +1,21 @@
+#!/bin/bash
+echo ""
+echo "Self Extracting sunxi-fel USB boot"
+echo ""
+
+export TMPDIR=`mktemp -d /tmp/selfextract.XXXXXX`
+
+ARCHIVE=`awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' $0`
+
+tail -n+$ARCHIVE $0 | tar xjv -C $TMPDIR
+
+CDIR=`pwd`
+cd $TMPDIR
+./fel-boot.sh
+
+cd $CDIR
+rm -rf $TMPDIR
+
+exit 0
+
+__ARCHIVE_BELOW__
diff --git a/board/orangepi/orangepi_plus/genimage.cfg b/board/orangepi/orangepi_plus/genimage.cfg
new file mode 100644
index 0000000..c607b9e
--- /dev/null
+++ b/board/orangepi/orangepi_plus/genimage.cfg
@@ -0,0 +1,35 @@
+# Minimal SD card image for the OrangePi PC
+#
+image boot.vfat {
+	vfat {
+		files = {
+			"uImage",
+			"sun8i-h3-orangepi-plus.dtb",
+			"boot-sdcard.scr"
+		}
+	}
+	size = 10M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "u-boot-sunxi-with-spl.bin"
+		offset = 8192
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+		size = 512M
+	}
+}
diff --git a/board/orangepi/orangepi_plus/payload.sh b/board/orangepi/orangepi_plus/payload.sh
new file mode 100644
index 0000000..ca247fd
--- /dev/null
+++ b/board/orangepi/orangepi_plus/payload.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+cd ${BINARIES_DIR}
+tar czf .tar ./*
+
+if [ -e "payload.tar" ]; then
+    gzip payload.tar
+
+    if [ -e "payload.tar.gz" ]; then
+        cat decompress payload.tar.gz > selfextract.bsx
+    else
+        echo "payload.tar.gz does not exist"
+        exit 1
+    fi
+else
+    echo "payload.tar does not exist"
+    exit 1
+fi
+
+echo "selfextract.bsx created"
+exit 0
+
diff --git a/board/orangepi/orangepi_plus/post-build.sh b/board/orangepi/orangepi_plus/post-build.sh
new file mode 100755
index 0000000..9885453
--- /dev/null
+++ b/board/orangepi/orangepi_plus/post-build.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+# post-build.sh for OrangePi Plus
+# based on OrangePi PC by Carlo Caione <carlo.caione@gmail.com>
+# 2016, Troy Dack <troy@dack.com.au>
+
+BOARD_DIR="$(dirname $0)"
+MKIMAGE=$HOST_DIR/usr/bin/mkimage
+
+for F in fel sdcard; do
+	BOOT_CMD=$BOARD_DIR/boot-$F.cmd
+	BOOT_CMD_H=$BINARIES_DIR/boot-$F.scr
+	# U-Boot script
+	$MKIMAGE -C none -A arm -T script -d $BOOT_CMD $BOOT_CMD_H
+done
+
diff --git a/board/orangepi/orangepi_plus/post-image.sh b/board/orangepi/orangepi_plus/post-image.sh
new file mode 100755
index 0000000..2be26a8
--- /dev/null
+++ b/board/orangepi/orangepi_plus/post-image.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname ${BR2_CONFIG})/$(dirname $0)"
+GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+echo ">>> Generating fel-boot.bsx self-extracting boot image"
+# Create fel-boot.sh
+cat > ${BINARIES_DIR}/fel-boot.sh <<__EOF__
+#!/bin/bash
+
+SUNXI_TOOLS=${HOST_DIR}
+BINARIES_DIR=${BINARIES_DIR}
+
+sudo \${SUNXI_TOOLS}/usr/bin/sunxi-fel -v -p \\
+	uboot \${BINARIES_DIR}\\u-boot-sunxi-with-spl.bin \\
+	write 0x42000000 \${BINARIES_DIR}\\uImage \\
+	write 0x43000000 \${BINARIES_DIR}\\sun8i-h3-orangepi-plus.dtb \\
+	write 0x43100000 \${BINARIES_DIR}\\boot-fel.scr \\
+	write 0x43300000 \${BINARIES_DIR}\\rootfs.cpio.uboot
+__EOF__
+chmod +x ${BINARIES_DIR}/fel-boot.sh
+
+# Create self-extracting fel-boot.bsx
+tar cjf ${BINARIES_DIR}/payload.tar.bz2 -C ${BINARIES_DIR} \
+	u-boot-sunxi-with-spl.bin \
+	uImage \
+	sun8i-h3-orangepi-plus.dtb \
+	boot-fel.scr \
+	rootfs.cpio.uboot \
+	fel-boot.sh
+
+if [ -e "${BINARIES_DIR}/payload.tar.bz2" ]; then
+    cat ${BOARD_DIR}/decompress ${BINARIES_DIR}/payload.tar.bz2 > ${BINARIES_DIR}/fel-boot.bsx
+    rm ${BINARIES_DIR}/payload.tar.bz2
+else
+    echo "${BINARIES_DIR}/payload.tar.bz2 does not exist"
+    exit 1
+fi
+chmod +x ${BINARIES_DIR}/fel-boot.bsx
+
+echo ">>> Generating SD card image"
+# Generate SD Card image
+rm -rf "${GENIMAGE_TMP}"
+
+genimage                               \
+	--rootpath "${TARGET_DIR}"     \
+	--tmppath "${GENIMAGE_TMP}"    \
+	--inputpath "${BINARIES_DIR}"  \
+	--outputpath "${BINARIES_DIR}" \
+	--config "${GENIMAGE_CFG}"
+
+
+exit $?
diff --git a/board/orangepi/orangepi_plus/readme.txt b/board/orangepi/orangepi_plus/readme.txt
new file mode 100644
index 0000000..818cfa5
--- /dev/null
+++ b/board/orangepi/orangepi_plus/readme.txt
@@ -0,0 +1,35 @@
+OrangePi Plus
+
+Intro
+=====
+
+This default configuration will allow you to start experimenting with the
+buildroot environment for the OrangePi PC. With the current configuration
+it will bring-up the board, and allow access through the serial console.
+
+How to build it
+===============
+
+Configure Buildroot:
+
+    $ make orangepi_plus_defconfig
+
+Compile everything and build the self extracting initrd FEL boot image:
+
+    $ make
+
+Booting
+=======
+
+Once the build process is finished you will have a script called 
+"fel-boot.bsx" in the output/images/ directory.
+
+Make sure sunxi-tools/sunxi-fel is in your current PATH if they are
+not installed.
+
+Connect your OrangePi Plus via the OSB-OTG port and put it into FEL
+mode by pressing the FEL button. Run fel-boot.bsx and the OrangePi
+Plus will boot from the compiled image.
+
+  $ sudo fel-boot.bsx
+
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 3/3] Default config for OrangePi Plus. Generates kernel using sunxi/for-next branch of git.kernel.org/git/mripard U-boot built from git tag v2016.05-rc3
  2016-05-14 23:33 [Buildroot] [PATCH 0/3] OrangePi Plus: Add support Troy Dack
  2016-05-14 23:33 ` [Buildroot] [PATCH 1/3] OrangePi Plus rootfs-overlay files Troy Dack
  2016-05-14 23:33 ` [Buildroot] [PATCH 2/3] OrangePi Plus files required to generate SD card image and a self extracting fel-boot command for booting from RAM using USB-OTG and sunxi-fel Troy Dack
@ 2016-05-14 23:33 ` Troy Dack
  2016-05-15 21:47   ` Peter Korsgaard
  2016-05-15 21:10 ` [Buildroot] [PATCH 0/3] OrangePi Plus: Add support Peter Korsgaard
  3 siblings, 1 reply; 10+ messages in thread
From: Troy Dack @ 2016-05-14 23:33 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Troy Dack <troy@dack.com.au>
---
 configs/orangepi_plus_defconfig | 64 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 configs/orangepi_plus_defconfig

diff --git a/configs/orangepi_plus_defconfig b/configs/orangepi_plus_defconfig
new file mode 100644
index 0000000..c4668ad
--- /dev/null
+++ b/configs/orangepi_plus_defconfig
@@ -0,0 +1,64 @@
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_ARM_FPU_VFPV4=y
+# Kernel is a pre-release of 4.5, so we do not yet have a _CUSTOM_4_5
+# option for the headers. Thus, we stick with the 4.4 headers for now.
+BR2_KERNEL_HEADERS_VERSION=y
+BR2_DEFAULT_KERNEL_VERSION="4.4"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+BR2_TARGET_GENERIC_HOSTNAME="OrangePi_PC"
+BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the Orange Pi Plus"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/orangepi/orangepi_plus/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/orangepi/orangepi_plus/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="sunxi/for-next"
+BR2_LINUX_KERNEL_VERSION="sunxi/for-next"
+BR2_LINUX_KERNEL_PATCH=""
+BR2_LINUX_KERNEL_USE_DEFCONFIG=y
+BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES=""
+BR2_LINUX_KERNEL_UBOOT_IMAGE=y
+BR2_LINUX_KERNEL_UIMAGE=y
+BR2_LINUX_KERNEL_GZIP=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="sun8i-h3-orangepi-plus"
+BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL=""
+BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION=""
+
+BR2_TARGET_ROOTFS_CPIO=y
+BR2_TARGET_ROOTFS_CPIO_GZIP=y
+BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="http://git.denx.de/u-boot.git"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="v2016.05-rc3"
+BR2_TARGET_UBOOT_VERSION="v2016.05-rc3"
+BR2_TARGET_UBOOT_PATCH=""
+BR2_TARGET_UBOOT_USE_DEFCONFIG=y
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="orangepi_plus"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin"
+BR2_TARGET_UBOOT_CUSTOM_GIT_REPO_URL=""
+BR2_TARGET_UBOOT_CUSTOM_GIT_VERSION=""
+
+BR2_CCACHE=y
+BR2_CCACHE_DIR="$(HOME)/.buildroot-ccache"
+BR2_CCACHE_INITIAL_SETUP=""
+BR2_CCACHE_USE_BASEDIR=y
+
+BR2_PACKAGE_HOST_DTC=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_SUNXI_TOOLS=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_MTOOLS=y
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/3] OrangePi Plus rootfs-overlay files
  2016-05-14 23:33 ` [Buildroot] [PATCH 1/3] OrangePi Plus rootfs-overlay files Troy Dack
@ 2016-05-15 21:06   ` Peter Korsgaard
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Korsgaard @ 2016-05-15 21:06 UTC (permalink / raw)
  To: buildroot

>>>>> "Troy" == Troy Dack <troy@dack.com.au> writes:

 > Signed-off-by: Troy Dack <troy@dack.com.au>
 > ---
 >  .../orangepi_plus/rootfs-overlay/etc/profile        | 21 +++++++++++++++++++++
 >  1 file changed, 21 insertions(+)
 >  create mode 100644 board/orangepi/orangepi_plus/rootfs-overlay/etc/profile

 > diff --git a/board/orangepi/orangepi_plus/rootfs-overlay/etc/profile
 > b/board/orangepi/orangepi_plus/rootfs-overlay/etc/profile
 > new file mode 100644
 > index 0000000..a4ddccd
 > --- /dev/null
 > +++ b/board/orangepi/orangepi_plus/rootfs-overlay/etc/profile
 > @@ -0,0 +1,21 @@
 > +export PATH=/bin:/sbin:/usr/bin:/usr/sbin
 > +
 > +if [ "$PS1" ]; then
 > +        if [ "`id -u`" -eq 0 ]; then
 > +                export PS1='\h:\w\# '
 > +        else
 > +                export PS1='\h:\w\$ '
 > +        fi
 > +fi
 > +
 > +export PAGER='/bin/more '
 > +export EDITOR='/bin/vi'
 > +
 > +# Source configuration files from /etc/profile.d
 > +for i in /etc/profile.d/*.sh ; do
 > +        if [ -r "$i" ]; then
 > +                . $i
 > +        fi
 > +        unset i
 > +done

Why? This doesn't seem critical/specific to this board? Any specific
reason to change the prompt? If this is generally useful, then perhaps
we should just change it in system/skeleton instead?

Please verify that this shell works with busybox ash/hush and bash.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 0/3] OrangePi Plus: Add support
  2016-05-14 23:33 [Buildroot] [PATCH 0/3] OrangePi Plus: Add support Troy Dack
                   ` (2 preceding siblings ...)
  2016-05-14 23:33 ` [Buildroot] [PATCH 3/3] Default config for OrangePi Plus. Generates kernel using sunxi/for-next branch of git.kernel.org/git/mripard U-boot built from git tag v2016.05-rc3 Troy Dack
@ 2016-05-15 21:10 ` Peter Korsgaard
  2016-05-16  2:17   ` Troy Dack
  3 siblings, 1 reply; 10+ messages in thread
From: Peter Korsgaard @ 2016-05-15 21:10 UTC (permalink / raw)
  To: buildroot

>>>>> "Troy" == Troy Dack <troy@dack.com.au> writes:

 > Add support for the OrangePi Plus board.

In what way does this differ from our existing orangepipc support? Can
anything be shared between them?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 3/3] Default config for OrangePi Plus. Generates kernel using sunxi/for-next branch of git.kernel.org/git/mripard U-boot built from git tag v2016.05-rc3
  2016-05-14 23:33 ` [Buildroot] [PATCH 3/3] Default config for OrangePi Plus. Generates kernel using sunxi/for-next branch of git.kernel.org/git/mripard U-boot built from git tag v2016.05-rc3 Troy Dack
@ 2016-05-15 21:47   ` Peter Korsgaard
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Korsgaard @ 2016-05-15 21:47 UTC (permalink / raw)
  To: buildroot

>>>>> "Troy" == Troy Dack <troy@dack.com.au> writes:

 > Signed-off-by: Troy Dack <troy@dack.com.au>
 > ---
 >  configs/orangepi_plus_defconfig | 64 +++++++++++++++++++++++++++++++++++++++++

Thanks. This should be in the same patch as the one adding the
post-image/build scripts.

>  1 file changed, 64 insertions(+)
 >  create mode 100644 configs/orangepi_plus_defconfig

 > diff --git a/configs/orangepi_plus_defconfig b/configs/orangepi_plus_defconfig
 > new file mode 100644
 > index 0000000..c4668ad
 > --- /dev/null
 > +++ b/configs/orangepi_plus_defconfig
 > @@ -0,0 +1,64 @@
 > +BR2_arm=y
 > +BR2_cortex_a7=y
 > +BR2_ARM_FPU_VFPV4=y
 > +# Kernel is a pre-release of 4.5, so we do not yet have a _CUSTOM_4_5
 > +# option for the headers. Thus, we stick with the 4.4 headers for now.
 > +BR2_KERNEL_HEADERS_VERSION=y
 > +BR2_DEFAULT_KERNEL_VERSION="4.4"
 > +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
 > +BR2_TARGET_GENERIC_HOSTNAME="OrangePi_PC"
 > +BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the Orange Pi Plus"
 > +BR2_ROOTFS_POST_BUILD_SCRIPT="board/orangepi/orangepi_plus/post-build.sh"
 > +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/orangepi/orangepi_plus/post-image.sh"
 > +BR2_LINUX_KERNEL=y
 > +BR2_LINUX_KERNEL_CUSTOM_GIT=y
 > +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git"
 > +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="sunxi/for-next"
 > +BR2_LINUX_KERNEL_VERSION="sunxi/for-next"

Why can't you use 4.5 like orangepipc_defconfig? This for-next branch
most likely isn't stable (E.G. it gets rebased and recreated once it is
merged into mainline). We want reproducable builds, so  _REPO_VERSION
has to point to a git commit hash or a tag, and not to a branch.

> +BR2_LINUX_KERNEL_PATCH=""
 > +BR2_LINUX_KERNEL_USE_DEFCONFIG=y
 > +BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
 > +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES=""

Please drop unneeded lines (E.G. the ones equal to the default values).

 > +BR2_LINUX_KERNEL_UBOOT_IMAGE=y
 > +BR2_LINUX_KERNEL_UIMAGE=y

Why? U-boot supports zImage (and orangepipc_defconfig already uses it)

 > +BR2_LINUX_KERNEL_GZIP=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="sun8i-h3-orangepi-plus"
 > +BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL=""
 > +BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION=""

Huh?

 > +
 > +BR2_TARGET_ROOTFS_CPIO=y
 > +BR2_TARGET_ROOTFS_CPIO_GZIP=y
 > +BR2_TARGET_ROOTFS_CPIO_UIMAGE=y

What is this for? Fel boot?

 > +BR2_TARGET_ROOTFS_EXT2=y
 > +BR2_TARGET_ROOTFS_EXT2_4=y
 > +
 > +BR2_PACKAGE_HOST_UBOOT_TOOLS=y
 > +
 > +BR2_TARGET_UBOOT=y
 > +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 > +BR2_TARGET_UBOOT_CUSTOM_GIT=y
 > +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="http://git.denx.de/u-boot.git"
 > +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="v2016.05-rc3"
 > +BR2_TARGET_UBOOT_VERSION="v2016.05-rc3"
 > +BR2_TARGET_UBOOT_PATCH=""
 > +BR2_TARGET_UBOOT_USE_DEFCONFIG=y
 > +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="orangepi_plus"
 > +BR2_TARGET_UBOOT_NEEDS_DTC=y
 > +BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
 > +BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin"


 > +BR2_TARGET_UBOOT_CUSTOM_GIT_REPO_URL=""
 > +BR2_TARGET_UBOOT_CUSTOM_GIT_VERSION=""

Again, huh?


 > +
 > +BR2_CCACHE=y
 > +BR2_CCACHE_DIR="$(HOME)/.buildroot-ccache"
 > +BR2_CCACHE_INITIAL_SETUP=""
 > +BR2_CCACHE_USE_BASEDIR=y

This is not specific to this board, so it doesn't belong here.

Care to fixup these issues and resend? Thanks!

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] OrangePi Plus files required to generate SD card image and a self extracting fel-boot command for booting from RAM using USB-OTG and sunxi-fel
  2016-05-14 23:33 ` [Buildroot] [PATCH 2/3] OrangePi Plus files required to generate SD card image and a self extracting fel-boot command for booting from RAM using USB-OTG and sunxi-fel Troy Dack
@ 2016-05-15 21:56   ` Peter Korsgaard
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Korsgaard @ 2016-05-15 21:56 UTC (permalink / raw)
  To: buildroot

>>>>> "Troy" == Troy Dack <troy@dack.com.au> writes:

 > Signed-off-by: Troy Dack <troy@dack.com.au>
 > ---
 >  board/orangepi/orangepi_plus/boot-fel.cmd    |  4 +++
 >  board/orangepi/orangepi_plus/boot-sdcard.cmd |  8 +++++

Is there any specific reason to support fel boot? As we create a full
blown sd card image, isn't that just as easy to use as fel boot?

 >  board/orangepi/orangepi_plus/boot.cmd        |  4 +++

This looks identical to boot-fel.cmd.

 > +++ b/board/orangepi/orangepi_plus/decompress
 > @@ -0,0 +1,21 @@
 > +#!/bin/bash
 > +echo ""
 > +echo "Self Extracting sunxi-fel USB boot"
 > +echo ""
 > +
 > +export TMPDIR=`mktemp -d /tmp/selfextract.XXXXXX`
 > +
 > +ARCHIVE=`awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' $0`
 > +
 > +tail -n+$ARCHIVE $0 | tar xjv -C $TMPDIR
 > +
 > +CDIR=`pwd`
 > +cd $TMPDIR
 > +./fel-boot.sh
 > +
 > +cd $CDIR
 > +rm -rf $TMPDIR
 > +
 > +exit 0
 > +
 > +__ARCHIVE_BELOW__

A description what this is about would be nice.


> diff --git a/board/orangepi/orangepi_plus/payload.sh b/board/orangepi/orangepi_plus/payload.sh
 > new file mode 100644
 > index 0000000..ca247fd
 > --- /dev/null
 > +++ b/board/orangepi/orangepi_plus/payload.sh
 > @@ -0,0 +1,21 @@
 > +#!/bin/bash
 > +cd ${BINARIES_DIR}
 > +tar czf .tar ./*
 > +
 > +if [ -e "payload.tar" ]; then
 > +    gzip payload.tar
 > +
 > +    if [ -e "payload.tar.gz" ]; then
 > +        cat decompress payload.tar.gz > selfextract.bsx
 > +    else
 > +        echo "payload.tar.gz does not exist"
 > +        exit 1
 > +    fi
 > +else
 > +    echo "payload.tar does not exist"
 > +    exit 1
 > +fi
 > +
 > +echo "selfextract.bsx created"
 > +exit 0

And this as well?

 > +++ b/board/orangepi/orangepi_plus/post-image.sh
 > @@ -0,0 +1,54 @@
 > +#!/bin/sh
 > +
 > +BOARD_DIR="$(dirname ${BR2_CONFIG})/$(dirname $0)"
 > +GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
 > +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
 > +
 > +echo ">>> Generating fel-boot.bsx self-extracting boot image"
 > +# Create fel-boot.sh
 > +cat > ${BINARIES_DIR}/fel-boot.sh <<__EOF__
 > +#!/bin/bash
 > +
 > +SUNXI_TOOLS=${HOST_DIR}
 > +BINARIES_DIR=${BINARIES_DIR}
 > +
 > +sudo \${SUNXI_TOOLS}/usr/bin/sunxi-fel -v -p \\

Calling sudo from the post-image.sh script isn't nice. I think the best
option is perhaps to just drop all the fel stuff, unless you have a
specific reason to have it?


> +echo ">>> Generating SD card image"
 > +# Generate SD Card image
 > +rm -rf "${GENIMAGE_TMP}"
 > +
 > +genimage                               \
 > +	--rootpath "${TARGET_DIR}"     \
 > +	--tmppath "${GENIMAGE_TMP}"    \
 > +	--inputpath "${BINARIES_DIR}"  \
 > +	--outputpath "${BINARIES_DIR}" \
 > +	--config "${GENIMAGE_CFG}"
 > +
 > +
 > +exit $?

The exit line (and empty lines above) can be dropped.

> diff --git a/board/orangepi/orangepi_plus/readme.txt b/board/orangepi/orangepi_plus/readme.txt
 > new file mode 100644
 > index 0000000..818cfa5
 > --- /dev/null
 > +++ b/board/orangepi/orangepi_plus/readme.txt
 > @@ -0,0 +1,35 @@
 > +OrangePi Plus
 > +
 > +Intro
 > +=====
 > +
 > +This default configuration will allow you to start experimenting with the
 > +buildroot environment for the OrangePi PC. With the current configuration

s/OrangePi PC/OrangePi Plus/

> +it will bring-up the board, and allow access through the serial console.


> +
 > +How to build it
 > +===============
 > +
 > +Configure Buildroot:
 > +
 > +    $ make orangepi_plus_defconfig
 > +
 > +Compile everything and build the self extracting initrd FEL boot image:
 > +
 > +    $ make
 > +
 > +Booting
 > +=======
 > +
 > +Once the build process is finished you will have a script called 
 > +"fel-boot.bsx" in the output/images/ directory.
 > +
 > +Make sure sunxi-tools/sunxi-fel is in your current PATH if they are
 > +not installed.

If needed, we should use the tools built by buildroot (but I think we
shold just drop the fel stuff).

> +
 > +Connect your OrangePi Plus via the OSB-OTG port and put it into FEL
 > +mode by pressing the FEL button. Run fel-boot.bsx and the OrangePi
 > +Plus will boot from the compiled image.
 > +
 > +  $ sudo fel-boot.bsx

It would be better to document how to use the sd card image.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 0/3] OrangePi Plus: Add support
  2016-05-15 21:10 ` [Buildroot] [PATCH 0/3] OrangePi Plus: Add support Peter Korsgaard
@ 2016-05-16  2:17   ` Troy Dack
  2016-05-16  9:38     ` Peter Korsgaard
  0 siblings, 1 reply; 10+ messages in thread
From: Troy Dack @ 2016-05-16  2:17 UTC (permalink / raw)
  To: buildroot


> On 16 May 2016, at 07:10, Peter Korsgaard <peter@korsgaard.com> wrote:
> 
>>>>>> "Troy" == Troy Dack <troy@dack.com.au> writes:
> 
>> Add support for the OrangePi Plus board.
> 
> In what way does this differ from our existing orangepipc support? Can
> anything be shared between them?

More than likely yes.  Although the OrangePi PC support does rename the
Plus .dts as U-boot doesn?t generate one for the PC yet.

Thanks for the comments on the patches themselves.

The intent was to create a minimal system that could be used either by
putting it onto an SD card, or boot via fel with a usable initrd - without
needing to create an SD card. This was mainly because network support in
mainline on the H3 based OrangePi?s isn?t the best at the moment.

Is it possible to have a generic configuration (say OrangePi-H3) that is
shared and then configs that include the specifics for the OrangePi
Plus/PC etc?

--
	Troy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160516/db895350/attachment.asc>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 0/3] OrangePi Plus: Add support
  2016-05-16  2:17   ` Troy Dack
@ 2016-05-16  9:38     ` Peter Korsgaard
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Korsgaard @ 2016-05-16  9:38 UTC (permalink / raw)
  To: buildroot

>>>>> "Troy" == Troy Dack <troy@dack.com.au> writes:

 >> On 16 May 2016, at 07:10, Peter Korsgaard <peter@korsgaard.com> wrote:
 >> 
 >>>>>>> "Troy" == Troy Dack <troy@dack.com.au> writes:
 >> 
 >>> Add support for the OrangePi Plus board.
 >> 
 >> In what way does this differ from our existing orangepipc support? Can
 >> anything be shared between them?

 > More than likely yes.  Although the OrangePi PC support does rename the
 > Plus .dts as U-boot doesn?t generate one for the PC yet.

 > Thanks for the comments on the patches themselves.

Ok, good - And you're welcome.

 > The intent was to create a minimal system that could be used either by
 > putting it onto an SD card, or boot via fel with a usable initrd - without
 > needing to create an SD card. This was mainly because network support in
 > mainline on the H3 based OrangePi?s isn?t the best at the moment.

Ahh, yes - The plus has a onboard eMMC? The PC variant doesn't, so
that's not really an option there.

Still, the easiest is probably to just go with the sdcard image for now.

 > Is it possible to have a generic configuration (say OrangePi-H3) that is
 > shared and then configs that include the specifics for the OrangePi
 > Plus/PC etc?

We can have multiple defconfigs sharing the same board files, or a
single config working on multiple boards (if u-boot can detect the board
variant), but there's currently no support for having a base defconfig
that gets included/overridden by other defconfigs.

-- 
Venlig hilsen,
Peter Korsgaard 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-05-16  9:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-14 23:33 [Buildroot] [PATCH 0/3] OrangePi Plus: Add support Troy Dack
2016-05-14 23:33 ` [Buildroot] [PATCH 1/3] OrangePi Plus rootfs-overlay files Troy Dack
2016-05-15 21:06   ` Peter Korsgaard
2016-05-14 23:33 ` [Buildroot] [PATCH 2/3] OrangePi Plus files required to generate SD card image and a self extracting fel-boot command for booting from RAM using USB-OTG and sunxi-fel Troy Dack
2016-05-15 21:56   ` Peter Korsgaard
2016-05-14 23:33 ` [Buildroot] [PATCH 3/3] Default config for OrangePi Plus. Generates kernel using sunxi/for-next branch of git.kernel.org/git/mripard U-boot built from git tag v2016.05-rc3 Troy Dack
2016-05-15 21:47   ` Peter Korsgaard
2016-05-15 21:10 ` [Buildroot] [PATCH 0/3] OrangePi Plus: Add support Peter Korsgaard
2016-05-16  2:17   ` Troy Dack
2016-05-16  9:38     ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.