Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2023-04-02 18:54:35 +08:00
commit 76d202039c
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
52 changed files with 520 additions and 856 deletions

View File

@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .104
LINUX_KERNEL_HASH-5.15.104 = 71c532ce09992e470f3259ffeb38d2b5bba990c243a559e4726a57412bd36b54
LINUX_VERSION-5.15 = .105
LINUX_KERNEL_HASH-5.15.105 = 01b537650332d2852722a626169cf7e5e798d11f9b578171b477868555f5e44f

View File

@ -950,7 +950,7 @@ define KernelPackage/tg3
TITLE:=Broadcom Tigon3 Gigabit Ethernet
KCONFIG:=CONFIG_TIGON3 \
CONFIG_TIGON3_HWMON=n
DEPENDS:=+!TARGET_bcm47xx:kmod-libphy +kmod-ptp
DEPENDS:=@PCI_SUPPORT +!TARGET_bcm47xx:kmod-libphy +kmod-ptp
SUBMENU:=$(NETWORK_DEVICES_MENU)
FILES:=$(LINUX_DIR)/drivers/net/ethernet/broadcom/tg3.ko
AUTOLOAD:=$(call AutoLoad,19,tg3,1)
@ -966,7 +966,7 @@ $(eval $(call KernelPackage,tg3))
define KernelPackage/hfcpci
TITLE:=HFC PCI cards (single port) support for mISDN
KCONFIG:=CONFIG_MISDN_HFCPCI
DEPENDS:=+kmod-misdn
DEPENDS:=@PCI_SUPPORT +kmod-misdn
SUBMENU:=$(NETWORK_DEVICES_MENU)
FILES:=$(LINUX_DIR)/drivers/isdn/hardware/mISDN/hfcpci.ko
AUTOLOAD:=$(call AutoLoad,31,hfcpci)
@ -983,7 +983,7 @@ $(eval $(call KernelPackage,hfcpci))
define KernelPackage/hfcmulti
TITLE:=HFC multiport cards (HFC-4S/8S/E1) support for mISDN
KCONFIG:=CONFIG_MISDN_HFCMULTI
DEPENDS:=+kmod-misdn
DEPENDS:=@PCI_SUPPORT +kmod-misdn
SUBMENU:=$(NETWORK_DEVICES_MENU)
FILES:=$(LINUX_DIR)/drivers/isdn/hardware/mISDN/hfcmulti.ko
AUTOLOAD:=$(call AutoLoad,31,hfcmulti)

View File

@ -12,9 +12,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/libnl-tiny.git
PKG_SOURCE_DATE:=2022-11-01
PKG_SOURCE_VERSION:=db3b2cdbca5277723326a2720024a59fb821ae36
PKG_MIRROR_HASH:=f6f9e2cb5366cda3be6d27a6320aa6cf3681c0b10df07b29ab4e4005e9f04f1c
PKG_SOURCE_DATE:=2023-04-02
PKG_SOURCE_VERSION:=11b7c5f0745af2637b48131287f28689bb80ed3e
PKG_MIRROR_HASH:=9bcae026ad1fde81865ea113d24bbc70c2bd1945655d51cd00181c41b70570d2
CMAKE_INSTALL:=1
PKG_LICENSE:=LGPL-2.1

View File

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libtraceevent
PKG_VERSION:=1.7.1
PKG_VERSION:=1.7.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/
PKG_HASH:=17b7131c106793c3b45477445bd32d295170c4245ed8348e03c17296e53009e1
PKG_HASH:=a8b4bf8f05c06d1d6405f6d0038467a87e7ab218f0d8b0608d08bca5d1fc112a
PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>

View File

