aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/image
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/layerscape/image')
-rw-r--r--target/linux/layerscape/image/Makefile10
-rw-r--r--target/linux/layerscape/image/armv7.mk16
-rw-r--r--target/linux/layerscape/image/armv8_64b.mk69
-rwxr-xr-xtarget/linux/layerscape/image/gen_sdcard_head_img.sh22
4 files changed, 117 insertions, 0 deletions
diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile
index b275ef71cc..a08cc2c2cb 100644
--- a/target/linux/layerscape/image/Makefile
+++ b/target/linux/layerscape/image/Makefile
@@ -9,6 +9,10 @@ include $(INCLUDE_DIR)/image.mk
ITB_BOARDS = traverse-five64
+LS_SD_ROOTFSPART_OFFSET = 64
+LS_SD_IMAGE_SIZE = $(shell echo $$((($(LS_SD_ROOTFSPART_OFFSET) + \
+ $(CONFIG_TARGET_ROOTFS_PARTSIZE)) * 1024 * 1024)))
+
define Build/ls-clean
rm -f $@
endef
@@ -22,6 +26,12 @@ define Build/ls-append-dtb
dd if=$(DTS_DIR)/$(1).dtb >> $@
endef
+define Build/ls-append-sdhead
+ ./gen_sdcard_head_img.sh $(STAGING_DIR_IMAGE)/$(1)-sdcard-head.img \
+ $(LS_SD_ROOTFSPART_OFFSET) $(CONFIG_TARGET_ROOTFS_PARTSIZE)
+ dd if=$(STAGING_DIR_IMAGE)/$(1)-sdcard-head.img >> $@
+endef
+
define Build/traverse-fit
./mkits-multiple-config.sh -o $@.its -A $(LINUX_KARCH) \
-v $(LINUX_VERSION) -k $@ -a $(KERNEL_LOADADDR) \
diff --git a/target/linux/layerscape/image/armv7.mk b/target/linux/layerscape/image/armv7.mk
index 59cc982017..7a582d79bf 100644
--- a/target/linux/layerscape/image/armv7.mk
+++ b/target/linux/layerscape/image/armv7.mk
@@ -29,3 +29,19 @@ define Device/ls1021atwr
append-rootfs | pad-rootfs | check-size 67108865
endef
TARGET_DEVICES += ls1021atwr
+
+define Device/ls1021atwr-sdboot
+ DEVICE_TITLE := LS1021ATWR (SD Card Boot)
+ DEVICE_DTS := ls1021a-twr
+ FILESYSTEMS := ext4
+ IMAGES := sdcard.img
+ IMAGE/sdcard.img := \
+ ls-clean | \
+ ls-append-sdhead $(1) | pad-to 4K | \
+ ls-append $(1)-uboot.bin | pad-to 3M | \
+ ls-append $(1)-uboot-env.bin | pad-to 15M | \
+ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
+ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
+ append-rootfs | check-size $(LS_SD_IMAGE_SIZE)
+endef
+TARGET_DEVICES += ls1021atwr-sdboot
diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk
index 15963eb912..a144fd0c66 100644
--- a/target/linux/layerscape/image/armv8_64b.mk
+++ b/target/linux/layerscape/image/armv8_64b.mk
@@ -85,6 +85,27 @@ define Device/ls1043ardb
endef
TARGET_DEVICES += ls1043ardb
+define Device/ls1043ardb-sdboot
+ DEVICE_TITLE := LS1043ARDB (SD Card Boot)
+ DEVICE_PACKAGES += \
+ layerscape-fman-ls1043ardb \
+ layerscape-ppa-ls1043ardb
+ DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk
+ FILESYSTEMS := ext4
+ IMAGES := sdcard.img
+ IMAGE/sdcard.img := \
+ ls-clean | \
+ ls-append-sdhead $(1) | pad-to 4K | \
+ ls-append $(1)-uboot.bin | pad-to 3M | \
+ ls-append $(1)-uboot-env.bin | pad-to 4M | \
+ ls-append ls1043ardb-ppa.itb | pad-to 9M | \
+ ls-append ls1043ardb-fman.bin | pad-to 15M | \
+ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
+ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
+ append-rootfs | check-size $(LS_SD_IMAGE_SIZE)
+endef
+TARGET_DEVICES += ls1043ardb-sdboot
+
define Device/ls1046ardb
DEVICE_TITLE := LS1046ARDB
DEVICE_PACKAGES += \
@@ -109,6 +130,27 @@ define Device/ls1046ardb
endef
TARGET_DEVICES += ls1046ardb
+define Device/ls1046ardb-sdboot
+ DEVICE_TITLE := LS1046ARDB (SD Card Boot)
+ DEVICE_PACKAGES += \
+ layerscape-fman-ls1046ardb \
+ layerscape-ppa-ls1046ardb
+ DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk
+ FILESYSTEMS := ext4
+ IMAGES := sdcard.img
+ IMAGE/sdcard.img := \
+ ls-clean | \
+ ls-append-sdhead $(1) | pad-to 4K | \
+ ls-append $(1)-uboot.bin | pad-to 3M | \
+ ls-append $(1)-uboot-env.bin | pad-to 4M | \
+ ls-append ls1046ardb-ppa.itb | pad-to 9M | \
+ ls-append ls1046ardb-fman.bin | pad-to 15M | \
+ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
+ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
+ append-rootfs | check-size $(LS_SD_IMAGE_SIZE)
+endef
+TARGET_DEVICES += ls1046ardb-sdboot
+
define Device/ls1088ardb
DEVICE_TITLE := LS1088ARDB
DEVICE_PACKAGES += \
@@ -137,6 +179,33 @@ define Device/ls1088ardb
endef
TARGET_DEVICES += ls1088ardb
+define Device/ls1088ardb-sdboot
+ DEVICE_TITLE := LS1088ARDB (SD Card Boot)
+ DEVICE_PACKAGES += \
+ layerscape-rcw-ls1088ardb-sdboot \
+ layerscape-mc-ls1088ardb \
+ layerscape-dpl-ls1088ardb \
+ layerscape-ppa-ls1088ardb \
+ restool
+ DEVICE_DTS := freescale/fsl-ls1088a-rdb
+ FILESYSTEMS := ext4
+ IMAGES := sdcard.img
+ IMAGE/sdcard.img := \
+ ls-clean | \
+ ls-append-sdhead $(1) | pad-to 4K | \
+ ls-append $(1)-rcw.bin | pad-to 1M | \
+ ls-append $(1)-uboot.bin | pad-to 3M | \
+ ls-append $(1)-uboot-env.bin | pad-to 4M | \
+ ls-append ls1088ardb-ppa.itb | pad-to 10M | \
+ ls-append ls1088ardb-mc.itb | pad-to 13M | \
+ ls-append ls1088ardb-dpl.dtb | pad-to 14M | \
+ ls-append ls1088ardb-dpc.dtb | pad-to 15M | \
+ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
+ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
+ append-rootfs | check-size $(LS_SD_IMAGE_SIZE)
+endef
+TARGET_DEVICES += ls1088ardb-sdboot
+
define Device/ls2088ardb
DEVICE_TITLE := LS2088ARDB
DEVICE_PACKAGES += \
diff --git a/target/linux/layerscape/image/gen_sdcard_head_img.sh b/target/linux/layerscape/image/gen_sdcard_head_img.sh
new file mode 100755
index 0000000000..dc1efbb3e0
--- /dev/null
+++ b/target/linux/layerscape/image/gen_sdcard_head_img.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+#
+# Copyright 2018 NXP
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+set -x
+[ $# -eq 3 ] || {
+ echo "SYNTAX: $0 <file> <rootfs part offset> <rootfs size>"
+ exit 1
+}
+
+OUTPUT="$1"
+ROOTFSOFFSET="$(($2 * 1024))"
+ROOTFSSIZE="$3"
+
+head=4
+sect=16
+
+set `ptgen -o $OUTPUT -h $head -s $sect -l $ROOTFSOFFSET -t 83 -p ${ROOTFSSIZE}M`