aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/imx6/image
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2018-11-23 10:33:24 +0100
committerPetr Štetiar <ynezz@true.cz>2019-04-08 18:37:04 +0200
commitd23222a96caeca5f83d22ffd55e210da30eaa379 (patch)
tree1b7a57958ff0569d5cd8b5131f92e595d3114ea5 /target/linux/imx6/image
parentdc1a73984e640ded21c7fe1abc8de2d5585ae0bd (diff)
downloadupstream-d23222a96caeca5f83d22ffd55e210da30eaa379.tar.gz
upstream-d23222a96caeca5f83d22ffd55e210da30eaa379.tar.bz2
upstream-d23222a96caeca5f83d22ffd55e210da30eaa379.zip
imx6: Add support for Toradex Apalis family of CoMs
This patch adds support for the following computer on modules (CoM) from Toradex[A]: Apalis iMX6 Quad 2GB IT - i.MX 6Quad 800MHz, 2GB DDR3, 4GB eMMC -40° to +85° C Temp Apalis iMX6 Quad 1GB - i.MX 6Quad 1GHz, 1GB DDR3, 4GB eMMC 0° to +70° C Temp Apalis iMX6 Dual 1GB IT - i.MX 6Dual 800MHz, 1GB DDR3, 4GB eMMC -40° to +85° C Temp Apalis iMX6 Dual 512MB - i.MX 6Dual 1GHz, 512MB DDR3, 4GB eMMC 0° to +70° C Temp I've developed and tested it on Quad 2GB IT v1.1A and Dual 512MB v1.1A CoMs, using Ixora[B] carrier board v1.0A, but it should hopefuly work on Eval[C] board as well. A. https://www.toradex.com/computer-on-modules/apalis-arm-family/nxp-freescale-imx-6 B. https://www.toradex.com/products/carrier-board/ixora-carrier-board C. https://www.toradex.com/products/carrier-board/apalis-evaluation-board Flashing/recovery instructions: 1. Download and compile imx_loader for OpenWrt from https://github.com/ynezz/imx_loader 2. Enter recovery mode as desribed in https://developer.toradex.com/knowledge-base/imx-recovery-mode 3. Connect board via USB to the host computer, check that it's connected by lsusb: 15a2:0054 Freescale Semiconductor, Inc. i.MX 6Dual/6Quad SystemOnChip in RecoveryMode 4. Copy following OpenWrt images to imx_loader directory: SPL u-boot.img u-boot-with-spl.imx openwrt-imx6-apalis-recovery.scr openwrt-imx6-apalis-squashfs.combined.bin 5. Run imx_usb in imx_loader directory Signed-off-by: Petr Štetiar <ynezz@true.cz>
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