Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
DHDAXCW committed Jun 29, 2024
1 parent e01e8ef commit d7e948e
Show file tree
Hide file tree
Showing 1,343 changed files with 86,304 additions and 149,532 deletions.
15 changes: 15 additions & 0 deletions config/Config-build.in
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@ menu "Global build settings"
default n
help
Adds -g3 to the CFLAGS.

config USE_GC_SECTIONS
bool
prompt "Dead code and data elimination for all packages (EXPERIMENTAL)"
help
Places functions and data items into its own sections to use the linker's
garbage collection capabilites.
Packages can choose to opt-out via setting PKG_BUILD_FLAGS:=no-gc-sections

config USE_LTO
bool
prompt "Use the link-time optimizer for all packages (EXPERIMENTAL)"
help
Adds LTO flags to the CFLAGS and LDFLAGS.
Packages can choose to opt-out via setting PKG_BUILD_FLAGS:=no-lto

config IPV6
def_bool y
Expand Down
2 changes: 1 addition & 1 deletion config/Config-images.in
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ menu "Target Images"
default 8 if TARGET_apm821xx_sata
default 64 if TARGET_bcm27xx
default 32 if TARGET_rockchip
default 32 if TARGET_x86
default 128 if TARGET_armvirt
default 16

config TARGET_ROOTFS_PARTSIZE
Expand Down
17 changes: 10 additions & 7 deletions config/Config-kernel.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ config KERNEL_ARM_PMU
default n
depends on (arm || aarch64)

config KERNEL_RISCV_PMU
bool
select KERNEL_RISCV_PMU_SBI
depends on riscv64

config KERNEL_RISCV_PMU_SBI
bool
depends on riscv64

config KERNEL_X86_VSYSCALL_EMULATION
bool "Enable vsyscall emulation"
default n
Expand All @@ -72,6 +81,7 @@ config KERNEL_PERF_EVENTS
bool "Compile the kernel with performance events and counters"
default n
select KERNEL_ARM_PMU if (arm || aarch64)
select KERNEL_RISCV_PMU if riscv64

config KERNEL_PROFILING
bool "Compile the kernel with profiling enabled"
Expand Down Expand Up @@ -1135,13 +1145,6 @@ config KERNEL_NET_L3_MASTER_DEV
This module provides glue between core networking code and device
drivers to support L3 master devices like VRF.

config KERNEL_XDP_SOCKETS
bool "XDP sockets support"
default y if KERNEL_DEBUG_INFO_BTF
help
XDP sockets allows a channel between XDP programs and
userspace applications.

config KERNEL_PAGE_POOL
def_bool n

Expand Down
4 changes: 2 additions & 2 deletions include/kernel-5.10
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-5.10 = .213
LINUX_KERNEL_HASH-5.10.213 = 84cf30223239ec3333a5f7b2a7fba2042bba70d1582a139f7543956af871ad80
LINUX_VERSION-5.10 = .220
LINUX_KERNEL_HASH-5.10.220 = 7cc3aff924e9707a5dbf1200c79a7f01617e097b9b175d02bda8ca762aeee19b
4 changes: 2 additions & 2 deletions include/kernel-5.15
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .156
LINUX_KERNEL_HASH-5.15.156 = 9f0465d14c93691056f5f94de647601f94f083ad8ce2e5d306564394b13e7778
LINUX_VERSION-5.15 = .161
LINUX_KERNEL_HASH-5.15.161 = d629f78680dc4b65e3d78b61406fb7757b960c83c206e63ad8c2606b3e3c474c
4 changes: 2 additions & 2 deletions include/kernel-5.4
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-5.4 = .272
LINUX_KERNEL_HASH-5.4.272 = 3599d5959a403e64be407d7f05e56cb270d6ddd154e89a596609919ab1e2e366
LINUX_VERSION-5.4 = .278
LINUX_KERNEL_HASH-5.4.278 = e5a00606115545f444ef2766af5652f5539e3c96f46a9778bede89b98ffb8588
45 changes: 39 additions & 6 deletions include/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ include $(INCLUDE_DIR)/download.mk
PKG_BUILD_DIR ?= $(BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
PKG_BUILD_PARALLEL ?=
PKG_USE_MIPS16 ?= 1
PKG_IREMAP ?= 1
PKG_SKIP_DOWNLOAD=$(USE_SOURCE_DIR)$(USE_GIT_TREE)$(USE_GIT_SRC_CHECKOUT)

MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) $(if $(filter 3.% 4.0 4.1,$(MAKE_VERSION)),-j))
Expand All @@ -24,15 +22,50 @@ PKG_JOBS?=-j1
else
PKG_JOBS?=$(if $(PKG_BUILD_PARALLEL),$(MAKE_J),-j1)
endif

