From ded905ce431bfdb4809124e0f0a587013f980b07 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 26 Aug 2018 20:04:08 +0200 Subject: imx6: extend cubox support to hummingboard, add support for building full images Signed-off-by: Felix Fietkau --- target/linux/imx6/Makefile | 2 +- target/linux/imx6/image/Makefile | 45 +++++++++++++++++++++++++++++--- target/linux/imx6/image/bootscript-cubox | 19 +++++++++----- 3 files changed, 54 insertions(+), 12 deletions(-) (limited to 'target/linux/imx6') diff --git a/target/linux/imx6/Makefile b/target/linux/imx6/Makefile index ba270df9e8..73512ca986 100644 --- a/target/linux/imx6/Makefile +++ b/target/linux/imx6/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk ARCH:=arm BOARD:=imx6 BOARDNAME:=Freescale i.MX 6 -FEATURES:=audio display fpu gpio pcie rtc usb usbgadget squashfs targz nand ubifs +FEATURES:=audio display fpu gpio pcie rtc usb usbgadget squashfs targz nand ubifs boot-part rootfs-part CPU_TYPE:=cortex-a9 CPU_SUBTYPE:=neon MAINTAINER:=Luka Perkov diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile index 540692d817..b6885eff60 100644 --- a/target/linux/imx6/image/Makefile +++ b/target/linux/imx6/image/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/image.mk # Images ################################################# -DEVICE_VARS += MKUBIFS_OPTS +DEVICE_VARS += MKUBIFS_OPTS UBOOT BOOT_SCRIPT define Build/boot-overlay rm -rf $@.boot @@ -58,6 +58,38 @@ define Build/boot-scr $(BIN_DIR)/boot.scr endef +define Build/imx6-sdcard + rm -rf $@.boot + mkdir -p $@.boot + + $(CP) $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.img $@.boot/u-boot.img + $(CP) $(IMAGE_KERNEL) $@.boot/uImage + + $(foreach dts,$(DEVICE_DTS), \ + $(CP) \ + $(DTS_DIR)/$(dts).dtb \ + $@.boot/; + ) + + mkimage -A arm -O linux -T script -C none -a 0 -e 0 \ + -n '$(DEVICE_ID) OpenWrt bootscript' \ + -d $(BOOT_SCRIPT) \ + $@.boot/boot.scr + + cp $@ $@.fs + + $(SCRIPT_DIR)/gen_image_generic.sh $@ \ + $(CONFIG_TARGET_KERNEL_PARTSIZE) \ + $@.boot \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) \ + $@.fs \ + 1024 + + dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-SPL of=$@ bs=1024 seek=1 conv=notrunc + + rm -rf $@.boot $@.fs +endef + ################################################# # Devices ################################################# @@ -72,7 +104,6 @@ define Device/Default KERNEL_NAME := zImage KERNEL_PREFIX := $$(IMAGE_PREFIX) KERNEL := kernel-bin | uImage none - IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2) IMAGES := endef @@ -103,6 +134,7 @@ define Device/ventana kobs-ng KERNEL += | boot-overlay IMAGES := nand.ubi bootfs.tar.gz + IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2) UBINIZE_PARTS = boot=$$(KDIR_KERNEL_IMAGE).boot.ubifs=15 IMAGE/nand.ubi := append-ubi IMAGE/bootfs.tar.gz := bootfs.tar.gz | install-dtb @@ -131,11 +163,16 @@ endef TARGET_DEVICES += wandboard define Device/cubox-i - KERNEL := kernel-bin | install-dtb | boot-scr + KERNEL := kernel-bin | install-dtb + UBOOT := mx6cuboxi + BOOT_SCRIPT = bootscript-cubox DEVICE_NAME := cubox DEVICE_TITLE := SolidRun CuBox-i DEVICE_PACKAGES := u-boot-mx6cuboxi kmod-drm-imx kmod-drm-imx-hdmi kmod-usb-hid - DEVICE_DTS := imx6q-cubox-i imx6dl-cubox-i + DEVICE_DTS := imx6q-cubox-i imx6dl-cubox-i imx6q-hummingboard imx6dl-hummingboard + IMAGES := combined.bin + FILESYSTEMS := squashfs + IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx6-sdcard endef TARGET_DEVICES += cubox-i diff --git a/target/linux/imx6/image/bootscript-cubox b/target/linux/imx6/image/bootscript-cubox index b639590720..2ed48ab941 100644 --- a/target/linux/imx6/image/bootscript-cubox +++ b/target/linux/imx6/image/bootscript-cubox @@ -4,10 +4,15 @@ echo "CuBox OpenWrt Boot script" setenv console console=ttymxc0,115200 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 # Find correct dtb -if test ${board_name} = CUBOXI && test ${board_rev} = MX6DL; then - setenv fdt_name imx6dl.dtb; -elif test ${board_name} = CUBOXI && test ${board_rev} = MX6Q; then - setenv fdt_name imx6q-cubox-i.dtb; +if test ${board_rev} = MX6DL; then + setenv fdt_soc_type imx6dl; +elif test ${board_rev} = MX6Q; then + setenv fdt_soc_type imx6q; +fi +if test ${board_name} = CUBOXI; then + setenv fdt_name ${fdt_soc_type}-cubox-i.dtb; +elif test ${board_name} = HUMMINGBOARD; then + setenv fdt_name ${fdt_soc_type}-hummingboard.dtb; fi # Set correct devtype and partition @@ -19,8 +24,8 @@ elif mmc dev 1; then fi # Boot from the SD card is supported at the moment -setenv bootargs "${console} root=/dev/mmcblk1p1 rw rootwait" +setenv bootargs "${console} root=/dev/mmcblk1p2 rw rootwait" mmc dev ${mmcdev} -load ${devtype} ${mmcdev}:${devplist} ${kernel_addr_r} /boot/openwrt-imx6-cubox-i-uImage -load ${devtype} ${mmcdev}:${devplist} ${fdt_addr_r} /boot/openwrt-imx6-${fdt_name} +load ${devtype} ${mmcdev}:${devplist} ${kernel_addr_r} /uImage +load ${devtype} ${mmcdev}:${devplist} ${fdt_addr_r} /${fdt_name} bootz ${kernel_addr_r} - ${fdt_addr_r} -- cgit v1.2.3