Merge branch 'openwrt:master' into master

This commit is contained in:
Hayzam Sherif 2023-02-10 18:51:11 +05:30 committed by GitHub
commit cdb7661a76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 644 additions and 625 deletions

View file

@ -387,12 +387,18 @@ config KERNEL_DEBUG_INFO_REDUCED
DEBUG_INFO build and compile times are reduced too. DEBUG_INFO build and compile times are reduced too.
Only works with newer gcc versions. Only works with newer gcc versions.
# KERNEL_DEBUG_LL symbols must have the default value set as otherwise
# KConfig wont evaluate them unless KERNEL_EARLY_PRINTK is selected
# which means that buildroot wont override the DEBUG_LL symbols in target
# kernel configurations and lead to devices that dont have working console
config KERNEL_DEBUG_LL_UART_NONE config KERNEL_DEBUG_LL_UART_NONE
bool bool
default n
depends on arm depends on arm
config KERNEL_DEBUG_LL config KERNEL_DEBUG_LL
bool bool
default n
depends on arm depends on arm
select KERNEL_DEBUG_LL_UART_NONE select KERNEL_DEBUG_LL_UART_NONE
help help

View file

@ -1,2 +1,2 @@
LINUX_VERSION-5.10 = .166 LINUX_VERSION-5.10 = .167
LINUX_KERNEL_HASH-5.10.166 = 0051a1780e5bda0efc68dafab7c728b8283d2b028fedb439418f478be7d3e1af LINUX_KERNEL_HASH-5.10.167 = d807f97812e566410cd13b3170009e0d7552748d4f22d608ffd4dbd7f85bf9c6

View file

@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .91 LINUX_VERSION-5.15 = .92
LINUX_KERNEL_HASH-5.15.91 = a63c2bb1beb15f1aea9c63cf80559f5b7ab58afd2da2fa5e7670c515ebe1fe80 LINUX_KERNEL_HASH-5.15.92 = 9f420451db99a31a4aade9a46487b39318340d228f5c87c6dc56d83477e6ef91

View file

@ -1,6 +1,5 @@
#!/bin/sh #!/usr/bin/awk -f
awk -f - $* <<EOF
function bitcount(c) { function bitcount(c) {
c=and(rshift(c, 1),0x55555555)+and(c,0x55555555) c=and(rshift(c, 1),0x55555555)+and(c,0x55555555)
c=and(rshift(c, 2),0x33333333)+and(c,0x33333333) c=and(rshift(c, 2),0x33333333)+and(c,0x33333333)
@ -11,14 +10,20 @@ function bitcount(c) {
} }
function ip2int(ip) { function ip2int(ip) {
for (ret=0,n=split(ip,a,"\."),x=1;x<=n;x++) ret=or(lshift(ret,8),a[x]) ret=0
n=split(ip,a,"\\.")
for (x=1;x<=n;x++)
ret=or(lshift(ret,8),a[x])
return ret return ret
} }
function int2ip(ip,ret,x) { function int2ip(ip,ret,x) {
ret=and(ip,255) ret=and(ip,255)
ip=rshift(ip,8) ip=rshift(ip,8)
for(;x<3;ret=and(ip,255)"."ret,ip=rshift(ip,8),x++); for(;x<3;x++) {
ret=and(ip,255)"."ret
ip=rshift(ip,8)
}
return ret return ret
} }
@ -44,28 +49,41 @@ BEGIN {
} }
network=and(ipaddr,netmask) network=and(ipaddr,netmask)
prefix=32-bitcount(compl32(netmask))
broadcast=or(network,compl32(netmask)) broadcast=or(network,compl32(netmask))
start=or(network,and(ip2int(ARGV[3]),compl32(netmask)))
limit=network+1
if (start<limit) start=limit
end=start+ARGV[4]
limit=or(network,compl32(netmask))-1
if (end>limit) end=limit
print "IP="int2ip(ipaddr) print "IP="int2ip(ipaddr)
print "NETMASK="int2ip(netmask) print "NETMASK="int2ip(netmask)
print "BROADCAST="int2ip(broadcast) print "BROADCAST="int2ip(broadcast)
print "NETWORK="int2ip(network) print "NETWORK="int2ip(network)
print "PREFIX="32-bitcount(compl32(netmask)) print "PREFIX="prefix
# range calculations: # range calculations:
# ipcalc <ip> <netmask> <start> <num> # ipcalc <ip> <netmask> <start> <num>
if (ARGC > 3) { if (ARGC <= 3)
print "START="int2ip(start) exit(0)
print "END="int2ip(end)
start=or(network,and(ip2int(ARGV[3]),compl32(netmask)))
limit=network+1
if (start<limit) start=limit
if (start==ipaddr) start=ipaddr+1
end=start+ARGV[4]
limit=or(network,compl32(netmask))-1
if (end>limit) end=limit
if (end==ipaddr) end=ipaddr-1
if (start>end) {
print "network ("int2ip(network)"/"prefix") too small" > "/dev/stderr"
exit(1)
} }
if (ipaddr > start && ipaddr < end) {
print "ipaddr inside range" > "/dev/stderr"
exit(1)
}
print "START="int2ip(start)
print "END="int2ip(end)
} }
EOF

View file

@ -535,7 +535,7 @@ define KernelPackage/fs-ntfs3
AUTOLOAD:=$(call AutoLoad,80,ntfs3) AUTOLOAD:=$(call AutoLoad,80,ntfs3)
endef endef
define KernelPackage/fuse/description define KernelPackage/fs-ntfs3/description
Kernel module for fully functional NTFS filesystem support. It allows Kernel module for fully functional NTFS filesystem support. It allows
reading as well as writing. reading as well as writing.

View file

