Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
456ad0e4f8
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.1 = .95
|
||||
LINUX_KERNEL_HASH-6.1.95 = 2960f0aa1d75665f39114ad3c272a999c54796e553a2355d0379f5188d14dfbd
|
||||
LINUX_VERSION-6.1 = .96
|
||||
LINUX_KERNEL_HASH-6.1.96 = 3e77c9069de5e7ab02ff9c2dcfe77dab193613fc1de21071901b4153374862a9
|
||||
|
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.6 = .35
|
||||
LINUX_KERNEL_HASH-6.6.35 = fce3ee728712ed063aa8c14a8756c8ff8c7a46ba3827f61d2b04a73c7cf5dd9e
|
||||
LINUX_VERSION-6.6 = .36
|
||||
LINUX_KERNEL_HASH-6.6.36 = b9676828b737e8fb8eaa5198303d35d35e8df019550be153c8a42c99afe0cdd5
|
||||
|
@ -9,15 +9,15 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uboot-envtools
|
||||
PKG_DISTNAME:=u-boot
|
||||
PKG_VERSION:=2024.01
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=2024.07
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:= \
|
||||
https://ftp.denx.de/pub/u-boot \
|
||||
https://mirror.cyberbits.eu/u-boot \
|
||||
ftp://ftp.denx.de/pub/u-boot
|
||||
PKG_HASH:=b99611f1ed237bf3541bdc8434b68c96a6e05967061f992443cb30aabebef5b3
|
||||
PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION)
|
||||
|
||||
|
@ -112,7 +112,8 @@ livinet,zr-3020-ubootmod)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "1"
|
||||
;;
|
||||
mercusys,mr90x-v1|\
|
||||
routerich,ax3000)
|
||||
routerich,ax3000|\
|
||||
tplink,re6000xd)
|
||||
local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
|
||||
ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
|
||||
;;
|
||||
|
@ -1,70 +0,0 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 12 Dec 2023 18:23:45 +0100
|
||||
Subject: [PATCH] fw_env: fix reading NVMEM device's "compatible" value
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Call to fread() was changed to check for return value. The problem is it
|
||||
can't be checked for returning 1 (as it is) to determine success.
|
||||
|
||||
We call fread() with buffer size as "size" argument. Reading any
|
||||
"compatible" value shorter than buffer size will result in returning 0
|
||||
even on success.
|
||||
|
||||
Modify code to use fstat() to determine expected read length.
|
||||
|
||||
This fixes regression that broke using fw_env with NVMEM devices.
|
||||
|
||||
Fixes: c059a22b7776 ("tools: env: fw_env: Fix unused-result warning")
|
||||
Cc: Jaehoon Chung <jh80.chung@samsung.com>
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
tools/env/fw_env.c | 18 ++++++++++++++----
|
||||
1 file changed, 14 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/tools/env/fw_env.c
|
||||
+++ b/tools/env/fw_env.c
|
||||
@@ -1732,6 +1732,7 @@ static int find_nvmem_device(void)
|
||||
}
|
||||
|
||||
while (!nvmem && (dent = readdir(dir))) {
|
||||
+ struct stat s;
|
||||
FILE *fp;
|
||||
size_t size;
|
||||
|
||||
@@ -1749,14 +1750,22 @@ static int find_nvmem_device(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
- size = fread(buf, sizeof(buf), 1, fp);
|
||||
+ if (fstat(fileno(fp), &s)) {
|
||||
+ fprintf(stderr, "Failed to fstat %s\n", comp);
|
||||
+ goto next;
|
||||
+ }
|
||||
+
|
||||
+ if (s.st_size >= sizeof(buf)) {
|
||||
+ goto next;
|
||||
+ }
|
||||
+
|
||||
+ size = fread(buf, s.st_size, 1, fp);
|
||||
if (size != 1) {
|
||||
fprintf(stderr,
|
||||
"read failed about %s\n", comp);
|
||||
- fclose(fp);
|
||||
- return -EIO;
|
||||
+ goto next;
|
||||
}
|
||||
-
|
||||
+ buf[s.st_size] = '\0';
|
||||
|
||||
if (!strcmp(buf, "u-boot,env")) {
|
||||
bytes = asprintf(&nvmem, "%s/%s/nvmem", path, dent->d_name);
|
||||
@@ -1765,6 +1774,7 @@ static int find_nvmem_device(void)
|
||||
}
|
||||
}
|
||||
|
||||
+next:
|
||||
fclose(fp);
|
||||
}
|
||||
|
@ -1,75 +0,0 @@
|
||||
From 9e3003f79d168eac7ee65cd457e3904e2fb4eea8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Wed, 13 Dec 2023 13:13:54 +0100
|
||||
Subject: [PATCH] fw_env: keep calling read() until whole flash block is read
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It's totally valid for read() to provide less bytes than requested
|
||||
maximum. It may happen if there is no more data available yet or source
|
||||
pushes data in small chunks.
|
||||
|
||||
This actually happens when trying to read env data from NVMEM device.
|
||||
Kernel may provide NVMEM content in page size parts (like 4096 B).
|
||||
|
||||
This fixes warnings like:
|
||||
Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 16384 bytes but got 4096
|
||||
Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 12288 bytes but got 4096
|
||||
Warning on /sys/bus/nvmem/devices/u-boot-env0/nvmem: Attempted to read 8192 bytes but got 4096
|
||||
|
||||
Since the main loop in flash_read_buf() is used to read blocks this
|
||||
patch adds a new nested one.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
tools/env/fw_env.c | 34 +++++++++++++++-------------------
|
||||
1 file changed, 15 insertions(+), 19 deletions(-)
|
||||
|
||||
--- a/tools/env/fw_env.c
|
||||
+++ b/tools/env/fw_env.c
|
||||
@@ -948,29 +948,25 @@ static int flash_read_buf(int dev, int f
|
||||
*/
|
||||
lseek(fd, blockstart + block_seek, SEEK_SET);
|
||||
|
||||
- rc = read(fd, buf + processed, readlen);
|
||||
- if (rc == -1) {
|
||||
- fprintf(stderr, "Read error on %s: %s\n",
|
||||
- DEVNAME(dev), strerror(errno));
|
||||
- return -1;
|
||||
- }
|
||||
+ while (readlen) {
|
||||
+ rc = read(fd, buf + processed, readlen);
|
||||
+ if (rc == -1) {
|
||||
+ fprintf(stderr, "Read error on %s: %s\n",
|
||||
+ DEVNAME(dev), strerror(errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
#ifdef DEBUG
|
||||
- fprintf(stderr, "Read 0x%x bytes at 0x%llx on %s\n",
|
||||
- rc, (unsigned long long)blockstart + block_seek,
|
||||
- DEVNAME(dev));
|
||||
+ fprintf(stderr, "Read 0x%x bytes at 0x%llx on %s\n",
|
||||
+ rc, (unsigned long long)blockstart + block_seek,
|
||||
+ DEVNAME(dev));
|
||||
#endif
|
||||
- processed += rc;
|
||||
- if (rc != readlen) {
|
||||
- fprintf(stderr,
|
||||
- "Warning on %s: Attempted to read %zd bytes but got %d\n",
|
||||
- DEVNAME(dev), readlen, rc);
|
||||
+ processed += rc;
|
||||
readlen -= rc;
|
||||
- block_seek += rc;
|
||||
- } else {
|
||||
- blockstart += blocklen;
|
||||
- readlen = min(blocklen, count - processed);
|
||||
- block_seek = 0;
|
||||
}
|
||||
+
|
||||
+ blockstart += blocklen;
|
||||
+ readlen = min(blocklen, count - processed);
|
||||
+ block_seek = 0;
|
||||
}
|
||||
|
||||
return processed;
|
@ -1,49 +0,0 @@
|
||||
From d73a6641868029b5cae53ed00c5766921c9d8b1f Mon Sep 17 00:00:00 2001
|
||||
From: Anthony Loiseau <anthony.loiseau@allcircuits.com>
|
||||
Date: Thu, 21 Dec 2023 23:44:38 +0100
|
||||
Subject: [PATCH] fw_env: autodetect NAND erase size and env sectors
|
||||
|
||||
As already done for NOR chips, if device ESIZE and ENVSECTORS static
|
||||
configurations are both zero, then autodetect them at runtime.
|
||||
|
||||
Cc: Joe Hershberger <joe.hershberger@ni.com>
|
||||
cc: Stefan Agner <stefan@agner.ch>
|
||||
cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
|
||||
Signed-off-by: Anthony Loiseau <anthony.loiseau@allcircuits.com>
|
||||
---
|
||||
tools/env/README | 3 +++
|
||||
tools/env/fw_env.c | 11 +++++++++--
|
||||
2 files changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/tools/env/README
|
||||
+++ b/tools/env/README
|
||||
@@ -58,6 +58,9 @@ DEVICEx_ENVSECTORS defines the number of
|
||||
this environment instance. On NAND this is used to limit the range
|
||||
within which bad blocks are skipped, on NOR it is not used.
|
||||
|
||||
+If DEVICEx_ESIZE and DEVICEx_ENVSECTORS are both zero, then a runtime
|
||||
+detection is attempted for NOR and NAND mtd types.
|
||||
+
|
||||
To prevent losing changes to the environment and to prevent confusing the MTD
|
||||
drivers, a lock file at /run/fw_printenv.lock is used to serialize access
|
||||
to the environment.
|
||||
--- a/tools/env/fw_env.c
|
||||
+++ b/tools/env/fw_env.c
|
||||
@@ -1655,8 +1655,15 @@ static int check_device_config(int dev)
|
||||
}
|
||||
DEVTYPE(dev) = mtdinfo.type;
|
||||
if (DEVESIZE(dev) == 0 && ENVSECTORS(dev) == 0 &&
|
||||
- mtdinfo.type == MTD_NORFLASH)
|
||||
- DEVESIZE(dev) = mtdinfo.erasesize;
|
||||
+ mtdinfo.erasesize > 0) {
|
||||
+ if (mtdinfo.type == MTD_NORFLASH)
|
||||
+ DEVESIZE(dev) = mtdinfo.erasesize;
|
||||
+ else if (mtdinfo.type == MTD_NANDFLASH) {
|
||||
+ DEVESIZE(dev) = mtdinfo.erasesize;
|
||||
+ ENVSECTORS(dev) =
|
||||
+ mtdinfo.size / mtdinfo.erasesize;
|
||||
+ }
|
||||
+ }
|
||||
if (DEVESIZE(dev) == 0)
|
||||
/* Assume the erase size is the same as the env-size */
|
||||
DEVESIZE(dev) = ENVSIZE(dev);
|
@ -337,7 +337,6 @@ UBOOT_TARGETS := \
|
||||
UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes
|
||||
|
||||
UBOOT_CUSTOMIZE_CONFIG := \
|
||||
--disable SPL_FIT_SIGNATURE \
|
||||
--disable TOOLS_MKEFICAPSULE \
|
||||
--set-str MKIMAGE_DTC_PATH $(PKG_BUILD_DIR)/scripts/dtc/dtc \
|
||||
$(if $(TPL),, \
|
||||
@ -347,6 +346,7 @@ UBOOT_CUSTOMIZE_CONFIG := \
|
||||
--disable DFU_MMC \
|
||||
--disable EFI_CAPSULE_ON_DISK \
|
||||
--disable EFI_CAPSULE_FIRMWARE_RAW \
|
||||
--disable SPL_FIT_SIGNATURE \
|
||||
)
|
||||
|
||||
UBOOT_MAKE_FLAGS += \
|
||||
|
@ -6,9 +6,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
|
||||
PKG_SOURCE_DATE:=2024-04-26
|
||||
PKG_SOURCE_VERSION:=644ba9ea2e6685e420561ef098cb6fbaaf136cbf
|
||||
PKG_MIRROR_HASH:=3b913fd6fb0fac404b16e67c66d36c10315dba5459a8d495d870afcb1e2c33cd
|
||||
PKG_SOURCE_DATE:=2024-06-30
|
||||
PKG_SOURCE_VERSION:=e82cba7e7ce79a04d2b658c20ac9be387ccc1dd9
|
||||
PKG_MIRROR_HASH:=c71ad9785bf382a80b4c9042f1f19da8737dc85cd11e49f18881dee94df61efd
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -38,6 +38,7 @@ ALLWIFIBOARDS:= \
|
||||
linksys_mx4200 \
|
||||
linksys_mx5300 \
|
||||
linksys_mx8500 \
|
||||
linksys_whw03 \
|
||||
netgear_lbr20 \
|
||||
netgear_rax120v2 \
|
||||
netgear_sxk80 \
|
||||
@ -160,6 +161,7 @@ $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800))
|
||||
$(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_mx8500,Linksys MX8500))
|
||||
$(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))
|
||||
$(eval $(call generate-ipq-wifi-package,netgear_sxk80,Netgear SXK80))
|
||||
|
@ -67,7 +67,7 @@
|
||||
reg = <0x18040000 0x28>;
|
||||
interrupts = <2>;
|
||||
|
||||
ngpios = <16>;
|
||||
ngpios = <12>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
@ -49,12 +49,9 @@
|
||||
};
|
||||
|
||||
&gpio {
|
||||
ngpios = <31>;
|
||||
gpio-line-names =
|
||||
"", "", "", "", "LED", "RDY", "", "MDC",
|
||||
"MDIO", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "",
|
||||
"", "", "", "", "", "", "", "";
|
||||
"MDIO", "", "", "";
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
|
@ -15,6 +15,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
&gpio {
|
||||
ngpios = <18>;
|
||||
};
|
||||
|
||||
&ahb {
|
||||
usb: usb@1b000000 {
|
||||
compatible = "generic-ohci";
|
||||
|
@ -16,7 +16,7 @@
|
||||
};
|
||||
|
||||
&gpio {
|
||||
ngpios = <20>;
|
||||
ngpios = <18>;
|
||||
};
|
||||
|
||||
&ahb {
|
||||
|
@ -60,8 +60,6 @@
|
||||
reg = <0x18040000 0x28>;
|
||||
interrupts = <2>;
|
||||
|
||||
ngpios = <18>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
|
@ -91,7 +91,6 @@
|
||||
};
|
||||
|
||||
&gpio {
|
||||
ngpios = <17>;
|
||||
gpio-line-names =
|
||||
"","reset-zigbee","reset-zwave","reset",
|
||||
"LED-orange","","","","","","",
|
||||
|
@ -72,7 +72,7 @@
|
||||
reg = <0x18040000 0x28>;
|
||||
|
||||
interrupts = <2>;
|
||||
ngpios = <20>;
|
||||
ngpios = <18>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
@ -61,7 +61,7 @@
|
||||
reg = <0x18040000 0x28>;
|
||||
|
||||
interrupts = <2>;
|
||||
ngpios = <24>;
|
||||
ngpios = <23>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
@ -11,62 +11,62 @@ board=$(board_name)
|
||||
case "$board" in
|
||||
adtran,bsap1800-v2|\
|
||||
adtran,bsap1840)
|
||||
ucidef_add_gpio_switch "wifi1_ext_a" "5GHz External Antenna A" "489" "1"
|
||||
ucidef_add_gpio_switch "wifi1_int_a" "5GHz Internal Antenna A" "493"
|
||||
ucidef_add_gpio_switch "wifi1_ext_b" "5GHz External Antenna B" "494" "1"
|
||||
ucidef_add_gpio_switch "wifi1_int_b" "5GHz Internal Antenna B" "495"
|
||||
ucidef_add_gpio_switch "wifi1_ext_c" "5GHz External Antenna C" "496" "1"
|
||||
ucidef_add_gpio_switch "wifi1_int_c" "5GHz Internal Antenna C" "497"
|
||||
ucidef_add_gpio_switch "wifi0_ext_a" "2.4GHz External Antenna A" "505" "1"
|
||||
ucidef_add_gpio_switch "wifi0_int_a" "2.4GHz Internal Antenna A" "506"
|
||||
ucidef_add_gpio_switch "wifi0_ext_b" "2.4GHz External Antenna B" "507" "1"
|
||||
ucidef_add_gpio_switch "wifi0_int_b" "2.4GHz Internal Antenna B" "508"
|
||||
ucidef_add_gpio_switch "wifi0_ext_c" "2.4GHz External Antenna C" "509" "1"
|
||||
ucidef_add_gpio_switch "wifi0_int_c" "2.4GHz Internal Antenna C" "510"
|
||||
ucidef_add_gpio_switch "wifi1_ext_a" "5GHz External Antenna A" "534" "1"
|
||||
ucidef_add_gpio_switch "wifi1_int_a" "5GHz Internal Antenna A" "535"
|
||||
ucidef_add_gpio_switch "wifi1_ext_b" "5GHz External Antenna B" "536" "1"
|
||||
ucidef_add_gpio_switch "wifi1_int_b" "5GHz Internal Antenna B" "537"
|
||||
ucidef_add_gpio_switch "wifi1_ext_c" "5GHz External Antenna C" "538" "1"
|
||||
ucidef_add_gpio_switch "wifi1_int_c" "5GHz Internal Antenna C" "539"
|
||||
ucidef_add_gpio_switch "wifi0_ext_a" "2.4GHz External Antenna A" "527" "1"
|
||||
ucidef_add_gpio_switch "wifi0_int_a" "2.4GHz Internal Antenna A" "528"
|
||||
ucidef_add_gpio_switch "wifi0_ext_b" "2.4GHz External Antenna B" "529" "1"
|
||||
ucidef_add_gpio_switch "wifi0_int_b" "2.4GHz Internal Antenna B" "530"
|
||||
ucidef_add_gpio_switch "wifi0_ext_c" "2.4GHz External Antenna C" "531" "1"
|
||||
ucidef_add_gpio_switch "wifi0_int_c" "2.4GHz Internal Antenna C" "532"
|
||||
;;
|
||||
asus,pl-ac56)
|
||||
ucidef_add_gpio_switch "plc_enable" "PLC enable" "14" "1"
|
||||
ucidef_add_gpio_switch "plc_enable" "PLC enable" "526" "1"
|
||||
;;
|
||||
comfast,cf-e5|\
|
||||
telco,t1)
|
||||
ucidef_add_gpio_switch "lte_power" "LTE Power" "14" "1"
|
||||
ucidef_add_gpio_switch "lte_wakeup" "LTE Wakeup" "11" "1"
|
||||
ucidef_add_gpio_switch "lte_poweroff" "LTE Poweroff" "1" "1"
|
||||
ucidef_add_gpio_switch "lte_reset" "LTE Reset" "12" "1"
|
||||
ucidef_add_gpio_switch "lte_power" "LTE Power" "526" "1"
|
||||
ucidef_add_gpio_switch "lte_wakeup" "LTE Wakeup" "523" "1"
|
||||
ucidef_add_gpio_switch "lte_poweroff" "LTE Poweroff" "513" "1"
|
||||
ucidef_add_gpio_switch "lte_reset" "LTE Reset" "524" "1"
|
||||
;;
|
||||
devolo,dlan-pro-1200plus-ac)
|
||||
ucidef_add_gpio_switch "plc_enable" "PLC enable" "13" "0"
|
||||
ucidef_add_gpio_switch "plc_enable" "PLC enable" "525" "0"
|
||||
;;
|
||||
devolo,magic-2-wifi)
|
||||
ucidef_add_gpio_switch "plc_pairing" "PLC pairing" "11" "1"
|
||||
ucidef_add_gpio_switch "plc_enable" "PLC enable" "13" "1"
|
||||
ucidef_add_gpio_switch "plc_pairing" "PLC pairing" "523" "1"
|
||||
ucidef_add_gpio_switch "plc_enable" "PLC enable" "525" "1"
|
||||
;;
|
||||
dlink,dir-825-c1|\
|
||||
dlink,dir-835-a1)
|
||||
ucidef_add_gpio_switch "wan_led_auto" "WAN LED Auto" "20" "0"
|
||||
ucidef_add_gpio_switch "wan_led_auto" "WAN LED Auto" "532" "0"
|
||||
;;
|
||||
librerouter,librerouter-v1)
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "1" "0"
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "513" "0"
|
||||
;;
|
||||
teltonika,rut955)
|
||||
ucidef_add_gpio_switch "sim_sel" "SIM select" "503" "1"
|
||||
ucidef_add_gpio_switch "DOUT1" "DOUT1 (OC)" "504" "0"
|
||||
ucidef_add_gpio_switch "DOUT2" "DOUT2 (Relay)" "505" "0"
|
||||
ucidef_add_gpio_switch "modem_vbus" "Modem enable" "506" "1"
|
||||
ucidef_add_gpio_switch "modem_rst" "Modem reset" "507" "0"
|
||||
ucidef_add_gpio_switch "DOUT3" "DOUT3" "508" "0"
|
||||
ucidef_add_gpio_switch "sim_sel" "SIM select" "542" "1"
|
||||
ucidef_add_gpio_switch "DOUT1" "DOUT1 (OC)" "543" "0"
|
||||
ucidef_add_gpio_switch "DOUT2" "DOUT2 (Relay)" "544" "0"
|
||||
ucidef_add_gpio_switch "modem_vbus" "Modem enable" "545" "1"
|
||||
ucidef_add_gpio_switch "modem_rst" "Modem reset" "546" "0"
|
||||
ucidef_add_gpio_switch "DOUT3" "DOUT3" "547" "0"
|
||||
;;
|
||||
teltonika,rut955-h7v3c0)
|
||||
ucidef_add_gpio_switch "sim_sel" "SIM select" "503" "1"
|
||||
ucidef_add_gpio_switch "DOUT1" "DOUT1 (OC)" "504" "0"
|
||||
ucidef_add_gpio_switch "DOUT2" "DOUT2 (Relay)" "505" "0"
|
||||
ucidef_add_gpio_switch "modem_vbus" "Modem enable" "508" "1"
|
||||
ucidef_add_gpio_switch "modem_rst" "Modem reset" "509" "0"
|
||||
ucidef_add_gpio_switch "sim_sel" "SIM select" "542" "1"
|
||||
ucidef_add_gpio_switch "DOUT1" "DOUT1 (OC)" "543" "0"
|
||||
ucidef_add_gpio_switch "DOUT2" "DOUT2 (Relay)" "544" "0"
|
||||
ucidef_add_gpio_switch "modem_vbus" "Modem enable" "547" "1"
|
||||
ucidef_add_gpio_switch "modem_rst" "Modem reset" "548" "0"
|
||||
;;
|
||||
|
||||
tplink,archer-c25-v1)
|
||||
ucidef_add_gpio_switch "led_control" "LED control" "21" "0"
|
||||
ucidef_add_gpio_switch "led_reset" "LED reset" "19" "1"
|
||||
ucidef_add_gpio_switch "led_control" "LED control" "533" "0"
|
||||
ucidef_add_gpio_switch "led_reset" "LED reset" "531" "1"
|
||||
;;
|
||||
tplink,cpe210-v1|\
|
||||
tplink,cpe220-v2|\
|
||||
@ -76,31 +76,31 @@ tplink,wbs210-v1|\
|
||||
tplink,wbs210-v2|\
|
||||
tplink,wbs510-v1|\
|
||||
tplink,wbs510-v2)
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20"
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "532"
|
||||
;;
|
||||
ubnt,aircube-ac|\
|
||||
ubnt,nanobeam-ac-gen2|\
|
||||
ubnt,nanostation-ac)
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "3"
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "515"
|
||||
;;
|
||||
ubnt,aircube-isp)
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11"
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "523"
|
||||
;;
|
||||
ubnt,nanostation-m)
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "8"
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "520"
|
||||
;;
|
||||
ubnt,nanostation-m-xw)
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "2"
|
||||
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "514"
|
||||
;;
|
||||
ubnt,uk-ultra)
|
||||
ucidef_add_gpio_switch "ant0_internal" "ANT0 Internal" "5" "1"
|
||||
ucidef_add_gpio_switch "ant1_internal" "ANT1 Internal" "6" "1"
|
||||
ucidef_add_gpio_switch "ant0_internal" "ANT0 Internal" "517" "1"
|
||||
ucidef_add_gpio_switch "ant1_internal" "ANT1 Internal" "518" "1"
|
||||
;;
|
||||
zbtlink,zbt-wd323)
|
||||
ucidef_add_gpio_switch "io0" "IO#0" "0"
|
||||
ucidef_add_gpio_switch "io1" "IO#1" "1"
|
||||
ucidef_add_gpio_switch "io2" "IO#2" "2"
|
||||
ucidef_add_gpio_switch "io14" "IO#14" "14"
|
||||
ucidef_add_gpio_switch "io0" "IO#0" "512"
|
||||
ucidef_add_gpio_switch "io1" "IO#1" "513"
|
||||
ucidef_add_gpio_switch "io2" "IO#2" "514"
|
||||
ucidef_add_gpio_switch "io14" "IO#14" "526"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -11,7 +11,7 @@ board=$(board_name)
|
||||
case "$board" in
|
||||
zte,mf286a|\
|
||||
zte,mf286r)
|
||||
ucidef_add_gpio_switch "power_btn_block" "Power button blocker" "20" "0"
|
||||
ucidef_add_gpio_switch "power_btn_block" "Power button blocker" "532" "0"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
From 9a473c2a093e0d1c466bf86073230e2c8b658977 Mon Sep 17 00:00:00 2001
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Wed, 26 Jun 2024 08:33:18 +0800
|
||||
Subject: gpio: ath79: convert to dynamic GPIO base allocation
|
||||
|
||||
ath79 target has already been converted to device tree based platform.
|
||||
Use dynamic GPIO numberspace base to suppress the warning:
|
||||
|
||||
gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
|
||||
|
||||
Tested on Atheros AR7241 and AR9344.
|
||||
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
Suggested-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||
Link: https://lore.kernel.org/r/TYCP286MB089598EA71E964BD8AB9EFD3BCD62@TYCP286MB0895.JPNP286.PROD.OUTLOOK.COM
|
||||
[Bartosz: tweaked the commit message]
|
||||
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
|
||||
---
|
||||
drivers/gpio/gpio-ath79.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
--- a/drivers/gpio/gpio-ath79.c
|
||||
+++ b/drivers/gpio/gpio-ath79.c
|
||||
@@ -273,8 +273,6 @@ static int ath79_gpio_probe(struct platf
|
||||
dev_err(dev, "bgpio_init failed\n");
|
||||
return err;
|
||||
}
|
||||
- /* Use base 0 to stay compatible with legacy platforms */
|
||||
- ctrl->gc.base = 0;
|
||||
|
||||
/* Optional interrupt setup */
|
||||
if (!np || of_property_read_bool(np, "interrupt-controller")) {
|
@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
||||
#define USB_VENDOR_ID_BELKIN 0x050d
|
||||
#define USB_DEVICE_ID_FLIP_KVM 0x3201
|
||||
|
||||
@@ -1404,6 +1407,9 @@
|
||||
@@ -1405,6 +1408,9 @@
|
||||
#define USB_VENDOR_ID_XIAOMI 0x2717
|
||||
#define USB_DEVICE_ID_MI_SILENT_MOUSE 0x5014
|
||||
|
||||
|
@ -30,7 +30,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
|
||||
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
|
||||
@@ -465,8 +465,6 @@ static void axi_chan_block_xfer_start(st
|
||||
@@ -389,8 +389,6 @@ static void axi_chan_block_xfer_start(st
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
--- a/drivers/net/usb/ax88179_178a.c
|
||||
+++ b/drivers/net/usb/ax88179_178a.c
|
||||
@@ -1320,6 +1320,8 @@ static int ax88179_bind(struct usbnet *d
|
||||
@@ -1319,6 +1319,8 @@ static int ax88179_bind(struct usbnet *d
|
||||
|
||||
ax88179_reset(dev);
|
||||
|
||||
|
@ -22,7 +22,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
|
||||
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
|
||||
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
|
||||
@@ -916,6 +916,9 @@ dw_axi_dma_chan_prep_slave_sg(struct dma
|
||||
@@ -834,6 +834,9 @@ dw_axi_dma_chan_prep_slave_sg(struct dma
|
||||
mem = sg_dma_address(sg);
|
||||
len = sg_dma_len(sg);
|
||||
num_segments = DIV_ROUND_UP(sg_dma_len(sg), axi_block_len);
|
||||
|
@ -0,0 +1,52 @@
|
||||
From 5c0f94088e0694220a2f0d8ad6e8216b50a80f2e Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
Date: Thu, 13 Jun 2024 15:01:02 +0100
|
||||
Subject: [PATCH 1133/1145] drivers: mmc: sdhci-brcmstb: improve bcm2712 card
|
||||
removal handling
|
||||
|
||||
If the controller is being reset, then the CQE needs to be reset as well.
|
||||
|
||||
For removable cards, CQHCI_SSC1 must specify a polling mode (CBC=0)
|
||||
otherwise it's possible that the controller stops emitting periodic
|
||||
CMD13s on card removal, without raising an error status interrupt.
|
||||
|
||||
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
|
||||
---
|
||||
drivers/mmc/host/sdhci-brcmstb.c | 19 ++++++++++++++++---
|
||||
1 file changed, 16 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/mmc/host/sdhci-brcmstb.c
|
||||
+++ b/drivers/mmc/host/sdhci-brcmstb.c
|
||||
@@ -365,8 +365,21 @@ static void sdhci_brcmstb_cqe_enable(str
|
||||
|
||||
sdhci_cqe_enable(mmc);
|
||||
|
||||
- /* Reset CMD13 polling timer back to eMMC specification default */
|
||||
- cqhci_writel(cq_host, 0x00011000, CQHCI_SSC1);
|
||||
+ /*
|
||||
+ * The controller resets this register to a very short default interval
|
||||
+ * whenever CQHCI is disabled.
|
||||
+ *
|
||||
+ * For removable cards CBC needs to be clear or card removal can hang
|
||||
+ * the CQE. In polling mode, a CIT of 0x4000 "cycles" seems to produce the best
|
||||
+ * throughput.
|
||||
+ *
|
||||
+ * For nonremovable cards, the specification default of CBC=1 CIT=0x1000
|
||||
+ * suffices.
|
||||
+ */
|
||||
+ if (mmc->caps & MMC_CAP_NONREMOVABLE)
|
||||
+ cqhci_writel(cq_host, 0x00011000, CQHCI_SSC1);
|
||||
+ else
|
||||
+ cqhci_writel(cq_host, 0x00004000, CQHCI_SSC1);
|
||||
}
|
||||
|
||||
static const struct cqhci_host_ops sdhci_brcmstb_cqhci_ops = {
|
||||
@@ -386,7 +399,7 @@ static struct sdhci_ops sdhci_brcmstb_op
|
||||
.set_clock = sdhci_bcm2712_set_clock,
|
||||
.set_power = sdhci_brcmstb_set_power,
|
||||
.set_bus_width = sdhci_set_bus_width,
|
||||
- .reset = sdhci_reset,
|
||||
+ .reset = brcmstb_reset,
|
||||
.set_uhs_signaling = sdhci_set_uhs_signaling,
|
||||
.init_sd_express = bcm2712_init_sd_express,
|
||||
};
|
@ -0,0 +1,193 @@
|
||||
From a1d3defcca200077e1e382fe049ca613d16efd2b Mon Sep 17 00:00:00 2001
|
||||
From: Cavon Lee <cavonxx@gmail.com>
|
||||
Date: Tue, 18 Jun 2024 14:01:23 +0800
|
||||
Subject: [PATCH 1136/1145] feat: Add support for SunFounder PiPower 3 overlay
|
||||
fix: Fix wrong Pironman 5 ir default pin number fix: Change space indentation
|
||||
to tab
|
||||
|
||||
Signed-off-by: Cavon Lee <cavonxx@gmail.com>
|
||||
---
|
||||
arch/arm/boot/dts/overlays/Makefile | 1 +
|
||||
arch/arm/boot/dts/overlays/README | 8 +-
|
||||
.../overlays/sunfounder-pipower3-overlay.dts | 44 ++++++++++
|
||||
.../overlays/sunfounder-pironman5-overlay.dts | 88 ++++++++++---------
|
||||
4 files changed, 98 insertions(+), 43 deletions(-)
|
||||
create mode 100644 arch/arm/boot/dts/overlays/sunfounder-pipower3-overlay.dts
|
||||
|
||||
--- a/arch/arm/boot/dts/overlays/Makefile
|
||||
+++ b/arch/arm/boot/dts/overlays/Makefile
|
||||
@@ -275,6 +275,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
|
||||
ssd1306-spi.dtbo \
|
||||
ssd1331-spi.dtbo \
|
||||
ssd1351-spi.dtbo \
|
||||
+ sunfounder-pipower3.dtbo \
|
||||
sunfounder-pironman5.dtbo \
|
||||
superaudioboard.dtbo \
|
||||
sx150x.dtbo \
|
||||
--- a/arch/arm/boot/dts/overlays/README
|
||||
+++ b/arch/arm/boot/dts/overlays/README
|
||||
@@ -4695,11 +4695,17 @@ Params: speed SPI bus
|
||||
reset_pin GPIO pin for RESET (default 25)
|
||||
|
||||
|
||||
+Name: sunfounder-pipower3
|
||||
+Info: Overlay for SunFounder PiPower 3
|
||||
+Load: dtoverlay=sunfounder-pipower3,<param>=<val>
|
||||
+Params: poweroff_pin Change poweroff pin (default 26)
|
||||
+
|
||||
+
|
||||
Name: sunfounder-pironman5
|
||||
Info: Overlay for SunFounder Pironman 5
|
||||
Load: dtoverlay=sunfounder-pironman5,<param>=<val>
|
||||
Params: ir Enable IR or not (on or off, default on)
|
||||
- ir_pins Change IR receiver pin (default 12)
|
||||
+ ir_pins Change IR receiver pin (default 13)
|
||||
|
||||
|
||||
Name: superaudioboard
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlays/sunfounder-pipower3-overlay.dts
|
||||
@@ -0,0 +1,44 @@
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "brcm,bcm2835";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+ target-path = "/chosen";
|
||||
+ __overlay__ {
|
||||
+ power: power {
|
||||
+ hat_current_supply = <5000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ fragment@1 {
|
||||
+ target = <&i2c1>;
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+ fragment@2 {
|
||||
+ target-path = "/";
|
||||
+ __overlay__ {
|
||||
+ power_ctrl: power_ctrl {
|
||||
+ compatible = "gpio-poweroff";
|
||||
+ gpios = <&gpio 26 0>;
|
||||
+ force;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ fragment@3 {
|
||||
+ target = <&gpio>;
|
||||
+ __overlay__ {
|
||||
+ power_ctrl_pins: power_ctrl_pins {
|
||||
+ brcm,pins = <26>;
|
||||
+ brcm,function = <1>; // out
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ __overrides__ {
|
||||
+ poweroff_pin = <&power_ctrl>,"gpios:4",
|
||||
+ <&power_ctrl_pins>,"brcm,pins:0";
|
||||
+ };
|
||||
+};
|
||||
--- a/arch/arm/boot/dts/overlays/sunfounder-pironman5-overlay.dts
|
||||
+++ b/arch/arm/boot/dts/overlays/sunfounder-pironman5-overlay.dts
|
||||
@@ -2,50 +2,54 @@
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
- compatible = "brcm,bcm2835";
|
||||
+ compatible = "brcm,bcm2835";
|
||||
|
||||
- fragment@0 {
|
||||
- target = <&i2c1>;
|
||||
- __overlay__ {
|
||||
- status = "okay";
|
||||
- };
|
||||
- };
|
||||
- fragment@1 {
|
||||
- target = <&spi0>;
|
||||
- __overlay__ {
|
||||
- status = "okay";
|
||||
- };
|
||||
- };
|
||||
- fragment@2 {
|
||||
- target-path = "/";
|
||||
- __overlay__ {
|
||||
- gpio_ir: ir-receiver@c {
|
||||
- compatible = "gpio-ir-receiver";
|
||||
- pinctrl-names = "default";
|
||||
- pinctrl-0 = <&gpio_ir_pins>;
|
||||
+ fragment@0 {
|
||||
+ target = <&i2c1>;
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+ fragment@1 {
|
||||
+ target = <&spi0>;
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+ fragment@2 {
|
||||
+ target-path = "/";
|
||||
+ __overlay__ {
|
||||
+ gpio_ir: ir-receiver@d {
|
||||
+ compatible = "gpio-ir-receiver";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&gpio_ir_pins>;
|
||||
|
||||
- // pin number, high or low
|
||||
- gpios = <&gpio 12 1>;
|
||||
+ // pin number, high or low
|
||||
+ gpios = <&gpio 13 1>;
|
||||
|
||||
- // parameter for keymap name
|
||||
- linux,rc-map-name = "rc-rc6-mce";
|
||||
+ // parameter for keymap name
|
||||
+ linux,rc-map-name = "rc-rc6-mce";
|
||||
|
||||
- status = "okay";
|
||||
- };
|
||||
- };
|
||||
- };
|
||||
- fragment@3 {
|
||||
- target = <&gpio>;
|
||||
- __overlay__ {
|
||||
- gpio_ir_pins: gpio_ir_pins@c {
|
||||
- brcm,pins = <12>;
|
||||
- brcm,function = <0>;
|
||||
- brcm,pull = <2>;
|
||||
- };
|
||||
- };
|
||||
- };
|
||||
- __overrides__ {
|
||||
- ir = <&gpio_ir>,"status";
|
||||
- ir_pins = <&gpio_ir>,"gpios:4", <&gpio_ir>,"reg:0", <&gpio_ir_pins>,"brcm,pins:0", <&gpio_ir_pins>,"reg:0";
|
||||
- };
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ fragment@3 {
|
||||
+ target = <&gpio>;
|
||||
+ __overlay__ {
|
||||
+ gpio_ir_pins: gpio_ir_pins@d {
|
||||
+ brcm,pins = <13>;
|
||||
+ brcm,function = <0>;
|
||||
+ brcm,pull = <2>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ __overrides__ {
|
||||
+ ir = <&gpio_ir>,"status";
|
||||
+ ir_pins =
|
||||
+ <&gpio_ir>,"gpios:4",
|
||||
+ <&gpio_ir>,"reg:0",
|
||||
+ <&gpio_ir_pins>,"brcm,pins:0",
|
||||
+ <&gpio_ir_pins>,"reg:0";
|
||||
+ };
|
||||
};
|
@ -0,0 +1,32 @@
|
||||
From cd92a9591833ea06d1f12391f6b027fcecf436a9 Mon Sep 17 00:00:00 2001
|
||||
From: Ratchanan Srirattanamet <peathot@hotmail.com>
|
||||
Date: Tue, 18 Jun 2024 15:44:13 +0700
|
||||
Subject: [PATCH 1137/1145] pwm: gpio-pwm: follow pwm_apply_might_sleep()
|
||||
rename
|
||||
|
||||
Fixes: 03286093be68("drivers/gpio: Add a driver that wraps the PWM API as a GPIO controller")
|
||||
Signed-off-by: Ratchanan Srirattanamet <peathot@hotmail.com>
|
||||
---
|
||||
drivers/gpio/gpio-pwm.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/gpio/gpio-pwm.c
|
||||
+++ b/drivers/gpio/gpio-pwm.c
|
||||
@@ -34,7 +34,7 @@ static void pwm_gpio_set(struct gpio_chi
|
||||
|
||||
pwm_get_state(pwm_gpio->pwm[off], &state);
|
||||
state.duty_cycle = val ? state.period : 0;
|
||||
- pwm_apply_state(pwm_gpio->pwm[off], &state);
|
||||
+ pwm_apply_might_sleep(pwm_gpio->pwm[off], &state);
|
||||
}
|
||||
|
||||
static int pwm_gpio_parse_dt(struct pwm_gpio *pwm_gpio,
|
||||
@@ -79,7 +79,7 @@ static int pwm_gpio_parse_dt(struct pwm_
|
||||
pwm_init_state(pwm_gpio->pwm[i], &state);
|
||||
|
||||
state.duty_cycle = 0;
|
||||
- pwm_apply_state(pwm_gpio->pwm[i], &state);
|
||||
+ pwm_apply_might_sleep(pwm_gpio->pwm[i], &state);
|
||||
}
|
||||
|
||||
pwm_gpio->gc.ngpio = num_gpios;
|
@ -0,0 +1,29 @@
|
||||
From da87f91ad8450ccc5274cd7b6ba8d823b396c96f Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Tue, 18 Jun 2024 15:33:30 +0100
|
||||
Subject: [PATCH 1138/1145] drm/bridge: panel: Ensure backlight is reachable
|
||||
|
||||
Ensure that the various options of modules vs builtin results
|
||||
in being able to call into the backlight code.
|
||||
|
||||
https://github.com/raspberrypi/linux/issues/6198
|
||||
|
||||
Fixes: 573f8fd0abf1 ("drm/bridge: panel: Name an associated backlight device")
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/gpu/drm/bridge/panel.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/gpu/drm/bridge/panel.c
|
||||
+++ b/drivers/gpu/drm/bridge/panel.c
|
||||
@@ -87,8 +87,10 @@ static int panel_bridge_attach(struct dr
|
||||
drm_connector_attach_encoder(&panel_bridge->connector,
|
||||
bridge->encoder);
|
||||
|
||||
+#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE)
|
||||
backlight_set_display_name(panel_bridge->panel->backlight,
|
||||
panel_bridge->connector.name);
|
||||
+#endif
|
||||
|
||||
if (bridge->dev->registered) {
|
||||
if (connector->funcs->reset)
|
@ -0,0 +1,36 @@
|
||||
From 7af85d54e39733bb9a236b95ea5ed1ab8277d560 Mon Sep 17 00:00:00 2001
|
||||
From: Dom Cobley <popcornmix@gmail.com>
|
||||
Date: Tue, 11 Jun 2024 16:12:47 +0100
|
||||
Subject: [PATCH 1141/1145] fs/ntfs3: Fix memory corruption when page_size
|
||||
changes
|
||||
|
||||
The rework in fs/ntfs3: Reduce stack usage
|
||||
changes log->page_size but doesn't change the associated
|
||||
log->page_mask and log->page_bits.
|
||||
|
||||
That results in the bytes value in read_log_page
|
||||
getting a negative value, which is bad when it is
|
||||
passed to memcpy.
|
||||
|
||||
The kernel panic can be observed when connecting an
|
||||
ntfs formatted drive that has previously been connected
|
||||
to a Windows machine to a Raspberry Pi 5, which by defauilt
|
||||
uses a 16K kernel pagesize.
|
||||
|
||||
Fixes: 865e7a7700d9 ("fs/ntfs3: Reduce stack usage")
|
||||
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
|
||||
---
|
||||
fs/ntfs3/fslog.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/fs/ntfs3/fslog.c
|
||||
+++ b/fs/ntfs3/fslog.c
|
||||
@@ -3907,6 +3907,8 @@ check_restart_area:
|
||||
log->l_size = log->orig_file_size;
|
||||
log->page_size = norm_file_page(t32, &log->l_size,
|
||||
t32 == DefaultLogPageSize);
|
||||
+ log->page_mask = log->page_size - 1;
|
||||
+ log->page_bits = blksize_bits(log->page_size);
|
||||
}
|
||||
|
||||
if (log->page_size != t32 ||
|
@ -0,0 +1,26 @@
|
||||
From d2813c02131b9ddf938277f4123da7ccbd113ea7 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Mon, 24 Jun 2024 22:35:42 +0100
|
||||
Subject: [PATCH 1142/1145] fixup! drivers: mmc: sdhci-brcmstb: bcm2712
|
||||
supports HS400es and clock gating
|
||||
|
||||
Declaring auto-clockgate support for a host that can interface with
|
||||
SDIO cards is a bug.
|
||||
|
||||
See: https://github.com/raspberrypi/linux/issues/6237
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/mmc/host/sdhci-brcmstb.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/drivers/mmc/host/sdhci-brcmstb.c
|
||||
+++ b/drivers/mmc/host/sdhci-brcmstb.c
|
||||
@@ -429,7 +429,6 @@ static const struct brcmstb_match_priv m
|
||||
};
|
||||
|
||||
static const struct brcmstb_match_priv match_priv_2712 = {
|
||||
- .flags = BRCMSTB_MATCH_FLAGS_HAS_CLOCK_GATE,
|
||||
.hs400es = sdhci_brcmstb_hs400es,
|
||||
.cfginit = sdhci_brcmstb_cfginit_2712,
|
||||
.ops = &sdhci_brcmstb_ops_2712,
|
@ -1,7 +1,7 @@
|
||||
From c6cd3e6878e32548ea90c4160c534e952221c194 Mon Sep 17 00:00:00 2001
|
||||
From 3b42260d2130b5ca110c5340ab2bd055eede5968 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Wed, 28 Apr 2021 17:46:01 +0100
|
||||
Subject: [PATCH 0536/1085] dmaengine: dw-axi-dmac: Fixes for RP1
|
||||
Subject: [PATCH 1144/1145] dmaengine: dw-axi-dmac: Fixes for RP1
|
||||
|
||||
Don't assume that DMA addresses of devices are the same as their
|
||||
physical addresses - convert correctly.
|
||||
@ -42,9 +42,9 @@ to the source register width.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
.../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 132 +++++++++++++++---
|
||||
.../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 136 +++++++++++++++---
|
||||
drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 1 +
|
||||
2 files changed, 113 insertions(+), 20 deletions(-)
|
||||
2 files changed, 116 insertions(+), 21 deletions(-)
|
||||
|
||||
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
|
||||
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
|
||||
@ -93,16 +93,24 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
for (i = 0; i < chip->dw->hdata->nr_channels; i++) {
|
||||
axi_chan_irq_disable(&chip->dw->chan[i], DWAXIDMAC_IRQ_ALL);
|
||||
axi_chan_disable(&chip->dw->chan[i]);
|
||||
@@ -282,7 +305,7 @@ static struct axi_dma_lli *axi_desc_get(
|
||||
@@ -256,7 +279,6 @@ static struct axi_dma_desc *axi_desc_all
|
||||
kfree(desc);
|
||||
return NULL;
|
||||
}
|
||||
- desc->nr_hw_descs = num;
|
||||
|
||||
return desc;
|
||||
}
|
||||
@@ -283,7 +305,7 @@ static struct axi_dma_lli *axi_desc_get(
|
||||
static void axi_desc_put(struct axi_dma_desc *desc)
|
||||
{
|
||||
struct axi_dma_chan *chan = desc->chan;
|
||||
- int count = atomic_read(&chan->descs_allocated);
|
||||
- int count = desc->nr_hw_descs;
|
||||
+ u32 count = desc->hw_desc_count;
|
||||
struct axi_dma_hw_desc *hw_desc;
|
||||
int descs_put;
|
||||
|
||||
@@ -304,6 +327,48 @@ static void vchan_desc_put(struct virt_d
|
||||
@@ -305,6 +327,48 @@ static void vchan_desc_put(struct virt_d
|
||||
axi_desc_put(vd_to_axi_desc(vdesc));
|
||||
}
|
||||
|
||||
@ -151,7 +159,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
static enum dma_status
|
||||
dma_chan_tx_status(struct dma_chan *dchan, dma_cookie_t cookie,
|
||||
struct dma_tx_state *txstate)
|
||||
@@ -313,10 +378,7 @@ dma_chan_tx_status(struct dma_chan *dcha
|
||||
@@ -314,10 +378,7 @@ dma_chan_tx_status(struct dma_chan *dcha
|
||||
enum dma_status status;
|
||||
u32 completed_length;
|
||||
unsigned long flags;
|
||||
@ -162,7 +170,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
status = dma_cookie_status(dchan, cookie, txstate);
|
||||
if (status == DMA_COMPLETE || !txstate)
|
||||
@@ -325,16 +387,31 @@ dma_chan_tx_status(struct dma_chan *dcha
|
||||
@@ -326,16 +387,31 @@ dma_chan_tx_status(struct dma_chan *dcha
|
||||
spin_lock_irqsave(&chan->vc.lock, flags);
|
||||
|
||||
vdesc = vchan_find_desc(&chan->vc, cookie);
|
||||
@ -201,7 +209,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -522,7 +599,7 @@ static void dw_axi_dma_set_hw_channel(st
|
||||
@@ -521,7 +597,7 @@ static void dw_axi_dma_set_hw_channel(st
|
||||
unsigned long reg_value, val;
|
||||
|
||||
if (!chip->apb_regs) {
|
||||
@ -210,7 +218,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -626,18 +703,25 @@ static int dw_axi_dma_set_hw_desc(struct
|
||||
@@ -625,18 +701,25 @@ static int dw_axi_dma_set_hw_desc(struct
|
||||
switch (chan->direction) {
|
||||
case DMA_MEM_TO_DEV:
|
||||
reg_width = __ffs(chan->config.dst_addr_width);
|
||||
@ -238,7 +246,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
DWAXIDMAC_CH_CTL_L_INC << CH_CTL_L_DST_INC_POS |
|
||||
DWAXIDMAC_CH_CTL_L_NOINC << CH_CTL_L_SRC_INC_POS;
|
||||
block_ts = len >> reg_width;
|
||||
@@ -673,9 +757,6 @@ static int dw_axi_dma_set_hw_desc(struct
|
||||
@@ -672,9 +755,6 @@ static int dw_axi_dma_set_hw_desc(struct
|
||||
}
|
||||
|
||||
hw_desc->lli->block_ts_lo = cpu_to_le32(block_ts - 1);
|
||||
@ -248,7 +256,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
hw_desc->lli->ctl_lo = cpu_to_le32(ctllo);
|
||||
|
||||
set_desc_src_master(hw_desc);
|
||||
@@ -770,6 +851,8 @@ dw_axi_dma_chan_prep_cyclic(struct dma_c
|
||||
@@ -769,6 +849,8 @@ dw_axi_dma_chan_prep_cyclic(struct dma_c
|
||||
src_addr += segment_len;
|
||||
}
|
||||
|
||||
@ -257,7 +265,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
llp = desc->hw_desc[0].llp;
|
||||
|
||||
/* Managed transfer list */
|
||||
@@ -849,6 +932,8 @@ dw_axi_dma_chan_prep_slave_sg(struct dma
|
||||
@@ -851,6 +933,8 @@ dw_axi_dma_chan_prep_slave_sg(struct dma
|
||||
} while (len >= segment_len);
|
||||
}
|
||||
|
||||
@ -266,7 +274,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
/* Set end-of-link to the last link descriptor of list */
|
||||
set_desc_last(&desc->hw_desc[num_sgs - 1]);
|
||||
|
||||
@@ -956,6 +1041,8 @@ dma_chan_prep_dma_memcpy(struct dma_chan
|
||||
@@ -958,6 +1042,8 @@ dma_chan_prep_dma_memcpy(struct dma_chan
|
||||
num++;
|
||||
}
|
||||
|
||||
@ -275,7 +283,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
/* Set end-of-link to the last link descriptor of list */
|
||||
set_desc_last(&desc->hw_desc[num - 1]);
|
||||
/* Managed transfer list */
|
||||
@@ -1004,7 +1091,7 @@ static void axi_chan_dump_lli(struct axi
|
||||
@@ -1006,7 +1092,7 @@ static void axi_chan_dump_lli(struct axi
|
||||
static void axi_chan_list_dump_lli(struct axi_dma_chan *chan,
|
||||
struct axi_dma_desc *desc_head)
|
||||
{
|
||||
@ -284,7 +292,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
int i;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
@@ -1047,11 +1134,11 @@ out:
|
||||
@@ -1049,11 +1135,11 @@ out:
|
||||
|
||||
static void axi_chan_block_xfer_complete(struct axi_dma_chan *chan)
|
||||
{
|
||||
@ -297,7 +305,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
u64 llp;
|
||||
int i;
|
||||
|
||||
@@ -1073,6 +1160,7 @@ static void axi_chan_block_xfer_complete
|
||||
@@ -1075,6 +1161,7 @@ static void axi_chan_block_xfer_complete
|
||||
if (chan->cyclic) {
|
||||
desc = vd_to_axi_desc(vd);
|
||||
if (desc) {
|
||||
@ -305,7 +313,17 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
llp = lo_hi_readq(chan->chan_regs + CH_LLP);
|
||||
for (i = 0; i < count; i++) {
|
||||
hw_desc = &desc->hw_desc[i];
|
||||
@@ -1325,6 +1413,10 @@ static int parse_device_properties(struc
|
||||
@@ -1095,6 +1182,9 @@ static void axi_chan_block_xfer_complete
|
||||
/* Remove the completed descriptor from issued list before completing */
|
||||
list_del(&vd->node);
|
||||
vchan_cookie_complete(vd);
|
||||
+
|
||||
+ /* Submit queued descriptors after processing the completed ones */
|
||||
+ axi_chan_start_first_queued(chan);
|
||||
}
|
||||
|
||||
out:
|
||||
@@ -1324,6 +1414,10 @@ static int parse_device_properties(struc
|
||||
|
||||
chip->dw->hdata->nr_masters = tmp;
|
||||
|
@ -0,0 +1,89 @@
|
||||
From 769634f344626ed73bcda14c91b567067974d7b2 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Sat, 29 Jun 2024 09:30:23 +0100
|
||||
Subject: [PATCH 1145/1145] fixup! dmaengine: dw-axi-dmac: Fixes for RP1
|
||||
|
||||
nr_hw_descs is the upstream version of what count_hw_descs, so make
|
||||
(more) use of it instead.
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 14 +++++++-------
|
||||
drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 1 -
|
||||
2 files changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
|
||||
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
|
||||
@@ -305,7 +305,7 @@ static struct axi_dma_lli *axi_desc_get(
|
||||
static void axi_desc_put(struct axi_dma_desc *desc)
|
||||
{
|
||||
struct axi_dma_chan *chan = desc->chan;
|
||||
- u32 count = desc->hw_desc_count;
|
||||
+ int count = desc->nr_hw_descs;
|
||||
struct axi_dma_hw_desc *hw_desc;
|
||||
int descs_put;
|
||||
|
||||
@@ -849,7 +849,7 @@ dw_axi_dma_chan_prep_cyclic(struct dma_c
|
||||
src_addr += segment_len;
|
||||
}
|
||||
|
||||
- desc->hw_desc_count = total_segments;
|
||||
+ desc->nr_hw_descs = total_segments;
|
||||
|
||||
llp = desc->hw_desc[0].llp;
|
||||
|
||||
@@ -933,7 +933,7 @@ dw_axi_dma_chan_prep_slave_sg(struct dma
|
||||
} while (len >= segment_len);
|
||||
}
|
||||
|
||||
- desc->hw_desc_count = loop;
|
||||
+ desc->nr_hw_descs = loop;
|
||||
|
||||
/* Set end-of-link to the last link descriptor of list */
|
||||
set_desc_last(&desc->hw_desc[num_sgs - 1]);
|
||||
@@ -1042,7 +1042,7 @@ dma_chan_prep_dma_memcpy(struct dma_chan
|
||||
num++;
|
||||
}
|
||||
|
||||
- desc->hw_desc_count = num;
|
||||
+ desc->nr_hw_descs = num;
|
||||
|
||||
/* Set end-of-link to the last link descriptor of list */
|
||||
set_desc_last(&desc->hw_desc[num - 1]);
|
||||
@@ -1092,7 +1092,7 @@ static void axi_chan_dump_lli(struct axi
|
||||
static void axi_chan_list_dump_lli(struct axi_dma_chan *chan,
|
||||
struct axi_dma_desc *desc_head)
|
||||
{
|
||||
- u32 count = desc_head->hw_desc_count;
|
||||
+ int count = desc_head->nr_hw_descs;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
@@ -1139,7 +1139,7 @@ static void axi_chan_block_xfer_complete
|
||||
struct axi_dma_desc *desc;
|
||||
struct virt_dma_desc *vd;
|
||||
unsigned long flags;
|
||||
- u32 count;
|
||||
+ int count;
|
||||
u64 llp;
|
||||
int i;
|
||||
|
||||
@@ -1161,7 +1161,7 @@ static void axi_chan_block_xfer_complete
|
||||
if (chan->cyclic) {
|
||||
desc = vd_to_axi_desc(vd);
|
||||
if (desc) {
|
||||
- count = desc->hw_desc_count;
|
||||
+ count = desc->nr_hw_descs;
|
||||
llp = lo_hi_readq(chan->chan_regs + CH_LLP);
|
||||
for (i = 0; i < count; i++) {
|
||||
hw_desc = &desc->hw_desc[i];
|
||||
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac.h
|
||||
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h
|
||||
@@ -101,7 +101,6 @@ struct axi_dma_desc {
|
||||
|
||||
struct virt_dma_desc vd;
|
||||
struct axi_dma_chan *chan;
|
||||
- u32 hw_desc_count;
|
||||
u32 completed_blocks;
|
||||
u32 length;
|
||||
u32 period_len;
|
@ -10,8 +10,7 @@ BOARDNAME:=Broadcom BCM47xx/53xx (MIPS)
|
||||
FEATURES:=squashfs usb
|
||||
SUBTARGETS:=generic mips74k legacy
|
||||
|
||||
KERNEL_PATCHVER:=6.1
|
||||
KERNEL_TESTING_PATCHVER:=6.6
|
||||
KERNEL_PATCHVER:=6.6
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS CPU, *not* ARM.
|
||||
|
@ -1,190 +0,0 @@
|
||||
CONFIG_ARCH_32BIT_OFF_T=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=15
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_BCM47XX=y
|
||||
CONFIG_BCM47XX_BCMA=y
|
||||
CONFIG_BCM47XX_NVRAM=y
|
||||
CONFIG_BCM47XX_SPROM=y
|
||||
CONFIG_BCM47XX_SSB=y
|
||||
CONFIG_BCM47XX_WDT=y
|
||||
CONFIG_BCMA=y
|
||||
CONFIG_BCMA_BLOCKIO=y
|
||||
CONFIG_BCMA_DEBUG=y
|
||||
CONFIG_BCMA_DRIVER_GMAC_CMN=y
|
||||
CONFIG_BCMA_DRIVER_GPIO=y
|
||||
CONFIG_BCMA_DRIVER_MIPS=y
|
||||
CONFIG_BCMA_DRIVER_PCI=y
|
||||
CONFIG_BCMA_DRIVER_PCI_HOSTMODE=y
|
||||
CONFIG_BCMA_FALLBACK_SPROM=y
|
||||
CONFIG_BCMA_HOST_PCI=y
|
||||
CONFIG_BCMA_HOST_PCI_POSSIBLE=y
|
||||
CONFIG_BCMA_HOST_SOC=y
|
||||
CONFIG_BCMA_NFLASH=y
|
||||
CONFIG_BCMA_PFLASH=y
|
||||
CONFIG_BCMA_SFLASH=y
|
||||
# CONFIG_BGMAC_BCMA is not set
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
|
||||
CONFIG_CC_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_CEVT_R4K=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_CMDLINE="noinitrd console=ttyS0,115200"
|
||||
CONFIG_CMDLINE_BOOL=y
|
||||
# CONFIG_CMDLINE_OVERRIDE is not set
|
||||
# CONFIG_COMMON_CLK is not set
|
||||
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
|
||||
CONFIG_COMPAT_32BIT_TIME=y
|
||||
# CONFIG_CPU_BMIPS is not set
|
||||
CONFIG_CPU_GENERIC_DUMP_TLB=y
|
||||
CONFIG_CPU_HAS_PREFETCH=y
|
||||
CONFIG_CPU_HAS_SYNC=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_MIPS32=y
|
||||
CONFIG_CPU_MIPS32_R1=y
|
||||
# CONFIG_CPU_MIPS32_R2 is not set
|
||||
CONFIG_CPU_MIPSR1=y
|
||||
CONFIG_CPU_MIPSR2_IRQ_VI=y
|
||||
CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
|
||||
CONFIG_CPU_R4K_CACHE_TLB=y
|
||||
CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
|
||||
CONFIG_CPU_SUPPORTS_HIGHMEM=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2
|
||||
CONFIG_CRYPTO_LIB_SHA1=y
|
||||
CONFIG_CRYPTO_LIB_UTILS=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CSRC_R4K=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DMA_NONCOHERENT=y
|
||||
# CONFIG_EARLY_PRINTK is not set
|
||||
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_FW_LOADER_SYSFS=y
|
||||
CONFIG_GCC11_NO_ARRAY_BOUNDS=y
|
||||
CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y
|
||||
CONFIG_GENERIC_ATOMIC64=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CMOS_UPDATE=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IOMAP=y
|
||||
CONFIG_GENERIC_IRQ_CHIP=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_LIB_ASHLDI3=y
|
||||
CONFIG_GENERIC_LIB_ASHRDI3=y
|
||||
CONFIG_GENERIC_LIB_CMPDI2=y
|
||||
CONFIG_GENERIC_LIB_LSHRDI3=y
|
||||
CONFIG_GENERIC_LIB_UCMPDI2=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_WDT=y
|
||||
CONFIG_HARDWARE_WATCHPOINTS=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HZ_PERIODIC=y
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_MIPS_CPU=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_LEDS_GPIO_REGISTER=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MIPS=y
|
||||
CONFIG_MIPS_ASID_BITS=8
|
||||
CONFIG_MIPS_ASID_SHIFT=0
|
||||
CONFIG_MIPS_CLOCK_VSYSCALL=y
|
||||
# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
|
||||
CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
|
||||
CONFIG_MIPS_L1_CACHE_SHIFT=5
|
||||
CONFIG_MIPS_LD_CAN_LINK_VDSO=y
|
||||
CONFIG_MODULES_USE_ELF_REL=y
|
||||
CONFIG_MTD_BCM47XXSFLASH=y
|
||||
CONFIG_MTD_BCM47XX_PARTS=y
|
||||
CONFIG_MTD_NAND_BCM47XXNFLASH=y
|
||||
CONFIG_MTD_NAND_BRCMNAND=y
|
||||
CONFIG_MTD_NAND_BRCMNAND_BCMA=y
|
||||
CONFIG_MTD_NAND_CORE=y
|
||||
CONFIG_MTD_NAND_ECC=y
|
||||
CONFIG_MTD_PARSER_TRX=y
|
||||
CONFIG_MTD_PHYSMAP=y
|
||||
CONFIG_MTD_RAW_NAND=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_PER_CPU_KM=y
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
CONFIG_NO_EXCEPT_FILL=y
|
||||
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
|
||||
# CONFIG_OF is not set
|
||||
CONFIG_PAGE_POOL=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_DRIVERS_LEGACY=y
|
||||
CONFIG_PERF_USE_VMALLOC=y
|
||||
CONFIG_PGTABLE_LEVELS=2
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PREEMPT_NONE_BUILD=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_RANDSTRUCT_NONE=y
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SRCU=y
|
||||
CONFIG_SSB=y
|
||||
CONFIG_SSB_B43_PCI_BRIDGE=y
|
||||
CONFIG_SSB_BLOCKIO=y
|
||||
CONFIG_SSB_DRIVER_EXTIF=y
|
||||
CONFIG_SSB_DRIVER_GIGE=y
|
||||
CONFIG_SSB_DRIVER_GPIO=y
|
||||
CONFIG_SSB_DRIVER_MIPS=y
|
||||
CONFIG_SSB_DRIVER_PCICORE=y
|
||||
CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
|
||||
CONFIG_SSB_EMBEDDED=y
|
||||
CONFIG_SSB_FALLBACK_SPROM=y
|
||||
CONFIG_SSB_HOST_SOC=y
|
||||
CONFIG_SSB_PCICORE_HOSTMODE=y
|
||||
CONFIG_SSB_PCIHOST=y
|
||||
CONFIG_SSB_PCIHOST_POSSIBLE=y
|
||||
CONFIG_SSB_SERIAL=y
|
||||
CONFIG_SSB_SFLASH=y
|
||||
CONFIG_SSB_SPROM=y
|
||||
CONFIG_SWCONFIG=y
|
||||
CONFIG_SWCONFIG_B53=y
|
||||
CONFIG_SWCONFIG_B53_PHY_DRIVER=y
|
||||
CONFIG_SWCONFIG_B53_PHY_FIXUP=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
CONFIG_SYS_HAS_CPU_BMIPS=y
|
||||
CONFIG_SYS_HAS_CPU_BMIPS32_3300=y
|
||||
CONFIG_SYS_HAS_CPU_MIPS32_R1=y
|
||||
CONFIG_SYS_HAS_CPU_MIPS32_R2=y
|
||||
CONFIG_SYS_HAS_EARLY_PRINTK=y
|
||||
CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
|
||||
CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
|
||||
CONFIG_SYS_SUPPORTS_HIGHMEM=y
|
||||
CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
|
||||
CONFIG_SYS_SUPPORTS_MIPS16=y
|
||||
CONFIG_SYS_SUPPORTS_ZBOOT=y
|
||||
CONFIG_TARGET_ISA_REV=1
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TINY_SRCU=y
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_USE_GENERIC_EARLY_PRINTK_8250=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_ZBOOT_LOAD_ADDRESS=0xffffffff80400000
|
@ -1,65 +0,0 @@
|
||||
From fc605b914167de75432c3b5aae239fb191e84a31 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Wed, 8 Feb 2023 08:03:01 +0100
|
||||
Subject: [PATCH] MIPS: BCM47XX: Add support for Linksys E2500 V3
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It's a BCM5358 based home WiFi router. 16 MiB flash, 64 MiB RAM, BCM5325
|
||||
switch, on-SoC 802.11n radio.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
|
||||
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||
---
|
||||
arch/mips/bcm47xx/board.c | 1 +
|
||||
arch/mips/bcm47xx/buttons.c | 9 +++++++++
|
||||
arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
|
||||
3 files changed, 11 insertions(+)
|
||||
|
||||
--- a/arch/mips/bcm47xx/board.c
|
||||
+++ b/arch/mips/bcm47xx/board.c
|
||||
@@ -130,6 +130,7 @@ struct bcm47xx_board_type_list2 bcm47xx_
|
||||
{{BCM47XX_BOARD_LINKSYS_E1000V21, "Linksys E1000 V2.1"}, "E1000", "2.1"},
|
||||
{{BCM47XX_BOARD_LINKSYS_E1200V2, "Linksys E1200 V2"}, "E1200", "2.0"},
|
||||
{{BCM47XX_BOARD_LINKSYS_E2000V1, "Linksys E2000 V1"}, "Linksys E2000", "1.0"},
|
||||
+ {{BCM47XX_BOARD_LINKSYS_E2500V3, "Linksys E2500 V3"}, "E2500", "1.0"},
|
||||
/* like WRT610N v2.0 */
|
||||
{{BCM47XX_BOARD_LINKSYS_E3000V1, "Linksys E3000 V1"}, "E300", "1.0"},
|
||||
{{BCM47XX_BOARD_LINKSYS_E3200V1, "Linksys E3200 V1"}, "E3200", "1.0"},
|
||||
--- a/arch/mips/bcm47xx/buttons.c
|
||||
+++ b/arch/mips/bcm47xx/buttons.c
|
||||
@@ -223,6 +223,12 @@ bcm47xx_buttons_linksys_e2000v1[] __init
|
||||
};
|
||||
|
||||
static const struct gpio_keys_button
|
||||
+bcm47xx_buttons_linksys_e2500v3[] __initconst = {
|
||||
+ BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON),
|
||||
+ BCM47XX_GPIO_KEY(10, KEY_RESTART),
|
||||
+};
|
||||
+
|
||||
+static const struct gpio_keys_button
|
||||
bcm47xx_buttons_linksys_e3000v1[] __initconst = {
|
||||
BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
|
||||
BCM47XX_GPIO_KEY(6, KEY_RESTART),
|
||||
@@ -617,6 +623,9 @@ int __init bcm47xx_buttons_register(void
|
||||
case BCM47XX_BOARD_LINKSYS_E2000V1:
|
||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2000v1);
|
||||
break;
|
||||
+ case BCM47XX_BOARD_LINKSYS_E2500V3:
|
||||
+ err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2500v3);
|
||||
+ break;
|
||||
case BCM47XX_BOARD_LINKSYS_E3000V1:
|
||||
err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3000v1);
|
||||
break;
|
||||
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||
@@ -61,6 +61,7 @@ enum bcm47xx_board {
|
||||
BCM47XX_BOARD_LINKSYS_E1000V21,
|
||||
BCM47XX_BOARD_LINKSYS_E1200V2,
|
||||
BCM47XX_BOARD_LINKSYS_E2000V1,
|
||||
+ BCM47XX_BOARD_LINKSYS_E2500V3,
|
||||
BCM47XX_BOARD_LINKSYS_E3000V1,
|
||||
BCM47XX_BOARD_LINKSYS_E3200V1,
|
||||
BCM47XX_BOARD_LINKSYS_E4200V1,
|
@ -1,61 +0,0 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Mon, 27 Feb 2023 07:44:38 +0100
|
||||
Subject: [PATCH] MIPS: BCM47XX: Add support for Huawei B593u-12
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It's a BCM5358 based home router. One of very few bcm47xx devices with
|
||||
cellular modems (here: LTE).
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
arch/mips/bcm47xx/board.c | 1 +
|
||||
arch/mips/bcm47xx/leds.c | 8 ++++++++
|
||||
arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
|
||||
3 files changed, 10 insertions(+)
|
||||
|
||||
--- a/arch/mips/bcm47xx/board.c
|
||||
+++ b/arch/mips/bcm47xx/board.c
|
||||
@@ -193,6 +193,7 @@ struct bcm47xx_board_type_list1 bcm47xx_
|
||||
/* boardtype, boardnum, boardrev */
|
||||
static const
|
||||
struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = {
|
||||
+ {{BCM47XX_BOARD_HUAWEI_B593U_12, "Huawei B593u-12"}, "0x053d", "1234", "0x1301"},
|
||||
{{BCM47XX_BOARD_HUAWEI_E970, "Huawei E970"}, "0x048e", "0x5347", "0x11"},
|
||||
{{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"},
|
||||
{{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"},
|
||||
--- a/arch/mips/bcm47xx/leds.c
|
||||
+++ b/arch/mips/bcm47xx/leds.c
|
||||
@@ -223,6 +223,11 @@ bcm47xx_leds_dlink_dir330[] __initconst
|
||||
/* Huawei */
|
||||
|
||||
static const struct gpio_led
|
||||
+bcm47xx_leds_huawei_b593u_12[] __initconst = {
|
||||
+ BCM47XX_GPIO_LED(5, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||
+};
|
||||
+
|
||||
+static const struct gpio_led
|
||||
bcm47xx_leds_huawei_e970[] __initconst = {
|
||||
BCM47XX_GPIO_LED(0, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
|
||||
};
|
||||
@@ -672,6 +677,9 @@ void __init bcm47xx_leds_register(void)
|
||||
bcm47xx_set_pdata(bcm47xx_leds_dlink_dir330);
|
||||
break;
|
||||
|
||||
+ case BCM47XX_BOARD_HUAWEI_B593U_12:
|
||||
+ bcm47xx_set_pdata(bcm47xx_leds_huawei_b593u_12);
|
||||
+ break;
|
||||
case BCM47XX_BOARD_HUAWEI_E970:
|
||||
bcm47xx_set_pdata(bcm47xx_leds_huawei_e970);
|
||||
break;
|
||||
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
|
||||
@@ -53,6 +53,7 @@ enum bcm47xx_board {
|
||||
BCM47XX_BOARD_DLINK_DIR130,
|
||||
BCM47XX_BOARD_DLINK_DIR330,
|
||||
|
||||
+ BCM47XX_BOARD_HUAWEI_B593U_12,
|
||||
BCM47XX_BOARD_HUAWEI_E970,
|
||||
|
||||
BCM47XX_BOARD_LINKSYS_E900V1,
|
@ -1,484 +0,0 @@
|
||||
--- a/arch/mips/include/asm/r4kcache.h
|
||||
+++ b/arch/mips/include/asm/r4kcache.h
|
||||
@@ -27,6 +27,38 @@
|
||||
extern void (*r4k_blast_dcache)(void);
|
||||
extern void (*r4k_blast_icache)(void);
|
||||
|
||||
+#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2)
|
||||
+#include <asm/paccess.h>
|
||||
+#include <linux/ssb/ssb.h>
|
||||
+#define BCM4710_DUMMY_RREG() bcm4710_dummy_rreg()
|
||||
+
|
||||
+static inline unsigned long bcm4710_dummy_rreg(void)
|
||||
+{
|
||||
+ return *(volatile unsigned long *)(KSEG1ADDR(SSB_ENUM_BASE));
|
||||
+}
|
||||
+
|
||||
+#define BCM4710_FILL_TLB(addr) bcm4710_fill_tlb((void *)(addr))
|
||||
+
|
||||
+static inline unsigned long bcm4710_fill_tlb(void *addr)
|
||||
+{
|
||||
+ return *(unsigned long *)addr;
|
||||
+}
|
||||
+
|
||||
+#define BCM4710_PROTECTED_FILL_TLB(addr) bcm4710_protected_fill_tlb((void *)(addr))
|
||||
+
|
||||
+static inline void bcm4710_protected_fill_tlb(void *addr)
|
||||
+{
|
||||
+ unsigned long x;
|
||||
+ get_dbe(x, (unsigned long *)addr);;
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+#define BCM4710_DUMMY_RREG()
|
||||
+
|
||||
+#define BCM4710_FILL_TLB(addr)
|
||||
+#define BCM4710_PROTECTED_FILL_TLB(addr)
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* This macro return a properly sign-extended address suitable as base address
|
||||
* for indexed cache operations. Two issues here:
|
||||
@@ -60,6 +92,7 @@ static inline void flush_icache_line_ind
|
||||
|
||||
static inline void flush_dcache_line_indexed(unsigned long addr)
|
||||
{
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
cache_op(Index_Writeback_Inv_D, addr);
|
||||
}
|
||||
|
||||
@@ -83,11 +116,13 @@ static inline void flush_icache_line(uns
|
||||
|
||||
static inline void flush_dcache_line(unsigned long addr)
|
||||
{
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
cache_op(Hit_Writeback_Inv_D, addr);
|
||||
}
|
||||
|
||||
static inline void invalidate_dcache_line(unsigned long addr)
|
||||
{
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
cache_op(Hit_Invalidate_D, addr);
|
||||
}
|
||||
|
||||
@@ -160,6 +195,7 @@ static inline int protected_flush_icache
|
||||
return protected_cache_op(Hit_Invalidate_I_Loongson2, addr);
|
||||
|
||||
default:
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
return protected_cache_op(Hit_Invalidate_I, addr);
|
||||
}
|
||||
}
|
||||
@@ -172,6 +208,7 @@ static inline int protected_flush_icache
|
||||
*/
|
||||
static inline int protected_writeback_dcache_line(unsigned long addr)
|
||||
{
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
return protected_cache_op(Hit_Writeback_Inv_D, addr);
|
||||
}
|
||||
|
||||
@@ -193,8 +230,51 @@ static inline void invalidate_tcache_pag
|
||||
unroll(times, _cache_op, insn, op, (addr) + (i++ * (lsize))); \
|
||||
} while (0)
|
||||
|
||||
+static inline void blast_dcache(void)
|
||||
+{
|
||||
+ unsigned long start = KSEG0;
|
||||
+ unsigned long dcache_size = current_cpu_data.dcache.waysize * current_cpu_data.dcache.ways;
|
||||
+ unsigned long end = (start + dcache_size);
|
||||
+
|
||||
+ do {
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
+ cache_op(Index_Writeback_Inv_D, start);
|
||||
+ start += current_cpu_data.dcache.linesz;
|
||||
+ } while(start < end);
|
||||
+}
|
||||
+
|
||||
+static inline void blast_dcache_page(unsigned long page)
|
||||
+{
|
||||
+ unsigned long start = page;
|
||||
+ unsigned long end = start + PAGE_SIZE;
|
||||
+
|
||||
+ BCM4710_FILL_TLB(start);
|
||||
+ do {
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
+ cache_op(Hit_Writeback_Inv_D, start);
|
||||
+ start += current_cpu_data.dcache.linesz;
|
||||
+ } while(start < end);
|
||||
+}
|
||||
+
|
||||
+static inline void blast_dcache_page_indexed(unsigned long page)
|
||||
+{
|
||||
+ unsigned long start = page;
|
||||
+ unsigned long end = start + PAGE_SIZE;
|
||||
+ unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;
|
||||
+ unsigned long ws_end = current_cpu_data.dcache.ways <<
|
||||
+ current_cpu_data.dcache.waybit;
|
||||
+ unsigned long ws, addr;
|
||||
+ for (ws = 0; ws < ws_end; ws += ws_inc) {
|
||||
+ start = page + ws;
|
||||
+ for (addr = start; addr < end; addr += current_cpu_data.dcache.linesz) {
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
+ cache_op(Index_Writeback_Inv_D, addr);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* build blast_xxx, blast_xxx_page, blast_xxx_page_indexed */
|
||||
-#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra) \
|
||||
+#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra, war) \
|
||||
static inline void extra##blast_##pfx##cache##lsize(void) \
|
||||
{ \
|
||||
unsigned long start = INDEX_BASE; \
|
||||
@@ -204,6 +284,7 @@ static inline void extra##blast_##pfx##c
|
||||
current_cpu_data.desc.waybit; \
|
||||
unsigned long ws, addr; \
|
||||
\
|
||||
+ war \
|
||||
for (ws = 0; ws < ws_end; ws += ws_inc) \
|
||||
for (addr = start; addr < end; addr += lsize * 32) \
|
||||
cache_unroll(32, kernel_cache, indexop, \
|
||||
@@ -215,6 +296,7 @@ static inline void extra##blast_##pfx##c
|
||||
unsigned long start = page; \
|
||||
unsigned long end = page + PAGE_SIZE; \
|
||||
\
|
||||
+ war \
|
||||
do { \
|
||||
cache_unroll(32, kernel_cache, hitop, start, lsize); \
|
||||
start += lsize * 32; \
|
||||
@@ -231,32 +313,33 @@ static inline void extra##blast_##pfx##c
|
||||
current_cpu_data.desc.waybit; \
|
||||
unsigned long ws, addr; \
|
||||
\
|
||||
+ war \
|
||||
for (ws = 0; ws < ws_end; ws += ws_inc) \
|
||||
for (addr = start; addr < end; addr += lsize * 32) \
|
||||
cache_unroll(32, kernel_cache, indexop, \
|
||||
addr | ws, lsize); \
|
||||
}
|
||||
|
||||
-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, )
|
||||
-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, )
|
||||
-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, )
|
||||
-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, )
|
||||
-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, )
|
||||
-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_)
|
||||
-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, )
|
||||
-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, )
|
||||
-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, )
|
||||
-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, )
|
||||
-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, )
|
||||
-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, )
|
||||
-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, )
|
||||
-
|
||||
-__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, )
|
||||
-__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, )
|
||||
-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, )
|
||||
-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, )
|
||||
-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, )
|
||||
-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, )
|
||||
+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, , )
|
||||
+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, , BCM4710_FILL_TLB(start);)
|
||||
+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, , )
|
||||
+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, , )
|
||||
+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, , BCM4710_FILL_TLB(start);)
|
||||
+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_, BCM4710_FILL_TLB(start);)
|
||||
+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, , )
|
||||
+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, , )
|
||||
+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, , BCM4710_FILL_TLB(start);)
|
||||
+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, , )
|
||||
+__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, , )
|
||||
+__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, , )
|
||||
+__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, , )
|
||||
+
|
||||
+__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, , )
|
||||
+__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, , )
|
||||
+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, , )
|
||||
+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, , )
|
||||
+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, , )
|
||||
+__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, , )
|
||||
|
||||
#define __BUILD_BLAST_USER_CACHE(pfx, desc, indexop, hitop, lsize) \
|
||||
static inline void blast_##pfx##cache##lsize##_user_page(unsigned long page) \
|
||||
@@ -281,65 +364,36 @@ __BUILD_BLAST_USER_CACHE(d, dcache, Inde
|
||||
__BUILD_BLAST_USER_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
|
||||
|
||||
/* build blast_xxx_range, protected_blast_xxx_range */
|
||||
-#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra) \
|
||||
+#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra, war, war2) \
|
||||
static inline void prot##extra##blast_##pfx##cache##_range(unsigned long start, \
|
||||
unsigned long end) \
|
||||
{ \
|
||||
unsigned long lsize = cpu_##desc##_line_size(); \
|
||||
- unsigned long lsize_2 = lsize * 2; \
|
||||
- unsigned long lsize_3 = lsize * 3; \
|
||||
- unsigned long lsize_4 = lsize * 4; \
|
||||
- unsigned long lsize_5 = lsize * 5; \
|
||||
- unsigned long lsize_6 = lsize * 6; \
|
||||
- unsigned long lsize_7 = lsize * 7; \
|
||||
- unsigned long lsize_8 = lsize * 8; \
|
||||
unsigned long addr = start & ~(lsize - 1); \
|
||||
- unsigned long aend = (end + lsize - 1) & ~(lsize - 1); \
|
||||
- int lines = (aend - addr) / lsize; \
|
||||
- \
|
||||
- while (lines >= 8) { \
|
||||
- prot##cache_op(hitop, addr); \
|
||||
- prot##cache_op(hitop, addr + lsize); \
|
||||
- prot##cache_op(hitop, addr + lsize_2); \
|
||||
- prot##cache_op(hitop, addr + lsize_3); \
|
||||
- prot##cache_op(hitop, addr + lsize_4); \
|
||||
- prot##cache_op(hitop, addr + lsize_5); \
|
||||
- prot##cache_op(hitop, addr + lsize_6); \
|
||||
- prot##cache_op(hitop, addr + lsize_7); \
|
||||
- addr += lsize_8; \
|
||||
- lines -= 8; \
|
||||
- } \
|
||||
+ unsigned long aend = (end - 1) & ~(lsize - 1); \
|
||||
\
|
||||
- if (lines & 0x4) { \
|
||||
- prot##cache_op(hitop, addr); \
|
||||
- prot##cache_op(hitop, addr + lsize); \
|
||||
- prot##cache_op(hitop, addr + lsize_2); \
|
||||
- prot##cache_op(hitop, addr + lsize_3); \
|
||||
- addr += lsize_4; \
|
||||
- } \
|
||||
- \
|
||||
- if (lines & 0x2) { \
|
||||
- prot##cache_op(hitop, addr); \
|
||||
- prot##cache_op(hitop, addr + lsize); \
|
||||
- addr += lsize_2; \
|
||||
- } \
|
||||
+ war \
|
||||
\
|
||||
- if (lines & 0x1) { \
|
||||
+ while (1) { \
|
||||
+ war2 \
|
||||
prot##cache_op(hitop, addr); \
|
||||
+ if (addr == aend) \
|
||||
+ break; \
|
||||
+ addr += lsize; \
|
||||
} \
|
||||
}
|
||||
|
||||
-__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, )
|
||||
-__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, )
|
||||
-__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, )
|
||||
+__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, , BCM4710_PROTECTED_FILL_TLB(addr); BCM4710_PROTECTED_FILL_TLB(aend);, BCM4710_DUMMY_RREG();)
|
||||
+__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, , , )
|
||||
+__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, , , )
|
||||
__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson2, \
|
||||
- protected_, loongson2_)
|
||||
-__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , )
|
||||
-__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , )
|
||||
-__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , )
|
||||
+ protected_, loongson2_, , )
|
||||
+__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , , BCM4710_FILL_TLB(addr); BCM4710_FILL_TLB(aend);, BCM4710_DUMMY_RREG();)
|
||||
+__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , , , )
|
||||
+__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , , , )
|
||||
/* blast_inv_dcache_range */
|
||||
-__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , )
|
||||
-__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , )
|
||||
+__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , , , BCM4710_DUMMY_RREG();)
|
||||
+__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , , , )
|
||||
|
||||
/* Currently, this is very specific to Loongson-3 */
|
||||
#define __BUILD_BLAST_CACHE_NODE(pfx, desc, indexop, hitop, lsize) \
|
||||
--- a/arch/mips/include/asm/stackframe.h
|
||||
+++ b/arch/mips/include/asm/stackframe.h
|
||||
@@ -429,6 +429,10 @@
|
||||
#else
|
||||
.set push
|
||||
.set arch=r4000
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ nop
|
||||
+ nop
|
||||
+#endif
|
||||
eret
|
||||
.set pop
|
||||
#endif
|
||||
--- a/arch/mips/kernel/genex.S
|
||||
+++ b/arch/mips/kernel/genex.S
|
||||
@@ -21,6 +21,19 @@
|
||||
#include <asm/sync.h>
|
||||
#include <asm/thread_info.h>
|
||||
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+# ifdef eret
|
||||
+# undef eret
|
||||
+# endif
|
||||
+# define eret \
|
||||
+ .set push; \
|
||||
+ .set noreorder; \
|
||||
+ nop; \
|
||||
+ nop; \
|
||||
+ eret; \
|
||||
+ .set pop;
|
||||
+#endif
|
||||
+
|
||||
__INIT
|
||||
|
||||
/*
|
||||
@@ -32,6 +45,9 @@
|
||||
NESTED(except_vec3_generic, 0, sp)
|
||||
.set push
|
||||
.set noat
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ nop
|
||||
+#endif
|
||||
mfc0 k1, CP0_CAUSE
|
||||
andi k1, k1, 0x7c
|
||||
#ifdef CONFIG_64BIT
|
||||
@@ -52,6 +68,9 @@ NESTED(except_vec3_r4000, 0, sp)
|
||||
.set push
|
||||
.set arch=r4000
|
||||
.set noat
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ nop
|
||||
+#endif
|
||||
mfc0 k1, CP0_CAUSE
|
||||
li k0, 31<<2
|
||||
andi k1, k1, 0x7c
|
||||
--- a/arch/mips/mm/c-r4k.c
|
||||
+++ b/arch/mips/mm/c-r4k.c
|
||||
@@ -37,6 +37,9 @@
|
||||
#include <asm/traps.h>
|
||||
#include <asm/mips-cps.h>
|
||||
|
||||
+/* For enabling BCM4710 cache workarounds */
|
||||
+static int bcm4710 = 0;
|
||||
+
|
||||
/*
|
||||
* Bits describing what cache ops an SMP callback function may perform.
|
||||
*
|
||||
@@ -189,6 +192,9 @@ static void r4k_blast_dcache_user_page_s
|
||||
{
|
||||
unsigned long dc_lsize = cpu_dcache_line_size();
|
||||
|
||||
+ if (bcm4710)
|
||||
+ r4k_blast_dcache_page = blast_dcache_page;
|
||||
+ else
|
||||
if (dc_lsize == 0)
|
||||
r4k_blast_dcache_user_page = (void *)cache_noop;
|
||||
else if (dc_lsize == 16)
|
||||
@@ -207,6 +213,9 @@ static void r4k_blast_dcache_page_indexe
|
||||
{
|
||||
unsigned long dc_lsize = cpu_dcache_line_size();
|
||||
|
||||
+ if (bcm4710)
|
||||
+ r4k_blast_dcache_page_indexed = blast_dcache_page_indexed;
|
||||
+ else
|
||||
if (dc_lsize == 0)
|
||||
r4k_blast_dcache_page_indexed = (void *)cache_noop;
|
||||
else if (dc_lsize == 16)
|
||||
@@ -226,6 +235,9 @@ static void r4k_blast_dcache_setup(void)
|
||||
{
|
||||
unsigned long dc_lsize = cpu_dcache_line_size();
|
||||
|
||||
+ if (bcm4710)
|
||||
+ r4k_blast_dcache = blast_dcache;
|
||||
+ else
|
||||
if (dc_lsize == 0)
|
||||
r4k_blast_dcache = (void *)cache_noop;
|
||||
else if (dc_lsize == 16)
|
||||
@@ -1779,6 +1791,17 @@ static void coherency_setup(void)
|
||||
* silly idea of putting something else there ...
|
||||
*/
|
||||
switch (current_cpu_type()) {
|
||||
+ case CPU_BMIPS3300:
|
||||
+ {
|
||||
+ u32 cm;
|
||||
+ cm = read_c0_diag();
|
||||
+ /* Enable icache */
|
||||
+ cm |= (1 << 31);
|
||||
+ /* Enable dcache */
|
||||
+ cm |= (1 << 30);
|
||||
+ write_c0_diag(cm);
|
||||
+ }
|
||||
+ break;
|
||||
case CPU_R4000PC:
|
||||
case CPU_R4000SC:
|
||||
case CPU_R4000MC:
|
||||
@@ -1825,6 +1848,15 @@ void r4k_cache_init(void)
|
||||
extern void build_copy_page(void);
|
||||
struct cpuinfo_mips *c = ¤t_cpu_data;
|
||||
|
||||
+ /* Check if special workarounds are required */
|
||||
+#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2)
|
||||
+ if (current_cpu_data.cputype == CPU_BMIPS32 && (current_cpu_data.processor_id & 0xff) == 0) {
|
||||
+ printk("Enabling BCM4710A0 cache workarounds.\n");
|
||||
+ bcm4710 = 1;
|
||||
+ } else
|
||||
+#endif
|
||||
+ bcm4710 = 0;
|
||||
+
|
||||
probe_pcache();
|
||||
probe_vcache();
|
||||
setup_scache();
|
||||
@@ -1897,7 +1929,15 @@ void r4k_cache_init(void)
|
||||
*/
|
||||
local_r4k___flush_cache_all(NULL);
|
||||
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ {
|
||||
+ static void (*_coherency_setup)(void);
|
||||
+ _coherency_setup = (void (*)(void)) KSEG1ADDR(coherency_setup);
|
||||
+ _coherency_setup();
|
||||
+ }
|
||||
+#else
|
||||
coherency_setup();
|
||||
+#endif
|
||||
board_cache_error_setup = r4k_cache_error_setup;
|
||||
|
||||
/*
|
||||
--- a/arch/mips/mm/tlbex.c
|
||||
+++ b/arch/mips/mm/tlbex.c
|
||||
@@ -958,6 +958,9 @@ void build_get_pgde32(u32 **p, unsigned
|
||||
uasm_i_srl(p, ptr, ptr, SMP_CPUID_PTRSHIFT);
|
||||
uasm_i_addu(p, ptr, tmp, ptr);
|
||||
#else
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ uasm_i_nop(p);
|
||||
+#endif
|
||||
UASM_i_LA_mostly(p, ptr, pgdc);
|
||||
#endif
|
||||
uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */
|
||||
@@ -1304,6 +1307,9 @@ static void build_r4000_tlb_refill_handl
|
||||
#ifdef CONFIG_64BIT
|
||||
build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
|
||||
#else
|
||||
+# ifdef CONFIG_BCM47XX
|
||||
+ uasm_i_nop(&p);
|
||||
+# endif
|
||||
build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
|
||||
#endif
|
||||
|
||||
@@ -1315,6 +1321,9 @@ static void build_r4000_tlb_refill_handl
|
||||
build_update_entries(&p, K0, K1);
|
||||
build_tlb_write_entry(&p, &l, &r, tlb_random);
|
||||
uasm_l_leave(&l, p);
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ uasm_i_nop(&p);
|
||||
+#endif
|
||||
uasm_i_eret(&p); /* return from trap */
|
||||
}
|
||||
#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
|
||||
@@ -2016,6 +2025,9 @@ build_r4000_tlbchange_handler_head(u32 *
|
||||
#ifdef CONFIG_64BIT
|
||||
build_get_pmde64(p, l, r, wr.r1, wr.r2); /* get pmd in ptr */
|
||||
#else
|
||||
+# ifdef CONFIG_BCM47XX
|
||||
+ uasm_i_nop(p);
|
||||
+# endif
|
||||
build_get_pgde32(p, wr.r1, wr.r2); /* get pgd in ptr */
|
||||
#endif
|
||||
|
||||
@@ -2062,6 +2074,9 @@ build_r4000_tlbchange_handler_tail(u32 *
|
||||
build_tlb_write_entry(p, l, r, tlb_indexed);
|
||||
uasm_l_leave(l, *p);
|
||||
build_restore_work_registers(p);
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+ uasm_i_nop(p);
|
||||
+#endif
|
||||
uasm_i_eret(p); /* return from trap */
|
||||
|
||||
#ifdef CONFIG_64BIT
|
@ -1,78 +0,0 @@
|
||||
From: Jeff Hansen <jhansen@cardaccess-inc.com>
|
||||
Subject: [PATCH] kmap_coherent
|
||||
|
||||
On ASUS WL-500gP there are some "Data bus error"s when executing simple
|
||||
commands liks "ps" or "cat /proc/1/cmdline".
|
||||
|
||||
This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485
|
||||
---
|
||||
--- a/arch/mips/include/asm/cpu-features.h
|
||||
+++ b/arch/mips/include/asm/cpu-features.h
|
||||
@@ -257,6 +257,9 @@
|
||||
#ifndef cpu_has_pindexed_dcache
|
||||
#define cpu_has_pindexed_dcache (cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX)
|
||||
#endif
|
||||
+#ifndef cpu_use_kmap_coherent
|
||||
+#define cpu_use_kmap_coherent 1
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* I-Cache snoops remote store. This only matters on SMP. Some multiprocessors
|
||||
--- a/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h
|
||||
+++ b/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h
|
||||
@@ -79,4 +79,6 @@
|
||||
#define cpu_scache_line_size() 0
|
||||
#define cpu_has_vz 0
|
||||
|
||||
+#define cpu_use_kmap_coherent 0
|
||||
+
|
||||
#endif /* __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H */
|
||||
--- a/arch/mips/mm/c-r4k.c
|
||||
+++ b/arch/mips/mm/c-r4k.c
|
||||
@@ -701,7 +701,7 @@ static inline void local_r4k_flush_cache
|
||||
map_coherent = (cpu_has_dc_aliases &&
|
||||
page_mapcount(page) &&
|
||||
!Page_dcache_dirty(page));
|
||||
- if (map_coherent)
|
||||
+ if (map_coherent && cpu_use_kmap_coherent)
|
||||
vaddr = kmap_coherent(page, addr);
|
||||
else
|
||||
vaddr = kmap_atomic(page);
|
||||
@@ -728,7 +728,7 @@ static inline void local_r4k_flush_cache
|
||||
}
|
||||
|
||||
if (vaddr) {
|
||||
- if (map_coherent)
|
||||
+ if (map_coherent && cpu_use_kmap_coherent)
|
||||
kunmap_coherent();
|
||||
else
|
||||
kunmap_atomic(vaddr);
|
||||
--- a/arch/mips/mm/init.c
|
||||
+++ b/arch/mips/mm/init.c
|
||||
@@ -172,7 +172,7 @@ void copy_user_highpage(struct page *to,
|
||||
void *vfrom, *vto;
|
||||
|
||||
vto = kmap_atomic(to);
|
||||
- if (cpu_has_dc_aliases &&
|
||||
+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
page_mapcount(from) && !Page_dcache_dirty(from)) {
|
||||
vfrom = kmap_coherent(from, vaddr);
|
||||
copy_page(vto, vfrom);
|
||||
@@ -194,7 +194,7 @@ void copy_to_user_page(struct vm_area_st
|
||||
struct page *page, unsigned long vaddr, void *dst, const void *src,
|
||||
unsigned long len)
|
||||
{
|
||||
- if (cpu_has_dc_aliases &&
|
||||
+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
page_mapcount(page) && !Page_dcache_dirty(page)) {
|
||||
void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
|
||||
memcpy(vto, src, len);
|
||||
@@ -212,7 +212,7 @@ void copy_from_user_page(struct vm_area_
|
||||
struct page *page, unsigned long vaddr, void *dst, const void *src,
|
||||
unsigned long len)
|
||||
{
|
||||
- if (cpu_has_dc_aliases &&
|
||||
+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
page_mapcount(page) && !Page_dcache_dirty(page)) {
|
||||
void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
|
||||
memcpy(dst, vfrom, len);
|
@ -1,121 +0,0 @@
|
||||
From b36f694256f41bc71571f467646d015dda128d14 Mon Sep 17 00:00:00 2001
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Sat, 9 Nov 2013 17:03:59 +0100
|
||||
Subject: [PATCH 210/210] b44: register adm switch
|
||||
|
||||
---
|
||||
drivers/net/ethernet/broadcom/b44.c | 57 +++++++++++++++++++++++++++++++++++
|
||||
drivers/net/ethernet/broadcom/b44.h | 3 ++
|
||||
2 files changed, 60 insertions(+)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/b44.c
|
||||
+++ b/drivers/net/ethernet/broadcom/b44.c
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <linux/ssb/ssb.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/phy.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/platform_data/adm6996-gpio.h>
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
@@ -2251,6 +2253,69 @@ static void b44_adjust_link(struct net_d
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+static int b44_register_adm_switch(struct b44 *bp)
|
||||
+{
|
||||
+ int gpio;
|
||||
+ struct platform_device *pdev;
|
||||
+ struct adm6996_gpio_platform_data adm_data = {0};
|
||||
+ struct platform_device_info info = {0};
|
||||
+
|
||||
+ adm_data.model = ADM6996L;
|
||||
+ gpio = bcm47xx_nvram_gpio_pin("adm_eecs");
|
||||
+ if (gpio >= 0)
|
||||
+ adm_data.eecs = gpio;
|
||||
+ else
|
||||
+ adm_data.eecs = 2;
|
||||
+
|
||||
+ gpio = bcm47xx_nvram_gpio_pin("adm_eesk");
|
||||
+ if (gpio >= 0)
|
||||
+ adm_data.eesk = gpio;
|
||||
+ else
|
||||
+ adm_data.eesk = 3;
|
||||
+
|
||||
+ gpio = bcm47xx_nvram_gpio_pin("adm_eedi");
|
||||
+ if (gpio >= 0)
|
||||
+ adm_data.eedi = gpio;
|
||||
+ else
|
||||
+ adm_data.eedi = 4;
|
||||
+
|
||||
+ /*
|
||||
+ * We ignore the "adm_rc" GPIO here. The driver does not use it,
|
||||
+ * and it conflicts with the Reset button GPIO on the Linksys WRT54GSv1.
|
||||
+ */
|
||||
+
|
||||
+ info.parent = bp->sdev->dev;
|
||||
+ info.name = "adm6996_gpio";
|
||||
+ info.id = -1;
|
||||
+ info.data = &adm_data;
|
||||
+ info.size_data = sizeof(adm_data);
|
||||
+
|
||||
+ if (!bp->adm_switch) {
|
||||
+ pdev = platform_device_register_full(&info);
|
||||
+ if (IS_ERR(pdev))
|
||||
+ return PTR_ERR(pdev);
|
||||
+
|
||||
+ bp->adm_switch = pdev;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+static void b44_unregister_adm_switch(struct b44 *bp)
|
||||
+{
|
||||
+ if (bp->adm_switch)
|
||||
+ platform_device_unregister(bp->adm_switch);
|
||||
+}
|
||||
+#else
|
||||
+static int b44_register_adm_switch(struct b44 *bp)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+static void b44_unregister_adm_switch(struct b44 *bp)
|
||||
+{
|
||||
+
|
||||
+}
|
||||
+#endif /* CONFIG_BCM47XX */
|
||||
+
|
||||
static int b44_register_phy_one(struct b44 *bp)
|
||||
{
|
||||
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
|
||||
@@ -2287,6 +2352,9 @@ static int b44_register_phy_one(struct b
|
||||
if (!mdiobus_is_registered_device(bp->mii_bus, bp->phy_addr) &&
|
||||
(sprom->boardflags_lo & (B44_BOARDFLAG_ROBO | B44_BOARDFLAG_ADM))) {
|
||||
|
||||
+ if (sprom->boardflags_lo & B44_BOARDFLAG_ADM)
|
||||
+ b44_register_adm_switch(bp);
|
||||
+
|
||||
dev_info(sdev->dev,
|
||||
"could not find PHY at %i, use fixed one\n",
|
||||
bp->phy_addr);
|
||||
@@ -2481,6 +2549,7 @@ static void b44_remove_one(struct ssb_de
|
||||
unregister_netdev(dev);
|
||||
if (bp->flags & B44_FLAG_EXTERNAL_PHY)
|
||||
b44_unregister_phy_one(bp);
|
||||
+ b44_unregister_adm_switch(bp);
|
||||
ssb_device_disable(sdev, 0);
|
||||
ssb_bus_may_powerdown(sdev->bus);
|
||||
netif_napi_del(&bp->napi);
|
||||
--- a/drivers/net/ethernet/broadcom/b44.h
|
||||
+++ b/drivers/net/ethernet/broadcom/b44.h
|
||||
@@ -408,6 +408,9 @@ struct b44 {
|
||||
struct mii_bus *mii_bus;
|
||||
int old_link;
|
||||
struct mii_if_info mii_if;
|
||||
+
|
||||
+ /* platform device for associated switch */
|
||||
+ struct platform_device *adm_switch;
|
||||
};
|
||||
|
||||
#endif /* _B44_H */
|
@ -1,54 +0,0 @@
|
||||
--- a/drivers/net/ethernet/broadcom/b44.c
|
||||
+++ b/drivers/net/ethernet/broadcom/b44.c
|
||||
@@ -430,10 +430,34 @@ static void b44_wap54g10_workaround(stru
|
||||
error:
|
||||
pr_warn("PHY: cannot reset MII transceiver isolate bit\n");
|
||||
}
|
||||
+
|
||||
+static void b44_bcm47xx_workarounds(struct b44 *bp)
|
||||
+{
|
||||
+ char buf[20];
|
||||
+ struct ssb_device *sdev = bp->sdev;
|
||||
+
|
||||
+ /* Toshiba WRC-1000, Siemens SE505 v1, Askey RT-210W, RT-220W */
|
||||
+ if (sdev->bus->sprom.board_num == 100) {
|
||||
+ bp->phy_addr = B44_PHY_ADDR_NO_LOCAL_PHY;
|
||||
+ } else {
|
||||
+ /* WL-HDD */
|
||||
+ if (bcm47xx_nvram_getenv("hardware_version", buf, sizeof(buf)) >= 0 &&
|
||||
+ !strncmp(buf, "WL300-", strlen("WL300-"))) {
|
||||
+ if (sdev->bus->sprom.et0phyaddr == 0 &&
|
||||
+ sdev->bus->sprom.et1phyaddr == 1)
|
||||
+ bp->phy_addr = B44_PHY_ADDR_NO_LOCAL_PHY;
|
||||
+ }
|
||||
+ }
|
||||
+ return;
|
||||
+}
|
||||
#else
|
||||
static inline void b44_wap54g10_workaround(struct b44 *bp)
|
||||
{
|
||||
}
|
||||
+
|
||||
+static inline void b44_bcm47xx_workarounds(struct b44 *bp)
|
||||
+{
|
||||
+}
|
||||
#endif
|
||||
|
||||
static int b44_setup_phy(struct b44 *bp)
|
||||
@@ -442,6 +466,7 @@ static int b44_setup_phy(struct b44 *bp)
|
||||
int err;
|
||||
|
||||
b44_wap54g10_workaround(bp);
|
||||
+ b44_bcm47xx_workarounds(bp);
|
||||
|
||||
if (bp->flags & B44_FLAG_EXTERNAL_PHY)
|
||||
return 0;
|
||||
@@ -2181,6 +2206,8 @@ static int b44_get_invariants(struct b44
|
||||
* valid PHY address. */
|
||||
bp->phy_addr &= 0x1F;
|
||||
|
||||
+ b44_bcm47xx_workarounds(bp);
|
||||
+
|
||||
eth_hw_addr_set(bp->dev, addr);
|
||||
|
||||
if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){
|
@ -1,25 +0,0 @@
|
||||
This prevents the options from being delete with make kernel_oldconfig.
|
||||
---
|
||||
drivers/ssb/Kconfig | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/bcma/Kconfig
|
||||
+++ b/drivers/bcma/Kconfig
|
||||
@@ -36,6 +36,7 @@ config BCMA_HOST_PCI
|
||||
config BCMA_HOST_SOC
|
||||
bool "Support for BCMA in a SoC"
|
||||
depends on HAS_IOMEM
|
||||
+ select USB_HCD_BCMA if USB_EHCI_HCD || USB_OHCI_HCD
|
||||
help
|
||||
Host interface for a Broadcom AIX bus directly mapped into
|
||||
the memory. This only works with the Broadcom SoCs from the
|
||||
--- a/drivers/ssb/Kconfig
|
||||
+++ b/drivers/ssb/Kconfig
|
||||
@@ -141,6 +141,7 @@ config SSB_SFLASH
|
||||
config SSB_EMBEDDED
|
||||
bool
|
||||
depends on SSB_DRIVER_MIPS && SSB_PCICORE_HOSTMODE
|
||||
+ select USB_HCD_SSB if USB_EHCI_HCD || USB_OHCI_HCD
|
||||
default y
|
||||
|
||||
config SSB_DRIVER_EXTIF
|
@ -1,21 +0,0 @@
|
||||
From: Wolfram Joost <dbox2@frokaschwei.de>
|
||||
Subject: [PATCH] fork_cacheflush
|
||||
|
||||
On ASUS WL-500gP there are many unexpected "Segmentation fault"s that
|
||||
seem to be caused by a kernel. They can be avoided by:
|
||||
1) Disabling highpage
|
||||
2) Using flush_cache_mm in flush_cache_dup_mm
|
||||
|
||||
For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035
|
||||
---
|
||||
--- a/arch/mips/include/asm/cacheflush.h
|
||||
+++ b/arch/mips/include/asm/cacheflush.h
|
||||
@@ -46,7 +46,7 @@
|
||||
extern void (*flush_cache_all)(void);
|
||||
extern void (*__flush_cache_all)(void);
|
||||
extern void (*flush_cache_mm)(struct mm_struct *mm);
|
||||
-#define flush_cache_dup_mm(mm) do { (void) (mm); } while (0)
|
||||
+#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
|
||||
extern void (*flush_cache_range)(struct vm_area_struct *vma,
|
||||
unsigned long start, unsigned long end);
|
||||
extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn);
|
@ -1,74 +0,0 @@
|
||||
From: Jeff Hansen <jhansen@cardaccess-inc.com>
|
||||
Subject: [PATCH] no highpage
|
||||
|
||||
On ASUS WL-500gP there are many unexpected "Segmentation fault"s that
|
||||
seem to be caused by a kernel. They can be avoided by:
|
||||
1) Disabling highpage
|
||||
2) Using flush_cache_mm in flush_cache_dup_mm
|
||||
|
||||
For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035
|
||||
---
|
||||
--- a/arch/mips/include/asm/page.h
|
||||
+++ b/arch/mips/include/asm/page.h
|
||||
@@ -71,6 +71,7 @@ static inline unsigned int page_size_ftl
|
||||
#endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
|
||||
|
||||
#include <linux/pfn.h>
|
||||
+#include <asm/cpu-features.h>
|
||||
|
||||
extern void build_clear_page(void);
|
||||
extern void build_copy_page(void);
|
||||
@@ -110,11 +111,16 @@ static inline void clear_user_page(void
|
||||
flush_data_cache_page((unsigned long)addr);
|
||||
}
|
||||
|
||||
-struct vm_area_struct;
|
||||
-extern void copy_user_highpage(struct page *to, struct page *from,
|
||||
- unsigned long vaddr, struct vm_area_struct *vma);
|
||||
+static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
|
||||
+ struct page *to)
|
||||
+{
|
||||
+ extern void (*flush_data_cache_page)(unsigned long addr);
|
||||
|
||||
-#define __HAVE_ARCH_COPY_USER_HIGHPAGE
|
||||
+ copy_page(vto, vfrom);
|
||||
+ if (!cpu_has_ic_fills_f_dc ||
|
||||
+ pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
|
||||
+ flush_data_cache_page((unsigned long)vto);
|
||||
+}
|
||||
|
||||
/*
|
||||
* These are used to make use of C type-checking..
|
||||
--- a/arch/mips/mm/init.c
|
||||
+++ b/arch/mips/mm/init.c
|
||||
@@ -166,30 +166,6 @@ void kunmap_coherent(void)
|
||||
preempt_enable();
|
||||
}
|
||||
|
||||
-void copy_user_highpage(struct page *to, struct page *from,
|
||||
- unsigned long vaddr, struct vm_area_struct *vma)
|
||||
-{
|
||||
- void *vfrom, *vto;
|
||||
-
|
||||
- vto = kmap_atomic(to);
|
||||
- if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
- page_mapcount(from) && !Page_dcache_dirty(from)) {
|
||||
- vfrom = kmap_coherent(from, vaddr);
|
||||
- copy_page(vto, vfrom);
|
||||
- kunmap_coherent();
|
||||
- } else {
|
||||
- vfrom = kmap_atomic(from);
|
||||
- copy_page(vto, vfrom);
|
||||
- kunmap_atomic(vfrom);
|
||||
- }
|
||||
- if ((!cpu_has_ic_fills_f_dc) ||
|
||||
- pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
|
||||
- flush_data_cache_page((unsigned long)vto);
|
||||
- kunmap_atomic(vto);
|
||||
- /* Make sure this page is cleared on other CPU's too before using it */
|
||||
- smp_wmb();
|
||||
-}
|
||||
-
|
||||
void copy_to_user_page(struct vm_area_struct *vma,
|
||||
struct page *page, unsigned long vaddr, void *dst, const void *src,
|
||||
unsigned long len)
|
@ -1,34 +0,0 @@
|
||||
--- a/drivers/mtd/parsers/bcm47xxpart.c
|
||||
+++ b/drivers/mtd/parsers/bcm47xxpart.c
|
||||
@@ -98,6 +98,7 @@ static int bcm47xxpart_parse(struct mtd_
|
||||
int trx_num = 0; /* Number of found TRX partitions */
|
||||
int possible_nvram_sizes[] = { 0x8000, 0xF000, 0x10000, };
|
||||
int err;
|
||||
+ bool found_nvram = false;
|
||||
|
||||
/*
|
||||
* Some really old flashes (like AT45DB*) had smaller erasesize-s, but
|
||||
@@ -279,12 +280,23 @@ static int bcm47xxpart_parse(struct mtd_
|
||||
if (buf[0] == NVRAM_HEADER) {
|
||||
bcm47xxpart_add_part(&parts[curr_part++], "nvram",
|
||||
master->size - blocksize, 0);
|
||||
+ found_nvram = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
kfree(buf);
|
||||
|
||||
+ if (!found_nvram) {
|
||||
+ pr_err("can not find a nvram partition reserve last block\n");
|
||||
+ bcm47xxpart_add_part(&parts[curr_part++], "nvram_guess",
|
||||
+ master->size - blocksize * 2, MTD_WRITEABLE);
|
||||
+ for (i = 0; i < curr_part; i++) {
|
||||
+ if (parts[i].size + parts[i].offset == master->size)
|
||||
+ parts[i].offset -= blocksize * 2;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Assume that partitions end at the beginning of the one they are
|
||||
* followed by.
|
@ -1,42 +0,0 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Sun, 7 Nov 2021 14:20:40 +0100
|
||||
Subject: [PATCH] net: bgmac: connect to PHY even if it is BGMAC_PHY_NOREGS
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Recent bgmac change was meant to just fix a race between "Generic PHY"
|
||||
and "bcm53xx" drivers after -EPROBE_DEFER. It modified bgmac to use
|
||||
phy_connect() only if there is a real PHY device connected.
|
||||
|
||||
That change broke bgmac on bcm47xx. bcma_phy_connect() now registers a
|
||||
fixed PHY with the bgmac_phy_connect_direct(). That fails as another
|
||||
fixed PHY (also using address 0) is already registered - by bcm47xx arch
|
||||
code bcm47xx_register_bus_complete().
|
||||
|
||||
This change brings origial behaviour. It connects Ethernet interface
|
||||
with pseudo-PHY (switch device) and adjusts Ethernet interface link to
|
||||
match connected switch.
|
||||
|
||||
This fixes:
|
||||
[ 2.548098] bgmac_bcma bcma0:1: Failed to register fixed PHY device
|
||||
[ 2.554584] bgmac_bcma bcma0:1: Cannot connect to phy
|
||||
|
||||
Fixes: b5375509184d ("net: bgmac: improve handling PHY")
|
||||
Link: https://lore.kernel.org/netdev/3639116e-9292-03ca-b9d9-d741118a4541@gmail.com/T/#u
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
drivers/net/ethernet/broadcom/bgmac-bcma.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
|
||||
@@ -94,7 +94,7 @@ static int bcma_phy_connect(struct bgmac
|
||||
return 0;
|
||||
|
||||
/* Connect to the PHY */
|
||||
- if (bgmac->mii_bus && bgmac->phyaddr != BGMAC_PHY_NOREGS) {
|
||||
+ if (bgmac->mii_bus) {
|
||||
snprintf(bus_id, sizeof(bus_id), PHY_ID_FMT, bgmac->mii_bus->id,
|
||||
bgmac->phyaddr);
|
||||
phy_dev = phy_connect(bgmac->net_dev, bus_id, bgmac_adjust_link,
|
@ -1,33 +0,0 @@
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Fri, 10 Jun 2022 13:10:47 +0200
|
||||
Subject: [PATCH] bgmac: reduce max frame size to support just MTU 1500
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
bgmac allocates new replacement buffer before handling each received
|
||||
frame. Allocating & DMA-preparing 9724 B each time consumes a lot of CPU
|
||||
time. Ideally bgmac should just respect currently set MTU but it isn't
|
||||
the case right now. For now just revert back to the old limited frame
|
||||
size.
|
||||
|
||||
This change bumps NAT masquarade speed by ~95%.
|
||||
|
||||
Ref: 8c7da63978f1 ("bgmac: configure MTU and add support for frames beyond 8192 byte size")
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
---
|
||||
drivers/net/ethernet/broadcom/bgmac.h | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/bgmac.h
|
||||
+++ b/drivers/net/ethernet/broadcom/bgmac.h
|
||||
@@ -328,8 +328,7 @@
|
||||
#define BGMAC_RX_FRAME_OFFSET 30 /* There are 2 unused bytes between header and real data */
|
||||
#define BGMAC_RX_BUF_OFFSET (NET_SKB_PAD + NET_IP_ALIGN - \
|
||||
BGMAC_RX_FRAME_OFFSET)
|
||||
-/* Jumbo frame size with FCS */
|
||||
-#define BGMAC_RX_MAX_FRAME_SIZE 9724
|
||||
+#define BGMAC_RX_MAX_FRAME_SIZE 1536
|
||||
#define BGMAC_RX_BUF_SIZE (BGMAC_RX_FRAME_OFFSET + BGMAC_RX_MAX_FRAME_SIZE)
|
||||
#define BGMAC_RX_ALLOC_SIZE (SKB_DATA_ALIGN(BGMAC_RX_BUF_SIZE + BGMAC_RX_BUF_OFFSET) + \
|
||||
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
|
@ -1,17 +0,0 @@
|
||||
When the Ethernet controller is powered down and someone wants to
|
||||
access the mdio bus like the witch driver (b53) the system crashed if
|
||||
PCI_D3hot was set before. This patch deactivates this power sawing mode
|
||||
when a switch driver is in use.
|
||||
|
||||
--- a/drivers/net/ethernet/broadcom/tg3.c
|
||||
+++ b/drivers/net/ethernet/broadcom/tg3.c
|
||||
@@ -4269,7 +4269,8 @@ static int tg3_power_down_prepare(struct
|
||||
static void tg3_power_down(struct tg3 *tp)
|
||||
{
|
||||
pci_wake_from_d3(tp->pdev, tg3_flag(tp, WOL_ENABLE));
|
||||
- pci_set_power_state(tp->pdev, PCI_D3hot);
|
||||
+ if (!tg3_flag(tp, ROBOSWITCH))
|
||||
+ pci_set_power_state(tp->pdev, PCI_D3hot);
|
||||
}
|
||||
|
||||
static void tg3_aux_stat_to_speed_duplex(struct tg3 *tp, u32 val, u32 *speed, u8 *duplex)
|
@ -1,73 +0,0 @@
|
||||
From 597715c61ae75a05ab3310a34ff3857a006f0f63 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
|
||||
Date: Thu, 20 Nov 2014 21:32:42 +0100
|
||||
Subject: [PATCH] bcma: add table of serial flashes with smaller blocks
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
---
|
||||
drivers/bcma/driver_chipcommon_sflash.c | 29 +++++++++++++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
|
||||
--- a/drivers/bcma/driver_chipcommon_sflash.c
|
||||
+++ b/drivers/bcma/driver_chipcommon_sflash.c
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/bcma/bcma.h>
|
||||
+#include <bcm47xx_board.h>
|
||||
|
||||
static struct resource bcma_sflash_resource = {
|
||||
.name = "bcma_sflash",
|
||||
@@ -42,6 +43,13 @@ static const struct bcma_sflash_tbl_e bc
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
+/* Some devices use smaller blocks (and have more of them) */
|
||||
+static const struct bcma_sflash_tbl_e bcma_sflash_st_shrink_tbl[] = {
|
||||
+ { "M25P16", 0x14, 0x1000, 512, },
|
||||
+ { "M25P32", 0x15, 0x1000, 1024, },
|
||||
+ { NULL },
|
||||
+};
|
||||
+
|
||||
static const struct bcma_sflash_tbl_e bcma_sflash_sst_tbl[] = {
|
||||
{ "SST25WF512", 1, 0x1000, 16, },
|
||||
{ "SST25VF512", 0x48, 0x1000, 16, },
|
||||
@@ -85,6 +93,24 @@ static void bcma_sflash_cmd(struct bcma_
|
||||
bcma_err(cc->core->bus, "SFLASH control command failed (timeout)!\n");
|
||||
}
|
||||
|
||||
+const struct bcma_sflash_tbl_e *bcma_sflash_shrink_flash(u32 id)
|
||||
+{
|
||||
+ enum bcm47xx_board board = bcm47xx_board_get();
|
||||
+ const struct bcma_sflash_tbl_e *e;
|
||||
+
|
||||
+ switch (board) {
|
||||
+ case BCM47XX_BOARD_NETGEAR_WGR614_V10:
|
||||
+ case BCM47XX_BOARD_NETGEAR_WNR1000_V3:
|
||||
+ for (e = bcma_sflash_st_shrink_tbl; e->name; e++) {
|
||||
+ if (e->id == id)
|
||||
+ return e;
|
||||
+ }
|
||||
+ return NULL;
|
||||
+ default:
|
||||
+ return NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* Initialize serial flash access */
|
||||
int bcma_sflash_init(struct bcma_drv_cc *cc)
|
||||
{
|
||||
@@ -115,6 +141,10 @@ int bcma_sflash_init(struct bcma_drv_cc
|
||||
case 0x13:
|
||||
return -ENOTSUPP;
|
||||
default:
|
||||
+ e = bcma_sflash_shrink_flash(id);
|
||||
+ if (e)
|
||||
+ break;
|
||||
+
|
||||
for (e = bcma_sflash_st_tbl; e->name; e++) {
|
||||
if (e->id == id)
|
||||
break;
|
@ -1,296 +0,0 @@
|
||||
The Netgear wgt634u uses a different format for storing the
|
||||
configuration. This patch is needed to read out the correct
|
||||
configuration. The cfe_env.c file uses a different method way to read
|
||||
out the configuration than the in kernel cfe config reader.
|
||||
|
||||
--- a/drivers/firmware/broadcom/Makefile
|
||||
+++ b/drivers/firmware/broadcom/Makefile
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
-obj-$(CONFIG_BCM47XX_NVRAM) += bcm47xx_nvram.o
|
||||
+obj-$(CONFIG_BCM47XX_NVRAM) += bcm47xx_nvram.o cfe_env.o
|
||||
obj-$(CONFIG_BCM47XX_SPROM) += bcm47xx_sprom.o
|
||||
obj-$(CONFIG_TEE_BNXT_FW) += tee_bnxt_fw.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/firmware/broadcom/cfe_env.c
|
||||
@@ -0,0 +1,228 @@
|
||||
+/*
|
||||
+ * CFE environment variable access
|
||||
+ *
|
||||
+ * Copyright 2001-2003, Broadcom Corporation
|
||||
+ * Copyright 2006, Felix Fietkau <nbd@nbd.name>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify it
|
||||
+ * under the terms of the GNU General Public License as published by the
|
||||
+ * Free Software Foundation; either version 2 of the License, or (at your
|
||||
+ * option) any later version.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/string.h>
|
||||
+#include <asm/io.h>
|
||||
+#include <linux/uaccess.h>
|
||||
+
|
||||
+#define NVRAM_SIZE (0x1ff0)
|
||||
+static char _nvdata[NVRAM_SIZE];
|
||||
+static char _valuestr[256];
|
||||
+
|
||||
+/*
|
||||
+ * TLV types. These codes are used in the "type-length-value"
|
||||
+ * encoding of the items stored in the NVRAM device (flash or EEPROM)
|
||||
+ *
|
||||
+ * The layout of the flash/nvram is as follows:
|
||||
+ *
|
||||
+ * <type> <length> <data ...> <type> <length> <data ...> <type_end>
|
||||
+ *
|
||||
+ * The type code of "ENV_TLV_TYPE_END" marks the end of the list.
|
||||
+ * The "length" field marks the length of the data section, not
|
||||
+ * including the type and length fields.
|
||||
+ *
|
||||
+ * Environment variables are stored as follows:
|
||||
+ *
|
||||
+ * <type_env> <length> <flags> <name> = <value>
|
||||
+ *
|
||||
+ * If bit 0 (low bit) is set, the length is an 8-bit value.
|
||||
+ * If bit 0 (low bit) is clear, the length is a 16-bit value
|
||||
+ *
|
||||
+ * Bit 7 set indicates "user" TLVs. In this case, bit 0 still
|
||||
+ * indicates the size of the length field.
|
||||
+ *
|
||||
+ * Flags are from the constants below:
|
||||
+ *
|
||||
+ */
|
||||
+#define ENV_LENGTH_16BITS 0x00 /* for low bit */
|
||||
+#define ENV_LENGTH_8BITS 0x01
|
||||
+
|
||||
+#define ENV_TYPE_USER 0x80
|
||||
+
|
||||
+#define ENV_CODE_SYS(n,l) (((n)<<1)|(l))
|
||||
+#define ENV_CODE_USER(n,l) ((((n)<<1)|(l)) | ENV_TYPE_USER)
|
||||
+
|
||||
+/*
|
||||
+ * The actual TLV types we support
|
||||
+ */
|
||||
+
|
||||
+#define ENV_TLV_TYPE_END 0x00
|
||||
+#define ENV_TLV_TYPE_ENV ENV_CODE_SYS(0,ENV_LENGTH_8BITS)
|
||||
+
|
||||
+/*
|
||||
+ * Environment variable flags
|
||||
+ */
|
||||
+
|
||||
+#define ENV_FLG_NORMAL 0x00 /* normal read/write */
|
||||
+#define ENV_FLG_BUILTIN 0x01 /* builtin - not stored in flash */
|
||||
+#define ENV_FLG_READONLY 0x02 /* read-only - cannot be changed */
|
||||
+
|
||||
+#define ENV_FLG_MASK 0xFF /* mask of attributes we keep */
|
||||
+#define ENV_FLG_ADMIN 0x100 /* lets us internally override permissions */
|
||||
+
|
||||
+
|
||||
+/* *********************************************************************
|
||||
+ * _nvram_read(buffer,offset,length)
|
||||
+ *
|
||||
+ * Read data from the NVRAM device
|
||||
+ *
|
||||
+ * Input parameters:
|
||||
+ * buffer - destination buffer
|
||||
+ * offset - offset of data to read
|
||||
+ * length - number of bytes to read
|
||||
+ *
|
||||
+ * Return value:
|
||||
+ * number of bytes read, or <0 if error occured
|
||||
+ ********************************************************************* */
|
||||
+static int
|
||||
+_nvram_read(unsigned char *nv_buf, unsigned char *buffer, int offset, int length)
|
||||
+{
|
||||
+ int i;
|
||||
+ if (offset > NVRAM_SIZE)
|
||||
+ return -1;
|
||||
+
|
||||
+ for ( i = 0; i < length; i++) {
|
||||
+ buffer[i] = ((volatile unsigned char*)nv_buf)[offset + i];
|
||||
+ }
|
||||
+ return length;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static char*
|
||||
+_strnchr(const char *dest,int c,size_t cnt)
|
||||
+{
|
||||
+ while (*dest && (cnt > 0)) {
|
||||
+ if (*dest == c) return (char *) dest;
|
||||
+ dest++;
|
||||
+ cnt--;
|
||||
+ }
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * Core support API: Externally visible.
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * Get the value of an NVRAM variable
|
||||
+ * @param name name of variable to get
|
||||
+ * @return value of variable or NULL if undefined
|
||||
+ */
|
||||
+
|
||||
+char *cfe_env_get(unsigned char *nv_buf, const char *name)
|
||||
+{
|
||||
+ int size;
|
||||
+ unsigned char *buffer;
|
||||
+ unsigned char *ptr;
|
||||
+ unsigned char *envval;
|
||||
+ unsigned int reclen;
|
||||
+ unsigned int rectype;
|
||||
+ int offset;
|
||||
+ int flg;
|
||||
+
|
||||
+ if (!strcmp(name, "nvram_type"))
|
||||
+ return "cfe";
|
||||
+
|
||||
+ size = NVRAM_SIZE;
|
||||
+ buffer = &_nvdata[0];
|
||||
+
|
||||
+ ptr = buffer;
|
||||
+ offset = 0;
|
||||
+
|
||||
+ /* Read the record type and length */
|
||||
+ if (_nvram_read(nv_buf, ptr,offset,1) != 1) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ while ((*ptr != ENV_TLV_TYPE_END) && (size > 1)) {
|
||||
+
|
||||
+ /* Adjust pointer for TLV type */
|
||||
+ rectype = *(ptr);
|
||||
+ offset++;
|
||||
+ size--;
|
||||
+
|
||||
+ /*
|
||||
+ * Read the length. It can be either 1 or 2 bytes
|
||||
+ * depending on the code
|
||||
+ */
|
||||
+ if (rectype & ENV_LENGTH_8BITS) {
|
||||
+ /* Read the record type and length - 8 bits */
|
||||
+ if (_nvram_read(nv_buf, ptr,offset,1) != 1) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+ reclen = *(ptr);
|
||||
+ size--;
|
||||
+ offset++;
|
||||
+ }
|
||||
+ else {
|
||||
+ /* Read the record type and length - 16 bits, MSB first */
|
||||
+ if (_nvram_read(nv_buf, ptr,offset,2) != 2) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+ reclen = (((unsigned int) *(ptr)) << 8) + (unsigned int) *(ptr+1);
|
||||
+ size -= 2;
|
||||
+ offset += 2;
|
||||
+ }
|
||||
+
|
||||
+ if (reclen > size)
|
||||
+ break; /* should not happen, bad NVRAM */
|
||||
+
|
||||
+ switch (rectype) {
|
||||
+ case ENV_TLV_TYPE_ENV:
|
||||
+ /* Read the TLV data */
|
||||
+ if (_nvram_read(nv_buf, ptr,offset,reclen) != reclen)
|
||||
+ goto error;
|
||||
+ flg = *ptr++;
|
||||
+ envval = (unsigned char *) _strnchr(ptr,'=',(reclen-1));
|
||||
+ if (envval) {
|
||||
+ *envval++ = '\0';
|
||||
+ memcpy(_valuestr,envval,(reclen-1)-(envval-ptr));
|
||||
+ _valuestr[(reclen-1)-(envval-ptr)] = '\0';
|
||||
+#if 0
|
||||
+ printk(KERN_INFO "NVRAM:%s=%s\n", ptr, _valuestr);
|
||||
+#endif
|
||||
+ if(!strcmp(ptr, name)){
|
||||
+ return _valuestr;
|
||||
+ }
|
||||
+ if((strlen(ptr) > 1) && !strcmp(&ptr[1], name))
|
||||
+ return _valuestr;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ /* Unknown TLV type, skip it. */
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Advance to next TLV
|
||||
+ */
|
||||
+
|
||||
+ size -= (int)reclen;
|
||||
+ offset += reclen;
|
||||
+
|
||||
+ /* Read the next record type */
|
||||
+ ptr = buffer;
|
||||
+ if (_nvram_read(nv_buf, ptr,offset,1) != 1)
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+error:
|
||||
+ return NULL;
|
||||
+
|
||||
+}
|
||||
+
|
||||
--- a/drivers/firmware/broadcom/bcm47xx_nvram.c
|
||||
+++ b/drivers/firmware/broadcom/bcm47xx_nvram.c
|
||||
@@ -33,6 +33,8 @@ struct nvram_header {
|
||||
static char nvram_buf[NVRAM_SPACE];
|
||||
static size_t nvram_len;
|
||||
static const u32 nvram_sizes[] = {0x6000, 0x8000, 0xF000, 0x10000};
|
||||
+static int cfe_env;
|
||||
+extern char *cfe_env_get(char *nv_buf, const char *name);
|
||||
|
||||
/**
|
||||
* bcm47xx_nvram_is_valid - check for a valid NVRAM at specified memory
|
||||
@@ -80,6 +82,26 @@ static int bcm47xx_nvram_find_and_copy(v
|
||||
return -EEXIST;
|
||||
}
|
||||
|
||||
+ cfe_env = 0;
|
||||
+
|
||||
+ /* XXX: hack for supporting the CFE environment stuff on WGT634U */
|
||||
+ if (res_size >= 8 * 1024 * 1024) {
|
||||
+ u32 *src = (u32 *)(flash_start + 8 * 1024 * 1024 - 0x2000);
|
||||
+ u32 *dst = (u32 *)nvram_buf;
|
||||
+
|
||||
+ if ((*src & 0xff00ff) == 0x000001) {
|
||||
+ printk("early_nvram_init: WGT634U NVRAM found.\n");
|
||||
+
|
||||
+ for (i = 0; i < 0x1ff0; i++) {
|
||||
+ if (*src == 0xFFFFFFFF)
|
||||
+ break;
|
||||
+ *dst++ = *src++;
|
||||
+ }
|
||||
+ cfe_env = 1;
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* TODO: when nvram is on nand flash check for bad blocks first. */
|
||||
|
||||
/* Try every possible flash size and check for NVRAM at its end */
|
||||
@@ -190,6 +212,13 @@ int bcm47xx_nvram_getenv(const char *nam
|
||||
if (!name)
|
||||
return -EINVAL;
|
||||
|
||||
+ if (cfe_env) {
|
||||
+ value = cfe_env_get(nvram_buf, name);
|
||||
+ if (!value)
|
||||
+ return -ENOENT;
|
||||
+ return snprintf(val, val_len, "%s", value);
|
||||
+ }
|
||||
+
|
||||
if (!nvram_len) {
|
||||
err = nvram_init();
|
||||
if (err)
|
@ -1,101 +0,0 @@
|
||||
--- a/arch/mips/bcm47xx/setup.c
|
||||
+++ b/arch/mips/bcm47xx/setup.c
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <linux/ssb/ssb.h>
|
||||
#include <linux/ssb/ssb_embedded.h>
|
||||
#include <linux/bcma/bcma_soc.h>
|
||||
+#include <linux/old_gpio_wdt.h>
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/idle.h>
|
||||
#include <asm/prom.h>
|
||||
@@ -254,6 +255,33 @@ static struct fixed_phy_status bcm47xx_f
|
||||
.duplex = DUPLEX_FULL,
|
||||
};
|
||||
|
||||
+static struct gpio_wdt_platform_data gpio_wdt_data;
|
||||
+
|
||||
+static struct platform_device gpio_wdt_device = {
|
||||
+ .name = "gpio-wdt",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = &gpio_wdt_data,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static int __init bcm47xx_register_gpio_watchdog(void)
|
||||
+{
|
||||
+ enum bcm47xx_board board = bcm47xx_board_get();
|
||||
+
|
||||
+ switch (board) {
|
||||
+ case BCM47XX_BOARD_HUAWEI_E970:
|
||||
+ pr_info("bcm47xx: detected Huawei E970 or similar, starting early gpio_wdt timer\n");
|
||||
+ gpio_wdt_data.gpio = 7;
|
||||
+ gpio_wdt_data.interval = HZ;
|
||||
+ gpio_wdt_data.first_interval = HZ / 5;
|
||||
+ return platform_device_register(&gpio_wdt_device);
|
||||
+ default:
|
||||
+ /* Nothing to do */
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int __init bcm47xx_register_bus_complete(void)
|
||||
{
|
||||
switch (bcm47xx_bus_type) {
|
||||
@@ -275,6 +303,7 @@ static int __init bcm47xx_register_bus_c
|
||||
bcm47xx_workarounds();
|
||||
|
||||
fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
|
||||
+ bcm47xx_register_gpio_watchdog();
|
||||
return 0;
|
||||
}
|
||||
device_initcall(bcm47xx_register_bus_complete);
|
||||
--- a/arch/mips/configs/bcm47xx_defconfig
|
||||
+++ b/arch/mips/configs/bcm47xx_defconfig
|
||||
@@ -63,6 +63,7 @@ CONFIG_HW_RANDOM=y
|
||||
CONFIG_GPIO_SYSFS=y
|
||||
CONFIG_WATCHDOG=y
|
||||
CONFIG_BCM47XX_WDT=y
|
||||
+CONFIG_GPIO_WDT=y
|
||||
CONFIG_SSB_DRIVER_GIGE=y
|
||||
CONFIG_BCMA_DRIVER_GMAC_CMN=y
|
||||
CONFIG_USB=y
|
||||
--- a/drivers/ssb/embedded.c
|
||||
+++ b/drivers/ssb/embedded.c
|
||||
@@ -34,11 +34,36 @@ int ssb_watchdog_timer_set(struct ssb_bu
|
||||
}
|
||||
EXPORT_SYMBOL(ssb_watchdog_timer_set);
|
||||
|
||||
+#ifdef CONFIG_BCM47XX
|
||||
+#include <bcm47xx_board.h>
|
||||
+
|
||||
+static bool ssb_watchdog_supported(void)
|
||||
+{
|
||||
+ enum bcm47xx_board board = bcm47xx_board_get();
|
||||
+
|
||||
+ /* The Huawei E970 has a hardware watchdog using a GPIO */
|
||||
+ switch (board) {
|
||||
+ case BCM47XX_BOARD_HUAWEI_E970:
|
||||
+ return false;
|
||||
+ default:
|
||||
+ return true;
|
||||
+ }
|
||||
+}
|
||||
+#else
|
||||
+static bool ssb_watchdog_supported(void)
|
||||
+{
|
||||
+ return true;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
int ssb_watchdog_register(struct ssb_bus *bus)
|
||||
{
|
||||
struct bcm47xx_wdt wdt = {};
|
||||
struct platform_device *pdev;
|
||||
|
||||
+ if (!ssb_watchdog_supported())
|
||||
+ return 0;
|
||||
+
|
||||
if (ssb_chipco_available(&bus->chipco)) {
|
||||
wdt.driver_data = &bus->chipco;
|
||||
wdt.timer_set = ssb_chipco_watchdog_timer_set_wdt;
|
@ -1,360 +0,0 @@
|
||||
This generic GPIO watchdog is used on Huawei E970 (bcm47xx)
|
||||
|
||||
Signed-off-by: Mathias Adam <m.adam--openwrt@adamis.de>
|
||||
|
||||
--- a/drivers/watchdog/Kconfig
|
||||
+++ b/drivers/watchdog/Kconfig
|
||||
@@ -1728,6 +1728,15 @@ config WDT_MTX1
|
||||
Hardware driver for the MTX-1 boards. This is a watchdog timer that
|
||||
will reboot the machine after a 100 seconds timer expired.
|
||||
|
||||
+config GPIO_WDT
|
||||
+ tristate "GPIO Hardware Watchdog"
|
||||
+ help
|
||||
+ Hardware driver for GPIO-controlled watchdogs. GPIO pin and
|
||||
+ toggle interval settings are platform-specific. The driver
|
||||
+ will stop toggling the GPIO (i.e. machine reboots) after a
|
||||
+ 100 second timer expired and no process has written to
|
||||
+ /dev/watchdog during that time.
|
||||
+
|
||||
config SIBYTE_WDOG
|
||||
tristate "Sibyte SoC hardware watchdog"
|
||||
depends on CPU_SB1
|
||||
--- a/drivers/watchdog/Makefile
|
||||
+++ b/drivers/watchdog/Makefile
|
||||
@@ -164,6 +164,7 @@ obj-$(CONFIG_RC32434_WDT) += rc32434_wdt
|
||||
obj-$(CONFIG_INDYDOG) += indydog.o
|
||||
obj-$(CONFIG_JZ4740_WDT) += jz4740_wdt.o
|
||||
obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
|
||||
+obj-$(CONFIG_GPIO_WDT) += old_gpio_wdt.o
|
||||
obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o
|
||||
obj-$(CONFIG_AR7_WDT) += ar7_wdt.o
|
||||
obj-$(CONFIG_TXX9_WDT) += txx9wdt.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/watchdog/old_gpio_wdt.c
|
||||
@@ -0,0 +1,301 @@
|
||||
+/*
|
||||
+ * Driver for GPIO-controlled Hardware Watchdogs.
|
||||
+ *
|
||||
+ * Copyright (C) 2013 Mathias Adam <m.adam--linux@adamis.de>
|
||||
+ *
|
||||
+ * Replaces mtx1_wdt (driver for the MTX-1 Watchdog):
|
||||
+ *
|
||||
+ * (C) Copyright 2005 4G Systems <info@4g-systems.biz>,
|
||||
+ * All Rights Reserved.
|
||||
+ * http://www.4g-systems.biz
|
||||
+ *
|
||||
+ * (C) Copyright 2007 OpenWrt.org, Florian Fainelli <florian@openwrt.org>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License
|
||||
+ * as published by the Free Software Foundation; either version
|
||||
+ * 2 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * Neither Michael Stickel nor 4G Systems admit liability nor provide
|
||||
+ * warranty for any of this software. This material is provided
|
||||
+ * "AS-IS" and at no charge.
|
||||
+ *
|
||||
+ * (c) Copyright 2005 4G Systems <info@4g-systems.biz>
|
||||
+ *
|
||||
+ * Release 0.01.
|
||||
+ * Author: Michael Stickel michael.stickel@4g-systems.biz
|
||||
+ *
|
||||
+ * Release 0.02.
|
||||
+ * Author: Florian Fainelli florian@openwrt.org
|
||||
+ * use the Linux watchdog/timer APIs
|
||||
+ *
|
||||
+ * Release 0.03.
|
||||
+ * Author: Mathias Adam <m.adam--linux@adamis.de>
|
||||
+ * make it a generic gpio watchdog driver
|
||||
+ *
|
||||
+ * The Watchdog is configured to reset the MTX-1
|
||||
+ * if it is not triggered for 100 seconds.
|
||||
+ * It should not be triggered more often than 1.6 seconds.
|
||||
+ *
|
||||
+ * A timer triggers the watchdog every 5 seconds, until
|
||||
+ * it is opened for the first time. After the first open
|
||||
+ * it MUST be triggered every 2..95 seconds.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/moduleparam.h>
|
||||
+#include <linux/types.h>
|
||||
+#include <linux/errno.h>
|
||||
+#include <linux/miscdevice.h>
|
||||
+#include <linux/fs.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <linux/timer.h>
|
||||
+#include <linux/completion.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/watchdog.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/uaccess.h>
|
||||
+#include <linux/gpio.h>
|
||||
+#include <linux/old_gpio_wdt.h>
|
||||
+
|
||||
+static int ticks = 100 * HZ;
|
||||
+
|
||||
+static struct {
|
||||
+ struct completion stop;
|
||||
+ spinlock_t lock;
|
||||
+ int running;
|
||||
+ struct timer_list timer;
|
||||
+ int queue;
|
||||
+ int default_ticks;
|
||||
+ unsigned long inuse;
|
||||
+ unsigned gpio;
|
||||
+ unsigned int gstate;
|
||||
+ int interval;
|
||||
+ int first_interval;
|
||||
+} gpio_wdt_device;
|
||||
+
|
||||
+static void gpio_wdt_trigger(struct timer_list *unused)
|
||||
+{
|
||||
+ spin_lock(&gpio_wdt_device.lock);
|
||||
+ if (gpio_wdt_device.running && ticks > 0)
|
||||
+ ticks -= gpio_wdt_device.interval;
|
||||
+
|
||||
+ /* toggle wdt gpio */
|
||||
+ gpio_wdt_device.gstate = !gpio_wdt_device.gstate;
|
||||
+ gpio_set_value(gpio_wdt_device.gpio, gpio_wdt_device.gstate);
|
||||
+
|
||||
+ if (gpio_wdt_device.queue && ticks > 0)
|
||||
+ mod_timer(&gpio_wdt_device.timer, jiffies + gpio_wdt_device.interval);
|
||||
+ else
|
||||
+ complete(&gpio_wdt_device.stop);
|
||||
+ spin_unlock(&gpio_wdt_device.lock);
|
||||
+}
|
||||
+
|
||||
+static void gpio_wdt_reset(void)
|
||||
+{
|
||||
+ ticks = gpio_wdt_device.default_ticks;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void gpio_wdt_start(void)
|
||||
+{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&gpio_wdt_device.lock, flags);
|
||||
+ if (!gpio_wdt_device.queue) {
|
||||
+ gpio_wdt_device.queue = 1;
|
||||
+ gpio_wdt_device.gstate = 1;
|
||||
+ gpio_set_value(gpio_wdt_device.gpio, 1);
|
||||
+ mod_timer(&gpio_wdt_device.timer, jiffies + gpio_wdt_device.first_interval);
|
||||
+ }
|
||||
+ gpio_wdt_device.running++;
|
||||
+ spin_unlock_irqrestore(&gpio_wdt_device.lock, flags);
|
||||
+}
|
||||
+
|
||||
+static int gpio_wdt_stop(void)
|
||||
+{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&gpio_wdt_device.lock, flags);
|
||||
+ if (gpio_wdt_device.queue) {
|
||||
+ gpio_wdt_device.queue = 0;
|
||||
+ gpio_wdt_device.gstate = 0;
|
||||
+ gpio_set_value(gpio_wdt_device.gpio, 0);
|
||||
+ }
|
||||
+ ticks = gpio_wdt_device.default_ticks;
|
||||
+ spin_unlock_irqrestore(&gpio_wdt_device.lock, flags);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* Filesystem functions */
|
||||
+
|
||||
+static int gpio_wdt_open(struct inode *inode, struct file *file)
|
||||
+{
|
||||
+ if (test_and_set_bit(0, &gpio_wdt_device.inuse))
|
||||
+ return -EBUSY;
|
||||
+ return nonseekable_open(inode, file);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int gpio_wdt_release(struct inode *inode, struct file *file)
|
||||
+{
|
||||
+ clear_bit(0, &gpio_wdt_device.inuse);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static long gpio_wdt_ioctl(struct file *file, unsigned int cmd,
|
||||
+ unsigned long arg)
|
||||
+{
|
||||
+ void __user *argp = (void __user *)arg;
|
||||
+ int __user *p = (int __user *)argp;
|
||||
+ unsigned int value;
|
||||
+ static const struct watchdog_info ident = {
|
||||
+ .options = WDIOF_CARDRESET,
|
||||
+ .identity = "GPIO WDT",
|
||||
+ };
|
||||
+
|
||||
+ switch (cmd) {
|
||||
+ case WDIOC_GETSUPPORT:
|
||||
+ if (copy_to_user(argp, &ident, sizeof(ident)))
|
||||
+ return -EFAULT;
|
||||
+ break;
|
||||
+ case WDIOC_GETSTATUS:
|
||||
+ case WDIOC_GETBOOTSTATUS:
|
||||
+ put_user(0, p);
|
||||
+ break;
|
||||
+ case WDIOC_SETOPTIONS:
|
||||
+ if (get_user(value, p))
|
||||
+ return -EFAULT;
|
||||
+ if (value & WDIOS_ENABLECARD)
|
||||
+ gpio_wdt_start();
|
||||
+ else if (value & WDIOS_DISABLECARD)
|
||||
+ gpio_wdt_stop();
|
||||
+ else
|
||||
+ return -EINVAL;
|
||||
+ return 0;
|
||||
+ case WDIOC_KEEPALIVE:
|
||||
+ gpio_wdt_reset();
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -ENOTTY;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static ssize_t gpio_wdt_write(struct file *file, const char *buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ if (!count)
|
||||
+ return -EIO;
|
||||
+ gpio_wdt_reset();
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations gpio_wdt_fops = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .llseek = no_llseek,
|
||||
+ .unlocked_ioctl = gpio_wdt_ioctl,
|
||||
+ .open = gpio_wdt_open,
|
||||
+ .write = gpio_wdt_write,
|
||||
+ .release = gpio_wdt_release,
|
||||
+};
|
||||
+
|
||||
+
|
||||
+static struct miscdevice gpio_wdt_misc = {
|
||||
+ .minor = WATCHDOG_MINOR,
|
||||
+ .name = "watchdog",
|
||||
+ .fops = &gpio_wdt_fops,
|
||||
+};
|
||||
+
|
||||
+
|
||||
+static int gpio_wdt_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ int ret;
|
||||
+ struct gpio_wdt_platform_data *gpio_wdt_data = pdev->dev.platform_data;
|
||||
+
|
||||
+ gpio_wdt_device.gpio = gpio_wdt_data->gpio;
|
||||
+ gpio_wdt_device.interval = gpio_wdt_data->interval;
|
||||
+ gpio_wdt_device.first_interval = gpio_wdt_data->first_interval;
|
||||
+ if (gpio_wdt_device.first_interval <= 0) {
|
||||
+ gpio_wdt_device.first_interval = gpio_wdt_device.interval;
|
||||
+ }
|
||||
+
|
||||
+ ret = gpio_request(gpio_wdt_device.gpio, "gpio-wdt");
|
||||
+ if (ret < 0) {
|
||||
+ dev_err(&pdev->dev, "failed to request gpio");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ spin_lock_init(&gpio_wdt_device.lock);
|
||||
+ init_completion(&gpio_wdt_device.stop);
|
||||
+ gpio_wdt_device.queue = 0;
|
||||
+ clear_bit(0, &gpio_wdt_device.inuse);
|
||||
+ timer_setup(&gpio_wdt_device.timer, gpio_wdt_trigger, 0L);
|
||||
+ gpio_wdt_device.default_ticks = ticks;
|
||||
+
|
||||
+ gpio_wdt_start();
|
||||
+ dev_info(&pdev->dev, "GPIO Hardware Watchdog driver (gpio=%i interval=%i/%i)\n",
|
||||
+ gpio_wdt_data->gpio, gpio_wdt_data->first_interval, gpio_wdt_data->interval);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int gpio_wdt_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ /* FIXME: do we need to lock this test ? */
|
||||
+ if (gpio_wdt_device.queue) {
|
||||
+ gpio_wdt_device.queue = 0;
|
||||
+ wait_for_completion(&gpio_wdt_device.stop);
|
||||
+ }
|
||||
+
|
||||
+ gpio_free(gpio_wdt_device.gpio);
|
||||
+ misc_deregister(&gpio_wdt_misc);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static struct platform_driver gpio_wdt_driver = {
|
||||
+ .probe = gpio_wdt_probe,
|
||||
+ .remove = gpio_wdt_remove,
|
||||
+ .driver.name = "gpio-wdt",
|
||||
+ .driver.owner = THIS_MODULE,
|
||||
+};
|
||||
+
|
||||
+static int __init gpio_wdt_init(void)
|
||||
+{
|
||||
+ return platform_driver_register(&gpio_wdt_driver);
|
||||
+}
|
||||
+arch_initcall(gpio_wdt_init);
|
||||
+
|
||||
+/*
|
||||
+ * We do wdt initialization in two steps: arch_initcall probes the wdt
|
||||
+ * very early to start pinging the watchdog (misc devices are not yet
|
||||
+ * available), and later module_init() just registers the misc device.
|
||||
+ */
|
||||
+static int gpio_wdt_init_late(void)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = misc_register(&gpio_wdt_misc);
|
||||
+ if (ret < 0) {
|
||||
+ pr_err("GPIO_WDT: failed to register misc device\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+#ifndef MODULE
|
||||
+module_init(gpio_wdt_init_late);
|
||||
+#endif
|
||||
+
|
||||
+static void __exit gpio_wdt_exit(void)
|
||||
+{
|
||||
+ platform_driver_unregister(&gpio_wdt_driver);
|
||||
+}
|
||||
+module_exit(gpio_wdt_exit);
|
||||
+
|
||||
+MODULE_AUTHOR("Michael Stickel, Florian Fainelli, Mathias Adam");
|
||||
+MODULE_DESCRIPTION("Driver for GPIO hardware watchdogs");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
|
||||
+MODULE_ALIAS("platform:gpio-wdt");
|
||||
--- /dev/null
|
||||
+++ b/include/linux/old_gpio_wdt.h
|
||||
@@ -0,0 +1,21 @@
|
||||
+/*
|
||||
+ * Definitions for the GPIO watchdog driver
|
||||
+ *
|
||||
+ * Copyright (C) 2013 Mathias Adam <m.adam--linux@adamis.de>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 as
|
||||
+ * published by the Free Software Foundation.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#ifndef _GPIO_WDT_H_
|
||||
+#define _GPIO_WDT_H_
|
||||
+
|
||||
+struct gpio_wdt_platform_data {
|
||||
+ int gpio; /* GPIO line number */
|
||||
+ int interval; /* watchdog reset interval in system ticks */
|
||||
+ int first_interval; /* first wd reset interval in system ticks */
|
||||
+};
|
||||
+
|
||||
+#endif /* _GPIO_WDT_H_ */
|
@ -1,30 +0,0 @@
|
||||
From 5c81397a0147ea59c778d1de14ef54e2268221f6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
|
||||
Date: Wed, 8 Apr 2015 06:58:11 +0200
|
||||
Subject: [PATCH] ssb: reject PCI writes setting CardBus bridge resources
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
If SoC has a CardBus we can set resources of device at slot 1 only. It's
|
||||
impossigle to set bridge resources as it simply overwrites device 1
|
||||
configuration and usually results in Data bus error-s.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
---
|
||||
drivers/ssb/driver_pcicore.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/drivers/ssb/driver_pcicore.c
|
||||
+++ b/drivers/ssb/driver_pcicore.c
|
||||
@@ -165,6 +165,10 @@ static int ssb_extpci_write_config(struc
|
||||
WARN_ON(!pc->hostmode);
|
||||
if (unlikely(len != 1 && len != 2 && len != 4))
|
||||
goto out;
|
||||
+ /* CardBus SoCs allow configuring dev 1 resources only */
|
||||
+ if (extpci_core->cardbusmode && dev != 1 &&
|
||||
+ off >= PCI_BASE_ADDRESS_0 && off <= PCI_BASE_ADDRESS_5)
|
||||
+ goto out;
|
||||
addr = get_cfgspace_addr(pc, bus, dev, func, off);
|
||||
if (unlikely(!addr))
|
||||
goto out;
|
@ -1,48 +0,0 @@
|
||||
--- a/drivers/pcmcia/yenta_socket.c
|
||||
+++ b/drivers/pcmcia/yenta_socket.c
|
||||
@@ -925,6 +925,8 @@ static struct cardbus_type cardbus_type[
|
||||
|
||||
static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mask)
|
||||
{
|
||||
+/* WRT54G3G does not like this */
|
||||
+#ifndef CONFIG_BCM47XX
|
||||
int i;
|
||||
unsigned long val;
|
||||
u32 mask;
|
||||
@@ -953,6 +955,9 @@ static unsigned int yenta_probe_irq(stru
|
||||
mask = probe_irq_mask(val) & 0xffff;
|
||||
|
||||
return mask;
|
||||
+#else
|
||||
+ return 0;
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1033,6 +1038,10 @@ static void yenta_get_socket_capabilitie
|
||||
else
|
||||
socket->socket.irq_mask = 0;
|
||||
|
||||
+ /* irq mask probing is broken for the WRT54G3G */
|
||||
+ if (socket->socket.irq_mask == 0)
|
||||
+ socket->socket.irq_mask = 0x6f8;
|
||||
+
|
||||
dev_info(&socket->dev->dev, "ISA IRQ mask 0x%04x, PCI irq %d\n",
|
||||
socket->socket.irq_mask, socket->cb_irq);
|
||||
}
|
||||
@@ -1264,6 +1273,15 @@ static int yenta_probe(struct pci_dev *d
|
||||
dev_info(&dev->dev, "Socket status: %08x\n",
|
||||
cb_readl(socket, CB_SOCKET_STATE));
|
||||
|
||||
+ /* Generate an interrupt on card insert/remove */
|
||||
+ config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK);
|
||||
+
|
||||
+ /* Set up Multifunction Routing Status Register */
|
||||
+ config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */);
|
||||
+
|
||||
+ /* Switch interrupts to parallelized */
|
||||
+ config_writeb(socket, 0x92, 0x64);
|
||||
+
|
||||
yenta_fixup_parent_bridge(dev->subordinate);
|
||||
|
||||
/* Register it with the pcmcia layer.. */
|
@ -1,11 +0,0 @@
|
||||
--- a/drivers/ssb/driver_pcicore.c
|
||||
+++ b/drivers/ssb/driver_pcicore.c
|
||||
@@ -394,7 +394,7 @@ static void ssb_pcicore_init_hostmode(st
|
||||
/* Give some time to the PCI controller to configure itself with the new
|
||||
* values. Not waiting at this point causes crashes of the machine.
|
||||
*/
|
||||
- mdelay(10);
|
||||
+ mdelay(300);
|
||||
register_pci_controller(&ssb_pcicore_controller);
|
||||
}
|
||||
|
@ -1,69 +0,0 @@
|
||||
From: Jeff Hansen <jhansen@cardaccess-inc.com>
|
||||
Subject: [PATCH] kmap_coherent
|
||||
|
||||
On ASUS WL-500gP there are some "Data bus error"s when executing simple
|
||||
commands liks "ps" or "cat /proc/1/cmdline".
|
||||
|
||||
This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485
|
||||
---
|
||||
--- a/arch/mips/include/asm/cpu-features.h
|
||||
+++ b/arch/mips/include/asm/cpu-features.h
|
||||
@@ -257,6 +257,9 @@
|
||||
#ifndef cpu_has_pindexed_dcache
|
||||
#define cpu_has_pindexed_dcache (cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX)
|
||||
#endif
|
||||
+#ifndef cpu_use_kmap_coherent
|
||||
+#define cpu_use_kmap_coherent 1
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* I-Cache snoops remote store. This only matters on SMP. Some multiprocessors
|
||||
--- a/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h
|
||||
+++ b/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h
|
||||
@@ -79,4 +79,6 @@
|
||||
#define cpu_scache_line_size() 0
|
||||
#define cpu_has_vz 0
|
||||
|
||||
+#define cpu_use_kmap_coherent 0
|
||||
+
|
||||
#endif /* __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H */
|
||||
--- a/arch/mips/mm/c-r4k.c
|
||||
+++ b/arch/mips/mm/c-r4k.c
|
||||
@@ -618,7 +618,7 @@ static inline void local_r4k_flush_cache
|
||||
}
|
||||
|
||||
if (vaddr) {
|
||||
- if (map_coherent)
|
||||
+ if (map_coherent && cpu_use_kmap_coherent)
|
||||
kunmap_coherent();
|
||||
else
|
||||
kunmap_atomic(vaddr);
|
||||
--- a/arch/mips/mm/init.c
|
||||
+++ b/arch/mips/mm/init.c
|
||||
@@ -173,7 +173,7 @@ void copy_user_highpage(struct page *to,
|
||||
void *vfrom, *vto;
|
||||
|
||||
vto = kmap_atomic(to);
|
||||
- if (cpu_has_dc_aliases &&
|
||||
+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
folio_mapped(src) && !folio_test_dcache_dirty(src)) {
|
||||
vfrom = kmap_coherent(from, vaddr);
|
||||
copy_page(vto, vfrom);
|
||||
@@ -197,7 +197,7 @@ void copy_to_user_page(struct vm_area_st
|
||||
{
|
||||
struct folio *folio = page_folio(page);
|
||||
|
||||
- if (cpu_has_dc_aliases &&
|
||||
+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
folio_mapped(folio) && !folio_test_dcache_dirty(folio)) {
|
||||
void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
|
||||
memcpy(vto, src, len);
|
||||
@@ -217,7 +217,7 @@ void copy_from_user_page(struct vm_area_
|
||||
{
|
||||
struct folio *folio = page_folio(page);
|
||||
|
||||
- if (cpu_has_dc_aliases &&
|
||||
+ if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
folio_mapped(folio) && !folio_test_dcache_dirty(folio)) {
|
||||
void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
|
||||
memcpy(dst, vfrom, len);
|
@ -1,21 +0,0 @@
|
||||
From: Wolfram Joost <dbox2@frokaschwei.de>
|
||||
Subject: [PATCH] fork_cacheflush
|
||||
|
||||
On ASUS WL-500gP there are many unexpected "Segmentation fault"s that
|
||||
seem to be caused by a kernel. They can be avoided by:
|
||||
1) Disabling highpage
|
||||
2) Using flush_cache_mm in flush_cache_dup_mm
|
||||
|
||||
For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035
|
||||
---
|
||||
--- a/arch/mips/include/asm/cacheflush.h
|
||||
+++ b/arch/mips/include/asm/cacheflush.h
|
||||
@@ -46,7 +46,7 @@
|
||||
extern void (*flush_cache_all)(void);
|
||||
extern void (*__flush_cache_all)(void);
|
||||
extern void (*flush_cache_mm)(struct mm_struct *mm);
|
||||
-#define flush_cache_dup_mm(mm) do { (void) (mm); } while (0)
|
||||
+#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
|
||||
extern void (*flush_cache_range)(struct vm_area_struct *vma,
|
||||
unsigned long start, unsigned long end);
|
||||
extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn);
|
@ -1,75 +0,0 @@
|
||||
From: Jeff Hansen <jhansen@cardaccess-inc.com>
|
||||
Subject: [PATCH] no highpage
|
||||
|
||||
On ASUS WL-500gP there are many unexpected "Segmentation fault"s that
|
||||
seem to be caused by a kernel. They can be avoided by:
|
||||
1) Disabling highpage
|
||||
2) Using flush_cache_mm in flush_cache_dup_mm
|
||||
|
||||
For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035
|
||||
---
|
||||
--- a/arch/mips/include/asm/page.h
|
||||
+++ b/arch/mips/include/asm/page.h
|
||||
@@ -71,6 +71,7 @@ static inline unsigned int page_size_ftl
|
||||
#endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
|
||||
|
||||
#include <linux/pfn.h>
|
||||
+#include <asm/cpu-features.h>
|
||||
|
||||
extern void build_clear_page(void);
|
||||
extern void build_copy_page(void);
|
||||
@@ -110,11 +111,16 @@ static inline void clear_user_page(void
|
||||
flush_data_cache_page((unsigned long)addr);
|
||||
}
|
||||
|
||||
-struct vm_area_struct;
|
||||
-extern void copy_user_highpage(struct page *to, struct page *from,
|
||||
- unsigned long vaddr, struct vm_area_struct *vma);
|
||||
+static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
|
||||
+ struct page *to)
|
||||
+{
|
||||
+ extern void (*flush_data_cache_page)(unsigned long addr);
|
||||
|
||||
-#define __HAVE_ARCH_COPY_USER_HIGHPAGE
|
||||
+ copy_page(vto, vfrom);
|
||||
+ if (!cpu_has_ic_fills_f_dc ||
|
||||
+ pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
|
||||
+ flush_data_cache_page((unsigned long)vto);
|
||||
+}
|
||||
|
||||
/*
|
||||
* These are used to make use of C type-checking..
|
||||
--- a/arch/mips/mm/init.c
|
||||
+++ b/arch/mips/mm/init.c
|
||||
@@ -166,31 +166,6 @@ void kunmap_coherent(void)
|
||||
preempt_enable();
|
||||
}
|
||||
|
||||
-void copy_user_highpage(struct page *to, struct page *from,
|
||||
- unsigned long vaddr, struct vm_area_struct *vma)
|
||||
-{
|
||||
- struct folio *src = page_folio(from);
|
||||
- void *vfrom, *vto;
|
||||
-
|
||||
- vto = kmap_atomic(to);
|
||||
- if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
|
||||
- folio_mapped(src) && !folio_test_dcache_dirty(src)) {
|
||||
- vfrom = kmap_coherent(from, vaddr);
|
||||
- copy_page(vto, vfrom);
|
||||
- kunmap_coherent();
|
||||
- } else {
|
||||
- vfrom = kmap_atomic(from);
|
||||
- copy_page(vto, vfrom);
|
||||
- kunmap_atomic(vfrom);
|
||||
- }
|
||||
- if ((!cpu_has_ic_fills_f_dc) ||
|
||||
- pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
|
||||
- flush_data_cache_page((unsigned long)vto);
|
||||
- kunmap_atomic(vto);
|
||||
- /* Make sure this page is cleared on other CPU's too before using it */
|
||||
- smp_wmb();
|
||||
-}
|
||||
-
|
||||
void copy_to_user_page(struct vm_area_struct *vma,
|
||||
struct page *page, unsigned long vaddr, void *dst, const void *src,
|
||||
unsigned long len)
|
@ -1,35 +0,0 @@
|
||||
From ce5cdd3b05216b704a704f466fb4c2dff3778caf Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 11 Jun 2024 13:35:33 +0200
|
||||
Subject: [PATCH] mips: bmips: BCM6358: make sure CBR is correctly set
|
||||
|
||||
It was discovered that some device have CBR address set to 0 causing
|
||||
kernel panic when arch_sync_dma_for_cpu_all is called.
|
||||
|
||||
This was notice in situation where the system is booted from TP1 and
|
||||
BMIPS_GET_CBR() returns 0 instead of a valid address and
|
||||
!!(read_c0_brcm_cmt_local() & (1 << 31)); not failing.
|
||||
|
||||
The current check whether RAC flush should be disabled or not are not
|
||||
enough hence lets check if CBR is a valid address or not.
|
||||
|
||||
Fixes: ab327f8acdf8 ("mips: bmips: BCM6358: disable RAC flush for TP1")
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Acked-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
||||
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
|
||||
---
|
||||
arch/mips/bmips/setup.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/mips/bmips/setup.c
|
||||
+++ b/arch/mips/bmips/setup.c
|
||||
@@ -110,7 +110,8 @@ static void bcm6358_quirks(void)
|
||||
* RAC flush causes kernel panics on BCM6358 when booting from TP1
|
||||
* because the bootloader is not initializing it properly.
|
||||
*/
|
||||
- bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31));
|
||||
+ bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31)) ||
|
||||
+ !!BMIPS_GET_CBR();
|
||||
}
|
||||
|
||||
static void bcm6368_quirks(void)
|
@ -1,10 +1,6 @@
|
||||
From 379ae584cea112db60f4ada79c7e5ba4f3364a64 Mon Sep 17 00:00:00 2001
|
||||
X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
|
||||
X-Patchwork-Id: 13718593
|
||||
X-Patchwork-Delegate: kuba@kernel.org
|
||||
List-Id: <netdev.vger.kernel.org>
|
||||
From 3b2aef99221d395ce37efa426d7b50e7dcd621d6 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Mon, 1 Jul 2024 19:26:28 +0100
|
||||
Date: Mon, 1 Jul 2024 20:28:14 +0100
|
||||
Subject: [PATCH] net: ethernet: mediatek: Allow gaps in MAC allocation
|
||||
|
||||
Some devices with MediaTek SoCs don't use the first but only the second
|
||||
@ -16,13 +12,16 @@ using 'continue' instead of aborting the loop using 'break'.
|
||||
Fixes: dee4dd10c79a ("net: ethernet: mtk_eth_soc: ppe: add support for multiple PPEs")
|
||||
Suggested-by: Elad Yifee <eladwf@gmail.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
|
||||
Link: https://patch.msgid.link/379ae584cea112db60f4ada79c7e5ba4f3364a64.1719862038.git.daniel@makrotopia.org
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
---
|
||||
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -3431,7 +3431,7 @@ static int mtk_open(struct net_device *d
|
||||
@@ -3396,7 +3396,7 @@ static int mtk_open(struct net_device *d
|
||||
|
||||
for (i = 0; i < MTK_MAX_DEVS; i++) {
|
||||
if (!eth->netdev[i])
|
@ -0,0 +1,29 @@
|
||||
From ca18300e00d584d5693127eb60c108b84883b8ac Mon Sep 17 00:00:00 2001
|
||||
From: Shengyu Qu <wiagn233@outlook.com>
|
||||
Date: Fri, 5 Jul 2024 01:26:26 +0800
|
||||
Subject: [PATCH] net: ethernet: mtk_ppe: Change PPE entries number to 16K
|
||||
|
||||
MT7981,7986 and 7988 all supports 32768 PPE entries, and MT7621/MT7620
|
||||
supports 16384 PPE entries, but only set to 8192 entries in driver. So
|
||||
incrase max entries to 16384 instead.
|
||||
|
||||
Signed-off-by: Elad Yifee <eladwf@gmail.com>
|
||||
Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
|
||||
Reviewed-by: Simon Horman <horms@kernel.org>
|
||||
Link: https://patch.msgid.link/TY3P286MB261103F937DE4EEB0F88437D98DE2@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
---
|
||||
drivers/net/ethernet/mediatek/mtk_ppe.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/rhashtable.h>
|
||||
|
||||
-#define MTK_PPE_ENTRIES_SHIFT 3
|
||||
+#define MTK_PPE_ENTRIES_SHIFT 4
|
||||
#define MTK_PPE_ENTRIES (1024 << MTK_PPE_ENTRIES_SHIFT)
|
||||
#define MTK_PPE_HASH_MASK (MTK_PPE_ENTRIES - 1)
|
||||
#define MTK_PPE_WAIT_TIMEOUT_US 1000000
|
@ -0,0 +1,55 @@
|
||||
From 064fbc4e9b5a6dbda7fe7b67dc7e9e95d31f8d75 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Thu, 4 Jul 2024 11:14:55 +0100
|
||||
Subject: [PATCH] net: ethernet: mtk_eth_soc: implement .{get,set}_pauseparam
|
||||
ethtool ops
|
||||
|
||||
Implement operations to get and set flow-control link parameters.
|
||||
Both is done by simply calling phylink_ethtool_{get,set}_pauseparam().
|
||||
Fix whitespace in mtk_ethtool_ops while at it.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
|
||||
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
||||
Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
|
||||
Link: https://patch.msgid.link/e3ece47323444631d6cb479f32af0dfd6d145be0.1720088047.git.daniel@makrotopia.org
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
---
|
||||
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 18 +++++++++++++++++-
|
||||
1 file changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -4462,6 +4462,20 @@ static int mtk_set_rxnfc(struct net_devi
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static void mtk_get_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
|
||||
+{
|
||||
+ struct mtk_mac *mac = netdev_priv(dev);
|
||||
+
|
||||
+ phylink_ethtool_get_pauseparam(mac->phylink, pause);
|
||||
+}
|
||||
+
|
||||
+static int mtk_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *pause)
|
||||
+{
|
||||
+ struct mtk_mac *mac = netdev_priv(dev);
|
||||
+
|
||||
+ return phylink_ethtool_set_pauseparam(mac->phylink, pause);
|
||||
+}
|
||||
+
|
||||
static u16 mtk_select_queue(struct net_device *dev, struct sk_buff *skb,
|
||||
struct net_device *sb_dev)
|
||||
{
|
||||
@@ -4490,8 +4504,10 @@ static const struct ethtool_ops mtk_etht
|
||||
.get_strings = mtk_get_strings,
|
||||
.get_sset_count = mtk_get_sset_count,
|
||||
.get_ethtool_stats = mtk_get_ethtool_stats,
|
||||
+ .get_pauseparam = mtk_get_pauseparam,
|
||||
+ .set_pauseparam = mtk_set_pauseparam,
|
||||
.get_rxnfc = mtk_get_rxnfc,
|
||||
- .set_rxnfc = mtk_set_rxnfc,
|
||||
+ .set_rxnfc = mtk_set_rxnfc,
|
||||
};
|
||||
|
||||
static const struct net_device_ops mtk_netdev_ops = {
|
@ -0,0 +1,42 @@
|
||||
From f07798d7bb9c46d17d80103fb772fd2c75d47919 Mon Sep 17 00:00:00 2001
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Tue, 25 Jun 2024 09:19:49 +0800
|
||||
Subject: [PATCH] gpio: mmio: do not calculate bgpio_bits via "ngpios"
|
||||
|
||||
bgpio_bits must be aligned with the data bus width. For example, on a
|
||||
32 bit big endian system and we only have 16 GPIOs. If we only assume
|
||||
bgpio_bits=16 we can never control the GPIO because the base address
|
||||
is the lowest address.
|
||||
|
||||
low address high address
|
||||
-------------------------------------------------
|
||||
| byte3 | byte2 | byte1 | byte0 |
|
||||
-------------------------------------------------
|
||||
| NaN | NaN | gpio8-15 | gpio0-7 |
|
||||
-------------------------------------------------
|
||||
|
||||
Fixes: 55b2395e4e92 ("gpio: mmio: handle "ngpios" properly in bgpio_init()")
|
||||
Fixes: https://github.com/openwrt/openwrt/issues/15739
|
||||
Reported-by: Mark Mentovai <mark@mentovai.com>
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
Suggested-By: Mark Mentovai <mark@mentovai.com>
|
||||
Reviewed-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||
Tested-by: Lóránd Horváth <lorand.horvath82@gmail.com>
|
||||
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
Link: https://lore.kernel.org/r/TYCP286MB089577B47D70F0AB25ABA6F5BCD52@TYCP286MB0895.JPNP286.PROD.OUTLOOK.COM
|
||||
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
|
||||
---
|
||||
drivers/gpio/gpio-mmio.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
--- a/drivers/gpio/gpio-mmio.c
|
||||
+++ b/drivers/gpio/gpio-mmio.c
|
||||
@@ -622,8 +622,6 @@ int bgpio_init(struct gpio_chip *gc, str
|
||||
ret = gpiochip_get_ngpios(gc, dev);
|
||||
if (ret)
|
||||
gc->ngpio = gc->bgpio_bits;
|
||||
- else
|
||||
- gc->bgpio_bits = roundup_pow_of_two(round_up(gc->ngpio, 8));
|
||||
|
||||
ret = bgpio_setup_io(gc, dat, set, clr, flags);
|
||||
if (ret)
|
@ -55,7 +55,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
/* SGMII */
|
||||
#define VSPEC1_SGMII_CTRL 0x08
|
||||
#define VSPEC1_SGMII_CTRL_ANEN BIT(12) /* Aneg enable */
|
||||
@@ -241,6 +248,35 @@ out:
|
||||
@@ -258,10 +265,39 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -90,15 +90,8 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
+
|
||||
static int gpy_config_init(struct phy_device *phydev)
|
||||
{
|
||||
int ret;
|
||||
@@ -252,7 +288,10 @@ static int gpy_config_init(struct phy_de
|
||||
|
||||
/* Clear all pending interrupts */
|
||||
ret = phy_read(phydev, PHY_ISTAT);
|
||||
- return ret < 0 ? ret : 0;
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
/* Nothing to configure. Configuration Requirement Placeholder */
|
||||
- return 0;
|
||||
+ return gpy_led_write(phydev);
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/core/sock.c
|
||||
+++ b/net/core/sock.c
|
||||
@@ -4115,6 +4115,8 @@ static __net_initdata struct pernet_oper
|
||||
@@ -4118,6 +4118,8 @@ static __net_initdata struct pernet_oper
|
||||
|
||||
static int __init proto_init(void)
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
#define PHY_PMA_MGBT_POLARITY 0x82
|
||||
#define PHY_MDI_MDI_X_MASK GENMASK(1, 0)
|
||||
#define PHY_MDI_MDI_X_NORMAL 0x3
|
||||
@@ -260,6 +267,35 @@ out:
|
||||
@@ -270,10 +277,39 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -90,15 +90,8 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
+
|
||||
static int gpy_config_init(struct phy_device *phydev)
|
||||
{
|
||||
int ret;
|
||||
@@ -271,7 +307,10 @@ static int gpy_config_init(struct phy_de
|
||||
|
||||
/* Clear all pending interrupts */
|
||||
ret = phy_read(phydev, PHY_ISTAT);
|
||||
- return ret < 0 ? ret : 0;
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
/* Nothing to configure. Configuration Requirement Placeholder */
|
||||
- return 0;
|
||||
+ return gpy_led_write(phydev);
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
// Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report
|
||||
// 2500MBd NRZ in their EEPROM
|
||||
SFP_QUIRK_M("Lantech", "8330-262D-E", sfp_quirk_2500basex),
|
||||
@@ -2586,7 +2589,8 @@ static void sfp_sm_main(struct sfp *sfp,
|
||||
@@ -2589,7 +2592,8 @@ static void sfp_sm_main(struct sfp *sfp,
|
||||
* or t_start_up, so assume there is a fault.
|
||||
*/
|
||||
sfp_sm_fault(sfp, SFP_S_INIT_TX_FAULT,
|
||||
@ -46,7 +46,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
} else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) {
|
||||
init_done:
|
||||
/* Create mdiobus and start trying for PHY */
|
||||
@@ -2840,10 +2844,12 @@ static void sfp_check_state(struct sfp *
|
||||
@@ -2843,10 +2847,12 @@ static void sfp_check_state(struct sfp *
|
||||
mutex_lock(&sfp->st_mutex);
|
||||
state = sfp_get_state(sfp);
|
||||
changed = state ^ sfp->state;
|
||||
|
@ -133,7 +133,7 @@ Subject: [PATCH] ssb_sprom: add generic kernel support for Broadcom Fallback SP
|
||||
# host support
|
||||
--- a/drivers/ssb/main.c
|
||||
+++ b/drivers/ssb/main.c
|
||||
@@ -1287,6 +1287,14 @@ static int __init ssb_modinit(void)
|
||||
@@ -1289,6 +1289,14 @@ static int __init ssb_modinit(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/core/sock.c
|
||||
+++ b/net/core/sock.c
|
||||
@@ -4145,6 +4145,8 @@ static __net_initdata struct pernet_oper
|
||||
@@ -4148,6 +4148,8 @@ static __net_initdata struct pernet_oper
|
||||
|
||||
static int __init proto_init(void)
|
||||
{
|
||||
|
@ -645,7 +645,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
+ (imgmaxsect + MIN_FREE_SECT) < dsectors) {
|
||||
+ add_fit_subimage_device(bdev, slot++, imgmaxsect,
|
||||
+ dsectors - imgmaxsect, false);
|
||||
+ dev_info(dev, "mapped remaing space as /dev/fitrw\n");
|
||||
+ dev_info(dev, "mapped remaining space as /dev/fitrw\n");
|
||||
+ }
|
||||
+
|
||||
+out_bootconf:
|
||||
|
@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
if (sock->type == SOCK_PACKET)
|
||||
po->prot_hook.func = packet_rcv_spkt;
|
||||
@@ -4012,6 +4015,16 @@ packet_setsockopt(struct socket *sock, i
|
||||
@@ -4014,6 +4017,16 @@ packet_setsockopt(struct socket *sock, i
|
||||
WRITE_ONCE(po->xmit, val ? packet_direct_xmit : dev_queue_xmit);
|
||||
return 0;
|
||||
}
|
||||
@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
default:
|
||||
return -ENOPROTOOPT;
|
||||
}
|
||||
@@ -4068,6 +4081,13 @@ static int packet_getsockopt(struct sock
|
||||
@@ -4070,6 +4083,13 @@ static int packet_getsockopt(struct sock
|
||||
case PACKET_VNET_HDR:
|
||||
val = po->has_vnet_hdr;
|
||||
break;
|
||||
|
@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
static const struct rt6_info ip6_blk_hole_entry_template = {
|
||||
.dst = {
|
||||
.__refcnt = ATOMIC_INIT(1),
|
||||
@@ -1040,6 +1054,7 @@ static const int fib6_prop[RTN_MAX + 1]
|
||||
@@ -1042,6 +1056,7 @@ static const int fib6_prop[RTN_MAX + 1]
|
||||
[RTN_BLACKHOLE] = -EINVAL,
|
||||
[RTN_UNREACHABLE] = -EHOSTUNREACH,
|
||||
[RTN_PROHIBIT] = -EACCES,
|
||||
@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
[RTN_THROW] = -EAGAIN,
|
||||
[RTN_NAT] = -EINVAL,
|
||||
[RTN_XRESOLVE] = -EINVAL,
|
||||
@@ -1075,6 +1090,10 @@ static void ip6_rt_init_dst_reject(struc
|
||||
@@ -1077,6 +1092,10 @@ static void ip6_rt_init_dst_reject(struc
|
||||
rt->dst.output = ip6_pkt_prohibit_out;
|
||||
rt->dst.input = ip6_pkt_prohibit;
|
||||
break;
|
||||
@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
case RTN_THROW:
|
||||
case RTN_UNREACHABLE:
|
||||
default:
|
||||
@@ -4545,6 +4564,17 @@ static int ip6_pkt_prohibit_out(struct n
|
||||
@@ -4547,6 +4566,17 @@ static int ip6_pkt_prohibit_out(struct n
|
||||
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
/*
|
||||
* Allocate a dst for local (unicast / anycast) address.
|
||||
*/
|
||||
@@ -5038,7 +5068,8 @@ static int rtm_to_fib6_config(struct sk_
|
||||
@@ -5040,7 +5070,8 @@ static int rtm_to_fib6_config(struct sk_
|
||||
if (rtm->rtm_type == RTN_UNREACHABLE ||
|
||||
rtm->rtm_type == RTN_BLACKHOLE ||
|
||||
rtm->rtm_type == RTN_PROHIBIT ||
|
||||
@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
cfg->fc_flags |= RTF_REJECT;
|
||||
|
||||
if (rtm->rtm_type == RTN_LOCAL)
|
||||
@@ -6285,6 +6316,8 @@ static int ip6_route_dev_notify(struct n
|
||||
@@ -6287,6 +6318,8 @@ static int ip6_route_dev_notify(struct n
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
net->ipv6.ip6_prohibit_entry->dst.dev = dev;
|
||||
net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
|
||||
@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
|
||||
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
|
||||
#endif
|
||||
@@ -6296,6 +6329,7 @@ static int ip6_route_dev_notify(struct n
|
||||
@@ -6298,6 +6331,7 @@ static int ip6_route_dev_notify(struct n
|
||||
in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
|
||||
@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
|
||||
#endif
|
||||
}
|
||||
@@ -6487,6 +6521,8 @@ static int __net_init ip6_route_net_init
|
||||
@@ -6489,6 +6523,8 @@ static int __net_init ip6_route_net_init
|
||||
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
net->ipv6.fib6_has_custom_rules = false;
|
||||
@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template,
|
||||
sizeof(*net->ipv6.ip6_prohibit_entry),
|
||||
GFP_KERNEL);
|
||||
@@ -6497,11 +6533,21 @@ static int __net_init ip6_route_net_init
|
||||
@@ -6499,11 +6535,21 @@ static int __net_init ip6_route_net_init
|
||||
ip6_template_metrics, true);
|
||||
INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached);
|
||||
|
||||
@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
|
||||
dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
|
||||
ip6_template_metrics, true);
|
||||
@@ -6528,6 +6574,8 @@ out:
|
||||
@@ -6530,6 +6576,8 @@ out:
|
||||
return ret;
|
||||
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
out_ip6_prohibit_entry:
|
||||
kfree(net->ipv6.ip6_prohibit_entry);
|
||||
out_ip6_null_entry:
|
||||
@@ -6547,6 +6595,7 @@ static void __net_exit ip6_route_net_exi
|
||||
@@ -6549,6 +6597,7 @@ static void __net_exit ip6_route_net_exi
|
||||
kfree(net->ipv6.ip6_null_entry);
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
kfree(net->ipv6.ip6_prohibit_entry);
|
||||
@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
kfree(net->ipv6.ip6_blk_hole_entry);
|
||||
#endif
|
||||
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
|
||||
@@ -6630,6 +6679,9 @@ void __init ip6_route_init_special_entri
|
||||
@@ -6632,6 +6681,9 @@ void __init ip6_route_init_special_entri
|
||||
init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
|
||||
init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
|
||||
init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
|
||||
|
@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
#include <net/net_namespace.h>
|
||||
#ifdef CONFIG_SYSCTL
|
||||
#include <linux/sysctl.h>
|
||||
@@ -461,6 +462,58 @@ static int ct_cpu_seq_show(struct seq_fi
|
||||
@@ -458,6 +459,58 @@ static int ct_cpu_seq_show(struct seq_fi
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
static const struct seq_operations ct_cpu_seq_ops = {
|
||||
.start = ct_cpu_seq_start,
|
||||
.next = ct_cpu_seq_next,
|
||||
@@ -474,8 +527,9 @@ static int nf_conntrack_standalone_init_
|
||||
@@ -471,8 +524,9 @@ static int nf_conntrack_standalone_init_
|
||||
kuid_t root_uid;
|
||||
kgid_t root_gid;
|
||||
|
||||
|
@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
if (sock->type == SOCK_PACKET)
|
||||
po->prot_hook.func = packet_rcv_spkt;
|
||||
@@ -4034,6 +4037,16 @@ packet_setsockopt(struct socket *sock, i
|
||||
@@ -4036,6 +4039,16 @@ packet_setsockopt(struct socket *sock, i
|
||||
packet_sock_flag_set(po, PACKET_SOCK_QDISC_BYPASS, val);
|
||||
return 0;
|
||||
}
|
||||
@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
default:
|
||||
return -ENOPROTOOPT;
|
||||
}
|
||||
@@ -4093,6 +4106,13 @@ static int packet_getsockopt(struct sock
|
||||
@@ -4095,6 +4108,13 @@ static int packet_getsockopt(struct sock
|
||||
case PACKET_VNET_HDR_SZ:
|
||||
val = READ_ONCE(po->vnet_hdr_sz);
|
||||
break;
|
||||
|
@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
static const struct rt6_info ip6_blk_hole_entry_template = {
|
||||
.dst = {
|
||||
.__rcuref = RCUREF_INIT(1),
|
||||
@@ -1038,6 +1052,7 @@ static const int fib6_prop[RTN_MAX + 1]
|
||||
@@ -1040,6 +1054,7 @@ static const int fib6_prop[RTN_MAX + 1]
|
||||
[RTN_BLACKHOLE] = -EINVAL,
|
||||
[RTN_UNREACHABLE] = -EHOSTUNREACH,
|
||||
[RTN_PROHIBIT] = -EACCES,
|
||||
@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
[RTN_THROW] = -EAGAIN,
|
||||
[RTN_NAT] = -EINVAL,
|
||||
[RTN_XRESOLVE] = -EINVAL,
|
||||
@@ -1073,6 +1088,10 @@ static void ip6_rt_init_dst_reject(struc
|
||||
@@ -1075,6 +1090,10 @@ static void ip6_rt_init_dst_reject(struc
|
||||
rt->dst.output = ip6_pkt_prohibit_out;
|
||||
rt->dst.input = ip6_pkt_prohibit;
|
||||
break;
|
||||
@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
case RTN_THROW:
|
||||
case RTN_UNREACHABLE:
|
||||
default:
|
||||
@@ -4544,6 +4563,17 @@ static int ip6_pkt_prohibit_out(struct n
|
||||
@@ -4546,6 +4565,17 @@ static int ip6_pkt_prohibit_out(struct n
|
||||
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
/*
|
||||
* Allocate a dst for local (unicast / anycast) address.
|
||||
*/
|
||||
@@ -5035,7 +5065,8 @@ static int rtm_to_fib6_config(struct sk_
|
||||
@@ -5037,7 +5067,8 @@ static int rtm_to_fib6_config(struct sk_
|
||||
if (rtm->rtm_type == RTN_UNREACHABLE ||
|
||||
rtm->rtm_type == RTN_BLACKHOLE ||
|
||||
rtm->rtm_type == RTN_PROHIBIT ||
|
||||
@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
cfg->fc_flags |= RTF_REJECT;
|
||||
|
||||
if (rtm->rtm_type == RTN_LOCAL)
|
||||
@@ -6282,6 +6313,8 @@ static int ip6_route_dev_notify(struct n
|
||||
@@ -6284,6 +6315,8 @@ static int ip6_route_dev_notify(struct n
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
net->ipv6.ip6_prohibit_entry->dst.dev = dev;
|
||||
net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
|
||||
@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
|
||||
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
|
||||
#endif
|
||||
@@ -6293,6 +6326,7 @@ static int ip6_route_dev_notify(struct n
|
||||
@@ -6295,6 +6328,7 @@ static int ip6_route_dev_notify(struct n
|
||||
in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
|
||||
@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
|
||||
#endif
|
||||
}
|
||||
@@ -6493,6 +6527,8 @@ static int __net_init ip6_route_net_init
|
||||
@@ -6495,6 +6529,8 @@ static int __net_init ip6_route_net_init
|
||||
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
net->ipv6.fib6_has_custom_rules = false;
|
||||
@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template,
|
||||
sizeof(*net->ipv6.ip6_prohibit_entry),
|
||||
GFP_KERNEL);
|
||||
@@ -6503,11 +6539,21 @@ static int __net_init ip6_route_net_init
|
||||
@@ -6505,11 +6541,21 @@ static int __net_init ip6_route_net_init
|
||||
ip6_template_metrics, true);
|
||||
INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->dst.rt_uncached);
|
||||
|
||||
@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
|
||||
dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
|
||||
ip6_template_metrics, true);
|
||||
@@ -6534,6 +6580,8 @@ out:
|
||||
@@ -6536,6 +6582,8 @@ out:
|
||||
return ret;
|
||||
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
out_ip6_prohibit_entry:
|
||||
kfree(net->ipv6.ip6_prohibit_entry);
|
||||
out_ip6_null_entry:
|
||||
@@ -6553,6 +6601,7 @@ static void __net_exit ip6_route_net_exi
|
||||
@@ -6555,6 +6603,7 @@ static void __net_exit ip6_route_net_exi
|
||||
kfree(net->ipv6.ip6_null_entry);
|
||||
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
|
||||
kfree(net->ipv6.ip6_prohibit_entry);
|
||||
@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||
kfree(net->ipv6.ip6_blk_hole_entry);
|
||||
#endif
|
||||
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
|
||||
@@ -6636,6 +6685,9 @@ void __init ip6_route_init_special_entri
|
||||
@@ -6638,6 +6687,9 @@ void __init ip6_route_init_special_entri
|
||||
init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
|
||||
init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
|
||||
init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
|
||||
|
@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -5020,6 +5020,8 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -5036,6 +5036,8 @@ static int mtk_probe(struct platform_dev
|
||||
* for NAPI to work
|
||||
*/
|
||||
init_dummy_netdev(ð->dummy_dev);
|
||||
|
@ -510,7 +510,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4554,6 +4701,7 @@ static const struct net_device_ops mtk_n
|
||||
@@ -4570,6 +4717,7 @@ static const struct net_device_ops mtk_n
|
||||
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
|
||||
{
|
||||
const __be32 *_id = of_get_property(np, "reg", NULL);
|
||||
@ -518,7 +518,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
phy_interface_t phy_mode;
|
||||
struct phylink *phylink;
|
||||
struct mtk_mac *mac;
|
||||
@@ -4590,16 +4738,41 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -4606,16 +4754,41 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
mac->id = id;
|
||||
mac->hw = eth;
|
||||
mac->of_node = np;
|
||||
@ -568,7 +568,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
}
|
||||
|
||||
memset(mac->hwlro_ip, 0, sizeof(mac->hwlro_ip));
|
||||
@@ -4682,8 +4855,21 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
@@ -4698,8 +4871,21 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||
phy_interface_zero(mac->phylink_config.supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_INTERNAL,
|
||||
mac->phylink_config.supported_interfaces);
|
||||
@ -590,7 +590,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
phylink = phylink_create(&mac->phylink_config,
|
||||
of_fwnode_handle(mac->of_node),
|
||||
phy_mode, &mtk_phylink_ops);
|
||||
@@ -4734,6 +4920,26 @@ free_netdev:
|
||||
@@ -4750,6 +4936,26 @@ free_netdev:
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -617,7 +617,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev)
|
||||
{
|
||||
struct net_device *dev, *tmp;
|
||||
@@ -4880,7 +5086,8 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -4896,7 +5102,8 @@ static int mtk_probe(struct platform_dev
|
||||
regmap_write(cci, 0, 3);
|
||||
}
|
||||
|
||||
@ -627,7 +627,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
err = mtk_sgmii_init(eth);
|
||||
|
||||
if (err)
|
||||
@@ -4991,6 +5198,24 @@ static int mtk_probe(struct platform_dev
|
||||
@@ -5007,6 +5214,24 @@ static int mtk_probe(struct platform_dev
|
||||
}
|
||||
}
|
||||
|
||||
@ -652,7 +652,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_INT)) {
|
||||
err = devm_request_irq(eth->dev, eth->irq[0],
|
||||
mtk_handle_irq, 0,
|
||||
@@ -5094,6 +5319,11 @@ static int mtk_remove(struct platform_de
|
||||
@@ -5110,6 +5335,11 @@ static int mtk_remove(struct platform_de
|
||||
mtk_stop(eth->netdev[i]);
|
||||
mac = netdev_priv(eth->netdev[i]);
|
||||
phylink_disconnect_phy(mac->phylink);
|
||||
|
@ -739,7 +739,7 @@ define Device/linksys_whw03
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | linksys-image type=WHW03
|
||||
DEVICE_PACKAGES := ath10k-firmware-qca9888-ct kmod-leds-pca963x kmod-spi-dev kmod-bluetooth \
|
||||
kmod-fs-ext4 e2fsprogs kmod-fs-f2fs mkf2fs losetup
|
||||
kmod-fs-ext4 e2fsprogs kmod-fs-f2fs mkf2fs losetup ipq-wifi-linksys_whw03
|
||||
endef
|
||||
TARGET_DEVICES += linksys_whw03
|
||||
|
||||
|
298
target/linux/mediatek/dts/mt7986b-tplink-re6000xd.dts
Normal file
298
target/linux/mediatek/dts/mt7986b-tplink-re6000xd.dts
Normal file
@ -0,0 +1,298 @@
|
||||
// SPDX-License-Identifier: (GL-2.0 OR MIT)
|
||||
|
||||
/dts-v1/;
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
#include "mt7986b.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "tplink,re6000xd", "mediatek,mt7986b";
|
||||
model = "TP-Link RE6000XD";
|
||||
|
||||
aliases {
|
||||
serial0 = &uart0;
|
||||
|
||||
led-boot = &led_status_blue;
|
||||
led-failsafe = &led_status_blue;
|
||||
led-running = &led_status_blue;
|
||||
led-upgrade = &led_status_blue;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
memory {
|
||||
reg = <0 0x40000000 0 0x20000000>;
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
gpios = <&pio 7 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_RESTART>;
|
||||
};
|
||||
|
||||
wps {
|
||||
label = "wps";
|
||||
gpios = <&pio 14 GPIO_ACTIVE_LOW>;
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_status_blue: power {
|
||||
gpios = <&pio 15 GPIO_ACTIVE_LOW>;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
panic-indicator;
|
||||
function-enumerator = <0>;
|
||||
};
|
||||
wlan_2g {
|
||||
gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_WLAN_2GHZ;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
wlan_5g {
|
||||
gpios = <&pio 12 GPIO_ACTIVE_LOW>;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_WLAN_5GHZ;
|
||||
linux,default-trigger = "phy1tpt";
|
||||
};
|
||||
signal_blue {
|
||||
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
function-enumerator = <1>;
|
||||
};
|
||||
signal_red {
|
||||
gpios = <&pio 19 GPIO_ACTIVE_LOW>;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
function-enumerator = <2>;
|
||||
};
|
||||
lan1 {
|
||||
gpios = <&pio 16 GPIO_ACTIVE_HIGH>;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <0>;
|
||||
};
|
||||
lan2 {
|
||||
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <1>;
|
||||
};
|
||||
lan3 {
|
||||
gpios = <&pio 18 GPIO_ACTIVE_LOW>;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&crypto {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ð {
|
||||
status = "okay";
|
||||
|
||||
gmac0: mac@0 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <0>;
|
||||
phy-mode = "2500base-x";
|
||||
|
||||
fixed-link {
|
||||
speed = <2500>;
|
||||
full-duplex;
|
||||
pause;
|
||||
};
|
||||
};
|
||||
|
||||
gmac1: mac@1 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <1>;
|
||||
phy-handle = <&phy6>;
|
||||
phy-mode = "2500base-x";
|
||||
};
|
||||
|
||||
mdio: mdio-bus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
&mdio {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
|
||||
reset-delay-us = <1500000>;
|
||||
reset-post-delay-us = <1000000>;
|
||||
|
||||
/* LAN3 2.5Gbps phy
|
||||
MaxLinear GPY211C0VC (SLNW8) */
|
||||
phy6: phy@6 {
|
||||
compatible = "ethernet-phy-ieee802.3-c45";
|
||||
reg = <6>;
|
||||
};
|
||||
|
||||
switch: switch@1f {
|
||||
compatible = "mediatek,mt7531";
|
||||
reg = <31>;
|
||||
reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
&switch {
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
/* reorder LAN1 and LAN2 port to match the port order of the case
|
||||
LAN1 - LAN2 - LAN3 (top to bottom of the case, no silkscreen)
|
||||
*/
|
||||
/* LAN2 port */
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
label = "lan2";
|
||||
};
|
||||
|
||||
/* LAN1 port */
|
||||
port@2 {
|
||||
reg = <2>;
|
||||
label = "lan1";
|
||||
};
|
||||
|
||||
port@6 {
|
||||
reg = <6>;
|
||||
ethernet = <&gmac0>;
|
||||
phy-mode = "2500base-x";
|
||||
|
||||
fixed-link {
|
||||
speed = <2500>;
|
||||
full-duplex;
|
||||
pause;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pio {
|
||||
spi_flash_pins: spi-flash-pins-33-to-38 {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi0", "spi0_wp_hold";
|
||||
};
|
||||
conf-pu {
|
||||
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
|
||||
drive-strength = <8>;
|
||||
mediatek,pull-up-adv = <0>; /* bias-disable */
|
||||
};
|
||||
conf-pd {
|
||||
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
|
||||
drive-strength = <8>;
|
||||
mediatek,pull-down-adv = <0>; /* bias-disable */
|
||||
};
|
||||
};
|
||||
|
||||
wf_2g_5g_pins: wf_2g_5g-pins {
|
||||
mux {
|
||||
function = "wifi";
|
||||
groups = "wf_2g", "wf_5g";
|
||||
};
|
||||
conf {
|
||||
pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
|
||||
"WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
|
||||
"WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
|
||||
"WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
|
||||
"WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
|
||||
"WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
|
||||
"WF1_TOP_CLK", "WF1_TOP_DATA";
|
||||
drive-strength = <4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi_flash_pins>;
|
||||
status = "okay";
|
||||
|
||||
spi_nand_flash: flash@0 {
|
||||
compatible = "spi-nand";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0>;
|
||||
|
||||
spi-max-frequency = <20000000>;
|
||||
spi-tx-bus-width = <4>;
|
||||
spi-rx-bus-width = <4>;
|
||||
|
||||
partitions: partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "boot";
|
||||
reg = <0x0 0x200000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@200000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x200000 0x100000>;
|
||||
};
|
||||
|
||||
partition@300000 {
|
||||
label = "ubi0";
|
||||
reg = <0x300000 0x3200000>;
|
||||
};
|
||||
|
||||
partition@3500000 {
|
||||
label = "ubi1";
|
||||
reg = <0x3500000 0x3200000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@6700000 {
|
||||
label = "userconfig";
|
||||
reg = <0x6700000 0x800000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@6f00000 {
|
||||
label = "tp_data";
|
||||
reg = <0x6f00000 0x400000>;
|
||||
read-only;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&trng {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&watchdog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&wifi {
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&wf_2g_5g_pins>;
|
||||
};
|
@ -103,11 +103,17 @@ smartrg,sdg-8734)
|
||||
ucidef_set_led_netdev "wan-green" "WAN" "mdio-bus:00:green:wan" "wan" "link_2500 link_5000"
|
||||
ucidef_set_led_netdev "wan-orange" "WAN" "mdio-bus:00:orange:wan" "wan" "link_100 link_1000"
|
||||
ucidef_set_led_netdev "wan-white" "WAN" "mdio-bus:00:white:wan" "wan" "link_10000"
|
||||
;;
|
||||
wavlink,wl-wn586x3)
|
||||
ucidef_set_led_netdev "lan-1" "lan-1" "blue:lan-1" "lan1" "link tx rx"
|
||||
ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-2" "lan2" "link tx rx"
|
||||
ucidef_set_led_netdev "wan" "wan" "blue:wan" "eth1" "link tx rx"
|
||||
;;
|
||||
tplink,re6000xd)
|
||||
ucidef_set_led_netdev "lan-1" "lan-1" "blue:lan-0" "lan1" "link tx rx"
|
||||
ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-1" "lan2" "link tx rx"
|
||||
ucidef_set_led_netdev "eth1" "lan-3" "blue:lan-2" "eth1" "link tx rx"
|
||||
;;
|
||||
xiaomi,mi-router-wr30u-stock|\
|
||||
xiaomi,mi-router-wr30u-ubootmod)
|
||||
ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" "link tx rx"
|
||||
|
@ -110,6 +110,9 @@ mediatek_setup_interfaces()
|
||||
wavlink,wl-wn586x3)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2" eth1
|
||||
;;
|
||||
tplink,re6000xd)
|
||||
ucidef_set_interface_lan "lan1 lan2 eth1"
|
||||
;;
|
||||
xiaomi,mi-router-ax3000t|\
|
||||
xiaomi,mi-router-ax3000t-ubootmod|\
|
||||
xiaomi,mi-router-wr30u-stock|\
|
||||
@ -161,7 +164,8 @@ mediatek_setup_macs()
|
||||
[ -n "$lan_mac" ] || lan_mac=$(macaddr_add $(mtd_get_mac_binary Factory 0x4) -1)
|
||||
wan_mac=$(macaddr_add $lan_mac 2)
|
||||
;;
|
||||
mercusys,mr90x-v1)
|
||||
mercusys,mr90x-v1|\
|
||||
tplink,re6000xd)
|
||||
label_mac=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
|
||||
lan_mac=$label_mac
|
||||
;;
|
||||
|
@ -31,9 +31,6 @@ case "$FIRMWARE" in
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
openwrt,one)
|
||||
caldata_extract "factory" 0x0 0x1000
|
||||
;;
|
||||
ubnt,unifi-6-plus)
|
||||
caldata_extract_mmc "factory" 0x0 0x1000
|
||||
;;
|
||||
@ -41,7 +38,8 @@ case "$FIRMWARE" in
|
||||
;;
|
||||
"mediatek/mt7986_eeprom_mt7975_dual.bin")
|
||||
case "$board" in
|
||||
mercusys,mr90x-v1)
|
||||
mercusys,mr90x-v1|\
|
||||
tplink,re6000xd)
|
||||
ln -sf /tmp/tp_data/MT7986_EEPROM.bin \
|
||||
/lib/firmware/$FIRMWARE
|
||||
;;
|
||||
|
@ -126,7 +126,8 @@ case "$board" in
|
||||
[ "$PHYNBR" = "0" ] && mtd_get_mac_ascii config2 wifi2gmac > /sys${DEVPATH}/macaddress
|
||||
[ "$PHYNBR" = "1" ] && mtd_get_mac_ascii config2 wifi5gmac > /sys${DEVPATH}/macaddress
|
||||
;;
|
||||
mercusys,mr90x-v1)
|
||||
mercusys,mr90x-v1|\
|
||||
tplink,re6000xd)
|
||||
addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
|
||||
[ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
|
||||
[ "$PHYNBR" = "1" ] && macaddr_add $addr -1 > /sys${DEVPATH}/macaddress
|
||||
|
@ -12,7 +12,8 @@ mount_ubi_part() {
|
||||
|
||||
preinit_mount_cfg_part() {
|
||||
case $(board_name) in
|
||||
mercusys,mr90x-v1)
|
||||
mercusys,mr90x-v1|\
|
||||
tplink,re6000xd)
|
||||
mount_ubi_part "tp_data"
|
||||
;;
|
||||
*)
|
||||
|
@ -17,7 +17,8 @@ preinit_set_mac_address() {
|
||||
ip link set dev eth0 address "$addr"
|
||||
ip link set dev eth1 address "$addr"
|
||||
;;
|
||||
mercusys,mr90x-v1)
|
||||
mercusys,mr90x-v1|\
|
||||
tplink,re6000xd)
|
||||
addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
|
||||
ip link set dev eth1 address "$(macaddr_add $addr 1)"
|
||||
;;
|
||||
|
@ -1,12 +0,0 @@
|
||||
. /lib/functions/system.sh
|
||||
|
||||
do_extract_caldata() {
|
||||
case $(board_name) in
|
||||
glinet,gl-mt6000|\
|
||||
jdcloud,re-cp-03)
|
||||
FIRMWARE=mediatek/mt7986_eeprom_mt7976_dual.bin \
|
||||
sh /etc/hotplug.d/firmware/11-mt76-caldata
|
||||
;;
|
||||
esac
|
||||
}
|
||||
boot_hook_add preinit_main do_extract_caldata
|
@ -142,7 +142,8 @@ platform_do_upgrade() {
|
||||
CI_KERNPART="fit"
|
||||
nand_do_upgrade "$1"
|
||||
;;
|
||||
mercusys,mr90x-v1)
|
||||
mercusys,mr90x-v1|\
|
||||
tplink,re6000xd)
|
||||
CI_UBIPART="ubi0"
|
||||
nand_do_upgrade "$1"
|
||||
;;
|
||||
|
@ -1244,6 +1244,20 @@ define Device/ruijie_rg-x60-pro
|
||||
endef
|
||||
TARGET_DEVICES += ruijie_rg-x60-pro
|
||||
|
||||
define Device/tplink_re6000xd
|
||||
DEVICE_VENDOR := TP-Link
|
||||
DEVICE_MODEL := RE6000XD
|
||||
DEVICE_DTS := mt7986b-tplink-re6000xd
|
||||
DEVICE_DTS_DIR := ../dts
|
||||
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
||||
UBINIZE_OPTS := -E 5
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
IMAGE_SIZE := 51200k
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
endef
|
||||
TARGET_DEVICES += tplink_re6000xd
|
||||
|
||||
define Device/tplink_tl-xdr-common
|
||||
DEVICE_VENDOR := TP-Link
|
||||
DEVICE_DTS_DIR := ../dts
|
||||
|
@ -14,7 +14,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
|
||||
--- a/drivers/net/phy/mxl-gpy.c
|
||||
+++ b/drivers/net/phy/mxl-gpy.c
|
||||
@@ -386,8 +386,11 @@ static bool gpy_2500basex_chk(struct phy
|
||||
@@ -385,8 +385,11 @@ static bool gpy_2500basex_chk(struct phy
|
||||
|
||||
phydev->speed = SPEED_2500;
|
||||
phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
|
||||
@ -28,7 +28,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -438,6 +441,14 @@ static int gpy_config_aneg(struct phy_de
|
||||
@@ -437,6 +440,14 @@ static int gpy_config_aneg(struct phy_de
|
||||
u32 adv;
|
||||
int ret;
|
||||
|
||||
@ -43,7 +43,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
if (phydev->autoneg == AUTONEG_DISABLE) {
|
||||
/* Configure half duplex with genphy_setup_forced,
|
||||
* because genphy_c45_pma_setup_forced does not support.
|
||||
@@ -560,6 +571,8 @@ static int gpy_update_interface(struct p
|
||||
@@ -559,6 +570,8 @@ static int gpy_update_interface(struct p
|
||||
switch (phydev->speed) {
|
||||
case SPEED_2500:
|
||||
phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
|
||||
@ -52,7 +52,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_SGMII_CTRL,
|
||||
VSPEC1_SGMII_CTRL_ANEN, 0);
|
||||
if (ret < 0) {
|
||||
@@ -573,7 +586,7 @@ static int gpy_update_interface(struct p
|
||||
@@ -572,7 +585,7 @@ static int gpy_update_interface(struct p
|
||||
case SPEED_100:
|
||||
case SPEED_10:
|
||||
phydev->interface = PHY_INTERFACE_MODE_SGMII;
|
||||
|
@ -29,7 +29,7 @@ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
||||
|
||||
--- a/drivers/thermal/mediatek/lvts_thermal.c
|
||||
+++ b/drivers/thermal/mediatek/lvts_thermal.c
|
||||
@@ -1243,7 +1243,7 @@ static int lvts_probe(struct platform_de
|
||||
@@ -1247,7 +1247,7 @@ static int lvts_probe(struct platform_de
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
||||
{
|
||||
struct lvts_domain *lvts_td;
|
||||
int i;
|
||||
@@ -1254,8 +1254,6 @@ static int lvts_remove(struct platform_d
|
||||
@@ -1258,8 +1258,6 @@ static int lvts_remove(struct platform_d
|
||||
lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], false);
|
||||
|
||||
lvts_debugfs_exit(lvts_td);
|
||||
@ -47,7 +47,7 @@ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
||||
}
|
||||
|
||||
static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = {
|
||||
@@ -1356,7 +1354,7 @@ MODULE_DEVICE_TABLE(of, lvts_of_match);
|
||||
@@ -1360,7 +1358,7 @@ MODULE_DEVICE_TABLE(of, lvts_of_match);
|
||||
|
||||
static struct platform_driver lvts_driver = {
|
||||
.probe = lvts_probe,
|
||||
|
@ -135,8 +135,8 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de
|
||||
{
|
||||
u32 gt;
|
||||
|
||||
@@ -703,7 +712,7 @@ static int lvts_golden_temp_init(struct
|
||||
if (gt && gt < LVTS_GOLDEN_TEMP_MAX)
|
||||
@@ -707,7 +716,7 @@ static int lvts_golden_temp_init(struct
|
||||
if (gt < LVTS_GOLDEN_TEMP_MAX)
|
||||
golden_temp = gt;
|
||||
|
||||
- coeff_b = golden_temp * 500 + LVTS_COEFF_B;
|
||||
@ -144,7 +144,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -726,7 +735,7 @@ static int lvts_ctrl_init(struct device
|
||||
@@ -730,7 +739,7 @@ static int lvts_ctrl_init(struct device
|
||||
* The golden temp information is contained in the first chunk
|
||||
* of efuse data.
|
||||
*/
|
||||
@ -153,7 +153,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -737,6 +746,7 @@ static int lvts_ctrl_init(struct device
|
||||
@@ -741,6 +750,7 @@ static int lvts_ctrl_init(struct device
|
||||
for (i = 0; i < lvts_data->num_lvts_ctrl; i++) {
|
||||
|
||||
lvts_ctrl[i].base = lvts_td->base + lvts_data->lvts_ctrl[i].offset;
|
||||
@ -161,7 +161,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de
|
||||
|
||||
ret = lvts_sensor_init(dev, &lvts_ctrl[i],
|
||||
&lvts_data->lvts_ctrl[i]);
|
||||
@@ -760,7 +770,8 @@ static int lvts_ctrl_init(struct device
|
||||
@@ -764,7 +774,8 @@ static int lvts_ctrl_init(struct device
|
||||
* after initializing the calibration.
|
||||
*/
|
||||
lvts_ctrl[i].hw_tshut_raw_temp =
|
||||
@ -171,7 +171,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de
|
||||
|
||||
lvts_ctrl[i].low_thresh = INT_MIN;
|
||||
lvts_ctrl[i].high_thresh = INT_MIN;
|
||||
@@ -1225,6 +1236,8 @@ static int lvts_probe(struct platform_de
|
||||
@@ -1229,6 +1240,8 @@ static int lvts_probe(struct platform_de
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
@ -180,7 +180,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de
|
||||
ret = lvts_domain_init(dev, lvts_td, lvts_data);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "Failed to initialize the lvts domain\n");
|
||||
@@ -1338,11 +1351,15 @@ static const struct lvts_ctrl_data mt819
|
||||
@@ -1342,11 +1355,15 @@ static const struct lvts_ctrl_data mt819
|
||||
static const struct lvts_data mt8195_lvts_mcu_data = {
|
||||
.lvts_ctrl = mt8195_lvts_mcu_data_ctrl,
|
||||
.num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl),
|
||||
|
@ -33,7 +33,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de
|
||||
#define LVTS_HW_SHUTDOWN_MT8195 105000
|
||||
|
||||
#define LVTS_MINIMUM_THRESHOLD 20000
|
||||
@@ -1269,6 +1272,33 @@ static void lvts_remove(struct platform_
|
||||
@@ -1273,6 +1276,33 @@ static void lvts_remove(struct platform_
|
||||
lvts_debugfs_exit(lvts_td);
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de
|
||||
static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = {
|
||||
{
|
||||
.cal_offset = { 0x04, 0x07 },
|
||||
@@ -1348,6 +1378,13 @@ static const struct lvts_ctrl_data mt819
|
||||
@@ -1352,6 +1382,13 @@ static const struct lvts_ctrl_data mt819
|
||||
}
|
||||
};
|
||||
|
||||
@ -81,7 +81,7 @@ Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de
|
||||
static const struct lvts_data mt8195_lvts_mcu_data = {
|
||||
.lvts_ctrl = mt8195_lvts_mcu_data_ctrl,
|
||||
.num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl),
|
||||
@@ -1363,6 +1400,7 @@ static const struct lvts_data mt8195_lvt
|
||||
@@ -1367,6 +1404,7 @@ static const struct lvts_data mt8195_lvt
|
||||
};
|
||||
|
||||
static const struct of_device_id lvts_of_match[] = {
|
||||
|
@ -24,7 +24,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-3-bero@baylibre.com
|
||||
|
||||
--- a/drivers/thermal/mediatek/lvts_thermal.c
|
||||
+++ b/drivers/thermal/mediatek/lvts_thermal.c
|
||||
@@ -1299,6 +1299,38 @@ static const struct lvts_ctrl_data mt798
|
||||
@@ -1303,6 +1303,38 @@ static const struct lvts_ctrl_data mt798
|
||||
}
|
||||
};
|
||||
|
||||
@ -63,7 +63,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-3-bero@baylibre.com
|
||||
static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = {
|
||||
{
|
||||
.cal_offset = { 0x04, 0x07 },
|
||||
@@ -1407,12 +1439,17 @@ static const struct of_device_id lvts_of
|
||||
@@ -1411,12 +1443,17 @@ static const struct of_device_id lvts_of
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, lvts_of_match);
|
||||
|
||||
|
@ -34,7 +34,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com
|
||||
#define LVTS_HW_SHUTDOWN_MT8195 105000
|
||||
|
||||
#define LVTS_MINIMUM_THRESHOLD 20000
|
||||
@@ -1331,6 +1332,88 @@ static int lvts_resume(struct device *de
|
||||
@@ -1335,6 +1336,88 @@ static int lvts_resume(struct device *de
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com
|
||||
static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = {
|
||||
{
|
||||
.cal_offset = { 0x04, 0x07 },
|
||||
@@ -1417,6 +1500,16 @@ static const struct lvts_data mt7988_lvt
|
||||
@@ -1421,6 +1504,16 @@ static const struct lvts_data mt7988_lvt
|
||||
.temp_offset = LVTS_COEFF_B_MT7988,
|
||||
};
|
||||
|
||||
@ -140,7 +140,7 @@ Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com
|
||||
static const struct lvts_data mt8195_lvts_mcu_data = {
|
||||
.lvts_ctrl = mt8195_lvts_mcu_data_ctrl,
|
||||
.num_lvts_ctrl = ARRAY_SIZE(mt8195_lvts_mcu_data_ctrl),
|
||||
@@ -1433,6 +1526,8 @@ static const struct lvts_data mt8195_lvt
|
||||
@@ -1437,6 +1530,8 @@ static const struct lvts_data mt8195_lvt
|
||||
|
||||
static const struct of_device_id lvts_of_match[] = {
|
||||
{ .compatible = "mediatek,mt7988-lvts-ap", .data = &mt7988_lvts_ap_data },
|
||||
|
@ -12,7 +12,7 @@ Signed-off-by: Tobias Schramm <tobias@t-sys.eu>
|
||||
---
|
||||
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
|
||||
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
|
||||
@@ -6153,6 +6153,12 @@ static int mvpp2_port_copy_mac_addr(stru
|
||||
@@ -6156,6 +6156,12 @@ static int mvpp2_port_copy_mac_addr(stru
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <24>;
|
||||
ralink,gpio-base = <0>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
20 24 28 2c
|
||||
30 34 ];
|
||||
@ -133,7 +132,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <16>;
|
||||
ralink,gpio-base = <24>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
@ -152,7 +150,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <32>;
|
||||
ralink,gpio-base = <40>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
@ -171,7 +168,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <1>;
|
||||
ralink,gpio-base = <72>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
|
@ -100,7 +100,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <24>;
|
||||
ralink,gpio-base = <0>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
20 24 28 2c
|
||||
30 34 ];
|
||||
@ -117,7 +116,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <16>;
|
||||
ralink,gpio-base = <24>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
@ -136,7 +134,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <32>;
|
||||
ralink,gpio-base = <40>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
@ -155,7 +152,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <1>;
|
||||
ralink,gpio-base = <72>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
|
@ -88,7 +88,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <24>;
|
||||
ralink,gpio-base = <0>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
20 24 28 2c
|
||||
30 34 ];
|
||||
@ -102,7 +101,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <16>;
|
||||
ralink,gpio-base = <24>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
@ -118,7 +116,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <32>;
|
||||
ralink,gpio-base = <40>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
|
@ -112,7 +112,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <24>;
|
||||
ralink,gpio-base = <0>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
20 24 28 2c
|
||||
30 34 ];
|
||||
@ -129,7 +128,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <16>;
|
||||
ralink,gpio-base = <24>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
@ -145,7 +143,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <12>;
|
||||
ralink,gpio-base = <40>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
|
@ -113,7 +113,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <24>;
|
||||
ralink,gpio-base = <0>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
20 24 28 2c
|
||||
30 34 ];
|
||||
@ -130,7 +129,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <16>;
|
||||
ralink,gpio-base = <24>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
@ -146,7 +144,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <6>;
|
||||
ralink,gpio-base = <40>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
|
@ -116,7 +116,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <24>;
|
||||
ralink,gpio-base = <0>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
20 24 28 2c
|
||||
30 34 ];
|
||||
@ -130,7 +129,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <16>;
|
||||
ralink,gpio-base = <24>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
@ -146,7 +144,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <32>;
|
||||
ralink,gpio-base = <40>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
@ -162,7 +159,6 @@
|
||||
#gpio-cells = <2>;
|
||||
|
||||
ngpios = <24>;
|
||||
ralink,gpio-base = <72>;
|
||||
ralink,register-map = [ 00 04 08 0c
|
||||
10 14 18 1c
|
||||
20 24 ];
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user