aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/imx6/image
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/imx6/image')
-rw-r--r--target/linux/imx6/image/Makefile33
-rw-r--r--target/linux/imx6/image/bootscript-apalis20
-rw-r--r--target/linux/imx6/image/recovery-apalis14
3 files changed, 67 insertions, 0 deletions
diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile
index fa10b756a1..85d6823021 100644
--- a/target/linux/imx6/image/Makefile
+++ b/target/linux/imx6/image/Makefile
@@ -58,6 +58,12 @@ define Build/boot-scr
$(BIN_DIR)/boot.scr
endef
+define Build/recovery-scr
+ mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
+ -n '$(DEVICE_ID) OpenWrt recovery bootscript' \
+ -d ./recovery-$(DEVICE_NAME) $@
+endef
+
define Build/imx6-combined-image-prepare
rm -rf $@.boot
mkdir -p $@.boot
@@ -101,6 +107,10 @@ define Build/imx6-sdcard
$(Build/imx6-combined-image-clean)
endef
+define Build/apalis-emmc
+ $(Build/imx6-combined-image-prepare)
+ $(Build/imx6-combined-image)
+ $(Build/imx6-combined-image-clean)
endef
#################################################
@@ -190,4 +200,27 @@ define Device/cubox-i
endef
TARGET_DEVICES += cubox-i
+define Device/apalis
+ DEVICE_TITLE := Toradex Apalis family
+ SUPPORTED_DEVICES := apalis,ixora apalis,eval
+ DEVICE_DTS := \
+ imx6q-apalis-eval \
+ imx6q-apalis-ixora \
+ imx6q-apalis-ixora-v1.1
+ DEVICE_PACKAGES := \
+ kmod-can kmod-can-flexcan kmod-can-raw \
+ kmod-leds-gpio kmod-gpio-button-hotplug \
+ kmod-pps-gpio kmod-rtc-ds1307
+ BOOT_SCRIPT := bootscript-apalis
+ UBOOT := apalis_imx6
+ FILESYSTEMS := squashfs
+ IMAGES := combined.bin sysupgrade.bin
+ IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
+ IMAGE/combined.bin := append-rootfs | pad-extra 128k | apalis-emmc
+ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+ ARTIFACTS := recovery.scr
+ ARTIFACT/recovery.scr := recovery-scr
+endef
+TARGET_DEVICES += apalis
+
$(eval $(call BuildImage))
diff --git a/target/linux/imx6/image/bootscript-apalis b/target/linux/imx6/image/bootscript-apalis
new file mode 100644
index 0000000000..81a501cc63
--- /dev/null
+++ b/target/linux/imx6/image/bootscript-apalis
@@ -0,0 +1,20 @@
+echo "Toradex Apalis OpenWrt Boot script v1.0"
+
+run finduuid
+
+setenv nextcon 0
+setenv fdt_file imx6q-apalis-ixora.dtb
+setenv root root=PARTUUID=${uuid} rootfstype=squashfs rootwait
+setenv bootargs earlyprintk console=${console},${baudrate}n8 ${root}
+setenv fsload ext4load mmc ${mmcbootdev}:${bootpart}
+
+if ${fsload} ${kernel_addr_r} ${boot_file}; then
+ if ${fsload} ${fdt_addr_r} ${fdt_file}; then
+ test -n "$fdt_fixup" && run fdt_fixup
+ bootm ${kernel_addr_r} - ${fdt_addr_r}
+ else
+ echo "Error loading device-tree"
+ fi
+else
+ echo "Error loading kernel image"
+fi
diff --git a/target/linux/imx6/image/recovery-apalis b/target/linux/imx6/image/recovery-apalis
new file mode 100644
index 0000000000..c1c5a3f5d6
--- /dev/null
+++ b/target/linux/imx6/image/recovery-apalis
@@ -0,0 +1,14 @@
+# flash u-boot-with-spl.imx
+# using fixed size of 1M for U-Boot + SPL
+mmc dev 0 1
+mmc write 0x12100000 0x2 0x800
+
+# flash openwrt-imx6-apalis-squashfs.combined.bin
+run set_blkcnt
+mmc dev 0 0
+mmc write 0x12500000 0 ${blkcnt}
+
+env default -f -a
+saveenv
+
+reset