@ -584,21 +584,20 @@ dhcp_add() {
limit=$((limit-1)) limit=$((limit-1))
fi fi
eval "$(ipcalc.sh "${subnet%%/*}" $netmask $start $limit)" # make sure the DHCP range is not empty
if [ "$dhcpv4" != "disabled" ] && eval "$(ipcalc.sh "${subnet%%/*}" "$netmask" "$start" "$limit")" ; then
[ "$dynamicdhcp" = "0" ] && END="static"
xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}"
fi
if [ "$dynamicdhcp" = "0" ] ; then if [ "$dynamicdhcp" = "0" ] ; then
END="static"
dhcp6range="::,static" dhcp6range="::,static"
else else
dhcp6range="::1000,::ffff" dhcp6range="::1000,::ffff"
fi fi
if [ "$dhcpv4" != "disabled" ] ; then
xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}"
fi
if [ $DNSMASQ_DHCP_VER -eq 6 ] && [ "$ra" = "server" ] ; then if [ $DNSMASQ_DHCP_VER -eq 6 ] && [ "$ra" = "server" ] ; then
# Note: dnsmasq cannot just be a DHCPv6 server (all-in-1) # Note: dnsmasq cannot just be a DHCPv6 server (all-in-1)
# and let some other machine(s) send RA pointing to it. # and let some other machine(s) send RA pointing to it.

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=e2fsprogs PKG_NAME:=e2fsprogs
PKG_VERSION:=1.46.5 PKG_VERSION:=1.46.6
PKG_RELEASE:=2 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/ PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
PKG_HASH:=2f16c9176704cf645dc69d5b15ff704ae722d665df38b2ed3cfc249757d8d81e PKG_HASH:=a77517f19ff5e4e97ede63536566865dd5d48654e13fc145f5f2249ef7c4f4fc
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=NOTICE PKG_LICENSE_FILES:=NOTICE

View file

@ -1,50 +0,0 @@
From ab51d587bb9b229b1fade1afd02e1574c1ba5c76 Mon Sep 17 00:00:00 2001
From: Lukas Czerner <lczerner@redhat.com>
Date: Thu, 21 Apr 2022 19:31:48 +0200
Subject: libext2fs: add sanity check to extent manipulation
It is possible to have a corrupted extent tree in such a way that a leaf
node contains zero extents in it. Currently if that happens and we try
to traverse the tree we can end up accessing wrong data, or possibly
even uninitialized memory. Make sure we don't do that.
Additionally make sure that we have a sane number of bytes passed to
memmove() in ext2fs_extent_delete().
Note that e2fsck is currently unable to spot and fix such corruption in
pass1.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reported-by: Nils Bars <nils_bars@t-online.de>
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2068113
Addresses: CVE-2022-1304
Addresses-Debian-Bug: #1010263
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
lib/ext2fs/extent.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -495,6 +495,10 @@ retry:
ext2fs_le16_to_cpu(eh->eh_entries);
newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max);
+ /* Make sure there is at least one extent present */
+ if (newpath->left <= 0)
+ return EXT2_ET_EXTENT_NO_DOWN;
+
if (path->left > 0) {
ix++;
newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block);
@@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_exte
cp = path->curr;
+ /* Sanity check before memmove() */
+ if (path->left < 0)
+ return EXT2_ET_EXTENT_LEAF_BAD;
+
if (path->left) {
memmove(cp, cp + sizeof(struct ext3_extent_idx),
path->left * sizeof(struct ext3_extent_idx));

View file

@ -58,7 +58,7 @@
}; };
}; };
}; };
virtual_flash { virtual_flash {
compatible = "mtd-concat"; compatible = "mtd-concat";
devices = <&fwconcat0 &fwconcat1>; devices = <&fwconcat0 &fwconcat1>;

View file

@ -10,11 +10,11 @@
model = "MikroTik RouterBOARD 912UAG-2HPnD"; model = "MikroTik RouterBOARD 912UAG-2HPnD";
aliases { aliases {
led-boot = &led_power; led-boot = &led_power;
led-failsafe = &led_power; led-failsafe = &led_power;
led-running = &led_power; led-running = &led_power;
led-upgrade = &led_power; led-upgrade = &led_power;
}; };
gpio_key: gpio_key { gpio_key: gpio_key {
compatible = "mikrotik,gpio-rb91x-key"; compatible = "mikrotik,gpio-rb91x-key";

View file

@ -16,7 +16,7 @@
led-upgrade = &led_system; led-upgrade = &led_system;
label-mac-device = &wmac; label-mac-device = &wmac;
}; };
keys { keys {
compatible = "gpio-keys"; compatible = "gpio-keys";
@ -26,7 +26,7 @@
debounce-interval = <60>; debounce-interval = <60>;
}; };
}; };
leds { leds {
compatible = "gpio-leds"; compatible = "gpio-leds";
@ -54,12 +54,12 @@
label = "green:lan4"; label = "green:lan4";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>; gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
}; };
wps { wps {
label = "green:wps"; label = "green:wps";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>; gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
}; };
wlan { wlan {
label = "green:wlan"; label = "green:wlan";
gpios = <&gpio 21 GPIO_ACTIVE_LOW>; gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
@ -130,16 +130,16 @@
&wmac { &wmac {
status = "okay"; status = "okay";
mtd-cal-data = <&art 0x1000>; mtd-cal-data = <&art 0x1000>;
nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cells = <&macaddr_uboot_1fc00>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address";
}; };
&eth0 { &eth0 {
status = "okay"; status = "okay";
phy-handle = <&swphy0>; phy-handle = <&swphy0>;
nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cells = <&macaddr_uboot_1fc00>;
@ -152,7 +152,7 @@
nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cells = <&macaddr_uboot_1fc00>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address";
gmac-config { gmac-config {
device = <&gmac>; device = <&gmac>;
switch-phy-swap = <1>; switch-phy-swap = <1>;

View file

@ -18,27 +18,27 @@
compatible = "gpio-leds"; compatible = "gpio-leds";
led-0 { led-0 {
color = <LED_COLOR_ID_BLUE>; color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WLAN; function = LED_FUNCTION_WLAN;
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
}; };
led_power: led-1 { led_power: led-1 {
label = "blue:power"; label = "blue:power";
color = <LED_COLOR_ID_BLUE>; color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_POWER; function = LED_FUNCTION_POWER;
gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
}; };
led-2 { led-2 {
color = <LED_COLOR_ID_BLUE>; color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WAN; function = LED_FUNCTION_WAN;
gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
}; };
led-3 { led-3 {
color = <LED_COLOR_ID_BLUE>; color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WPS; function = LED_FUNCTION_WPS;
gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
}; };
}; };

View file

@ -5,7 +5,7 @@
* Copyright (C) 2022 Daniel González Cabanelas <dgcbueu@gmail.com> * Copyright (C) 2022 Daniel González Cabanelas <dgcbueu@gmail.com>
* based on device tree from qca9558_ubnt_powerbeam-5ac-500.dts * based on device tree from qca9558_ubnt_powerbeam-5ac-500.dts
*/ */
#include "qca955x_ubnt_xc.dtsi" #include "qca955x_ubnt_xc.dtsi"
/ { / {

View file

@ -24,7 +24,7 @@
gpios = <&gpio 1 GPIO_ACTIVE_LOW>; gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt"; linux,default-trigger = "phy1tpt";
}; };
led_power: power { led_power: power {
label = "green:power"; label = "green:power";
gpios = <&gpio 7 GPIO_ACTIVE_LOW>; gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
@ -41,7 +41,7 @@
keys { keys {
compatible = "gpio-keys"; compatible = "gpio-keys";
reset { reset {
label = "Reset button"; label = "Reset button";
linux,code = <KEY_RESTART>; linux,code = <KEY_RESTART>;
@ -83,19 +83,19 @@
compatible = "fixed-partitions"; compatible = "fixed-partitions";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
uboot: partition@0 { uboot: partition@0 {
label = "u-boot"; label = "u-boot";
reg = <0x000000 0x080000>; reg = <0x000000 0x080000>;
read-only; read-only;
}; };
partition@80000 { partition@80000 {
compatible = "denx,uimage"; compatible = "denx,uimage";
label = "firmware"; label = "firmware";
reg = <0x080000 0xe00000>; reg = <0x080000 0xe00000>;
}; };
partition@e80000 { partition@e80000 {
label = "product-info"; label = "product-info";
reg = <0xe80000 0x05000>; reg = <0xe80000 0x05000>;
@ -107,7 +107,7 @@
reg = <0xe85000 0x16b000>; reg = <0xe85000 0x16b000>;
read-only; read-only;
}; };
art: partition@ff0000 { art: partition@ff0000 {
label = "art"; label = "art";
reg = <0xff0000 0x010000>; reg = <0xff0000 0x010000>;
@ -122,7 +122,7 @@
phy-mode = "sgmii"; phy-mode = "sgmii";
phy-handle = <&phy0>; phy-handle = <&phy0>;
nvmem-cells = <&macaddr_config_8>; nvmem-cells = <&macaddr_config_8>;
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address";
}; };

View file

@ -0,0 +1,33 @@
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
@@ -366,8 +366,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)))

View file

@ -0,0 +1,33 @@
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)))

View file

@ -4,7 +4,7 @@
* *
* Copyright (C) 2020 Daniel González Cabanelas <dgcbueu@gmail.com> * Copyright (C) 2020 Daniel González Cabanelas <dgcbueu@gmail.com>
*/ */
#include "bcm63167-sercomm-h500-s.dtsi" #include "bcm63167-sercomm-h500-s.dtsi"
/ { / {

View file

@ -646,7 +646,7 @@
} }
/* Reposition in the original skb */ /* Reposition in the original skb */
@@ -5189,6 +5210,20 @@ bool skb_try_coalesce(struct sk_buff *to @@ -5188,6 +5209,20 @@ bool skb_try_coalesce(struct sk_buff *to
if (skb_cloned(to)) if (skb_cloned(to))
return false; return false;

View file

@ -17,7 +17,7 @@ Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
--- a/net/core/skbuff.c --- a/net/core/skbuff.c
+++ b/net/core/skbuff.c +++ b/net/core/skbuff.c
@@ -4166,6 +4166,15 @@ int skb_gro_receive(struct sk_buff *p, s @@ -4165,6 +4165,15 @@ int skb_gro_receive(struct sk_buff *p, s
if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush)) if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush))
return -E2BIG; return -E2BIG;

View file

@ -17,7 +17,7 @@ Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
--- a/net/core/skbuff.c --- a/net/core/skbuff.c
+++ b/net/core/skbuff.c +++ b/net/core/skbuff.c
@@ -4348,6 +4348,15 @@ int skb_gro_receive(struct sk_buff *p, s @@ -4347,6 +4347,15 @@ int skb_gro_receive(struct sk_buff *p, s
if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush)) if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush))
return -E2BIG; return -E2BIG;

View file

@ -182,17 +182,17 @@
}; };
&gmac { &gmac {
status = "okay"; status = "okay";
}; };
&switch { &switch {
status = "okay"; status = "okay";
}; };
&swport5 { &swport5 {
status = "okay"; status = "okay";
label = "lan"; label = "lan";
}; };
&tlmm { &tlmm {

View file

@ -196,9 +196,9 @@
}; };
partition@180000 { partition@180000 {
label = "log"; label = "log";
reg = <0x00180000 0x00020000>; reg = <0x00180000 0x00020000>;
}; };
}; };
}; };
@ -262,9 +262,9 @@
}; };
&blsp1_i2c3 { &blsp1_i2c3 {
status = "okay"; status = "okay";
pinctrl-0 = <&i2c_0_pins>; pinctrl-0 = <&i2c_0_pins>;
pinctrl-names = "default"; pinctrl-names = "default";
}; };
&usb2 { &usb2 {

View file

@ -222,18 +222,18 @@
}; };
&gmac { &gmac {
status = "okay"; status = "okay";
}; };
&switch { &switch {
status = "okay"; status = "okay";
/delete-property/ psgmii-ethphy; /delete-property/ psgmii-ethphy;
}; };
&swport5 { &swport5 {
status = "okay"; status = "okay";
label = "lan"; label = "lan";
phy-mode = "rgmii"; phy-mode = "rgmii";
}; };