PKG_BUILD_FLAGS?=
# TODO remove this when all packages moved to PKG_BUILD_FLAGS=no-mips16
PKG_USE_MIPS16?=1
ifneq ($(strip $(PKG_USE_MIPS16)),1)
PKG_BUILD_FLAGS+=no-mips16
endif

__unknown_flags=$(filter-out no-iremap no-mips16 gc-sections no-gc-sections lto no-lto no-mold,$(PKG_BUILD_FLAGS))
ifneq ($(__unknown_flags),)
$(error unknown PKG_BUILD_FLAGS: $(__unknown_flags))
endif

# $1=flagname, $2=default (0/1)
define pkg_build_flag
$(if $(filter no-$(1),$(PKG_BUILD_FLAGS)),0,$(if $(filter $(1),$(PKG_BUILD_FLAGS)),1,$(2)))
endef

ifeq ($(call pkg_build_flag,iremap,1),1)
IREMAP_CFLAGS = $(call iremap,$(PKG_BUILD_DIR),$(notdir $(PKG_BUILD_DIR)))
TARGET_CFLAGS += $(IREMAP_CFLAGS)
endif

ifdef CONFIG_USE_MIPS16
ifeq ($(strip $(PKG_USE_MIPS16)),1)
ifeq ($(call pkg_build_flag,mips16,1),1)
TARGET_ASFLAGS_DEFAULT = $(filter-out -mips16 -minterlink-mips16,$(TARGET_CFLAGS))
TARGET_CFLAGS += -mips16 -minterlink-mips16
TARGET_CXXFLAGS += -mips16 -minterlink-mips16
endif
endif
ifeq ($(strip $(PKG_IREMAP)),1)
IREMAP_CFLAGS = $(call iremap,$(PKG_BUILD_DIR),$(notdir $(PKG_BUILD_DIR)))
TARGET_CFLAGS += $(IREMAP_CFLAGS)
ifeq ($(call pkg_build_flag,gc-sections,$(if $(CONFIG_USE_GC_SECTIONS),1,0)),1)
TARGET_CFLAGS+= -ffunction-sections -fdata-sections
TARGET_CXXFLAGS+= -ffunction-sections -fdata-sections
TARGET_LDFLAGS+= -Wl,--gc-sections
endif
ifeq ($(call pkg_build_flag,lto,$(if $(CONFIG_USE_LTO),1,0)),1)
TARGET_CFLAGS+= -flto=auto -fno-fat-lto-objects
TARGET_CXXFLAGS+= -flto=auto -fno-fat-lto-objects
TARGET_LDFLAGS+= -flto=auto -fuse-linker-plugin
endif
ifdef CONFIG_USE_MOLD
ifeq ($(call pkg_build_flag,mold,1),1)
TARGET_LINKER:=mold
endif
endif

include $(INCLUDE_DIR)/hardening.mk
Expand Down
2 changes: 1 addition & 1 deletion include/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ DEFAULT_PACKAGES.nas:=\
DEFAULT_PACKAGES.router:=\
dnsmasq-full firewall iptables ppp ppp-mod-pppoe \
block-mount coremark kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw kmod-tun \
iptables-mod-tproxy iptables-mod-extra ipset ip-full default-settings luci luci-newapi \
iptables-mod-tproxy iptables-mod-extra ipset ip-full default-settings luci \
ddns-scripts_aliyun ddns-scripts_dnspod luci-app-ddns luci-app-upnp luci-app-autoreboot \
luci-app-arpbind luci-app-filetransfer luci-app-vsftpd luci-app-ssr-plus luci-app-vlmcsd \
luci-app-accesscontrol luci-app-nlbwmon luci-app-turboacc luci-app-wol curl ca-certificates
Expand Down
35 changes: 1 addition & 34 deletions include/u-boot.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include $(INCLUDE_DIR)/prereq.mk

PKG_NAME ?= u-boot

ifndef PKG_SOURCE_PROTO
Expand All @@ -20,31 +18,6 @@ PKG_LICENSE_FILES:=Licenses/README

PKG_BUILD_PARALLEL ?= 1

ifdef UBOOT_USE_BINMAN
$(eval $(call TestHostCommand,python3-pyelftools, \
Please install the Python3 elftools module, \
$(STAGING_DIR_HOST)/bin/python3 -c 'import elftools'))
endif

ifdef UBOOT_USE_INTREE_DTC
$(eval $(call TestHostCommand,python3-dev, \
Please install the python3-dev package, \
python3.11-config --includes 2>&1 | grep 'python3', \
python3.10-config --includes 2>&1 | grep 'python3', \
python3.9-config --includes 2>&1 | grep 'python3', \
python3.8-config --includes 2>&1 | grep 'python3', \
python3.7-config --includes 2>&1 | grep 'python3', \
python3-config --includes 2>&1 | grep -E 'python3\.([7-9]|[0-9][0-9])\.?'))

$(eval $(call TestHostCommand,python3-setuptools, \
Please install the Python3 setuptools module, \
$(STAGING_DIR_HOST)/bin/python3 -c 'import setuptools'))

$(eval $(call TestHostCommand,swig, \
Please install the swig package, \
swig -version))
endif

export GCC_HONOUR_COPTS=s

define Package/u-boot/install/default
Expand All @@ -69,7 +42,6 @@ endef
TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))

UBOOT_MAKE_FLAGS = \
PATH=$(STAGING_DIR_HOST)/bin:$(PATH) \
HOSTCC="$(HOSTCC)" \
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \
HOSTLDFLAGS="$(HOST_LDFLAGS)" \
Expand Down Expand Up @@ -111,14 +83,9 @@ endef

define Build/Configure/U-Boot
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIGURE_VARS) $(UBOOT_CONFIG)_config
$(if $(strip $(UBOOT_CUSTOMIZE_CONFIG)),
$(PKG_BUILD_DIR)/scripts/config --file $(PKG_BUILD_DIR)/.config $(UBOOT_CUSTOMIZE_CONFIG)
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIGURE_VARS) oldconfig)
endef

ifndef UBOOT_USE_INTREE_DTC
DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
endif
DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)

define Build/Compile/U-Boot
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
Expand Down
33 changes: 30 additions & 3 deletions package/boot/arm-trusted-firmware-mediatek/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ PKG_RELEASE:=2

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/mtk-openwrt/arm-trusted-firmware.git
PKG_SOURCE_DATE:=2023-07-24
PKG_SOURCE_VERSION:=00ac6db375b76e57e1f5e9e9bffa033e907c3581
PKG_MIRROR_HASH:=74fc18395532c4292f530da8d00fa1873ada4e05e600c0077a7b7f85ace0d913
PKG_SOURCE_DATE:=2024-01-17
PKG_SOURCE_VERSION:=bacca82a8cac369470df052a9d801a0ceb9b74ca
PKG_MIRROR_HASH:=d035c1b63a9bd71d752c90540361b66d290e7cf42dcca73259d0950af3569c79

PKG_MAINTAINER:=Daniel Golle <[email protected]>

Expand Down Expand Up @@ -94,6 +94,30 @@ define Trusted-Firmware-A/mt7622-sdmmc-2ddr
DDR3_FLYBY:=1
endef

define Trusted-Firmware-A/mt7981-nor-ddr4
NAME:=MediaTek MT7981 (SPI-NOR, DDR4)
BOOT_DEVICE:=nor
BUILD_SUBTARGET:=filogic
PLAT:=mt7981
DDR_TYPE:=ddr4
endef

define Trusted-Firmware-A/mt7981-emmc-ddr4
NAME:=MediaTek MT7981 (eMMC, DDR4)
BOOT_DEVICE:=emmc
BUILD_SUBTARGET:=filogic
PLAT:=mt7981
DDR_TYPE:=ddr4
endef

define Trusted-Firmware-A/mt7981-spim-nand-ddr4
NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7981
DDR_TYPE:=ddr4
endef

define Trusted-Firmware-A/mt7981-nor-ddr3
NAME:=MediaTek MT7981 (SPI-NOR, DDR3)
BOOT_DEVICE:=nor
Expand Down Expand Up @@ -349,6 +373,9 @@ TFA_TARGETS:= \
mt7981-sdmmc-ddr3 \
mt7981-snand-ddr3 \
mt7981-spim-nand-ddr3 \
mt7981-emmc-ddr4 \
mt7981-nor-ddr4 \
mt7981-spim-nand-ddr4 \
mt7986-emmc-ddr3 \
mt7986-nor-ddr3 \
mt7986-sdmmc-ddr3 \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From fb2a2b669ec9bbf5c448d4b56499bc83de075c93 Mon Sep 17 00:00:00 2001
From: Daniel Golle <[email protected]>
Date: Thu, 29 Feb 2024 18:01:08 +0000
Subject: [PATCH 1/3] mediatek: snfi: FM35Q1GA is x4-only

Dont allow x2 read and cache read operations on FM35Q1GA.

Signed-off-by: Daniel Golle <[email protected]>
---
plat/mediatek/apsoc_common/drivers/snfi/mtk-snand-ids.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/plat/mediatek/apsoc_common/drivers/snfi/mtk-snand-ids.c
+++ b/plat/mediatek/apsoc_common/drivers/snfi/mtk-snand-ids.c
@@ -423,7 +423,7 @@ static const struct snand_flash_info sna

SNAND_INFO("FM35Q1GA", SNAND_ID(SNAND_ID_DYMMY, 0xe5, 0x71),
SNAND_MEMORG_1G_2K_64,
- &snand_cap_read_from_cache_x4,
+ &snand_cap_read_from_cache_x4_only,
&snand_cap_program_load_x4),

