1 # SPDX-License-Identifier: GPL-2.0-only
3 # Copyright (C) 2022 Toco Technologies <info@toco.ae>
5 include $(TOPDIR
)/rules.mk
6 include $(INCLUDE_DIR
)/image.mk
9 FAT32_BLOCKS
=$(shell echo
$$(($(CONFIG_SIFIVEU_SD_BOOT_PARTSIZE
)*1024*1024/$(FAT32_BLOCK_SIZE
))))
11 KERNEL_LOADADDR
:=0x80200000
13 define Build
/riscv-sdcard
14 rm -f
$@.boot
#$(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img
15 mkfs.fat
$@.boot
-C
$(FAT32_BLOCKS
)
17 mcopy
-i
$@.boot
$(STAGING_DIR_IMAGE
)/$(DEVICE_NAME
)-boot.scr
::boot.scr
18 mcopy
-i
$@.boot
$(DTS_DIR
)/$(DEVICE_DTS
).dtb
::dtb
19 mcopy
-i
$@.boot
$(IMAGE_KERNEL
) ::Image
21 .
/gen_sifiveu_sdcard_img.sh \
25 $(CONFIG_SIFIVEU_SD_BOOT_PARTSIZE
) \
26 $(CONFIG_TARGET_ROOTFS_PARTSIZE
) \
27 $(STAGING_DIR_IMAGE
)/$(DEVICE_NAME
)-u-boot.itb \
28 $(STAGING_DIR_IMAGE
)/$(DEVICE_NAME
)-u-boot.itb-spl
34 KERNEL
:= kernel-bin | libdeflate-gzip
35 IMAGES
:= sdcard.img.gz
36 IMAGE
/sdcard.img.gz
:= riscv-sdcard | append-metadata | gzip
39 define Device
/sifive_unleashed
40 DEVICE_VENDOR
:= SiFive
41 DEVICE_MODEL
:= Unleashed
(FU540
)
42 DEVICE_DTS
:= sifive
/hifive-unleashed-a00
43 UBOOT
:= sifive_unleashed
45 TARGET_DEVICES
+= sifive_unleashed
47 define Device
/sifive_unmatched
48 DEVICE_VENDOR
:= SiFive
49 DEVICE_MODEL
:= Unmatched
(FU740
)
50 DEVICE_DTS
:= sifive
/hifive-unmatched-a00
51 DEVICE_PACKAGES
+= kmod-eeprom-at24 kmod-hwmon-lm90
52 UBOOT
:= sifive_unmatched
54 TARGET_DEVICES
+= sifive_unmatched
56 $(eval
$(call BuildImage
))