@ -67,7 +67,7 @@ proto_dhcp_setup() {
-p /var/run/udhcpc-$iface.pid \
-s /lib/netifd/dhcp.script \
-f -t 0 -i "$iface" \
${ipaddr:+-r $ipaddr} \
${ipaddr:+-r ${ipaddr/\/*/}} \
${hostname:+-x "hostname:$hostname"} \
${vendorid:+-V "$vendorid"} \
$clientid $defaultreqopts $broadcast $norelease $dhcpopts

View File

@ -557,6 +557,8 @@ dhcp_add() {
config_get leasetime "$cfg" leasetime 12h
config_get options "$cfg" options
config_get_bool dynamicdhcp "$cfg" dynamicdhcp 1
config_get_bool dynamicdhcpv4 "$cfg" dynamicdhcpv4 $dynamicdhcp
config_get_bool dynamicdhcpv6 "$cfg" dynamicdhcpv6 $dynamicdhcp
config_get dhcpv4 "$cfg" dhcpv4
config_get dhcpv6 "$cfg" dhcpv6
@ -586,12 +588,12 @@ dhcp_add() {
# make sure the DHCP range is not empty
if [ "$dhcpv4" != "disabled" ] && eval "$(ipcalc.sh "${subnet%%/*}" "$netmask" "$start" "$limit")" ; then
[ "$dynamicdhcp" = "0" ] && END="static"
[ "$dynamicdhcpv4" = "0" ] && END="static"
xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}"
fi
if [ "$dynamicdhcp" = "0" ] ; then
if [ "$dynamicdhcpv6" = "0" ] ; then
dhcp6range="::,static"
else
dhcp6range="::1000,::ffff"
@ -1213,6 +1215,7 @@ dnsmasq_start()
[ ! -e "$logfacility" ] && touch "$logfacility"
procd_add_jail_mount_rw "$logfacility"
esac
[ -e "$hostsfile" ] && procd_add_jail_mount $hostsfile
procd_close_instance

View File

@ -25,7 +25,7 @@ Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
u32 *data, int in_pm)
{
@@ -1837,7 +1841,8 @@ static int smsc95xx_rx_fixup(struct usbn
@@ -1843,7 +1847,8 @@ static int smsc95xx_rx_fixup(struct usbn
if (dev->net->features & NETIF_F_RXCSUM)
smsc95xx_rx_csum_offload(skb);
skb_trim(skb, skb->len - 4); /* remove fcs */
@ -35,7 +35,7 @@ Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
return 1;
}
@@ -1855,7 +1860,8 @@ static int smsc95xx_rx_fixup(struct usbn
@@ -1861,7 +1866,8 @@ static int smsc95xx_rx_fixup(struct usbn
if (dev->net->features & NETIF_F_RXCSUM)
smsc95xx_rx_csum_offload(ax_skb);
skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */

View File

@ -88,7 +88,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
commit->event = kzalloc(sizeof(*commit->event),
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -10821,6 +10821,19 @@ static int intel_atomic_commit(struct dr
@@ -10822,6 +10822,19 @@ static int intel_atomic_commit(struct dr
state->base.legacy_cursor_update = false;
}

View File

@ -414,7 +414,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
/* forking complete and child started to run, tell ptracer */
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5007,6 +5007,7 @@ context_switch(struct rq *rq, struct tas
@@ -5010,6 +5010,7 @@ context_switch(struct rq *rq, struct tas
* finish_task_switch()'s mmdrop().
*/
switch_mm_irqs_off(prev->active_mm, next->mm, next);

View File

@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1194,27 +1194,31 @@ static int
@@ -1190,27 +1190,31 @@ static int
mt7530_port_bridge_join(struct dsa_switch *ds, int port,
struct net_device *bridge)
{
@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
/* Add the all other ports to this port matrix. */
@@ -1319,24 +1323,28 @@ static void
@@ -1315,24 +1319,28 @@ static void
mt7530_port_bridge_leave(struct dsa_switch *ds, int port,
struct net_device *bridge)
{

View File

@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2407,6 +2407,32 @@ mt7531_setup(struct dsa_switch *ds)
@@ -2412,6 +2412,32 @@ mt7531_setup(struct dsa_switch *ds)
return 0;
}
@ -56,7 +56,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool
mt7530_phy_mode_supported(struct dsa_switch *ds, int port,
const struct phylink_link_state *state)
@@ -2443,6 +2469,37 @@ static bool mt7531_is_rgmii_port(struct
@@ -2448,6 +2474,37 @@ static bool mt7531_is_rgmii_port(struct
return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
}
@ -94,7 +94,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool
mt7531_phy_mode_supported(struct dsa_switch *ds, int port,
const struct phylink_link_state *state)
@@ -2919,6 +2976,18 @@ mt7531_cpu_port_config(struct dsa_switch
@@ -2924,6 +2981,18 @@ mt7531_cpu_port_config(struct dsa_switch
return 0;
}
@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void
mt7530_mac_port_validate(struct dsa_switch *ds, int port,
unsigned long *supported)
@@ -3154,6 +3223,7 @@ static const struct dsa_switch_ops mt753
@@ -3159,6 +3228,7 @@ static const struct dsa_switch_ops mt753
.port_vlan_del = mt7530_port_vlan_del,
.port_mirror_add = mt753x_port_mirror_add,
.port_mirror_del = mt753x_port_mirror_del,
@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phylink_validate = mt753x_phylink_validate,
.phylink_mac_link_state = mt753x_phylink_mac_link_state,
.phylink_mac_config = mt753x_phylink_mac_config,
@@ -3171,6 +3241,7 @@ static const struct mt753x_info mt753x_t
@@ -3176,6 +3246,7 @@ static const struct mt753x_info mt753x_t
.phy_read = mt7530_phy_read,
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
@ -129,7 +129,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7530_phy_mode_supported,
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
@@ -3182,6 +3253,7 @@ static const struct mt753x_info mt753x_t
@@ -3187,6 +3258,7 @@ static const struct mt753x_info mt753x_t
.phy_read = mt7530_phy_read,
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
@ -137,7 +137,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7530_phy_mode_supported,
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
@@ -3194,6 +3266,7 @@ static const struct mt753x_info mt753x_t
@@ -3199,6 +3271,7 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7531_ind_phy_write,
.pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config,
@ -145,7 +145,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phy_mode_supported = mt7531_phy_mode_supported,
.mac_port_validate = mt7531_mac_port_validate,
.mac_port_get_state = mt7531_phylink_mac_link_state,
@@ -3256,6 +3329,7 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3261,6 +3334,7 @@ mt7530_probe(struct mdio_device *mdiodev
*/
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||

View File

@ -21,7 +21,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2433,37 +2433,6 @@ static void mt7530_mac_port_get_caps(str
@@ -2438,37 +2438,6 @@ static void mt7530_mac_port_get_caps(str
}
}
@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static bool mt7531_is_rgmii_port(struct mt7530_priv *priv, u32 port)
{
return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
@@ -2500,44 +2469,6 @@ static void mt7531_mac_port_get_caps(str
@@ -2505,44 +2474,6 @@ static void mt7531_mac_port_get_caps(str
}
}
@ -104,7 +104,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static int
mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
{
@@ -2792,9 +2723,6 @@ mt753x_phylink_mac_config(struct dsa_swi
@@ -2797,9 +2728,6 @@ mt753x_phylink_mac_config(struct dsa_swi
struct mt7530_priv *priv = ds->priv;
u32 mcr_cur, mcr_new;
@ -114,7 +114,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
switch (port) {
case 0 ... 4: /* Internal phy */
if (state->interface != PHY_INTERFACE_MODE_GMII)
@@ -3010,12 +2938,6 @@ mt753x_phylink_validate(struct dsa_switc
@@ -3015,12 +2943,6 @@ mt753x_phylink_validate(struct dsa_switc
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
struct mt7530_priv *priv = ds->priv;
@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
phylink_set_port_modes(mask);
if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
@@ -3242,7 +3164,6 @@ static const struct mt753x_info mt753x_t
@@ -3247,7 +3169,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@ -135,7 +135,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
@@ -3254,7 +3175,6 @@ static const struct mt753x_info mt753x_t
@@ -3259,7 +3180,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@ -143,7 +143,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7530_mac_port_validate,
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
@@ -3267,7 +3187,6 @@ static const struct mt753x_info mt753x_t
@@ -3272,7 +3192,6 @@ static const struct mt753x_info mt753x_t
.pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config,
.mac_port_get_caps = mt7531_mac_port_get_caps,
@ -151,7 +151,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_validate = mt7531_mac_port_validate,
.mac_port_get_state = mt7531_phylink_mac_link_state,
.mac_port_config = mt7531_mac_config,
@@ -3330,7 +3249,6 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3335,7 +3254,6 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps ||

View File

@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2962,11 +2962,6 @@ mt753x_phylink_validate(struct dsa_switc
@@ -2967,11 +2967,6 @@ mt753x_phylink_validate(struct dsa_switc
linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask);

View File

@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2540,12 +2540,13 @@ static int mt7531_rgmii_setup(struct mt7
@@ -2545,12 +2545,13 @@ static int mt7531_rgmii_setup(struct mt7
}
static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port,
@ -38,7 +38,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
phylink_set(supported, 2500baseX_Full);
phylink_set(supported, 2500baseT_Full);
}
@@ -2918,16 +2919,18 @@ static void mt753x_phylink_get_caps(stru
@@ -2923,16 +2924,18 @@ static void mt753x_phylink_get_caps(stru
static void
mt7530_mac_port_validate(struct dsa_switch *ds, int port,
@ -58,7 +58,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static void
@@ -2950,12 +2953,13 @@ mt753x_phylink_validate(struct dsa_switc
@@ -2955,12 +2958,13 @@ mt753x_phylink_validate(struct dsa_switc
}
/* This switch only supports 1G full-duplex. */

View File

@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2539,19 +2539,6 @@ static int mt7531_rgmii_setup(struct mt7
@@ -2544,19 +2544,6 @@ static int mt7531_rgmii_setup(struct mt7
return 0;
}
@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void
mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port,
unsigned int mode, phy_interface_t interface,
@@ -2918,51 +2905,21 @@ static void mt753x_phylink_get_caps(stru
@@ -2923,51 +2910,21 @@ static void mt753x_phylink_get_caps(stru
}
static void
@ -97,7 +97,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask);
@@ -3163,7 +3120,6 @@ static const struct mt753x_info mt753x_t
@@ -3168,7 +3125,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@ -105,7 +105,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
},
@@ -3174,7 +3130,6 @@ static const struct mt753x_info mt753x_t
@@ -3179,7 +3135,6 @@ static const struct mt753x_info mt753x_t
.phy_write = mt7530_phy_write,
.pad_setup = mt7530_pad_clk_setup,
.mac_port_get_caps = mt7530_mac_port_get_caps,
@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
},
@@ -3186,7 +3141,6 @@ static const struct mt753x_info mt753x_t
@@ -3191,7 +3146,6 @@ static const struct mt753x_info mt753x_t
.pad_setup = mt7531_pad_setup,
.cpu_port_config = mt7531_cpu_port_config,
.mac_port_get_caps = mt7531_mac_port_get_caps,
@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.mac_port_get_state = mt7531_phylink_mac_link_state,
.mac_port_config = mt7531_mac_config,
.mac_pcs_an_restart = mt7531_sgmii_restart_an,
@@ -3248,7 +3202,6 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3253,7 +3207,6 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps ||

View File

@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* String, offset, and register size in bytes if different from 4 bytes */
static const struct mt7530_mib_desc mt7530_mib[] = {
MIB_DESC(1, 0x00, "TxDrop"),
@@ -2539,12 +2544,11 @@ static int mt7531_rgmii_setup(struct mt7
@@ -2544,12 +2549,11 @@ static int mt7531_rgmii_setup(struct mt7
return 0;
}
@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
unsigned int val;
/* For adjusting speed and duplex of SGMII force mode. */
@@ -2570,6 +2574,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
@@ -2575,6 +2579,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
/* MT7531 SGMII 1G force mode can only work in full duplex mode,
* no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not.
@ -60,7 +60,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
*/
if ((speed == SPEED_10 || speed == SPEED_100) &&
duplex != DUPLEX_FULL)
@@ -2645,9 +2652,10 @@ static int mt7531_sgmii_setup_mode_an(st
@@ -2650,9 +2657,10 @@ static int mt7531_sgmii_setup_mode_an(st
return 0;
}
@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u32 val;
/* Only restart AN when AN is enabled */
@@ -2704,6 +2712,24 @@ mt753x_mac_config(struct dsa_switch *ds,
@@ -2709,6 +2717,24 @@ mt753x_mac_config(struct dsa_switch *ds,
return priv->info->mac_port_config(ds, port, mode, state->interface);
}
@ -98,7 +98,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void
mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
const struct phylink_link_state *state)
@@ -2765,17 +2791,6 @@ unsupported:
@@ -2770,17 +2796,6 @@ unsupported:
mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
}
@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port,
unsigned int mode,
phy_interface_t interface)
@@ -2785,16 +2800,13 @@ static void mt753x_phylink_mac_link_down
@@ -2790,16 +2805,13 @@ static void mt753x_phylink_mac_link_down
mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
}
@ -139,7 +139,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
@@ -2807,8 +2819,6 @@ static void mt753x_phylink_mac_link_up(s
@@ -2812,8 +2824,6 @@ static void mt753x_phylink_mac_link_up(s
struct mt7530_priv *priv = ds->priv;
u32 mcr;
@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
/* MT753x MAC works in 1G full duplex mode for all up-clocked
@@ -2886,6 +2896,8 @@ mt7531_cpu_port_config(struct dsa_switch
@@ -2891,6 +2901,8 @@ mt7531_cpu_port_config(struct dsa_switch
return ret;
mt7530_write(priv, MT7530_PMCR_P(port),
PMCR_CPU_PORT_SETTING(priv->id));
@ -157,7 +157,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL,
speed, DUPLEX_FULL, true, true);
@@ -2925,16 +2937,13 @@ mt753x_phylink_validate(struct dsa_switc
@@ -2930,16 +2942,13 @@ mt753x_phylink_validate(struct dsa_switc
linkmode_and(state->advertising, state->advertising, mask);
}
@ -178,7 +178,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
pmsr = mt7530_read(priv, MT7530_PMSR_P(port));
state->link = (pmsr & PMSR_LINK);
@@ -2961,8 +2970,6 @@ mt7530_phylink_mac_link_state(struct dsa
@@ -2966,8 +2975,6 @@ mt7530_phylink_mac_link_state(struct dsa
state->pause |= MLO_PAUSE_RX;
if (pmsr & PMSR_TX_FC)
state->pause |= MLO_PAUSE_TX;
@ -187,7 +187,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static int
@@ -3004,32 +3011,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
@@ -3009,32 +3016,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
return 0;
}
@ -249,7 +249,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (ret)
return ret;
@@ -3042,6 +3066,13 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3047,6 +3071,13 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);
@ -263,7 +263,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return ret;
}
@@ -3103,9 +3134,8 @@ static const struct dsa_switch_ops mt753
@@ -3108,9 +3139,8 @@ static const struct dsa_switch_ops mt753
.port_mirror_del = mt753x_port_mirror_del,
.phylink_get_caps = mt753x_phylink_get_caps,
.phylink_validate = mt753x_phylink_validate,
@ -274,7 +274,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.phylink_mac_link_down = mt753x_phylink_mac_link_down,
.phylink_mac_link_up = mt753x_phylink_mac_link_up,
.get_mac_eee = mt753x_get_mac_eee,
@@ -3115,36 +3145,34 @@ static const struct dsa_switch_ops mt753
@@ -3120,36 +3150,34 @@ static const struct dsa_switch_ops mt753
static const struct mt753x_info mt753x_table[] = {
[ID_MT7621] = {
.id = ID_MT7621,
@ -314,7 +314,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
},
};
@@ -3202,7 +3230,7 @@ mt7530_probe(struct mdio_device *mdiodev
@@ -3207,7 +3235,7 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps ||

View File

@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2916,25 +2916,16 @@ static void mt753x_phylink_get_caps(stru
@@ -2921,25 +2921,16 @@ static void mt753x_phylink_get_caps(stru
priv->info->mac_port_get_caps(ds, port, config);
}
@ -55,7 +55,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static void mt7530_pcs_get_state(struct phylink_pcs *pcs,
@@ -3036,12 +3027,14 @@ static void mt7530_pcs_an_restart(struct
@@ -3041,12 +3032,14 @@ static void mt7530_pcs_an_restart(struct
}
static const struct phylink_pcs_ops mt7530_pcs_ops = {
@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
.pcs_get_state = mt7531_pcs_get_state,
.pcs_config = mt753x_pcs_config,
.pcs_an_restart = mt7531_pcs_an_restart,
@@ -3133,7 +3126,6 @@ static const struct dsa_switch_ops mt753
@@ -3138,7 +3131,6 @@ static const struct dsa_switch_ops mt753
.port_mirror_add = mt753x_port_mirror_add,
.port_mirror_del = mt753x_port_mirror_del,
.phylink_get_caps = mt753x_phylink_get_caps,

View File

@ -19,7 +19,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2913,6 +2913,12 @@ static void mt753x_phylink_get_caps(stru
@@ -2918,6 +2918,12 @@ static void mt753x_phylink_get_caps(stru
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000FD;

View File

@ -81,7 +81,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3051,9 +3051,16 @@ static int
@@ -3056,9 +3056,16 @@ static int
mt753x_setup(struct dsa_switch *ds)
{
struct mt7530_priv *priv = ds->priv;
@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (ret)
return ret;
@@ -3065,13 +3072,6 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3070,13 +3077,6 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);

View File

@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1540,11 +1540,11 @@ static void
@@ -1536,11 +1536,11 @@ static void
mt7530_hw_vlan_add(struct mt7530_priv *priv,
struct mt7530_hw_vlan_entry *entry)
{
@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Validate the entry with independent learning, create egress tag per
* VLAN and joining the port as one of the port members.
@@ -1555,22 +1555,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p
@@ -1551,22 +1551,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p
/* Decide whether adding tag or not for those outgoing packets from the
* port inside the VLAN.
@ -72,7 +72,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
static void
@@ -1589,11 +1587,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p
@@ -1585,11 +1583,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p
return;
}

View File

@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2105,11 +2105,12 @@ static int
@@ -2101,11 +2101,12 @@ static int
mt7530_setup(struct dsa_switch *ds)
{
struct mt7530_priv *priv = ds->priv;
@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
u32 id, val;
int ret, i;
@@ -2117,7 +2118,19 @@ mt7530_setup(struct dsa_switch *ds)
@@ -2113,7 +2114,19 @@ mt7530_setup(struct dsa_switch *ds)
* controller also is the container for two GMACs nodes representing
* as two netdev instances.
*/
@ -51,7 +51,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
ds->assisted_learning_on_cpu_port = true;
ds->mtu_enforcement_ingress = true;
@@ -2281,6 +2294,7 @@ mt7531_setup(struct dsa_switch *ds)
@@ -2286,6 +2299,7 @@ mt7531_setup(struct dsa_switch *ds)
{
struct mt7530_priv *priv = ds->priv;
struct mt7530_dummy_poll p;
@ -59,7 +59,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
u32 val, id;
int ret, i;
@@ -2355,8 +2369,11 @@ mt7531_setup(struct dsa_switch *ds)
@@ -2360,8 +2374,11 @@ mt7531_setup(struct dsa_switch *ds)
CORE_PLL_GROUP4, val);
/* BPDU to CPU port */

View File

@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1044,6 +1044,7 @@ static int
@@ -1040,6 +1040,7 @@ static int
mt7530_port_enable(struct dsa_switch *ds, int port,
struct phy_device *phy)
{
@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex);
@@ -1052,7 +1053,11 @@ mt7530_port_enable(struct dsa_switch *ds
@@ -1048,7 +1049,11 @@ mt7530_port_enable(struct dsa_switch *ds
* restore the port matrix if the port is the member of a certain
* bridge.
*/
@ -42,7 +42,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
priv->ports[port].enable = true;
mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK,
priv->ports[port].pm);
@@ -1200,7 +1205,8 @@ mt7530_port_bridge_join(struct dsa_switc
@@ -1196,7 +1201,8 @@ mt7530_port_bridge_join(struct dsa_switc
struct net_device *bridge)
{
struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex);
@@ -1277,9 +1283,12 @@ mt7530_port_set_vlan_unaware(struct dsa_
@@ -1273,9 +1279,12 @@ mt7530_port_set_vlan_unaware(struct dsa_
* the CPU port get out of VLAN filtering mode.
*/
if (all_user_ports_removed) {
@ -67,7 +67,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
}
}
@@ -1329,6 +1338,7 @@ mt7530_port_bridge_leave(struct dsa_swit
@@ -1325,6 +1334,7 @@ mt7530_port_bridge_leave(struct dsa_swit
struct net_device *bridge)
{
struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct mt7530_priv *priv = ds->priv;
mutex_lock(&priv->reg_mutex);
@@ -1357,8 +1367,8 @@ mt7530_port_bridge_leave(struct dsa_swit
@@ -1353,8 +1363,8 @@ mt7530_port_bridge_leave(struct dsa_swit
*/
if (priv->ports[port].enable)
mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK,
@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* When a port is removed from the bridge, the port would be set up
* back to the default as is at initial boot which is a VLAN-unaware
@@ -1521,6 +1531,9 @@ static int
@@ -1517,6 +1527,9 @@ static int
mt7530_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering,
struct netlink_ext_ack *extack)
{
@ -96,7 +96,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (vlan_filtering) {
/* The port is being kept as VLAN-unaware port when bridge is
* set up with vlan_filtering not being set, Otherwise, the
@@ -1528,7 +1541,7 @@ mt7530_port_vlan_filtering(struct dsa_sw
@@ -1524,7 +1537,7 @@ mt7530_port_vlan_filtering(struct dsa_sw
* for becoming a VLAN-aware port.
*/
mt7530_port_set_vlan_aware(ds, port);

View File

@ -0,0 +1,49 @@
From 45977e58ce65ed0459edc9a0466d9dfea09463f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Thu, 23 Mar 2023 20:48:41 +0100
Subject: [PATCH] net: dsa: b53: mmap: add phy ops
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Implement phy_read16() and phy_write16() ops for B53 MMAP to avoid accessing
B53_PORT_MII_PAGE registers which hangs the device.
This access should be done through the MDIO Mux bus controller.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/dsa/b53/b53_mmap.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -216,6 +216,18 @@ static int b53_mmap_write64(struct b53_d
return 0;
}
+static int b53_mmap_phy_read16(struct b53_device *dev, int addr, int reg,
+ u16 *value)
+{
+ return -EIO;
+}
+
+static int b53_mmap_phy_write16(struct b53_device *dev, int addr, int reg,
+ u16 value)
+{
+ return -EIO;
+}
+
static const struct b53_io_ops b53_mmap_ops = {
.read8 = b53_mmap_read8,
.read16 = b53_mmap_read16,
@@ -227,6 +239,8 @@ static const struct b53_io_ops b53_mmap_
.write32 = b53_mmap_write32,
.write48 = b53_mmap_write48,
.write64 = b53_mmap_write64,
+ .phy_read16 = b53_mmap_phy_read16,
+ .phy_write16 = b53_mmap_phy_write16,
};
static int b53_mmap_probe_of(struct platform_device *pdev,

View File

@ -1,30 +0,0 @@
From 30796d0dcb6e41c6558a07950f2ce60c209da867 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Thu, 16 Mar 2023 18:28:07 +0100
Subject: [PATCH] net: dsa: b53: mmap: fix device tree support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
CPU port should also be enabled in order to get a working switch.
Fixes: a5538a777b73 ("net: dsa: b53: mmap: Add device tree support")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20230316172807.460146-1-noltari@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/dsa/b53/b53_mmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -263,7 +263,7 @@ static int b53_mmap_probe_of(struct plat
if (of_property_read_u32(of_port, "reg", &reg))
continue;
- if (reg < B53_CPU_PORT)
+ if (reg < B53_N_PORTS)
pdata->enabled_ports |= BIT(reg);
}

View File

@ -1,65 +0,0 @@
From 032a954061afd4b7426c3eb6bfd2952ef1e9a384 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Sun, 19 Mar 2023 10:55:40 +0100
Subject: [PATCH] net: dsa: tag_brcm: legacy: fix daisy-chained switches
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When BCM63xx internal switches are connected to switches with a 4-byte
Broadcom tag, it does not identify the packet as VLAN tagged, so it adds one
based on its PVID (which is likely 0).
Right now, the packet is received by the BCM63xx internal switch and the 6-byte
tag is properly processed. The next step would to decode the corresponding
4-byte tag. However, the internal switch adds an invalid VLAN tag after the
6-byte tag and the 4-byte tag handling fails.
In order to fix this we need to remove the invalid VLAN tag after the 6-byte
tag before passing it to the 4-byte tag decoding.
Fixes: 964dbf186eaa ("net: dsa: tag_brcm: add support for legacy tags")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20230319095540.239064-1-noltari@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
net/dsa/tag_brcm.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- a/net/dsa/tag_brcm.c
+++ b/net/dsa/tag_brcm.c
@@ -7,6 +7,7 @@
#include <linux/dsa/brcm.h>
#include <linux/etherdevice.h>
+#include <linux/if_vlan.h>
#include <linux/list.h>
#include <linux/slab.h>
@@ -248,6 +249,7 @@ static struct sk_buff *brcm_leg_tag_xmit
static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff *skb,
struct net_device *dev)
{
+ int len = BRCM_LEG_TAG_LEN;
int source_port;
u8 *brcm_tag;
@@ -262,12 +264,16 @@ static struct sk_buff *brcm_leg_tag_rcv(
if (!skb->dev)
return NULL;
+ /* VLAN tag is added by BCM63xx internal switch */
+ if (netdev_uses_dsa(skb->dev))
+ len += VLAN_HLEN;
+
/* Remove Broadcom tag and update checksum */
- skb_pull_rcsum(skb, BRCM_LEG_TAG_LEN);
+ skb_pull_rcsum(skb, len);
dsa_default_offload_fwd_mark(skb);
- dsa_strip_etype_header(skb, BRCM_LEG_TAG_LEN);
+ dsa_strip_etype_header(skb, len);
return skb;
}

View File

@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2716,9 +2716,6 @@ mt7531_mac_config(struct dsa_switch *ds,
@@ -2721,9 +2721,6 @@ mt7531_mac_config(struct dsa_switch *ds,
case PHY_INTERFACE_MODE_NA:
case PHY_INTERFACE_MODE_1000BASEX:
case PHY_INTERFACE_MODE_2500BASEX:
@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
return mt7531_sgmii_setup_mode_force(priv, port, interface);
default:
return -EINVAL;
@@ -2794,13 +2791,6 @@ unsupported:
@@ -2799,13 +2796,6 @@ unsupported:
return;
}
@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
mcr_new = mcr_cur;
mcr_new &= ~PMCR_LINK_SETTINGS_MASK;
@@ -2937,6 +2927,9 @@ static void mt753x_phylink_get_caps(stru
@@ -2942,6 +2932,9 @@ static void mt753x_phylink_get_caps(stru
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000FD;
@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* This driver does not make use of the speed, duplex, pause or the
* advertisement in its mac_config, so it is safe to mark this driver
* as non-legacy.
@@ -3002,6 +2995,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
@@ -3007,6 +3000,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
status = mt7530_read(priv, MT7531_PCS_CONTROL_1(port));
state->link = !!(status & MT7531_SGMII_LINK_STATUS);
@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (state->interface == PHY_INTERFACE_MODE_SGMII &&
(status & MT7531_SGMII_AN_ENABLE)) {
val = mt7530_read(priv, MT7531_PCS_SPEED_ABILITY(port));
@@ -3032,16 +3026,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
@@ -3037,16 +3031,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
return 0;
}
@ -109,7 +109,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
@@ -3082,6 +3104,8 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3087,6 +3109,8 @@ mt753x_setup(struct dsa_switch *ds)
priv->pcs[i].pcs.ops = priv->info->pcs_ops;
priv->pcs[i].priv = priv;
priv->pcs[i].port = i;

View File

@ -81,7 +81,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
#include <linux/phylink.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
@@ -2568,128 +2569,11 @@ static int mt7531_rgmii_setup(struct mt7
@@ -2573,128 +2574,11 @@ static int mt7531_rgmii_setup(struct mt7
return 0;
}
@ -210,7 +210,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
static int
mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
phy_interface_t interface)
@@ -2712,11 +2596,11 @@ mt7531_mac_config(struct dsa_switch *ds,
@@ -2717,11 +2601,11 @@ mt7531_mac_config(struct dsa_switch *ds,
phydev = dp->slave->phydev;
return mt7531_rgmii_setup(priv, port, interface, phydev);
case PHY_INTERFACE_MODE_SGMII:
@ -224,7 +224,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
default:
return -EINVAL;
}
@@ -2741,11 +2625,11 @@ mt753x_phylink_mac_select_pcs(struct dsa
@@ -2746,11 +2630,11 @@ mt753x_phylink_mac_select_pcs(struct dsa
switch (interface) {
case PHY_INTERFACE_MODE_TRGMII:
@ -238,7 +238,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
default:
return NULL;
}
@@ -2986,86 +2870,6 @@ static void mt7530_pcs_get_state(struct
@@ -2991,86 +2875,6 @@ static void mt7530_pcs_get_state(struct
state->pause |= MLO_PAUSE_TX;
}
@ -325,7 +325,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
phy_interface_t interface,
const unsigned long *advertising,
@@ -3085,18 +2889,57 @@ static const struct phylink_pcs_ops mt75
@@ -3090,18 +2894,57 @@ static const struct phylink_pcs_ops mt75
.pcs_an_restart = mt7530_pcs_an_restart,
};
@ -389,7 +389,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
int i, ret;
/* Initialise the PCS devices */
@@ -3104,8 +2947,6 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3109,8 +2952,6 @@ mt753x_setup(struct dsa_switch *ds)
priv->pcs[i].pcs.ops = priv->info->pcs_ops;
priv->pcs[i].priv = priv;
priv->pcs[i].port = i;
@ -398,7 +398,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
}
ret = priv->info->sw_setup(ds);
@@ -3120,6 +2961,16 @@ mt753x_setup(struct dsa_switch *ds)
@@ -3125,6 +2966,16 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);
@ -415,7 +415,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
return ret;
}
@@ -3211,7 +3062,7 @@ static const struct mt753x_info mt753x_t
@@ -3216,7 +3067,7 @@ static const struct mt753x_info mt753x_t
},
[ID_MT7531] = {
.id = ID_MT7531,
@ -424,7 +424,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
.sw_setup = mt7531_setup,
.phy_read = mt7531_ind_phy_read,
.phy_write = mt7531_ind_phy_write,
@@ -3319,7 +3170,7 @@ static void
@@ -3324,7 +3175,7 @@ static void
mt7530_remove(struct mdio_device *mdiodev)
{
struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
@ -433,7 +433,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
if (!priv)
return;
@@ -3338,6 +3189,10 @@ mt7530_remove(struct mdio_device *mdiode
@@ -3343,6 +3194,10 @@ mt7530_remove(struct mdio_device *mdiode
mt7530_free_irq(priv);
dsa_unregister_switch(priv->ds);

View File

@ -72,7 +72,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+MODULE_LICENSE("GPL");
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4213,6 +4213,7 @@ int wake_up_state(struct task_struct *p,
@@ -4216,6 +4216,7 @@ int wake_up_state(struct task_struct *p,
{
return try_to_wake_up(p, state, 0);
}

View File

@ -0,0 +1,22 @@
From: Joe Mullally <jwmullally@gmail.com>
Subject: mtd/spi-nor/xmc: add support for XMC XM25QH64C
The XMC XM25QH64C is a 8MB SPI NOR chip. The patch is verified on TL-WPA8631P v3.
Datasheet available at https://www.xmcwh.com/uploads/442/XM25QH64C.pdf
Signed-off-by: Joe Mullally <jwmullally@gmail.com>
---
drivers/mtd/spi-nor/xmc.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/mtd/spi-nor/xmc.c
+++ b/drivers/mtd/spi-nor/xmc.c
@@ -12,6 +12,8 @@ static const struct flash_info xmc_parts
/* XMC (Wuhan Xinxin Semiconductor Manufacturing Corp.) */
{ "XM25QH64A", INFO(0x207017, 0, 64 * 1024, 128,
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+ { "XM25QH64C", INFO(0x204017, 0, 64 * 1024, 128,
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "XM25QH128A", INFO(0x207018, 0, 64 * 1024, 256,
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "XM25QH128C", INFO(0x204018, 0, 64 * 1024, 256,

View File

@ -0,0 +1,22 @@
From: Joe Mullally <jwmullally@gmail.com>
Subject: mtd/spi-nor/xmc: add support for XMC XM25QH64C
The XMC XM25QH64C is a 8MB SPI NOR chip. The patch is verified on TL-WPA8631P v3.
Datasheet available at https://www.xmcwh.com/uploads/442/XM25QH64C.pdf
Signed-off-by: Joe Mullally <jwmullally@gmail.com>
---
drivers/mtd/spi-nor/xmc.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/mtd/spi-nor/xmc.c
+++ b/drivers/mtd/spi-nor/xmc.c
@@ -12,6 +12,8 @@ static const struct flash_info xmc_parts
/* XMC (Wuhan Xinxin Semiconductor Manufacturing Corp.) */
{ "XM25QH64A", INFO(0x207017, 0, 64 * 1024, 128,
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+ { "XM25QH64C", INFO(0x204017, 0, 64 * 1024, 128,
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "XM25QH128A", INFO(0x207018, 0, 64 * 1024, 256,
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "XM25QH128C", INFO(0x204018, 0, 64 * 1024, 256,

View File

@ -15,7 +15,7 @@ Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2342,6 +2342,10 @@ mt7531_setup(struct dsa_switch *ds)
@@ -2347,6 +2347,10 @@ mt7531_setup(struct dsa_switch *ds)
return -ENODEV;
}

View File

@ -94,7 +94,7 @@ Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -333,8 +333,11 @@ static void b53_mmap_shutdown(struct pla
@@ -347,8 +347,11 @@ static void b53_mmap_shutdown(struct pla
static const struct of_device_id b53_mmap_of_table[] = {
{ .compatible = "brcm,bcm3384-switch" },

View File

@ -122,7 +122,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
.vlans = 4096,
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -248,7 +248,7 @@ static int b53_mmap_probe_of(struct plat
@@ -262,7 +262,7 @@ static int b53_mmap_probe_of(struct plat
return -ENOMEM;
pdata->regs = mem;
@ -131,7 +131,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
pdata->big_endian = of_property_read_bool(np, "big-endian");
of_ports = of_get_child_by_name(np, "ports");
@@ -332,14 +332,28 @@ static void b53_mmap_shutdown(struct pla
@@ -346,14 +346,28 @@ static void b53_mmap_shutdown(struct pla
}
static const struct of_device_id b53_mmap_of_table[] = {

View File

@ -1,118 +0,0 @@
From patchwork Thu Mar 23 19:48:41 2023
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?=
<noltari@gmail.com>
X-Patchwork-Id: 13186039
X-Patchwork-Delegate: kuba@kernel.org
Return-Path: <netdev-owner@vger.kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
aws-us-west-2-korg-lkml-1.web.codeaurora.org
Received: from vger.kernel.org (vger.kernel.org [23.128.96.18])
by smtp.lore.kernel.org (Postfix) with ESMTP id 968C3C6FD1C
for <netdev@archiver.kernel.org>; Thu, 23 Mar 2023 19:48:57 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S230463AbjCWTs4 (ORCPT <rfc822;netdev@archiver.kernel.org>);
Thu, 23 Mar 2023 15:48:56 -0400
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55372 "EHLO
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
with ESMTP id S231235AbjCWTsv (ORCPT
<rfc822;netdev@vger.kernel.org>); Thu, 23 Mar 2023 15:48:51 -0400
Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com
[IPv6:2a00:1450:4864:20::431])
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ECB01040F;
Thu, 23 Mar 2023 12:48:46 -0700 (PDT)
Received: by mail-wr1-x431.google.com with SMTP id i9so21784869wrp.3;
Thu, 23 Mar 2023 12:48:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20210112; t=1679600924;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=/D6faZLuMe7xaso6CO/2kkyQATErE9ouEiXJJAWuYSw=;
b=Sy0AoQ2nURFU7hQ4iDJucgH+I1i7hZxm6erI5lMl/wC/XyNRhAZD+ZJSzlFJBQDtoD
hZThEQp9Ad0QKaZFom1OzYTuNqWp1QWKY+AJFN/vyaEKWP/Q1jYAIRkTJK3c+qpZwesc
Oha96WNA7SfaVJ/HBCTlaPwV1/N7X5gOWxoqX59Fb4KDRLJ7PBASD6XXxTnaeFudYogB
Vg3Mq+rm/TApR/IPWANEO7KqEr6StC0P0EN1tSnfPdAkxSkByuM34l+pr5LXD8w91MGe
1BQSl1vHyZQjR/WJmiZl1QAgSaJR0EVn2isPcjOIjQPBg+HQ4AY4MFoaOTm6RanKzloA
BtWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112; t=1679600924;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=/D6faZLuMe7xaso6CO/2kkyQATErE9ouEiXJJAWuYSw=;
b=GoOv7EUR83WD3MWgKMC9ENLuaNcBHHis524Yrd5LxZOocYFmdtARV8Gfgk2WHyQ5lM
zoNvI+h6alZwbu2qWJq9KbAUekFUm5/qkjWvPGRMcQVt9aKiCI/nLy6zYG4tJSqT2kyX
FHbhy2GbJIriCm8ENoRfzE5RhAjxFuaaD+/apSEA5IK4a7hm+VKDWJDe+VF8C/Vah/Bp
tK2LG14OdhhwFmepUsr9lA7jzTqhyCAFklHW+frebH2K/D4ZzvcScvXTx3k+d8+7ZuYr
BkPI0fgMryZdYgeGDWnox5s1jIzQQn4laPpNczVMu06i9j8ANfjnZ9uICrpUDAAKgn+x
uGBg==
X-Gm-Message-State: AAQBX9efILx1adxeGqvUsSK8ibPnaoTHCJA78gzwtmsK+HYaaGH/yO4t
xPl4Q8TUvNTDcy2J2/mFy80=
X-Google-Smtp-Source:
AKy350bX5yENhBXAjV5ZhqRDlOsZvqU+xNCSUbf4jNQtqB8hjgDg9RB7fVuazc+3ZdlciEIHI1q/jg==
X-Received: by 2002:adf:f30c:0:b0:2cf:ed87:37c9 with SMTP id
i12-20020adff30c000000b002cfed8737c9mr200232wro.11.1679600924524;
Thu, 23 Mar 2023 12:48:44 -0700 (PDT)
Received: from atlantis.lan (255.red-79-146-124.dynamicip.rima-tde.net.
[79.146.124.255])
by smtp.gmail.com with ESMTPSA id
p17-20020adfcc91000000b002c71dd1109fsm16952587wrj.47.2023.03.23.12.48.43
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 23 Mar 2023 12:48:44 -0700 (PDT)
From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <noltari@gmail.com>
To: f.fainelli@gmail.com, jonas.gorski@gmail.com, andrew@lunn.ch,
olteanv@gmail.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <noltari@gmail.com>
Subject: [PATCH] net: dsa: b53: mmap: add phy ops
Date: Thu, 23 Mar 2023 20:48:41 +0100
Message-Id: <20230323194841.1431878-1-noltari@gmail.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Precedence: bulk
List-ID: <netdev.vger.kernel.org>
X-Mailing-List: netdev@vger.kernel.org
X-Patchwork-Delegate: kuba@kernel.org
Implement phy_read16() and phy_write16() ops for B53 MMAP to avoid accessing
B53_PORT_MII_PAGE registers which hangs the device.
This access should be done through the MDIO Mux bus controller.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
drivers/net/dsa/b53/b53_mmap.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -216,6 +216,18 @@ static int b53_mmap_write64(struct b53_d
return 0;
}
+static int b53_mmap_phy_read16(struct b53_device *dev, int addr, int reg,
+ u16 *value)
+{
+ return -EIO;
+}
+
+static int b53_mmap_phy_write16(struct b53_device *dev, int addr, int reg,
+ u16 value)
+{
+ return -EIO;
+}
+
static const struct b53_io_ops b53_mmap_ops = {
.read8 = b53_mmap_read8,
.read16 = b53_mmap_read16,
@@ -227,6 +239,8 @@ static const struct b53_io_ops b53_mmap_
.write32 = b53_mmap_write32,
.write48 = b53_mmap_write48,
.write64 = b53_mmap_write64,
+ .phy_read16 = b53_mmap_phy_read16,
+ .phy_write16 = b53_mmap_phy_write16,
};
static int b53_mmap_probe_of(struct platform_device *pdev,

View File

@ -63,6 +63,11 @@
&nand {
status = "okay";
mediatek,nmbm;
mediatek,bmt-remap-range =
<0x000000 0x7e0000>,
<0x35e0000 0x7800000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
@ -110,13 +115,22 @@
};
partition@3e0000 {
label = "kernel";
reg = <0x3e0000 0x400000>;
};
label = "firmware";
reg = <0x3e0000 0x3200000>;
partition@7e0000 {
label = "ubi";
reg = <0x7e0000 0x2e00000>;
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "kernel";
reg = <0x0 0x400000>;
};
partition@400000 {
label = "ubi";
reg = <0x400000 0x2e00000>;
};
};
partition@35e0000 {
@ -124,7 +138,12 @@
reg = <0x35e0000 0x3200000>;
};
/* Last 8M possibly store the bad block table */
partition@67e0000 {
label = "jffs2";
reg = <0x67e0000 0x1020000>;
};
/* Last 8M are reserved for NMBM management (bad blocks) */
};
};

View File

@ -0,0 +1,196 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "hanyang,hyc-g920", "mediatek,mt7621-soc";
model = "CJ-Hello HYC-G920";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
chosen {
bootargs = "console=ttyS0,115200";
bootargs-override = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
led_power: power {
label = "red:power";
gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
};
usb {
label = "green:usb";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
trigger-sources = <&ehci_port2>;
linux,default-trigger = "usbport";
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
debounce-interval = <60>;
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "bootloader";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "mac";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0xfb0000>;
};
partition@fb0000 {
label = "config ";
reg = <0xfb0000 0x20000>;
read-only;
};
partition@fd0000 {
label = "config_bak ";
reg = <0xfd0000 0x20000>;
read-only;
};
partition@ff0000 {
label = "mac_bak ";
reg = <0xff0000 0x10000>;
read-only;
};
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
led {
led-sources = <2>;
led-active-low;
};
};
};
&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0000>;
led {
led-sources = <2>;
led-active-low;
};
};
};
&gmac0 {
nvmem-cells = <&macaddr_factory_4>;
nvmem-cell-names = "mac-address";
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
nvmem-cells = <&macaddr_factory_4>;
nvmem-cell-names = "mac-address";
mac-address-increment = <1>;
};
port@1 {
status = "okay";
label = "lan1";
};
port@2 {
status = "okay";
label = "lan2";
};
port@3 {
status = "okay";
label = "lan3";
};
port@4 {
status = "okay";
label = "lan4";
};
};
};
&state_default {
gpio {
groups = "sdhci";
function = "gpio";
};
};
&factory {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_factory_4: macaddr@4 {
reg = <0x4 0x6>;
};
macaddr_factory_8004: macaddr@8004 {
reg = <0x8004 0x6>;
};
};

View File

@ -976,6 +976,16 @@ define Device/gnubee_gb-pc2
endef
TARGET_DEVICES += gnubee_gb-pc2
define Device/hanyang_hyc-g920
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
DEVICE_VENDOR := Hanyang
DEVICE_MODEL := CJ-Hello HYC-G920
IMAGE_SIZE := 15744k
DEVICE_PACKAGES := kmod-usb3 kmod-mt76x2 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += hanyang_hyc-g920
define Device/h3c_tx180x
$(Device/dsa-migration)
BLOCKSIZE := 128k

View File

@ -0,0 +1,75 @@
#!/bin/sh
# This must run before 10-wifi-detect
[ "${ACTION}" = "add" ] || return
. /lib/functions.sh
check_radio()
{
local cfg="$1" to="$2"
config_get path "$cfg" path
[ "$path" = "$to" ] && PATH_EXISTS=true
}
do_migrate_radio()
{
local cfg="$1" from="$2" to="$3"
config_get path "$cfg" path
[ "$path" = "$from" ] || return
uci set "wireless.${cfg}.path=${to}"
WIRELESS_CHANGED=true
logger -t wifi-migrate "Updated path of wireless.${cfg} from '${from}' to '${to}'"
}
migrate_radio()
{
local from="$1" to="$2"
config_load wireless
# Check if there is already a section with the target path: In this case, the system
# was already upgraded to a version without this migration script before; better bail out,
# as we can't be sure we don't break more than we fix.
PATH_EXISTS=false
config_foreach check_radio wifi-device "$to"
$PATH_EXISTS && return
config_foreach do_migrate_radio wifi-device "$from" "$to"
}
WIRELESS_CHANGED=false
case "$(board_name)" in
arcadyan,we420223-99|\
beeline,smartbox-flash|\
mts,wg430223)
migrate_radio '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0' '1e140000.pcie/pci0000:00/0000:00:01.0/0000:01:00.0'
migrate_radio '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0+1' '1e140000.pcie/pci0000:00/0000:00:01.0/0000:01:00.0+1'
;;
netgear,r6220|\
netgear,wac104|\
netgear,wndr3700-v5)
migrate_radio '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0' '1e140000.pcie/pci0000:00/0000:00:02.0/0000:02:00.0'
;;
zbtlink,zbt-we1326)
migrate_radio '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0' '1e140000.pcie/pci0000:00/0000:00:02.0/0000:02:00.0'
migrate_radio '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0' '1e140000.pcie/pci0000:00/0000:00:01.0/0000:01:00.0'
;;
esac
$WIRELESS_CHANGED && uci commit wireless
exit 0

View File

@ -1,19 +0,0 @@
#!/bin/sh /etc/rc.common
START=99
start() {
if grep -q 'processor.*: 2' /proc/cpuinfo; then
mask=4
elif grep -q 'processor.*: 1' /proc/cpuinfo; then
mask=2
else
return
fi
for irq in $(grep "mt76..e" /proc/interrupts | cut -d: -f1 | sed 's, *,,')
do
echo "$mask" > "/proc/irq/$irq/smp_affinity"
[ $mask = 4 ] && mask=8
done
}

View File

@ -16,7 +16,7 @@ still required by target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -59,13 +59,13 @@ static const char *phy_state_to_str(enum
@@ -71,13 +71,13 @@ static void phy_process_state_change(str
static void phy_link_up(struct phy_device *phydev)
{
@ -33,7 +33,7 @@ still required by target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c
phy_led_trigger_change_speed(phydev);
}
@@ -551,7 +551,7 @@ int phy_start_cable_test(struct phy_devi
@@ -563,7 +563,7 @@ int phy_start_cable_test(struct phy_devi
goto out;
/* Mark the carrier down until the test is complete */
@ -42,7 +42,7 @@ still required by target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c
netif_testing_on(dev);
err = phydev->drv->cable_test_start(phydev);
@@ -622,7 +622,7 @@ int phy_start_cable_test_tdr(struct phy_
@@ -634,7 +634,7 @@ int phy_start_cable_test_tdr(struct phy_
goto out;
/* Mark the carrier down until the test is complete */
@ -51,7 +51,7 @@ still required by target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c
netif_testing_on(dev);
err = phydev->drv->cable_test_tdr_start(phydev, config);
@@ -694,7 +694,7 @@ static int phy_check_link_status(struct
@@ -706,7 +706,7 @@ static int phy_check_link_status(struct
phy_link_up(phydev);
} else if (!phydev->link && phydev->state != PHY_NOLINK) {
phydev->state = PHY_NOLINK;
@ -60,7 +60,7 @@ still required by target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c
}
return 0;
@@ -1177,7 +1177,7 @@ void phy_state_machine(struct work_struc
@@ -1192,7 +1192,7 @@ void phy_state_machine(struct work_struc
case PHY_HALTED:
if (phydev->link) {
phydev->link = 0;

View File

@ -11,7 +11,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -694,7 +694,10 @@ static int phy_check_link_status(struct
@@ -706,7 +706,10 @@ static int phy_check_link_status(struct
phy_link_up(phydev);
} else if (!phydev->link && phydev->state != PHY_NOLINK) {
phydev->state = PHY_NOLINK;
@ -23,7 +23,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
}
return 0;
@@ -1177,7 +1180,10 @@ void phy_state_machine(struct work_struc
@@ -1192,7 +1195,10 @@ void phy_state_machine(struct work_struc
case PHY_HALTED:
if (phydev->link) {
phydev->link = 0;

View File

@ -1,6 +1,6 @@
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -510,6 +510,12 @@ static int dwc2_driver_probe(struct plat
@@ -498,6 +498,12 @@ static int dwc2_driver_probe(struct plat
if (retval)
return retval;

View File

@ -8,20 +8,22 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=squashfs4
PKG_CPE_ID:=cpe:/a:phillip_lougher:squashfs
PKG_VERSION:=4.5.1
PKG_VERSION:=4.6.1
PKG_RELEASE=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/plougher/squashfs-tools
PKG_SOURCE_DATE:=2022-03-17
PKG_SOURCE_VERSION:=afdd63fc386919b4aa40d573b0a6069414d14317
PKG_MIRROR_HASH:=59c294e00ddfc1f4bda658c7567584ce35fdd479c413ebdb1376981b27737be1
PKG_SOURCE_DATE:=2023-03-26
PKG_SOURCE_VERSION:=d8cb82d9840330f9344ec37b992595b5d7b44184
PKG_MIRROR_HASH:=fc625af657ca284d69fbc32e3bb572d0afd566cf816b7c1c1b66dda0a0c2760a
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
define Host/Compile
+$(HOST_MAKE_VARS) \
$(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \
$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/squashfs-tools \
XZ_SUPPORT=1 \
LZMA_XZ_SUPPORT=1 \
EXTRA_CFLAGS="-I$(STAGING_DIR_HOST)/include" \

View File

@ -1,39 +0,0 @@
From a9119c969af0a5aa961d56978d5dd4f3eb952667 Mon Sep 17 00:00:00 2001
From: Phillip Lougher <phillip@squashfs.org.uk>
Date: Mon, 15 Aug 2022 17:04:43 +0100
Subject: [PATCH 1/1] Unsquashfs: Add and make some header includes conditional
Fixes https://github.com/plougher/squashfs-tools/issues/122
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
---
squashfs-tools/reader.c | 1 +
squashfs-tools/unsquashfs.c | 5 +++++
2 files changed, 6 insertions(+)
--- a/squashfs-tools/reader.c
+++ b/squashfs-tools/reader.c
@@ -38,6 +38,7 @@
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
+#include <signal.h>
#include "squashfs_fs.h"
#include "mksquashfs.h"
#include "caches-queues-lists.h"
--- a/squashfs-tools/unsquashfs.c
+++ b/squashfs-tools/unsquashfs.c
@@ -32,8 +32,13 @@
#include "stdarg.h"
#include "fnmatch_compat.h"
+#ifdef __linux__
#include <sys/sysinfo.h>
#include <sys/sysmacros.h>
+#elif defined __FreeBSD__
+#include <sys/sysctl.h>
+#endif
+
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>

View File

@ -1,30 +0,0 @@
From 374e39a786a5acda841056bec26fd0e0c4d40dac Mon Sep 17 00:00:00 2001
From: Phillip Lougher <phillip@squashfs.org.uk>
Date: Mon, 15 Aug 2022 17:09:05 +0100
Subject: [PATCH 1/1] Mksquashfs: Make sysinfo() conditional
Fixes https://github.com/plougher/squashfs-tools/issues/123
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
---
squashfs-tools/mksquashfs.c | 2 ++
1 file changed, 2 insertions(+)
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -5802,6 +5802,7 @@ static int get_physical_memory()
long long page_size = sysconf(_SC_PAGESIZE);
int phys_mem;
+#ifdef __linux__
if(num_pages == -1 || page_size == -1) {
struct sysinfo sys;
int res = sysinfo(&sys);
@@ -5812,6 +5813,7 @@ static int get_physical_memory()
num_pages = sys.totalram;
page_size = sys.mem_unit;
}
+#endif
phys_mem = num_pages * page_size >> 20;

View File

@ -1,92 +0,0 @@
From bc8e655a420d2f62bb0597947e96dce7b4d3fb36 Mon Sep 17 00:00:00 2001
From: Wessel Dankers <wsl@fruit.je>
Date: Sun, 30 Oct 2022 19:29:28 +0100
Subject: [PATCH] Only use available CPUs
Not all online CPUs may be available for the current process,
especially when CPU affinity is involved. In such cases too many
threads will be created, which will then compete unnecessarily
for CPU time.
Use sched_getaffinity() to determine the correct number of threads
to create.
---
squashfs-tools/mksquashfs.c | 16 ++++++++++++----
squashfs-tools/unsquashfs.c | 13 ++++++++++---
2 files changed, 22 insertions(+), 7 deletions(-)
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -52,7 +52,9 @@
#include <ctype.h>
#include <sys/sysinfo.h>
-#ifndef linux
+#ifdef linux
+#include <sched.h>
+#else
#include <sys/sysctl.h>
#endif
@@ -5079,7 +5081,15 @@ static void initialise_threads(int readq
BAD_ERROR("Failed to set signal mask in intialise_threads\n");
if(processors == -1) {
-#ifndef linux
+#ifdef linux
+ cpu_set_t cpu_set;
+ CPU_ZERO(&cpu_set);
+
+ if(sched_getaffinity(0, sizeof cpu_set, &cpu_set) == -1)
+ processors = sysconf(_SC_NPROCESSORS_ONLN);
+ else
+ processors = CPU_COUNT(&cpu_set);
+#else
int mib[2];
size_t len = sizeof(processors);
@@ -5096,8 +5106,6 @@ static void initialise_threads(int readq
ERROR_EXIT(" Defaulting to 1\n");
processors = 1;
}
-#else
- processors = sysconf(_SC_NPROCESSORS_ONLN);
#endif
}
--- a/squashfs-tools/unsquashfs.c
+++ b/squashfs-tools/unsquashfs.c
@@ -33,6 +33,7 @@
#include "fnmatch_compat.h"
#ifdef __linux__
+#include <sched.h>
#include <sys/sysinfo.h>
#include <sys/sysmacros.h>
#elif defined __FreeBSD__
@@ -2719,7 +2720,15 @@ void initialise_threads(int fragment_buf
}
if(processors == -1) {
-#ifndef linux
+#ifdef linux
+ cpu_set_t cpu_set;
+ CPU_ZERO(&cpu_set);
+
+ if(sched_getaffinity(0, sizeof cpu_set, &cpu_set) == -1)
+ processors = sysconf(_SC_NPROCESSORS_ONLN);
+ else
+ processors = CPU_COUNT(&cpu_set);
+#else
int mib[2];
size_t len = sizeof(processors);
@@ -2735,8 +2744,6 @@ void initialise_threads(int fragment_buf
"Defaulting to 1\n");
processors = 1;
}
-#else
- processors = sysconf(_SC_NPROCESSORS_ONLN);
#endif
}

View File

@ -1,37 +0,0 @@
From 92e628ec0e26cf091d82356e3b74f73bedf4cfc8 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Sat, 15 Oct 2022 00:11:20 +0200
Subject: [PATCH] action: rework strdupa with POSIX strdup and free
strdupa is not POSIX and cause compilation error on macos.
Fix this by using strdup and free.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
---
squashfs-tools/action.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
--- a/squashfs-tools/action.c
+++ b/squashfs-tools/action.c
@@ -2415,9 +2415,17 @@ static char *get_start(char *s, int n)
static int subpathname_fn(struct atom *atom, struct action_data *action_data)
{
- return fnmatch(atom->argv[0], get_start(strdupa(action_data->subpath),
- count_components(atom->argv[0])),
- FNM_PATHNAME|FNM_EXTMATCH) == 0;
+ char *s, *tmp;
+ int ret;
+
+ s = tmp = strdup(action_data->subpath);
+ tmp = get_start(tmp, count_components(atom->argv[0]));
+
+ ret = fnmatch(atom->argv[0], tmp, FNM_PATHNAME|FNM_EXTMATCH);
+
+ free(s);
+
+ return ret == 0;
}
/*

View File

@ -1,192 +0,0 @@
From dbe9747b4f09bd2f4d63af06e55c2c3ed35bfca1 Mon Sep 17 00:00:00 2001
From: Phillip Lougher <phillip@squashfs.org.uk>
Date: Tue, 7 Feb 2023 23:09:30 +0000
Subject: [PATCH] Don't use sigwaitinfo()/sigtimedwait() if not supported
If sigwaitinfo() and sigtimedwait() are not supported,
use sigwait() instead.
This will disable the queue/caches dump if ^\ (SIGQUIT)
is hit twice within a second.
But the queue/caches dump is still available if SIGHUP
is sent to the program.
Currently this check is applied to MAC OS X. FreeBSD and
NetBSD appear to have these functions.
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
---
squashfs-tools/info.c | 25 ++-------------
squashfs-tools/signals.h | 54 ++++++++++++++++++++++++++++++++
squashfs-tools/unsquashfs_info.c | 25 ++-------------
3 files changed, 60 insertions(+), 44 deletions(-)
create mode 100644 squashfs-tools/signals.h
--- a/squashfs-tools/info.c
+++ b/squashfs-tools/info.c
@@ -2,7 +2,7 @@
* Create a squashfs filesystem. This is a highly compressed read only
* filesystem.
*
- * Copyright (c) 2013, 2014, 2019, 2021
+ * Copyright (c) 2013, 2014, 2019, 2021, 2022, 2023
* Phillip Lougher <phillip@squashfs.org.uk>
*
* This program is free software; you can redistribute it and/or
@@ -42,6 +42,7 @@
#include "mksquashfs_error.h"
#include "progressbar.h"
#include "caches-queues-lists.h"
+#include "signals.h"
static int silent = 0;
static struct dir_ent *ent = NULL;
@@ -144,7 +145,6 @@ void dump_state()
void *info_thrd(void *arg)
{
sigset_t sigmask;
- struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 };
int sig, waiting = 0;
sigemptyset(&sigmask);
@@ -152,26 +152,7 @@ void *info_thrd(void *arg)
sigaddset(&sigmask, SIGHUP);
while(1) {
- if(waiting)
- sig = sigtimedwait(&sigmask, NULL, &timespec);
- else
- sig = sigwaitinfo(&sigmask, NULL);
-
- if(sig == -1) {
- switch(errno) {
- case EAGAIN:
- /* interval timed out */
- waiting = 0;
- /* FALLTHROUGH */
- case EINTR:
- /* if waiting, the wait will be longer, but
- that's OK */
- continue;
- default:
- BAD_ERROR("sigtimedwait/sigwaitinfo failed "
- "because %s\n", strerror(errno));
- }
- }
+ sig = wait_for_signal(&sigmask, &waiting);
if(sig == SIGQUIT && !waiting) {
print_filename();
--- /dev/null
+++ b/squashfs-tools/signals.h
@@ -0,0 +1,54 @@
+#ifndef SIGNALS_H
+#define SIGNALS_H
+/*
+ * Create a squashfs filesystem. This is a highly compressed read only
+ * filesystem.
+ *
+ * Copyright (c) 2023
+ * Phillip Lougher <phillip@squashfs.org.uk>
+ *
+ * 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,
+ * or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * signals.h
+ */
+
+static inline int wait_for_signal(sigset_t *sigmask, int *waiting)
+{
+ int sig;
+
+#if defined(__APPLE__) && defined(__MACH__)
+ sigwait(sigmask, &sig);
+ *waiting = 0;
+#else
+ struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 };
+
+ while(1) {
+ if(*waiting)
+ sig = sigtimedwait(sigmask, NULL, &timespec);
+ else
+ sig = sigwaitinfo(sigmask, NULL);
+
+ if(sig != -1)
+ break;
+
+ if(errno == EAGAIN)
+ *waiting = 0;
+ else if(errno != EINTR)
+ BAD_ERROR("sigtimedwait/sigwaitinfo failed because %s\n", strerror(errno));
+ }
+#endif
+ return sig;
+}
+#endif
--- a/squashfs-tools/unsquashfs_info.c
+++ b/squashfs-tools/unsquashfs_info.c
@@ -2,7 +2,7 @@
* Create a squashfs filesystem. This is a highly compressed read only
* filesystem.
*
- * Copyright (c) 2013, 2021
+ * Copyright (c) 2013, 2021, 2023
* Phillip Lougher <phillip@squashfs.org.uk>
*
* This program is free software; you can redistribute it and/or
@@ -40,6 +40,7 @@
#include "squashfs_fs.h"
#include "unsquashfs.h"
#include "unsquashfs_error.h"
+#include "signals.h"
char *pathname = NULL;
@@ -96,7 +97,6 @@ void dump_state()
void *info_thrd(void *arg)
{
sigset_t sigmask;
- struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 };
int sig, waiting = 0;
sigemptyset(&sigmask);
@@ -104,26 +104,7 @@ void *info_thrd(void *arg)
sigaddset(&sigmask, SIGHUP);
while(1) {
- if(waiting)
- sig = sigtimedwait(&sigmask, NULL, &timespec);
- else
- sig = sigwaitinfo(&sigmask, NULL);
-
- if(sig == -1) {
- switch(errno) {
- case EAGAIN:
- /* interval timed out */
- waiting = 0;
- /* FALLTHROUGH */
- case EINTR:
- /* if waiting, the wait will be longer, but
- that's OK */
- continue;
- default:
- BAD_ERROR("sigtimedwait/sigwaitinfo failed "
- "because %s\n", strerror(errno));
- }
- }
+ sig = wait_for_signal(&sigmask, &waiting);
if(sig == SIGQUIT && !waiting) {
if(pathname)

View File

@ -1,49 +0,0 @@
From b2f6454a2b2517cfba7a24cf02e9bdf3b959c86a Mon Sep 17 00:00:00 2001
From: Tony Butler <spudz76@gmail.com>
Date: Sat, 18 Feb 2023 13:20:48 -0800
Subject: [PATCH] Move sysinfo.h into the linux-only section, should fix build
on MacOS.
All compilers set `__linux__`, but `linux` may not be defined, and usage
was mixed. Use `__linux__` everywhere instead.
Signed-off-by: Tony Butler <spudz76@gmail.com>
---
squashfs-tools/mksquashfs.c | 6 +++---
squashfs-tools/unsquashfs.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -50,9 +50,9 @@
#include <sys/wait.h>
#include <limits.h>
#include <ctype.h>
-#include <sys/sysinfo.h>
-#ifdef linux
+#ifdef __linux__
+#include <sys/sysinfo.h>
#include <sched.h>
#else
#include <sys/sysctl.h>
@@ -5081,7 +5081,7 @@ static void initialise_threads(int readq
BAD_ERROR("Failed to set signal mask in intialise_threads\n");
if(processors == -1) {
-#ifdef linux
+#ifdef __linux__
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);
--- a/squashfs-tools/unsquashfs.c
+++ b/squashfs-tools/unsquashfs.c
@@ -2720,7 +2720,7 @@ void initialise_threads(int fragment_buf
}
if(processors == -1) {
-#ifdef linux
+#ifdef __linux__
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);

View File

@ -1,26 +0,0 @@
From dcf492077ef10ed7550b6e2b38b81318645bbdd5 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Sun, 19 Feb 2023 04:36:01 +0100
Subject: [PATCH] Unsquashfs: fix compilation error for missing sysctl.h on
macos
Currently the include of sys/sysctl.h is guarded and done only for
FreeBSD system. Remove this to fix compilation error on macos following
the same pattern done in mksquashfs.c
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
squashfs-tools/unsquashfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/squashfs-tools/unsquashfs.c
+++ b/squashfs-tools/unsquashfs.c
@@ -36,7 +36,7 @@
#include <sched.h>
#include <sys/sysinfo.h>
#include <sys/sysmacros.h>
-#elif defined __FreeBSD__
+#else
#include <sys/sysctl.h>
#endif

View File

@ -1,37 +0,0 @@
--- a/squashfs-tools/xattr.c
+++ b/squashfs-tools/xattr.c
@@ -115,6 +115,7 @@ int xattr_get_prefix(struct xattr_list *
static int read_xattrs_from_system(char *filename, struct xattr_list **xattrs)
{
+#if defined(linux)
ssize_t size, vsize;
char *xattr_names, *p;
int i;
@@ -227,6 +228,10 @@ failed:
free(xattr_list);
free(xattr_names);
return 0;
+#else
+ *xattrs = NULL;
+ return 0;
+#endif
}
--- a/squashfs-tools/unsquashfs_xattr.c
+++ b/squashfs-tools/unsquashfs_xattr.c
@@ -36,6 +36,7 @@ extern int strict_errors;
int write_xattr(char *pathname, unsigned int xattr)
{
+#if defined(linux)
unsigned int count;
struct xattr_list *xattr_list;
int i;
@@ -147,4 +148,5 @@ int write_xattr(char *pathname, unsigned
free_xattr(xattr_list, count);
return !failed;
+#endif
}