# Images
#################################################
-DEVICE_VARS += MKUBIFS_OPTS
+DEVICE_VARS += MKUBIFS_OPTS UBOOT BOOT_SCRIPT
define Build/boot-overlay
rm -rf $@.boot
$(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
#################################################
KERNEL_NAME := zImage
KERNEL_PREFIX := $$(IMAGE_PREFIX)
KERNEL := kernel-bin | uImage none
- IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
IMAGES :=
endef
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
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
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
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}