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
57 define U-Boot
/mt7621_nand_rfb
58 NAME
:=MT7621 Reference Board
(NAND
)
59 UBOOT_CONFIG
:=mt7621_nand_rfb
60 BUILD_DEVICES
:=mediatek_mt7621-eval-board
62 BUILD_SUBTARGET
:=mt7621
63 UBOOT_IMAGE
:=u-boot-mt7621.bin
67 define U-Boot
/mt7622_rfb1
68 NAME
:=MT7622 Reference Board
1
69 UBOOT_CONFIG
:=mt7622_rfb
70 BUILD_DEVICES
:=mediatek_mt7622-rfb1 mediatek_mt7622-rfb1-ubi
71 BUILD_SUBTARGET
:=mt7622
74 define U-Boot
/mt7622_linksys_e8450
76 UBOOT_CONFIG
:=mt7622_linksys_e8450
77 BUILD_DEVICES
:=linksys_e8450-ubi
78 BUILD_SUBTARGET
:=mt7622
79 UBOOT_IMAGE
:=u-boot.fip
82 DEPENDS
:=+trusted-firmware-a-mt7622-snand-1ddr
85 define U-Boot
/mt7622_bananapi_bpi-r64-emmc
86 NAME
:=BananaPi R64
(eMMC
)
87 UBOOT_CONFIG
:=mt7622_bananapi_bpi-r64-emmc
88 BUILD_DEVICES
:=bananapi_bpi-r64
89 BUILD_SUBTARGET
:=mt7622
90 UBOOT_IMAGE
:=u-boot.fip
93 DEPENDS
:=+trusted-firmware-a-mt7622-emmc-2ddr
96 define U-Boot
/mt7622_bananapi_bpi-r64-sdmmc
97 NAME
:=BananaPi R64
(SDMMC
)
98 UBOOT_CONFIG
:=mt7622_bananapi_bpi-r64-sdmmc
99 BUILD_DEVICES
:=bananapi_bpi-r64
100 BUILD_SUBTARGET
:=mt7622
101 UBOOT_IMAGE
:=u-boot.fip
104 DEPENDS
:=+trusted-firmware-a-mt7622-sdmmc-2ddr
107 define U-Boot
/mt7622_bananapi_bpi-r64-snand
108 NAME
:=BananaPi R64
(SNAND
)
109 UBOOT_CONFIG
:=mt7622_bananapi_bpi-r64-snand
110 BUILD_DEVICES
:=bananapi_bpi-r64
111 BUILD_SUBTARGET
:=mt7622
112 UBOOT_IMAGE
:=u-boot.fip
115 DEPENDS
:=+trusted-firmware-a-mt7622-snand-2ddr
118 define U-Boot
/mt7622_ubnt_unifi-6-lr
119 NAME
:=Ubiquiti UniFi
6 LR
120 UBOOT_CONFIG
:=mt7622_ubnt_unifi-6-lr
121 BUILD_DEVICES
:=ubnt_unifi-6-lr-v1-ubootmod ubnt_unifi-6-lr-v2-ubootmod
122 BUILD_SUBTARGET
:=mt7622
123 UBOOT_IMAGE
:=u-boot.fip
126 DEPENDS
:=+trusted-firmware-a-mt7622-nor-2ddr
129 define U-Boot
/mt7623a_unielec_u7623
130 NAME
:=UniElec U7623
(mt7623
)
131 BUILD_DEVICES
:=unielec_u7623-02
132 BUILD_SUBTARGET
:=mt7623
133 UBOOT_CONFIG
:=mt7623a_unielec_u7623_02
136 define U-Boot
/mt7623n_bpir2
137 NAME
:=Banana Pi R2
(mt7623
)
138 BUILD_DEVICES
:=bananapi_bpi-r2
139 BUILD_SUBTARGET
:=mt7623
140 UBOOT_IMAGE
:=u-boot.bin
141 UBOOT_CONFIG
:=mt7623n_bpir2
144 define U-Boot
/mt7628_rfb
145 NAME
:=MT7628 Reference Board
146 BUILD_DEVICES
:=mediatek_mt7628an-eval-board
148 BUILD_SUBTARGET
:=mt76x8
149 UBOOT_CONFIG
:=mt7628_rfb
150 UBOOT_IMAGE
:=u-boot-with-spl.bin
153 define U-Boot
/ravpower_rp-wd009
154 NAME
:=RAVPower RP-WD009
156 BUILD_DEVICES
:=ravpower_rp-wd009
157 BUILD_SUBTARGET
:=mt76x8
158 UBOOT_CONFIG
:=ravpower-rp-wd009-ram
159 UBOOT_IMAGE
:=u-boot.bin
162 define U-Boot
/mt7629_rfb
163 NAME
:=MT7629 Reference Board
164 BUILD_SUBTARGET
:=mt7629
165 BUILD_DEVICES
:=mediatek_mt7629-rfb
166 UBOOT_CONFIG
:=mt7629_rfb
174 mt7622_bananapi_bpi-r64-emmc \
175 mt7622_bananapi_bpi-r64-sdmmc \
176 mt7622_bananapi_bpi-r64-snand \
177 mt7622_linksys_e8450 \
179 mt7622_ubnt_unifi-6-lr \
181 mt7623a_unielec_u7623 \
186 ifdef CONFIG_TARGET_mediatek
187 UBOOT_MAKE_FLAGS
+= $(UBOOT_IMAGE
:.fip
=.bin
)
190 define Build
/fip-image
191 $(STAGING_DIR_HOST
)/bin
/fiptool create \
192 --soc-fw
$(STAGING_DIR_IMAGE
)/$(BUILD_SUBTARGET
)-$(BL2_BOOTDEV
)-$(BL2_DDRBLOB
)ddr-bl31.bin \
193 --nt-fw
$(PKG_BUILD_DIR
)/u-boot.bin \
194 $(PKG_BUILD_DIR
)/u-boot.fip
197 ifdef CONFIG_TARGET_ramips_mt7621
199 $(call Build
/Prepare
/Default
)
200 $(CP
) $(DL_DIR
)/mt7621_stage_sram.bin
$(PKG_BUILD_DIR
)/
204 define Build
/Configure
205 $(call Build
/Configure
/U-Boot
)
206 sed
-i
's/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/' $(PKG_BUILD_DIR
)/.config
210 $(call Build
/Compile
/U-Boot
)
211 ifeq ($(UBOOT_IMAGE
),u-boot.fip
))
212 $(call Build
/fip-image
)
216 # don't stage files to bindir, let target/linux/mediatek/image/*.mk do that
217 ifdef CONFIG_TARGET_mediatek
218 define Package
/u-boot
/install
222 define Build
/InstallDev
223 $(INSTALL_DIR
) $(STAGING_DIR_IMAGE
)
224 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/$(UBOOT_IMAGE
) $(STAGING_DIR_IMAGE
)/$(BUILD_VARIANT
)-$(UBOOT_IMAGE
)
227 $(eval
$(call BuildPackage
/U-Boot
))