diff options
Diffstat (limited to 'target/linux/mediatek/image/mt7623.mk')
-rw-r--r-- | target/linux/mediatek/image/mt7623.mk | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk index ef14969029..1061a0d281 100644 --- a/target/linux/mediatek/image/mt7623.mk +++ b/target/linux/mediatek/image/mt7623.mk @@ -1,5 +1,5 @@ KERNEL_LOADADDR := 0x80008000 -DEVICE_VARS += UBOOT_TARGET +DEVICE_VARS += UBOOT_TARGET UBOOT_OFFSET UBOOT_ENVSIZE ifneq ($(CONFIG_BANANA_PI_BOOT_PARTSIZE),) BOOTFS_BLOCK_SIZE := 1024 @@ -10,16 +10,18 @@ define Build/banana-pi-sdcard rm -f $@.boot mkfs.fat -C $@.boot $(BOOTFS_BLOCKS) - ./gen_banana_pi_img.sh emmc $@.emmc \ - $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin - - mkenvimage -s 0x2000 -o $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-uboot.env $(UBOOT_TARGET)-uEnv.txt + if [ -r $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin ]; then \ + ./gen_banana_pi_img.sh emmc $@.emmc \ + $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin; \ + mcopy -i $@.boot $@.emmc ::eMMCboot.bin; \ + fi + mkenvimage -s $(UBOOT_ENVSIZE) -o $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-uboot.env $(UBOOT_TARGET)-uEnv.txt mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-uboot.env ::uboot.env mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage - mcopy -i $@.boot $@.emmc ::eMMCboot.bin ./gen_banana_pi_img.sh sd $@ \ $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin \ - $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-u-boot.bin \ + $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-u-boot*.bin \ + $(UBOOT_OFFSET) \ $@.boot \ $(IMAGE_ROOTFS) \ $(CONFIG_BANANA_PI_BOOT_PARTSIZE) \ @@ -41,6 +43,8 @@ define Device/bpi_bananapi-r2 DEVICE_DTS := mt7623n-bananapi-bpi-r2 DEVICE_PACKAGES := kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc \ mkf2fs e2fsprogs kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk + UBOOT_ENVSIZE := 0x2000 + UBOOT_OFFSET := 320k UBOOT_TARGET := mt7623n_bpir2 IMAGES := img.gz IMAGE/img.gz := banana-pi-sdcard | gzip | append-metadata |