imx6: add support for UDOO Dual and Quad boards udoo
authorStijn Tintel <stijn@linux-ipv6.be>
Mon, 12 Nov 2018 17:11:21 +0000 (19:11 +0200)
committerStijn Tintel <stijn@linux-ipv6.be>
Mon, 9 Sep 2019 12:08:44 +0000 (15:08 +0300)
package/boot/uboot-imx6/Makefile
package/kernel/linux/modules/video.mk
target/linux/imx6/base-files/etc/board.d/02_network
target/linux/imx6/base-files/lib/imx6.sh
target/linux/imx6/base-files/lib/upgrade/platform.sh
target/linux/imx6/image/Makefile
target/linux/imx6/image/bootscript-udoo [new file with mode: 0644]

index 193a35d27cb0c4faac7c7a4073c2aab92072d200..636e77b7742acc25c8a73540a4911a0c74eb61c1 100644 (file)
@@ -62,6 +62,13 @@ define U-Boot/nitrogen6s1g
   NAME:=Nitrogen6x i.MX6Solo 1GB board
 endef
 
+define U-Boot/udoo
+  NAME:=UDOO Dual/Quad
+  BUILD_DEVICES:=udoo
+  UBOOT_IMAGE:=SPL u-boot.img
+  UBOOT_MAKE_FLAGS:=SPL u-boot.img
+endef
+
 define U-Boot/wandboard
   NAME:=Wandboard Dual Lite/Quad/Solo
   BUILD_DEVICES:=wandboard
@@ -77,6 +84,7 @@ UBOOT_TARGETS := \
        nitrogen6q2g \
        nitrogen6s \
        nitrogen6s1g \
+       udoo \
        wandboard
 
 UBOOT_MAKE_FLAGS += u-boot.imx
index f9d5c1b1bbcaf8ea15e723a3dbe5d0054e86c299..11372a75f39377aff21f41329a3a47e466a38597 100644 (file)
@@ -295,6 +295,23 @@ endef
 
 $(eval $(call KernelPackage,drm-amdgpu))
 
+define KernelPackage/drm-etnaviv
+  SUBMENU:=$(VIDEO_MENU)
+  TITLE:=Vivante DRM support
+  DEPENDS:=@TARGET_imx6 +kmod-drm +kmod-thermal
+  KCONFIG:= \
+       CONFIG_CMA=y \
+       CONFIG_DRM_ETNAVIV \
+       CONFIG_DRM_ETNAVIV_THERMAL=y
+  FILES:=$(LINUX_DIR)/drivers/gpu/drm/etnaviv/etnaviv.ko
+AUTOLOAD:=$(call AutoProbe,etnaviv)
+endef
+
+define KernelPackage/drm-etnaviv/description
+  DRM Driver for Vivante GPUs
+endef
+
+$(eval $(call KernelPackage,drm-etnaviv))
 
 define KernelPackage/drm-imx
   SUBMENU:=$(VIDEO_MENU)
@@ -313,7 +330,8 @@ define KernelPackage/drm-imx
        CONFIG_DRM_IMX_PARALLEL_DISPLAY=n \
        CONFIG_DRM_IMX_TVE=n \
        CONFIG_DRM_IMX_LDB=n \
-       CONFIG_DRM_IMX_HDMI=n
+       CONFIG_DRM_IMX_HDMI=n \
+       CONFIG_VIDEOMODE_HELPERS
   FILES:= \
        $(LINUX_DIR)/drivers/gpu/drm/imx/imxdrm.ko \
        $(LINUX_DIR)/drivers/gpu/ipu-v3/imx-ipu-v3.ko
index 6ec667346df86ab5f1115232f21e31478a8d2024..da087b1c3d16b912f32580659f1e6828a982f42b 100755 (executable)
@@ -13,7 +13,8 @@ case "$board" in
 cubox-i |\
 *gw51xx |\
 *gw52xx |\
-*gw5904)
+*gw5904 |\
+udoo)
        ucidef_set_interface_lan 'eth0'
        ;;
 *gw53xx |\
index 68caaff15fe72b33ea57a9c42eff38f654a16a87..21830753d2af5c0e2de6b600690a52e5249ef21d 100755 (executable)
@@ -95,6 +95,11 @@ imx6_board_detect() {
                name="apalis,eval"
                ;;
 
+       "Udoo i.MX6 Dual Board" |\
+       "Udoo i.MX6 Quad Board")
+               name="udoo"
+               ;;
+
        "Wandboard i.MX6 Dual Lite Board")
                name="wandboard"
                ;;
index 0dfaf0163d0aa5dc5e13e4b8c6236a69cd59bd63..0743b1b5408d284136204096e500491179bc6159 100755 (executable)
@@ -41,6 +41,10 @@ platform_check_image() {
                nand_do_platform_check $board $1
                return $?;
                ;;
+       udoo)
+               blkdev_check_image "$1"
+               return $?;
+               ;;
        esac
 
        echo "Sysupgrade is not yet supported on $board."
@@ -57,6 +61,9 @@ platform_do_upgrade() {
        *gw5*)
                nand_do_upgrade "$1"
                ;;
+       udoo)
+               blkdev_do_upgrade "$1"
+               ;;
        esac
 }
 
index 85d68230215d669cc2cc1ad64ebebe7d6e13262c..1fec4d6d0d98edd58eda477746407f7ed4e77d6a 100644 (file)
@@ -223,4 +223,19 @@ define Device/apalis
 endef
 TARGET_DEVICES += apalis
 
+define Device/udoo
+  BOOT_SCRIPT = bootscript-udoo
+  DEVICE_DTS := imx6dl-udoo imx6q-udoo
+  DEVICE_TITLE := UDOO Dual/Quad
+  DEVICE_PACKAGES := \
+       kmod-drm-imx kmod-drm-imx-hdmi kmod-rt2800-usb kmod-sound-soc-imx \
+       kmod-usb-hid wpad
+  IMAGES := combined.bin
+  IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx6-sdcard
+  KERNEL := kernel-bin | install-dtb
+  KERNEL_LOADADDR := 0x12000000
+  UBOOT := udoo
+endef
+TARGET_DEVICES += udoo
+
 $(eval $(call BuildImage))
diff --git a/target/linux/imx6/image/bootscript-udoo b/target/linux/imx6/image/bootscript-udoo
new file mode 100644 (file)
index 0000000..7b61362
--- /dev/null
@@ -0,0 +1,28 @@
+echo "UDOO OpenWrt Boot script"
+
+# Set console variable for both UART and HDMI
+setenv console console=ttymxc1,115200 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32
+
+# Find correct dtb
+if test ${board_rev} = MX6DL; then
+       setenv fdt_soc_type imx6dl;
+elif test ${board_rev} = MX6Q; then
+       setenv fdt_soc_type imx6q;
+fi
+
+setenv fdt_name ${fdt_soc_type}-udoo.dtb;
+
+# Set correct devtype and partition
+if test ${devtype} != mmc; then setenv devtype mmc; fi
+if mmc dev 0; then
+       setenv mmcdev 0
+elif mmc dev 1; then
+       setenv mmcdev 1
+fi
+
+# Boot from the SD card is supported at the moment
+setenv bootargs "${console} root=/dev/mmcblk0p2 rw rootwait"
+mmc dev ${mmcdev}
+load ${devtype} ${mmcdev}:${devplist} ${loadaddr} /uImage
+load ${devtype} ${mmcdev}:${devplist} ${fdt_addr} /${fdt_name}
+bootz ${loadaddr} - ${fdt_addr}