Commit 76cf00db authored by Grant Likely's avatar Grant Likely
Browse files

Rationalize sd image generation



Unify the SD card image generation so that each platform can define its
own rule for generating the SD card image, and the sd.img target will
call that rule.

Signed-off-by: Grant Likely's avatarGrant Likely <grant.likely@arm.com>
parent dcef3d21
......@@ -11,6 +11,7 @@ endif
export CROSS_COMPILE=aarch64-linux-gnu-
MAKE=make
SD_IMG=$(CURDIR)/$(TARGET)-sdcard.img
all: # Nothing by default
......@@ -69,5 +70,8 @@ tfa-bl31:
tfa-fip: u-boot ${TFA_DEPS}
${MAKE} -C ${TFA_PATH} LOG_LEVEL=20 PLAT=$(TFA_PLAT) BL33=$(UBOOT_OUTPUT)/u-boot.bin ${TFA_EXTRA} all fip
flash-to-sd:
sudo dd if=${FLASH_IMAGE} of=${FLASH_DEVICE} ${FLASH_EXTRA} conv=fdatasync status=progress
sd.img: $(SD_IMG)
flash-sd: $(SD_IMG)
sudo dd if=${SD_IMG} of=${FLASH_DEVICE} conv=fdatasync status=progress
......@@ -9,8 +9,7 @@ TFA_EXTRA += SCP_BL2=${CURDIR}/binaries-marvell/mrvl_scp_bl2.img
TFA_EXTRA += MV_DDR_PATH=${CURDIR}/mv-ddr
TFA_EXTRA += USE_COHERENT_MEM=0
sdcard-image: SD_IMG=$(CURDIR)/$(TARGET)-sdcard.img
sdcard-image: u-boot
$(SD_IMG): u-boot
dd if=/dev/zero of=$(SD_IMG) seek=32M count=0
echo "label: dos" | /sbin/sfdisk $(SD_IMG)
dd if=${FLASH_IMAGE} of=$(SD_IMG) seek=1
......@@ -5,8 +5,7 @@
# Build config for RockPro64
# Inspired by https://stikonas.eu/wordpress/2019/09/15/blobless-boot-with-rockpro64/
sdcard-image: SD_IMG=$(CURDIR)/$(TARGET)-sdcard.img
sdcard-image: u-boot
$(SD_IMG): u-boot
dd if=/dev/zero of=$(SD_IMG) seek=32M count=0
/sbin/sgdisk -g $(SD_IMG)
/sbin/sgdisk -n 1:: $(SD_IMG)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment