Skip to contentSkip to conversation

Add support for Firefly RK3288

PATCH New Ariel D'Alessandro 2 participants 5 messages Feb 15, 2016 – Feb 20, 2016

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for Firefly RK3288

Hi all,

This is a patchset v2 adding support for the Firefly RK3288 board [0]. It includes 2 defconfigs:
* configs/firefly_rk3288_defconfig: minimal configuration.
* configs/firefly_rk3288_demo_defconfig: Qt5 + EGLFS backend enabled.

In order to get Qt5 + EGLFS backend running on the board, a new mali-t76x package is added, which installs the required libraries for Mali Midgard GPU from ARM [1].

Although most of the kernel support for the board has been mainlined, the kernel is taken from Heiko St?bner's [2] devel/somewhat-stable branch as it includes the latest support and the Mali GPU drivers. The GPU drivers should be added as an extension separated from the kernel in the future.

Uboot bootloader is taken from mainline tag v2016.01.

The building process will output a 'sdcard.img' that is ready to be flash into a SD card and boot the board.

Changelog:
---------
v1 -> v2:
* Modified mali-t76x package so headers are installed by the mesa3d-headers package.
* Squashed commits 2/3 and 3/3.
* Added a minimal defconfig, besides the demo defconfig (Qt5 + EGLFS).
* Minor fixes.

Regards,

Links:
[0] http://en.t-firefly.com/en/firenow/firefly_rk3288/specifications/
[1] http://malideveloper.arm.com/resources/drivers/arm-mali-midgard-gpu-user-space-drivers/
[2] https://github.com/mmind/linux-rockchip

Ariel D'Alessandro (2):
mali-t76x: add new package
board/firefly_rk3288: add new board

 board/firefly/firefly-rk3288/extlinux.conf |  6 +++++
 board/firefly/firefly-rk3288/post-build.sh |  3 +++
 board/firefly/firefly-rk3288/post-image.sh | 20 +++++++++++++++
 board/firefly/firefly-rk3288/readme.txt    | 40 +++++++++++++++++++++++++++++
 board/firefly/firefly-rk3288/sd-image.cfg  | 22 ++++++++++++++++
 configs/firefly_rk3288_defconfig           | 33 ++++++++++++++++++++++++
 configs/firefly_rk3288_demo_defconfig      | 41 ++++++++++++++++++++++++++++++
 package/Config.in                          |  1 +
 package/mali-t76x/Config.in                | 28 ++++++++++++++++++++
 package/mali-t76x/egl.pc                   | 11 ++++++++
 package/mali-t76x/glesv2.pc                | 11 ++++++++
 package/mali-t76x/mali-t76x.hash           |  2 ++
 package/mali-t76x/mali-t76x.mk             | 27 ++++++++++++++++++++
 13 files changed, 245 insertions(+)
 create mode 100644 board/firefly/firefly-rk3288/extlinux.conf
 create mode 100755 board/firefly/firefly-rk3288/post-build.sh
 create mode 100755 board/firefly/firefly-rk3288/post-image.sh
 create mode 100644 board/firefly/firefly-rk3288/readme.txt
 create mode 100644 board/firefly/firefly-rk3288/sd-image.cfg
 create mode 100644 configs/firefly_rk3288_defconfig
 create mode 100644 configs/firefly_rk3288_demo_defconfig
 create mode 100644 package/mali-t76x/Config.in
 create mode 100644 package/mali-t76x/egl.pc
 create mode 100644 package/mali-t76x/glesv2.pc
 create mode 100644 package/mali-t76x/mali-t76x.hash
 create mode 100644 package/mali-t76x/mali-t76x.mk
Signature · 1 line
2.7.0
#1 lore raw

PATCH v2 1/2 mali-t76x: add new package

Package provides the binary user-space components for the ARM Mali Midgard T76X GPU.

Note that this package requires a kernel with the ARM Mali Midgard GPU Kernel Drivers enabled.

