Skip to content

Commit 5d58d2a

Browse files
committed
Merge remote-tracking branch 'other/main'
2 parents 6b6206e + 9d2882f commit 5d58d2a

633 files changed

Lines changed: 38341 additions & 38354 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

include/cmake.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ define Build/Configure/Default
113113
-DCMAKE_NM="$(CMAKE_NM)" \
114114
-DCMAKE_RANLIB="$(CMAKE_RANLIB)" \
115115
-DCMAKE_FIND_ROOT_PATH="$(CMAKE_FIND_ROOT_PATH)" \
116-
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH \
116+
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
117117
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
118118
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
119119
-DCMAKE_STRIP=: \

include/download.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ $(if $(if $(MIRROR), \
159159
( $(3) ) \
160160
$(if $(filter-out x,$(MIRROR_HASH)), && ( \
161161
file_hash="$$$$($(MKHASH) sha256 "$(DL_DIR)/$(FILE)")"; \
162-
[ "$$$$file_hash" = "$(MIRROR_HASH)" ] || { \
162+
[ "$$$$file_hash" = "$(MIRROR_HASH)" ] || [ "$(MIRROR_HASH)" = "skip" ] || { \
163163
echo "Hash mismatch for file $(FILE): expected $(MIRROR_HASH), got $$$$file_hash"; \
164164
false; \
165165
}; \

include/openssl-module.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Copyright (C) 2022-2023 Enéas Ulir de Queiroz
44

55
ENGINES_DIR=engines-3
6+
MODULES_DIR=ossl-modules
67

78
define Package/openssl/module/Default
89
SECTION:=libs
@@ -74,6 +75,6 @@ endef
7475
# 1 = provider name
7576
# 2 = [ package name, defaults to libopenssl-$(1) ]
7677
define Package/openssl/add-provider
77-
$(call Package/openssl/add-module,provider,$(1),/usr/lib/ossl-modules,$(2))
78+
$(call Package/openssl/add-module,provider,$(1),/usr/lib/$(MODULES_DIR),$(2))
7879
endef
7980

include/prereq-build.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \
187187
perl --version | grep "perl.*v5"))
188188

189189
$(eval $(call SetupHostCommand,python,Please install Python >= 3.7, \
190+
python3.13 -V 2>&1 | grep 'Python 3', \
190191
python3.12 -V 2>&1 | grep 'Python 3', \
191192
python3.11 -V 2>&1 | grep 'Python 3', \
192193
python3.10 -V 2>&1 | grep 'Python 3', \
@@ -196,6 +197,7 @@ $(eval $(call SetupHostCommand,python,Please install Python >= 3.7, \
196197
python3 -V 2>&1 | grep -E 'Python 3\.([7-9]|[0-9][0-9])\.?'))
197198

198199
$(eval $(call SetupHostCommand,python3,Please install Python >= 3.7, \
200+
python3.13 -V 2>&1 | grep 'Python 3', \
199201
python3.12 -V 2>&1 | grep 'Python 3', \
200202
python3.11 -V 2>&1 | grep 'Python 3', \
201203
python3.10 -V 2>&1 | grep 'Python 3', \

include/toplevel.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ _ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))
7878
prepare-tmpinfo: FORCE
7979
@+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK)
8080
mkdir -p tmp/info feeds
81-
[ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base
81+
[ -e $(TOPDIR)/feeds/base ] || ln -sf ../package $(TOPDIR)/feeds/base
8282
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="packageinfo" SCAN_DIR="package" SCAN_NAME="package" SCAN_DEPTH=5 SCAN_EXTRA=""
8383
$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f include/scan.mk SCAN_TARGET="targetinfo" SCAN_DIR="target/linux" SCAN_NAME="target" SCAN_DEPTH=3 SCAN_EXTRA="" SCAN_MAKEOPTS="TARGET_BUILD=1"
8484
for type in package target; do \

package/base-files/files/etc/uci-defaults/14_network-generate-clientid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
uci -q batch <<-EOF >/dev/null
44
# DUID-UUID - RFC6355
5-
set network.globals.dhcp_default_duid="$(hexdump -vn 16 -e '"0004" 2/2 "%x"' /dev/urandom)"
5+
set network.globals.dhcp_default_duid="$(printf '%s%s' '0004' $(cat /proc/sys/kernel/random/uuid | sed -e 's/-//g'))"
66
commit network
77
EOF
88

package/boot/arm-trusted-firmware-mediatek/Makefile

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ define Trusted-Firmware-A/Default
3838
USE_UBI:=
3939
FIP_OFFSET:=
4040
FIP_SIZE:=
41+
SPIM_CTRL:=
4142
endef
4243

4344
define Trusted-Firmware-A/mt7622-nor-1ddr
@@ -393,6 +394,61 @@ define Trusted-Firmware-A/mt7986-spim-nand-ubi-ddr3
393394
USE_UBI:=1
394395
endef
395396

397+
define Trusted-Firmware-A/mt7987-emmc-comb
398+
NAME:=MediaTek MT7987 (eMMC)
399+
BOOT_DEVICE:=emmc
400+
BUILD_SUBTARGET:=filogic
401+
PLAT:=mt7987
402+
DRAM_USE_COMB:=1
403+
endef
404+
405+
define Trusted-Firmware-A/mt7987-nor-comb
406+
NAME:=MediaTek MT7987 (NOR)
407+
BOOT_DEVICE:=nor
408+
BUILD_SUBTARGET:=filogic
409+
PLAT:=mt7987
410+
DRAM_USE_COMB:=1
411+
endef
412+
413+
define Trusted-Firmware-A/mt7987-sdmmc-comb
414+
NAME:=MediaTek MT7987 (SD card)
415+
BOOT_DEVICE:=sdmmc
416+
BUILD_SUBTARGET:=filogic
417+
PLAT:=mt7987
418+
DRAM_USE_COMB:=1
419+
endef
420+
421+
define Trusted-Firmware-A/mt7987-spim-nand0-ubi-comb
422+
NAME:=MediaTek MT7987 (SPI-NAND via SPIM, UBI)
423+
BOOT_DEVICE:=spim-nand
424+
BUILD_SUBTARGET:=filogic
425+
PLAT:=mt7987
426+
DRAM_USE_COMB:=1
427+
USE_UBI:=1
428+
SPIM_CTRL:=0
429+
endef
430+
431+
define Trusted-Firmware-A/mt7987-spim-nand2-ubi-comb
432+
NAME:=MediaTek MT7987 (SPI-NAND via SPIM, UBI)
433+
BOOT_DEVICE:=spim-nand
434+
BUILD_SUBTARGET:=filogic
435+
PLAT:=mt7987
436+
DRAM_USE_COMB:=1
437+
USE_UBI:=1
438+
SPIM_CTRL:=2
439+
endef
440+
441+
define Trusted-Firmware-A/mt7987-ram-comb
442+
NAME:=MediaTek MT7987 (RAM)
443+
BOOT_DEVICE:=ram
444+
BUILD_SUBTARGET:=filogic
445+
PLAT:=mt7987
446+
DRAM_USE_COMB:=1
447+
RAM_BOOT_UART_DL:=1
448+
HIDDEN:=
449+
DEFAULT:=TARGET_mediatek_filogic
450+
endef
451+
396452
define Trusted-Firmware-A/mt7988-nor-ddr3
397453
NAME:=MediaTek MT7988 (SPI-NOR, DDR3)
398454
BOOT_DEVICE:=nor
@@ -604,6 +660,12 @@ TFA_TARGETS:= \
604660
mt7986-spim-nand-ddr4 \
605661
mt7986-spim-nand-ubi-ddr4 \
606662
mt7986-spim-nand-4k-ddr4 \
663+
mt7987-emmc-comb \
664+
mt7987-nor-comb \
665+
mt7987-sdmmc-comb \
666+
mt7987-spim-nand0-ubi-comb \
667+
mt7987-spim-nand2-ubi-comb \
668+
mt7987-ram-comb \
607669
mt7988-emmc-ddr3 \
608670
mt7988-nor-ddr3 \
609671
mt7988-sdmmc-ddr3 \
@@ -641,6 +703,7 @@ TFA_MAKE_FLAGS += \
641703
$(if $(USE_UBI),UBI=1 $(if $(findstring mt7986,$(PLAT)),OVERRIDE_UBI_START_ADDR=0x200000)) \
642704
$(if $(FIP_OFFSET),OVERRIDE_FIP_BASE=$(FIP_OFFSET)) \
643705
$(if $(FIP_SIZE),OVERRIDE_FIP_SIZE=$(FIP_SIZE)) \
706+
$(if $(SPIM_CTRL),SPIM_CTRL=$(SPIM_CTRL)) \
644707
$(if $(RAM_BOOT_UART_DL),bl2,all)
645708

646709
define Package/trusted-firmware-a-ram/install
@@ -653,6 +716,7 @@ Package/trusted-firmware-a-mt7981-ram-ddr3/install = $(Package/trusted-firmware-
653716
Package/trusted-firmware-a-mt7981-ram-ddr4/install = $(Package/trusted-firmware-a-ram/install)
654717
Package/trusted-firmware-a-mt7986-ram-ddr3/install = $(Package/trusted-firmware-a-ram/install)
655718
Package/trusted-firmware-a-mt7986-ram-ddr4/install = $(Package/trusted-firmware-a-ram/install)
719+
Package/trusted-firmware-a-mt7987-ram-comb/install = $(Package/trusted-firmware-a-ram/install)
656720
Package/trusted-firmware-a-mt7988-ram-comb/install = $(Package/trusted-firmware-a-ram/install)
657721
Package/trusted-firmware-a-mt7988-ram-ddr4/install = $(Package/trusted-firmware-a-ram/install)
658722

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
From e2e43103c00b5f7ccedbdbdece0f622cb420b4a5 Mon Sep 17 00:00:00 2001
2+
From: Daniel Golle <daniel@makrotopia.org>
3+
Date: Fri, 3 Oct 2025 12:53:10 +0100
4+
Subject: [PATCH] mt7987: make SPI controller configurable
5+
6+
Allow selecting the SPI controller used for SPIM-NAND or SPI-NOR boot
7+
devices (either SPI0 or SPI2).
8+
9+
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10+
---
11+
plat/mediatek/apsoc_common/Config.in | 1 +
12+
plat/mediatek/mt7987/Config.in | 29 +++++++++++++++++++++
13+
plat/mediatek/mt7987/bl2/bl2.mk | 12 +++++++++
14+
plat/mediatek/mt7987/bl2/bl2_dev_spi_nand.c | 10 ++++++-
15+
plat/mediatek/mt7987/platform.mk | 4 +--
16+
5 files changed, 53 insertions(+), 3 deletions(-)
17+
create mode 100644 plat/mediatek/mt7987/Config.in
18+
19+
--- a/plat/mediatek/apsoc_common/Config.in
20+
+++ b/plat/mediatek/apsoc_common/Config.in
21+
@@ -783,6 +783,7 @@ config ENABLE_BL31_RUNTIME_LOG
22+
default 1
23+
depends on _ENABLE_BL31_RUNTIME_LOG
24+
25+
+source "plat/mediatek/mt7987/Config.in"
26+
source "plat/mediatek/mt7988/Config.in"
27+
28+
endmenu # Platform configurations
29+
--- /dev/null
30+
+++ b/plat/mediatek/mt7987/Config.in
31+
@@ -0,0 +1,29 @@
32+
+# SPDX-License-Identifier: BSD-3-Clause
33+
+#
34+
+# Copyright (c) 2025 Daniel Golle <daniel@makrotopia.org>
35+
+#
36+
+# MT7987 platform-specific configurations
37+
+#
38+
+
39+
+if _PLAT_MT7987
40+
+
41+
+choice
42+
+ prompt "SPI controller"
43+
+ depends on (_BOOT_DEVICE_SPIM_NAND || _BOOT_DEVICE_SPI_NOR)
44+
+ default _SPIM_CTRL_0 if _BOOT_DEVICE_SPIM_NAND
45+
+ default _SPIM_CTRL_2 if _BOOT_DEVICE_SPI_NOR
46+
+
47+
+ config _SPIM_CTRL_0
48+
+ bool "0"
49+
+
50+
+ config _SPIM_CTRL_2
51+
+ bool "2"
52+
+
53+
+endchoice
54+
+
55+
+config SPIM_CTRL
56+
+ int
57+
+ default 0 if _SPIM_CTRL_0
58+
+ default 2 if _SPIM_CTRL_2
59+
+
60+
+endif # _PLAT_MT7987
61+
--- a/plat/mediatek/mt7987/bl2/bl2.mk
62+
+++ b/plat/mediatek/mt7987/bl2/bl2.mk
63+
@@ -91,7 +91,11 @@ endif # END OF BOOT_DEVICE = ram
64+
ifeq ($(BOOT_DEVICE),nor)
65+
$(eval $(call BL2_BOOT_NOR))
66+
BL2_SOURCES += $(MTK_PLAT_SOC)/bl2/bl2_dev_spi_nor.c
67+
+ifeq ($(SPIM_CTRL),0)
68+
+DTS_NAME := mt7987-spi0
69+
+else
70+
DTS_NAME := mt7987-spi2
71+
+endif
72+
endif # END OF BOOTDEVICE = nor
73+
74+
ifeq ($(BOOT_DEVICE),emmc)
75+
@@ -112,10 +116,18 @@ ifeq ($(BOOT_DEVICE),spim-nand)
76+
$(eval $(call BL2_BOOT_SPI_NAND,0,0))
77+
BL2_SOURCES += $(MTK_PLAT_SOC)/bl2/bl2_dev_spi_nand.c
78+
NAND_TYPE ?= spim:2k+64
79+
+ifeq ($(SPIM_CTRL),2)
80+
+DTS_NAME := mt7987-spi2
81+
+else
82+
DTS_NAME := mt7987-spi0
83+
+endif
84+
$(eval $(call BL2_BOOT_NAND_TYPE_CHECK,$(NAND_TYPE),spim:2k+64 spim:2k+128 spim:4k+256))
85+
endif # END OF BOOTDEVICE = spim-nand
86+
87+
+ifneq ($(SPIM_CTRL),)
88+
+BL2_CPPFLAGS += -DSPIM_CTRL=$(SPIM_CTRL)
89+
+endif
90+
+
91+
ifeq ($(BROM_HEADER_TYPE),)
92+
$(error BOOT_DEVICE has invalid value. Please re-check.)
93+
endif
94+
--- a/plat/mediatek/mt7987/bl2/bl2_dev_spi_nand.c
95+
+++ b/plat/mediatek/mt7987/bl2/bl2_dev_spi_nand.c
96+
@@ -12,10 +12,18 @@
97+
98+
#define MTK_QSPI_SRC_CLK CB_MPLL_D2
99+
100+
+#if SPIM_CTRL == 0
101+
+#define SELECTED_SPIM SPIM0
102+
+#elif SPIM_CTRL == 2
103+
+#define SELECTED_SPIM SPIM2
104+
+#else
105+
+#error "Invalid SPI controller selection"
106+
+#endif
107+
+
108+
uint32_t mtk_plat_get_qspi_src_clk(void)
109+
{
110+
/* config GPIO pinmux to spi mode */
111+
- mtk_spi_gpio_init(SPIM0);
112+
+ mtk_spi_gpio_init(SELECTED_SPIM);
113+
114+
/* select 208M clk */
115+
mtk_spi_source_clock_select(MTK_QSPI_SRC_CLK);
116+
--- a/plat/mediatek/mt7987/platform.mk
117+
+++ b/plat/mediatek/mt7987/platform.mk
118+
@@ -56,8 +56,8 @@ include make_helpers/dep.mk
119+
120+
$(call GEN_DEP_RULES,bl2,emicfg bl2_boot_ram bl2_boot_nand_nmbm bl2_dev_mmc bl2_plat_init bl2_plat_setup mt7987_gpio dtb)
121+
$(call MAKE_DEP,bl2,emicfg,DDR4_4BG_MODE DRAM_DEBUG_LOG DDR3_FREQ_2133 DDR3_FREQ_1866 DDR4_FREQ_3200 DDR4_FREQ_2666)
122+
-$(call MAKE_DEP,bl2,bl2_plat_init,BL2_COMPRESS)
123+
-$(call MAKE_DEP,bl2,bl2_plat_setup,BOOT_DEVICE TRUSTED_BOARD_BOOT BL32_TZRAM_BASE BL32_TZRAM_SIZE BL32_LOAD_OFFSET)
124+
+$(call MAKE_DEP,bl2,bl2_plat_init,BL2_COMPRESS SPIM_CTRL)
125+
+$(call MAKE_DEP,bl2,bl2_plat_setup,BOOT_DEVICE TRUSTED_BOARD_BOOT BL32_TZRAM_BASE BL32_TZRAM_SIZE BL32_LOAD_OFFSET SPIM_CTRL)
126+
$(call MAKE_DEP,bl2,bl2_dev_mmc,BOOT_DEVICE)
127+
$(call MAKE_DEP,bl2,bl2_boot_ram,RAM_BOOT_DEBUGGER_HOOK RAM_BOOT_UART_DL)
128+
$(call MAKE_DEP,bl2,bl2_boot_nand_nmbm,NMBM_MAX_RATIO NMBM_MAX_RESERVED_BLOCKS NMBM_DEFAULT_LOG_LEVEL)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 0a09912eb336bee788443b919ea5b99b195f5a91 Mon Sep 17 00:00:00 2001
2+
From: Daniel Golle <daniel@makrotopia.org>
3+
Date: Sat, 4 Oct 2025 22:13:49 +0100
4+
Subject: [PATCH] hack: mt7987: mmc: use 4-bit bus-width for eMMC
5+
6+
The BananaPi R4 Lite has broken DAT5 signal of the MMC bus, which
7+
results in 8-bit buswidth not working well for the eMMC.
8+
Reduce to 4-bit buswidth fixes it (and makes all other boards with
9+
eMMC a tiny bit slower to boot, but it's in the milliseconds).
10+
---
11+
plat/mediatek/mt7987/bl2/bl2_dev_mmc.c | 2 +-
12+
1 file changed, 1 insertion(+), 1 deletion(-)
13+
14+
--- a/plat/mediatek/mt7987/bl2/bl2_dev_mmc.c
15+
+++ b/plat/mediatek/mt7987/bl2/bl2_dev_mmc.c
16+
@@ -74,7 +74,7 @@ static const struct mt7987_msdc_conf {
17+
{
18+
.base = MSDC0_BASE,
19+
.top_base = MSDC0_TOP_BASE,
20+
- .bus_width = MMC_BUS_WIDTH_8,
21+
+ .bus_width = MMC_BUS_WIDTH_4,
22+
.type = MMC_IS_EMMC,
23+
.src_clk = 200000000,
24+
.dev_comp = &mt7987_msdc_compat,
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 6725bb3c2aa9330f37a591e1e539badf67021b47 Mon Sep 17 00:00:00 2001
2+
From: Daniel Golle <daniel@makrotopia.org>
3+
Date: Sat, 4 Oct 2025 23:59:54 +0100
4+
Subject: [PATCH] hack: mt7987: bl2: move FIP offset to 0x100000
5+
6+
There is no use in allocating more than 2MB to the factory partition.
7+
After all, even for WiFi 7 tri-band devices the calibration data is
8+
still in the kilobytes range.
9+
Move FIP offset to 0x100000 to not waste so much space on small NOR
10+
flash.
11+
12+
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
13+
---
14+
plat/mediatek/mt7987/bl2/bl2_dev_spi_nor.c | 2 +-
15+
1 file changed, 1 insertion(+), 1 deletion(-)
16+
17+
--- a/plat/mediatek/mt7987/bl2/bl2_dev_spi_nor.c
18+
+++ b/plat/mediatek/mt7987/bl2/bl2_dev_spi_nor.c
19+
@@ -7,7 +7,7 @@
20+
#include <stdint.h>
21+
#include <boot_spi.h>
22+
23+
-#define FIP_BASE 0x250000
24+
+#define FIP_BASE 0x100000
25+
#define FIP_SIZE 0x80000
26+
27+
#define MTK_QSPI_SRC_CLK CB_MPLL_D2

0 commit comments

Comments
 (0)