View file

@ -158,12 +158,12 @@
line-name = "enable USB power"; line-name = "enable USB power";
}; };
enable-mpcie-power { enable-mpcie-power {
gpio-hog; gpio-hog;
gpios = <51 GPIO_ACTIVE_HIGH>; gpios = <51 GPIO_ACTIVE_HIGH>;
output-high; output-high;
line-name = "enable mPCI-E power"; line-name = "enable mPCI-E power";
}; };
}; };

View file

@ -54,7 +54,7 @@
gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>; gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "phy0tpt"; linux,default-trigger = "phy0tpt";
}; };
led-3 { led-3 {
label = "red:wlan"; label = "red:wlan";
gpios = <&tlmm 26 GPIO_ACTIVE_HIGH>; gpios = <&tlmm 26 GPIO_ACTIVE_HIGH>;

View file

@ -7,513 +7,513 @@
#include <dt-bindings/leds/common.h> #include <dt-bindings/leds/common.h>
/ { / {
model = "Linksys WHW03 V2 (Velop)"; model = "Linksys WHW03 V2 (Velop)";
compatible = "linksys,whw03v2", "qcom,ipq4019"; compatible = "linksys,whw03v2", "qcom,ipq4019";
aliases { aliases {
led-boot = &led_blue; led-boot = &led_blue;
led-failsafe = &led_red; led-failsafe = &led_red;
led-running = &led_green; led-running = &led_green;
led-upgrade = &led_red; led-upgrade = &led_red;
}; };
// The arguments rootfstype and ro are needed // The arguments rootfstype and ro are needed
// to override the default bootargs // to override the default bootargs
chosen { chosen {
bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro"; bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro";
stdout-path = &blsp1_uart1; stdout-path = &blsp1_uart1;
}; };
soc { soc {
ess-tcsr@1953000 { ess-tcsr@1953000 {
compatible = "qcom,tcsr"; compatible = "qcom,tcsr";
reg = <0x1953000 0x1000>; reg = <0x1953000 0x1000>;
qcom,ess-interface-select = <TCSR_ESS_PSGMII>; qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
}; };
tcsr@1949000 { tcsr@1949000 {
compatible = "qcom,tcsr"; compatible = "qcom,tcsr";
reg = <0x1949000 0x100>; reg = <0x1949000 0x100>;
qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>; qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
}; };
tcsr@194b000 { tcsr@194b000 {
compatible = "qcom,tcsr"; compatible = "qcom,tcsr";
reg = <0x194b000 0x100>; reg = <0x194b000 0x100>;
qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>; qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
}; };
tcsr@1957000 { tcsr@1957000 {
compatible = "qcom,tcsr"; compatible = "qcom,tcsr";
reg = <0x1957000 0x100>; reg = <0x1957000 0x100>;
qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>; qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
}; };
}; };
keys { keys {
compatible = "gpio-keys"; compatible = "gpio-keys";
reset { reset {
label = "reset"; label = "reset";
gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>; linux,code = <KEY_RESTART>;
}; };
}; };
}; };
&tlmm { &tlmm {
mdio_pins: mdio-pinmux { mdio_pins: mdio-pinmux {
mux-1 { mux-1 {
pins = "gpio6"; pins = "gpio6";
function = "mdio"; function = "mdio";
bias-pull-up; bias-pull-up;
}; };
mux-2 { mux-2 {
pins = "gpio7"; pins = "gpio7";
function = "mdc"; function = "mdc";
bias-pull-up; bias-pull-up;
}; };
}; };
i2c_0_pins: i2c-0-pinmux { i2c_0_pins: i2c-0-pinmux {
mux { mux {
function = "blsp_i2c0"; function = "blsp_i2c0";
pins = "gpio20", "gpio21"; pins = "gpio20", "gpio21";
bias-disable; bias-disable;
}; };
}; };
serial_0_pins: serial0-pinmux { serial_0_pins: serial0-pinmux {
mux { mux {
pins = "gpio16", "gpio17"; pins = "gpio16", "gpio17";
function = "blsp_uart0"; function = "blsp_uart0";
bias-disable; bias-disable;
}; };
}; };
serial_1_pins: serial1-pinmux { serial_1_pins: serial1-pinmux {
mux { mux {
pins = "gpio8", "gpio9", "gpio10", "gpio11"; pins = "gpio8", "gpio9", "gpio10", "gpio11";
function = "blsp_uart1"; function = "blsp_uart1";
bias-disable; bias-disable;
}; };
}; };
spi_0_pins: spi-0-pinmux { spi_0_pins: spi-0-pinmux {
mux { mux {
function = "blsp_spi0"; function = "blsp_spi0";
pins = "gpio13", "gpio14", "gpio15"; pins = "gpio13", "gpio14", "gpio15";
drive-strength = <12>; drive-strength = <12>;
bias-disable; bias-disable;
}; };
mux-cs { mux-cs {
pins = "gpio12"; pins = "gpio12";
drive-strength = <2>; drive-strength = <2>;
bias-disable; bias-disable;
output-high; output-high;
}; };
}; };
spi_1_pins: spi-1-pinmux {
mux-1 {
function = "blsp_spi1";
pins = "gpio44", "gpio46","gpio47";
bias-disable;
};
mux-2 { spi_1_pins: spi-1-pinmux {
pins = "gpio31", "gpio45", "gpio49"; mux-1 {
function = "gpio"; function = "blsp_spi1";
bias-pull-up; pins = "gpio44", "gpio46","gpio47";
output-high; bias-disable;
}; };
host-interrupt { mux-2 {
pins = "gpio42"; pins = "gpio31", "gpio45", "gpio49";
function = "gpio"; function = "gpio";
input; bias-pull-up;
}; output-high;
}; };
wifi_0_pins: wifi0-pinmux { host-interrupt {
btcoexist { pins = "gpio42";
bias-pull-up; function = "gpio";
drive-strength = <6>; input;
function = "gpio"; };
output-high; };
pins = "gpio52";
};
};
zigbee-0 { wifi_0_pins: wifi0-pinmux {
gpio-hog; btcoexist {
gpios = <29 GPIO_ACTIVE_HIGH>; bias-pull-up;
bias-disable; drive-strength = <6>;
output-low; function = "gpio";
}; output-high;
pins = "gpio52";
};
};
zigbee-1 { zigbee-0 {
gpio-hog; gpio-hog;
gpios = <50 GPIO_ACTIVE_HIGH>; gpios = <29 GPIO_ACTIVE_HIGH>;
bias-disable; bias-disable;
input; output-low;
}; };
bluetooth-enable { zigbee-1 {
gpio-hog; gpio-hog;
gpios = <32 GPIO_ACTIVE_HIGH>; gpios = <50 GPIO_ACTIVE_HIGH>;
output-high; bias-disable;
}; input;
};
bluetooth-enable {
gpio-hog;
gpios = <32 GPIO_ACTIVE_HIGH>;
output-high;
};
}; };
&mdio { &mdio {
status = "okay"; status = "okay";
pinctrl-0 = <&mdio_pins>; pinctrl-0 = <&mdio_pins>;
pinctrl-names = "default"; pinctrl-names = "default";
phy-reset-gpios = <&tlmm 19 GPIO_ACTIVE_LOW>; phy-reset-gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
}; };
&ethphy0 { &ethphy0 {
status = "disabled"; status = "disabled";
}; };
&ethphy1 { &ethphy1 {
status = "disabled"; status = "disabled";
}; };
&ethphy2 { &ethphy2 {
status = "disabled"; status = "disabled";
}; };
&ethphy3 { &ethphy3 {
reg = <0x1b>; reg = <0x1b>;
}; };
&ethphy4 { &ethphy4 {
reg = <0x1c>; reg = <0x1c>;
}; };
&psgmiiphy { &psgmiiphy {
reg = <0x1d>; reg = <0x1d>;
}; };
&watchdog { &watchdog {
status = "okay"; status = "okay";
}; };
&prng { &prng {
status = "okay"; status = "okay";
}; };
&blsp_dma { &blsp_dma {
status = "okay"; status = "okay";
}; };
&cryptobam { &cryptobam {
num-channels = <4>; num-channels = <4>;
qcom,num-ees = <2>; qcom,num-ees = <2>;
status = "okay"; status = "okay";
}; };
&crypto { &crypto {
status = "okay"; status = "okay";
}; };
&blsp1_uart1 { &blsp1_uart1 {
status = "okay"; status = "okay";
pinctrl-0 = <&serial_0_pins>; pinctrl-0 = <&serial_0_pins>;
pinctrl-names = "default"; pinctrl-names = "default";
}; };
&blsp1_uart2 { &blsp1_uart2 {
status = "okay"; status = "okay";
pinctrl-0 = <&serial_1_pins>; pinctrl-0 = <&serial_1_pins>;
pinctrl-names = "default"; pinctrl-names = "default";
bluetooth { bluetooth {
compatible = "csr,8811"; compatible = "csr,8811";
enable-gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>; enable-gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>;
}; };
}; };
&blsp1_spi2 { &blsp1_spi2 {
pinctrl-0 = <&spi_1_pins>; pinctrl-0 = <&spi_1_pins>;
pinctrl-names = "default"; pinctrl-names = "default";
status = "okay"; status = "okay";
cs-gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>; cs-gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
zigbee@0 { zigbee@0 {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
compatible = "silabs,em3581"; compatible = "silabs,em3581";
reg = <0>; reg = <0>;
spi-max-frequency = <12000000>; spi-max-frequency = <12000000>;
}; };
}; };
&blsp1_i2c3 { &blsp1_i2c3 {
pinctrl-0 = <&i2c_0_pins>; pinctrl-0 = <&i2c_0_pins>;
pinctrl-names = "default"; pinctrl-names = "default";
status = "okay";
// RGB LEDs status = "okay";
pca9633: led-controller {
compatible = "nxp,pca9633";
nxp,hw-blink;
reg = <0x62>;
#address-cells = <1>;
#size-cells = <0>;
led_red: red@0 { // RGB LEDs
label = "red"; pca9633: led-controller {
color = <LED_COLOR_ID_RED>; compatible = "nxp,pca9633";
function = LED_FUNCTION_INDICATOR; nxp,hw-blink;
linux,default-trigger = "none"; reg = <0x62>;
reg = <0>; #address-cells = <1>;
}; #size-cells = <0>;
led_green: green@1 { led_red: red@0 {
label = "green"; label = "red";
color = <LED_COLOR_ID_GREEN>; color = <LED_COLOR_ID_RED>;
function = LED_FUNCTION_INDICATOR; function = LED_FUNCTION_INDICATOR;
linux,default-trigger = "none"; linux,default-trigger = "none";
reg = <1>; reg = <0>;
}; };
led_blue: blue@2 { led_green: green@1 {
label = "blue"; label = "green";
color = <LED_COLOR_ID_BLUE>; color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_INDICATOR; function = LED_FUNCTION_INDICATOR;
linux,default-trigger = "default-on"; linux,default-trigger = "none";
reg = <2>; reg = <1>;
}; };
};
led_blue: blue@2 {
label = "blue";
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_INDICATOR;
linux,default-trigger = "default-on";
reg = <2>;
};
};
}; };
&usb3_ss_phy { &usb3_ss_phy {
status = "okay"; status = "okay";
}; };
&usb3_hs_phy { &usb3_hs_phy {
status = "okay"; status = "okay";
}; };
&usb2_hs_phy { &usb2_hs_phy {
status = "okay"; status = "okay";
}; };
&nand { &nand {
status = "okay"; status = "okay";
nand@0 { nand@0 {
partitions { partitions {
compatible = "fixed-partitions"; compatible = "fixed-partitions";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
partition@0 { partition@0 {
label = "SBL1"; label = "SBL1";
reg = <0x0 0x100000>; reg = <0x0 0x100000>;
read-only; read-only;
}; };
partition@100000 { partition@100000 {
label = "MIBIB"; label = "MIBIB";
reg = <0x100000 0x100000>; reg = <0x100000 0x100000>;
read-only; read-only;
}; };
partition@200000 { partition@200000 {
label = "QSEE"; label = "QSEE";
reg = <0x200000 0x100000>; reg = <0x200000 0x100000>;
read-only; read-only;
}; };
partition@300000 { partition@300000 {
label = "CDT"; label = "CDT";
reg = <0x300000 0x80000>; reg = <0x300000 0x80000>;
read-only; read-only;
}; };
partition@380000 { partition@380000 {
label = "APPSBL"; label = "APPSBL";
reg = <0x380000 0x200000>; reg = <0x380000 0x200000>;
read-only; read-only;
}; };
partition@580000 { partition@580000 {
label = "ART"; label = "ART";
reg = <0x580000 0x80000>; reg = <0x580000 0x80000>;
compatible = "nvmem-cells"; compatible = "nvmem-cells";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
read-only; read-only;
precal_art_1000: precal@1000 { precal_art_1000: precal@1000 {
reg = <0x1000 0x2f20>; reg = <0x1000 0x2f20>;
}; };
precal_art_5000: precal@5000 { precal_art_5000: precal@5000 {
reg = <0x5000 0x2f20>; reg = <0x5000 0x2f20>;
}; };
precal_art_9000: precal@9000 { precal_art_9000: precal@9000 {
reg = <0x9000 0x2f20>; reg = <0x9000 0x2f20>;
}; };
macaddr_gmac0: macaddr@0 { macaddr_gmac0: macaddr@0 {
reg = <0x0 0x6>; reg = <0x0 0x6>;
}; };
macaddr_gmac1: macaddr@6 { macaddr_gmac1: macaddr@6 {
reg = <0x6 0x6>; reg = <0x6 0x6>;
}; };
}; };
partition@600000 { partition@600000 {
label = "u_env"; label = "u_env";
reg = <0x600000 0x80000>; reg = <0x600000 0x80000>;
}; };
partition@680000 { partition@680000 {
label = "s_env"; label = "s_env";
reg = <0x680000 0x40000>; reg = <0x680000 0x40000>;
}; };
partition@6c0000 { partition@6c0000 {
label = "devinfo"; label = "devinfo";
reg = <0x6c0000 0x40000>; reg = <0x6c0000 0x40000>;
read-only; read-only;
}; };
partition@700000 { partition@700000 {
label = "kernel"; label = "kernel";
reg = <0x700000 0xa100000>; reg = <0x700000 0xa100000>;
}; };
partition@d00000 { partition@d00000 {
label = "rootfs"; label = "rootfs";
reg = <0xd00000 0x9b00000>; reg = <0xd00000 0x9b00000>;
}; };
partition@a800000 { partition@a800000 {
label = "alt_kernel"; label = "alt_kernel";
reg = <0xa800000 0xa100000>; reg = <0xa800000 0xa100000>;
}; };
partition@ae00000 { partition@ae00000 {
label = "alt_rootfs"; label = "alt_rootfs";
reg = <0xae00000 0x9b00000>; reg = <0xae00000 0x9b00000>;
}; };
partition@14900000 { partition@14900000 {
label = "sysdiag"; label = "sysdiag";
reg = <0x14900000 0x200000>; reg = <0x14900000 0x200000>;
read-only; read-only;
}; };
partition@14b00000 { partition@14b00000 {
label = "syscfg"; label = "syscfg";
reg = <0x14b00000 0xb500000>; reg = <0x14b00000 0xb500000>;
read-only; read-only;
}; };
}; };
}; };
}; };
&pcie0 { &pcie0 {
status = "okay"; status = "okay";
perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
wake-gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; wake-gpios = <&tlmm 40 GPIO_ACTIVE_LOW>;
clkreq-gpios = <&tlmm 39 GPIO_ACTIVE_LOW>; clkreq-gpios = <&tlmm 39 GPIO_ACTIVE_LOW>;
bridge@0,0 { bridge@0,0 {
reg = <0x00000000 0 0 0 0>; reg = <0x00000000 0 0 0 0>;
#address-cells = <3>; #address-cells = <3>;
#size-cells = <2>; #size-cells = <2>;
ranges; ranges;
wifi2: wifi@1,0 { wifi2: wifi@1,0 {
compatible = "qcom,ath10k"; compatible = "qcom,ath10k";
reg = <0x00010000 0 0 0 0>; reg = <0x00010000 0 0 0 0>;
}; };
}; };
}; };
&qpic_bam { &qpic_bam {
status = "okay"; status = "okay";
}; };
&gmac { &gmac {
status = "okay"; status = "okay";
}; };
&switch { &switch {
status = "okay"; status = "okay";
}; };
&swport4 { &swport4 {
status = "okay"; status = "okay";
label = "lan"; label = "lan";
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_gmac1>; nvmem-cells = <&macaddr_gmac1>;
}; };
&swport5 { &swport5 {
status = "okay"; status = "okay";
label = "wan"; label = "wan";
nvmem-cell-names = "mac-address"; nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_gmac0>; nvmem-cells = <&macaddr_gmac0>;
}; };
&wifi0 { &wifi0 {
pinctrl-0 = <&wifi_0_pins>; pinctrl-0 = <&wifi_0_pins>;
pinctrl-names = "default"; pinctrl-names = "default";
status = "okay"; status = "okay";
qcom,coexist-support = <1>; qcom,coexist-support = <1>;
qcom,coexist-gpio-pin = <0x34>; qcom,coexist-gpio-pin = <0x34>;
ieee80211-freq-limit = <2401000 2473000>; ieee80211-freq-limit = <2401000 2473000>;
qcom,ath10k-calibration-variant = "linksys-whw03v2"; qcom,ath10k-calibration-variant = "linksys-whw03v2";
nvmem-cell-names = "pre-calibration", "mac-address"; nvmem-cell-names = "pre-calibration", "mac-address";
nvmem-cells = <&precal_art_1000>, <&macaddr_gmac0>; nvmem-cells = <&precal_art_1000>, <&macaddr_gmac0>;
mac-address-increment = <1>; mac-address-increment = <1>;
}; };
&wifi1 { &wifi1 {
status = "okay"; status = "okay";
ieee80211-freq-limit = <5170000 5250000>; ieee80211-freq-limit = <5170000 5250000>;
qcom,ath10k-calibration-variant = "linksys-whw03v2"; qcom,ath10k-calibration-variant = "linksys-whw03v2";
nvmem-cell-names = "pre-calibration", "mac-address"; nvmem-cell-names = "pre-calibration", "mac-address";
nvmem-cells = <&precal_art_5000>, <&macaddr_gmac0>; nvmem-cells = <&precal_art_5000>, <&macaddr_gmac0>;
mac-address-increment = <2>; mac-address-increment = <2>;
}; };
&wifi2 { &wifi2 {
status = "okay"; status = "okay";
ieee80211-freq-limit = <5735000 5835000>; ieee80211-freq-limit = <5735000 5835000>;
qcom,ath10k-calibration-variant = "linksys-whw03v2"; qcom,ath10k-calibration-variant = "linksys-whw03v2";
nvmem-cell-names = "pre-calibration", "mac-address"; nvmem-cell-names = "pre-calibration", "mac-address";
nvmem-cells = <&precal_art_9000>, <&macaddr_gmac0>; nvmem-cells = <&precal_art_9000>, <&macaddr_gmac0>;
mac-address-increment = <3>; mac-address-increment = <3>;
}; };

View file

@ -15,7 +15,7 @@
serial0 = &blsp1_uart1; serial0 = &blsp1_uart1;
serial1 = &blsp1_uart2; serial1 = &blsp1_uart2;
}; };
soc { soc {
rng@22000 { rng@22000 {

View file

@ -288,29 +288,29 @@
}; };
&gmac { &gmac {
status = "okay"; status = "okay";
}; };
&switch { &switch {
status = "okay"; status = "okay";
}; };
&swport1 { &swport1 {
status = "okay"; status = "okay";
}; };
&swport2 { &swport2 {
status = "okay"; status = "okay";
}; };
&swport3 { &swport3 {
status = "okay"; status = "okay";
}; };
&swport4 { &swport4 {
status = "okay"; status = "okay";
}; };
&swport5 { &swport5 {
status = "okay"; status = "okay";
}; };

View file

@ -92,7 +92,7 @@
/* No driver */ /* No driver */
compatible = "isl,isl28022"; compatible = "isl,isl28022";
reg = <0x40>; reg = <0x40>;
}; };
}; };
}; };

