Merge branch 'openwrt:master' into master
This commit is contained in:
commit
4314b9f7e9
50 changed files with 2986 additions and 342 deletions
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
|
@ -198,13 +198,11 @@ jobs:
|
||||||
if curl $SUMS_FILE | grep -q ".*openwrt-toolchain.*tar.xz"; then
|
if curl $SUMS_FILE | grep -q ".*openwrt-toolchain.*tar.xz"; then
|
||||||
TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-toolchain.*tar.xz")"
|
TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-toolchain.*tar.xz")"
|
||||||
TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p')
|
TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p')
|
||||||
TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1)
|
|
||||||
|
|
||||||
echo "toolchain-type=external_toolchain" >> $GITHUB_OUTPUT
|
echo "toolchain-type=external_toolchain" >> $GITHUB_OUTPUT
|
||||||
elif curl $SUMS_FILE | grep -q ".*openwrt-sdk.*tar.xz"; then
|
elif curl $SUMS_FILE | grep -q ".*openwrt-sdk.*tar.xz"; then
|
||||||
TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-sdk.*tar.xz")"
|
TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-sdk.*tar.xz")"
|
||||||
TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-sdk.*\).tar.xz/\1/p')
|
TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-sdk.*\).tar.xz/\1/p')
|
||||||
TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1)
|
|
||||||
|
|
||||||
echo "toolchain-type=external_sdk" >> $GITHUB_OUTPUT
|
echo "toolchain-type=external_sdk" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
|
@ -212,17 +210,8 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV"
|
echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV"
|
||||||
echo "TOOLCHAIN_SHA256=$TOOLCHAIN_SHA256" >> "$GITHUB_ENV"
|
|
||||||
echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV"
|
echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Cache external toolchain/sdk
|
|
||||||
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal'
|
|
||||||
id: cache-external-toolchain
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: openwrt/${{ env.TOOLCHAIN_FILE }}
|
|
||||||
key: ${{ env.TOOLCHAIN_FILE }}-${{ steps.parse-toolchain.outputs.toolchain-type }}-${{ env.TOOLCHAIN_SHA256 }}
|
|
||||||
|
|
||||||
- name: Cache ccache
|
- name: Cache ccache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
@ -232,7 +221,7 @@ jobs:
|
||||||
ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-
|
ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-
|
||||||
|
|
||||||
- name: Download external toolchain/sdk
|
- name: Download external toolchain/sdk
|
||||||
if: inputs.build_toolchain == false && steps.cache-external-toolchain.outputs.cache-hit != 'true' && steps.parse-toolchain.outputs.toolchain-type != 'internal'
|
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal'
|
||||||
shell: su buildbot -c "sh -e {0}"
|
shell: su buildbot -c "sh -e {0}"
|
||||||
working-directory: openwrt
|
working-directory: openwrt
|
||||||
run: |
|
run: |
|
||||||
|
@ -284,7 +273,7 @@ jobs:
|
||||||
--config ${{ env.TARGET }}/${{ env.SUBTARGET }}
|
--config ${{ env.TARGET }}/${{ env.SUBTARGET }}
|
||||||
|
|
||||||
- name: Adapt external sdk to external toolchain format
|
- name: Adapt external sdk to external toolchain format
|
||||||
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_sdk' && steps.cache-external-toolchain.outputs.cache-hit != 'true'
|
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_sdk'
|
||||||
shell: su buildbot -c "sh -e {0}"
|
shell: su buildbot -c "sh -e {0}"
|
||||||
working-directory: openwrt
|
working-directory: openwrt
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -139,7 +139,10 @@ plasmacloud,pa300e)
|
||||||
qihoo,c301)
|
qihoo,c301)
|
||||||
ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
|
ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
|
||||||
;;
|
;;
|
||||||
ruckus,zf7025)
|
ruckus,zf7025|\
|
||||||
|
ruckus,zf7341|\
|
||||||
|
ruckus,zf7351|\
|
||||||
|
ruckus,zf7363)
|
||||||
ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x40000" "0x40000"
|
ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x40000" "0x40000"
|
||||||
;;
|
;;
|
||||||
ruckus,zf7321|\
|
ruckus,zf7321|\
|
||||||
|
|
|
@ -0,0 +1,149 @@
|
||||||
|
From: Felix Fietkau <nbd@nbd.name>
|
||||||
|
Date: Mon, 20 Mar 2023 14:28:08 +0100
|
||||||
|
Subject: [PATCH] wifi: mac80211: add support for letting drivers register tc
|
||||||
|
offload support
|
||||||
|
|
||||||
|
On newer MediaTek SoCs (e.g. MT7986), WLAN->WLAN or WLAN->Ethernet flows can
|
||||||
|
be offloaded by the SoC. In order to support that, the .ndo_setup_tc op is
|
||||||
|
needed.
|
||||||
|
|
||||||
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/include/net/mac80211.h
|
||||||
|
+++ b/include/net/mac80211.h
|
||||||
|
@@ -4196,6 +4196,10 @@ struct ieee80211_prep_tx_info {
|
||||||
|
* Note that a sta can also be inserted or removed with valid links,
|
||||||
|
* i.e. passed to @sta_add/@sta_state with sta->valid_links not zero.
|
||||||
|
* In fact, cannot change from having valid_links and not having them.
|
||||||
|
+ * @net_setup_tc: Called from .ndo_setup_tc in order to prepare hardware
|
||||||
|
+ * flow offloading for flows originating from the vif.
|
||||||
|
+ * Note that the driver must not assume that the vif driver_data is valid
|
||||||
|
+ * at this point, since the callback can be called during netdev teardown.
|
||||||
|
*/
|
||||||
|
struct ieee80211_ops {
|
||||||
|
void (*tx)(struct ieee80211_hw *hw,
|
||||||
|
@@ -4551,6 +4555,11 @@ struct ieee80211_ops {
|
||||||
|
struct ieee80211_vif *vif,
|
||||||
|
struct ieee80211_sta *sta,
|
||||||
|
u16 old_links, u16 new_links);
|
||||||
|
+ int (*net_setup_tc)(struct ieee80211_hw *hw,
|
||||||
|
+ struct ieee80211_vif *vif,
|
||||||
|
+ struct net_device *dev,
|
||||||
|
+ enum tc_setup_type type,
|
||||||
|
+ void *type_data);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
--- a/net/mac80211/driver-ops.h
|
||||||
|
+++ b/net/mac80211/driver-ops.h
|
||||||
|
@@ -1470,6 +1470,23 @@ static inline int drv_net_fill_forward_p
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static inline int drv_net_setup_tc(struct ieee80211_local *local,
|
||||||
|
+ struct ieee80211_sub_if_data *sdata,
|
||||||
|
+ struct net_device *dev,
|
||||||
|
+ enum tc_setup_type type, void *type_data)
|
||||||
|
+{
|
||||||
|
+ int ret = -EOPNOTSUPP;
|
||||||
|
+
|
||||||
|
+ sdata = get_bss_sdata(sdata);
|
||||||
|
+ trace_drv_net_setup_tc(local, sdata, type);
|
||||||
|
+ if (local->ops->net_setup_tc)
|
||||||
|
+ ret = local->ops->net_setup_tc(&local->hw, &sdata->vif, dev,
|
||||||
|
+ type, type_data);
|
||||||
|
+ trace_drv_return_int(local, ret);
|
||||||
|
+
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
int drv_change_vif_links(struct ieee80211_local *local,
|
||||||
|
struct ieee80211_sub_if_data *sdata,
|
||||||
|
u16 old_links, u16 new_links,
|
||||||
|
--- a/net/mac80211/ieee80211_i.h
|
||||||
|
+++ b/net/mac80211/ieee80211_i.h
|
||||||
|
@@ -1935,7 +1935,8 @@ void ieee80211_color_change_finalize_wor
|
||||||
|
/* interface handling */
|
||||||
|
#define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \
|
||||||
|
NETIF_F_HW_CSUM | NETIF_F_SG | \
|
||||||
|
- NETIF_F_HIGHDMA | NETIF_F_GSO_SOFTWARE)
|
||||||
|
+ NETIF_F_HIGHDMA | NETIF_F_GSO_SOFTWARE | \
|
||||||
|
+ NETIF_F_HW_TC)
|
||||||
|
#define MAC80211_SUPPORTED_FEATURES_RX (NETIF_F_RXCSUM)
|
||||||
|
#define MAC80211_SUPPORTED_FEATURES (MAC80211_SUPPORTED_FEATURES_TX | \
|
||||||
|
MAC80211_SUPPORTED_FEATURES_RX)
|
||||||
|
--- a/net/mac80211/iface.c
|
||||||
|
+++ b/net/mac80211/iface.c
|
||||||
|
@@ -813,6 +813,21 @@ ieee80211_get_stats64(struct net_device
|
||||||
|
dev_fetch_sw_netstats(stats, dev->tstats);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int ieee80211_netdev_setup_tc(struct net_device *dev,
|
||||||
|
+ enum tc_setup_type type, void *type_data)
|
||||||
|
+{
|
||||||
|
+ struct ieee80211_sub_if_data *sdata;
|
||||||
|
+ struct ieee80211_local *local;
|
||||||
|
+
|
||||||
|
+ sdata = IEEE80211_DEV_TO_SUB_IF(dev);
|
||||||
|
+ local = sdata->local;
|
||||||
|
+
|
||||||
|
+ if (!local->ops->net_setup_tc)
|
||||||
|
+ return -EOPNOTSUPP;
|
||||||
|
+
|
||||||
|
+ return drv_net_setup_tc(local, sdata, dev, type, type_data);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static const struct net_device_ops ieee80211_dataif_ops = {
|
||||||
|
.ndo_open = ieee80211_open,
|
||||||
|
.ndo_stop = ieee80211_stop,
|
||||||
|
@@ -821,6 +836,7 @@ static const struct net_device_ops ieee8
|
||||||
|
.ndo_set_rx_mode = ieee80211_set_multicast_list,
|
||||||
|
.ndo_set_mac_address = ieee80211_change_mac,
|
||||||
|
.ndo_get_stats64 = ieee80211_get_stats64,
|
||||||
|
+ .ndo_setup_tc = ieee80211_netdev_setup_tc,
|
||||||
|
};
|
||||||
|
|
||||||
|
static u16 ieee80211_monitor_select_queue(struct net_device *dev,
|
||||||
|
@@ -929,6 +945,7 @@ static const struct net_device_ops ieee8
|
||||||
|
.ndo_set_mac_address = ieee80211_change_mac,
|
||||||
|
.ndo_get_stats64 = ieee80211_get_stats64,
|
||||||
|
.ndo_fill_forward_path = ieee80211_netdev_fill_forward_path,
|
||||||
|
+ .ndo_setup_tc = ieee80211_netdev_setup_tc,
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool ieee80211_iftype_supports_hdr_offload(enum nl80211_iftype iftype)
|
||||||
|
--- a/net/mac80211/trace.h
|
||||||
|
+++ b/net/mac80211/trace.h
|
||||||
|
@@ -2478,6 +2478,31 @@ DEFINE_EVENT(sta_event, drv_net_fill_for
|
||||||
|
TP_ARGS(local, sdata, sta)
|
||||||
|
);
|
||||||
|
|
||||||
|
+TRACE_EVENT(drv_net_setup_tc,
|
||||||
|
+ TP_PROTO(struct ieee80211_local *local,
|
||||||
|
+ struct ieee80211_sub_if_data *sdata,
|
||||||
|
+ u8 type),
|
||||||
|
+
|
||||||
|
+ TP_ARGS(local, sdata, type),
|
||||||
|
+
|
||||||
|
+ TP_STRUCT__entry(
|
||||||
|
+ LOCAL_ENTRY
|
||||||
|
+ VIF_ENTRY
|
||||||
|
+ __field(u8, type)
|
||||||
|
+ ),
|
||||||
|
+
|
||||||
|
+ TP_fast_assign(
|
||||||
|
+ LOCAL_ASSIGN;
|
||||||
|
+ VIF_ASSIGN;
|
||||||
|
+ __entry->type = type;
|
||||||
|
+ ),
|
||||||
|
+
|
||||||
|
+ TP_printk(
|
||||||
|
+ LOCAL_PR_FMT VIF_PR_FMT " type:%d\n",
|
||||||
|
+ LOCAL_PR_ARG, VIF_PR_ARG, __entry->type
|
||||||
|
+ )
|
||||||
|
+);
|
||||||
|
+
|
||||||
|
TRACE_EVENT(drv_change_vif_links,
|
||||||
|
TP_PROTO(struct ieee80211_local *local,
|
||||||
|
struct ieee80211_sub_if_data *sdata,
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
--- a/include/net/mac80211.h
|
--- a/include/net/mac80211.h
|
||||||
+++ b/include/net/mac80211.h
|
+++ b/include/net/mac80211.h
|
||||||
@@ -1645,6 +1645,7 @@ enum ieee80211_smps_mode {
|
@@ -1671,6 +1671,7 @@ enum ieee80211_smps_mode {
|
||||||
*
|
*
|
||||||
* @power_level: requested transmit power (in dBm), backward compatibility
|
* @power_level: requested transmit power (in dBm), backward compatibility
|
||||||
* value only that is set to the minimum of all interfaces
|
* value only that is set to the minimum of all interfaces
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
*
|
*
|
||||||
* @chandef: the channel definition to tune to
|
* @chandef: the channel definition to tune to
|
||||||
* @radar_enabled: whether radar detection is enabled
|
* @radar_enabled: whether radar detection is enabled
|
||||||
@@ -1665,6 +1666,7 @@ enum ieee80211_smps_mode {
|
@@ -1691,6 +1692,7 @@ enum ieee80211_smps_mode {
|
||||||
struct ieee80211_conf {
|
struct ieee80211_conf {
|
||||||
u32 flags;
|
u32 flags;
|
||||||
int power_level, dynamic_ps_timeout;
|
int power_level, dynamic_ps_timeout;
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
__NL80211_ATTR_AFTER_LAST,
|
__NL80211_ATTR_AFTER_LAST,
|
||||||
--- a/net/mac80211/cfg.c
|
--- a/net/mac80211/cfg.c
|
||||||
+++ b/net/mac80211/cfg.c
|
+++ b/net/mac80211/cfg.c
|
||||||
@@ -2998,6 +2998,19 @@ static int ieee80211_get_tx_power(struct
|
@@ -3028,6 +3028,19 @@ static int ieee80211_get_tx_power(struct
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
static void ieee80211_rfkill_poll(struct wiphy *wiphy)
|
static void ieee80211_rfkill_poll(struct wiphy *wiphy)
|
||||||
{
|
{
|
||||||
struct ieee80211_local *local = wiphy_priv(wiphy);
|
struct ieee80211_local *local = wiphy_priv(wiphy);
|
||||||
@@ -4881,6 +4894,7 @@ const struct cfg80211_ops mac80211_confi
|
@@ -4911,6 +4924,7 @@ const struct cfg80211_ops mac80211_confi
|
||||||
.set_wiphy_params = ieee80211_set_wiphy_params,
|
.set_wiphy_params = ieee80211_set_wiphy_params,
|
||||||
.set_tx_power = ieee80211_set_tx_power,
|
.set_tx_power = ieee80211_set_tx_power,
|
||||||
.get_tx_power = ieee80211_get_tx_power,
|
.get_tx_power = ieee80211_get_tx_power,
|
||||||
|
|
|
@ -9,9 +9,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall4.git
|
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall4.git
|
||||||
PKG_SOURCE_DATE:=2022-11-29
|
PKG_SOURCE_DATE:=2023-03-23
|
||||||
PKG_SOURCE_VERSION:=700a925fd9c1f1ff404e6b125cd5347ad7c45668
|
PKG_SOURCE_VERSION:=04a06bd70b9808b14444cae81a2faba4708ee231
|
||||||
PKG_MIRROR_HASH:=18fb7a27399bf2e9e094a4cbacd4e859448c1c9194b6da4a78c9f37a642d1703
|
PKG_MIRROR_HASH:=37c34facb733c50d0fdbfa238765a23e667e4daaae9728aaccbaba87a2a07bb9
|
||||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||||
PKG_LICENSE:=ISC
|
PKG_LICENSE:=ISC
|
||||||
|
|
||||||
|
|
|
@ -8,13 +8,13 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=odhcpd
|
PKG_NAME:=odhcpd
|
||||||
PKG_RELEASE:=$(AUTORELEASE)
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
|
PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
|
||||||
PKG_SOURCE_DATE:=2023-02-17
|
PKG_MIRROR_HASH:=f95c2edfa6756e2a6522cd9d3e0560bfc1cbc2aed9e0c3763c5f6081b153eb49
|
||||||
PKG_SOURCE_VERSION:=edc5e1738682e764e64bcbffde1e0a1cc9feac21
|
PKG_SOURCE_DATE:=2023-03-24
|
||||||
PKG_MIRROR_HASH:=4d8f630770bcf4594c8fc0a2ee34bc40ce8618cc46e76ae5c3629da2fea9e90b
|
PKG_SOURCE_VERSION:=29c934d7ab98ca0b5da0e3757b885a1d3c19a2f4
|
||||||
|
|
||||||
PKG_MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>
|
PKG_MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
|
243
target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi
Normal file
243
target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi
Normal file
|
@ -0,0 +1,243 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||||
|
|
||||||
|
#include "ar7100.dtsi"
|
||||||
|
|
||||||
|
#include <dt-bindings/gpio/gpio.h>
|
||||||
|
#include <dt-bindings/input/input.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
compatible = "ruckus,gd11", "qca,ar7161";
|
||||||
|
|
||||||
|
aliases {
|
||||||
|
led-boot = &led_power_green;
|
||||||
|
led-failsafe = &led_power_red;
|
||||||
|
led-running = &led_power_green;
|
||||||
|
led-upgrade = &led_power_red;
|
||||||
|
label-mac-device = ð0;
|
||||||
|
};
|
||||||
|
|
||||||
|
keys: keys {
|
||||||
|
compatible = "gpio-keys";
|
||||||
|
|
||||||
|
reset {
|
||||||
|
label = "reset";
|
||||||
|
linux,code = <KEY_RESTART>;
|
||||||
|
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
|
||||||
|
debounce-interval = <60>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
leds {
|
||||||
|
compatible = "gpio-leds";
|
||||||
|
dir-green {
|
||||||
|
label = "green:dir";
|
||||||
|
gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
opt-green {
|
||||||
|
label = "green:opt";
|
||||||
|
gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
|
||||||
|
};
|
||||||
|
|
||||||
|
led_power_green: power-green {
|
||||||
|
label = "green:power";
|
||||||
|
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
|
||||||
|
default-state = "on";
|
||||||
|
};
|
||||||
|
|
||||||
|
led_power_red: power-red {
|
||||||
|
label = "red:power";
|
||||||
|
gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
|
||||||
|
panic-indicator;
|
||||||
|
};
|
||||||
|
|
||||||
|
wlan2g-green {
|
||||||
|
label = "green:wlan2g";
|
||||||
|
gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
|
||||||
|
linux,default-trigger = "phy0assoc";
|
||||||
|
};
|
||||||
|
|
||||||
|
wlan2g-yellow {
|
||||||
|
label = "yellow:wlan2g";
|
||||||
|
gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
|
||||||
|
linux,default-trigger = "phy0tpt";
|
||||||
|
};
|
||||||
|
|
||||||
|
wlan5g-green {
|
||||||
|
label = "green:wlan5g";
|
||||||
|
gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
|
||||||
|
linux,default-trigger = "phy1assoc";
|
||||||
|
};
|
||||||
|
|
||||||
|
wlan5g-yellow {
|
||||||
|
label = "yellow:wlan5g";
|
||||||
|
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||||
|
linux,default-trigger = "phy1tpt";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
reserved-memory {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
ranges;
|
||||||
|
|
||||||
|
ruckus-himem@3ff0000 {
|
||||||
|
/* Ruckus Himem area used to control
|
||||||
|
* redundant boot image selection
|
||||||
|
*/
|
||||||
|
compatible = "nvmem-rmem";
|
||||||
|
reg = <0x3ff0000 0x10000>;
|
||||||
|
no-map;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
beamforming-2g-spi {
|
||||||
|
compatible = "spi-gpio";
|
||||||
|
mosi-gpios = <&ath9k0 5 GPIO_ACTIVE_HIGH>;
|
||||||
|
sck-gpios = <&ath9k0 6 GPIO_ACTIVE_HIGH>;
|
||||||
|
num-chipselects = <0>;
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
|
||||||
|
beamforming_2g_gpio: beamforming-2g-gpio@0 {
|
||||||
|
compatible = "fairchild,74hc595";
|
||||||
|
reg = <0>;
|
||||||
|
registers-number = <1>;
|
||||||
|
spi-max-frequency = <24000000>;
|
||||||
|
gpio-controller;
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
beamforming-5g-spi {
|
||||||
|
compatible = "spi-gpio";
|
||||||
|
mosi-gpios = <&ath9k1 5 GPIO_ACTIVE_HIGH>;
|
||||||
|
sck-gpios = <&ath9k1 6 GPIO_ACTIVE_HIGH>;
|
||||||
|
num-chipselects = <0>;
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
|
||||||
|
beamforming_5g_gpio: beamforming-5g-gpio@0 {
|
||||||
|
compatible = "fairchild,74hc595";
|
||||||
|
reg = <0>;
|
||||||
|
registers-number = <1>;
|
||||||
|
spi-max-frequency = <24000000>;
|
||||||
|
gpio-controller;
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&pcie0 {
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
ath9k0: wifi@0,11 { /* 2.4 GHz */
|
||||||
|
compatible = "pci168c,0029";
|
||||||
|
reg = <0x8800 0 0 0 0>;
|
||||||
|
nvmem-cells = <&macaddr_bdata_60>;
|
||||||
|
nvmem-cell-names = "mac-address";
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
gpio-controller;
|
||||||
|
};
|
||||||
|
|
||||||
|
ath9k1: wifi@0,12 { /* 5 GHz */
|
||||||
|
compatible = "pci168c,0029";
|
||||||
|
reg = <0x9000 0 0 0 0>;
|
||||||
|
nvmem-cells = <&macaddr_bdata_76>;
|
||||||
|
nvmem-cell-names = "mac-address";
|
||||||
|
#gpio-cells = <2>;
|
||||||
|
gpio-controller;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&mdio0 {
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
phy0: ethernet-phy@1e {
|
||||||
|
reg = <0x1e>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
ð0 {
|
||||||
|
status = "okay";
|
||||||
|
nvmem-cells = <&macaddr_bdata_66>;
|
||||||
|
nvmem-cell-names = "mac-address";
|
||||||
|
|
||||||
|
pll-data = <0x00110000 0x00001099 0x00991099>;
|
||||||
|
phy-handle = <&phy0>;
|
||||||
|
phy-mode = "rgmii-id";
|
||||||
|
};
|
||||||
|
|
||||||
|
&spi {
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
flash@0 {
|
||||||
|
compatible = "jedec,spi-nor";
|
||||||
|
reg = <0>;
|
||||||
|
spi-max-frequency = <104000000>;
|
||||||
|
m25p,fast-read;
|
||||||
|
|
||||||
|
partitions {
|
||||||
|
compatible = "fixed-partitions";
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
|
partition@0 {
|
||||||
|
reg = <0x0 0x40000>;
|
||||||
|
label = "u-boot";
|
||||||
|
read-only;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* On stock FW this encompasses rcks_wlan.main,
|
||||||
|
* rcks_wlan.bkup and datafs partitions
|
||||||
|
*/
|
||||||
|
partition@40000 {
|
||||||
|
compatible = "openwrt,uimage", "denx,uimage";
|
||||||
|
reg = <0x40000 0xf40000>;
|
||||||
|
label = "firmware";
|
||||||
|
};
|
||||||
|
|
||||||
|
partition@f80000 {
|
||||||
|
compatible = "u-boot,env";
|
||||||
|
reg = <0xf80000 0x40000>;
|
||||||
|
label = "u-boot-env";
|
||||||
|
};
|
||||||
|
|
||||||
|
board_data: partition@fc0000 {
|
||||||
|
reg = <0xfc0000 0x40000>;
|
||||||
|
label = "board-data";
|
||||||
|
read-only;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&usb1 {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&usb2 {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&usb_phy {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&board_data {
|
||||||
|
compatible = "nvmem-cells";
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
|
macaddr_bdata_60: macaddr@60 {
|
||||||
|
reg = <0x60 0x6>;
|
||||||
|
};
|
||||||
|
|
||||||
|
macaddr_bdata_66: macaddr@66 {
|
||||||
|
reg = <0x66 0x6>;
|
||||||
|
};
|
||||||
|
|
||||||
|
macaddr_bdata_76: macaddr@76 {
|
||||||
|
reg = <0x76 0x6>;
|
||||||
|
};
|
||||||
|
};
|
8
target/linux/ath79/dts/ar7161_ruckus_zf7341.dts
Normal file
8
target/linux/ath79/dts/ar7161_ruckus_zf7341.dts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||||
|
|
||||||
|
#include "ar7161_ruckus_zf734x.dtsi"
|
||||||
|
|
||||||
|
/ {
|
||||||
|
model = "Ruckus ZoneFlex 7341[-U]";
|
||||||
|
compatible = "ruckus,zf7341", "qca,ar7161";
|
||||||
|
};
|
119
target/linux/ath79/dts/ar7161_ruckus_zf734x.dtsi
Normal file
119
target/linux/ath79/dts/ar7161_ruckus_zf734x.dtsi
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||||
|
|
||||||
|
#include "ar7161_ruckus_gd11.dtsi"
|
||||||
|
|
||||||
|
&keys {
|
||||||
|
opt {
|
||||||
|
/* Not used by stock firmware */
|
||||||
|
label = "opt";
|
||||||
|
linux,code = <KEY_WPS_BUTTON>;
|
||||||
|
gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
|
||||||
|
debounce-interval = <60>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&beamforming_2g_gpio {
|
||||||
|
/* Default beamforming switches configuration from stock firmware,
|
||||||
|
* the AP is started and for broadcast frames - all outputs high */
|
||||||
|
lb0 {
|
||||||
|
line-name = "beamforming:2g:lb0";
|
||||||
|
gpios = <0 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb1 {
|
||||||
|
line-name = "beamforming:2g:lb1";
|
||||||
|
gpios = <1 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb2 {
|
||||||
|
line-name = "beamforming:2g:lb2";
|
||||||
|
gpios = <2 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb3 {
|
||||||
|
line-name = "beamforming:2g:lb3";
|
||||||
|
gpios = <3 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb4 {
|
||||||
|
line-name = "beamforming:2g:lb4";
|
||||||
|
gpios = <4 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb5 {
|
||||||
|
line-name = "beamforming:2g:lb5";
|
||||||
|
gpios = <5 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb6 {
|
||||||
|
line-name = "beamforming:2g:lb6";
|
||||||
|
gpios = <6 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb7 {
|
||||||
|
line-name = "beamforming:2g:lb7";
|
||||||
|
gpios = <7 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&beamforming_5g_gpio {
|
||||||
|
/* Default beamforming switches configuration from stock firmware,
|
||||||
|
* the AP is started and for broadcast frames - all outputs high */
|
||||||
|
hb0 {
|
||||||
|
line-name = "beamforming:5g:hb0";
|
||||||
|
gpios = <0 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb1 {
|
||||||
|
line-name = "beamforming:5g:hb1";
|
||||||
|
gpios = <1 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb2 {
|
||||||
|
line-name = "beamforming:5g:hb2";
|
||||||
|
gpios = <2 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb3 {
|
||||||
|
line-name = "beamforming:5g:hb3";
|
||||||
|
gpios = <3 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb4 {
|
||||||
|
line-name = "beamforming:5g:hb4";
|
||||||
|
gpios = <4 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb5 {
|
||||||
|
line-name = "beamforming:5g:hb5";
|
||||||
|
gpios = <5 GPIO_ACTIVE_LOW>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
};
|
115
target/linux/ath79/dts/ar7161_ruckus_zf7351.dts
Normal file
115
target/linux/ath79/dts/ar7161_ruckus_zf7351.dts
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||||
|
|
||||||
|
#include "ar7161_ruckus_gd11.dtsi"
|
||||||
|
|
||||||
|
/ {
|
||||||
|
model = "Ruckus ZoneFlex 7351[-U]";
|
||||||
|
compatible = "ruckus,zf7351", "qca,ar7161";
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
&beamforming_2g_gpio {
|
||||||
|
/* Default beamforming switches configuration from stock firmware,
|
||||||
|
* the AP is started and for broadcast frames - all outputs high */
|
||||||
|
lb0 {
|
||||||
|
line-name = "beamforming:2g:lb0";
|
||||||
|
gpios = <0 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb1 {
|
||||||
|
line-name = "beamforming:2g:lb1";
|
||||||
|
gpios = <1 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb2 {
|
||||||
|
line-name = "beamforming:2g:lb2";
|
||||||
|
gpios = <2 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb3 {
|
||||||
|
line-name = "beamforming:2g:lb3";
|
||||||
|
gpios = <4 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb4 {
|
||||||
|
line-name = "beamforming:2g:lb4";
|
||||||
|
gpios = <5 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
lb5 {
|
||||||
|
line-name = "beamforming:2g:lb5";
|
||||||
|
gpios = <6 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&beamforming_5g_gpio {
|
||||||
|
/* Default beamforming switches configuration from stock firmware,
|
||||||
|
* the AP is started and for broadcast frames - all outputs high */
|
||||||
|
hb0 {
|
||||||
|
line-name = "beamforming:5g:hb0";
|
||||||
|
gpios = <0 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb1 {
|
||||||
|
line-name = "beamforming:5g:hb1";
|
||||||
|
gpios = <1 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb2 {
|
||||||
|
line-name = "beamforming:5g:hb2";
|
||||||
|
gpios = <2 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb3 {
|
||||||
|
line-name = "beamforming:5g:hb3";
|
||||||
|
gpios = <3 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb4 {
|
||||||
|
line-name = "beamforming:5g:hb4";
|
||||||
|
gpios = <4 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb5 {
|
||||||
|
line-name = "beamforming:5g:hb5";
|
||||||
|
gpios = <5 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb6 {
|
||||||
|
line-name = "beamforming:5g:hb6";
|
||||||
|
gpios = <6 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
|
||||||
|
hb7 {
|
||||||
|
line-name = "beamforming:5g:hb7";
|
||||||
|
gpios = <7 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-high;
|
||||||
|
gpio-hog;
|
||||||
|
};
|
||||||
|
};
|
39
target/linux/ath79/dts/ar7161_ruckus_zf7363.dts
Normal file
39
target/linux/ath79/dts/ar7161_ruckus_zf7363.dts
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||||
|
|
||||||
|
#include "ar7161_ruckus_zf734x.dtsi"
|
||||||
|
|
||||||
|
/ {
|
||||||
|
model = "Ruckus ZoneFlex 7343/7363[-U]";
|
||||||
|
compatible = "ruckus,zf7363", "qca,ar7161";
|
||||||
|
};
|
||||||
|
|
||||||
|
&mdio0 {
|
||||||
|
ethernet-phy@0 {
|
||||||
|
reg = <0x0>;
|
||||||
|
max-speed = <100>;
|
||||||
|
};
|
||||||
|
|
||||||
|
ethernet-phy@1 {
|
||||||
|
reg = <0x1>;
|
||||||
|
max-speed = <100>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
ð1 {
|
||||||
|
status = "okay";
|
||||||
|
pll-data = <0x00110000 0x00001099 0x00991099>;
|
||||||
|
nvmem-cells = <&macaddr_bdata_6c>;
|
||||||
|
nvmem-cell-names = "mac-address";
|
||||||
|
phy-mode = "rgmii-id";
|
||||||
|
|
||||||
|
fixed-link {
|
||||||
|
speed = <100>;
|
||||||
|
full-duplex;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&board_data {
|
||||||
|
macaddr_bdata_6c: macaddr@6c {
|
||||||
|
reg = <0x6c 0x6>;
|
||||||
|
};
|
||||||
|
};
|
|
@ -67,6 +67,8 @@ ath79_setup_interfaces()
|
||||||
pisen,wmb001n|\
|
pisen,wmb001n|\
|
||||||
pisen,wmm003n|\
|
pisen,wmm003n|\
|
||||||
ruckus,zf7321|\
|
ruckus,zf7321|\
|
||||||
|
ruckus,zf7341|\
|
||||||
|
ruckus,zf7351|\
|
||||||
siemens,ws-ap3610|\
|
siemens,ws-ap3610|\
|
||||||
sophos,ap15|\
|
sophos,ap15|\
|
||||||
sophos,ap55|\
|
sophos,ap55|\
|
||||||
|
@ -138,6 +140,7 @@ ath79_setup_interfaces()
|
||||||
engenius,ews511ap|\
|
engenius,ews511ap|\
|
||||||
engenius,ews660ap|\
|
engenius,ews660ap|\
|
||||||
ocedo,ursus|\
|
ocedo,ursus|\
|
||||||
|
ruckus,zf7363|\
|
||||||
ruckus,zf7372|\
|
ruckus,zf7372|\
|
||||||
ubnt,unifi-ap-outdoor-plus)
|
ubnt,unifi-ap-outdoor-plus)
|
||||||
ucidef_set_interface_lan "eth0 eth1"
|
ucidef_set_interface_lan "eth0 eth1"
|
||||||
|
@ -744,6 +747,9 @@ ath79_setup_macs()
|
||||||
;;
|
;;
|
||||||
ruckus,zf7025|\
|
ruckus,zf7025|\
|
||||||
ruckus,zf7321|\
|
ruckus,zf7321|\
|
||||||
|
ruckus,zf7341|\
|
||||||
|
ruckus,zf7351|\
|
||||||
|
ruckus,zf7363|\
|
||||||
ruckus,zf7372)
|
ruckus,zf7372)
|
||||||
lan_mac=$(mtd_get_mac_binary board-data 0x807E)
|
lan_mac=$(mtd_get_mac_binary board-data 0x807E)
|
||||||
label_mac=$lan_mac
|
label_mac=$lan_mac
|
||||||
|
|
|
@ -2530,6 +2530,36 @@ define Device/ruckus_zf7025
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += ruckus_zf7025
|
TARGET_DEVICES += ruckus_zf7025
|
||||||
|
|
||||||
|
define Device/ruckus_gd11_common
|
||||||
|
$(Device/ruckus_common)
|
||||||
|
SOC := ar7161
|
||||||
|
IMAGE_SIZE := 15616k
|
||||||
|
BLOCKSIZE := 256k
|
||||||
|
DEVICE_PACKAGES := kmod-usb2 kmod-usb-chipidea2
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Device/ruckus_zf7341
|
||||||
|
$(Device/ruckus_gd11_common)
|
||||||
|
DEVICE_MODEL := ZoneFlex 7341[-U]
|
||||||
|
DEVICE_PACKAGES += -swconfig
|
||||||
|
endef
|
||||||
|
TARGET_DEVICES += ruckus_zf7341
|
||||||
|
|
||||||
|
define Device/ruckus_zf7351
|
||||||
|
$(Device/ruckus_gd11_common)
|
||||||
|
DEVICE_MODEL := ZoneFlex 7351[-U]
|
||||||
|
DEVICE_PACKAGES += -swconfig
|
||||||
|
endef
|
||||||
|
TARGET_DEVICES += ruckus_zf7351
|
||||||
|
|
||||||
|
define Device/ruckus_zf7363
|
||||||
|
$(Device/ruckus_gd11_common)
|
||||||
|
DEVICE_MODEL := ZoneFlex 7363[-U]
|
||||||
|
DEVICE_ALT0_VENDOR := Ruckus
|
||||||
|
DEVICE_ALT0_MODEL := ZoneFlex 7343[-U]
|
||||||
|
endef
|
||||||
|
TARGET_DEVICES += ruckus_zf7363
|
||||||
|
|
||||||
define Device/ruckus_zf73xx_common
|
define Device/ruckus_zf73xx_common
|
||||||
$(Device/ruckus_common)
|
$(Device/ruckus_common)
|
||||||
DEVICE_PACKAGES := -swconfig kmod-usb2 kmod-usb-chipidea2
|
DEVICE_PACKAGES := -swconfig kmod-usb2 kmod-usb-chipidea2
|
||||||
|
|
8
target/linux/bmips/dts/bcm63167-sercomm-h500-s-lowi.dts
Normal file
8
target/linux/bmips/dts/bcm63167-sercomm-h500-s-lowi.dts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "bcm63167-sercomm-h500-s.dtsi"
|
||||||
|
|
||||||
|
/ {
|
||||||
|
model = "Sercomm H500-s lowi";
|
||||||
|
compatible = "sercomm,h500-s-lowi", "brcm,bcm63167", "brcm,bcm63268";
|
||||||
|
};
|
8
target/linux/bmips/dts/bcm63167-sercomm-h500-s-vfes.dts
Normal file
8
target/linux/bmips/dts/bcm63167-sercomm-h500-s-vfes.dts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "bcm63167-sercomm-h500-s.dtsi"
|
||||||
|
|
||||||
|
/ {
|
||||||
|
model = "Sercomm H500-s vfes";
|
||||||
|
compatible = "sercomm,h500-s-vfes", "brcm,bcm63167", "brcm,bcm63268";
|
||||||
|
};
|
298
target/linux/bmips/dts/bcm63167-sercomm-h500-s.dtsi
Normal file
298
target/linux/bmips/dts/bcm63167-sercomm-h500-s.dtsi
Normal file
|
@ -0,0 +1,298 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "bcm63268.dtsi"
|
||||||
|
|
||||||
|
/ {
|
||||||
|
aliases {
|
||||||
|
led-boot = &led_power_green;
|
||||||
|
led-failsafe = &led_power_red;
|
||||||
|
led-running = &led_power_green;
|
||||||
|
led-upgrade = &led_power_green;
|
||||||
|
|
||||||
|
led-internet = &led_internet_green;
|
||||||
|
led-usb = &led_mobile_green;
|
||||||
|
led-wireless = &led_wireless_green;
|
||||||
|
};
|
||||||
|
|
||||||
|
keys {
|
||||||
|
compatible = "gpio-keys-polled";
|
||||||
|
poll-interval = <20>;
|
||||||
|
|
||||||
|
wps {
|
||||||
|
label = "wps";
|
||||||
|
gpios = <&gpio 34 GPIO_ACTIVE_LOW>;
|
||||||
|
linux,code = <KEY_WPS_BUTTON>;
|
||||||
|
debounce-interval = <60>;
|
||||||
|
};
|
||||||
|
|
||||||
|
reset {
|
||||||
|
label = "reset";
|
||||||
|
gpios = <&gpio 35 GPIO_ACTIVE_LOW>;
|
||||||
|
linux,code = <KEY_RESTART>;
|
||||||
|
debounce-interval = <60>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&ehci {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
ðernet {
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
nvmem-cells = <&macaddr_cferom_6a0>;
|
||||||
|
nvmem-cell-names = "mac-address";
|
||||||
|
};
|
||||||
|
|
||||||
|
&leds {
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&pinctrl_leds>;
|
||||||
|
|
||||||
|
led@0 {
|
||||||
|
reg = <0>;
|
||||||
|
label = "red:mobile";
|
||||||
|
};
|
||||||
|
|
||||||
|
led_mobile_green: led@1 {
|
||||||
|
reg = <1>;
|
||||||
|
label = "green:mobile";
|
||||||
|
};
|
||||||
|
|
||||||
|
led_power_red: led@8 {
|
||||||
|
reg = <8>;
|
||||||
|
label = "red:power";
|
||||||
|
};
|
||||||
|
|
||||||
|
led_wireless_green: led@9 {
|
||||||
|
reg = <9>;
|
||||||
|
label = "green:wifi";
|
||||||
|
};
|
||||||
|
|
||||||
|
led@12 {
|
||||||
|
reg = <12>;
|
||||||
|
label = "red:phone";
|
||||||
|
};
|
||||||
|
|
||||||
|
led@13 {
|
||||||
|
reg = <13>;
|
||||||
|
label = "red:wifi";
|
||||||
|
};
|
||||||
|
|
||||||
|
led@14 {
|
||||||
|
reg = <14>;
|
||||||
|
label = "red:internet";
|
||||||
|
};
|
||||||
|
|
||||||
|
led_internet_green: led@15 {
|
||||||
|
reg = <15>;
|
||||||
|
label = "green:internet";
|
||||||
|
};
|
||||||
|
|
||||||
|
led@16 {
|
||||||
|
reg = <16>;
|
||||||
|
label = "green:phone";
|
||||||
|
};
|
||||||
|
|
||||||
|
led_power_green: led@17 {
|
||||||
|
reg = <17>;
|
||||||
|
label = "green:power";
|
||||||
|
};
|
||||||
|
|
||||||
|
led@23 {
|
||||||
|
reg = <23>;
|
||||||
|
label = "blue:mobile";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&mdio_int {
|
||||||
|
phy12: ethernet-phy@c {
|
||||||
|
compatible = "ethernet-phy-ieee802.3-c22";
|
||||||
|
reg = <12>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&mdio_ext {
|
||||||
|
switch@1e {
|
||||||
|
compatible = "brcm,bcm53134";
|
||||||
|
reg = <30>;
|
||||||
|
|
||||||
|
dsa,member = <1 0>;
|
||||||
|
|
||||||
|
ports {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <0>;
|
||||||
|
|
||||||
|
port@1 {
|
||||||
|
reg = <1>;
|
||||||
|
label = "lan3";
|
||||||
|
};
|
||||||
|
|
||||||
|
port@2 {
|
||||||
|
reg = <2>;
|
||||||
|
label = "lan2";
|
||||||
|
};
|
||||||
|
|
||||||
|
port@3 {
|
||||||
|
reg = <3>;
|
||||||
|
label = "lan1";
|
||||||
|
};
|
||||||
|
|
||||||
|
port@5 {
|
||||||
|
reg = <5>;
|
||||||
|
label = "wifi";
|
||||||
|
|
||||||
|
phy-mode = "rgmii";
|
||||||
|
|
||||||
|
fixed-link {
|
||||||
|
speed = <1000>;
|
||||||
|
full-duplex;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
port@8 {
|
||||||
|
reg = <8>;
|
||||||
|
|
||||||
|
phy-mode = "rgmii-txid";
|
||||||
|
ethernet = <&switch0port4>;
|
||||||
|
|
||||||
|
fixed-link {
|
||||||
|
speed = <1000>;
|
||||||
|
full-duplex;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&nflash {
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
nandcs@0 {
|
||||||
|
compatible = "brcm,nandcs";
|
||||||
|
reg = <0>;
|
||||||
|
nand-ecc-step-size = <512>;
|
||||||
|
nand-ecc-strength = <4>;
|
||||||
|
nand-on-flash-bbt;
|
||||||
|
brcm,nand-oob-sector-size = <64>;
|
||||||
|
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
|
partitions {
|
||||||
|
compatible = "fixed-partitions";
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
|
cferom: partition@0 {
|
||||||
|
label = "cferom";
|
||||||
|
reg = <0x0000000 0x0020000>;
|
||||||
|
read-only;
|
||||||
|
};
|
||||||
|
|
||||||
|
partition@20000 {
|
||||||
|
label = "part_map";
|
||||||
|
reg = <0x0020000 0x00a0000>;
|
||||||
|
read-only;
|
||||||
|
};
|
||||||
|
|
||||||
|
partition@c0000 {
|
||||||
|
label = "cferam1";
|
||||||
|
reg = <0x00c0000 0x0140000>;
|
||||||
|
read-only;
|
||||||
|
};
|
||||||
|
|
||||||
|
partition@200000 {
|
||||||
|
label = "cferam2";
|
||||||
|
reg = <0x0200000 0x0140000>;
|
||||||
|
read-only;
|
||||||
|
};
|
||||||
|
|
||||||
|
partition@6920000 {
|
||||||
|
label = "bootflag1";
|
||||||
|
reg = <0x6920000 0x0140000>;
|
||||||
|
};
|
||||||
|
|
||||||
|
partition@6a60000 {
|
||||||
|
label = "bootflag2";
|
||||||
|
reg = <0x6a60000 0x0140000>;
|
||||||
|
};
|
||||||
|
|
||||||
|
partition@520000 {
|
||||||
|
compatible = "sercomm,wfi";
|
||||||
|
label = "wfi";
|
||||||
|
reg = <0x0520000 0x6400000>;
|
||||||
|
};
|
||||||
|
|
||||||
|
partition@6ba0000 {
|
||||||
|
label = "xml_cfg";
|
||||||
|
reg = <0x6ba0000 0x0280000>;
|
||||||
|
read-only;
|
||||||
|
};
|
||||||
|
|
||||||
|
partition@6e20000 {
|
||||||
|
label = "app_data";
|
||||||
|
reg = <0x6e20000 0x0280000>;
|
||||||
|
read-only;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&ohci {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&switch0 {
|
||||||
|
dsa,member = <0 0>;
|
||||||
|
|
||||||
|
ports {
|
||||||
|
port@3 {
|
||||||
|
reg = <3>;
|
||||||
|
label = "wan";
|
||||||
|
|
||||||
|
phy-handle = <&phy12>;
|
||||||
|
};
|
||||||
|
|
||||||
|
switch0port4: port@4 {
|
||||||
|
reg = <4>;
|
||||||
|
label = "extsw";
|
||||||
|
|
||||||
|
phy-mode = "rgmii-txid";
|
||||||
|
|
||||||
|
fixed-link {
|
||||||
|
speed = <1000>;
|
||||||
|
full-duplex;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&pinctrl {
|
||||||
|
pinctrl_leds: leds {
|
||||||
|
function = "led";
|
||||||
|
pins = "gpio0", "gpio1", "gpio8", "gpio9",
|
||||||
|
"gpio12", "gpio13", "gpio14", "gpio15",
|
||||||
|
"gpio16", "gpio17", "gpio23";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&uart0 {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&usbh {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&cferom {
|
||||||
|
compatible = "nvmem-cells";
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
|
macaddr_cferom_6a0: macaddr@6a0 {
|
||||||
|
reg = <0x6a0 0x6>;
|
||||||
|
};
|
||||||
|
};
|
|
@ -123,7 +123,6 @@
|
||||||
|
|
||||||
port@8 {
|
port@8 {
|
||||||
reg = <8>;
|
reg = <8>;
|
||||||
label = "cpu";
|
|
||||||
|
|
||||||
phy-mode = "rgmii";
|
phy-mode = "rgmii";
|
||||||
ethernet = <&switch0port4>;
|
ethernet = <&switch0port4>;
|
||||||
|
|
|
@ -186,7 +186,6 @@
|
||||||
|
|
||||||
port@8 {
|
port@8 {
|
||||||
reg = <8>;
|
reg = <8>;
|
||||||
label = "cpu";
|
|
||||||
|
|
||||||
phy-mode = "rgmii";
|
phy-mode = "rgmii";
|
||||||
ethernet = <&switch0port4>;
|
ethernet = <&switch0port4>;
|
||||||
|
|
|
@ -100,3 +100,57 @@ define Device/netgear_dgnd3700-v2
|
||||||
CFE_WFI_VERSION := 0x5731
|
CFE_WFI_VERSION := 0x5731
|
||||||
endef
|
endef
|
||||||
TARGET_DEVICES += netgear_dgnd3700-v2
|
TARGET_DEVICES += netgear_dgnd3700-v2
|
||||||
|
|
||||||
|
define Device/sercomm_h500-s-lowi
|
||||||
|
$(Device/sercomm-nand)
|
||||||
|
DEVICE_VENDOR := Sercomm
|
||||||
|
DEVICE_MODEL := H500-s
|
||||||
|
DEVICE_VARIANT := lowi
|
||||||
|
DEVICE_LOADADDR := $(KERNEL_LOADADDR)
|
||||||
|
KERNEL := kernel-bin | append-dtb | lzma | cfe-jffs2-kernel
|
||||||
|
CHIP_ID := 63268
|
||||||
|
SOC := bcm63167
|
||||||
|
BLOCKSIZE := 128k
|
||||||
|
PAGESIZE := 2048
|
||||||
|
SUBPAGESIZE := 512
|
||||||
|
VID_HDR_OFFSET := 2048
|
||||||
|
DEVICE_PACKAGES += $(USB2_PACKAGES)
|
||||||
|
SERCOMM_PID := \
|
||||||
|
30 30 30 30 30 30 30 31 34 33 34 62 33 31 30 30 \
|
||||||
|
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
|
||||||
|
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
|
||||||
|
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
|
||||||
|
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
|
||||||
|
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
|
||||||
|
30 30 30 30 33 33 30 35 30 30 30 30 30 30 30 30 \
|
||||||
|
0D 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
|
SERCOMM_VERSION := 1001
|
||||||
|
endef
|
||||||
|
TARGET_DEVICES += sercomm_h500-s-lowi
|
||||||
|
|
||||||
|
define Device/sercomm_h500-s-vfes
|
||||||
|
$(Device/sercomm-nand)
|
||||||
|
DEVICE_VENDOR := Sercomm
|
||||||
|
DEVICE_MODEL := H500-s
|
||||||
|
DEVICE_VARIANT := vfes
|
||||||
|
DEVICE_LOADADDR := $(KERNEL_LOADADDR)
|
||||||
|
KERNEL := kernel-bin | append-dtb | lzma | cfe-jffs2-kernel
|
||||||
|
CHIP_ID := 63268
|
||||||
|
SOC := bcm63167
|
||||||
|
BLOCKSIZE := 128k
|
||||||
|
PAGESIZE := 2048
|
||||||
|
SUBPAGESIZE := 512
|
||||||
|
VID_HDR_OFFSET := 2048
|
||||||
|
DEVICE_PACKAGES += $(USB2_PACKAGES)
|
||||||
|
SERCOMM_PID := \
|
||||||
|
30 30 30 30 30 30 30 31 34 32 35 38 34 62 30 30 \
|
||||||
|
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
|
||||||
|
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
|
||||||
|
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
|
||||||
|
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
|
||||||
|
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 \
|
||||||
|
30 30 30 30 33 34 31 37 30 30 30 30 30 30 30 30 \
|
||||||
|
0D 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
|
SERCOMM_VERSION := 1001
|
||||||
|
endef
|
||||||
|
TARGET_DEVICES += sercomm_h500-s-vfes
|
||||||
|
|
|
@ -14,6 +14,13 @@ netgear,dgnd3700-v2)
|
||||||
ucidef_set_bridge_device switch
|
ucidef_set_bridge_device switch
|
||||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
|
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
|
||||||
;;
|
;;
|
||||||
|
sercomm,h500-s-lowi |\
|
||||||
|
sercomm,h500-s-vfes)
|
||||||
|
ucidef_set_bridge_device switch
|
||||||
|
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
|
||||||
|
ucidef_set_interface "qtn" device "wifi" protocol "static" ipaddr "1.1.1.1" netmask "255.255.255.252"
|
||||||
|
uci add_list firewall.@zone[0].network='qtn'
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
board_config_flush
|
board_config_flush
|
||||||
|
|
|
@ -47,7 +47,9 @@ platform_do_upgrade() {
|
||||||
case "$(board_name)" in
|
case "$(board_name)" in
|
||||||
comtrend,vr-3032u|\
|
comtrend,vr-3032u|\
|
||||||
huawei,hg253s-v2|\
|
huawei,hg253s-v2|\
|
||||||
netgear,dgnd3700-v2)
|
netgear,dgnd3700-v2|\
|
||||||
|
sercomm,h500-s-lowi|\
|
||||||
|
sercomm,h500-s-vfes)
|
||||||
cfe_jffs2_nand_upgrade "$1"
|
cfe_jffs2_nand_upgrade "$1"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
From 5a079515cb3066aeb658634301a98871b47c2af4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
|
||||||
Date: Thu, 25 Feb 2021 19:44:22 +0100
|
|
||||||
Subject: [PATCH 1/4] mips: bmips: add BCM63268 timer clock definitions
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Add missing timer clock definitions for BCM63268.
|
|
||||||
|
|
||||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
||||||
---
|
|
||||||
include/dt-bindings/clock/bcm63268-clock.h | 13 +++++++++++++
|
|
||||||
1 file changed, 13 insertions(+)
|
|
||||||
|
|
||||||
--- a/include/dt-bindings/clock/bcm63268-clock.h
|
|
||||||
+++ b/include/dt-bindings/clock/bcm63268-clock.h
|
|
||||||
@@ -27,4 +27,17 @@
|
|
||||||
#define BCM63268_CLK_TBUS 27
|
|
||||||
#define BCM63268_CLK_ROBOSW250 31
|
|
||||||
|
|
||||||
+#define BCM63268_TCLK_EPHY1 0
|
|
||||||
+#define BCM63268_TCLK_EPHY2 1
|
|
||||||
+#define BCM63268_TCLK_EPHY3 2
|
|
||||||
+#define BCM63268_TCLK_GPHY1 3
|
|
||||||
+#define BCM63268_TCLK_DSL 4
|
|
||||||
+#define BCM63268_TCLK_WAKEON_EPHY 6
|
|
||||||
+#define BCM63268_TCLK_WAKEON_DSL 7
|
|
||||||
+#define BCM63268_TCLK_FAP1 11
|
|
||||||
+#define BCM63268_TCLK_FAP2 15
|
|
||||||
+#define BCM63268_TCLK_UTO_50 16
|
|
||||||
+#define BCM63268_TCLK_UTO_EXTIN 17
|
|
||||||
+#define BCM63268_TCLK_USB_REF 18
|
|
||||||
+
|
|
||||||
#endif /* __DT_BINDINGS_CLOCK_BCM63268_H */
|
|
|
@ -1,26 +0,0 @@
|
||||||
From 3327df17635dd9d24a855ac6b7247fac381514cf Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
|
||||||
Date: Thu, 25 Feb 2021 19:45:04 +0100
|
|
||||||
Subject: [PATCH 2/4] mips: bmips: add BCM63268 timer reset definitions
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Add missing timer reset definitions for BCM63268.
|
|
||||||
|
|
||||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
||||||
---
|
|
||||||
include/dt-bindings/reset/bcm63268-reset.h | 4 ++++
|
|
||||||
1 file changed, 4 insertions(+)
|
|
||||||
|
|
||||||
--- a/include/dt-bindings/reset/bcm63268-reset.h
|
|
||||||
+++ b/include/dt-bindings/reset/bcm63268-reset.h
|
|
||||||
@@ -23,4 +23,8 @@
|
|
||||||
#define BCM63268_RST_PCIE_HARD 17
|
|
||||||
#define BCM63268_RST_GPHY 18
|
|
||||||
|
|
||||||
+#define BCM63268_TRST_SW 29
|
|
||||||
+#define BCM63268_TRST_HW 30
|
|
||||||
+#define BCM63268_TRST_POR 31
|
|
||||||
+
|
|
||||||
#endif /* __DT_BINDINGS_RESET_BCM63268_H */
|
|
|
@ -1,59 +0,0 @@
|
||||||
From c17702bad18a085ae913752b45bcc20c2cea879e Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
|
||||||
Date: Thu, 25 Feb 2021 19:53:08 +0100
|
|
||||||
Subject: [PATCH 3/4] dt-bindings: clock: Add BCM63268 timer binding
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Document the Broadcom BCM63268 Clock and Reset controller.
|
|
||||||
|
|
||||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
||||||
---
|
|
||||||
.../clock/brcm,bcm63268-timer-clocks.yaml | 40 +++++++++++++++++++
|
|
||||||
1 file changed, 40 insertions(+)
|
|
||||||
create mode 100644 Documentation/devicetree/bindings/clock/brcm,bcm63268-timer-clocks.yaml
|
|
||||||
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/Documentation/devicetree/bindings/clock/brcm,bcm63268-timer-clocks.yaml
|
|
||||||
@@ -0,0 +1,40 @@
|
|
||||||
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
|
||||||
+%YAML 1.2
|
|
||||||
+---
|
|
||||||
+$id: http://devicetree.org/schemas/clock/brcm,bcm63268-timer-clocks.yaml#
|
|
||||||
+$schema: http://devicetree.org/meta-schemas/core.yaml#
|
|
||||||
+
|
|
||||||
+title: Broadcom BCM63268 Timer Clock and Reset Device Tree Bindings
|
|
||||||
+
|
|
||||||
+maintainers:
|
|
||||||
+ - Álvaro Fernández Rojas <noltari@gmail.com>
|
|
||||||
+
|
|
||||||
+properties:
|
|
||||||
+ compatible:
|
|
||||||
+ const: brcm,bcm63268-timer-clocks
|
|
||||||
+
|
|
||||||
+ reg:
|
|
||||||
+ maxItems: 1
|
|
||||||
+
|
|
||||||
+ "#clock-cells":
|
|
||||||
+ const: 1
|
|
||||||
+
|
|
||||||
+ "#reset-cells":
|
|
||||||
+ const: 1
|
|
||||||
+
|
|
||||||
+required:
|
|
||||||
+ - compatible
|
|
||||||
+ - reg
|
|
||||||
+ - "#clock-cells"
|
|
||||||
+ - "#reset-cells"
|
|
||||||
+
|
|
||||||
+additionalProperties: false
|
|
||||||
+
|
|
||||||
+examples:
|
|
||||||
+ - |
|
|
||||||
+ timer_clk: clock-controller@100000ac {
|
|
||||||
+ compatible = "brcm,bcm63268-timer-clocks";
|
|
||||||
+ reg = <0x100000ac 0x4>;
|
|
||||||
+ #clock-cells = <1>;
|
|
||||||
+ #reset-cells = <1>;
|
|
||||||
+ };
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
From 5a37811de679bff03e9c5a746f75574910ede964 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
||||||
|
Date: Wed, 22 Mar 2023 20:52:13 +0100
|
||||||
|
Subject: [PATCH] Revert "mtd: rawnand: Macronix: Add support for block
|
||||||
|
protection"
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
This reverts commit 03a539c7a118427a6609a26461358c56ac8f3a06.
|
||||||
|
|
||||||
|
Macronix block protection doesn't seem to be supported on Sercomm H-500s
|
||||||
|
devices since it hangs the device.
|
||||||
|
|
||||||
|
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||||
|
---
|
||||||
|
drivers/mtd/nand/raw/nand_macronix.c | 5 -----
|
||||||
|
1 file changed, 5 deletions(-)
|
||||||
|
|
||||||
|
--- a/drivers/mtd/nand/raw/nand_macronix.c
|
||||||
|
+++ b/drivers/mtd/nand/raw/nand_macronix.c
|
||||||
|
@@ -323,7 +323,6 @@ static int macronix_nand_init(struct nan
|
||||||
|
|
||||||
|
macronix_nand_fix_broken_get_timings(chip);
|
||||||
|
macronix_nand_onfi_init(chip);
|
||||||
|
- macronix_nand_block_protection_support(chip);
|
||||||
|
macronix_nand_deep_power_down_support(chip);
|
||||||
|
|
||||||
|
return 0;
|
|
@ -1,46 +0,0 @@
|
||||||
From 03e31e5197a041857299c70bbbc461131156d434 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
|
||||||
Date: Tue, 21 Mar 2023 19:11:58 +0100
|
|
||||||
Subject: [PATCH] net: dsa: b53: mmap: disable phy read/write ops
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
B53 MMAP switches have a MDIO Mux bus controller which should be used instead
|
|
||||||
of phy_read() and phy_write() ops.
|
|
||||||
|
|
||||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
||||||
---
|
|
||||||
drivers/net/dsa/b53/b53_mmap.c | 10 ++++++++++
|
|
||||||
1 file changed, 10 insertions(+)
|
|
||||||
|
|
||||||
--- a/drivers/net/dsa/b53/b53_mmap.c
|
|
||||||
+++ b/drivers/net/dsa/b53/b53_mmap.c
|
|
||||||
@@ -279,6 +279,7 @@ static int b53_mmap_probe(struct platfor
|
|
||||||
struct b53_platform_data *pdata = pdev->dev.platform_data;
|
|
||||||
struct b53_mmap_priv *priv;
|
|
||||||
struct b53_device *dev;
|
|
||||||
+ struct dsa_switch_ops *dso;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!pdata && np) {
|
|
||||||
@@ -298,10 +299,19 @@ static int b53_mmap_probe(struct platfor
|
|
||||||
|
|
||||||
priv->regs = pdata->regs;
|
|
||||||
|
|
||||||
+ dso = devm_kzalloc(&pdev->dev, sizeof(*dso), GFP_KERNEL);
|
|
||||||
+ if (!dso)
|
|
||||||
+ return -ENOMEM;
|
|
||||||
+
|
|
||||||
dev = b53_switch_alloc(&pdev->dev, &b53_mmap_ops, priv);
|
|
||||||
if (!dev)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
+ memcpy(dso, dev->ds->ops, sizeof(*dso));
|
|
||||||
+ dso->phy_read = NULL;
|
|
||||||
+ dso->phy_write = NULL;
|
|
||||||
+ dev->ds->ops = dso;
|
|
||||||
+
|
|
||||||
dev->pdata = pdata;
|
|
||||||
|
|
||||||
platform_set_drvdata(pdev, dev);
|
|
|
@ -0,0 +1,105 @@
|
||||||
|
From 815f0e738a8d5663a02350e2580706829144a722 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Horatiu Vultur <horatiu.vultur@microchip.com>
|
||||||
|
Date: Wed, 3 Nov 2021 09:50:59 +0100
|
||||||
|
Subject: [PATCH] clk: gate: Add devm_clk_hw_register_gate()
|
||||||
|
|
||||||
|
Add devm_clk_hw_register_gate() - devres-managed version of
|
||||||
|
clk_hw_register_gate()
|
||||||
|
|
||||||
|
Suggested-by: Stephen Boyd <sboyd@kernel.org>
|
||||||
|
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
|
||||||
|
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
||||||
|
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
||||||
|
Link: https://lore.kernel.org/r/20211103085102.1656081-2-horatiu.vultur@microchip.com
|
||||||
|
---
|
||||||
|
drivers/clk/clk-gate.c | 35 +++++++++++++++++++++++++++++++++++
|
||||||
|
include/linux/clk-provider.h | 23 +++++++++++++++++++++++
|
||||||
|
2 files changed, 58 insertions(+)
|
||||||
|
|
||||||
|
--- a/drivers/clk/clk-gate.c
|
||||||
|
+++ b/drivers/clk/clk-gate.c
|
||||||
|
@@ -7,6 +7,7 @@
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/clk-provider.h>
|
||||||
|
+#include <linux/device.h>
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/slab.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
@@ -222,3 +223,37 @@ void clk_hw_unregister_gate(struct clk_h
|
||||||
|
kfree(gate);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(clk_hw_unregister_gate);
|
||||||
|
+
|
||||||
|
+static void devm_clk_hw_release_gate(struct device *dev, void *res)
|
||||||
|
+{
|
||||||
|
+ clk_hw_unregister_gate(*(struct clk_hw **)res);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+struct clk_hw *__devm_clk_hw_register_gate(struct device *dev,
|
||||||
|
+ struct device_node *np, const char *name,
|
||||||
|
+ const char *parent_name, const struct clk_hw *parent_hw,
|
||||||
|
+ const struct clk_parent_data *parent_data,
|
||||||
|
+ unsigned long flags,
|
||||||
|
+ void __iomem *reg, u8 bit_idx,
|
||||||
|
+ u8 clk_gate_flags, spinlock_t *lock)
|
||||||
|
+{
|
||||||
|
+ struct clk_hw **ptr, *hw;
|
||||||
|
+
|
||||||
|
+ ptr = devres_alloc(devm_clk_hw_release_gate, sizeof(*ptr), GFP_KERNEL);
|
||||||
|
+ if (!ptr)
|
||||||
|
+ return ERR_PTR(-ENOMEM);
|
||||||
|
+
|
||||||
|
+ hw = __clk_hw_register_gate(dev, np, name, parent_name, parent_hw,
|
||||||
|
+ parent_data, flags, reg, bit_idx,
|
||||||
|
+ clk_gate_flags, lock);
|
||||||
|
+
|
||||||
|
+ if (!IS_ERR(hw)) {
|
||||||
|
+ *ptr = hw;
|
||||||
|
+ devres_add(dev, ptr);
|
||||||
|
+ } else {
|
||||||
|
+ devres_free(ptr);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return hw;
|
||||||
|
+}
|
||||||
|
+EXPORT_SYMBOL_GPL(__devm_clk_hw_register_gate);
|
||||||
|
--- a/include/linux/clk-provider.h
|
||||||
|
+++ b/include/linux/clk-provider.h
|
||||||
|
@@ -490,6 +490,13 @@ struct clk_hw *__clk_hw_register_gate(st
|
||||||
|
unsigned long flags,
|
||||||
|
void __iomem *reg, u8 bit_idx,
|
||||||
|
u8 clk_gate_flags, spinlock_t *lock);
|
||||||
|
+struct clk_hw *__devm_clk_hw_register_gate(struct device *dev,
|
||||||
|
+ struct device_node *np, const char *name,
|
||||||
|
+ const char *parent_name, const struct clk_hw *parent_hw,
|
||||||
|
+ const struct clk_parent_data *parent_data,
|
||||||
|
+ unsigned long flags,
|
||||||
|
+ void __iomem *reg, u8 bit_idx,
|
||||||
|
+ u8 clk_gate_flags, spinlock_t *lock);
|
||||||
|
struct clk *clk_register_gate(struct device *dev, const char *name,
|
||||||
|
const char *parent_name, unsigned long flags,
|
||||||
|
void __iomem *reg, u8 bit_idx,
|
||||||
|
@@ -544,6 +551,22 @@ struct clk *clk_register_gate(struct dev
|
||||||
|
__clk_hw_register_gate((dev), NULL, (name), NULL, NULL, (parent_data), \
|
||||||
|
(flags), (reg), (bit_idx), \
|
||||||
|
(clk_gate_flags), (lock))
|
||||||
|
+/**
|
||||||
|
+ * devm_clk_hw_register_gate - register a gate clock with the clock framework
|
||||||
|
+ * @dev: device that is registering this clock
|
||||||
|
+ * @name: name of this clock
|
||||||
|
+ * @parent_name: name of this clock's parent
|
||||||
|
+ * @flags: framework-specific flags for this clock
|
||||||
|
+ * @reg: register address to control gating of this clock
|
||||||
|
+ * @bit_idx: which bit in the register controls gating of this clock
|
||||||
|
+ * @clk_gate_flags: gate-specific flags for this clock
|
||||||
|
+ * @lock: shared register lock for this clock
|
||||||
|
+ */
|
||||||
|
+#define devm_clk_hw_register_gate(dev, name, parent_name, flags, reg, bit_idx,\
|
||||||
|
+ clk_gate_flags, lock) \
|
||||||
|
+ __devm_clk_hw_register_gate((dev), NULL, (name), (parent_name), NULL, \
|
||||||
|
+ NULL, (flags), (reg), (bit_idx), \
|
||||||
|
+ (clk_gate_flags), (lock))
|
||||||
|
void clk_unregister_gate(struct clk *clk);
|
||||||
|
void clk_hw_unregister_gate(struct clk_hw *hw);
|
||||||
|
int clk_gate_is_enabled(struct clk_hw *hw);
|
|
@ -1,10 +1,11 @@
|
||||||
--- a/include/linux/soc/mediatek/mtk_wed.h
|
--- a/include/linux/soc/mediatek/mtk_wed.h
|
||||||
+++ b/include/linux/soc/mediatek/mtk_wed.h
|
+++ b/include/linux/soc/mediatek/mtk_wed.h
|
||||||
@@ -5,21 +5,76 @@
|
@@ -5,21 +5,77 @@
|
||||||
#include <linux/rcupdate.h>
|
#include <linux/rcupdate.h>
|
||||||
#include <linux/regmap.h>
|
#include <linux/regmap.h>
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
+#include <linux/skbuff.h>
|
+#include <linux/skbuff.h>
|
||||||
|
+#include <linux/netdevice.h>
|
||||||
|
|
||||||
#define MTK_WED_TX_QUEUES 2
|
#define MTK_WED_TX_QUEUES 2
|
||||||
+#define MTK_WED_RX_QUEUES 2
|
+#define MTK_WED_RX_QUEUES 2
|
||||||
|
@ -77,7 +78,7 @@
|
||||||
struct mtk_wed_device {
|
struct mtk_wed_device {
|
||||||
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
|
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
|
||||||
const struct mtk_wed_ops *ops;
|
const struct mtk_wed_ops *ops;
|
||||||
@@ -28,30 +83,76 @@ struct mtk_wed_device {
|
@@ -28,30 +84,76 @@ struct mtk_wed_device {
|
||||||
bool init_done, running;
|
bool init_done, running;
|
||||||
int wdma_idx;
|
int wdma_idx;
|
||||||
int irq;
|
int irq;
|
||||||
|
@ -156,7 +157,7 @@
|
||||||
} wlan;
|
} wlan;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@@ -59,10 +160,16 @@ struct mtk_wed_device {
|
@@ -59,10 +161,16 @@ struct mtk_wed_device {
|
||||||
struct mtk_wed_ops {
|
struct mtk_wed_ops {
|
||||||
int (*attach)(struct mtk_wed_device *dev);
|
int (*attach)(struct mtk_wed_device *dev);
|
||||||
int (*tx_ring_setup)(struct mtk_wed_device *dev, int ring,
|
int (*tx_ring_setup)(struct mtk_wed_device *dev, int ring,
|
||||||
|
@ -174,7 +175,16 @@
|
||||||
|
|
||||||
void (*stop)(struct mtk_wed_device *dev);
|
void (*stop)(struct mtk_wed_device *dev);
|
||||||
void (*start)(struct mtk_wed_device *dev, u32 irq_mask);
|
void (*start)(struct mtk_wed_device *dev, u32 irq_mask);
|
||||||
@@ -97,12 +204,22 @@ mtk_wed_device_attach(struct mtk_wed_dev
|
@@ -73,6 +181,8 @@ struct mtk_wed_ops {
|
||||||
|
|
||||||
|
u32 (*irq_get)(struct mtk_wed_device *dev, u32 mask);
|
||||||
|
void (*irq_set_mask)(struct mtk_wed_device *dev, u32 mask);
|
||||||
|
+ int (*setup_tc)(struct mtk_wed_device *wed, struct net_device *dev,
|
||||||
|
+ enum tc_setup_type type, void *type_data);
|
||||||
|
};
|
||||||
|
|
||||||
|
extern const struct mtk_wed_ops __rcu *mtk_soc_wed_ops;
|
||||||
|
@@ -97,12 +207,22 @@ mtk_wed_device_attach(struct mtk_wed_dev
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +209,7 @@
|
||||||
#define mtk_wed_device_txfree_ring_setup(_dev, _regs) \
|
#define mtk_wed_device_txfree_ring_setup(_dev, _regs) \
|
||||||
(_dev)->ops->txfree_ring_setup(_dev, _regs)
|
(_dev)->ops->txfree_ring_setup(_dev, _regs)
|
||||||
#define mtk_wed_device_reg_read(_dev, _reg) \
|
#define mtk_wed_device_reg_read(_dev, _reg) \
|
||||||
@@ -113,6 +230,14 @@ mtk_wed_device_attach(struct mtk_wed_dev
|
@@ -113,6 +233,16 @@ mtk_wed_device_attach(struct mtk_wed_dev
|
||||||
(_dev)->ops->irq_get(_dev, _mask)
|
(_dev)->ops->irq_get(_dev, _mask)
|
||||||
#define mtk_wed_device_irq_set_mask(_dev, _mask) \
|
#define mtk_wed_device_irq_set_mask(_dev, _mask) \
|
||||||
(_dev)->ops->irq_set_mask(_dev, _mask)
|
(_dev)->ops->irq_set_mask(_dev, _mask)
|
||||||
|
@ -211,10 +221,12 @@
|
||||||
+ (_dev)->ops->msg_update(_dev, _id, _msg, _len)
|
+ (_dev)->ops->msg_update(_dev, _id, _msg, _len)
|
||||||
+#define mtk_wed_device_stop(_dev) (_dev)->ops->stop(_dev)
|
+#define mtk_wed_device_stop(_dev) (_dev)->ops->stop(_dev)
|
||||||
+#define mtk_wed_device_dma_reset(_dev) (_dev)->ops->reset_dma(_dev)
|
+#define mtk_wed_device_dma_reset(_dev) (_dev)->ops->reset_dma(_dev)
|
||||||
|
+#define mtk_wed_device_setup_tc(_dev, _netdev, _type, _type_data) \
|
||||||
|
+ (_dev)->ops->setup_tc(_dev, _netdev, _type, _type_data)
|
||||||
#else
|
#else
|
||||||
static inline bool mtk_wed_device_active(struct mtk_wed_device *dev)
|
static inline bool mtk_wed_device_active(struct mtk_wed_device *dev)
|
||||||
{
|
{
|
||||||
@@ -120,12 +245,17 @@ static inline bool mtk_wed_device_active
|
@@ -120,12 +250,18 @@ static inline bool mtk_wed_device_active
|
||||||
}
|
}
|
||||||
#define mtk_wed_device_detach(_dev) do {} while (0)
|
#define mtk_wed_device_detach(_dev) do {} while (0)
|
||||||
#define mtk_wed_device_start(_dev, _mask) do {} while (0)
|
#define mtk_wed_device_start(_dev, _mask) do {} while (0)
|
||||||
|
@ -230,6 +242,7 @@
|
||||||
+#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) -ENODEV
|
+#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) -ENODEV
|
||||||
+#define mtk_wed_device_stop(_dev) do {} while (0)
|
+#define mtk_wed_device_stop(_dev) do {} while (0)
|
||||||
+#define mtk_wed_device_dma_reset(_dev) do {} while (0)
|
+#define mtk_wed_device_dma_reset(_dev) do {} while (0)
|
||||||
|
+#define mtk_wed_device_setup_tc(_dev, _netdev, _type, _type_data) -EOPNOTSUPP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o
|
obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/net/netfilter/xt_FLOWOFFLOAD.c
|
+++ b/net/netfilter/xt_FLOWOFFLOAD.c
|
||||||
@@ -0,0 +1,697 @@
|
@@ -0,0 +1,698 @@
|
||||||
+/*
|
+/*
|
||||||
+ * Copyright (C) 2018-2021 Felix Fietkau <nbd@nbd.name>
|
+ * Copyright (C) 2018-2021 Felix Fietkau <nbd@nbd.name>
|
||||||
+ *
|
+ *
|
||||||
|
@ -752,6 +752,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
+{
|
+{
|
||||||
+ INIT_DELAYED_WORK(&tbl->work, xt_flowoffload_hook_work);
|
+ INIT_DELAYED_WORK(&tbl->work, xt_flowoffload_hook_work);
|
||||||
+ tbl->ft.type = &flowtable_inet;
|
+ tbl->ft.type = &flowtable_inet;
|
||||||
|
+ tbl->ft.flags = NF_FLOWTABLE_COUNTER;
|
||||||
+
|
+
|
||||||
+ return nf_flow_table_init(&tbl->ft);
|
+ return nf_flow_table_init(&tbl->ft);
|
||||||
+}
|
+}
|
||||||
|
@ -770,7 +771,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
+ if (ret)
|
+ if (ret)
|
||||||
+ goto cleanup;
|
+ goto cleanup;
|
||||||
+
|
+
|
||||||
+ flowtable[1].ft.flags = NF_FLOWTABLE_HW_OFFLOAD;
|
+ flowtable[1].ft.flags |= NF_FLOWTABLE_HW_OFFLOAD;
|
||||||
+
|
+
|
||||||
+ ret = xt_register_target(&offload_tg_reg);
|
+ ret = xt_register_target(&offload_tg_reg);
|
||||||
+ if (ret)
|
+ if (ret)
|
||||||
|
|
|
@ -53,18 +53,18 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
|
|
||||||
--- 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
|
||||||
@@ -4586,7 +4586,9 @@ static int mtk_probe(struct platform_dev
|
@@ -4585,8 +4585,8 @@ static int mtk_probe(struct platform_dev
|
||||||
|
for (i = 0; i < num_ppe; i++) {
|
||||||
u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400;
|
u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400;
|
||||||
|
|
||||||
eth->ppe[i] = mtk_ppe_init(eth, eth->base + ppe_addr,
|
- eth->ppe[i] = mtk_ppe_init(eth, eth->base + ppe_addr,
|
||||||
- eth->soc->offload_version, i);
|
- eth->soc->offload_version, i);
|
||||||
+ eth->soc->offload_version, i,
|
+ eth->ppe[i] = mtk_ppe_init(eth, eth->base + ppe_addr, i);
|
||||||
+ eth->soc->has_accounting);
|
|
||||||
+
|
+
|
||||||
if (!eth->ppe[i]) {
|
if (!eth->ppe[i]) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto err_free_dev;
|
goto err_free_dev;
|
||||||
@@ -4711,6 +4713,7 @@ static const struct mtk_soc_data mt7622_
|
@@ -4711,6 +4711,7 @@ static const struct mtk_soc_data mt7622_
|
||||||
.required_pctl = false,
|
.required_pctl = false,
|
||||||
.offload_version = 2,
|
.offload_version = 2,
|
||||||
.hash_offset = 2,
|
.hash_offset = 2,
|
||||||
|
@ -72,7 +72,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
||||||
.txrx = {
|
.txrx = {
|
||||||
.txd_size = sizeof(struct mtk_tx_dma),
|
.txd_size = sizeof(struct mtk_tx_dma),
|
||||||
@@ -4748,6 +4751,7 @@ static const struct mtk_soc_data mt7629_
|
@@ -4748,6 +4749,7 @@ static const struct mtk_soc_data mt7629_
|
||||||
.hw_features = MTK_HW_FEATURES,
|
.hw_features = MTK_HW_FEATURES,
|
||||||
.required_clks = MT7629_CLKS_BITMAP,
|
.required_clks = MT7629_CLKS_BITMAP,
|
||||||
.required_pctl = false,
|
.required_pctl = false,
|
||||||
|
@ -80,7 +80,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
.txrx = {
|
.txrx = {
|
||||||
.txd_size = sizeof(struct mtk_tx_dma),
|
.txd_size = sizeof(struct mtk_tx_dma),
|
||||||
.rxd_size = sizeof(struct mtk_rx_dma),
|
.rxd_size = sizeof(struct mtk_rx_dma),
|
||||||
@@ -4768,6 +4772,7 @@ static const struct mtk_soc_data mt7986_
|
@@ -4768,6 +4770,7 @@ static const struct mtk_soc_data mt7986_
|
||||||
.offload_version = 2,
|
.offload_version = 2,
|
||||||
.hash_offset = 4,
|
.hash_offset = 4,
|
||||||
.foe_entry_size = sizeof(struct mtk_foe_entry),
|
.foe_entry_size = sizeof(struct mtk_foe_entry),
|
||||||
|
@ -90,7 +90,16 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
.rxd_size = sizeof(struct mtk_rx_dma_v2),
|
.rxd_size = sizeof(struct mtk_rx_dma_v2),
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
@@ -1042,6 +1042,7 @@ struct mtk_soc_data {
|
@@ -1025,6 +1025,8 @@ struct mtk_reg_map {
|
||||||
|
* the extra setup for those pins used by GMAC.
|
||||||
|
* @hash_offset Flow table hash offset.
|
||||||
|
* @foe_entry_size Foe table entry size.
|
||||||
|
+ * @has_accounting Bool indicating support for accounting of
|
||||||
|
+ * offloaded flows.
|
||||||
|
* @txd_size Tx DMA descriptor size.
|
||||||
|
* @rxd_size Rx DMA descriptor size.
|
||||||
|
* @rx_irq_done_mask Rx irq done register mask.
|
||||||
|
@@ -1042,6 +1044,7 @@ struct mtk_soc_data {
|
||||||
u8 hash_offset;
|
u8 hash_offset;
|
||||||
u16 foe_entry_size;
|
u16 foe_entry_size;
|
||||||
netdev_features_t hw_features;
|
netdev_features_t hw_features;
|
||||||
|
@ -100,7 +109,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
u32 rxd_size;
|
u32 rxd_size;
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
@@ -74,6 +74,46 @@ static int mtk_ppe_wait_busy(struct mtk_
|
@@ -74,6 +74,48 @@ static int mtk_ppe_wait_busy(struct mtk_
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,14 +130,16 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
+
|
+
|
||||||
+static int mtk_mib_entry_read(struct mtk_ppe *ppe, u16 index, u64 *bytes, u64 *packets)
|
+static int mtk_mib_entry_read(struct mtk_ppe *ppe, u16 index, u64 *bytes, u64 *packets)
|
||||||
+{
|
+{
|
||||||
+ u32 val, cnt_r0, cnt_r1, cnt_r2;
|
|
||||||
+ u32 byte_cnt_low, byte_cnt_high, pkt_cnt_low, pkt_cnt_high;
|
+ u32 byte_cnt_low, byte_cnt_high, pkt_cnt_low, pkt_cnt_high;
|
||||||
|
+ u32 val, cnt_r0, cnt_r1, cnt_r2;
|
||||||
|
+ int ret;
|
||||||
+
|
+
|
||||||
+ val = FIELD_PREP(MTK_PPE_MIB_SER_CR_ADDR, index) | MTK_PPE_MIB_SER_CR_ST;
|
+ val = FIELD_PREP(MTK_PPE_MIB_SER_CR_ADDR, index) | MTK_PPE_MIB_SER_CR_ST;
|
||||||
+ ppe_w32(ppe, MTK_PPE_MIB_SER_CR, val);
|
+ ppe_w32(ppe, MTK_PPE_MIB_SER_CR, val);
|
||||||
+
|
+
|
||||||
+ if (mtk_ppe_mib_wait_busy(ppe))
|
+ ret = mtk_ppe_mib_wait_busy(ppe);
|
||||||
+ return -ETIMEDOUT;
|
+ if (ret)
|
||||||
|
+ return ret;
|
||||||
+
|
+
|
||||||
+ cnt_r0 = readl(ppe->base + MTK_PPE_MIB_SER_R0);
|
+ cnt_r0 = readl(ppe->base + MTK_PPE_MIB_SER_R0);
|
||||||
+ cnt_r1 = readl(ppe->base + MTK_PPE_MIB_SER_R1);
|
+ cnt_r1 = readl(ppe->base + MTK_PPE_MIB_SER_R1);
|
||||||
|
@ -147,7 +158,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
static void mtk_ppe_cache_clear(struct mtk_ppe *ppe)
|
static void mtk_ppe_cache_clear(struct mtk_ppe *ppe)
|
||||||
{
|
{
|
||||||
ppe_set(ppe, MTK_PPE_CACHE_CTL, MTK_PPE_CACHE_CTL_CLEAR);
|
ppe_set(ppe, MTK_PPE_CACHE_CTL, MTK_PPE_CACHE_CTL_CLEAR);
|
||||||
@@ -464,6 +504,13 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp
|
@@ -464,6 +506,13 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp
|
||||||
hwe->ib1 &= ~MTK_FOE_IB1_STATE;
|
hwe->ib1 &= ~MTK_FOE_IB1_STATE;
|
||||||
hwe->ib1 |= FIELD_PREP(MTK_FOE_IB1_STATE, MTK_FOE_STATE_INVALID);
|
hwe->ib1 |= FIELD_PREP(MTK_FOE_IB1_STATE, MTK_FOE_STATE_INVALID);
|
||||||
dma_wmb();
|
dma_wmb();
|
||||||
|
@ -161,7 +172,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
}
|
}
|
||||||
entry->hash = 0xffff;
|
entry->hash = 0xffff;
|
||||||
|
|
||||||
@@ -571,6 +618,9 @@ __mtk_foe_entry_commit(struct mtk_ppe *p
|
@@ -571,6 +620,9 @@ __mtk_foe_entry_commit(struct mtk_ppe *p
|
||||||
wmb();
|
wmb();
|
||||||
hwe->ib1 = entry->ib1;
|
hwe->ib1 = entry->ib1;
|
||||||
|
|
||||||
|
@ -171,10 +182,12 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
dma_wmb();
|
dma_wmb();
|
||||||
|
|
||||||
mtk_ppe_cache_clear(ppe);
|
mtk_ppe_cache_clear(ppe);
|
||||||
@@ -762,14 +812,42 @@ int mtk_ppe_prepare_reset(struct mtk_ppe
|
@@ -762,11 +814,39 @@ int mtk_ppe_prepare_reset(struct mtk_ppe
|
||||||
return mtk_ppe_wait_busy(ppe);
|
return mtk_ppe_wait_busy(ppe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base,
|
||||||
|
- int version, int index)
|
||||||
+struct mtk_foe_accounting *mtk_foe_entry_get_mib(struct mtk_ppe *ppe, u32 index,
|
+struct mtk_foe_accounting *mtk_foe_entry_get_mib(struct mtk_ppe *ppe, u32 index,
|
||||||
+ struct mtk_foe_accounting *diff)
|
+ struct mtk_foe_accounting *diff)
|
||||||
+{
|
+{
|
||||||
|
@ -201,29 +214,27 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
+ return acct;
|
+ return acct;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base,
|
+struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int index)
|
||||||
- int version, int index)
|
|
||||||
+ int version, int index, bool accounting)
|
|
||||||
{
|
{
|
||||||
|
+ bool accounting = eth->soc->has_accounting;
|
||||||
const struct mtk_soc_data *soc = eth->soc;
|
const struct mtk_soc_data *soc = eth->soc;
|
||||||
|
+ struct mtk_foe_accounting *acct;
|
||||||
struct device *dev = eth->dev;
|
struct device *dev = eth->dev;
|
||||||
|
+ struct mtk_mib_entry *mib;
|
||||||
struct mtk_ppe *ppe;
|
struct mtk_ppe *ppe;
|
||||||
u32 foe_flow_size;
|
u32 foe_flow_size;
|
||||||
void *foe;
|
void *foe;
|
||||||
+ struct mtk_mib_entry *mib;
|
@@ -783,7 +863,8 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
|
||||||
+ struct mtk_foe_accounting *acct;
|
ppe->base = base;
|
||||||
|
|
||||||
ppe = devm_kzalloc(dev, sizeof(*ppe), GFP_KERNEL);
|
|
||||||
if (!ppe)
|
|
||||||
@@ -784,6 +862,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
|
|
||||||
ppe->eth = eth;
|
ppe->eth = eth;
|
||||||
ppe->dev = dev;
|
ppe->dev = dev;
|
||||||
ppe->version = version;
|
- ppe->version = version;
|
||||||
|
+ ppe->version = eth->soc->offload_version;
|
||||||
+ ppe->accounting = accounting;
|
+ ppe->accounting = accounting;
|
||||||
|
|
||||||
foe = dmam_alloc_coherent(ppe->dev,
|
foe = dmam_alloc_coherent(ppe->dev,
|
||||||
MTK_PPE_ENTRIES * soc->foe_entry_size,
|
MTK_PPE_ENTRIES * soc->foe_entry_size,
|
||||||
@@ -799,6 +878,25 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
|
@@ -799,6 +880,23 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
|
||||||
if (!ppe->foe_flow)
|
if (!ppe->foe_flow)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -233,8 +244,6 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
+ if (!mib)
|
+ if (!mib)
|
||||||
+ return NULL;
|
+ return NULL;
|
||||||
+
|
+
|
||||||
+ memset(mib, 0, MTK_PPE_ENTRIES * sizeof(*mib));
|
|
||||||
+
|
|
||||||
+ ppe->mib_table = mib;
|
+ ppe->mib_table = mib;
|
||||||
+
|
+
|
||||||
+ acct = devm_kzalloc(dev, MTK_PPE_ENTRIES * sizeof(*acct),
|
+ acct = devm_kzalloc(dev, MTK_PPE_ENTRIES * sizeof(*acct),
|
||||||
|
@ -311,16 +320,17 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
u16 foe_check_time[MTK_PPE_ENTRIES];
|
u16 foe_check_time[MTK_PPE_ENTRIES];
|
||||||
struct hlist_head *foe_flow;
|
struct hlist_head *foe_flow;
|
||||||
|
|
||||||
@@ -304,7 +323,7 @@ struct mtk_ppe {
|
@@ -303,8 +322,7 @@ struct mtk_ppe {
|
||||||
|
void *acct_table;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base,
|
-struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base,
|
||||||
- int version, int index);
|
- int version, int index);
|
||||||
+ int version, int index, bool accounting);
|
+struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int index);
|
||||||
void mtk_ppe_start(struct mtk_ppe *ppe);
|
void mtk_ppe_start(struct mtk_ppe *ppe);
|
||||||
int mtk_ppe_stop(struct mtk_ppe *ppe);
|
int mtk_ppe_stop(struct mtk_ppe *ppe);
|
||||||
int mtk_ppe_prepare_reset(struct mtk_ppe *ppe);
|
int mtk_ppe_prepare_reset(struct mtk_ppe *ppe);
|
||||||
@@ -358,5 +377,7 @@ int mtk_foe_entry_commit(struct mtk_ppe
|
@@ -358,5 +376,7 @@ int mtk_foe_entry_commit(struct mtk_ppe
|
||||||
void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
|
void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
|
||||||
int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
|
int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
|
||||||
int mtk_ppe_debugfs_init(struct mtk_ppe *ppe, int index);
|
int mtk_ppe_debugfs_init(struct mtk_ppe *ppe, int index);
|
||||||
|
@ -353,7 +363,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
seq_printf(m, " eth=%pM->%pM etype=%04x"
|
seq_printf(m, " eth=%pM->%pM etype=%04x"
|
||||||
- " vlan=%d,%d ib1=%08x ib2=%08x\n",
|
- " vlan=%d,%d ib1=%08x ib2=%08x\n",
|
||||||
+ " vlan=%d,%d ib1=%08x ib2=%08x"
|
+ " vlan=%d,%d ib1=%08x ib2=%08x"
|
||||||
+ " packets=%lld bytes=%lld\n",
|
+ " packets=%llu bytes=%llu\n",
|
||||||
h_source, h_dest, ntohs(l2->etype),
|
h_source, h_dest, ntohs(l2->etype),
|
||||||
- l2->vlan1, l2->vlan2, entry->ib1, ib2);
|
- l2->vlan1, l2->vlan2, entry->ib1, ib2);
|
||||||
+ l2->vlan1, l2->vlan2, entry->ib1, ib2,
|
+ l2->vlan1, l2->vlan2, entry->ib1, ib2,
|
||||||
|
@ -371,12 +381,13 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
|
||||||
u32 idle;
|
u32 idle;
|
||||||
|
|
||||||
entry = rhashtable_lookup(ð->flow_table, &f->cookie,
|
entry = rhashtable_lookup(ð->flow_table, &f->cookie,
|
||||||
@@ -507,6 +508,12 @@ mtk_flow_offload_stats(struct mtk_eth *e
|
@@ -507,6 +508,13 @@ mtk_flow_offload_stats(struct mtk_eth *e
|
||||||
idle = mtk_foe_entry_idle_time(eth->ppe[entry->ppe_index], entry);
|
idle = mtk_foe_entry_idle_time(eth->ppe[entry->ppe_index], entry);
|
||||||
f->stats.lastused = jiffies - idle * HZ;
|
f->stats.lastused = jiffies - idle * HZ;
|
||||||
|
|
||||||
+ if (entry->hash != 0xFFFF) {
|
+ if (entry->hash != 0xFFFF &&
|
||||||
+ mtk_foe_entry_get_mib(eth->ppe[entry->ppe_index], entry->hash, &diff);
|
+ mtk_foe_entry_get_mib(eth->ppe[entry->ppe_index], entry->hash,
|
||||||
|
+ &diff)) {
|
||||||
+ f->stats.pkts += diff.packets;
|
+ f->stats.pkts += diff.packets;
|
||||||
+ f->stats.bytes += diff.bytes;
|
+ f->stats.bytes += diff.bytes;
|
||||||
+ }
|
+ }
|
||||||
|
|
|
@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
#include <net/dsa.h>
|
#include <net/dsa.h>
|
||||||
#include "mtk_eth_soc.h"
|
#include "mtk_eth_soc.h"
|
||||||
#include "mtk_ppe.h"
|
#include "mtk_ppe.h"
|
||||||
@@ -755,7 +756,9 @@ void __mtk_ppe_check_skb(struct mtk_ppe
|
@@ -757,7 +758,9 @@ void __mtk_ppe_check_skb(struct mtk_ppe
|
||||||
skb->dev->dsa_ptr->tag_ops->proto != DSA_TAG_PROTO_MTK)
|
skb->dev->dsa_ptr->tag_ops->proto != DSA_TAG_PROTO_MTK)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
|
@ -14,43 +14,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
|
||||||
@@ -561,6 +561,7 @@ mtk_eth_setup_tc_block(struct net_device
|
@@ -584,6 +584,7 @@ mtk_eth_setup_tc_block(struct net_device
|
||||||
struct mtk_eth *eth = mac->hw;
|
if (IS_ERR(block_cb))
|
||||||
static LIST_HEAD(block_cb_list);
|
return PTR_ERR(block_cb);
|
||||||
struct flow_block_cb *block_cb;
|
|
||||||
+ bool register_block = false;
|
|
||||||
flow_setup_cb_t *cb;
|
|
||||||
|
|
||||||
if (!eth->soc->offload_version)
|
|
||||||
@@ -575,23 +576,27 @@ mtk_eth_setup_tc_block(struct net_device
|
|
||||||
switch (f->command) {
|
|
||||||
case FLOW_BLOCK_BIND:
|
|
||||||
block_cb = flow_block_cb_lookup(f->block, cb, dev);
|
|
||||||
- if (block_cb) {
|
|
||||||
- flow_block_cb_incref(block_cb);
|
|
||||||
- return 0;
|
|
||||||
+ if (!block_cb) {
|
|
||||||
+ block_cb = flow_block_cb_alloc(cb, dev, dev, NULL);
|
|
||||||
+ if (IS_ERR(block_cb))
|
|
||||||
+ return PTR_ERR(block_cb);
|
|
||||||
+
|
|
||||||
+ register_block = true;
|
|
||||||
}
|
|
||||||
- block_cb = flow_block_cb_alloc(cb, dev, dev, NULL);
|
|
||||||
- if (IS_ERR(block_cb))
|
|
||||||
- return PTR_ERR(block_cb);
|
|
||||||
|
|
||||||
- flow_block_cb_add(block_cb, f);
|
|
||||||
- list_add_tail(&block_cb->driver_list, &block_cb_list);
|
|
||||||
+ flow_block_cb_incref(block_cb);
|
+ flow_block_cb_incref(block_cb);
|
||||||
+
|
flow_block_cb_add(block_cb, f);
|
||||||
+ if (register_block) {
|
list_add_tail(&block_cb->driver_list, &block_cb_list);
|
||||||
+ flow_block_cb_add(block_cb, f);
|
|
||||||
+ list_add_tail(&block_cb->driver_list, &block_cb_list);
|
|
||||||
+ }
|
|
||||||
return 0;
|
return 0;
|
||||||
case FLOW_BLOCK_UNBIND:
|
@@ -592,7 +593,7 @@ mtk_eth_setup_tc_block(struct net_device
|
||||||
block_cb = flow_block_cb_lookup(f->block, cb, dev);
|
|
||||||
if (!block_cb)
|
if (!block_cb)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,266 @@
|
||||||
|
From: Felix Fietkau <nbd@nbd.name>
|
||||||
|
Date: Mon, 20 Mar 2023 11:44:30 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: add code for offloading flows
|
||||||
|
from wlan devices
|
||||||
|
|
||||||
|
WED version 2 (on MT7986 and later) can offload flows originating from wireless
|
||||||
|
devices. In order to make that work, ndo_setup_tc needs to be implemented on
|
||||||
|
the netdevs. This adds the required code to offload flows coming in from WED,
|
||||||
|
while keeping track of the incoming wed index used for selecting the correct
|
||||||
|
PPE device.
|
||||||
|
|
||||||
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
||||||
|
@@ -1319,6 +1319,9 @@ int mtk_gmac_rgmii_path_setup(struct mtk
|
||||||
|
int mtk_eth_offload_init(struct mtk_eth *eth);
|
||||||
|
int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type,
|
||||||
|
void *type_data);
|
||||||
|
+int mtk_flow_offload_cmd(struct mtk_eth *eth, struct flow_cls_offload *cls,
|
||||||
|
+ int ppe_index);
|
||||||
|
+void mtk_flow_offload_cleanup(struct mtk_eth *eth, struct list_head *list);
|
||||||
|
void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev);
|
||||||
|
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
|
||||||
|
@@ -235,7 +235,8 @@ out:
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
-mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f)
|
||||||
|
+mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f,
|
||||||
|
+ int ppe_index)
|
||||||
|
{
|
||||||
|
struct flow_rule *rule = flow_cls_offload_flow_rule(f);
|
||||||
|
struct flow_action_entry *act;
|
||||||
|
@@ -452,6 +453,7 @@ mtk_flow_offload_replace(struct mtk_eth
|
||||||
|
entry->cookie = f->cookie;
|
||||||
|
memcpy(&entry->data, &foe, sizeof(entry->data));
|
||||||
|
entry->wed_index = wed_index;
|
||||||
|
+ entry->ppe_index = ppe_index;
|
||||||
|
|
||||||
|
err = mtk_foe_entry_commit(eth->ppe[entry->ppe_index], entry);
|
||||||
|
if (err < 0)
|
||||||
|
@@ -520,25 +522,15 @@ mtk_flow_offload_stats(struct mtk_eth *e
|
||||||
|
|
||||||
|
static DEFINE_MUTEX(mtk_flow_offload_mutex);
|
||||||
|
|
||||||
|
-static int
|
||||||
|
-mtk_eth_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_priv)
|
||||||
|
+int mtk_flow_offload_cmd(struct mtk_eth *eth, struct flow_cls_offload *cls,
|
||||||
|
+ int ppe_index)
|
||||||
|
{
|
||||||
|
- struct flow_cls_offload *cls = type_data;
|
||||||
|
- struct net_device *dev = cb_priv;
|
||||||
|
- struct mtk_mac *mac = netdev_priv(dev);
|
||||||
|
- struct mtk_eth *eth = mac->hw;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
- if (!tc_can_offload(dev))
|
||||||
|
- return -EOPNOTSUPP;
|
||||||
|
-
|
||||||
|
- if (type != TC_SETUP_CLSFLOWER)
|
||||||
|
- return -EOPNOTSUPP;
|
||||||
|
-
|
||||||
|
mutex_lock(&mtk_flow_offload_mutex);
|
||||||
|
switch (cls->command) {
|
||||||
|
case FLOW_CLS_REPLACE:
|
||||||
|
- err = mtk_flow_offload_replace(eth, cls);
|
||||||
|
+ err = mtk_flow_offload_replace(eth, cls, ppe_index);
|
||||||
|
break;
|
||||||
|
case FLOW_CLS_DESTROY:
|
||||||
|
err = mtk_flow_offload_destroy(eth, cls);
|
||||||
|
@@ -556,6 +548,23 @@ mtk_eth_setup_tc_block_cb(enum tc_setup_
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
+mtk_eth_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_priv)
|
||||||
|
+{
|
||||||
|
+ struct flow_cls_offload *cls = type_data;
|
||||||
|
+ struct net_device *dev = cb_priv;
|
||||||
|
+ struct mtk_mac *mac = netdev_priv(dev);
|
||||||
|
+ struct mtk_eth *eth = mac->hw;
|
||||||
|
+
|
||||||
|
+ if (!tc_can_offload(dev))
|
||||||
|
+ return -EOPNOTSUPP;
|
||||||
|
+
|
||||||
|
+ if (type != TC_SETUP_CLSFLOWER)
|
||||||
|
+ return -EOPNOTSUPP;
|
||||||
|
+
|
||||||
|
+ return mtk_flow_offload_cmd(eth, cls, 0);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
mtk_eth_setup_tc_block(struct net_device *dev, struct flow_block_offload *f)
|
||||||
|
{
|
||||||
|
struct mtk_mac *mac = netdev_priv(dev);
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
|
@@ -13,6 +13,8 @@
|
||||||
|
#include <linux/mfd/syscon.h>
|
||||||
|
#include <linux/debugfs.h>
|
||||||
|
#include <linux/soc/mediatek/mtk_wed.h>
|
||||||
|
+#include <net/flow_offload.h>
|
||||||
|
+#include <net/pkt_cls.h>
|
||||||
|
#include "mtk_eth_soc.h"
|
||||||
|
#include "mtk_wed_regs.h"
|
||||||
|
#include "mtk_wed.h"
|
||||||
|
@@ -41,6 +43,11 @@
|
||||||
|
static struct mtk_wed_hw *hw_list[2];
|
||||||
|
static DEFINE_MUTEX(hw_lock);
|
||||||
|
|
||||||
|
+struct mtk_wed_flow_block_priv {
|
||||||
|
+ struct mtk_wed_hw *hw;
|
||||||
|
+ struct net_device *dev;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
wed_m32(struct mtk_wed_device *dev, u32 reg, u32 mask, u32 val)
|
||||||
|
{
|
||||||
|
@@ -1752,6 +1759,99 @@ out:
|
||||||
|
mutex_unlock(&hw_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int
|
||||||
|
+mtk_wed_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_priv)
|
||||||
|
+{
|
||||||
|
+ struct mtk_wed_flow_block_priv *priv = cb_priv;
|
||||||
|
+ struct flow_cls_offload *cls = type_data;
|
||||||
|
+ struct mtk_wed_hw *hw = priv->hw;
|
||||||
|
+
|
||||||
|
+ if (!tc_can_offload(priv->dev))
|
||||||
|
+ return -EOPNOTSUPP;
|
||||||
|
+
|
||||||
|
+ if (type != TC_SETUP_CLSFLOWER)
|
||||||
|
+ return -EOPNOTSUPP;
|
||||||
|
+
|
||||||
|
+ return mtk_flow_offload_cmd(hw->eth, cls, hw->index);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+mtk_wed_setup_tc_block(struct mtk_wed_hw *hw, struct net_device *dev,
|
||||||
|
+ struct flow_block_offload *f)
|
||||||
|
+{
|
||||||
|
+ struct mtk_wed_flow_block_priv *priv;
|
||||||
|
+ static LIST_HEAD(block_cb_list);
|
||||||
|
+ struct flow_block_cb *block_cb;
|
||||||
|
+ struct mtk_eth *eth = hw->eth;
|
||||||
|
+ flow_setup_cb_t *cb;
|
||||||
|
+
|
||||||
|
+ if (!eth->soc->offload_version)
|
||||||
|
+ return -EOPNOTSUPP;
|
||||||
|
+
|
||||||
|
+ if (f->binder_type != FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
|
||||||
|
+ return -EOPNOTSUPP;
|
||||||
|
+
|
||||||
|
+ cb = mtk_wed_setup_tc_block_cb;
|
||||||
|
+ f->driver_block_list = &block_cb_list;
|
||||||
|
+
|
||||||
|
+ switch (f->command) {
|
||||||
|
+ case FLOW_BLOCK_BIND:
|
||||||
|
+ block_cb = flow_block_cb_lookup(f->block, cb, dev);
|
||||||
|
+ if (block_cb) {
|
||||||
|
+ flow_block_cb_incref(block_cb);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
||||||
|
+ if (!priv)
|
||||||
|
+ return -ENOMEM;
|
||||||
|
+
|
||||||
|
+ priv->hw = hw;
|
||||||
|
+ priv->dev = dev;
|
||||||
|
+ block_cb = flow_block_cb_alloc(cb, dev, priv, NULL);
|
||||||
|
+ if (IS_ERR(block_cb)) {
|
||||||
|
+ kfree(priv);
|
||||||
|
+ return PTR_ERR(block_cb);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ flow_block_cb_incref(block_cb);
|
||||||
|
+ flow_block_cb_add(block_cb, f);
|
||||||
|
+ list_add_tail(&block_cb->driver_list, &block_cb_list);
|
||||||
|
+ return 0;
|
||||||
|
+ case FLOW_BLOCK_UNBIND:
|
||||||
|
+ block_cb = flow_block_cb_lookup(f->block, cb, dev);
|
||||||
|
+ if (!block_cb)
|
||||||
|
+ return -ENOENT;
|
||||||
|
+
|
||||||
|
+ if (!flow_block_cb_decref(block_cb)) {
|
||||||
|
+ flow_block_cb_remove(block_cb, f);
|
||||||
|
+ list_del(&block_cb->driver_list);
|
||||||
|
+ kfree(block_cb->cb_priv);
|
||||||
|
+ }
|
||||||
|
+ return 0;
|
||||||
|
+ default:
|
||||||
|
+ return -EOPNOTSUPP;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+mtk_wed_setup_tc(struct mtk_wed_device *wed, struct net_device *dev,
|
||||||
|
+ enum tc_setup_type type, void *type_data)
|
||||||
|
+{
|
||||||
|
+ struct mtk_wed_hw *hw = wed->hw;
|
||||||
|
+
|
||||||
|
+ if (hw->version < 2)
|
||||||
|
+ return -EOPNOTSUPP;
|
||||||
|
+
|
||||||
|
+ switch (type) {
|
||||||
|
+ case TC_SETUP_BLOCK:
|
||||||
|
+ case TC_SETUP_FT:
|
||||||
|
+ return mtk_wed_setup_tc_block(hw, dev, type_data);
|
||||||
|
+ default:
|
||||||
|
+ return -EOPNOTSUPP;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
|
||||||
|
void __iomem *wdma, phys_addr_t wdma_phy,
|
||||||
|
int index)
|
||||||
|
@@ -1771,6 +1871,7 @@ void mtk_wed_add_hw(struct device_node *
|
||||||
|
.irq_set_mask = mtk_wed_irq_set_mask,
|
||||||
|
.detach = mtk_wed_detach,
|
||||||
|
.ppe_check = mtk_wed_ppe_check,
|
||||||
|
+ .setup_tc = mtk_wed_setup_tc,
|
||||||
|
};
|
||||||
|
struct device_node *eth_np = eth->dev->of_node;
|
||||||
|
struct platform_device *pdev;
|
||||||
|
--- a/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
+++ b/include/linux/soc/mediatek/mtk_wed.h
|
||||||
|
@@ -6,6 +6,7 @@
|
||||||
|
#include <linux/regmap.h>
|
||||||
|
#include <linux/pci.h>
|
||||||
|
#include <linux/skbuff.h>
|
||||||
|
+#include <linux/netdevice.h>
|
||||||
|
|
||||||
|
#define MTK_WED_TX_QUEUES 2
|
||||||
|
#define MTK_WED_RX_QUEUES 2
|
||||||
|
@@ -180,6 +181,8 @@ struct mtk_wed_ops {
|
||||||
|
|
||||||
|
u32 (*irq_get)(struct mtk_wed_device *dev, u32 mask);
|
||||||
|
void (*irq_set_mask)(struct mtk_wed_device *dev, u32 mask);
|
||||||
|
+ int (*setup_tc)(struct mtk_wed_device *wed, struct net_device *dev,
|
||||||
|
+ enum tc_setup_type type, void *type_data);
|
||||||
|
};
|
||||||
|
|
||||||
|
extern const struct mtk_wed_ops __rcu *mtk_soc_wed_ops;
|
||||||
|
@@ -238,6 +241,8 @@ mtk_wed_get_rx_capa(struct mtk_wed_devic
|
||||||
|
(_dev)->ops->msg_update(_dev, _id, _msg, _len)
|
||||||
|
#define mtk_wed_device_stop(_dev) (_dev)->ops->stop(_dev)
|
||||||
|
#define mtk_wed_device_dma_reset(_dev) (_dev)->ops->reset_dma(_dev)
|
||||||
|
+#define mtk_wed_device_setup_tc(_dev, _netdev, _type, _type_data) \
|
||||||
|
+ (_dev)->ops->setup_tc(_dev, _netdev, _type, _type_data)
|
||||||
|
#else
|
||||||
|
static inline bool mtk_wed_device_active(struct mtk_wed_device *dev)
|
||||||
|
{
|
||||||
|
@@ -256,6 +261,7 @@ static inline bool mtk_wed_device_active
|
||||||
|
#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) -ENODEV
|
||||||
|
#define mtk_wed_device_stop(_dev) do {} while (0)
|
||||||
|
#define mtk_wed_device_dma_reset(_dev) do {} while (0)
|
||||||
|
+#define mtk_wed_device_setup_tc(_dev, _netdev, _type, _type_data) -EOPNOTSUPP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,37 @@
|
||||||
|
From: Felix Fietkau <nbd@nbd.name>
|
||||||
|
Date: Mon, 20 Mar 2023 15:37:55 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mediatek: mtk_ppe: prefer newly added l2
|
||||||
|
flows over existing ones
|
||||||
|
|
||||||
|
When a device is roaming between interfaces and a new flow entry is created,
|
||||||
|
we should assume that its output device is more up to date than whatever
|
||||||
|
entry existed already.
|
||||||
|
|
||||||
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
@@ -639,10 +639,20 @@ void mtk_foe_entry_clear(struct mtk_ppe
|
||||||
|
static int
|
||||||
|
mtk_foe_entry_commit_l2(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
||||||
|
{
|
||||||
|
+ struct mtk_flow_entry *prev;
|
||||||
|
+
|
||||||
|
entry->type = MTK_FLOW_TYPE_L2;
|
||||||
|
|
||||||
|
- return rhashtable_insert_fast(&ppe->l2_flows, &entry->l2_node,
|
||||||
|
- mtk_flow_l2_ht_params);
|
||||||
|
+ prev = rhashtable_lookup_get_insert_fast(&ppe->l2_flows, &entry->l2_node,
|
||||||
|
+ mtk_flow_l2_ht_params);
|
||||||
|
+ if (likely(!prev))
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+ if (IS_ERR(prev))
|
||||||
|
+ return PTR_ERR(prev);
|
||||||
|
+
|
||||||
|
+ return rhashtable_replace_fast(&ppe->l2_flows, &prev->l2_node,
|
||||||
|
+ &entry->l2_node, mtk_flow_l2_ht_params);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
|
@ -0,0 +1,314 @@
|
||||||
|
From: Felix Fietkau <nbd@nbd.name>
|
||||||
|
Date: Thu, 23 Mar 2023 10:24:11 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: improve keeping track of
|
||||||
|
offloaded flows
|
||||||
|
|
||||||
|
Unify tracking of L2 and L3 flows. Use the generic list field in struct
|
||||||
|
mtk_foe_entry for tracking L2 subflows. Preparation for improving
|
||||||
|
flow accounting support.
|
||||||
|
|
||||||
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
@@ -466,26 +466,30 @@ int mtk_foe_entry_set_queue(struct mtk_e
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int
|
||||||
|
+mtk_flow_entry_match_len(struct mtk_eth *eth, struct mtk_foe_entry *entry)
|
||||||
|
+{
|
||||||
|
+ int type = mtk_get_ib1_pkt_type(eth, entry->ib1);
|
||||||
|
+
|
||||||
|
+ if (type > MTK_PPE_PKT_TYPE_IPV4_DSLITE)
|
||||||
|
+ return offsetof(struct mtk_foe_entry, ipv6._rsv);
|
||||||
|
+ else
|
||||||
|
+ return offsetof(struct mtk_foe_entry, ipv4.ib2);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static bool
|
||||||
|
mtk_flow_entry_match(struct mtk_eth *eth, struct mtk_flow_entry *entry,
|
||||||
|
- struct mtk_foe_entry *data)
|
||||||
|
+ struct mtk_foe_entry *data, int len)
|
||||||
|
{
|
||||||
|
- int type, len;
|
||||||
|
-
|
||||||
|
if ((data->ib1 ^ entry->data.ib1) & MTK_FOE_IB1_UDP)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
- type = mtk_get_ib1_pkt_type(eth, entry->data.ib1);
|
||||||
|
- if (type > MTK_PPE_PKT_TYPE_IPV4_DSLITE)
|
||||||
|
- len = offsetof(struct mtk_foe_entry, ipv6._rsv);
|
||||||
|
- else
|
||||||
|
- len = offsetof(struct mtk_foe_entry, ipv4.ib2);
|
||||||
|
-
|
||||||
|
return !memcmp(&entry->data.data, &data->data, len - 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
-__mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
||||||
|
+__mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry,
|
||||||
|
+ bool set_state)
|
||||||
|
{
|
||||||
|
struct hlist_head *head;
|
||||||
|
struct hlist_node *tmp;
|
||||||
|
@@ -495,13 +499,12 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp
|
||||||
|
mtk_flow_l2_ht_params);
|
||||||
|
|
||||||
|
head = &entry->l2_flows;
|
||||||
|
- hlist_for_each_entry_safe(entry, tmp, head, l2_data.list)
|
||||||
|
- __mtk_foe_entry_clear(ppe, entry);
|
||||||
|
+ hlist_for_each_entry_safe(entry, tmp, head, list)
|
||||||
|
+ __mtk_foe_entry_clear(ppe, entry, set_state);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
- hlist_del_init(&entry->list);
|
||||||
|
- if (entry->hash != 0xffff) {
|
||||||
|
+ if (entry->hash != 0xffff && set_state) {
|
||||||
|
struct mtk_foe_entry *hwe = mtk_foe_get_entry(ppe, entry->hash);
|
||||||
|
|
||||||
|
hwe->ib1 &= ~MTK_FOE_IB1_STATE;
|
||||||
|
@@ -520,7 +523,7 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp
|
||||||
|
if (entry->type != MTK_FLOW_TYPE_L2_SUBFLOW)
|
||||||
|
return;
|
||||||
|
|
||||||
|
- hlist_del_init(&entry->l2_data.list);
|
||||||
|
+ hlist_del_init(&entry->list);
|
||||||
|
kfree(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -536,66 +539,55 @@ static int __mtk_foe_entry_idle_time(str
|
||||||
|
return now - timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static bool
|
||||||
|
+mtk_flow_entry_update(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
||||||
|
+{
|
||||||
|
+ struct mtk_foe_entry foe = {};
|
||||||
|
+ struct mtk_foe_entry *hwe;
|
||||||
|
+ u16 hash = entry->hash;
|
||||||
|
+ int len;
|
||||||
|
+
|
||||||
|
+ if (hash == 0xffff)
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
+ hwe = mtk_foe_get_entry(ppe, hash);
|
||||||
|
+ len = mtk_flow_entry_match_len(ppe->eth, &entry->data);
|
||||||
|
+ memcpy(&foe, hwe, len);
|
||||||
|
+
|
||||||
|
+ if (!mtk_flow_entry_match(ppe->eth, entry, &foe, len) ||
|
||||||
|
+ FIELD_GET(MTK_FOE_IB1_STATE, foe.ib1) != MTK_FOE_STATE_BIND)
|
||||||
|
+ return false;
|
||||||
|
+
|
||||||
|
+ entry->data.ib1 = foe.ib1;
|
||||||
|
+
|
||||||
|
+ return true;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
mtk_flow_entry_update_l2(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
||||||
|
{
|
||||||
|
u32 ib1_ts_mask = mtk_get_ib1_ts_mask(ppe->eth);
|
||||||
|
struct mtk_flow_entry *cur;
|
||||||
|
- struct mtk_foe_entry *hwe;
|
||||||
|
struct hlist_node *tmp;
|
||||||
|
int idle;
|
||||||
|
|
||||||
|
idle = __mtk_foe_entry_idle_time(ppe, entry->data.ib1);
|
||||||
|
- hlist_for_each_entry_safe(cur, tmp, &entry->l2_flows, l2_data.list) {
|
||||||
|
+ hlist_for_each_entry_safe(cur, tmp, &entry->l2_flows, list) {
|
||||||
|
int cur_idle;
|
||||||
|
- u32 ib1;
|
||||||
|
-
|
||||||
|
- hwe = mtk_foe_get_entry(ppe, cur->hash);
|
||||||
|
- ib1 = READ_ONCE(hwe->ib1);
|
||||||
|
|
||||||
|
- if (FIELD_GET(MTK_FOE_IB1_STATE, ib1) != MTK_FOE_STATE_BIND) {
|
||||||
|
- cur->hash = 0xffff;
|
||||||
|
- __mtk_foe_entry_clear(ppe, cur);
|
||||||
|
+ if (!mtk_flow_entry_update(ppe, cur)) {
|
||||||
|
+ __mtk_foe_entry_clear(ppe, entry, false);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
- cur_idle = __mtk_foe_entry_idle_time(ppe, ib1);
|
||||||
|
+ cur_idle = __mtk_foe_entry_idle_time(ppe, cur->data.ib1);
|
||||||
|
if (cur_idle >= idle)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
idle = cur_idle;
|
||||||
|
entry->data.ib1 &= ~ib1_ts_mask;
|
||||||
|
- entry->data.ib1 |= hwe->ib1 & ib1_ts_mask;
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void
|
||||||
|
-mtk_flow_entry_update(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
||||||
|
-{
|
||||||
|
- struct mtk_foe_entry foe = {};
|
||||||
|
- struct mtk_foe_entry *hwe;
|
||||||
|
-
|
||||||
|
- spin_lock_bh(&ppe_lock);
|
||||||
|
-
|
||||||
|
- if (entry->type == MTK_FLOW_TYPE_L2) {
|
||||||
|
- mtk_flow_entry_update_l2(ppe, entry);
|
||||||
|
- goto out;
|
||||||
|
+ entry->data.ib1 |= cur->data.ib1 & ib1_ts_mask;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- if (entry->hash == 0xffff)
|
||||||
|
- goto out;
|
||||||
|
-
|
||||||
|
- hwe = mtk_foe_get_entry(ppe, entry->hash);
|
||||||
|
- memcpy(&foe, hwe, ppe->eth->soc->foe_entry_size);
|
||||||
|
- if (!mtk_flow_entry_match(ppe->eth, entry, &foe)) {
|
||||||
|
- entry->hash = 0xffff;
|
||||||
|
- goto out;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- entry->data.ib1 = foe.ib1;
|
||||||
|
-
|
||||||
|
-out:
|
||||||
|
- spin_unlock_bh(&ppe_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
@@ -632,7 +624,8 @@ __mtk_foe_entry_commit(struct mtk_ppe *p
|
||||||
|
void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
||||||
|
{
|
||||||
|
spin_lock_bh(&ppe_lock);
|
||||||
|
- __mtk_foe_entry_clear(ppe, entry);
|
||||||
|
+ __mtk_foe_entry_clear(ppe, entry, true);
|
||||||
|
+ hlist_del_init(&entry->list);
|
||||||
|
spin_unlock_bh(&ppe_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -679,8 +672,8 @@ mtk_foe_entry_commit_subflow(struct mtk_
|
||||||
|
{
|
||||||
|
const struct mtk_soc_data *soc = ppe->eth->soc;
|
||||||
|
struct mtk_flow_entry *flow_info;
|
||||||
|
- struct mtk_foe_entry foe = {}, *hwe;
|
||||||
|
struct mtk_foe_mac_info *l2;
|
||||||
|
+ struct mtk_foe_entry *hwe;
|
||||||
|
u32 ib1_mask = mtk_get_ib1_pkt_type_mask(ppe->eth) | MTK_FOE_IB1_UDP;
|
||||||
|
int type;
|
||||||
|
|
||||||
|
@@ -688,30 +681,30 @@ mtk_foe_entry_commit_subflow(struct mtk_
|
||||||
|
if (!flow_info)
|
||||||
|
return;
|
||||||
|
|
||||||
|
- flow_info->l2_data.base_flow = entry;
|
||||||
|
flow_info->type = MTK_FLOW_TYPE_L2_SUBFLOW;
|
||||||
|
flow_info->hash = hash;
|
||||||
|
hlist_add_head(&flow_info->list,
|
||||||
|
&ppe->foe_flow[hash / soc->hash_offset]);
|
||||||
|
- hlist_add_head(&flow_info->l2_data.list, &entry->l2_flows);
|
||||||
|
+ hlist_add_head(&flow_info->list, &entry->l2_flows);
|
||||||
|
|
||||||
|
hwe = mtk_foe_get_entry(ppe, hash);
|
||||||
|
- memcpy(&foe, hwe, soc->foe_entry_size);
|
||||||
|
- foe.ib1 &= ib1_mask;
|
||||||
|
- foe.ib1 |= entry->data.ib1 & ~ib1_mask;
|
||||||
|
+ memcpy(&flow_info->data, hwe, soc->foe_entry_size);
|
||||||
|
+ flow_info->data.ib1 &= ib1_mask;
|
||||||
|
+ flow_info->data.ib1 |= entry->data.ib1 & ~ib1_mask;
|
||||||
|
|
||||||
|
- l2 = mtk_foe_entry_l2(ppe->eth, &foe);
|
||||||
|
+ l2 = mtk_foe_entry_l2(ppe->eth, &flow_info->data);
|
||||||
|
memcpy(l2, &entry->data.bridge.l2, sizeof(*l2));
|
||||||
|
|
||||||
|
- type = mtk_get_ib1_pkt_type(ppe->eth, foe.ib1);
|
||||||
|
+ type = mtk_get_ib1_pkt_type(ppe->eth, flow_info->data.ib1);
|
||||||
|
if (type == MTK_PPE_PKT_TYPE_IPV4_HNAPT)
|
||||||
|
- memcpy(&foe.ipv4.new, &foe.ipv4.orig, sizeof(foe.ipv4.new));
|
||||||
|
+ memcpy(&flow_info->data.ipv4.new, &flow_info->data.ipv4.orig,
|
||||||
|
+ sizeof(flow_info->data.ipv4.new));
|
||||||
|
else if (type >= MTK_PPE_PKT_TYPE_IPV6_ROUTE_3T && l2->etype == ETH_P_IP)
|
||||||
|
l2->etype = ETH_P_IPV6;
|
||||||
|
|
||||||
|
- *mtk_foe_entry_ib2(ppe->eth, &foe) = entry->data.bridge.ib2;
|
||||||
|
+ *mtk_foe_entry_ib2(ppe->eth, &flow_info->data) = entry->data.bridge.ib2;
|
||||||
|
|
||||||
|
- __mtk_foe_entry_commit(ppe, &foe, hash);
|
||||||
|
+ __mtk_foe_entry_commit(ppe, &flow_info->data, hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash)
|
||||||
|
@@ -721,9 +714,11 @@ void __mtk_ppe_check_skb(struct mtk_ppe
|
||||||
|
struct mtk_foe_entry *hwe = mtk_foe_get_entry(ppe, hash);
|
||||||
|
struct mtk_flow_entry *entry;
|
||||||
|
struct mtk_foe_bridge key = {};
|
||||||
|
+ struct mtk_foe_entry foe = {};
|
||||||
|
struct hlist_node *n;
|
||||||
|
struct ethhdr *eh;
|
||||||
|
bool found = false;
|
||||||
|
+ int entry_len;
|
||||||
|
u8 *tag;
|
||||||
|
|
||||||
|
spin_lock_bh(&ppe_lock);
|
||||||
|
@@ -731,20 +726,14 @@ void __mtk_ppe_check_skb(struct mtk_ppe
|
||||||
|
if (FIELD_GET(MTK_FOE_IB1_STATE, hwe->ib1) == MTK_FOE_STATE_BIND)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
- hlist_for_each_entry_safe(entry, n, head, list) {
|
||||||
|
- if (entry->type == MTK_FLOW_TYPE_L2_SUBFLOW) {
|
||||||
|
- if (unlikely(FIELD_GET(MTK_FOE_IB1_STATE, hwe->ib1) ==
|
||||||
|
- MTK_FOE_STATE_BIND))
|
||||||
|
- continue;
|
||||||
|
-
|
||||||
|
- entry->hash = 0xffff;
|
||||||
|
- __mtk_foe_entry_clear(ppe, entry);
|
||||||
|
- continue;
|
||||||
|
- }
|
||||||
|
+ entry_len = mtk_flow_entry_match_len(ppe->eth, hwe);
|
||||||
|
+ memcpy(&foe, hwe, entry_len);
|
||||||
|
|
||||||
|
- if (found || !mtk_flow_entry_match(ppe->eth, entry, hwe)) {
|
||||||
|
+ hlist_for_each_entry_safe(entry, n, head, list) {
|
||||||
|
+ if (found ||
|
||||||
|
+ !mtk_flow_entry_match(ppe->eth, entry, &foe, entry_len)) {
|
||||||
|
if (entry->hash != 0xffff)
|
||||||
|
- entry->hash = 0xffff;
|
||||||
|
+ __mtk_foe_entry_clear(ppe, entry, false);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -795,9 +784,17 @@ out:
|
||||||
|
|
||||||
|
int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
||||||
|
{
|
||||||
|
- mtk_flow_entry_update(ppe, entry);
|
||||||
|
+ int idle;
|
||||||
|
+
|
||||||
|
+ spin_lock_bh(&ppe_lock);
|
||||||
|
+ if (entry->type == MTK_FLOW_TYPE_L2)
|
||||||
|
+ mtk_flow_entry_update_l2(ppe, entry);
|
||||||
|
+ else
|
||||||
|
+ mtk_flow_entry_update(ppe, entry);
|
||||||
|
+ idle = __mtk_foe_entry_idle_time(ppe, entry->data.ib1);
|
||||||
|
+ spin_unlock_bh(&ppe_lock);
|
||||||
|
|
||||||
|
- return __mtk_foe_entry_idle_time(ppe, entry->data.ib1);
|
||||||
|
+ return idle;
|
||||||
|
}
|
||||||
|
|
||||||
|
int mtk_ppe_prepare_reset(struct mtk_ppe *ppe)
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
|
||||||
|
@@ -275,13 +275,7 @@ struct mtk_flow_entry {
|
||||||
|
s8 wed_index;
|
||||||
|
u8 ppe_index;
|
||||||
|
u16 hash;
|
||||||
|
- union {
|
||||||
|
- struct mtk_foe_entry data;
|
||||||
|
- struct {
|
||||||
|
- struct mtk_flow_entry *base_flow;
|
||||||
|
- struct hlist_node list;
|
||||||
|
- } l2_data;
|
||||||
|
- };
|
||||||
|
+ struct mtk_foe_entry data;
|
||||||
|
struct rhash_head node;
|
||||||
|
unsigned long cookie;
|
||||||
|
};
|
|
@ -0,0 +1,333 @@
|
||||||
|
From: Felix Fietkau <nbd@nbd.name>
|
||||||
|
Date: Thu, 23 Mar 2023 11:05:22 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mediatek: fix ppe flow accounting for L2
|
||||||
|
flows
|
||||||
|
|
||||||
|
For L2 flows, the packet/byte counters should report the sum of the
|
||||||
|
counters of their subflows, both current and expired.
|
||||||
|
In order to make this work, change the way that accounting data is tracked.
|
||||||
|
Reset counters when a flow enters bind. Once it expires (or enters unbind),
|
||||||
|
store the last counter value in struct mtk_flow_entry.
|
||||||
|
|
||||||
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
@@ -80,9 +80,9 @@ static int mtk_ppe_mib_wait_busy(struct
|
||||||
|
int ret;
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
- ret = readl_poll_timeout(ppe->base + MTK_PPE_MIB_SER_CR, val,
|
||||||
|
- !(val & MTK_PPE_MIB_SER_CR_ST),
|
||||||
|
- 20, MTK_PPE_WAIT_TIMEOUT_US);
|
||||||
|
+ ret = readl_poll_timeout_atomic(ppe->base + MTK_PPE_MIB_SER_CR, val,
|
||||||
|
+ !(val & MTK_PPE_MIB_SER_CR_ST),
|
||||||
|
+ 20, MTK_PPE_WAIT_TIMEOUT_US);
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
dev_err(ppe->dev, "MIB table busy");
|
||||||
|
@@ -90,18 +90,32 @@ static int mtk_ppe_mib_wait_busy(struct
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int mtk_mib_entry_read(struct mtk_ppe *ppe, u16 index, u64 *bytes, u64 *packets)
|
||||||
|
+static inline struct mtk_foe_accounting *
|
||||||
|
+mtk_ppe_acct_data(struct mtk_ppe *ppe, u16 index)
|
||||||
|
+{
|
||||||
|
+ if (!ppe->acct_table)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ return ppe->acct_table + index * sizeof(struct mtk_foe_accounting);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+struct mtk_foe_accounting *mtk_ppe_mib_entry_read(struct mtk_ppe *ppe, u16 index)
|
||||||
|
{
|
||||||
|
u32 byte_cnt_low, byte_cnt_high, pkt_cnt_low, pkt_cnt_high;
|
||||||
|
u32 val, cnt_r0, cnt_r1, cnt_r2;
|
||||||
|
+ struct mtk_foe_accounting *acct;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
val = FIELD_PREP(MTK_PPE_MIB_SER_CR_ADDR, index) | MTK_PPE_MIB_SER_CR_ST;
|
||||||
|
ppe_w32(ppe, MTK_PPE_MIB_SER_CR, val);
|
||||||
|
|
||||||
|
+ acct = mtk_ppe_acct_data(ppe, index);
|
||||||
|
+ if (!acct)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
ret = mtk_ppe_mib_wait_busy(ppe);
|
||||||
|
if (ret)
|
||||||
|
- return ret;
|
||||||
|
+ return acct;
|
||||||
|
|
||||||
|
cnt_r0 = readl(ppe->base + MTK_PPE_MIB_SER_R0);
|
||||||
|
cnt_r1 = readl(ppe->base + MTK_PPE_MIB_SER_R1);
|
||||||
|
@@ -111,10 +125,11 @@ static int mtk_mib_entry_read(struct mtk
|
||||||
|
byte_cnt_high = FIELD_GET(MTK_PPE_MIB_SER_R1_BYTE_CNT_HIGH, cnt_r1);
|
||||||
|
pkt_cnt_low = FIELD_GET(MTK_PPE_MIB_SER_R1_PKT_CNT_LOW, cnt_r1);
|
||||||
|
pkt_cnt_high = FIELD_GET(MTK_PPE_MIB_SER_R2_PKT_CNT_HIGH, cnt_r2);
|
||||||
|
- *bytes = ((u64)byte_cnt_high << 32) | byte_cnt_low;
|
||||||
|
- *packets = (pkt_cnt_high << 16) | pkt_cnt_low;
|
||||||
|
|
||||||
|
- return 0;
|
||||||
|
+ acct->bytes += ((u64)byte_cnt_high << 32) | byte_cnt_low;
|
||||||
|
+ acct->packets += (pkt_cnt_high << 16) | pkt_cnt_low;
|
||||||
|
+
|
||||||
|
+ return acct;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void mtk_ppe_cache_clear(struct mtk_ppe *ppe)
|
||||||
|
@@ -510,13 +525,6 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp
|
||||||
|
hwe->ib1 &= ~MTK_FOE_IB1_STATE;
|
||||||
|
hwe->ib1 |= FIELD_PREP(MTK_FOE_IB1_STATE, MTK_FOE_STATE_INVALID);
|
||||||
|
dma_wmb();
|
||||||
|
- if (ppe->accounting) {
|
||||||
|
- struct mtk_foe_accounting *acct;
|
||||||
|
-
|
||||||
|
- acct = ppe->acct_table + entry->hash * sizeof(*acct);
|
||||||
|
- acct->packets = 0;
|
||||||
|
- acct->bytes = 0;
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
entry->hash = 0xffff;
|
||||||
|
|
||||||
|
@@ -540,11 +548,14 @@ static int __mtk_foe_entry_idle_time(str
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
-mtk_flow_entry_update(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
||||||
|
+mtk_flow_entry_update(struct mtk_ppe *ppe, struct mtk_flow_entry *entry,
|
||||||
|
+ u64 *packets, u64 *bytes)
|
||||||
|
{
|
||||||
|
+ struct mtk_foe_accounting *acct;
|
||||||
|
struct mtk_foe_entry foe = {};
|
||||||
|
struct mtk_foe_entry *hwe;
|
||||||
|
u16 hash = entry->hash;
|
||||||
|
+ bool ret = false;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
if (hash == 0xffff)
|
||||||
|
@@ -555,18 +566,35 @@ mtk_flow_entry_update(struct mtk_ppe *pp
|
||||||
|
memcpy(&foe, hwe, len);
|
||||||
|
|
||||||
|
if (!mtk_flow_entry_match(ppe->eth, entry, &foe, len) ||
|
||||||
|
- FIELD_GET(MTK_FOE_IB1_STATE, foe.ib1) != MTK_FOE_STATE_BIND)
|
||||||
|
- return false;
|
||||||
|
+ FIELD_GET(MTK_FOE_IB1_STATE, foe.ib1) != MTK_FOE_STATE_BIND) {
|
||||||
|
+ acct = mtk_ppe_acct_data(ppe, hash);
|
||||||
|
+ if (acct) {
|
||||||
|
+ entry->prev_packets += acct->packets;
|
||||||
|
+ entry->prev_bytes += acct->bytes;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ goto out;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
entry->data.ib1 = foe.ib1;
|
||||||
|
+ acct = mtk_ppe_mib_entry_read(ppe, hash);
|
||||||
|
+ ret = true;
|
||||||
|
+
|
||||||
|
+out:
|
||||||
|
+ if (acct) {
|
||||||
|
+ *packets += acct->packets;
|
||||||
|
+ *bytes += acct->bytes;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- return true;
|
||||||
|
+ return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
mtk_flow_entry_update_l2(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
||||||
|
{
|
||||||
|
u32 ib1_ts_mask = mtk_get_ib1_ts_mask(ppe->eth);
|
||||||
|
+ u64 *packets = &entry->packets;
|
||||||
|
+ u64 *bytes = &entry->bytes;
|
||||||
|
struct mtk_flow_entry *cur;
|
||||||
|
struct hlist_node *tmp;
|
||||||
|
int idle;
|
||||||
|
@@ -575,7 +603,9 @@ mtk_flow_entry_update_l2(struct mtk_ppe
|
||||||
|
hlist_for_each_entry_safe(cur, tmp, &entry->l2_flows, list) {
|
||||||
|
int cur_idle;
|
||||||
|
|
||||||
|
- if (!mtk_flow_entry_update(ppe, cur)) {
|
||||||
|
+ if (!mtk_flow_entry_update(ppe, cur, packets, bytes)) {
|
||||||
|
+ entry->prev_packets += cur->prev_packets;
|
||||||
|
+ entry->prev_bytes += cur->prev_bytes;
|
||||||
|
__mtk_foe_entry_clear(ppe, entry, false);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
@@ -590,10 +620,29 @@ mtk_flow_entry_update_l2(struct mtk_ppe
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void mtk_foe_entry_get_stats(struct mtk_ppe *ppe, struct mtk_flow_entry *entry,
|
||||||
|
+ int *idle)
|
||||||
|
+{
|
||||||
|
+ entry->packets = entry->prev_packets;
|
||||||
|
+ entry->bytes = entry->prev_bytes;
|
||||||
|
+
|
||||||
|
+ spin_lock_bh(&ppe_lock);
|
||||||
|
+
|
||||||
|
+ if (entry->type == MTK_FLOW_TYPE_L2)
|
||||||
|
+ mtk_flow_entry_update_l2(ppe, entry);
|
||||||
|
+ else
|
||||||
|
+ mtk_flow_entry_update(ppe, entry, &entry->packets, &entry->bytes);
|
||||||
|
+
|
||||||
|
+ *idle = __mtk_foe_entry_idle_time(ppe, entry->data.ib1);
|
||||||
|
+
|
||||||
|
+ spin_unlock_bh(&ppe_lock);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
__mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_foe_entry *entry,
|
||||||
|
u16 hash)
|
||||||
|
{
|
||||||
|
+ struct mtk_foe_accounting *acct;
|
||||||
|
struct mtk_eth *eth = ppe->eth;
|
||||||
|
u16 timestamp = mtk_eth_timestamp(eth);
|
||||||
|
struct mtk_foe_entry *hwe;
|
||||||
|
@@ -618,6 +667,12 @@ __mtk_foe_entry_commit(struct mtk_ppe *p
|
||||||
|
|
||||||
|
dma_wmb();
|
||||||
|
|
||||||
|
+ acct = mtk_ppe_mib_entry_read(ppe, hash);
|
||||||
|
+ if (acct) {
|
||||||
|
+ acct->packets = 0;
|
||||||
|
+ acct->bytes = 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
mtk_ppe_cache_clear(ppe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -782,21 +837,6 @@ out:
|
||||||
|
spin_unlock_bh(&ppe_lock);
|
||||||
|
}
|
||||||
|
|
||||||
|
-int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry)
|
||||||
|
-{
|
||||||
|
- int idle;
|
||||||
|
-
|
||||||
|
- spin_lock_bh(&ppe_lock);
|
||||||
|
- if (entry->type == MTK_FLOW_TYPE_L2)
|
||||||
|
- mtk_flow_entry_update_l2(ppe, entry);
|
||||||
|
- else
|
||||||
|
- mtk_flow_entry_update(ppe, entry);
|
||||||
|
- idle = __mtk_foe_entry_idle_time(ppe, entry->data.ib1);
|
||||||
|
- spin_unlock_bh(&ppe_lock);
|
||||||
|
-
|
||||||
|
- return idle;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
int mtk_ppe_prepare_reset(struct mtk_ppe *ppe)
|
||||||
|
{
|
||||||
|
if (!ppe)
|
||||||
|
@@ -824,32 +864,6 @@ int mtk_ppe_prepare_reset(struct mtk_ppe
|
||||||
|
return mtk_ppe_wait_busy(ppe);
|
||||||
|
}
|
||||||
|
|
||||||
|
-struct mtk_foe_accounting *mtk_foe_entry_get_mib(struct mtk_ppe *ppe, u32 index,
|
||||||
|
- struct mtk_foe_accounting *diff)
|
||||||
|
-{
|
||||||
|
- struct mtk_foe_accounting *acct;
|
||||||
|
- int size = sizeof(struct mtk_foe_accounting);
|
||||||
|
- u64 bytes, packets;
|
||||||
|
-
|
||||||
|
- if (!ppe->accounting)
|
||||||
|
- return NULL;
|
||||||
|
-
|
||||||
|
- if (mtk_mib_entry_read(ppe, index, &bytes, &packets))
|
||||||
|
- return NULL;
|
||||||
|
-
|
||||||
|
- acct = ppe->acct_table + index * size;
|
||||||
|
-
|
||||||
|
- acct->bytes += bytes;
|
||||||
|
- acct->packets += packets;
|
||||||
|
-
|
||||||
|
- if (diff) {
|
||||||
|
- diff->bytes = bytes;
|
||||||
|
- diff->packets = packets;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- return acct;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int index)
|
||||||
|
{
|
||||||
|
bool accounting = eth->soc->has_accounting;
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
|
||||||
|
@@ -278,6 +278,8 @@ struct mtk_flow_entry {
|
||||||
|
struct mtk_foe_entry data;
|
||||||
|
struct rhash_head node;
|
||||||
|
unsigned long cookie;
|
||||||
|
+ u64 prev_packets, prev_bytes;
|
||||||
|
+ u64 packets, bytes;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct mtk_mib_entry {
|
||||||
|
@@ -320,6 +322,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
|
||||||
|
void mtk_ppe_start(struct mtk_ppe *ppe);
|
||||||
|
int mtk_ppe_stop(struct mtk_ppe *ppe);
|
||||||
|
int mtk_ppe_prepare_reset(struct mtk_ppe *ppe);
|
||||||
|
+struct mtk_foe_accounting *mtk_ppe_mib_entry_read(struct mtk_ppe *ppe, u16 index);
|
||||||
|
|
||||||
|
void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash);
|
||||||
|
|
||||||
|
@@ -368,9 +371,8 @@ int mtk_foe_entry_set_queue(struct mtk_e
|
||||||
|
unsigned int queue);
|
||||||
|
int mtk_foe_entry_commit(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
|
||||||
|
void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
|
||||||
|
-int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
|
||||||
|
int mtk_ppe_debugfs_init(struct mtk_ppe *ppe, int index);
|
||||||
|
-struct mtk_foe_accounting *mtk_foe_entry_get_mib(struct mtk_ppe *ppe, u32 index,
|
||||||
|
- struct mtk_foe_accounting *diff);
|
||||||
|
+void mtk_foe_entry_get_stats(struct mtk_ppe *ppe, struct mtk_flow_entry *entry,
|
||||||
|
+ int *idle);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c
|
||||||
|
@@ -96,7 +96,7 @@ mtk_ppe_debugfs_foe_show(struct seq_file
|
||||||
|
if (bind && state != MTK_FOE_STATE_BIND)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
- acct = mtk_foe_entry_get_mib(ppe, i, NULL);
|
||||||
|
+ acct = mtk_ppe_mib_entry_read(ppe, i);
|
||||||
|
|
||||||
|
type = FIELD_GET(MTK_FOE_IB1_PACKET_TYPE, entry->ib1);
|
||||||
|
seq_printf(m, "%05x %s %7s", i,
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c
|
||||||
|
@@ -499,24 +499,21 @@ static int
|
||||||
|
mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f)
|
||||||
|
{
|
||||||
|
struct mtk_flow_entry *entry;
|
||||||
|
- struct mtk_foe_accounting diff;
|
||||||
|
- u32 idle;
|
||||||
|
+ u64 packets, bytes;
|
||||||
|
+ int idle;
|
||||||
|
|
||||||
|
entry = rhashtable_lookup(ð->flow_table, &f->cookie,
|
||||||
|
mtk_flow_ht_params);
|
||||||
|
if (!entry)
|
||||||
|
return -ENOENT;
|
||||||
|
|
||||||
|
- idle = mtk_foe_entry_idle_time(eth->ppe[entry->ppe_index], entry);
|
||||||
|
+ packets = entry->packets;
|
||||||
|
+ bytes = entry->bytes;
|
||||||
|
+ mtk_foe_entry_get_stats(eth->ppe[entry->ppe_index], entry, &idle);
|
||||||
|
+ f->stats.pkts += entry->packets - packets;
|
||||||
|
+ f->stats.bytes += entry->bytes - bytes;
|
||||||
|
f->stats.lastused = jiffies - idle * HZ;
|
||||||
|
|
||||||
|
- if (entry->hash != 0xFFFF &&
|
||||||
|
- mtk_foe_entry_get_mib(eth->ppe[entry->ppe_index], entry->hash,
|
||||||
|
- &diff)) {
|
||||||
|
- f->stats.pkts += diff.packets;
|
||||||
|
- f->stats.bytes += diff.bytes;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
From: Felix Fietkau <nbd@nbd.name>
|
||||||
|
Date: Thu, 23 Mar 2023 11:19:14 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: add missing ppe cache flush when
|
||||||
|
deleting a flow
|
||||||
|
|
||||||
|
The cache needs to be flushed to ensure that the hardware stops offloading
|
||||||
|
the flow immediately.
|
||||||
|
|
||||||
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
@@ -525,6 +525,7 @@ __mtk_foe_entry_clear(struct mtk_ppe *pp
|
||||||
|
hwe->ib1 &= ~MTK_FOE_IB1_STATE;
|
||||||
|
hwe->ib1 |= FIELD_PREP(MTK_FOE_IB1_STATE, MTK_FOE_STATE_INVALID);
|
||||||
|
dma_wmb();
|
||||||
|
+ mtk_ppe_cache_clear(ppe);
|
||||||
|
}
|
||||||
|
entry->hash = 0xffff;
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
From: Felix Fietkau <nbd@nbd.name>
|
||||||
|
Date: Thu, 23 Mar 2023 21:45:43 +0100
|
||||||
|
Subject: [PATCH] net: ethernet: mediatek: fix ppe flow accounting for v1
|
||||||
|
hardware
|
||||||
|
|
||||||
|
Older chips (like MT7622) use a different bit in ib2 to enable hardware
|
||||||
|
counter support.
|
||||||
|
|
||||||
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||||
|
---
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
|
||||||
|
@@ -647,6 +647,7 @@ __mtk_foe_entry_commit(struct mtk_ppe *p
|
||||||
|
struct mtk_eth *eth = ppe->eth;
|
||||||
|
u16 timestamp = mtk_eth_timestamp(eth);
|
||||||
|
struct mtk_foe_entry *hwe;
|
||||||
|
+ u32 val;
|
||||||
|
|
||||||
|
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||||
|
entry->ib1 &= ~MTK_FOE_IB1_BIND_TIMESTAMP_V2;
|
||||||
|
@@ -663,8 +664,13 @@ __mtk_foe_entry_commit(struct mtk_ppe *p
|
||||||
|
wmb();
|
||||||
|
hwe->ib1 = entry->ib1;
|
||||||
|
|
||||||
|
- if (ppe->accounting)
|
||||||
|
- *mtk_foe_entry_ib2(eth, hwe) |= MTK_FOE_IB2_MIB_CNT;
|
||||||
|
+ if (ppe->accounting) {
|
||||||
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
|
||||||
|
+ val = MTK_FOE_IB2_MIB_CNT_V2;
|
||||||
|
+ else
|
||||||
|
+ val = MTK_FOE_IB2_MIB_CNT;
|
||||||
|
+ *mtk_foe_entry_ib2(eth, hwe) |= val;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
dma_wmb();
|
||||||
|
|
||||||
|
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
|
||||||
|
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
|
||||||
|
@@ -55,9 +55,10 @@ enum {
|
||||||
|
#define MTK_FOE_IB2_PSE_QOS BIT(4)
|
||||||
|
#define MTK_FOE_IB2_DEST_PORT GENMASK(7, 5)
|
||||||
|
#define MTK_FOE_IB2_MULTICAST BIT(8)
|
||||||
|
+#define MTK_FOE_IB2_MIB_CNT BIT(10)
|
||||||
|
|
||||||
|
#define MTK_FOE_IB2_WDMA_QID2 GENMASK(13, 12)
|
||||||
|
-#define MTK_FOE_IB2_MIB_CNT BIT(15)
|
||||||
|
+#define MTK_FOE_IB2_MIB_CNT_V2 BIT(15)
|
||||||
|
#define MTK_FOE_IB2_WDMA_DEVIDX BIT(16)
|
||||||
|
#define MTK_FOE_IB2_WDMA_WINFO BIT(17)
|
||||||
|
|
|
@ -152,7 +152,7 @@ Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||||
if (is531x5(dev) && phy_interface_is_rgmii(phydev)) {
|
if (is531x5(dev) && phy_interface_is_rgmii(phydev)) {
|
||||||
if (port == dev->imp_port)
|
if (port == dev->imp_port)
|
||||||
off = B53_RGMII_CTRL_IMP;
|
off = B53_RGMII_CTRL_IMP;
|
||||||
@@ -1396,6 +1439,9 @@ void b53_phylink_mac_link_down(struct ds
|
@@ -1419,6 +1462,9 @@ void b53_phylink_mac_link_up(struct dsa_
|
||||||
{
|
{
|
||||||
struct b53_device *dev = ds->priv;
|
struct b53_device *dev = ds->priv;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,118 @@
|
||||||
|
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,
|
|
@ -0,0 +1,189 @@
|
||||||
|
From patchwork Fri Mar 24 08:41:38 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: 13186549
|
||||||
|
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 EF744C76195
|
||||||
|
for <netdev@archiver.kernel.org>; Fri, 24 Mar 2023 08:42:01 +0000 (UTC)
|
||||||
|
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
|
||||||
|
id S231807AbjCXImA (ORCPT <rfc822;netdev@archiver.kernel.org>);
|
||||||
|
Fri, 24 Mar 2023 04:42:00 -0400
|
||||||
|
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32956 "EHLO
|
||||||
|
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
|
||||||
|
with ESMTP id S231272AbjCXIly (ORCPT
|
||||||
|
<rfc822;netdev@vger.kernel.org>); Fri, 24 Mar 2023 04:41:54 -0400
|
||||||
|
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
|
||||||
|
[IPv6:2a00:1450:4864:20::535])
|
||||||
|
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 113A517CF3;
|
||||||
|
Fri, 24 Mar 2023 01:41:46 -0700 (PDT)
|
||||||
|
Received: by mail-ed1-x535.google.com with SMTP id ek18so4877175edb.6;
|
||||||
|
Fri, 24 Mar 2023 01:41:45 -0700 (PDT)
|
||||||
|
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||||
|
d=gmail.com; s=20210112; t=1679647304;
|
||||||
|
h=content-transfer-encoding:mime-version:references:in-reply-to
|
||||||
|
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
|
||||||
|
:message-id:reply-to;
|
||||||
|
bh=OfUWRaFIQIQw/lRivER+LHryfdLliXzvabGrcmkQVEU=;
|
||||||
|
b=JMrl6Eay1FS0JZqgPHsbcVzuNAbFELc0SLNGyzYtOVQXcI+YwKDM9Ls7I9PsQVEPoZ
|
||||||
|
CthomCTYoz5G9DU7uBuia207rnjOhssZJRu0syrCoU+O/ZiQyGLJDvq61z5oZJxC2S40
|
||||||
|
kzRsUsC6MRjn64DKPWmxhsSTMKLzn2+P233LKNFbHtfi3NWF5Qu/85sUkxMurnfUgja0
|
||||||
|
qQhl25qYY7ZIvmlFHYefaI5UkITQFuiybrqJW9tztCdHf/gS+f33YkkvQ8njmMQa1DW0
|
||||||
|
ppedfOUotX+6kmHZGX1yea2V5ezEGGvRourZtYMoecTiD0E5d1J1bKhktKslVLIDm0ig
|
||||||
|
oc2g==
|
||||||
|
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||||
|
d=1e100.net; s=20210112; t=1679647304;
|
||||||
|
h=content-transfer-encoding:mime-version:references:in-reply-to
|
||||||
|
:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
|
||||||
|
:subject:date:message-id:reply-to;
|
||||||
|
bh=OfUWRaFIQIQw/lRivER+LHryfdLliXzvabGrcmkQVEU=;
|
||||||
|
b=b3Gmga5ZDbnmQfnw1GCz+eU2JwgsVzfciZuSmfYAiVxpW4c6cur3MHbpzDPhi99wzA
|
||||||
|
ZYAM7ryLv88rXl/tQB5g2Nte5rvMfxUeHXsT/JpsRcSSocFRbRrk0QJyiA/Xj86NiD5N
|
||||||
|
C1sKz50Im190FmrvPcBh6OHQbv/3MQyE+1fQx+9q3jW5rQiAWQaYk4Ng8GlWA7gtG3jB
|
||||||
|
fHO6Fuoenn32pgkveJbQLYL/2t2f53wGf3QLQ3IeKW7jdfIHNThwrwqBMxdHoIDaTBT9
|
||||||
|
UWMeJuiYtylIibo/3zbORbWOgIERlWxZRf3BCOFpnzUn4eBzio4LgjtNxZ77ITRxsmbk
|
||||||
|
3+Hg==
|
||||||
|
X-Gm-Message-State: AAQBX9dfyBfbR7Sdd5wqxMiAv3Yhk47pK1XzD87MZyAF3AxyoFyKcMaF
|
||||||
|
EbwJLyRvTGQEFdVWCGw1eMU=
|
||||||
|
X-Google-Smtp-Source:
|
||||||
|
AKy350bpDVLq7k1FxG2Mek/VIobZL4KhufiKx8qfmpxpcWmLI3bLg8wfQKEAKJRNJBleo/7CZuCL5g==
|
||||||
|
X-Received: by 2002:aa7:c711:0:b0:4a2:588f:b3c5 with SMTP id
|
||||||
|
i17-20020aa7c711000000b004a2588fb3c5mr2261236edq.21.1679647304260;
|
||||||
|
Fri, 24 Mar 2023 01:41: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
|
||||||
|
z21-20020a50cd15000000b004acbda55f6bsm10323728edi.27.2023.03.24.01.41.43
|
||||||
|
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||||||
|
Fri, 24 Mar 2023 01:41:43 -0700 (PDT)
|
||||||
|
From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <noltari@gmail.com>
|
||||||
|
To: paul.geurts@prodrive-technologies.com, 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, robh+dt@kernel.org,
|
||||||
|
krzysztof.kozlowski+dt@linaro.org, netdev@vger.kernel.org,
|
||||||
|
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
|
||||||
|
Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <noltari@gmail.com>
|
||||||
|
Subject: [PATCH v2 2/2] net: dsa: b53: mdio: add support for BCM53134
|
||||||
|
Date: Fri, 24 Mar 2023 09:41:38 +0100
|
||||||
|
Message-Id: <20230324084138.664285-3-noltari@gmail.com>
|
||||||
|
X-Mailer: git-send-email 2.30.2
|
||||||
|
In-Reply-To: <20230324084138.664285-1-noltari@gmail.com>
|
||||||
|
References: <20230323121804.2249605-1-noltari@gmail.com>
|
||||||
|
<20230324084138.664285-1-noltari@gmail.com>
|
||||||
|
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
|
||||||
|
|
||||||
|
From: Paul Geurts <paul.geurts@prodrive-technologies.com>
|
||||||
|
|
||||||
|
Add support for the BCM53134 Ethernet switch in the existing b53 dsa driver.
|
||||||
|
BCM53134 is very similar to the BCM58XX series.
|
||||||
|
|
||||||
|
Signed-off-by: Paul Geurts <paul.geurts@prodrive-technologies.com>
|
||||||
|
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||||
|
---
|
||||||
|
v2: add BCM53134 to is531x5() and remove special RGMII config
|
||||||
|
|
||||||
|
drivers/net/dsa/b53/b53_common.c | 15 +++++++++++++++
|
||||||
|
drivers/net/dsa/b53/b53_mdio.c | 5 ++++-
|
||||||
|
drivers/net/dsa/b53/b53_priv.h | 7 +++++--
|
||||||
|
3 files changed, 24 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
--- a/drivers/net/dsa/b53/b53_common.c
|
||||||
|
+++ b/drivers/net/dsa/b53/b53_common.c
|
||||||
|
@@ -2609,6 +2609,20 @@ static const struct b53_chip_data b53_sw
|
||||||
|
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
|
||||||
|
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
|
||||||
|
},
|
||||||
|
+ {
|
||||||
|
+ .chip_id = BCM53134_DEVICE_ID,
|
||||||
|
+ .dev_name = "BCM53134",
|
||||||
|
+ .vlans = 4096,
|
||||||
|
+ .enabled_ports = 0x12f,
|
||||||
|
+ .imp_port = 8,
|
||||||
|
+ .cpu_port = B53_CPU_PORT,
|
||||||
|
+ .vta_regs = B53_VTA_REGS,
|
||||||
|
+ .arl_bins = 4,
|
||||||
|
+ .arl_buckets = 1024,
|
||||||
|
+ .duplex_reg = B53_DUPLEX_STAT_GE,
|
||||||
|
+ .jumbo_pm_reg = B53_JUMBO_PORT_MASK,
|
||||||
|
+ .jumbo_size_reg = B53_JUMBO_MAX_SIZE,
|
||||||
|
+ },
|
||||||
|
};
|
||||||
|
|
||||||
|
static int b53_switch_init(struct b53_device *dev)
|
||||||
|
@@ -2785,6 +2799,7 @@ int b53_switch_detect(struct b53_device
|
||||||
|
case BCM53012_DEVICE_ID:
|
||||||
|
case BCM53018_DEVICE_ID:
|
||||||
|
case BCM53019_DEVICE_ID:
|
||||||
|
+ case BCM53134_DEVICE_ID:
|
||||||
|
dev->chip_id = id32;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
--- a/drivers/net/dsa/b53/b53_mdio.c
|
||||||
|
+++ b/drivers/net/dsa/b53/b53_mdio.c
|
||||||
|
@@ -286,6 +286,7 @@ static const struct b53_io_ops b53_mdio_
|
||||||
|
#define B53_BRCM_OUI_2 0x03625c00
|
||||||
|
#define B53_BRCM_OUI_3 0x00406000
|
||||||
|
#define B53_BRCM_OUI_4 0x01410c00
|
||||||
|
+#define B53_BRCM_OUI_5 0xae025000
|
||||||
|
|
||||||
|
static int b53_mdio_probe(struct mdio_device *mdiodev)
|
||||||
|
{
|
||||||
|
@@ -313,7 +314,8 @@ static int b53_mdio_probe(struct mdio_de
|
||||||
|
if ((phy_id & 0xfffffc00) != B53_BRCM_OUI_1 &&
|
||||||
|
(phy_id & 0xfffffc00) != B53_BRCM_OUI_2 &&
|
||||||
|
(phy_id & 0xfffffc00) != B53_BRCM_OUI_3 &&
|
||||||
|
- (phy_id & 0xfffffc00) != B53_BRCM_OUI_4) {
|
||||||
|
+ (phy_id & 0xfffffc00) != B53_BRCM_OUI_4 &&
|
||||||
|
+ (phy_id & 0xfffffc00) != B53_BRCM_OUI_5) {
|
||||||
|
dev_err(&mdiodev->dev, "Unsupported device: 0x%08x\n", phy_id);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
@@ -377,6 +379,7 @@ static const struct of_device_id b53_of_
|
||||||
|
{ .compatible = "brcm,bcm53115" },
|
||||||
|
{ .compatible = "brcm,bcm53125" },
|
||||||
|
{ .compatible = "brcm,bcm53128" },
|
||||||
|
+ { .compatible = "brcm,bcm53134" },
|
||||||
|
{ .compatible = "brcm,bcm5365" },
|
||||||
|
{ .compatible = "brcm,bcm5389" },
|
||||||
|
{ .compatible = "brcm,bcm5395" },
|
||||||
|
--- a/drivers/net/dsa/b53/b53_priv.h
|
||||||
|
+++ b/drivers/net/dsa/b53/b53_priv.h
|
||||||
|
@@ -85,6 +85,7 @@ enum {
|
||||||
|
BCM583XX_DEVICE_ID = 0x58300,
|
||||||
|
BCM7445_DEVICE_ID = 0x7445,
|
||||||
|
BCM7278_DEVICE_ID = 0x7278,
|
||||||
|
+ BCM53134_DEVICE_ID = 0x5075,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define B53_N_PORTS 9
|
||||||
|
@@ -182,7 +183,8 @@ static inline int is531x5(struct b53_dev
|
||||||
|
{
|
||||||
|
return dev->chip_id == BCM53115_DEVICE_ID ||
|
||||||
|
dev->chip_id == BCM53125_DEVICE_ID ||
|
||||||
|
- dev->chip_id == BCM53128_DEVICE_ID;
|
||||||
|
+ dev->chip_id == BCM53128_DEVICE_ID ||
|
||||||
|
+ dev->chip_id == BCM53134_DEVICE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int is63xx(struct b53_device *dev)
|
||||||
|
@@ -210,7 +212,8 @@ static inline int is58xx(struct b53_devi
|
||||||
|
return dev->chip_id == BCM58XX_DEVICE_ID ||
|
||||||
|
dev->chip_id == BCM583XX_DEVICE_ID ||
|
||||||
|
dev->chip_id == BCM7445_DEVICE_ID ||
|
||||||
|
- dev->chip_id == BCM7278_DEVICE_ID;
|
||||||
|
+ dev->chip_id == BCM7278_DEVICE_ID ||
|
||||||
|
+ dev->chip_id == BCM53134_DEVICE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define B53_63XX_RGMII0 4
|
|
@ -0,0 +1,114 @@
|
||||||
|
From patchwork Wed Mar 22 17:15:12 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: 13184389
|
||||||
|
Return-Path: <linux-clk-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 73F2DC6FD1C
|
||||||
|
for <linux-clk@archiver.kernel.org>; Wed, 22 Mar 2023 17:15:59 +0000 (UTC)
|
||||||
|
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
|
||||||
|
id S231363AbjCVRP5 (ORCPT <rfc822;linux-clk@archiver.kernel.org>);
|
||||||
|
Wed, 22 Mar 2023 13:15:57 -0400
|
||||||
|
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58824 "EHLO
|
||||||
|
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
|
||||||
|
with ESMTP id S231408AbjCVRPy (ORCPT
|
||||||
|
<rfc822;linux-clk@vger.kernel.org>); Wed, 22 Mar 2023 13:15:54 -0400
|
||||||
|
Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com
|
||||||
|
[IPv6:2a00:1450:4864:20::32d])
|
||||||
|
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70E4C64B28;
|
||||||
|
Wed, 22 Mar 2023 10:15:24 -0700 (PDT)
|
||||||
|
Received: by mail-wm1-x32d.google.com with SMTP id n19so1740892wms.0;
|
||||||
|
Wed, 22 Mar 2023 10:15:24 -0700 (PDT)
|
||||||
|
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||||
|
d=gmail.com; s=20210112; t=1679505322;
|
||||||
|
h=content-transfer-encoding:mime-version:references:in-reply-to
|
||||||
|
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
|
||||||
|
:message-id:reply-to;
|
||||||
|
bh=dEknM98Izmc8d/crPsoJ+ejZxfl78958Ei6SPYhYDHs=;
|
||||||
|
b=LTOQ75W3s5nYo+nEfiJAKqytSopONB4jCtU3zRygzPMasugVOrYFMsUR+WrpsAjuRT
|
||||||
|
v4HgWpJxEsIWeRXrUN9W21mFXhGgJLJXSxRnrio0CsZZBNMdkebbNOphgKXIWAdm+2iM
|
||||||
|
PzqAdGm5t38wT2mmm6V/9hCy90+12raHM82tNFdhhiezfg2cukVOKP3j/TeOVCwas0gQ
|
||||||
|
iFc+CuZB6y73zYXvMUMUpTsqI5vev4xJsSMHIQJVmUxJAwqhOBhN9JCRo7Ao+wayjn2d
|
||||||
|
Fxo6AV3A8v68nVfoQ0K0I+eWXG48nMCX45iWh/lVvVTOFcR99kn4va7NY1oVnPsh+WQz
|
||||||
|
WcLA==
|
||||||
|
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||||
|
d=1e100.net; s=20210112; t=1679505322;
|
||||||
|
h=content-transfer-encoding:mime-version:references:in-reply-to
|
||||||
|
:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
|
||||||
|
:subject:date:message-id:reply-to;
|
||||||
|
bh=dEknM98Izmc8d/crPsoJ+ejZxfl78958Ei6SPYhYDHs=;
|
||||||
|
b=wv2NSR1B5RnsdoEE7mgJSHAfSs1JHZbQ1HPMldyaGWAk1dcucqh/uDzM3Flz+ADRi1
|
||||||
|
19NoaB2Ur7QaWZejbuplnIOK/nte3PnmqJ9ZNw8HejmuS4eU8mB1V1aJUSKSPGsfUi4a
|
||||||
|
LYe3HSw87l0jrAC7ptdKvdUtzBoIkX0CeFvfguTQQkDhUTyAFIG144hY6uPXY9Mga96b
|
||||||
|
gnNe2dLCzHQLbEJpaDaavT7FEEcLDxaq7jNcR2xqEEZaIwfcew+Q05t4xL/3i8GAj9Ru
|
||||||
|
6ivQjIbBKfYQF88o7KnOW9o1wjrGsk+Nd4Iy0OLZix3JQasCJGrKV7ib5awI9J39upYV
|
||||||
|
fa4A==
|
||||||
|
X-Gm-Message-State: AO0yUKWw75I1M5Vjrd4vXq4GTruQu0H84pycgyi2CT3bczTYRJpWmEWg
|
||||||
|
+bHDhvp1n5IWW85GI9vKWpbclB13a/S0RQ==
|
||||||
|
X-Google-Smtp-Source:
|
||||||
|
AK7set9T/2oJsVetUb2L4mPEWu8YqDrnK8EzHK5bJf1ABIa1Et8f7BFJ7AA3j14ITZuf8cH0HqlRtg==
|
||||||
|
X-Received: by 2002:a05:600c:2304:b0:3ed:2949:985b with SMTP id
|
||||||
|
4-20020a05600c230400b003ed2949985bmr206833wmo.23.1679505322457;
|
||||||
|
Wed, 22 Mar 2023 10:15:22 -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
|
||||||
|
v10-20020a05600c470a00b003ee11ac2288sm8414333wmo.21.2023.03.22.10.15.21
|
||||||
|
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||||||
|
Wed, 22 Mar 2023 10:15:22 -0700 (PDT)
|
||||||
|
From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <noltari@gmail.com>
|
||||||
|
To: mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org,
|
||||||
|
krzysztof.kozlowski+dt@linaro.org, p.zabel@pengutronix.de,
|
||||||
|
f.fainelli@gmail.com, jonas.gorski@gmail.com,
|
||||||
|
william.zhang@broadcom.com, linux-clk@vger.kernel.org,
|
||||||
|
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
|
||||||
|
Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <noltari@gmail.com>,
|
||||||
|
Rob Herring <robh@kernel.org>
|
||||||
|
Subject: [PATCH v4 1/4] dt-bindings: clk: add BCM63268 timer clock definitions
|
||||||
|
Date: Wed, 22 Mar 2023 18:15:12 +0100
|
||||||
|
Message-Id: <20230322171515.120353-2-noltari@gmail.com>
|
||||||
|
X-Mailer: git-send-email 2.30.2
|
||||||
|
In-Reply-To: <20230322171515.120353-1-noltari@gmail.com>
|
||||||
|
References: <20230322171515.120353-1-noltari@gmail.com>
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Precedence: bulk
|
||||||
|
List-ID: <linux-clk.vger.kernel.org>
|
||||||
|
X-Mailing-List: linux-clk@vger.kernel.org
|
||||||
|
|
||||||
|
Add missing timer clock definitions for BCM63268.
|
||||||
|
|
||||||
|
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||||
|
Acked-by: Rob Herring <robh@kernel.org>
|
||||||
|
---
|
||||||
|
v4: no changes
|
||||||
|
v3: no changes
|
||||||
|
v2: change commit title, as suggested by Stephen Boyd
|
||||||
|
|
||||||
|
include/dt-bindings/clock/bcm63268-clock.h | 13 +++++++++++++
|
||||||
|
1 file changed, 13 insertions(+)
|
||||||
|
|
||||||
|
--- a/include/dt-bindings/clock/bcm63268-clock.h
|
||||||
|
+++ b/include/dt-bindings/clock/bcm63268-clock.h
|
||||||
|
@@ -27,4 +27,17 @@
|
||||||
|
#define BCM63268_CLK_TBUS 27
|
||||||
|
#define BCM63268_CLK_ROBOSW250 31
|
||||||
|
|
||||||
|
+#define BCM63268_TCLK_EPHY1 0
|
||||||
|
+#define BCM63268_TCLK_EPHY2 1
|
||||||
|
+#define BCM63268_TCLK_EPHY3 2
|
||||||
|
+#define BCM63268_TCLK_GPHY1 3
|
||||||
|
+#define BCM63268_TCLK_DSL 4
|
||||||
|
+#define BCM63268_TCLK_WAKEON_EPHY 6
|
||||||
|
+#define BCM63268_TCLK_WAKEON_DSL 7
|
||||||
|
+#define BCM63268_TCLK_FAP1 11
|
||||||
|
+#define BCM63268_TCLK_FAP2 15
|
||||||
|
+#define BCM63268_TCLK_UTO_50 16
|
||||||
|
+#define BCM63268_TCLK_UTO_EXTIN 17
|
||||||
|
+#define BCM63268_TCLK_USB_REF 18
|
||||||
|
+
|
||||||
|
#endif /* __DT_BINDINGS_CLOCK_BCM63268_H */
|
|
@ -0,0 +1,107 @@
|
||||||
|
From patchwork Wed Mar 22 17:15:13 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: 13184390
|
||||||
|
Return-Path: <linux-clk-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 D0B1AC6FD1C
|
||||||
|
for <linux-clk@archiver.kernel.org>; Wed, 22 Mar 2023 17:16:08 +0000 (UTC)
|
||||||
|
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
|
||||||
|
id S231472AbjCVRQI (ORCPT <rfc822;linux-clk@archiver.kernel.org>);
|
||||||
|
Wed, 22 Mar 2023 13:16:08 -0400
|
||||||
|
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58934 "EHLO
|
||||||
|
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
|
||||||
|
with ESMTP id S231435AbjCVRP5 (ORCPT
|
||||||
|
<rfc822;linux-clk@vger.kernel.org>); Wed, 22 Mar 2023 13:15:57 -0400
|
||||||
|
Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com
|
||||||
|
[IPv6:2a00:1450:4864:20::329])
|
||||||
|
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9655064863;
|
||||||
|
Wed, 22 Mar 2023 10:15:25 -0700 (PDT)
|
||||||
|
Received: by mail-wm1-x329.google.com with SMTP id
|
||||||
|
v4-20020a05600c470400b003ee4f06428fso2424553wmo.4;
|
||||||
|
Wed, 22 Mar 2023 10:15:25 -0700 (PDT)
|
||||||
|
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||||
|
d=gmail.com; s=20210112; t=1679505324;
|
||||||
|
h=content-transfer-encoding:mime-version:references:in-reply-to
|
||||||
|
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
|
||||||
|
:message-id:reply-to;
|
||||||
|
bh=C7ykhArT1dO7P8wtmI92eo4c7KtPZI9w182/5+cB3T0=;
|
||||||
|
b=WRZRU2SM9n1LfUj4SgTPfQczADC2pfvoIrOsNpBLTym2eOfmkTetb/WbGSla5kw2Wb
|
||||||
|
SH5MIC2fFeScJg6T5FFAUOOLmRVW9xvl8Q3T3NKb3z/9wvPHO767nrdIbffRWMJFs7gW
|
||||||
|
wT/kuTpn8GYdfY0sZ/dMTkq41DVusEkxfX6GxtG85O98ZP8xMHQog8aPs9fRfUvI5ZKB
|
||||||
|
eGYcRz/Wn1cHhjey9jtWzQEEmZ/BT3b0HQTF9Tl88oofhiEgbyjFXr91+vRsLbsJpGXH
|
||||||
|
/1FjjaLG5DnonKubV9rmbuCU8KzwH331gi2KuRjvLD2V+OMewqSa5i+GvgVv8x2zC8y+
|
||||||
|
/mLQ==
|
||||||
|
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||||
|
d=1e100.net; s=20210112; t=1679505324;
|
||||||
|
h=content-transfer-encoding:mime-version:references:in-reply-to
|
||||||
|
:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
|
||||||
|
:subject:date:message-id:reply-to;
|
||||||
|
bh=C7ykhArT1dO7P8wtmI92eo4c7KtPZI9w182/5+cB3T0=;
|
||||||
|
b=bhd0fNh0jDOMlGSC4F+p5igV8AUlGEPj2cXUwgdgqRfSSuUy9z+Li8cT0MbY/aWH5Z
|
||||||
|
qInRVA+R1cWV3ubrDyKag6oEc0LDU234bnMFcP9b7MRlrM8Dpit9TFSyqJU4sDUWNDs5
|
||||||
|
KOe2k/SNIdat6munC9VOuEBDO0eB/UDMN+repKwXNdHChp/Toq9qMvW4Uy8uHxosbQlD
|
||||||
|
8P88GbKFjynb1E8I8croGjfub7+y8PPsWB0xNUcafIv6xs3MnVOP1Mk4KwBCbqS509la
|
||||||
|
mfjsriXtIybO8XFqtn100ungjvbFWdogEplLdSPVdgAqdfF5J8gHxAoApoeYejYkL5/R
|
||||||
|
kOhQ==
|
||||||
|
X-Gm-Message-State: AO0yUKWdzr3dMmjKhD8tF+ec4Dfdq9VGZ/WCU4d85npKQvxSwhNPZZ1J
|
||||||
|
5WYRIqivh0suFC1OqEidwenpiJYvXedYjw==
|
||||||
|
X-Google-Smtp-Source:
|
||||||
|
AK7set87ew2/mKWeShXTTW/YBbBJNR2zeGFV0CfuqLXhiJEU6tqFuyKcW+vFEoKHIbNUS8wRy1SzLA==
|
||||||
|
X-Received: by 2002:a05:600c:290:b0:3ee:6d88:774a with SMTP id
|
||||||
|
16-20020a05600c029000b003ee6d88774amr160734wmk.14.1679505323514;
|
||||||
|
Wed, 22 Mar 2023 10:15:23 -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
|
||||||
|
v10-20020a05600c470a00b003ee11ac2288sm8414333wmo.21.2023.03.22.10.15.22
|
||||||
|
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||||||
|
Wed, 22 Mar 2023 10:15:23 -0700 (PDT)
|
||||||
|
From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <noltari@gmail.com>
|
||||||
|
To: mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org,
|
||||||
|
krzysztof.kozlowski+dt@linaro.org, p.zabel@pengutronix.de,
|
||||||
|
f.fainelli@gmail.com, jonas.gorski@gmail.com,
|
||||||
|
william.zhang@broadcom.com, linux-clk@vger.kernel.org,
|
||||||
|
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
|
||||||
|
Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <noltari@gmail.com>,
|
||||||
|
Rob Herring <robh@kernel.org>
|
||||||
|
Subject: [PATCH v4 2/4] dt-bindings: reset: add BCM63268 timer reset
|
||||||
|
definitions
|
||||||
|
Date: Wed, 22 Mar 2023 18:15:13 +0100
|
||||||
|
Message-Id: <20230322171515.120353-3-noltari@gmail.com>
|
||||||
|
X-Mailer: git-send-email 2.30.2
|
||||||
|
In-Reply-To: <20230322171515.120353-1-noltari@gmail.com>
|
||||||
|
References: <20230322171515.120353-1-noltari@gmail.com>
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Precedence: bulk
|
||||||
|
List-ID: <linux-clk.vger.kernel.org>
|
||||||
|
X-Mailing-List: linux-clk@vger.kernel.org
|
||||||
|
|
||||||
|
Add missing timer reset definitions for BCM63268.
|
||||||
|
|
||||||
|
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||||
|
Acked-by: Rob Herring <robh@kernel.org>
|
||||||
|
---
|
||||||
|
v4: no changes
|
||||||
|
v3: no changes
|
||||||
|
v2: change commit title, as suggested by Stephen Boyd
|
||||||
|
|
||||||
|
include/dt-bindings/reset/bcm63268-reset.h | 4 ++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
--- a/include/dt-bindings/reset/bcm63268-reset.h
|
||||||
|
+++ b/include/dt-bindings/reset/bcm63268-reset.h
|
||||||
|
@@ -23,4 +23,8 @@
|
||||||
|
#define BCM63268_RST_PCIE_HARD 17
|
||||||
|
#define BCM63268_RST_GPHY 18
|
||||||
|
|
||||||
|
+#define BCM63268_TRST_SW 29
|
||||||
|
+#define BCM63268_TRST_HW 30
|
||||||
|
+#define BCM63268_TRST_POR 31
|
||||||
|
+
|
||||||
|
#endif /* __DT_BINDINGS_RESET_BCM63268_H */
|
|
@ -1,19 +1,100 @@
|
||||||
From 3c8dd9d0937a19f3f20f28ba0b0b64f448d50dd4 Mon Sep 17 00:00:00 2001
|
From patchwork Wed Mar 22 17:15:15 2023
|
||||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
Content-Type: text/plain; charset="utf-8"
|
||||||
Date: Thu, 25 Feb 2021 19:54:04 +0100
|
|
||||||
Subject: [PATCH 4/4] clk: bcm: Add BCM63268 timer clock and reset driver
|
|
||||||
MIME-Version: 1.0
|
MIME-Version: 1.0
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
Content-Transfer-Encoding: 8bit
|
||||||
|
X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?=
|
||||||
|
<noltari@gmail.com>
|
||||||
|
X-Patchwork-Id: 13184392
|
||||||
|
Return-Path: <linux-clk-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 199D9C76196
|
||||||
|
for <linux-clk@archiver.kernel.org>; Wed, 22 Mar 2023 17:16:11 +0000 (UTC)
|
||||||
|
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
|
||||||
|
id S231512AbjCVRQJ (ORCPT <rfc822;linux-clk@archiver.kernel.org>);
|
||||||
|
Wed, 22 Mar 2023 13:16:09 -0400
|
||||||
|
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58942 "EHLO
|
||||||
|
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
|
||||||
|
with ESMTP id S231442AbjCVRP5 (ORCPT
|
||||||
|
<rfc822;linux-clk@vger.kernel.org>); Wed, 22 Mar 2023 13:15:57 -0400
|
||||||
|
Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com
|
||||||
|
[IPv6:2a00:1450:4864:20::32c])
|
||||||
|
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DDB36487D;
|
||||||
|
Wed, 22 Mar 2023 10:15:27 -0700 (PDT)
|
||||||
|
Received: by mail-wm1-x32c.google.com with SMTP id
|
||||||
|
i5-20020a05600c354500b003edd24054e0so6717370wmq.4;
|
||||||
|
Wed, 22 Mar 2023 10:15:27 -0700 (PDT)
|
||||||
|
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||||
|
d=gmail.com; s=20210112; t=1679505325;
|
||||||
|
h=content-transfer-encoding:mime-version:references:in-reply-to
|
||||||
|
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
|
||||||
|
:message-id:reply-to;
|
||||||
|
bh=rkv/eZYA1ncHp5FnV2ZWc3hgYnAx28S86QA9vmcXFCY=;
|
||||||
|
b=Y1mva2Bt3sUbKxLgEUS331CJbGxUc4z8kTQW8qiHWGhYlFKtm+d5z4sT40E5BeZAnU
|
||||||
|
zmTbCI7jbroe9NYBxGUmSli6LNVDPjND80ChbhWTqbqMQTmeQFWut9KmeBWK6Oze2lC/
|
||||||
|
XMSOorUzowjcU2xtHNrzoq2KH2pstW573lsB8WnzFVfhMaRkE9DfRr6WNyA7zC8DyxM5
|
||||||
|
ezxlCQtCmgPfCqlyksbIDKrgrRf3GiUR0yUd6xRU+MssyvH1FkYGDCerPctDto6lGHBz
|
||||||
|
8Y15jT3l6OnQMT6dkekgpPF5/XrSUY93u9g0B4U8+0dhNj+K7vmDen+jqdess+tpLnq/
|
||||||
|
gFrA==
|
||||||
|
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||||
|
d=1e100.net; s=20210112; t=1679505325;
|
||||||
|
h=content-transfer-encoding:mime-version:references:in-reply-to
|
||||||
|
:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
|
||||||
|
:subject:date:message-id:reply-to;
|
||||||
|
bh=rkv/eZYA1ncHp5FnV2ZWc3hgYnAx28S86QA9vmcXFCY=;
|
||||||
|
b=Ym4+u8bbTQGNkewUBrLf+89vE0EFJBQp2f1crwUxZFboKTROF9ltZonY1CGepo7b0B
|
||||||
|
fkx3TbWQy5X65g3ScuieqtClCI8WanPeNBJ48+JipJYO3ODVNBxnVaTuW/0FOIcahfqe
|
||||||
|
sG5GvggHhzRz+Yeybsbnupmzxnw8Ez0BpMl3p7zcjHL7BGZDdOOX2Zbw3zfyYa5sg2nX
|
||||||
|
UXYJT36zy2h39gxUsy9QkhQ76CG3w6omniohZpYidpojpiDjbOy0nKFky4kUe+YyA1fF
|
||||||
|
4IBhjAm6mH+uh6wHSG1qj+NAXHs0xDDJps16PbJwAgL7Qt9K5WW+R/UAYPmHFgaRIHOw
|
||||||
|
/seA==
|
||||||
|
X-Gm-Message-State: AO0yUKXRtoYO8Nfus6Ca8lhM39P1Xn6TGkhatEfoISd1YNOkTJJN2hW+
|
||||||
|
xRphLgxlzNfCLcVPlpGK9dk=
|
||||||
|
X-Google-Smtp-Source:
|
||||||
|
AK7set9VnMEykugk8ZYnkXuqK41bX1dzlvKsAXHEjr8i2NZBld0buKhQLcGYEcwxnBgVTtC7eRGfXw==
|
||||||
|
X-Received: by 2002:a1c:7c0b:0:b0:3e2:1dac:b071 with SMTP id
|
||||||
|
x11-20020a1c7c0b000000b003e21dacb071mr178053wmc.13.1679505325582;
|
||||||
|
Wed, 22 Mar 2023 10:15:25 -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
|
||||||
|
v10-20020a05600c470a00b003ee11ac2288sm8414333wmo.21.2023.03.22.10.15.24
|
||||||
|
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||||||
|
Wed, 22 Mar 2023 10:15:25 -0700 (PDT)
|
||||||
|
From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <noltari@gmail.com>
|
||||||
|
To: mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org,
|
||||||
|
krzysztof.kozlowski+dt@linaro.org, p.zabel@pengutronix.de,
|
||||||
|
f.fainelli@gmail.com, jonas.gorski@gmail.com,
|
||||||
|
william.zhang@broadcom.com, linux-clk@vger.kernel.org,
|
||||||
|
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
|
||||||
|
Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <noltari@gmail.com>
|
||||||
|
Subject: [PATCH v4 4/4] clk: bcm: Add BCM63268 timer clock and reset driver
|
||||||
|
Date: Wed, 22 Mar 2023 18:15:15 +0100
|
||||||
|
Message-Id: <20230322171515.120353-5-noltari@gmail.com>
|
||||||
|
X-Mailer: git-send-email 2.30.2
|
||||||
|
In-Reply-To: <20230322171515.120353-1-noltari@gmail.com>
|
||||||
|
References: <20230322171515.120353-1-noltari@gmail.com>
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Precedence: bulk
|
||||||
|
List-ID: <linux-clk.vger.kernel.org>
|
||||||
|
X-Mailing-List: linux-clk@vger.kernel.org
|
||||||
|
|
||||||
Add driver for BCM63268 timer clock and reset controller.
|
Add driver for BCM63268 timer clock and reset controller.
|
||||||
|
|
||||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||||
---
|
---
|
||||||
|
v4: add changes suggested by Stephen Boyd:
|
||||||
|
- Usage of of_device_get_match_data() isn't needed.
|
||||||
|
- Use devm_clk_hw_register_gate().
|
||||||
|
- Drop clk_hw_unregister_gate().
|
||||||
|
v3: add missing <linux/io.h> include to fix build warning
|
||||||
|
v2: add changes suggested by Stephen Boyd
|
||||||
|
|
||||||
drivers/clk/bcm/Kconfig | 9 ++
|
drivers/clk/bcm/Kconfig | 9 ++
|
||||||
drivers/clk/bcm/Makefile | 1 +
|
drivers/clk/bcm/Makefile | 1 +
|
||||||
drivers/clk/bcm/clk-bcm63268-timer.c | 232 +++++++++++++++++++++++++++
|
drivers/clk/bcm/clk-bcm63268-timer.c | 215 +++++++++++++++++++++++++++
|
||||||
3 files changed, 242 insertions(+)
|
3 files changed, 225 insertions(+)
|
||||||
create mode 100644 drivers/clk/bcm/clk-bcm63268-timer.c
|
create mode 100644 drivers/clk/bcm/clk-bcm63268-timer.c
|
||||||
|
|
||||||
--- a/drivers/clk/bcm/Kconfig
|
--- a/drivers/clk/bcm/Kconfig
|
||||||
|
@ -46,17 +127,17 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||||
obj-$(CONFIG_CLK_BCM_KONA) += clk-bcm281xx.o
|
obj-$(CONFIG_CLK_BCM_KONA) += clk-bcm281xx.o
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/clk/bcm/clk-bcm63268-timer.c
|
+++ b/drivers/clk/bcm/clk-bcm63268-timer.c
|
||||||
@@ -0,0 +1,232 @@
|
@@ -0,0 +1,215 @@
|
||||||
+// SPDX-License-Identifier: GPL-2.0
|
+// SPDX-License-Identifier: GPL-2.0
|
||||||
+/*
|
+/*
|
||||||
+ * BCM63268 Timer Clock and Reset Controller Driver
|
+ * BCM63268 Timer Clock and Reset Controller Driver
|
||||||
+ *
|
+ *
|
||||||
+ * Copyright (C) 2021 Álvaro Fernández Rojas <noltari@gmail.com>
|
+ * Copyright (C) 2023 Álvaro Fernández Rojas <noltari@gmail.com>
|
||||||
+ */
|
+ */
|
||||||
+
|
+
|
||||||
+#include <linux/clk-provider.h>
|
+#include <linux/clk-provider.h>
|
||||||
+#include <linux/delay.h>
|
+#include <linux/delay.h>
|
||||||
+#include <linux/init.h>
|
+#include <linux/io.h>
|
||||||
+#include <linux/of.h>
|
+#include <linux/of.h>
|
||||||
+#include <linux/of_device.h>
|
+#include <linux/of_device.h>
|
||||||
+#include <linux/platform_device.h>
|
+#include <linux/platform_device.h>
|
||||||
|
@ -78,7 +159,6 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||||
+struct bcm63268_tclk_table_entry {
|
+struct bcm63268_tclk_table_entry {
|
||||||
+ const char * const name;
|
+ const char * const name;
|
||||||
+ u8 bit;
|
+ u8 bit;
|
||||||
+ unsigned long flags;
|
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+static const struct bcm63268_tclk_table_entry bcm63268_timer_clocks[] = {
|
+static const struct bcm63268_tclk_table_entry bcm63268_timer_clocks[] = {
|
||||||
|
@ -197,17 +277,14 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||||
+static int bcm63268_tclk_probe(struct platform_device *pdev)
|
+static int bcm63268_tclk_probe(struct platform_device *pdev)
|
||||||
+{
|
+{
|
||||||
+ struct device *dev = &pdev->dev;
|
+ struct device *dev = &pdev->dev;
|
||||||
+ const struct bcm63268_tclk_table_entry *entry, *table;
|
+ const struct bcm63268_tclk_table_entry *entry;
|
||||||
+ struct bcm63268_tclkrst_hw *hw;
|
+ struct bcm63268_tclkrst_hw *hw;
|
||||||
|
+ struct clk_hw *clk;
|
||||||
+ u8 maxbit = 0;
|
+ u8 maxbit = 0;
|
||||||
+ int i, ret;
|
+ int i, ret;
|
||||||
+
|
+
|
||||||
+ table = of_device_get_match_data(dev);
|
+ for (entry = bcm63268_timer_clocks; entry->name; entry++)
|
||||||
+ if (!table)
|
+ maxbit = max(maxbit, entry->bit);
|
||||||
+ return -EINVAL;
|
|
||||||
+
|
|
||||||
+ for (entry = table; entry->name; entry++)
|
|
||||||
+ maxbit = max_t(u8, maxbit, entry->bit);
|
|
||||||
+ maxbit++;
|
+ maxbit++;
|
||||||
+
|
+
|
||||||
+ hw = devm_kzalloc(&pdev->dev, struct_size(hw, data.hws, maxbit),
|
+ hw = devm_kzalloc(&pdev->dev, struct_size(hw, data.hws, maxbit),
|
||||||
|
@ -227,24 +304,21 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||||
+ if (IS_ERR(hw->regs))
|
+ if (IS_ERR(hw->regs))
|
||||||
+ return PTR_ERR(hw->regs);
|
+ return PTR_ERR(hw->regs);
|
||||||
+
|
+
|
||||||
+ for (entry = table; entry->name; entry++) {
|
+ for (entry = bcm63268_timer_clocks; entry->name; entry++) {
|
||||||
+ struct clk_hw *clk;
|
+ clk = devm_clk_hw_register_gate(dev, entry->name, NULL, 0,
|
||||||
+
|
+ hw->regs, entry->bit,
|
||||||
+ clk = clk_hw_register_gate(dev, entry->name, NULL,
|
+ CLK_GATE_BIG_ENDIAN,
|
||||||
+ entry->flags, hw->regs, entry->bit,
|
+ &hw->lock);
|
||||||
+ CLK_GATE_BIG_ENDIAN, &hw->lock);
|
+ if (IS_ERR(clk))
|
||||||
+ if (IS_ERR(clk)) {
|
+ return PTR_ERR(clk);
|
||||||
+ ret = PTR_ERR(clk);
|
|
||||||
+ goto out_err;
|
|
||||||
+ }
|
|
||||||
+
|
+
|
||||||
+ hw->data.hws[entry->bit] = clk;
|
+ hw->data.hws[entry->bit] = clk;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
|
+ ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
|
||||||
+ &hw->data);
|
+ &hw->data);
|
||||||
+ if (!ret)
|
+ if (ret)
|
||||||
+ return 0;
|
+ return ret;
|
||||||
+
|
+
|
||||||
+ hw->rcdev.of_node = dev->of_node;
|
+ hw->rcdev.of_node = dev->of_node;
|
||||||
+ hw->rcdev.ops = &bcm63268_timer_reset_ops;
|
+ hw->rcdev.ops = &bcm63268_timer_reset_ops;
|
||||||
|
@ -253,22 +327,12 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||||
+ if (ret)
|
+ if (ret)
|
||||||
+ dev_err(dev, "Failed to register reset controller\n");
|
+ dev_err(dev, "Failed to register reset controller\n");
|
||||||
+
|
+
|
||||||
+out_err:
|
+ return 0;
|
||||||
+ for (i = 0; i < hw->data.num; i++) {
|
|
||||||
+ if (!IS_ERR(hw->data.hws[i]))
|
|
||||||
+ clk_hw_unregister_gate(hw->data.hws[i]);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return ret;
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static const struct of_device_id bcm63268_tclk_dt_ids[] = {
|
+static const struct of_device_id bcm63268_tclk_dt_ids[] = {
|
||||||
+ {
|
+ { .compatible = "brcm,bcm63268-timer-clocks" },
|
||||||
+ .compatible = "brcm,bcm63268-timer-clocks",
|
+ { /* sentinel */ }
|
||||||
+ .data = &bcm63268_timer_clocks,
|
|
||||||
+ }, {
|
|
||||||
+ /* sentinel */
|
|
||||||
+ }
|
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+static struct platform_driver bcm63268_tclk = {
|
+static struct platform_driver bcm63268_tclk = {
|
|
@ -17,7 +17,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||||
|
|
||||||
--- a/include/linux/clk-provider.h
|
--- a/include/linux/clk-provider.h
|
||||||
+++ b/include/linux/clk-provider.h
|
+++ b/include/linux/clk-provider.h
|
||||||
@@ -932,12 +932,26 @@ struct clk *clk_register_mux_table(struc
|
@@ -955,12 +955,26 @@ struct clk *clk_register_mux_table(struc
|
||||||
__clk_hw_register_mux((dev), NULL, (name), (num_parents), NULL, NULL, \
|
__clk_hw_register_mux((dev), NULL, (name), (num_parents), NULL, NULL, \
|
||||||
(parent_data), (flags), (reg), (shift), \
|
(parent_data), (flags), (reg), (shift), \
|
||||||
BIT((width)) - 1, (clk_mux_flags), NULL, (lock))
|
BIT((width)) - 1, (clk_mux_flags), NULL, (lock))
|
||||||
|
|
|
@ -21,8 +21,6 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
drivers/net/ethernet/mediatek/mtk_wed_wo.h | 3 +-
|
drivers/net/ethernet/mediatek/mtk_wed_wo.h | 3 +-
|
||||||
2 files changed, 30 insertions(+), 7 deletions(-)
|
2 files changed, 30 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
|
||||||
index 6624f6d6abdd..797c3b412ab6 100644
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
--- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
||||||
@@ -18,12 +18,23 @@
|
@@ -18,12 +18,23 @@
|
||||||
|
@ -51,7 +49,7 @@ index 6624f6d6abdd..797c3b412ab6 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct sk_buff *
|
static struct sk_buff *
|
||||||
@@ -316,10 +327,21 @@ mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo)
|
@@ -316,10 +327,21 @@ mtk_wed_mcu_load_firmware(struct mtk_wed
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,8 +75,6 @@ index 6624f6d6abdd..797c3b412ab6 100644
|
||||||
|
|
||||||
/* set dummy cr */
|
/* set dummy cr */
|
||||||
wed_w32(wo->hw->wed_dev, MTK_WED_SCR0 + 4 * MTK_WED_DUMMY_CR_FWDL,
|
wed_w32(wo->hw->wed_dev, MTK_WED_SCR0 + 4 * MTK_WED_DUMMY_CR_FWDL,
|
||||||
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_wo.h b/drivers/net/ethernet/mediatek/mtk_wed_wo.h
|
|
||||||
index dbcf42ce9173..c03071203cc0 100644
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.h
|
--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.h
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.h
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.h
|
||||||
@@ -227,7 +227,8 @@ struct mtk_wed_wo_queue {
|
@@ -227,7 +227,8 @@ struct mtk_wed_wo_queue {
|
||||||
|
@ -91,6 +87,3 @@ index dbcf42ce9173..c03071203cc0 100644
|
||||||
|
|
||||||
struct mtk_wed_wo_queue q_tx;
|
struct mtk_wed_wo_queue q_tx;
|
||||||
struct mtk_wed_wo_queue q_rx;
|
struct mtk_wed_wo_queue q_rx;
|
||||||
--
|
|
||||||
2.39.2
|
|
||||||
|
|
||||||
|
|
|
@ -18,15 +18,12 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
drivers/net/ethernet/mediatek/mtk_wed_mcu.c | 55 ++++++++++++++++++---
|
drivers/net/ethernet/mediatek/mtk_wed_mcu.c | 55 ++++++++++++++++++---
|
||||||
1 file changed, 49 insertions(+), 6 deletions(-)
|
1 file changed, 49 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
|
||||||
index 797c3b412ab6..976946a3653a 100644
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
--- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
||||||
@@ -299,6 +299,52 @@ mtk_wed_mcu_run_firmware(struct mtk_wed_wo *wo, const struct firmware *fw,
|
@@ -300,6 +300,52 @@ next:
|
||||||
return -EINVAL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+static int
|
static int
|
||||||
+mtk_wed_mcu_load_memory_regions(struct mtk_wed_wo *wo,
|
+mtk_wed_mcu_load_memory_regions(struct mtk_wed_wo *wo,
|
||||||
+ struct mtk_wed_wo_memory_region *region)
|
+ struct mtk_wed_wo_memory_region *region)
|
||||||
+{
|
+{
|
||||||
|
@ -72,10 +69,11 @@ index 797c3b412ab6..976946a3653a 100644
|
||||||
+ ®ion[MTK_WED_WO_REGION_ILM]);
|
+ ®ion[MTK_WED_WO_REGION_ILM]);
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
static int
|
+static int
|
||||||
mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo)
|
mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo)
|
||||||
{
|
{
|
||||||
@@ -320,12 +366,9 @@ mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo)
|
static struct mtk_wed_wo_memory_region mem_region[] = {
|
||||||
|
@@ -320,12 +366,9 @@ mtk_wed_mcu_load_firmware(struct mtk_wed
|
||||||
u32 val, boot_cr;
|
u32 val, boot_cr;
|
||||||
int ret, i;
|
int ret, i;
|
||||||
|
|
||||||
|
@ -91,6 +89,3 @@ index 797c3b412ab6..976946a3653a 100644
|
||||||
|
|
||||||
wo->boot_regmap = syscon_regmap_lookup_by_phandle(wo->hw->node,
|
wo->boot_regmap = syscon_regmap_lookup_by_phandle(wo->hw->node,
|
||||||
"mediatek,wo-cpuboot");
|
"mediatek,wo-cpuboot");
|
||||||
--
|
|
||||||
2.39.2
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
@@ -806,6 +806,24 @@ mtk_wed_rro_alloc(struct mtk_wed_device
|
@@ -813,6 +813,24 @@ mtk_wed_rro_alloc(struct mtk_wed_device
|
||||||
struct device_node *np;
|
struct device_node *np;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
index = of_property_match_string(dev->hw->node, "memory-region-names",
|
index = of_property_match_string(dev->hw->node, "memory-region-names",
|
||||||
"wo-dlm");
|
"wo-dlm");
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
@@ -822,6 +840,7 @@ mtk_wed_rro_alloc(struct mtk_wed_device
|
@@ -829,6 +847,7 @@ mtk_wed_rro_alloc(struct mtk_wed_device
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
dev->rro.miod_phys = rmem->base;
|
dev->rro.miod_phys = rmem->base;
|
||||||
|
|
|
@ -16,7 +16,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||||
|
|
||||||
--- a/arch/powerpc/boot/Makefile
|
--- a/arch/powerpc/boot/Makefile
|
||||||
+++ b/arch/powerpc/boot/Makefile
|
+++ b/arch/powerpc/boot/Makefile
|
||||||
@@ -272,7 +272,6 @@ image-$(CONFIG_PPC_CHRP) += zImage.chrp
|
@@ -273,7 +273,6 @@ image-$(CONFIG_PPC_CHRP) += zImage.chrp
|
||||||
image-$(CONFIG_PPC_EFIKA) += zImage.chrp
|
image-$(CONFIG_PPC_EFIKA) += zImage.chrp
|
||||||
image-$(CONFIG_PPC_PMAC) += zImage.pmac
|
image-$(CONFIG_PPC_PMAC) += zImage.pmac
|
||||||
image-$(CONFIG_PPC_HOLLY) += dtbImage.holly
|
image-$(CONFIG_PPC_HOLLY) += dtbImage.holly
|
||||||
|
@ -24,7 +24,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||||
image-$(CONFIG_EPAPR_BOOT) += zImage.epapr
|
image-$(CONFIG_EPAPR_BOOT) += zImage.epapr
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -404,15 +403,6 @@ $(obj)/dtbImage.%: vmlinux $(wrapperbits
|
@@ -406,15 +405,6 @@ $(obj)/dtbImage.%: vmlinux $(wrapperbits
|
||||||
$(obj)/vmlinux.strip: vmlinux
|
$(obj)/vmlinux.strip: vmlinux
|
||||||
$(STRIP) -s -R .comment $< -o $@
|
$(STRIP) -s -R .comment $< -o $@
|
||||||
|
|
||||||
|
|
|
@ -140,6 +140,7 @@ TARGET_DEVICES += adslr_g7
|
||||||
|
|
||||||
define Device/afoundry_ew1200
|
define Device/afoundry_ew1200
|
||||||
$(Device/dsa-migration)
|
$(Device/dsa-migration)
|
||||||
|
$(Device/uimage-lzma-loader)
|
||||||
IMAGE_SIZE := 16064k
|
IMAGE_SIZE := 16064k
|
||||||
DEVICE_VENDOR := AFOUNDRY
|
DEVICE_VENDOR := AFOUNDRY
|
||||||
DEVICE_MODEL := EW1200
|
DEVICE_MODEL := EW1200
|
||||||
|
|
Loading…
Reference in a new issue