aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep Sheriker M <sandeep.sheriker@microchip.com>2019-09-11 18:35:56 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2019-09-21 01:09:27 +0200
commit89fe1dfac2862297dffc94966a9b0f12237eae55 (patch)
treee8cc9130628fcc883a64d85f4a73684ec62a9304
parent612e9ed7b8d2123a64e5617b2f0ea3f99102e31c (diff)
downloadupstream-89fe1dfac2862297dffc94966a9b0f12237eae55.tar.gz
upstream-89fe1dfac2862297dffc94966a9b0f12237eae55.tar.bz2
upstream-89fe1dfac2862297dffc94966a9b0f12237eae55.zip
at91:sam9x: create sdcard images
create sdcard images for sam9x25 & sam9x35 ek targets. Signed-off-by: Sandeep Sheriker M <sandeep.sheriker@microchip.com>
-rw-r--r--target/linux/at91/image/sam9x.mk44
1 files changed, 42 insertions, 2 deletions
diff --git a/target/linux/at91/image/sam9x.mk b/target/linux/at91/image/sam9x.mk
index e40019f058..8fd6b4506f 100644
--- a/target/linux/at91/image/sam9x.mk
+++ b/target/linux/at91/image/sam9x.mk
@@ -5,6 +5,44 @@ define Device/default-nand
MKUBIFS_OPTS := -m $$(PAGESIZE) -e 126KiB -c 2048
endef
+define Build/at91-sdcard
+ $(if $(findstring ext4,$@), \
+ rm -f $@.boot
+ mkfs.fat -C $@.boot $(FAT32_BLOCKS)
+
+ mcopy -i $@.boot \
+ $(KDIR)/$(DEVICE_NAME)-fit-zImage.itb \
+ ::$(DEVICE_NAME)-fit.itb
+
+ mcopy -i $@.boot \
+ $(BIN_DIR)/u-boot-at91sam9x5ek_mmc/u-boot.bin \
+ ::u-boot.bin
+
+ mcopy -i $@.boot \
+ $(BIN_DIR)/at91bootstrap-at91sam9x5eksd_uboot/at91bootstrap.bin \
+ ::BOOT.bin
+
+ $(CP) uboot-env.txt $@-uboot-env.txt
+ sed -i '2d;3d' $@-uboot-env.txt
+ sed -i '2i board='"$(DEVICE_NAME)"'' $@-uboot-env.txt
+ sed -i '3i board_name='"$(DEVICE_NAME)"'' $@-uboot-env.txt
+
+ mkenvimage -s 0x4000 -o $@-uboot.env $@-uboot-env.txt
+
+ mcopy -i $@.boot $@-uboot.env ::uboot.env
+
+ ./gen_at91_sdcard_img.sh \
+ $@.img \
+ $@.boot \
+ $(KDIR)/root.ext4 \
+ $(AT91_SD_BOOT_PARTSIZE) \
+ $(CONFIG_TARGET_ROOTFS_PARTSIZE)
+
+ gzip -nc9 $@.img > $@
+
+ rm -f $@.img $@.boot $@-uboot.env $@-uboot-env.txt)
+endef
+
define Device/at91sam9263ek
$(Device/evaluation-dtb)
DEVICE_VENDOR := Atmel
@@ -56,16 +94,18 @@ endef
TARGET_DEVICES += at91sam9m10g45ek
define Device/at91sam9x25ek
- $(Device/evaluation)
+ $(Device/evaluation-dtb)
DEVICE_VENDOR := Atmel
DEVICE_MODEL := AT91SAM9X25-EK
+ $(Device/evaluation-sdimage)
endef
TARGET_DEVICES += at91sam9x25ek
define Device/at91sam9x35ek
- $(Device/evaluation)
+ $(Device/evaluation-dtb)
DEVICE_VENDOR := Atmel
DEVICE_MODEL := AT91SAM9X35-EK
+ $(Device/evaluation-sdimage)
endef
TARGET_DEVICES += at91sam9x35ek