View file

@ -125,17 +125,17 @@
}; };
&gmac { &gmac {
status = "okay"; status = "okay";
}; };
&switch { &switch {
status = "okay"; status = "okay";
}; };
&swport5 { &swport5 {
status = "okay"; status = "okay";
label = "lan"; label = "lan";
}; };
&tlmm { &tlmm {

View file

@ -10,13 +10,15 @@
device_type = "memory"; device_type = "memory";
}; };
ramoops@42100000 { reserved-memory {
compatible = "ramoops"; ramoops@42100000 {
reg = <0x42100000 0x40000>; compatible = "ramoops";
record-size = <0x4000>; reg = <0x42100000 0x40000>;
console-size = <0x4000>; record-size = <0x4000>;
ftrace-size = <0x4000>; console-size = <0x4000>;
pmsg-size = <0x4000>; ftrace-size = <0x4000>;
pmsg-size = <0x4000>;
};
}; };
aliases { aliases {

View file

@ -55,6 +55,7 @@ CONFIG_BLK_MQ_PCI=y
CONFIG_BLK_MQ_VIRTIO=y CONFIG_BLK_MQ_VIRTIO=y
CONFIG_BLK_PM=y CONFIG_BLK_PM=y
CONFIG_CAVIUM_TX2_ERRATUM_219=y CONFIG_CAVIUM_TX2_ERRATUM_219=y
CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
CONFIG_CLONE_BACKWARDS=y CONFIG_CLONE_BACKWARDS=y
CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK=y
@ -257,8 +258,8 @@ CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=y
CONFIG_NVMEM=y CONFIG_NVMEM=y
CONFIG_NVMEM_QCOM_QFPROM=y CONFIG_NVMEM_QCOM_QFPROM=y
# CONFIG_NVMEM_SPMI_SDAM is not set # CONFIG_NVMEM_SPMI_SDAM is not set
CONFIG_NVMEM_U_BOOT_ENV=y
CONFIG_NVMEM_SYSFS=y CONFIG_NVMEM_SYSFS=y
CONFIG_NVMEM_U_BOOT_ENV=y
CONFIG_OF=y CONFIG_OF=y
CONFIG_OF_ADDRESS=y CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_EARLY_FLATTREE=y
@ -268,6 +269,7 @@ CONFIG_OF_IRQ=y
CONFIG_OF_KOBJ=y CONFIG_OF_KOBJ=y
CONFIG_OF_MDIO=y CONFIG_OF_MDIO=y
CONFIG_PADATA=y CONFIG_PADATA=y
# CONFIG_PAGE_POOL is not set
CONFIG_PARTITION_PERCPU=y CONFIG_PARTITION_PERCPU=y
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_PCIEAER=y CONFIG_PCIEAER=y

View file

@ -199,7 +199,7 @@
function = "gpio"; function = "gpio";
drive-strength = <8>; drive-strength = <8>;
bias-pull-down; bias-pull-down;
}; };
}; };
&blsp1_uart5 { &blsp1_uart5 {

View file

@ -258,7 +258,7 @@
}; };
&pciec { &pciec {
status = "okay"; status = "okay";
}; };
&pcie0 { &pcie0 {

View file

@ -8,7 +8,7 @@ define Device/avm_fritz7312
kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
ltq-adsl-app ppp-mod-pppoa \ ltq-adsl-app ppp-mod-pppoa \
kmod-ltq-deu-ar9 -swconfig kmod-ltq-deu-ar9 fritz-tffs -swconfig
endef endef
TARGET_DEVICES += avm_fritz7312 TARGET_DEVICES += avm_fritz7312
@ -24,7 +24,7 @@ define Device/avm_fritz7320
kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
ltq-adsl-app ppp-mod-pppoa \ ltq-adsl-app ppp-mod-pppoa \
kmod-ltq-deu-ar9 kmod-usb-dwc2 -swconfig kmod-ltq-deu-ar9 kmod-usb-dwc2 fritz-tffs -swconfig
SUPPORTED_DEVICES += FRITZ7320 SUPPORTED_DEVICES += FRITZ7320
endef endef
TARGET_DEVICES += avm_fritz7320 TARGET_DEVICES += avm_fritz7320

View file

@ -152,7 +152,8 @@ define Device/avm_fritz7360sl
$(Device/AVM) $(Device/AVM)
DEVICE_MODEL := FRITZ!Box 7360 SL DEVICE_MODEL := FRITZ!Box 7360 SL
IMAGE_SIZE := 15744k IMAGE_SIZE := 15744k
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2 DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
kmod-usb-dwc2 fritz-tffs
SUPPORTED_DEVICES += FRITZ7360SL SUPPORTED_DEVICES += FRITZ7360SL
endef endef
TARGET_DEVICES += avm_fritz7360sl TARGET_DEVICES += avm_fritz7360sl
@ -163,7 +164,8 @@ define Device/avm_fritz7360-v2
DEVICE_MODEL := FRITZ!Box 7360 DEVICE_MODEL := FRITZ!Box 7360
DEVICE_VARIANT := v2 DEVICE_VARIANT := v2
IMAGE_SIZE := 32128k IMAGE_SIZE := 32128k
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2 DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
kmod-usb-dwc2 fritz-tffs
endef endef
TARGET_DEVICES += avm_fritz7360-v2 TARGET_DEVICES += avm_fritz7360-v2
@ -174,7 +176,8 @@ define Device/avm_fritz7362sl
DEVICE_MODEL := FRITZ!Box 7362 SL DEVICE_MODEL := FRITZ!Box 7362 SL
KERNEL_SIZE := 4096k KERNEL_SIZE := 4096k
IMAGE_SIZE := 49152k IMAGE_SIZE := 49152k
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2 fritz-tffs DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
kmod-usb-dwc2 fritz-tffs
endef endef
TARGET_DEVICES += avm_fritz7362sl TARGET_DEVICES += avm_fritz7362sl
@ -186,7 +189,8 @@ define Device/avm_fritz7412
BOARD_NAME := FRITZ7412 BOARD_NAME := FRITZ7412
KERNEL_SIZE := 4096k KERNEL_SIZE := 4096k
IMAGE_SIZE := 49152k IMAGE_SIZE := 49152k
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls fritz-tffs-nand fritz-caldata DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
fritz-tffs-nand fritz-caldata
endef endef
TARGET_DEVICES += avm_fritz7412 TARGET_DEVICES += avm_fritz7412
@ -197,8 +201,8 @@ define Device/avm_fritz7430
DEVICE_MODEL := FRITZ!Box 7430 DEVICE_MODEL := FRITZ!Box 7430
KERNEL_SIZE := 4096k KERNEL_SIZE := 4096k
IMAGE_SIZE := 49152k IMAGE_SIZE := 49152k
DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader kmod-usb-dwc2 wpad-basic-mbedtls \ DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
fritz-tffs-nand fritz-caldata kmod-usb-dwc2 fritz-tffs-nand fritz-caldata
endef endef
TARGET_DEVICES += avm_fritz7430 TARGET_DEVICES += avm_fritz7430

View file

@ -3,7 +3,7 @@
#include "mt7986a-rfb.dtsi" #include "mt7986a-rfb.dtsi"
/ { / {
compatible = "mediatek,mt7986a-rfb-snor"; compatible = "mediatek,mt7986a-rfb-snor";
}; };
&spi0 { &spi0 {

View file

@ -1,30 +1,43 @@
CONFIG_ARCH_HAS_TICK_BROADCAST=y CONFIG_BLK_DEV_NVME=y
CONFIG_CPU_RMAP=y CONFIG_CPU_RMAP=y
CONFIG_DEFAULT_UIMAGE=y
CONFIG_FSL_ULI1575=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_IRQ_MIGRATION=y CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_GENERIC_MSI_IRQ=y
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
CONFIG_GENERIC_TBSYNC=y CONFIG_GENERIC_TBSYNC=y
CONFIG_HAVE_RCU_TABLE_FREE=y CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_LOCK_SPIN_ON_OWNER=y CONFIG_LOCK_SPIN_ON_OWNER=y
CONFIG_MDIO_DEVRES=y
CONFIG_MPC85xx_RDB=y CONFIG_MPC85xx_RDB=y
CONFIG_MTD_CFI=y CONFIG_MTD_CFI=y
CONFIG_MTD_NAND_BCH=y
CONFIG_MTD_NAND_ECC_BCH=y
CONFIG_MTD_NAND_FSL_ELBC=y CONFIG_MTD_NAND_FSL_ELBC=y
CONFIG_MTD_PHYSMAP=y CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_FIRMWARE=y
CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_SPLIT_FIT_FW=y
CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NET_FLOW_LIMIT=y CONFIG_NET_FLOW_LIMIT=y
CONFIG_NR_CPUS=2 CONFIG_NR_CPUS=2
CONFIG_NVME_CORE=y
# CONFIG_NVME_MULTIPATH is not set
CONFIG_PADATA=y CONFIG_PADATA=y
CONFIG_PCI_MSI=y CONFIG_PCI_MSI=y
CONFIG_PCI_MSI_ARCH_FALLBACKS=y
CONFIG_PCI_MSI_IRQ_DOMAIN=y
CONFIG_PPC_I8259=y
CONFIG_PPC_MSI_BITMAP=y CONFIG_PPC_MSI_BITMAP=y
# CONFIG_PPC_QUEUED_SPINLOCKS is not set CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_RFS_ACCEL=y CONFIG_RFS_ACCEL=y
CONFIG_RPS=y CONFIG_RPS=y
CONFIG_RTC_DRV_DS1307=y CONFIG_RTC_DRV_DS1307=y
CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_SMP=y CONFIG_SMP=y
CONFIG_SWIOTLB=y
CONFIG_TARGET_CPU="8540"
CONFIG_TARGET_CPU_BOOL=y
CONFIG_TREE_RCU=y CONFIG_TREE_RCU=y
CONFIG_TREE_SRCU=y CONFIG_TREE_SRCU=y
CONFIG_XPS=y CONFIG_XPS=y

View file

@ -106,7 +106,7 @@
}; };
&gpio { &gpio {
status = "okay"; status = "okay";
}; };
&spi0 { &spi0 {
@ -208,12 +208,12 @@
}; };
&switch0 { &switch0 {
ports { ports {
port@0 { port@0 {
status = "okay"; status = "okay";
label = "lan"; label = "lan";
}; };
}; };
}; };
&xhci { &xhci {

View file

@ -55,7 +55,7 @@
label = "white:net"; label = "white:net";
gpios = <&gpio 3 GPIO_ACTIVE_LOW>; gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
}; };
usb2_white { usb2_white {
label = "white:usb2"; label = "white:usb2";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>; gpios = <&gpio 13 GPIO_ACTIVE_LOW>;

View file

@ -65,7 +65,7 @@
label = "wps"; label = "wps";
gpios = <&gpio 41 GPIO_ACTIVE_LOW>; gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>; linux,code = <KEY_WPS_BUTTON>;
}; };
}; };
virtual_flash { virtual_flash {

View file

@ -8,7 +8,7 @@
}; };
&gmac1 { &gmac1 {
phy-handle = <&ethphy4>; phy-handle = <&ethphy4>;
}; };
&mdio { &mdio {

View file

@ -145,7 +145,7 @@
}; };
&switch0 { &switch0 {
ports { ports {
port@2 { port@2 {
status = "okay"; status = "okay";
label = "lan2"; label = "lan2";

View file

@ -49,8 +49,8 @@
}; };
&state_default { &state_default {
gpio { gpio {
groups = "uart3", "rgmii2"; groups = "uart3", "rgmii2";
function = "gpio"; function = "gpio";
}; };
}; };

View file

@ -14,7 +14,7 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3998,6 +3998,7 @@ static const struct net_device_ops mtk_n @@ -4227,6 +4227,7 @@ static const struct net_device_ops mtk_n
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
{ {
@ -22,7 +22,7 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
const __be32 *_id = of_get_property(np, "reg", NULL); const __be32 *_id = of_get_property(np, "reg", NULL);
phy_interface_t phy_mode; phy_interface_t phy_mode;
struct phylink *phylink; struct phylink *phylink;
@@ -4126,6 +4127,9 @@ static int mtk_add_mac(struct mtk_eth *e @@ -4355,6 +4356,9 @@ static int mtk_add_mac(struct mtk_eth *e
register_netdevice_notifier(&mac->device_notifier); register_netdevice_notifier(&mac->device_notifier);
} }

View file

@ -14,7 +14,7 @@
led-failsafe = &led_sys; led-failsafe = &led_sys;
led-running = &led_sys; led-running = &led_sys;
led-upgrade = &led_sys; led-upgrade = &led_sys;
}; };
memory@0 { memory@0 {
device_type = "memory"; device_type = "memory";
@ -149,7 +149,7 @@
regmap = <&ethernet0>; regmap = <&ethernet0>;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
/* External phy RTL8218B #1 */ /* External phy RTL8218B #1 */
EXTERNAL_PHY(0) EXTERNAL_PHY(0)
EXTERNAL_PHY(1) EXTERNAL_PHY(1)

View file

@ -5,7 +5,7 @@
/ { / {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
compatible = "realtek,rtl838x-soc"; compatible = "realtek,rtl838x-soc";
cpus { cpus {
@ -28,7 +28,7 @@
device_type = "memory"; device_type = "memory";
reg = <0x0 0x10000000>; reg = <0x0 0x10000000>;
}; };
chosen { chosen {
bootargs = "console=ttyS0,115200"; bootargs = "console=ttyS0,115200";
}; };
@ -75,7 +75,7 @@
clocks = <&cpuclock>; clocks = <&cpuclock>;
}; };
}; };
soc: soc { soc: soc {
compatible = "simple-bus"; compatible = "simple-bus";
#address-cells = <1>; #address-cells = <1>;

View file

@ -14,7 +14,7 @@
led-failsafe = &led_sys; led-failsafe = &led_sys;
led-running = &led_sys; led-running = &led_sys;
led-upgrade = &led_sys; led-upgrade = &led_sys;
}; };
memory@0 { memory@0 {
device_type = "memory"; device_type = "memory";
@ -149,7 +149,7 @@
regmap = <&ethernet0>; regmap = <&ethernet0>;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
/* External phy RTL8218B #1 */ /* External phy RTL8218B #1 */
EXTERNAL_PHY(0) EXTERNAL_PHY(0)
EXTERNAL_PHY(1) EXTERNAL_PHY(1)

View file

@ -5,7 +5,7 @@
/ { / {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
compatible = "realtek,rtl838x-soc"; compatible = "realtek,rtl838x-soc";
cpus { cpus {
@ -81,7 +81,7 @@
clocks = <&cpuclock>; clocks = <&cpuclock>;
}; };
}; };
soc: soc { soc: soc {
compatible = "simple-bus"; compatible = "simple-bus";
#address-cells = <1>; #address-cells = <1>;

View file

@ -43,8 +43,12 @@ HOST_CONFIGURE_ARGS = \
--host=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \ --target=$(REAL_GNU_TARGET_NAME) \
--with-sysroot=$(TOOLCHAIN_DIR) \ --with-sysroot=$(TOOLCHAIN_DIR) \
--with-system-zlib \
--without-zstd \
--enable-deterministic-archives \ --enable-deterministic-archives \
--enable-plugins \ --enable-plugins \
--enable-lto \
--disable-gprofng \
--disable-multilib \ --disable-multilib \
--disable-werror \ --disable-werror \
--disable-nls \ --disable-nls \

View file

@ -79,10 +79,6 @@ endif
GCC_CONFIGURE:= \ GCC_CONFIGURE:= \
SHELL="$(BASH)" \ SHELL="$(BASH)" \
$(if $(shell gcc --version 2>&1 | grep -E "Apple.(LLVM|clang)"), \
CFLAGS="-O2 -fbracket-depth=512 -pipe" \
CXXFLAGS="-O2 -fbracket-depth=512 -pipe" \
) \
$(HOST_SOURCE_DIR)/configure \ $(HOST_SOURCE_DIR)/configure \
--with-bugurl=$(BUGURL) \ --with-bugurl=$(BUGURL) \
--with-pkgversion="$(PKGVERSION)" \ --with-pkgversion="$(PKGVERSION)" \
@ -106,6 +102,8 @@ GCC_CONFIGURE:= \
--with-abi=$(call qstrip,$(CONFIG_MIPS64_ABI))) \ --with-abi=$(call qstrip,$(CONFIG_MIPS64_ABI))) \
$(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \ $(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \
$(if $(CONFIG_powerpc64), $(if $(CONFIG_USE_MUSL),--with-abi=elfv2)) \ $(if $(CONFIG_powerpc64), $(if $(CONFIG_USE_MUSL),--with-abi=elfv2)) \
--with-system-zlib=$(STAGING_DIR_HOST) \
--without-zstd \
--with-gmp=$(STAGING_DIR_HOST) \ --with-gmp=$(STAGING_DIR_HOST) \
--with-mpfr=$(STAGING_DIR_HOST) \ --with-mpfr=$(STAGING_DIR_HOST) \
--with-mpc=$(STAGING_DIR_HOST) \ --with-mpc=$(STAGING_DIR_HOST) \
@ -164,13 +162,21 @@ ifeq ($(CONFIG_TARGET_x86)$(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yyy)
TARGET_CFLAGS+=-fno-split-stack TARGET_CFLAGS+=-fno-split-stack
endif endif
CFLAGS:=$(HOST_CFLAGS) -pipe
ifneq ($(shell gcc --version 2>&1 | grep -E "Apple.(LLVM|clang)"),)
CFLAGS+= -fbracket-depth=512
endif
GCC_CONFIGURE+= \
CFLAGS="$(CFLAGS)" \
CXXFLAGS="$(CFLAGS)" \
CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
GOCFLAGS_FOR_TARGET="$(TARGET_CFLAGS)"
GCC_MAKE:= \ GCC_MAKE:= \
export SHELL="$(BASH)"; \ export SHELL="$(BASH)"; \
$(MAKE) \ $(MAKE)
CFLAGS="$(HOST_CFLAGS)" \
CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
GOCFLAGS_FOR_TARGET="$(TARGET_CFLAGS)"
define Host/SetToolchainInfo define Host/SetToolchainInfo
$(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk $(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk

View file

@ -8,6 +8,7 @@ GCC_CONFIGURE += \
--enable-shared \ --enable-shared \
--enable-threads \ --enable-threads \
--with-slibdir=$(TOOLCHAIN_DIR)/lib \ --with-slibdir=$(TOOLCHAIN_DIR)/lib \
--enable-plugins \
--enable-lto \ --enable-lto \
--with-libelf=$(STAGING_DIR_HOST) --with-libelf=$(STAGING_DIR_HOST)

View file

@ -38,8 +38,6 @@ HOST_CONFIGURE_ARGS := \
--system-zstd \ --system-zstd \
--generator=Ninja --generator=Ninja
HOST_LDFLAGS += -Wl,-rpath,$(STAGING_DIR_HOST)/lib
define Host/Compile/Default define Host/Compile/Default
+$(NINJA) -C $(HOST_BUILD_DIR) $(1) +$(NINJA) -C $(HOST_BUILD_DIR) $(1)
endef endef

View file

@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=e2fsprogs PKG_NAME:=e2fsprogs
PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
PKG_VERSION:=1.46.5 PKG_VERSION:=1.46.6
PKG_HASH:=2f16c9176704cf645dc69d5b15ff704ae722d665df38b2ed3cfc249757d8d81e PKG_HASH:=a77517f19ff5e4e97ede63536566865dd5d48654e13fc145f5f2249ef7c4f4fc
PKG_RELEASE:=2 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/ PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/

View file

@ -1,11 +1,11 @@
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -12538,7 +12538,7 @@ $as_echo_n "checking for system crontab @@ -15259,7 +15259,7 @@ then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5
$as_echo "${crond_dir}" >&6; } printf "%s\n" "${crond_dir}" >&6; }
- have_crond="yes" - have_crond="yes"
+ have_crond="no"; with_crond_dir="" + have_crond="no"; with_crond_dir=""
else else $as_nop

View file

@ -1,50 +0,0 @@
From ab51d587bb9b229b1fade1afd02e1574c1ba5c76 Mon Sep 17 00:00:00 2001
From: Lukas Czerner <lczerner@redhat.com>
Date: Thu, 21 Apr 2022 19:31:48 +0200
Subject: libext2fs: add sanity check to extent manipulation
It is possible to have a corrupted extent tree in such a way that a leaf
node contains zero extents in it. Currently if that happens and we try
to traverse the tree we can end up accessing wrong data, or possibly
even uninitialized memory. Make sure we don't do that.
Additionally make sure that we have a sane number of bytes passed to
memmove() in ext2fs_extent_delete().
Note that e2fsck is currently unable to spot and fix such corruption in
pass1.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reported-by: Nils Bars <nils_bars@t-online.de>
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2068113
Addresses: CVE-2022-1304
Addresses-Debian-Bug: #1010263
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
lib/ext2fs/extent.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -495,6 +495,10 @@ retry:
ext2fs_le16_to_cpu(eh->eh_entries);
newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max);
+ /* Make sure there is at least one extent present */
+ if (newpath->left <= 0)
+ return EXT2_ET_EXTENT_NO_DOWN;
+
if (path->left > 0) {
ix++;
newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block);
@@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_exte
cp = path->curr;
+ /* Sanity check before memmove() */
+ if (path->left < 0)
+ return EXT2_ET_EXTENT_LEAF_BAD;
+
if (path->left) {
memmove(cp, cp + sizeof(struct ext3_extent_idx),
path->left * sizeof(struct ext3_extent_idx));

View file

@ -17,9 +17,9 @@ include $(INCLUDE_DIR)/meson.mk
MESON_HOST_BUILD_DIR:=$(HOST_BUILD_DIR)/build/meson/openwrt-build MESON_HOST_BUILD_DIR:=$(HOST_BUILD_DIR)/build/meson/openwrt-build
HOSTCC:= $(HOSTCC_NOCACHE) HOSTCC:= $(HOSTCC_NOCACHE)
HOST_LDFLAGS += -Wl,-rpath,$(STAGING_DIR_HOST)/lib
MESON_HOST_ARGS += \ MESON_HOST_ARGS += \
-Ddefault_library=static \
-Dlegacy_level=7 \ -Dlegacy_level=7 \
-Ddebug_level=0 \ -Ddebug_level=0 \
-Dbacktrace=false \ -Dbacktrace=false \