---
 package/Config.in                |  1 +
 package/mali-t76x/Config.in      | 28 ++++++++++++++++++++++++++++
 package/mali-t76x/egl.pc         | 11 +++++++++++
 package/mali-t76x/glesv2.pc      | 11 +++++++++++
 package/mali-t76x/mali-t76x.hash |  2 ++
 package/mali-t76x/mali-t76x.mk   | 27 +++++++++++++++++++++++++++
 6 files changed, 80 insertions(+)
 create mode 100644 package/mali-t76x/Config.in
 create mode 100644 package/mali-t76x/egl.pc
 create mode 100644 package/mali-t76x/glesv2.pc
 create mode 100644 package/mali-t76x/mali-t76x.hash
 create mode 100644 package/mali-t76x/mali-t76x.mk
package/Config.in +1 -0
index 09c2b40..274c451 100644
@@ -398,6 +398,7 @@ endif
 	source "package/lshw/Config.in"
 	source "package/lsuio/Config.in"
 	source "package/lvm2/Config.in"
+	source "package/mali-t76x/Config.in"
 	source "package/mdadm/Config.in"
 	source "package/memtest86/Config.in"
 	source "package/memtester/Config.in"
package/mali-t76x/Config.in new file +28 -0
new file mode 100644
index 0000000..6c2ae4e
@@ -0,0 +1,28 @@
+config BR2_PACKAGE_MALI_T76X
+	bool "mali-t76x"
+	select BR2_PACKAGE_MESA3D_HEADERS
+	select BR2_PACKAGE_HAS_LIBEGL
+	select BR2_PACKAGE_HAS_LIBGLES
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	depends on BR2_ARM_EABIHF
+	depends on BR2_arm
+	help
+	  Install the binary user-space components for the ARM Mali Midgard
+	  T76X GPU. This package requires a kernel with the ARM Mali Midgard
+	  GPU Kernel Drivers enabled.
+
+	  Source: http://malideveloper.arm.com/resources/drivers/
+
+if BR2_PACKAGE_MALI_T76X
+
+config BR2_PACKAGE_PROVIDES_LIBEGL
+	default "mali-t76x"
+
+config BR2_PACKAGE_PROVIDES_LIBGLES
+	default "mali-t76x"
+
+endif
+
+comment "mali-t76x needs an (e)glibc toolchain with armhf enabled"
+	depends on BR2_arm
+	depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_ARM_EABIHF
package/mali-t76x/egl.pc new file +11 -0
new file mode 100644
index 0000000..614b700
@@ -0,0 +1,11 @@
+prefix=/usr/
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: egl
+Description: ARM Mali implementation of EGL
+Version: 1.5
+Requires:
+Libs: -L${libdir} -lEGL -lGLESv2
+Cflags: -I${includedir} -DMESA_EGL_NO_X11_HEADERS
package/mali-t76x/glesv2.pc new file +11 -0
new file mode 100644
index 0000000..5997eac
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: glesv2
+Description: ARM Mali implementation of OpenGL ESv2
+Version: 2.0
+Requires:
+Libs: -L${libdir} -lGLESv2 -lGLESv1_CM
+Cflags: -I${includedir} -DMESA_EGL_NO_X11_HEADERS
package/mali-t76x/mali-t76x.hash new file +2 -0
new file mode 100644
index 0000000..a754b98
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256  5a0b00438edc8066b374481d3332a43c07ec2bd3bc73265983a968970f754902  mali-t76x_r5p0-06rel0_linux_1+fbdev.tar.gz
package/mali-t76x/mali-t76x.mk new file +27 -0
new file mode 100644
index 0000000..702f583
@@ -0,0 +1,27 @@
+################################################################################
+#
+# mali-t76x
+#
+################################################################################
+
+MALI_T76X_VERSION = r5p0-06rel0
+MALI_T76X_SOURCE = mali-t76x_$(MALI_T76X_VERSION)_linux_1+fbdev.tar.gz
+MALI_T76X_SITE = http://malideveloper.arm.com/downloads/drivers/binary/$(MALI_T76X_VERSION)
+
+MALI_T76X_INSTALL_STAGING = YES
+MALI_T76X_PROVIDES = libegl libgles
+
+define MALI_T76X_INSTALL_STAGING_CMDS
+	$(INSTALL) -m 755 $(@D)/*.so $(STAGING_DIR)/usr/lib/
+
+	$(INSTALL) -D -m 0644 package/mali-t76x/egl.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/egl.pc
+	$(INSTALL) -D -m 0644 package/mali-t76x/glesv2.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/glesv2.pc
+endef
+
+define MALI_T76X_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 755 $(@D)/*.so $(TARGET_DIR)/usr/lib/
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.7.0
#2 lore raw

PATCH v2 1/2 mali-t76x: add new package

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ariel" == Ariel D'Alessandro <[email protected]> writes:

Package provides the binary user-space components for the ARM Mali Midgard T76X GPU.

Note that this package requires a kernel with the ARM Mali Midgard GPU Kernel Drivers enabled.

Committed to next, thanks.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard 
#3 lore raw

PATCH v2 2/2 board/firefly_rk3288: add new board

In reply to Ariel D'Alessandro

This commit adds basic configuration files for the Firefly RK3288 board. Both minimal and demo defconfigs are added. The latter enables Qt5 with the required Mali T76X GPU user space components.

More info about the board:
http://en.t-firefly.com/en/firenow/firefly_rk3288/specifications/

---
 board/firefly/firefly-rk3288/extlinux.conf |  6 +++++
 board/firefly/firefly-rk3288/post-build.sh |  3 +++
 board/firefly/firefly-rk3288/post-image.sh | 20 +++++++++++++++
 board/firefly/firefly-rk3288/readme.txt    | 40 +++++++++++++++++++++++++++++
 board/firefly/firefly-rk3288/sd-image.cfg  | 22 ++++++++++++++++
 configs/firefly_rk3288_defconfig           | 33 ++++++++++++++++++++++++
 configs/firefly_rk3288_demo_defconfig      | 41 ++++++++++++++++++++++++++++++
 7 files changed, 165 insertions(+)
 create mode 100644 board/firefly/firefly-rk3288/extlinux.conf
 create mode 100755 board/firefly/firefly-rk3288/post-build.sh
 create mode 100755 board/firefly/firefly-rk3288/post-image.sh
 create mode 100644 board/firefly/firefly-rk3288/readme.txt
 create mode 100644 board/firefly/firefly-rk3288/sd-image.cfg
 create mode 100644 configs/firefly_rk3288_defconfig
 create mode 100644 configs/firefly_rk3288_demo_defconfig
board/firefly/firefly-rk3288/extlinux.conf new file +6 -0
new file mode 100644
index 0000000..39ac5b9
@@ -0,0 +1,6 @@
+default firefly-rk3288
+
+label firefly-rk3288
+kernel /boot/uImage
+devicetree /boot/rk3288-firefly.dtb
+append console=ttyS2,115200n8 root=/dev/mmcblk0p1 rootwait
board/firefly/firefly-rk3288/post-build.sh new file +3 -0
new file mode 100755
index 0000000..94e89ce
@@ -0,0 +1,3 @@
+BOARD_DIR="$(dirname $0)"
+
+install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
board/firefly/firefly-rk3288/post-image.sh new file +20 -0
new file mode 100755
index 0000000..1dd30a6
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+MKIMAGE=$HOST_DIR/usr/bin/mkimage
+
+BOARD_DIR="$(dirname $0)"
+GENIMAGE_CFG="${BOARD_DIR}/sd-image.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+$MKIMAGE -n rk3288 -T rksd -d $BINARIES_DIR/u-boot-spl-dtb.bin $BINARIES_DIR/u-boot-spl-dtb.img
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage							\
+	--rootpath "${TARGET_DIR}"		\
+	--tmppath "${GENIMAGE_TMP}"		\
+	--inputpath "${BINARIES_DIR}"	\
+	--outputpath "${BINARIES_DIR}"	\
+	--config "${GENIMAGE_CFG}"
+
+exit $?
board/firefly/firefly-rk3288/readme.txt new file +40 -0
new file mode 100644
index 0000000..d621085
@@ -0,0 +1,40 @@
+Firefly RK3288
+
+How to build it
+===============
+
+  $ make firefly_rk3288_defconfig
+
+Then you can edit the build options using
+
+  $ make menuconfig
+
+Compile all and build rootfs image:
+
+  $ make
+
+Result of the build
+-------------------
+
+After building, you should get a tree like this:
+
+  output/images/
+  ??? rk3288-firefly.dtb
+  ??? rootfs.ext2
+  ??? rootfs.ext4 -> rootfs.ext2
+  ??? sdcard.img
+  ??? u-boot-dtb.img
+  ??? u-boot-spl-dtb.bin
+  ??? u-boot-spl-dtb.img
+  ??? uImage
+
+Prepare your SDCard
+===================
+
+Buildroot generates a ready-to-use SD card image that you can flash directly to
+the card. The image will be in output/images/sdcard.img.
+You can write this image directly to an SD card device (i.e. /dev/xxx):
+
+  $ dd if=output/images/sdcard.img of=/dev/xxx
+
+Finally, you can insert the SD card to the Firefly RK3288 board and boot it.
board/firefly/firefly-rk3288/sd-image.cfg new file +22 -0
new file mode 100644
index 0000000..a9eb9f0
@@ -0,0 +1,22 @@
+image sdcard.img {
+  hdimage {
+  }
+
+  partition u-boot-spl-dtb {
+    in-partition-table = "no"
+    image = "u-boot-spl-dtb.img"
+    offset = 32K
+  }
+
+  partition u-boot-dtb {
+    in-partition-table = "no"
+    image = "u-boot-dtb.img"
+    offset = 128K
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext4"
+    size = 512M
+  }
+}
configs/firefly_rk3288_defconfig new file +33 -0
new file mode 100644
index 0000000..a4eaa44
@@ -0,0 +1,33 @@
+BR2_arm=y
+BR2_cortex_a12=y
+BR2_ARM_FPU_NEON_VFPV4=y
+BR2_KERNEL_HEADERS_VERSION=y
+BR2_DEFAULT_KERNEL_VERSION="4.4"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+BR2_TARGET_GENERIC_HOSTNAME="firefly-rk3288"
+BR2_TARGET_GENERIC_ISSUE="Welcome to FIREFLY RK3288!"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/firefly/firefly-rk3288/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/firefly/firefly-rk3288/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git at github.com:mmind/linux-rockchip.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="ccb89e9b5657b4911c16d08e1581121222ee12c4"
+BR2_LINUX_KERNEL_DEFCONFIG="rk3288_veyron"
+BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x02000000"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="rk3288-firefly"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.01"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="firefly-rk3288"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_FORMAT_DTB_IMG=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl-dtb.bin"
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
configs/firefly_rk3288_demo_defconfig new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.7.0
#4 lore raw

PATCH v2 2/2 board/firefly_rk3288: add new board

Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ariel" == Ariel D'Alessandro <[email protected]> writes:

This commit adds basic configuration files for the Firefly RK3288 board. Both minimal and demo defconfigs are added. The latter enables Qt5 with the required Mali T76X GPU user space components.

More info about the board:
http://en.t-firefly.com/en/firenow/firefly_rk3288/specifications/

+++ b/configs/firefly_rk3288_defconfig

configs/firefly_rk3288_defconfig line 5

Quoted 5 lines
configs/firefly_rk3288_defconfig new file +5 -0
@@ -0,0 +1,33 @@
+BR2_arm=y
+BR2_cortex_a12=y
+BR2_ARM_FPU_NEON_VFPV4=y
+BR2_KERNEL_HEADERS_VERSION=y
+BR2_DEFAULT_KERNEL_VERSION="4.4"

We now default the kernel headers to get them from the kernel source if you build a Linux kernel, so these two lines can be removed from both defconfigs.

Committed to next with that fixed, thanks.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard