Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2025-02-19 20:10:49 +08:00
commit 90a59fc027
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
60 changed files with 819 additions and 763 deletions

View File

@ -9,7 +9,8 @@ board=$(board_name)
case "$board" in
linksys,mx2000|\
linksys,mx5500)
linksys,mx5500|\
linksys,spnmx56)
idx="$(find_mtd_index u_env)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000"

View File

@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_RELEASE:=1
PKG_VERSION:=2022.10
PKG_HASH:=50b4482a505bc281ba8470c399a3c26e145e29b23500bc35c50debd7fa46bdf8
PKG_VERSION:=2023.10
PKG_HASH:=e00e6c6f014e046101739d08d06f328811cebcf5ae101348f409cbbd55ce6900
UBOOT_USE_INTREE_DTC:=1
@ -58,7 +58,7 @@ define Build/InstallDev
$(INSTALL_BIN) $(PKG_BUILD_DIR)/spl/u-boot-spl.bin $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE)-spl
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(DTS_DIR)/$(UBOOT_DTS) $(STAGING_DIR_IMAGE)/$(UBOOT_DTS)
mkimage -C none -A arm -T script -d uEnv-$(UENV).txt \
mkimage -C none -A riscv -T script -d uEnv-$(UENV).txt \
$(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-boot.scr
endef

View File

@ -1,19 +1,42 @@
From 725595e667cc4423347c255da8ca4c5b3aa0980a Mon Sep 17 00:00:00 2001
From 2ba4e6d78e0a63e5d491f9b01b498899e58cb58d Mon Sep 17 00:00:00 2001
From: Vincent Chen <vincent.chen@sifive.com>
Date: Mon, 15 Nov 2021 03:31:04 -0800
Subject: [PATCH 2/8] board: sifive: spl: Initialized the PWM setting in the
Subject: [PATCH 1/5] board: sifive: spl: Initialized the PWM setting in the
SPL stage
LEDs and multiple fans can be controlled by SPL. This patch ensures
that all fans have been enabled in the SPL stage. In addition, the
LED's color will be set to yellow.
Upstream-Status: Pending
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
---
board/sifive/unmatched/Makefile | 1 +
board/sifive/unmatched/pwm.c | 57 +++++++++++++++++++++++++++++++++
board/sifive/unmatched/spl.c | 2 ++
3 files changed, 60 insertions(+)
arch/riscv/include/asm/arch-fu740/eeprom.h | 15 ++++++
board/sifive/unmatched/Makefile | 1 +
board/sifive/unmatched/pwm.c | 57 ++++++++++++++++++++++
board/sifive/unmatched/spl.c | 2 +
4 files changed, 75 insertions(+)
create mode 100644 arch/riscv/include/asm/arch-fu740/eeprom.h
create mode 100644 board/sifive/unmatched/pwm.c
--- /dev/null
+++ b/arch/riscv/include/asm/arch-fu740/eeprom.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2021 SiFive, Inc.
+ *
+ * Zong Li <zong.li@sifve.com>
+ */
+
+#ifndef _ASM_RISCV_EEPROM_H
+#define _ASM_RISCV_EEPROM_H
+
+#define PCB_REVISION_REV3 0x3
+
+u8 get_pcb_revision_from_eeprom(void);
+
+#endif /* _ASM_RISCV_EEPROM_H */
--- a/board/sifive/unmatched/Makefile
+++ b/board/sifive/unmatched/Makefile
@@ -9,3 +9,4 @@ obj-y += spl.o

View File

@ -1,13 +1,16 @@
From 7ead6d662a2f9d8498af6650ea38418c64b52048 Mon Sep 17 00:00:00 2001
From 0dfab8fab80107aa4ad7d41a8ff47e5ff59632f9 Mon Sep 17 00:00:00 2001
From: Vincent Chen <vincent.chen@sifive.com>
Date: Mon, 24 Jan 2022 02:42:02 -0800
Subject: [PATCH 3/8] board: sifive: Set LED's color to purple in the U-boot
Subject: [PATCH 2/5] board: sifive: Set LED's color to purple in the U-boot
stage
Set LED's color to purple in the U-boot stage. Because there are still
some functions to be executed before board_early_init_f(), it means
the LED's is not changed to purple instantly when entering the U-boot
stage.
Upstream-Status: Pending
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
---
board/sifive/unmatched/pwm.c | 7 +++++++
board/sifive/unmatched/unmatched.c | 6 ++++++
@ -52,7 +55,7 @@ stage.
/* enable all cache ways */
--- a/configs/sifive_unmatched_defconfig
+++ b/configs/sifive_unmatched_defconfig
@@ -62,3 +62,4 @@ CONFIG_DM_SCSI=y
@@ -63,3 +63,4 @@ CONFIG_DM_SCSI=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PCI=y

View File

@ -1,20 +1,23 @@
From 6ef7023c0dcfde320015ab19e0e0d423921be77d Mon Sep 17 00:00:00 2001
From 1a48019dd4b69dd76551217a61cc4cab9e92fd39 Mon Sep 17 00:00:00 2001
From: Vincent Chen <vincent.chen@sifive.com>
Date: Mon, 15 Nov 2021 03:39:07 -0800
Subject: [PATCH 1/2] board: sifive: Set LED's color to blue before jumping to
Subject: [PATCH 3/5] board: sifive: Set LED's color to blue before jumping to
Linux
The LED's color wil be changed from purple to blue before executing
the sysboot command. Because the sysboot command includes the image loading
from the boot partition, It means the LED's color is blue when executing
"Retrieving file: /Image.gz".
Upstream-Status: Pending
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
---
include/configs/sifive-unmatched.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/include/configs/sifive-unmatched.h
+++ b/include/configs/sifive-unmatched.h
@@ -49,7 +49,12 @@
@@ -48,6 +48,11 @@
"type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \
"partitions=" PARTS_DEFAULT "\0" \
"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
@ -26,5 +29,4 @@ from the boot partition, It means the LED's color is blue when executing
+ "sysboot ${devtype} ${devnum}:${distro_bootpart} any " \
+ "${scriptaddr} ${prefix}${boot_syslinux_conf};\0"
#define CONFIG_SYS_EEPROM_BUS_NUM 0
#endif /* __SIFIVE_UNMATCHED_H */

View File

@ -0,0 +1,67 @@
From 877afdf63129caa64d70d4a1252eec44778cfa0e Mon Sep 17 00:00:00 2001
From: Vincent Chen <vincent.chen@sifive.com>
Date: Mon, 24 Jan 2022 02:57:40 -0800
Subject: [PATCH 4/5] board: sifive: spl: Set remote thermal of TMP451 to 85
deg C
for the unmatched board
For TMP451 on the unmatched board, the default value of the remote
thermal threshold is 108 deg C. This commit initilizes it to 85 deg C at SPL.
Upstream-Status: Pending
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
---
board/sifive/unmatched/spl.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
--- a/board/sifive/unmatched/spl.c
+++ b/board/sifive/unmatched/spl.c
@@ -10,6 +10,8 @@
#include <spl.h>
#include <misc.h>
#include <log.h>
+#include <config.h>
+#include <i2c.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <asm/gpio.h>
@@ -26,6 +28,24 @@
#define MODE_SELECT_SD 0xb
#define MODE_SELECT_MASK GENMASK(3, 0)
+#define TMP451_REMOTE_THERM_LIMIT_REG_OFFSET 0x19
+#define TMP451_REMOTE_THERM_LIMIT_INIT_VALUE 0x55
+
+static inline int init_tmp451_remote_therm_limit(void)
+{
+ struct udevice *dev;
+ unsigned char r_therm_limit = TMP451_REMOTE_THERM_LIMIT_INIT_VALUE;
+ int ret;
+
+ ret = i2c_get_chip_for_busnum(0, 0x4c, 0x1, &dev);
+
+ if (!ret)
+ ret = dm_i2c_write(dev, TMP451_REMOTE_THERM_LIMIT_REG_OFFSET,
+ &r_therm_limit,
+ sizeof(unsigned char));
+ return ret;
+}
+
static inline int spl_reset_device_by_gpio(const char *label, int pin, int low_width)
{
int ret;
@@ -92,6 +112,12 @@ int spl_board_init_f(void)
pwm_device_init();
+ ret = init_tmp451_remote_therm_limit();
+ if (ret) {
+ debug("TMP451 remote THERM limit init failed: %d\n", ret);
+ goto end;
+ }
+
ret = spl_gemgxl_init();
if (ret) {
debug("Gigabit ethernet PHY (VSC8541) init failed: %d\n", ret);

View File

@ -1,111 +0,0 @@
From 07f84ed283b913cbdf87181ae2ed65467d923df5 Mon Sep 17 00:00:00 2001
From: Vincent Chen <vincent.chen@sifive.com>
Date: Mon, 24 Jan 2022 02:57:40 -0800
Subject: [PATCH 2/2] board: sifive: spl: Set remote thermal of TMP451 to 85
deg C for the unmatched board
For TMP451 on the unmatched board, the default value of the remote
thermal threshold is 108 deg C. This commit initilizes it to 85 deg C at SPL.
---
board/sifive/unmatched/spl.c | 29 +++++++++++++++++++++++++++++
drivers/misc/Kconfig | 10 ++++++++++
include/configs/sifive-unmatched.h | 4 ++++
scripts/config_whitelist.txt | 1 +
4 files changed, 44 insertions(+)
--- a/board/sifive/unmatched/spl.c
+++ b/board/sifive/unmatched/spl.c
@@ -10,6 +10,8 @@
#include <spl.h>
#include <misc.h>
#include <log.h>
+#include <config.h>
+#include <i2c.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <asm/gpio.h>
@@ -26,6 +28,27 @@
#define MODE_SELECT_SD 0xb
#define MODE_SELECT_MASK GENMASK(3, 0)
+#define TMP451_REMOTE_THERM_LIMIT_REG_OFFSET 0x19
+#define TMP451_REMOTE_THERM_LIMIT_INIT_VALUE 0x55
+
+static inline int init_tmp451_remote_therm_limit(void)
+{
+ struct udevice *dev;
+ unsigned char r_therm_limit = TMP451_REMOTE_THERM_LIMIT_INIT_VALUE;
+ int ret;
+
+ ret = i2c_get_chip_for_busnum(CONFIG_SYS_TMP451_BUS_NUM,
+ CONFIG_SYS_I2C_TMP451_ADDR,
+ CONFIG_SYS_I2C_TMP451_ADDR_LEN,
+ &dev);
+
+ if (!ret)
+ ret = dm_i2c_write(dev, TMP451_REMOTE_THERM_LIMIT_REG_OFFSET,
+ &r_therm_limit,
+ sizeof(unsigned char));
+ return ret;
+}
+
static inline int spl_reset_device_by_gpio(const char *label, int pin, int low_width)
{
int ret;
@@ -92,6 +115,12 @@ int spl_board_init_f(void)
pwm_device_init();
+ ret = init_tmp451_remote_therm_limit();
+ if (ret) {
+ debug("TMP451 remote THERM limit init failed: %d\n", ret);
+ goto end;
+ }
+
ret = spl_gemgxl_init();
if (ret) {
debug("Gigabit ethernet PHY (VSC8541) init failed: %d\n", ret);
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -536,8 +536,18 @@ config SYS_I2C_EEPROM_ADDR
depends on ID_EEPROM || I2C_EEPROM || SPL_I2C_EEPROM || CMD_EEPROM || ENV_IS_IN_EEPROM
default 0
+config SYS_I2C_TMP451_ADDR
+ hex "Chip address of the TMP451 device"
+ default 0
+
if I2C_EEPROM
+config SYS_I2C_TMP451_ADDR_LEN
+ int "Length in bytes of the TMP451 memory array address"
+ default 1
+ help
+ Note: This is NOT the chip address length!
+
config SYS_I2C_EEPROM_ADDR_OVERFLOW
hex "EEPROM Address Overflow"
default 0x0
--- a/include/configs/sifive-unmatched.h
+++ b/include/configs/sifive-unmatched.h
@@ -15,6 +15,10 @@
#define CONFIG_STANDALONE_LOAD_ADDR 0x80200000
+#define CONFIG_SYS_TMP451_BUS_NUM 0
+#define CONFIG_SYS_I2C_TMP451_ADDR 0x4c
+#define CONFIG_SYS_I2C_TMP451_ADDR_LEN 0x1
+
/* Environment options */
#define BOOT_TARGET_DEVICES(func) \
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1268,6 +1268,7 @@ CONFIG_SYS_TIMER_BASE
CONFIG_SYS_TIMER_COUNTER
CONFIG_SYS_TIMER_COUNTS_DOWN
CONFIG_SYS_TIMER_RATE
+CONFIG_SYS_TMP451_BUS_NUM
CONFIG_SYS_TMPVIRT
CONFIG_SYS_TSEC1_OFFSET
CONFIG_SYS_TX_ETH_BUFFER

View File

@ -1,7 +1,7 @@
From c29e4d84cfa17ab96eff2a9044f486ba3c8b5c43 Mon Sep 17 00:00:00 2001
From 9b2868e9fda750c985313a40e60b67f96dc77ed1 Mon Sep 17 00:00:00 2001
From: Atish Patra <atish.patra@wdc.com>
Date: Mon, 25 Oct 2021 11:35:41 -0700
Subject: [PATCH] riscv: dts: Add few PMU events
Subject: [PATCH 5/5] riscv: dts: Add few PMU events
fu740 has 2 HPM counters and many HPM events defined in the fu740 manual[1].
This patch adds some of these events and their mapping as per the
@ -9,6 +9,7 @@ OpenSBI PMU DT binding for now.
[1]https://sifive.cdn.prismic.io/sifive/de1491e5-077c-461d-9605-e8a0ce57337d_fu740-c000-manual-v1p3.pdf
Upstream-Status: Pending
Signed-off-by: Atish Patra <atish.patra@wdc.com>
---
arch/riscv/dts/fu740-c000.dtsi | 11 +++++++++++

View File

@ -0,0 +1,22 @@
From 45f9941ddc6346b38aa9eb7f033e1e169b63bdc7 Mon Sep 17 00:00:00 2001
From: Thomas Perrot <thomas.perrot@bootlin.com>
Date: Fri, 8 Dec 2023 11:24:37 +0100
Subject: [PATCH] riscv: sifive: fu740: reduce DDR speed from 1866MT/s to
1600MT/s
Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
---
arch/riscv/dts/fu740-c000-u-boot.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/riscv/dts/fu740-c000-u-boot.dtsi
+++ b/arch/riscv/dts/fu740-c000-u-boot.dtsi
@@ -77,7 +77,7 @@
0x0 0x100b2000 0x0 0x2000
0x0 0x100b8000 0x0 0x1000>;
clocks = <&prci FU740_PRCI_CLK_DDRPLL>;
- clock-frequency = <933333324>;
+ clock-frequency = <800000004>;
bootph-pre-ram;
};
};

View File

@ -1,48 +0,0 @@
commit 1dde977518f13824b847e23275001191139bc384
Author: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Date: Mon Oct 3 18:07:54 2022 +0200
riscv: Fix build against binutils 2.38
The following description is copied from the equivalent patch for the
Linux Kernel proposed by Aurelien Jarno:
>From version 2.38, binutils default to ISA spec version 20191213. This
means that the csr read/write (csrr*/csrw*) instructions and fence.i
instruction has separated from the `I` extension, become two standalone
extensions: Zicsr and Zifencei. As the kernel uses those instruction,
this causes the following build failure:
arch/riscv/cpu/mtrap.S: Assembler messages:
arch/riscv/cpu/mtrap.S:65: Error: unrecognized opcode `csrr a0,scause'
arch/riscv/cpu/mtrap.S:66: Error: unrecognized opcode `csrr a1,sepc'
arch/riscv/cpu/mtrap.S:67: Error: unrecognized opcode `csrr a2,stval'
arch/riscv/cpu/mtrap.S:70: Error: unrecognized opcode `csrw sepc,a0'
Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Christian Stewart <christian@paral.in>
Reviewed-by: Rick Chen <rick@andestech.com>
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -24,7 +24,16 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
CMODEL = medany
endif
-ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
+RISCV_MARCH = $(ARCH_BASE)$(ARCH_A)$(ARCH_C)
+
+# Newer binutils versions default to ISA spec version 20191213 which moves some
+# instructions from the I extension to the Zicsr and Zifencei extensions.
+toolchain-need-zicsr-zifencei := $(call cc-option-yn, -mabi=$(ABI) -march=$(RISCV_MARCH)_zicsr_zifencei)
+ifeq ($(toolchain-need-zicsr-zifencei),y)
+ RISCV_MARCH := $(RISCV_MARCH)_zicsr_zifencei
+endif
+
+ARCH_FLAGS = -march=$(RISCV_MARCH) -mabi=$(ABI) \
-mcmodel=$(CMODEL)
PLATFORM_CPPFLAGS += $(ARCH_FLAGS)

View File

@ -17,7 +17,7 @@ Cc: Simon Glass <sjg@chromium.org>
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -729,9 +729,14 @@ static int fit_handle_file(struct image_
@@ -754,9 +754,14 @@ static int fit_handle_file(struct image_
}
*cmd = '\0';
} else if (params->datafile) {

View File

@ -1,10 +1,10 @@
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -119,7 +119,6 @@ dumpimage-mkimage-objs := aisimage.o \
@@ -114,7 +114,6 @@ dumpimage-mkimage-objs := aisimage.o \
imximage.o \
imx8image.o \
imx8mimage.o \
- kwbimage.o \
lib/md5.o \
generated/lib/md5.o \
lpc32xximage.o \
mxsimage.o \

View File

@ -1,6 +1,6 @@
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -1122,6 +1122,7 @@ static int fit_config_add_verification_d
@@ -1125,6 +1125,7 @@ static int fit_config_add_verification_d
* 2) get public key (X509_get_pubkey)
* 3) provide der format (d2i_RSAPublicKey)
*/
@ -8,7 +8,7 @@
static int read_pub_key(const char *keydir, const void *name,
unsigned char **pubkey, int *pubkey_len)
{
@@ -1175,6 +1176,13 @@ err_cert:
@@ -1178,6 +1179,13 @@ err_cert:
fclose(f);
return ret;
}

View File

@ -9,9 +9,8 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2024.01
PKG_HASH:=b99611f1ed237bf3541bdc8434b68c96a6e05967061f992443cb30aabebef5b3
PKG_VERSION:=2025.01
PKG_HASH:=cdef7d507c93f1bbd9f015ea9bc21fa074268481405501945abc6f854d5b686f
PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
@ -114,6 +113,7 @@ endef
define U-Boot/Hummingbird_A31
BUILD_SUBTARGET:=cortexa7
NAME:=Hummingbird A31 board
BUILD_DEVICES:=merrii_hummingbird
endef
define U-Boot/Marsboard_A10
@ -428,6 +428,11 @@ UBOOT_TARGETS := \
UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes
UBOOT_CUSTOMIZE_CONFIG := \
--disable TOOLS_KWBIMAGE \
--disable TOOLS_LIBCRYPTO \
--disable TOOLS_MKEFICAPSULE
UBOOT_MAKE_FLAGS += \
BL31=$(STAGING_DIR_IMAGE)/bl31_sunxi-$(ATF).bin SCP=/dev/null

View File

@ -14,7 +14,7 @@ More specifically, the following settings are now used:
--- a/arch/arm/mach-sunxi/clock_sun6i.c
+++ b/arch/arm/mach-sunxi/clock_sun6i.c
@@ -131,11 +131,12 @@ void clock_set_pll1(unsigned int clk)
@@ -128,11 +128,12 @@ void clock_set_pll1(unsigned int clk)
struct sunxi_ccm_reg * const ccm =
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
const int p = 0;

View File

@ -18,7 +18,7 @@ required setting for the PLL LDO is 1.37v as per the A31 manual.
--- a/arch/arm/mach-sunxi/clock_sun6i.c
+++ b/arch/arm/mach-sunxi/clock_sun6i.c
@@ -28,13 +28,26 @@ void clock_init_safe(void)
@@ -27,13 +27,26 @@ void clock_init_safe(void)
struct sunxi_prcm_reg * const prcm =
(struct sunxi_prcm_reg *)SUNXI_PRCM_BASE;

View File

@ -45,6 +45,7 @@ ALLWIFIBOARDS:= \
linksys_mx5300 \
linksys_mx5500 \
linksys_mx8500 \
linksys_spnmx56 \
linksys_whw03 \
netgear_lbr20 \
netgear_rax120v2 \
@ -184,6 +185,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200))
$(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300))
$(eval $(call generate-ipq-wifi-package,linksys_mx5500,Linksys MX5500))
$(eval $(call generate-ipq-wifi-package,linksys_mx8500,Linksys MX8500))
$(eval $(call generate-ipq-wifi-package,linksys_spnmx56,Linksys SPNMX56))
$(eval $(call generate-ipq-wifi-package,linksys_whw03,Linksys WHW03))
$(eval $(call generate-ipq-wifi-package,netgear_lbr20,Netgear LBR20))
$(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2))

View File

@ -8,16 +8,16 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mwlwifi
PKG_RELEASE=2
PKG_RELEASE=1
PKG_LICENSE:=ISC
PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2024-04-19
PKG_SOURCE_VERSION:=a737d348ef4fe00434b2bc44b2b6a68ea833d95b
PKG_MIRROR_HASH:=d55f69c2fa48d02ba535b72b108fc77f5f13a52b29130a631489a053f1670d2c
PKG_SOURCE_DATE:=2025-02-06
PKG_SOURCE_VERSION:=db97edf20fadea2617805006f5230665fadc6a8c
PKG_MIRROR_HASH:=b5464cf6d57d87f6ce5f13bd2320c7e7e671a3152a74f4ef004382f898b89ecf
PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
PKG_BUILD_PARALLEL:=1

View File

@ -20,7 +20,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
--- a/hif/fwcmd.c
+++ b/hif/fwcmd.c
@@ -3622,11 +3622,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ie
@@ -3624,11 +3624,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ie
core_dump->context = pcmd->cmd_data.coredump.context;
core_dump->size_kb = pcmd->cmd_data.coredump.size_kb;
core_dump->flags = pcmd->cmd_data.coredump.flags;

View File

@ -19,7 +19,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
--- a/hif/pcie/pcie.c
+++ b/hif/pcie/pcie.c
@@ -1466,8 +1466,8 @@ static void pcie_bf_mimo_ctrl_decode(str
@@ -1449,8 +1449,8 @@ static void pcie_bf_mimo_ctrl_decode(str
&fp_data->f_pos);
filp_close(fp_data, current->files);
} else {

View File

@ -14,7 +14,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
--- a/debugfs.c
+++ b/debugfs.c
@@ -1342,7 +1342,7 @@ done:
@@ -1394,7 +1394,7 @@ done:
priv->reg_value);
else
len += scnprintf(p + len, size - len,

View File

@ -1,31 +0,0 @@
From 8e809b241695252e397bf0d7fc5f36e115c38831 Mon Sep 17 00:00:00 2001
From: Robert Marko <robert.marko@sartura.hr>
Date: Fri, 5 Mar 2021 11:47:59 +0100
Subject: [PATCH] mwlwifi: fix PCIe DT node null pointer dereference
pci_bus_to_OF_node() used to get the PCI bus DT node
returns node if found or NULL if none is found.
Since the return of pci_bus_to_OF_node() is not checked in
the DT node name print it will cause a null pointer
dereference and crash the kernel.
So first check whether the node is not NULL and then print.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
hif/pcie/pcie.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/hif/pcie/pcie.c
+++ b/hif/pcie/pcie.c
@@ -685,7 +685,8 @@ static struct device_node *pcie_get_devi
struct device_node *dev_node;
dev_node = pci_bus_to_OF_node(pcie_priv->pdev->bus);
- wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name);
+ if (dev_node)
+ wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name);
return dev_node;
}

View File

@ -13,7 +13,7 @@
--- a/debugfs.c
+++ b/debugfs.c
@@ -498,9 +498,9 @@ static ssize_t mwl_debugfs_vif_read(stru
@@ -550,9 +550,9 @@ static ssize_t mwl_debugfs_vif_read(stru
switch (vif->type) {
case NL80211_IFTYPE_AP:
len += scnprintf(p + len, size - len, "type: ap\n");
@ -26,7 +26,7 @@
len += scnprintf(p + len, size - len,
"ssid: %s\n", ssid);
len += scnprintf(p + len, size - len,
@@ -522,8 +522,8 @@ static ssize_t mwl_debugfs_vif_read(stru
@@ -574,8 +574,8 @@ static ssize_t mwl_debugfs_vif_read(stru
"type: unknown\n");
break;
}
@ -37,7 +37,7 @@
len += scnprintf(p + len, size - len,
"channel: %d: width: %d\n",
chan_def->chan->hw_value,
@@ -596,18 +596,18 @@ static ssize_t mwl_debugfs_sta_read(stru
@@ -648,18 +648,18 @@ static ssize_t mwl_debugfs_sta_read(stru
sta_info->wds ? "true" : "false",
sta_info->ba_hist.enable ? "enable" : "disable",
sta_info->is_amsdu_allowed ? sta_info->amsdu_ctrl.cap : 0 ,
@ -68,7 +68,7 @@
sta->tdls,
sta->tdls_initiator,
sta->wme,
@@ -1158,7 +1158,7 @@ static ssize_t mwl_debugfs_dfs_radar_wri
@@ -1210,7 +1210,7 @@ static ssize_t mwl_debugfs_dfs_radar_wri
struct mwl_priv *priv = (struct mwl_priv *)file->private_data;
wiphy_info(priv->hw->wiphy, "simulate radar detected\n");
@ -127,7 +127,7 @@
a_band = true;
else
return -EINVAL;
@@ -2090,7 +2094,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021
@@ -2092,7 +2096,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021
if (mwl_fwcmd_set_wsc_ie(hw, b_inf->ie_wsc_len, b_inf->ie_wsc_ptr))
goto err;
@ -136,7 +136,7 @@
goto err;
if (b_inf->cap_info & WLAN_CAPABILITY_SPECTRUM_MGMT)
@@ -2152,38 +2156,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee
@@ -2154,38 +2158,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee
ether_addr_copy(pcmd->mac_addr, sta->addr);
if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ)
@ -189,7 +189,7 @@
}
pcmd->is_qos_sta = sta->wme;
@@ -2239,38 +2243,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct
@@ -2241,38 +2245,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct
ether_addr_copy(pcmd->mac_addr, sta->addr);
if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ)
@ -242,7 +242,7 @@
}
pcmd->is_qos_sta = sta->wme;
@@ -2787,9 +2791,9 @@ int mwl_fwcmd_create_ba(struct ieee80211
@@ -2789,9 +2793,9 @@ int mwl_fwcmd_create_ba(struct ieee80211
pcmd->ba_info.create_params.flags = cpu_to_le32(ba_flags);
pcmd->ba_info.create_params.queue_id = stream->idx;
pcmd->ba_info.create_params.param_info =
@ -254,7 +254,7 @@
IEEE80211_HT_AMPDU_PARM_DENSITY);
if (direction == BA_FLAG_DIRECTION_UP) {
pcmd->ba_info.create_params.reset_seq_no = 0;
@@ -2799,9 +2803,9 @@ int mwl_fwcmd_create_ba(struct ieee80211
@@ -2801,9 +2805,9 @@ int mwl_fwcmd_create_ba(struct ieee80211
pcmd->ba_info.create_params.current_seq = cpu_to_le16(0);
}
if (priv->chip_type == MWL8964 &&
@ -268,16 +268,16 @@
}
--- a/hif/pcie/8864/tx.c
+++ b/hif/pcie/8864/tx.c
@@ -490,7 +490,7 @@ static void pcie_non_pfu_tx_done(struct
} else
memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen);
skb_pull(done_skb, sizeof(*dma_data) - hdrlen);
- ieee80211_tx_status(priv->hw, done_skb);
+ ieee80211_tx_status_skb(priv->hw, done_skb);
dev_kfree_skb_any(done_skb);
done_skb = NULL;
}
@@ -743,7 +743,7 @@ void pcie_8864_tx_xmit(struct ieee80211_
@@ -478,7 +478,7 @@ static void pcie_non_pfu_tx_done(struct
} else
memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen);
skb_pull(done_skb, sizeof(*dma_data) - hdrlen);
- ieee80211_tx_status(priv->hw, done_skb);
+ ieee80211_tx_status_skb(priv->hw, done_skb);
next:
tx_hndl = tx_hndl->pnext;
tx_desc = tx_hndl->pdesc;
@@ -730,7 +730,7 @@ void pcie_8864_tx_xmit(struct ieee80211_
index = SYSADPT_TX_WMM_QUEUES - index - 1;
txpriority = index;
@ -286,7 +286,7 @@
!(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) &&
ieee80211_is_data_qos(wh->frame_control)) {
tid = qos & 0xf;
@@ -925,4 +925,4 @@ void pcie_8864_tx_del_sta_amsdu_pkts(str
@@ -912,4 +912,4 @@ void pcie_8864_tx_del_sta_amsdu_pkts(str
}
}
spin_unlock_bh(&sta_info->amsdu_lock);
@ -313,7 +313,7 @@
bypass_ack:
if (++tx_done_tail >= MAX_TX_RING_DONE_SIZE)
@@ -596,13 +596,13 @@ void pcie_tx_xmit_ndp(struct ieee80211_h
@@ -593,13 +593,13 @@ void pcie_tx_xmit_ndp(struct ieee80211_h
ack_skb = skb_copy(skb, GFP_ATOMIC);
ack_info = IEEE80211_SKB_CB(ack_skb);
pcie_tx_prepare_info(priv, 0, ack_info);
@ -340,16 +340,16 @@
pcie_priv->txbd_ring_size);
for (num = 0; num < PCIE_MAX_TXRX_BD; num++) {
@@ -444,7 +444,7 @@ static void pcie_pfu_tx_done(struct mwl_
} else
memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen);
skb_pull(done_skb, sizeof(*pfu_dma) - hdrlen);
- ieee80211_tx_status(priv->hw, done_skb);
+ ieee80211_tx_status_skb(priv->hw, done_skb);
}
@@ -431,7 +431,7 @@ static void pcie_pfu_tx_done(struct mwl_
} else
memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen);
skb_pull(done_skb, sizeof(*pfu_dma) - hdrlen);
- ieee80211_tx_status(priv->hw, done_skb);
+ ieee80211_tx_status_skb(priv->hw, done_skb);
}
next:
@@ -694,7 +694,7 @@ void pcie_8997_tx_xmit(struct ieee80211_
memset(data_buf, 0, sizeof(*data_buf));
@@ -682,7 +682,7 @@ void pcie_8997_tx_xmit(struct ieee80211_
index = SYSADPT_TX_WMM_QUEUES - index - 1;
txpriority = index;
@ -358,7 +358,7 @@
!(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) &&
ieee80211_is_data_qos(wh->frame_control)) {
tid = qos & 0xf;
@@ -875,4 +875,4 @@ void pcie_8997_tx_del_sta_amsdu_pkts(str
@@ -863,4 +863,4 @@ void pcie_8997_tx_del_sta_amsdu_pkts(str
}
}
spin_unlock_bh(&sta_info->amsdu_lock);
@ -376,7 +376,7 @@
{
mwl_fwcmd_radio_disable(hw);
@@ -368,15 +368,15 @@ static void mwl_mac80211_bss_info_change
@@ -390,15 +390,15 @@ static void mwl_mac80211_bss_info_change
}
}
@ -395,7 +395,7 @@
{
struct mwl_priv *priv = hw->priv;
struct mwl_vif *mwl_vif;
@@ -426,8 +426,8 @@ static void mwl_mac80211_bss_info_change
@@ -448,8 +448,8 @@ static void mwl_mac80211_bss_info_change
if (changed & (BSS_CHANGED_BEACON_INT | BSS_CHANGED_BEACON)) {
struct sk_buff *skb;
@ -406,7 +406,7 @@
(!info->hidden_ssid)) {
if (mwl_vif->broadcast_ssid != true) {
mwl_fwcmd_broadcast_ssid_enable(hw, vif, true);
@@ -441,7 +441,7 @@ static void mwl_mac80211_bss_info_change
@@ -463,7 +463,7 @@ static void mwl_mac80211_bss_info_change
}
if (!mwl_vif->set_beacon) {
@ -415,7 +415,7 @@
if (skb) {
mwl_fwcmd_set_beacon(hw, vif, skb->data, skb->len);
@@ -458,7 +458,7 @@ static void mwl_mac80211_bss_info_change
@@ -480,7 +480,7 @@ static void mwl_mac80211_bss_info_change
static void mwl_mac80211_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *info,
@ -424,7 +424,7 @@
{
switch (vif->type) {
case NL80211_IFTYPE_AP:
@@ -583,10 +583,10 @@ static int mwl_mac80211_sta_add(struct i
@@ -605,10 +605,10 @@ static int mwl_mac80211_sta_add(struct i
if (vif->type == NL80211_IFTYPE_MESH_POINT)
sta_info->is_mesh_node = true;
@ -437,7 +437,7 @@
sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_8K;
sta_info->amsdu_ctrl.amsdu_allow_size = SYSADPT_AMSDU_8K_MAX_SIZE;
}
@@ -670,7 +670,7 @@ static int mwl_mac80211_sta_remove(struc
@@ -692,7 +692,7 @@ static int mwl_mac80211_sta_remove(struc
static int mwl_mac80211_conf_tx(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
@ -446,7 +446,7 @@
const struct ieee80211_tx_queue_params *params)
{
struct mwl_priv *priv = hw->priv;
@@ -934,4 +934,9 @@ const struct ieee80211_ops mwl_mac80211_
@@ -956,4 +956,9 @@ const struct ieee80211_ops mwl_mac80211_
.pre_channel_switch = mwl_mac80211_chnl_switch,
.sw_scan_start = mwl_mac80211_sw_scan_start,
.sw_scan_complete = mwl_mac80211_sw_scan_complete,
@ -502,16 +502,7 @@
case TX_RATE_FORMAT_LEGACY:
--- a/hif/pcie/pcie.c
+++ b/hif/pcie/pcie.c
@@ -546,7 +546,7 @@ static irqreturn_t pcie_isr_8864(struct
if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) {
wiphy_info(hw->wiphy, "radar detected by firmware\n");
- ieee80211_radar_detected(hw);
+ ieee80211_radar_detected(hw, NULL);
}
if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) ieee80211_queue_work(hw, &priv->chnl_switch_handle);
@@ -593,7 +593,7 @@ static irqreturn_t pcie_isr_8997(struct
@@ -533,7 +533,7 @@ static irqreturn_t pcie_isr_8864(struct
if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) {
wiphy_info(hw->wiphy, "radar detected by firmware\n");
@ -520,7 +511,16 @@
}
if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH)
@@ -1071,7 +1071,7 @@ static irqreturn_t pcie_isr_ndp(struct i
@@ -575,7 +575,7 @@ static irqreturn_t pcie_isr_8997(struct
if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) {
wiphy_info(hw->wiphy, "radar detected by firmware\n");
- ieee80211_radar_detected(hw);
+ ieee80211_radar_detected(hw, NULL);
}
if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH)
@@ -1053,7 +1053,7 @@ static irqreturn_t pcie_isr_ndp(struct i
if (int_status & MACREG_A2HRIC_NEWDP_DFS) {
wiphy_info(hw->wiphy, "radar detected by firmware\n");

View File

@ -635,7 +635,8 @@
},
"short_gi_80": {
"description": "Short GI for 80 MHz",
"type": "boolean"
"type": "boolean",
"default": true
},
"spectrum_mgmt_required": {
"description": "Set Spectrum Management subfield in the Capability Information field",
@ -712,7 +713,8 @@
"description": "Indicates the maximum length of A-MPDU pre-EOF padding that the STA can recv",
"type": "number",
"minimum": 0,
"maximum": 7
"maximum": 7,
"default": 7
},
"vht_max_mpdu": {
"description": "Maximum MPDU length",

View File

@ -311,16 +311,16 @@ export function assoclist(dev) {
snr: station.sta_info.signal_avg - ifaces[dev].noise,
inactive_time: station.sta_info.inactive_time,
rx: {
bitrate: format_rate(station.sta_info.rx_bitrate.bitrate),
bitrate_raw: station.sta_info.rx_bitrate.bitrate,
packets: station.sta_info.rx_packets,
flags: assoc_flags(station.sta_info.rx_bitrate),
bitrate: format_rate(station.sta_info.rx_bitrate?.bitrate ?? 0),
bitrate_raw: station.sta_info.rx_bitrate?.bitrate ?? 0,
packets: station.sta_info.rx_packets ?? 0,
flags: assoc_flags(station.sta_info.rx_bitrate ?? {}),
},
tx: {
bitrate: format_rate(station.sta_info.tx_bitrate.bitrate),
bitrate_raw: station.sta_info.tx_bitrate.bitrate,
packets: station.sta_info.tx_packets,
flags: assoc_flags(station.sta_info.tx_bitrate),
bitrate: format_rate(station.sta_info.tx_bitrate?.bitrate ?? 0),
bitrate_raw: station.sta_info.tx_bitrate?.bitrate ?? 0,
packets: station.sta_info.tx_packets ?? 0,
flags: assoc_flags(station.sta_info.tx_bitrate ?? {}),
},
expected_throughput: station.sta_info.expected_throughput ?? 'unknown',
};

View File

@ -242,7 +242,7 @@ function device_htmode_append(config) {
[ 29, 15 ], [ 61, 47 ], [ 93, 79 ], [ 125, 111 ],
[ 157, 143 ], [ 189, 175 ], [ 221, 207 ]];
for (let k, v in vht_oper_centr_freq_seg0_idx_map)
if (v[0] <= config.channel) {
if (config.channel >= (v[0] - 28) && config.channel <= v[0]) {
config.vht_oper_centr_freq_seg0_idx = v[1];
break;
}
@ -329,7 +329,7 @@ function device_htmode_append(config) {
config.vht_capab += '[RX-ANTENNA-PATTERN]';
if (vht_capab & 0x20000000 && config.tx_antenna_pattern)
config.vht_capab += '[TX-ANTENNA-PATTERN]';
let rx_stbc = [ '', '[RX-STBC1]', '[RX-STBC12]', '[RX-STBC123]', '[RX-STBC-1234]' ];
let rx_stbc = [ '', '[RX-STBC-1]', '[RX-STBC-12]', '[RX-STBC-123]', '[RX-STBC-1234]' ];
config.vht_capab += rx_stbc[min(config.rx_stbc, (vht_capab >> 8) & 7)];
if (vht_capab & 0x800 && config.su_beamformer)
@ -338,15 +338,15 @@ function device_htmode_append(config) {
config.vht_capab += '[BF-ANTENNA-' + min(((vht_capab >> 13) & 3) + 1, config.beamformer_antennas) + ']';
/* supported Channel widths */
if (vht_capab & 0xc == 8 && config.vht160 <= 2)
if ((vht_capab & 0xc) == 8 && config.vht160 <= 2)
config.vht_capab += '[VHT160-80PLUS80]';
else if (vht_capab & 0xc == 4 && config.vht160 <= 1)
else if ((vht_capab & 0xc) == 4 && config.vht160 <= 2)
config.vht_capab += '[VHT160]';
/* maximum MPDU length */
if (vht_capab & 3 > 1 && config.vht_max_mpdu > 11454)
if ((vht_capab & 3) > 1 && config.vht_max_mpdu >= 11454)
config.vht_capab += '[MAX-MPDU-11454]';
else if (vht_capab & 3 && config.vht_max_mpdu > 7991)
else if ((vht_capab & 3) && config.vht_max_mpdu >= 7991)
config.vht_capab += '[MAX-MPDU-7991]';
/* maximum A-MPDU length exponent */

View File

@ -164,6 +164,7 @@
[ "0x168c", "0x003c", "0x19b6", "0xd03c", 0, 0, "Mikrotik", "R11e-5HacT" ],
[ "0x168c", "0x003c", "0x19b6", "0xd075", 0, 0, "Mikrotik", "R11e-5HacD" ],
[ "0x168c", "0x003e", "0x168c", "0x3361", 0, 0, "Qualcomm, Atheros", "QCA6174" ],
[ "0x168c", "0x0046", "0x168c", "0xcafe", 0, 0, "Qualcomm, Atheros", "QCA9984" ],
[ "0x168c", "0x0040", "0x168c", "0x0002", 0, 0, "Qualcomm, Atheros", "QCA9990" ],
[ "0x168c", "0x0046", "0x0777", "0xe535", 0, 0, "Qualcomm, Atheros", "QCA9994" ],
[ "0x168c", "0x0046", "0x0777", "0xe5a2", 0, 0, "Qualcomm, Atheros", "QCA9994" ],

View File

@ -471,7 +471,6 @@ mac80211_hostapd_setup_base() {
he_su_beamformer:${he_phy_cap:6:2}:0x80:$he_su_beamformer \
he_su_beamformee:${he_phy_cap:8:2}:0x1:$he_su_beamformee \
he_mu_beamformer:${he_phy_cap:8:2}:0x2:$he_mu_beamformer \
he_spr_psr_enabled:${he_phy_cap:14:2}:0x1:$he_spr_psr_enabled \
he_twt_required:${he_mac_cap:0:2}:0x6:$he_twt_required
if [ "$he_bss_color_enabled" -gt 0 ]; then
@ -480,6 +479,7 @@ mac80211_hostapd_setup_base() {
append base_cfg "he_spr_non_srg_obss_pd_max_offset=$he_spr_non_srg_obss_pd_max_offset" "$N"
he_spr_sr_control=$((he_spr_sr_control | (1 << 2)))
}
[ "$he_spr_psr_enabled" -gt 0 ] && he_spr_psr_enabled=$((0x${he_phy_cap:14:2} & 0x1))
[ "$he_spr_psr_enabled" -gt 0 ] || he_spr_sr_control=$((he_spr_sr_control | (1 << 0)))
append base_cfg "he_spr_sr_control=$he_spr_sr_control" "$N"
else

View File

@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=apk
PKG_RELEASE:=2
PKG_RELEASE:=1
PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2024-11-30
PKG_SOURCE_VERSION:=8d93a79fb8958607f097be2c4ac97f4596faf91d
PKG_MIRROR_HASH:=565c87fac26e696c362c2fe85159cc3ed2fd27153f244c2e9dc0fd7fa67a4173
PKG_SOURCE_DATE:=2025-02-08
PKG_SOURCE_VERSION:=34771ccb7964b0e7cb5d1fc64bd1b83fe73296ba
PKG_MIRROR_HASH:=fddd0334fa2ce7cc7fedb2cc95ee800caf9cbe43d617c2e612e2f58fc30b14c2
PKG_VERSION=3.0.0_pre$(subst -,,$(PKG_SOURCE_DATE))
@ -61,6 +61,7 @@ MESON_COMMON_ARGS = \
-Ddefault_library=static \
-Durl_backend=wget \
-Dzstd=false \
-Dpython=disabled \
-Dtests=disabled
MESON_HOST_ARGS += \

View File

@ -10,7 +10,7 @@ Signed-off-by: Paul Spooren <mail@aparcar.org>
--- a/src/database.c
+++ b/src/database.c
@@ -1624,7 +1624,7 @@ const char *apk_db_layer_name(int layer)
@@ -1832,7 +1832,7 @@ const char *apk_db_layer_name(int layer)
{
switch (layer) {
case APK_DB_LAYER_ROOT: return "lib/apk/db";

View File

@ -1,52 +0,0 @@
From a6180e4cfa1a98d361ffdce9e48857504997fbe9 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Tue, 3 Dec 2024 18:12:58 -0800
Subject: [PATCH] meson: add tests option
Allows disabling tests when not desired.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
meson_options.txt | 1 +
test/meson.build | 10 +++++++---
test/unit/meson.build | 2 +-
3 files changed, 9 insertions(+), 4 deletions(-)
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,6 +6,7 @@ option('docs', description: 'Build manpa
option('help', description: 'Build help into apk binaries, needs lua', type: 'feature', value: 'auto')
option('lua', description: 'Build luaapk (lua bindings)', type: 'feature', value: 'auto')
option('lua_version', description: 'Lua version to build against', type: 'string', value: '5.3')
+option('tests', description: 'Build tests', type: 'feature', value: 'auto')
option('url_backend', description: 'URL backend', type: 'combo', choices: ['libfetch', 'wget'], value: 'libfetch')
option('uvol_db_target', description: 'Default target for uvol database layer', type: 'string')
option('zstd', description: 'Build with zstd support', type: 'boolean', value: true)
--- a/test/meson.build
+++ b/test/meson.build
@@ -1,10 +1,14 @@
+enum_sh = find_program('enum.sh', required: get_option('tests'))
+solver_sh = find_program('solver.sh', required: get_option('tests'))
+
+if not enum_sh.found() or not solver_sh.found()
+ subdir_done()
+endif
+
cur_dir = meson.current_source_dir()
env = environment()
env.set('APK', apk_exe.full_path())
-enum_sh = files('enum.sh')
-solver_sh = files('solver.sh')
-
subdir('unit')
foreach t : run_command(enum_sh, 'shell', check: true).stdout().strip().split(' ')
--- a/test/unit/meson.build
+++ b/test/unit/meson.build
@@ -1,4 +1,4 @@
-cmocka_dep = dependency('cmocka', required: false)
+cmocka_dep = dependency('cmocka', required: get_option('tests'))
if cmocka_dep.found()

View File

@ -20,7 +20,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
struct apk_string_array *filters;
};
@@ -118,6 +119,40 @@ static void print_manifest(const struct
@@ -105,6 +106,40 @@ static void print_manifest(const struct
printf("%s " BLOB_FMT "\n", pkg->name->name, BLOB_PRINTF(*pkg->version));
}
@ -60,11 +60,11 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+
static void filter_package(const struct apk_database *db, const struct apk_package *pkg, const struct list_ctx *ctx, const struct apk_name *name)
{
if (ctx->match_origin && !origin_matches(ctx, pkg))
@@ -138,7 +173,9 @@ static void filter_package(const struct
if (ctx->match_providers)
printf("<%s> ", name->name);
if (ctx->match_origin && !origin_matches(ctx, pkg)) return;
@@ -114,7 +149,9 @@ static void filter_package(const struct
if (ctx->upgradable && !is_upgradable(db, pkg)) return;
if (ctx->match_providers) printf("<%s> ", name->name);
- if (ctx->manifest)
+ if (ctx->full)
+ print_full(pkg, ctx);
@ -72,7 +72,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
print_manifest(pkg, ctx);
else
print_package(db, pkg, ctx);
@@ -178,6 +215,7 @@ static int print_result(struct apk_datab
@@ -154,6 +191,7 @@ static int print_result(struct apk_datab
OPT(OPT_LIST_depends, APK_OPT_SH("d") "depends") \
OPT(OPT_LIST_installed, APK_OPT_SH("I") "installed") \
OPT(OPT_LIST_manifest, "manifest") \
@ -80,12 +80,13 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
OPT(OPT_LIST_origin, APK_OPT_SH("o") "origin") \
OPT(OPT_LIST_orphaned, APK_OPT_SH("O") "orphaned") \
OPT(OPT_LIST_providers, APK_OPT_SH("P") "providers") \
@@ -191,6 +229,8 @@ static int option_parse_applet(void *pct
@@ -167,6 +205,9 @@ static int list_parse_option(void *pctx,
struct list_ctx *ctx = pctx;
switch (opt) {
+ case OPT_LIST_full:
+ ctx->full = 1;
+ break;
case OPT_LIST_available:
ctx->available = 1;
ctx->orphaned = 0;

View File

@ -5,9 +5,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/kempniu/yafut.git
PKG_MIRROR_HASH:=7540e977104d41b3aca27b58fda8cd84ebec80cfe01d955712fb8dc717aff6a6
PKG_SOURCE_DATE:=2024-06-10
PKG_SOURCE_VERSION:=38439f8a53d33b14744bc8f938662670b9d3e361
PKG_MIRROR_HASH:=f5c76edc81477d2b68a7b032487d10fa361c8eaeecfc36908fde2ae828b7e822
PKG_SOURCE_DATE:=2025-02-18
PKG_SOURCE_VERSION:=e342c93981dc255bba58c17925b5c8983d7dacf8
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE

View File

@ -1,3 +1,69 @@
From 3471bba1b33a8b54cb0be9d30b7aac4fb2766365 Mon Sep 17 00:00:00 2001
From: Baochen Qiang <quic_bqiang@quicinc.com>
Date: Tue, 5 Mar 2024 10:13:18 +0800
Subject: [PATCH] bus: mhi: host: Add mhi_power_down_keep_dev() API to support
system suspend/hibernation
Currently, ath11k fails to resume from system suspend/hibernation on some
the x86 host machines with below error message:
```
ath11k_pci 0000:06:00.0: timeout while waiting for restart complete
```
This happens because, ath11k powers down the MHI stack during suspend and
that leads to destruction of the struct device associated with the MHI
channels. And during resume, ath11k calls calling mhi_sync_power_up() to
power up the MHI subsystem and that eventually calls the driver framework's
device_add() API from mhi_create_devices(). But the PM framework blocks the
struct device creation during device_add() and this leads to probe deferral
as below:
```
mhi mhi0_IPCR: Driver qcom_mhi_qrtr force probe deferral
```
The reason for deferring device creation during resume is explained in
dpm_prepare():
/*
* It is unsafe if probing of devices will happen during suspend or
* hibernation and system behavior will be unpredictable in this
* case. So, let's prohibit device's probing here and defer their
* probes instead. The normal behavior will be restored in
* dpm_complete().
*/
Due to the device probe deferral, qcom_mhi_qrtr_probe() API is not getting
called during resume and thus MHI channels are not prepared. So this blocks
the QMI messages from being transferred between ath11k and firmware,
resulting in a firmware initialization failure.
After consulting with Rafael, it was decided to not destroy the struct
device for the MHI channels during system suspend/hibernation because the
device is bound to appear again during resume.
So to achieve this, a new API called mhi_power_down_keep_dev() is
introduced for MHI controllers to keep the struct device when required.
This API is similar to the existing mhi_power_down() API, except that it
keeps the struct device associated with MHI channels instead of destroying
them.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://lore.kernel.org/r/20240305021320.3367-2-quic_bqiang@quicinc.com
[mani: reworded the commit message and subject]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/bus/mhi/host/init.c | 1 +
drivers/bus/mhi/host/internal.h | 1 +
drivers/bus/mhi/host/pm.c | 42 ++++++++++++++++++++++++++++-----
include/linux/mhi.h | 18 +++++++++++++-
4 files changed, 55 insertions(+), 7 deletions(-)
--- a/drivers/bus/mhi/host/init.c
+++ b/drivers/bus/mhi/host/init.c
@@ -43,6 +43,7 @@ const char * const dev_state_tran_str[DE

View File

@ -0,0 +1,115 @@
From bc51c337a3147c4a02c743489885a6657bc5371c Mon Sep 17 00:00:00 2001
From: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
Date: Wed, 27 Nov 2024 13:36:49 +0800
Subject: [PATCH] net: ethernet: mtk_eth_soc: add hw dump for forced reset
Without this patch, the ETH driver is unable to dump the registers
before triggering a forced reset.
Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 55 +++++++++++++++++++++
1 files changed, 55 insertions(+)
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -66,6 +66,7 @@ static const struct mtk_reg_map mtk_reg_
.rx_ptr = 0x1900,
.rx_cnt_cfg = 0x1904,
.qcrx_ptr = 0x1908,
+ .page = 0x19f0,
.glo_cfg = 0x1a04,
.rst_idx = 0x1a08,
.delay_irq = 0x1a0c,
@@ -132,6 +133,7 @@ static const struct mtk_reg_map mt7986_r
.rx_ptr = 0x4500,
.rx_cnt_cfg = 0x4504,
.qcrx_ptr = 0x4508,
+ .page = 0x45f0,
.glo_cfg = 0x4604,
.rst_idx = 0x4608,
.delay_irq = 0x460c,
@@ -183,6 +185,7 @@ static const struct mtk_reg_map mt7988_r
.rx_ptr = 0x4500,
.rx_cnt_cfg = 0x4504,
.qcrx_ptr = 0x4508,
+ .page = 0x45f0,
.glo_cfg = 0x4604,
.rst_idx = 0x4608,
.delay_irq = 0x460c,
@@ -3885,6 +3888,56 @@ static void mtk_set_mcr_max_rx(struct mt
mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
}
+static void mtk_hw_dump_reg(struct mtk_eth *eth, char *name, u32 offset, u32 range)
+{
+ u32 cur = offset;
+
+ pr_info("\n==================== %s ====================\n", name);
+ while (cur < offset + range) {
+ pr_info("0x%08x: %08x %08x %08x %08x\n",
+ cur, mtk_r32(eth, cur), mtk_r32(eth, cur + 0x4),
+ mtk_r32(eth, cur + 0x8), mtk_r32(eth, cur + 0xc));
+ cur += 0x10;
+ }
+}
+
+static void mtk_hw_dump(struct mtk_eth *eth)
+{
+ const struct mtk_reg_map *reg_map = eth->soc->reg_map;
+ u32 id;
+
+ mtk_hw_dump_reg(eth, "FE", 0x0, 0x600);
+ mtk_hw_dump_reg(eth, "FE", 0x1400, 0x300);
+ mtk_hw_dump_reg(eth, "ADMA", reg_map->pdma.rx_ptr, 0x300);
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
+ for (id = 0; id < MTK_QDMA_NUM_QUEUES / 16; id++) {
+ mtk_w32(eth, id, reg_map->qdma.page);
+ pr_info("\nQDMA PAGE:%x ", mtk_r32(eth, reg_map->qdma.page));
+ mtk_hw_dump_reg(eth, "QDMA", reg_map->qdma.qtx_cfg, 0x100);
+ mtk_w32(eth, 0, reg_map->qdma.page);
+ }
+ mtk_hw_dump_reg(eth, "QDMA", reg_map->qdma.rx_ptr, 0x300);
+ }
+ if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
+ mtk_hw_dump_reg(eth, "WDMA0", reg_map->wdma_base[0], 0x400);
+ mtk_hw_dump_reg(eth, "WDMA1", reg_map->wdma_base[1], 0x400);
+ if (mtk_is_netsys_v3_or_greater(eth))
+ mtk_hw_dump_reg(eth, "WDMA2", reg_map->wdma_base[2], 0x400);
+ }
+ mtk_hw_dump_reg(eth, "PPE0", reg_map->ppe_base + 0x200, 0x200);
+ if (!mtk_is_netsys_v1(eth))
+ mtk_hw_dump_reg(eth, "PPE1", reg_map->ppe_base + 0x600, 0x200);
+ if (mtk_is_netsys_v3_or_greater(eth))
+ mtk_hw_dump_reg(eth, "PPE2", reg_map->ppe_base + 0xE00, 0x200);
+ mtk_hw_dump_reg(eth, "GMAC", 0x10000, 0x300);
+ if (mtk_is_netsys_v3_or_greater(eth))
+ mtk_hw_dump_reg(eth, "GMAC", 0x10300, 0x100);
+ if (mtk_is_netsys_v3_or_greater(eth)) {
+ mtk_hw_dump_reg(eth, "XGMAC0", 0x12000, 0x300);
+ mtk_hw_dump_reg(eth, "XGMAC1", 0x13000, 0x300);
+ }
+}
+
static void mtk_hw_reset(struct mtk_eth *eth)
{
u32 val;
@@ -4344,6 +4397,8 @@ static void mtk_pending_work(struct work
rtnl_lock();
set_bit(MTK_RESETTING, &eth->state);
+ mtk_hw_dump(eth);
+
mtk_prepare_for_reset(eth);
mtk_wed_fe_reset();
/* Run again reset preliminary configuration in order to avoid any
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1172,6 +1172,7 @@ struct mtk_reg_map {
u32 rx_ptr; /* rx base pointer */
u32 rx_cnt_cfg; /* rx max count configuration */
u32 qcrx_ptr; /* rx cpu pointer */
+ u32 page; /* page configuration */
u32 glo_cfg; /* global configuration */
u32 rst_idx; /* reset index */
u32 delay_irq; /* delay interrupt */

View File

@ -0,0 +1,58 @@
From: George Moussalem <george.moussalem@outlook.com>
Date: Thu, 06 Feb 2025 21:55:28 +0400
Subject: [PATCH] nvmem: layouts: ascii-env handle CRLF while parsing
The current driver supports LF line endings only.
For CRLF-based line endings in the ASCII env, the length of the value of
the variable passed to nvmem_layout_parse_mac_base is 18 bytes instead
of an expected length of 17 causing the parsing to fail.
So, let's add the ability to handle CRLF line endings by adding a
condition to check if the value ends with a '\r' character and replace it
with '\0' to properly parse the mac address.
Tested on Linksys MX2000, MX5500, and SPNMX56.
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
--- a/drivers/nvmem/layouts/ascii-env.c
+++ b/drivers/nvmem/layouts/ascii-env.c
@@ -25,18 +25,20 @@ struct ascii_env_match_data {
static int ascii_env_parse_cells(struct device *dev, struct nvmem_device *nvmem, uint8_t *buf,
size_t data_len, const char delim)
{
- char *var, *value, *eq, *lf;
+ char *var, *value, *eq, *lf, *cr;
char *data = buf;
+ uint incr = 0;
/*
* Warning the inner loop take care of replacing '\n'
* with '\0', hence we can use strlen on value.
*/
for (var = data; var < data + data_len && *var;
- var = value + strlen(value) + 1) {
+ var = value + strlen(value) + incr) {
struct nvmem_cell_info info = {};
struct device_node *child;
const char *label;
+ incr = 0;
eq = strchr(var, delim);
if (!eq)
@@ -49,6 +51,15 @@ static int ascii_env_parse_cells(struct
if (!lf)
break;
*lf = '\0';
+ incr++;
+
+ /* For CRLF based env, replace '\r' with '\0' too to use strlen
+ * for value, and increment var by one in loop for next variable */
+ cr = strchr(value, '\r');
+ if (cr) {
+ *cr = '\0';
+ incr++;
+ }
info.name = devm_kstrdup(dev, var, GFP_KERNEL);
if (!info.name)

View File

@ -0,0 +1,240 @@
/dts-v1/;
#include "ipq5018.dtsi"
#include "ipq5018-mx-base.dtsi"
/ {
model = "Linksys SPNMX56";
compatible = "linksys,spnmx56", "qcom,ipq5018";
};
/*
* =================================================================
* _______________________ _______________________
* | IPQ5018 | | QCA8337 |
* | +------+ +--------+ | | +--------+ +------+ |
* | | MAC0 |---| GE Phy |-+--- MDI ---+ | Phy4 |---| MAC5 | |
* | +------+ +--------+ | | +--------+ +------+ |
* | | |_______________________|
* | | _______________________
* | | | QCA8081 |
* | +------+ +--------+ | | +--------+ +------+ |
* | | MAC1 |---| Uniphy |-+-- SGMII+--+ | Phy |---| MAC | |
* | +------+ +--------+ | | +--------+ +------+ |
* |_______________________| |_______________________|
*
* =================================================================
*/
&switch {
status = "okay";
switch_mac_mode = <MAC_MODE_SGMII_CHANNEL0>;
qcom,port_phyinfo {
// MAC0 -> GE Phy --- MDI --- QCA8337 Switch
port@0 {
port_id = <1>;
mdiobus = <&mdio0>;
phy_address = <7>;
phy_dac = <0x10 0x10>;
};
// MAC1 -> Uniphy --- SGMII --- QCA8081
port@1 {
port_id = <2>;
mdiobus = <&mdio1>;
phy_address = <28>;
port_mac_sel = "QGMAC_PORT";
};
};
};
// MAC0 -> GE Phy
&dp1 {
status = "okay";
};
// MAC1 ---SGMII---> QCA8081
&dp2 {
status = "okay";
label = "wan";
phy-handle = <&qca8081>;
};
&mdio0 {
status = "okay";
};
// IPQ5018 GE Phy -> QCA8337 PHY4
&ge_phy {
qcom,dac = <0x10 0x10>;
};
&mdio1 {
status = "okay";
pinctrl-0 = <&mdio1_pins>;
pinctrl-names = "default";
reset-gpios = <&tlmm 39 GPIO_ACTIVE_LOW>;
// Not connected
qca8337_0: ethernet-phy@0 {
reg = <0>;
};
// QCA8337 Phy1 -> LAN1
qca8337_1: ethernet-phy@1 {
reg = <1>;
};
// QCA8337 Phy2 -> LAN2
qca8337_2: ethernet-phy@2 {
reg = <2>;
};
// QCA8337 Phy3 -> LAN3
qca8337_3: ethernet-phy@3 {
reg = <3>;
};
// QCA8337 Phy4 -> MDI -> IPQ5018 GE PHY
qca8337_4: ethernet-phy@4 {
reg = <4>;
};
// QCA8081 Phy -> WAN
qca8081: ethernet-phy@28 {
compatible = "ethernet-phy-id004d.d101";
reg = <28>;
reset-deassert-us = <10000>;
reset-gpios = <&tlmm 24 GPIO_ACTIVE_LOW>;
};
// QCA8337 switch
switch1: ethernet-switch@17 {
compatible = "qca,qca8337";
reg = <17>;
#address-cells = <1>;
#size-cells = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@2 {
reg = <2>;
label = "lan3";
phy-handle = <&qca8337_1>;
};
port@3 {
reg = <3>;
label = "lan2";
phy-handle = <&qca8337_2>;
};
port@4 {
reg = <4>;
label = "lan1";
phy-handle = <&qca8337_3>;
};
port@5 {
reg = <5>;
phy-handle = <&qca8337_4>;
phy-mode = "gmii";
ethernet = <&dp1>;
};
};
};
};
&pcie0_phy {
status = "okay";
};
&pcie0 {
status = "okay";
perst-gpios = <&tlmm 15 GPIO_ACTIVE_LOW>;
bridge@0,0 {
reg = <0x00000000 0 0 0 0>;
#address-cells = <3>;
#size-cells = <2>;
ranges;
wifi@1,0 {
status = "okay";
/* QCN9074: ath11k lacks DT compatible for PCI cards */
compatible = "pci17cb,1104";
reg = <0x00010000 0 0 0 0>;
qcom,ath11k-calibration-variant = "Linksys-SPNMX56";
};
};
};
&q6v5_wcss {
status = "okay";
memory-region = <&q6_mem_regions>;
firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt",
"ath11k/IPQ5018/hw1.0/m3_fw.mdt";
// IPQ5018
q6_wcss_pd1: pd-1 {
firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt";
resets =
<&gcc GCC_WCSSAON_RESET>,
<&gcc GCC_WCSS_BCR>,
<&gcc GCC_CE_BCR>;
reset-names =
"wcss_aon_reset",
"wcss_reset",
"ce_reset";
clocks =
<&gcc GCC_WCSS_AHB_S_CLK>,
<&gcc GCC_WCSS_ACMT_CLK>,
<&gcc GCC_WCSS_AXI_M_CLK>;
clock-names =
"gcc_wcss_ahb_s_clk",
"gcc_wcss_acmt_clk",
"gcc_wcss_axi_m_clk";
interrupts-extended =
<&wcss_smp2p_in 8 0>,
<&wcss_smp2p_in 9 0>,
<&wcss_smp2p_in 12 0>,
<&wcss_smp2p_in 11 0>;
interrupt-names =
"fatal",
"ready",
"spawn-ack",
"stop-ack";
qcom,smem-states =
<&wcss_smp2p_out 8>,
<&wcss_smp2p_out 9>,
<&wcss_smp2p_out 10>;
qcom,smem-state-names =
"shutdown",
"stop",
"spawn";
};
};
&wifi0 {
// IPQ5018
qcom,rproc = <&q6_wcss_pd1>;
qcom,ath11k-calibration-variant = "Linksys-SPNMX56";
qcom,ath11k-fw-memory-mode = <2>;
qcom,bdf-addr = <0x4c400000>;
status = "okay";
};

View File

@ -29,3 +29,13 @@ define Device/linksys_mx5500
ipq-wifi-linksys_mx5500
endef
TARGET_DEVICES += linksys_mx5500
define Device/linksys_spnmx56
$(call Device/linksys_ipq50xx_mx_base)
DEVICE_MODEL := SPNMX56
DEVICE_DTS_CONFIG := config@mp03.1
DEVICE_PACKAGES := kmod-ath11k-pci \
ath11k-firmware-qcn9074 \
ipq-wifi-linksys_spnmx56
endef
TARGET_DEVICES += linksys_spnmx56

View File

@ -8,7 +8,8 @@ ipq50xx_setup_interfaces()
local board="$1"
case $board in
linksys,mx2000|\
linksys,mx5500)
linksys,mx5500|\
linksys,spnmx56)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
esac
@ -23,7 +24,8 @@ ipq50xx_setup_macs()
case "$board" in
linksys,mx2000|\
linksys,mx5500)
linksys,mx5500|\
linksys,spnmx56)
label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
lan_mac=$label_mac
wan_mac=$label_mac

View File

@ -10,7 +10,8 @@ case "$FIRMWARE" in
"ath11k/IPQ5018/hw1.0/cal-ahb-c000000.wifi.bin")
case "$board" in
linksys,mx2000|\
linksys,mx5500)
linksys,mx5500|\
linksys,spnmx56)
caldata_extract "0:ART" 0x1000 0x20000
label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
ath11k_patch_mac $(macaddr_add $label_mac 1) 0
@ -32,7 +33,8 @@ case "$FIRMWARE" in
;;
"ath11k/QCN9074/hw1.0/cal-pci-0001:01:00.0.bin")
case "$board" in
linksys,mx5500)
linksys,mx5500|\
linksys,spnmx56)
caldata_extract "0:ART" 0x26800 0x20000
label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
ath11k_patch_mac $(macaddr_add $label_mac 2) 0

View File

@ -5,7 +5,8 @@ START=99
boot() {
case $(board_name) in
linksys,mx2000|\
linksys,mx5500)
linksys,mx5500|\
linksys,spnmx56)
mtd resetbc s_env || true
;;
esac

View File

@ -73,8 +73,9 @@ platform_check_image() {
platform_do_upgrade() {
case "$(board_name)" in
linksys,mx2000|\
linksys,mx5500)
remove_oem_ubi_volume rootfs
linksys,mx5500|\
linksys,spnmx56)
remove_oem_ubi_volume squashfs
linksys_mx_do_upgrade "$1"
;;
*)

View File

@ -2005,6 +2005,8 @@ define Device/mercusys_mr70x-v1
$(Device/tplink-safeloader)
DEVICE_VENDOR := MERCUSYS
DEVICE_MODEL := MR70X
DEVICE_ALT0_VENDOR := MERCUSYS
DEVICE_ALT0_MODEL := MR1800X
DEVICE_VARIANT := v1
DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools
TPLINK_BOARD_ID := MR70X

View File

@ -26,8 +26,18 @@ Suggested-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
arch/mips/include/asm/mips-cps.h | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
The proposed detection method was based on reading the LAUNCH_FREADY core flag.
However, this method only works before the cores are launched.
For this reason, the core number detection method has been changed to a simpler one.
For mt6721s the 17th revision bit is zero, hence we know that it is this chip,
so the number of cores is 1.
Co-authored-by: Shiji Yang <yangshiji66@qq.com>
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
---
arch/mips/include/asm/mips-cps.h | 5 +++++
1 file changed, 5 insertions(+)
--- a/arch/mips/include/asm/mips-cps.h
+++ b/arch/mips/include/asm/mips-cps.h
@ -35,41 +45,19 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
#include <linux/io.h>
#include <linux/types.h>
+#include <asm/mips-boards/launch.h>
+#include <asm/mach-ralink/mt7621.h>
+
extern unsigned long __cps_access_bad_size(void)
__compiletime_error("Bad size for CPS accessor");
@@ -162,12 +164,31 @@ static inline uint64_t mips_cps_cluster_
*/
static inline unsigned int mips_cps_numcores(unsigned int cluster)
{
+ unsigned int ncores;
+
@@ -165,6 +167,10 @@ static inline unsigned int mips_cps_numc
if (!mips_cm_present())
return 0;
+ if (IS_ENABLED(CONFIG_SOC_MT7621) &&
+ !FIELD_GET(0x20000, __raw_readl(MT7621_SYSC_BASE + SYSC_REG_CHIP_REV)))
+ return 1;
+
/* Add one before masking to handle 0xff indicating no cores */
- return FIELD_GET(CM_GCR_CONFIG_PCORES,
+ ncores = FIELD_GET(CM_GCR_CONFIG_PCORES,
return FIELD_GET(CM_GCR_CONFIG_PCORES,
mips_cps_cluster_config(cluster) + 1);
+
+ if (IS_ENABLED(CONFIG_SOC_MT7621)) {
+ struct cpulaunch *launch;
+
+ /*
+ * Ralink MT7621S SoC is single core, but the GCR_CONFIG method
+ * always reports 2 cores. Check the second core's LAUNCH_FREADY
+ * flag to detect if the second core is missing. This method
+ * only works before the core has been started.
+ */
+ launch = (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH);
+ launch += 2; /* MT7621 has 2 VPEs per core */
+ if (!(launch->flags & LAUNCH_FREADY))
+ ncores = 1;
+ }
+
+ return ncores;
}
/**

View File

@ -145,6 +145,14 @@ define Device/mele_m9
endef
TARGET_DEVICES += mele_m9
define Device/merrii_hummingbird
DEVICE_VENDOR := Merrii
DEVICE_MODEL := Hummingbird
DEVICE_PACKAGES:=kmod-brcmfmac cypress-firmware-43362-sdio wpad-basic-mbedtls
SOC := sun6i-a31
endef
TARGET_DEVICES += merrii_hummingbird
define Device/olimex_a20-olinuxino-lime
DEVICE_VENDOR := Olimex
DEVICE_MODEL := A20-OLinuXino-LIME

View File

@ -1,11 +1,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=autoconf-archive
PKG_VERSION:=2023.02.20
PKG_VERSION:=2024.10.16
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/autoconf-archive
PKG_HASH:=71d4048479ae28f1f5794619c3d72df9c01df49b1c628ef85fde37596dc31a33
PKG_HASH:=7bcd5d001916f3a50ed7436f4f700e3d2b1bade3ed803219c592d62502a57363
include $(INCLUDE_DIR)/host-build.mk

View File

@ -7,11 +7,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=autoconf
PKG_VERSION:=2.71
PKG_VERSION:=2.72
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/autoconf
PKG_HASH:=431075ad0bf529ef13cb41e9042c542381103e80015686222b8a9d4abef42a1c
PKG_HASH:=ba885c1319578d6c94d46e9b0dceb4014caafe2490e437a0dbca3f270a223f5a
include $(INCLUDE_DIR)/host-build.mk

View File

@ -58,7 +58,7 @@
# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
fatal "need GNU m4 1.4 or later: $m4"
if system "$m4 --help </dev/null 2>&1 | grep reload-state >/dev/null";
@@ -272,6 +276,12 @@ sub load_configuration ($)
@@ -322,6 +326,12 @@ sub load_configuration ($)
my @words = shellwords ($_);
my $type = shift @words;
@ -88,7 +88,7 @@
unshift @INC, $pkgdatadir;
$buildauxdir = $ENV{'autom4te_buildauxdir'} || $pkgdatadir . '/build-aux';
@@ -117,9 +120,9 @@ Written by David J. MacKenzie and Akim D
@@ -116,9 +119,9 @@ Written by David J. MacKenzie and Akim D
";
# Lib files.
@ -175,21 +175,3 @@
unshift @INC, $pkgdatadir;
# Override SHELL. On DJGPP SHELL may not be set to a shell
--- a/bin/autoconf.as
+++ b/bin/autoconf.as
@@ -89,8 +89,13 @@ exit_missing_arg='
# restore font-lock: '
# Variables.
-: ${AUTOM4TE='@bindir@/@autom4te-name@'}
-: ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'}
+if test -n "$STAGING_DIR_HOST"; then
+ : ${AUTOM4TE="$STAGING_DIR_HOST/bin/@autom4te-name@"}
+ : ${trailer_m4="$STAGING_DIR_HOST/share/autoconf/autoconf/trailer.m4"}
+else
+ : ${AUTOM4TE='@bindir@/@autom4te-name@'}
+ : ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'}
+fi
autom4te_options=
outfile=
verbose=false

View File

@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=automake
PKG_CPE_ID:=cpe:/a:gnu:automake
PKG_VERSION:=1.16.5
PKG_VERSION:=1.17
PKG_API_VERSION:=$(word 2,$(subst ., ,$(PKG_VERSION)))
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/automake
PKG_HASH:=07bd24ad08a64bc17250ce09ec56e921d6343903943e99ccf63bbf0705e34605
PKG_HASH:=8920c1fc411e13b90bf704ef9db6f29d540e76d232cb3b2c9f4dc4cc599bd990
include $(INCLUDE_DIR)/host-build.mk
@ -21,7 +21,7 @@ HOST_CONFIGURE_ARGS += \
--disable-silent-rules
HOST_CONFIGURE_VARS += \
PERL="/usr/bin/env perl" \
PERL="$(shell command -v perl)" \
am_cv_prog_PERL_ithreads=no
define Host/Configure

View File

@ -11,7 +11,7 @@
# We need at least this version for CLONE support.
--- a/bin/aclocal.in
+++ b/bin/aclocal.in
@@ -23,9 +23,11 @@ use 5.006;
@@ -23,10 +23,12 @@ use 5.006;
use strict;
use warnings FATAL => 'all';
@ -20,21 +20,23 @@
BEGIN
{
- unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@')
- unless $ENV{AUTOMAKE_UNINSTALLED};
+ unshift (@INC, ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@'))
unless $ENV{AUTOMAKE_UNINSTALLED};
+ unless $ENV{AUTOMAKE_UNINSTALLED};
}
use File::Basename;
@@ -65,8 +67,8 @@ $perl_threads = 0;
# ACLOCAL_PATH environment variable, and reset with the '--system-acdir'
# option.
# --aclocal-path option/ACLOCAL_PATH environment variable, and reset
# with the '--system-acdir' option.
my @user_includes = ();
-my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION);
-my @system_includes = ('@datadir@/aclocal');
+my @automake_includes = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . "/share/aclocal-$APIVERSION" : "@datadir@/aclocal-$APIVERSION");
+my @system_includes = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/aclocal' : '@datadir@/aclocal');
my $aclocal_path = '';
# Whether we should copy M4 file in $user_includes[0].
my $install = 0;
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -26,9 +26,11 @@ use 5.006;

View File

@ -1,6 +1,6 @@
--- a/bin/aclocal.in
+++ b/bin/aclocal.in
@@ -371,6 +371,12 @@ sub scan_m4_dirs ($$@)
@@ -372,6 +372,12 @@ sub scan_m4_dirs ($$@)
foreach my $m4dir (@dirlist)
{

View File

@ -1,6 +1,6 @@
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -4513,7 +4513,7 @@ sub handle_gettext ()
@@ -4552,7 +4552,7 @@ sub handle_gettext ()
&& grep ($_ eq 'intl', @subdirs));
}
@ -9,7 +9,7 @@
}
# Emit makefile footer.
@@ -5641,7 +5641,7 @@ sub check_gnu_standards ()
@@ -5677,7 +5677,7 @@ sub check_gnu_standards ()
# otherwise require non-.md.
my $required
= (! -f $file && -f "$file.md") ? "$file.md" : $file;
@ -18,7 +18,7 @@
}
# Accept one of these three licenses; default to COPYING.
@@ -5655,7 +5655,7 @@ sub check_gnu_standards ()
@@ -5691,7 +5691,7 @@ sub check_gnu_standards ()
last;
}
}

View File

@ -9,8 +9,8 @@ Subject: [PATCH] Allow other V values for verbosity
--- a/m4/silent.m4
+++ b/m4/silent.m4
@@ -43,7 +43,7 @@ else
fi])
@@ -53,7 +53,7 @@ case $enable_silent_rules in @%:@ (((
esac
if test $am_cv_make_support_nested_variables = yes; then
dnl Using '$V' instead of '$(V)' breaks IRIX make.
- AM_V='$(V)'

View File

@ -7,11 +7,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bc
PKG_VERSION:=1.07.1
PKG_VERSION:=1.08.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/bc
PKG_HASH:=62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a
PKG_HASH:=515430115b3334c636317503460a0950dff79940aa3259ce2c1aa67c2881d023
PKG_FIXUP := autoreconf
PKG_CPE_ID:=cpe:/a:gnu:bc

View File

@ -7,15 +7,15 @@
+SUBDIRS = lib bc dc
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \
stamp-h $(distdir).tar.gz h/number.h depcomp missing \
stamp-h $(distdir).tar.gz h/number.h depcomp missing
--- a/Makefile.in
+++ b/Makefile.in
@@ -288,7 +288,7 @@ target_alias = @target_alias@
@@ -305,7 +305,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = lib bc dc doc
+SUBDIRS = lib bc dc
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \
stamp-h $(distdir).tar.gz h/number.h depcomp missing \
bc/libmath.h
stamp-h $(distdir).tar.gz h/number.h depcomp missing

View File

@ -1,27 +1,6 @@
--- a/bc/fix-libmath_h
+++ b/bc/fix-libmath_h
@@ -1,9 +1,9 @@
-ed libmath.h <<EOS-EOS
-1,1s/^/{"/
-1,\$s/\$/",/
-2,\$s/^/"/
-\$,\$d
-\$,\$s/,\$/,0}/
-w
-q
-EOS-EOS
+#!/usr/bin/env bash
+sed -e '1 s/^/{"/' \
+ -e 's/$/",/' \
+ -e '2,$ s/^/"/' \
+ -e '$ d' \
+ -i libmath.h
+
+sed -e '$ s/$/0}/' \
+ -i libmath.h
--- a/configure
+++ b/configure
@@ -5288,7 +5288,7 @@ case $bcle-$bcrl-$LEX in
@@ -5926,7 +5926,7 @@ case $bcle-$bcrl-$LEX in
?-?-flex)
LEX="flex -I -8" ;;
?-y-*)

View File

@ -11,9 +11,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git
PKG_SOURCE_DATE:=2025-01-14
PKG_SOURCE_VERSION:=12c0b42231bee58b3cd7cbe95c33de2685484a4f
PKG_MIRROR_HASH:=50d872a5069f9f672de5ea9efcf00872bcce27ec52bbb69fff3785abcee1c77c
PKG_SOURCE_DATE:=2025-02-16
PKG_SOURCE_VERSION:=5d1446bf57d6490573dc71f10c05e83b36d44374
PKG_MIRROR_HASH:=e054ea416f5a596f681bba593f71dfbe8149361432d7c17f2374c60dfe227749
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk

View File

@ -7,11 +7,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mtools
PKG_VERSION:=4.0.43
PKG_VERSION:=4.0.44
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
PKG_HASH:=541e179665dc4e272b9602f2074243591a157da89cc47064da8c5829dbd2b339
PKG_HASH:=37dc4df022533c3d4b2ec1c78973c27c7e8b585374c2d46ab64c6a3db31eddb8
HOST_BUILD_PARALLEL:=1

View File

@ -5,9 +5,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/kempniu/yafut.git
PKG_MIRROR_HASH:=9cc6b4c485ce16d44b67ebf79e8bee1e07aecde112da739cf33e8714ac3842e7
PKG_SOURCE_DATE:=2024-05-13
PKG_SOURCE_VERSION:=2b45baaf1cced47af8f22dd3acbf1df2f04c7510
PKG_MIRROR_HASH:=f5c76edc81477d2b68a7b032487d10fa361c8eaeecfc36908fde2ae828b7e822
PKG_SOURCE_DATE:=2025-02-18
PKG_SOURCE_VERSION:=e342c93981dc255bba58c17925b5c8983d7dacf8
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE

View File

@ -1,289 +0,0 @@
--- a/lib/yaffs2/direct/yportenv.h
+++ b/lib/yaffs2/direct/yportenv.h
@@ -32,10 +32,13 @@
#define CONFIG_YAFFS_DEFINES_TYPES 1
#define CONFIG_YAFFS_USE_32_BIT_TIME_T 1
#define NO_Y_INLINE 1
-#define loff_t off_t
#endif /* __rtems__ */
+#ifndef linux
+#define loff_t off_t
+#endif
+
/* Definition of types */
#ifdef CONFIG_YAFFS_DEFINES_TYPES
typedef unsigned char u8;
--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -21,5 +21,9 @@
* integer overflow when building against e.g. musl.
*/
int linux_ioctl(int fd, unsigned long request, void *ptr) {
+#ifdef linux
return syscall(SYS_ioctl, fd, request, ptr);
+#else
+ return -1;
+#endif
}
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -12,7 +12,9 @@ int linux_ioctl(int fd, unsigned long re
* time, as the definition of the MEMREAD ioctl trickles down into kernel
* headers distributed out there.
*/
+#ifdef linux
#include <mtd/mtd-user.h>
+
#ifndef MEMREAD
#include <sys/ioctl.h>
@@ -35,3 +37,4 @@ struct mtd_read_req {
#define MEMREAD _IOWR('M', 26, struct mtd_read_req)
#endif /* MEMREAD */
+#endif
--- a/src/mtd.c
+++ b/src/mtd.c
@@ -4,7 +4,9 @@
#include <errno.h>
#include <fcntl.h>
+#ifdef linux
#include <mtd/mtd-user.h>
+#endif
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
@@ -82,6 +84,7 @@ static void mtd_debug_location(const cha
va_end(args);
}
+#ifdef linux
/*
* Read the raw contents of the sysfs attribute at the provided 'sysfs_path'
* into 'buf', which is 'buf_len' bytes large. The given sysfs attribute is
@@ -179,6 +182,7 @@ static int discover_mtd_parameters(const
return 0;
}
+#endif
/*
* Initialize 'geometry' with 'chunk_size' and 'block_size' set to the default
@@ -203,6 +207,7 @@ static void init_yaffs_geometry_default(
* Initialize 'geometry' with 'chunk_size' and 'block_size' set to the relevant
* MTD parameters provided in 'mtd' and 'mtd_type' set to the provided value.
*/
+#ifdef linux
static void init_yaffs_geometry_autodetected(const struct mtd_ctx *ctx,
const struct mtd_info_user *mtd,
struct mtd_geometry *geometry,
@@ -217,6 +222,7 @@ static void init_yaffs_geometry_autodete
.block_size = mtd->erasesize,
};
}
+#endif
/*
* Update 'chunk_size' and 'block_size' in 'geometry' to the values provided in
@@ -280,6 +286,7 @@ static int init_yaffs_geometry_file(cons
* 2. If -C and/or -B were used, override any default values with those
* provided on the command line.
*/
+#ifdef linux
static void init_yaffs_geometry_nand_or_nor(const struct mtd_ctx *ctx,
const struct mtd_info_user *mtd,
const struct opts *opts,
@@ -297,6 +304,7 @@ static void init_yaffs_geometry_nand_or_
geometry->block_count = mtd->size / geometry->block_size;
}
+#endif
/*
* Determine the type of the provided MTD (which can be either NAND/NOR flash
@@ -317,6 +325,7 @@ static int init_yaffs_geometry(const str
geometry->oob_size = 0;
geometry->oobavail = 0;
} else {
+#ifdef linux
struct mtd_info_user mtd;
unsigned int oobavail;
@@ -329,6 +338,9 @@ static int init_yaffs_geometry(const str
geometry->oob_size = mtd.oobsize;
geometry->oobavail = oobavail;
+#else
+ return -1;
+#endif
}
return 0;
--- a/src/ydrv.c
+++ b/src/ydrv.c
@@ -3,7 +3,9 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <errno.h>
+#ifdef linux
#include <mtd/mtd-user.h>
+#endif
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
@@ -122,6 +124,7 @@ static long long ydrv_get_data_offset_fo
/*
* Check whether the given MTD block is a bad one on NAND or NOR flash.
*/
+#ifdef linux
static int ydrv_check_bad_nand_or_nor(const struct ydrv_ctx *ctx,
int block_no) {
long long offset = block_no * ctx->block_size;
@@ -139,6 +142,7 @@ static int ydrv_check_bad_nand_or_nor(co
return (ret == 0 ? YAFFS_OK : YAFFS_FAIL);
}
+#endif
/*
* Check whether the given MTD block is a bad one.
@@ -154,9 +158,11 @@ static int ydrv_check_bad(struct yaffs_d
}
switch (ctx->mtd_type) {
+#ifdef linux
case MTD_TYPE_NAND:
case MTD_TYPE_NOR:
return ydrv_check_bad_nand_or_nor(ctx, block_no);
+#endif
case MTD_TYPE_FILE:
ydrv_debug("file is assumed to only contain good blocks");
return YAFFS_OK;
@@ -169,6 +175,7 @@ static int ydrv_check_bad(struct yaffs_d
/*
* Erase the given MTD block on NAND or NOR flash.
*/
+#ifdef linux
static int ydrv_erase_block_nand_or_nor(const struct ydrv_ctx *ctx,
int block_no) {
long long offset = block_no * ctx->block_size;
@@ -196,6 +203,7 @@ static int ydrv_erase_block_nand_or_nor(
return YAFFS_OK;
}
+#endif
/*
* Erase the given MTD block in a file.
@@ -247,9 +255,11 @@ static int ydrv_erase_block(struct yaffs
}
switch (ctx->mtd_type) {
+#ifdef linux
case MTD_TYPE_NAND:
case MTD_TYPE_NOR:
return ydrv_erase_block_nand_or_nor(ctx, block_no);
+#endif
case MTD_TYPE_FILE:
return ydrv_erase_block_file(ctx, block_no);
default:
@@ -261,6 +271,7 @@ static int ydrv_erase_block(struct yaffs
/*
* Mark the given MTD block as bad on NAND or NOR flash.
*/
+#ifdef linux
static int ydrv_mark_bad_nand_or_nor(const struct ydrv_ctx *ctx, int block_no) {
long long offset = block_no * ctx->block_size;
int err = 0;
@@ -281,6 +292,7 @@ static int ydrv_mark_bad_nand_or_nor(con
return YAFFS_OK;
}
+#endif
/*
* Mark the given MTD block as bad.
@@ -296,9 +308,11 @@ static int ydrv_mark_bad(struct yaffs_de
}
switch (ctx->mtd_type) {
+#ifdef linux
case MTD_TYPE_NAND:
case MTD_TYPE_NOR:
return ydrv_mark_bad_nand_or_nor(ctx, block_no);
+#endif
case MTD_TYPE_FILE:
ydrv_debug("file is assumed to only contain good blocks");
return YAFFS_FAIL;
@@ -315,9 +329,11 @@ static int ydrv_mark_bad(struct yaffs_de
*/
static int ydrv_ecc_result(int read_result, enum yaffs_ecc_result *ecc_result) {
switch (read_result) {
+#ifdef linux
case -EUCLEAN:
*ecc_result = YAFFS_ECC_RESULT_FIXED;
return YAFFS_OK;
+#endif
case -EBADMSG:
*ecc_result = YAFFS_ECC_RESULT_UNFIXED;
return YAFFS_FAIL;
@@ -333,6 +349,7 @@ static int ydrv_ecc_result(int read_resu
/*
* Read a data+OOB chunk from NAND flash.
*/
+#ifdef linux
static int ydrv_read_chunk_nand(const struct ydrv_ctx *ctx, int chunk, u8 *data,
int data_len, u8 *oob, int oob_len,
enum yaffs_ecc_result *ecc_result_out,
@@ -371,6 +388,7 @@ static int ydrv_read_chunk_nand(const st
return ret;
}
+#endif
/*
* Read a data chunk from NOR flash.
@@ -420,10 +438,12 @@ static int ydrv_read_chunk(struct yaffs_
}
switch (ctx->mtd_type) {
+#ifdef linux
case MTD_TYPE_NAND:
return ydrv_read_chunk_nand(ctx, chunk, data, data_len, oob,
oob_len, ecc_result_out,
dev->param.is_yaffs2);
+#endif
case MTD_TYPE_NOR:
case MTD_TYPE_FILE:
return ydrv_read_chunk_nor_or_file(ctx, chunk, data, data_len,
@@ -438,6 +458,7 @@ static int ydrv_read_chunk(struct yaffs_
/*
* Write a data+OOB chunk to NAND flash.
*/
+#ifdef linux
static int ydrv_write_chunk_nand(const struct ydrv_ctx *ctx, int chunk,
const u8 *data, int data_len, const u8 *oob,
int oob_len, bool is_yaffs2) {
@@ -472,6 +493,7 @@ static int ydrv_write_chunk_nand(const s
return YAFFS_OK;
}
+#endif
/*
* Write a data chunk to NOR flash.
@@ -516,9 +538,11 @@ static int ydrv_write_chunk(struct yaffs
}
switch (ctx->mtd_type) {
+#ifdef linux
case MTD_TYPE_NAND:
return ydrv_write_chunk_nand(ctx, chunk, data, data_len, oob,
oob_len, dev->param.is_yaffs2);
+#endif
case MTD_TYPE_NOR:
case MTD_TYPE_FILE:
return ydrv_write_chunk_nor_or_file(ctx, chunk, data, data_len);