SNAND_INFO("PN26G01A", SNAND_ID(SNAND_ID_DYMMY, 0xa1, 0xe1),
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
From 6470986f037880ce76960c369d6e5a5270e7ce32 Mon Sep 17 00:00:00 2001
From: Daniel Golle <[email protected]>
Date: Sun, 10 Mar 2024 15:39:07 +0000
Subject: [PATCH 2/3] mediatek: snfi: adjust pin drive strength for Fidelix
SPI-NAND

It seems like we might need to adjust the pin driver strength to 12mA
for Fidelix SPI-NAND chip on MT7622 to avoid SPI data corruption on
some devices.

Signed-off-by: Daniel Golle <[email protected]>
---
.../apsoc_common/drivers/snfi/mtk-snand-def.h | 7 +++++
.../apsoc_common/drivers/snfi/mtk-snand-ids.c | 4 ++-
.../apsoc_common/drivers/snfi/mtk-snand.c | 30 +++++++++++++++++++
3 files changed, 40 insertions(+), 1 deletion(-)

--- a/plat/mediatek/apsoc_common/drivers/snfi/mtk-snand-def.h
+++ b/plat/mediatek/apsoc_common/drivers/snfi/mtk-snand-def.h
@@ -86,6 +86,12 @@ struct snand_mem_org {

typedef int (*snand_select_die_t)(struct mtk_snand *snf, uint32_t dieidx);

+enum snand_drv {
+ SNAND_DRV_NO_CHANGE = 0,
+ SNAND_DRV_8mA = 8,
+ SNAND_DRV_12mA = 12,
+};
+
struct snand_flash_info {
const char *model;
struct snand_id id;
@@ -93,6 +99,7 @@ struct snand_flash_info {
const struct snand_io_cap *cap_rd;
const struct snand_io_cap *cap_pl;
snand_select_die_t select_die;
+ enum snand_drv drv;
};

#define SNAND_INFO(_model, _id, _memorg, _cap_rd, _cap_pl, ...) \
--- a/plat/mediatek/apsoc_common/drivers/snfi/mtk-snand-ids.c
+++ b/plat/mediatek/apsoc_common/drivers/snfi/mtk-snand-ids.c
@@ -424,7 +424,9 @@ static const struct snand_flash_info sna
SNAND_INFO("FM35Q1GA", SNAND_ID(SNAND_ID_DYMMY, 0xe5, 0x71),
SNAND_MEMORG_1G_2K_64,
&snand_cap_read_from_cache_x4_only,
- &snand_cap_program_load_x4),
+ &snand_cap_program_load_x4,
+ NULL,
+ SNAND_DRV_12mA),

SNAND_INFO("PN26G01A", SNAND_ID(SNAND_ID_DYMMY, 0xa1, 0xe1),
SNAND_MEMORG_1G_2K_128,
--- a/plat/mediatek/apsoc_common/drivers/snfi/mtk-snand.c
+++ b/plat/mediatek/apsoc_common/drivers/snfi/mtk-snand.c
@@ -1845,6 +1845,33 @@ static int mtk_snand_id_probe(struct mtk
return -EINVAL;
}

+#define MT7622_GPIO_BASE (void *)0x10211000
+#define MT7622_GPIO_DRIV(x) (MT7622_GPIO_BASE + 0x900 + 0x10 * x)
+
+void mtk_mt7622_snand_adjust_drive(void *dev, enum snand_drv drv)
+{
+ uint32_t e4, e8;
+
+ e4 = readl(MT7622_GPIO_DRIV(6)) & ~(0x3f00);
+ e8 = readl(MT7622_GPIO_DRIV(7)) & ~(0x3f00);
+
+ switch (drv) {
+ case SNAND_DRV_8mA:
+ e4 |= 0x3f00;
+ break;
+ case SNAND_DRV_12mA:
+ e8 |= 0x3f00;
+ break;
+ default:
+ return;
+ }
+
+ snand_log_chip(dev, "adjusting SPI-NAND pin drive strength to %umA\n", drv);
+
+ writel(e4, MT7622_GPIO_DRIV(6));
+ writel(e8, MT7622_GPIO_DRIV(7));
+}
+
int mtk_snand_init(void *dev, const struct mtk_snand_platdata *pdata,
struct mtk_snand **psnf)
{
@@ -1888,6 +1915,9 @@ int mtk_snand_init(void *dev, const stru
if (ret)
return ret;

+ if (pdata->soc == SNAND_SOC_MT7622 && snand_info->drv)
+ mtk_mt7622_snand_adjust_drive(dev, snand_info->drv);
+
rawpage_size = snand_info->memorg.pagesize +
snand_info->memorg.sparesize;

Loading

0 comments on commit d7e948e

Please sign in to comment.