Skip to contentSkip to conversation

board: add support for nexbox a95x

PATCH New Peter Korsgaard 1 participant 2 messages Feb 17, 2017 – Feb 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: add support for nexbox a95x

Nexbox A95X is a low cost Android STB based around an Amlogic s905(x) SoC (quad A53), 8/16GB eMMC and 1/2GB RAM.

Both the s905 (gxbb) and s905x (gxl) variant is supported.

This defconfig uses mainline Linux. As the mainline support for s905 is quite young, use the latest release candidate. There is currently no support for this board in U-Boot or sources available for the vendor U-Boot, so the defconfig doesn't build a u-boot and instead uses the existing U-Boot available in the eMMC. This also means that we need to wrap the kernel as uImage, which isn't suppported for aarch64. Instead this is done in the post-build script.

Mainline aarch64 defconfig builds most drivers modular, so add mdev for module autoloading.

---
 board/nexbox/a95x/boot.txt      | 11 ++++++++++
 board/nexbox/a95x/genimage.cfg  | 28 ++++++++++++++++++++++++
 board/nexbox/a95x/post-build.sh | 12 +++++++++++
 board/nexbox/a95x/post-image.sh | 14 ++++++++++++
 board/nexbox/a95x/readme.txt    | 48 +++++++++++++++++++++++++++++++++++++++++
 configs/nexbox_a95x_defconfig   | 19 ++++++++++++++++
 6 files changed, 132 insertions(+)
 create mode 100644 board/nexbox/a95x/boot.txt
 create mode 100644 board/nexbox/a95x/genimage.cfg
 create mode 100755 board/nexbox/a95x/post-build.sh
 create mode 100755 board/nexbox/a95x/post-image.sh
 create mode 100644 board/nexbox/a95x/readme.txt
 create mode 100644 configs/nexbox_a95x_defconfig
board/nexbox/a95x/boot.txt new file +11 -0
new file mode 100644
index 000000000..b538b4a9a
@@ -0,0 +1,11 @@
+setenv bootargs console=ttyAML0,115200 earlyprintk root=/dev/mmcblk1p2 rootwait
+
+fatload mmc 0:1 0x01080000 uImage
+
+if itest.s "${aml_dt}" == "gxl_p212_2g"; then
+	fatload mmc 0:1 $dtb_mem_addr meson-gxl-nexbox-a95x.dtb
+else
+	fatload mmc 0:1 $dtb_mem_addr meson-gxbb-nexbox-a95x.dtb
+fi
+
+bootm 0x1080000 - $dtb_mem_addr
board/nexbox/a95x/genimage.cfg new file +28 -0
new file mode 100644
index 000000000..c6c80f860
@@ -0,0 +1,28 @@
+image boot.vfat {
+	vfat {
+		files = {
+			"uImage",
+			"meson-gxbb-nexbox-a95x.dtb",
+			"meson-gxl-nexbox-a95x.dtb",
+			"boot.scr"
+		}
+	}
+	size = 32M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+		size = 512M
+	}
+}
board/nexbox/a95x/post-build.sh new file +12 -0
new file mode 100755
index 000000000..9f4cc0451
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+MKIMAGE=$HOST_DIR/usr/bin/mkimage
+
+$MKIMAGE -C none -A arm64 -T script -d $BOARD_DIR/boot.txt $BINARIES_DIR/boot.scr
+
+# vendor u-boot uses uImage
+if [ -e $BINARIES_DIR/Image ]; then
+    $MKIMAGE -A arm64 -O linux -T kernel -C none -a 0x1080000 -e 0x1080000 \
+	     -n linux -d $BINARIES_DIR/Image $BINARIES_DIR/uImage
+fi
board/nexbox/a95x/post-image.sh new file +14 -0
new file mode 100755
index 000000000..359b4c9e7
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage                               \
+	--rootpath "${TARGET_DIR}"     \
+	--tmppath "${GENIMAGE_TMP}"    \
+	--inputpath "${BINARIES_DIR}"  \
+	--outputpath "${BINARIES_DIR}" \
+	--config "${GENIMAGE_CFG}"
board/nexbox/a95x/readme.txt new file +48 -0

48 lines not on this page · raw message

configs/nexbox_a95x_defconfig new file +19 -0
new file mode 100644
index 000000000..fe02efd8e
@@ -0,0 +1,19 @@
+BR2_aarch64=y
+BR2_KERNEL_HEADERS_4_9=y
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
+BR2_SYSTEM_DHCP="eth0"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/nexbox/a95x/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/nexbox/a95x/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.10-rc8"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="amlogic/meson-gxbb-nexbox-a95x amlogic/meson-gxl-nexbox-a95x"
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 board: add support for nexbox a95x

Quoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

Nexbox A95X is a low cost Android STB based around an Amlogic s905(x) SoC (quad A53), 8/16GB eMMC and 1/2GB RAM.

Both the s905 (gxbb) and s905x (gxl) variant is supported.

This defconfig uses mainline Linux. As the mainline support for s905 is quite young, use the latest release candidate. There is currently no support for this board in U-Boot or sources available for the vendor U-Boot, so the defconfig doesn't build a u-boot and instead uses the existing U-Boot available in the eMMC. This also means that we need to wrap the kernel as uImage, which isn't suppported for aarch64. Instead this is done in the post-build script.

Quoted 4 lines

Mainline aarch64 defconfig builds most drivers modular, so add mdev for module autoloading.

Committed to next after explicitly setting BR2_cortex_a53=y in the defconfig.

Signature · 1 line
Bye, Peter Korsgaard