1 include $(TOPDIR
)/rules.mk
2 include $(INCLUDE_DIR
)/kernel.mk
5 PKG_HASH
:=92b08eb49c24da14c1adbf70a71ae8f37cc53eeb4230e859ad8b6733d13dcf5e
6 PKG_BUILD_DEPENDS
:=arm-trusted-firmware-tools
/host
8 include $(INCLUDE_DIR
)/u-boot.mk
9 include $(INCLUDE_DIR
)/package.mk
10 include $(INCLUDE_DIR
)/host-build.mk
12 MT7621_LOWLEVEL_PRELOADER_URL
:=https
://raw.githubusercontent.com
/mtk-openwrt
/mt7621-lowlevel-preloader
/master
/
14 define Download
/mt7621-stage-sram
15 FILE
:=mt7621_stage_sram.bin
16 URL
:=$(MT7621_LOWLEVEL_PRELOADER_URL
)
17 HASH
:=1dda68aa089f0ff262e01539b990dea478952e9fb68bcc0a8cd6f76f0135c62e
20 ifdef CONFIG_TARGET_ramips_mt7621
21 $(eval
$(call Download
,mt7621-stage-sram
))
25 BUILD_TARGET
:=mediatek
26 UBOOT_IMAGE
:=u-boot-mtk.bin
29 define U-Boot
/mt7620_rfb
30 NAME
:=MT7620 Reference Board
31 UBOOT_CONFIG
:=mt7620_rfb
32 BUILD_DEVICES
:=ralink_mt7620a-evb
34 BUILD_SUBTARGET
:=mt7620
35 UBOOT_IMAGE
:=u-boot-with-spl.bin
38 define U-Boot
/mt7620_mt7530_rfb
39 NAME
:=MT7620
+MT7530 Reference Board
40 UBOOT_CONFIG
:=mt7620_mt7530_rfb
41 BUILD_DEVICES
:=ralink_mt7620a-mt7530-evb
43 BUILD_SUBTARGET
:=mt7620
44 UBOOT_IMAGE
:=u-boot-with-spl.bin
47 define U-Boot
/mt7621_rfb
48 NAME
:=MT7621 Reference Board
49 UBOOT_CONFIG
:=mt7621_rfb
50 BUILD_DEVICES
:=mediatek_mt7621-eval-board
52 BUILD_SUBTARGET
:=mt7621
53 UBOOT_IMAGE
:=u-boot-mt7621.bin
56 define U-Boot
/mt7621_nand_rfb
57 NAME
:=MT7621 Reference Board
(NAND
)
58 UBOOT_CONFIG
:=mt7621_nand_rfb
59 BUILD_DEVICES
:=mediatek_mt7621-eval-board
61 BUILD_SUBTARGET
:=mt7621
62 UBOOT_IMAGE
:=u-boot-mt7621.bin
65 define U-Boot
/mt7622_rfb1
66 NAME
:=MT7622 Reference Board
1
67 UBOOT_CONFIG
:=mt7622_rfb
68 BUILD_DEVICES
:=mediatek_mt7622-rfb1 mediatek_mt7622-rfb1-ubi
69 BUILD_SUBTARGET
:=mt7622
72 define U-Boot
/mt7622_linksys_e8450
74 UBOOT_CONFIG
:=mt7622_linksys_e8450
75 BUILD_DEVICES
:=linksys_e8450-ubi
76 BUILD_SUBTARGET
:=mt7622
77 UBOOT_IMAGE
:=u-boot.fip
80 DEPENDS
:=+trusted-firmware-a-mt7622-snand-1ddr
83 define U-Boot
/mt7622_bananapi_bpi-r64-emmc
84 NAME
:=BananaPi R64
(eMMC
)
85 UBOOT_CONFIG
:=mt7622_bananapi_bpi-r64-emmc
86 BUILD_DEVICES
:=bananapi_bpi-r64
87 BUILD_SUBTARGET
:=mt7622
88 UBOOT_IMAGE
:=u-boot.fip
91 DEPENDS
:=+trusted-firmware-a-mt7622-emmc-2ddr
94 define U-Boot
/mt7622_bananapi_bpi-r64-sdmmc
95 NAME
:=BananaPi R64
(SDMMC
)
96 UBOOT_CONFIG
:=mt7622_bananapi_bpi-r64-sdmmc
97 BUILD_DEVICES
:=bananapi_bpi-r64
98 BUILD_SUBTARGET
:=mt7622
99 UBOOT_IMAGE
:=u-boot.fip
102 DEPENDS
:=+trusted-firmware-a-mt7622-sdmmc-2ddr
105 define U-Boot
/mt7622_bananapi_bpi-r64-snand
106 NAME
:=BananaPi R64
(SNAND
)
107 UBOOT_CONFIG
:=mt7622_bananapi_bpi-r64-snand
108 BUILD_DEVICES
:=bananapi_bpi-r64
109 BUILD_SUBTARGET
:=mt7622
110 UBOOT_IMAGE
:=u-boot.fip
113 DEPENDS
:=+trusted-firmware-a-mt7622-snand-2ddr
116 define U-Boot
/mt7622_ubnt_unifi-6-lr
117 NAME
:=Ubiquiti UniFi
6 LR
118 UBOOT_CONFIG
:=mt7622_ubnt_unifi-6-lr
119 BUILD_DEVICES
:=ubnt_unifi-6-lr-v1-ubootmod ubnt_unifi-6-lr-v2-ubootmod
120 BUILD_SUBTARGET
:=mt7622
121 UBOOT_IMAGE
:=u-boot.fip
124 DEPENDS
:=+trusted-firmware-a-mt7622-nor-2ddr
127 define U-Boot
/mt7623a_unielec_u7623
128 NAME
:=UniElec U7623
(mt7623
)
129 BUILD_DEVICES
:=unielec_u7623-02
130 BUILD_SUBTARGET
:=mt7623
131 UBOOT_CONFIG
:=mt7623a_unielec_u7623_02
134 define U-Boot
/mt7623n_bpir2
135 NAME
:=Banana Pi R2
(mt7623
)
136 BUILD_DEVICES
:=bananapi_bpi-r2
137 BUILD_SUBTARGET
:=mt7623
138 UBOOT_IMAGE
:=u-boot.bin
139 UBOOT_CONFIG
:=mt7623n_bpir2
142 define U-Boot
/mt7628_rfb
143 NAME
:=MT7628 Reference Board
144 BUILD_DEVICES
:=mediatek_mt7628an-eval-board
146 BUILD_SUBTARGET
:=mt76x8
147 UBOOT_CONFIG
:=mt7628_rfb
148 UBOOT_IMAGE
:=u-boot-with-spl.bin
151 define U-Boot
/ravpower_rp-wd009
152 NAME
:=RAVPower RP-WD009
154 BUILD_DEVICES
:=ravpower_rp-wd009
155 BUILD_SUBTARGET
:=mt76x8
156 UBOOT_CONFIG
:=ravpower-rp-wd009-ram
157 UBOOT_IMAGE
:=u-boot.bin
160 define U-Boot
/mt7629_rfb
161 NAME
:=MT7629 Reference Board
162 BUILD_SUBTARGET
:=mt7629
163 BUILD_DEVICES
:=mediatek_mt7629-rfb
164 UBOOT_CONFIG
:=mt7629_rfb
172 mt7622_bananapi_bpi-r64-emmc \
173 mt7622_bananapi_bpi-r64-sdmmc \
174 mt7622_bananapi_bpi-r64-snand \
175 mt7622_linksys_e8450 \
177 mt7622_ubnt_unifi-6-lr \
179 mt7623a_unielec_u7623 \
184 ifdef CONFIG_TARGET_mediatek
185 UBOOT_MAKE_FLAGS
+= $(UBOOT_IMAGE
:.fip
=.bin
)
188 define Build
/fip-image
189 $(STAGING_DIR_HOST
)/bin
/fiptool create \
190 --soc-fw
$(STAGING_DIR_IMAGE
)/$(BUILD_SUBTARGET
)-$(BL2_BOOTDEV
)-$(BL2_DDRBLOB
)ddr-bl31.bin \
191 --nt-fw
$(PKG_BUILD_DIR
)/u-boot.bin \
192 $(PKG_BUILD_DIR
)/u-boot.fip
195 ifdef CONFIG_TARGET_ramips_mt7621
197 $(call Build
/Prepare
/Default
)
198 $(CP
) $(DL_DIR
)/mt7621_stage_sram.bin
$(PKG_BUILD_DIR
)/
202 define Build
/Configure
203 $(call Build
/Configure
/U-Boot
)
204 sed
-i
's/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/' $(PKG_BUILD_DIR
)/.config
208 $(call Build
/Compile
/U-Boot
)
209 ifeq ($(UBOOT_IMAGE
),u-boot.fip
))
210 $(call Build
/fip-image
)
214 # don't stage files to bindir, let target/linux/mediatek/image/*.mk do that
215 ifdef CONFIG_TARGET_mediatek
216 define Package
/u-boot
/install
220 define Build
/InstallDev
221 $(INSTALL_DIR
) $(STAGING_DIR_IMAGE
)
222 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/$(UBOOT_IMAGE
) $(STAGING_DIR_IMAGE
)/$(BUILD_VARIANT
)-$(UBOOT_IMAGE
)
225 $(eval
$(call BuildPackage
/U-Boot
))