dt-bindings: net: wireless: qcom,ath11k: allow describing radios
Subsystems (5)
PATCH 1/3 dt-bindings: net: wireless: qcom,ath11k: allow describing radios
From: Rafał Miłecki <[email protected]>
Qualcomm ath11k chipsets can have up to 3 radios. Each radio may need to be additionally described by including its MAC or available frequency ranges.
--- .../bindings/net/wireless/qcom,ath11k.yaml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+)
Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml +26 -0
@@ -78,6 +78,24 @@ properties: items: - const: wlan-smp2p-out +patternProperties: + "^radio@[0-2]$": + type: object + + allOf: + - $ref: ieee80211.yaml# + + properties: + nvmem-cells: + items: + - description: NVMEM cell with the MAC address + + nvmem-cell-names: + items: + - const: mac-address + + unevaluatedProperties: false + required: - compatible - reg
@@ -378,6 +396,14 @@ examples: "wbm2host-tx-completions-ring1", "tcl2host-status-ring"; qcom,rproc = <&q6v5_wcss>; + #address-cells = <1>; + #size-cells = <0>; + + radio@0 { + reg = <0x0>; + nvmem-cells = <&mac>; + nvmem-cell-names = "mac-address"; + }; }; - |
Signature · 7 lines
2.34.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 2/3 wifi: ath11k: look for DT node for each radio
From: Rafał Miłecki <[email protected]>
Updated DT binding allows describing each chip radio.
--- drivers/net/wireless/ath/ath11k/core.h | 2 ++ drivers/net/wireless/ath/ath11k/mac.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+)
drivers/net/wireless/ath/ath11k/core.h +2 -0
@@ -13,6 +13,7 @@#include <linux/bitfield.h> #include <linux/dmi.h> #include <linux/ctype.h> +#include <linux/of.h> #include <linux/rhashtable.h> #include <linux/average.h> #include "qmi.h"
@@ -592,6 +593,7 @@ struct ath11k_per_peer_tx_stats {struct ath11k {struct ath11k_base *ab;struct ath11k_pdev *pdev; +struct device_node *np;struct ieee80211_hw *hw;struct ieee80211_ops *ops;struct ath11k_pdev_wmi *wmi;
drivers/net/wireless/ath/ath11k/mac.c +20 -0
@@ -9344,6 +9344,25 @@ int ath11k_mac_register(struct ath11k_base *ab)return ret; } +static struct device_node *ath11k_mac_find_radio_node (struct ath11k_base *ab,int i) +{ +struct device_node *np; + +for_each_child_of_node (ab->dev->of_node, np) { +u32 reg; +int err; + +if (strcmp (np->name,"radio" )) +continue ; + + err =of_property_read_u32 (np,"reg" , ®); +if (!err && reg == i) +return np; + } + +return NULL ; +} +int ath11k_mac_allocate (struct ath11k_base *ab) {struct ieee80211_hw *hw;
@@ -9369,6 +9388,7 @@ int ath11k_mac_allocate(struct ath11k_base *ab) ar->ab = ab; ar->pdev = pdev; ar->pdev_idx = i; + ar->np =ath11k_mac_find_radio_node (ab, i); ar->lmac_id =ath11k_hw_get_mac_from_pdev_id (&ab->hw_params, i); ar->wmi = &ab->wmi_ab.wmi[i];
Signature · 7 lines
2.34.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 3/3 wifi: ath11k: support reading radio MAC from DT
In reply to Rafał MiłeckiFrom: Rafał Miłecki <[email protected]>
On some devices (most routers) MAC is stored in an NVMEM cell. Support reading it.
--- drivers/net/wireless/ath/ath11k/mac.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +10 -5
@@ -8,6 +8,7 @@#include <linux/etherdevice.h> #include <linux/bitfield.h> #include <linux/inetdevice.h> +#include <linux/of_net.h> #include <net/if_inet6.h> #include <net/ipv6.h>
@@ -9292,7 +9293,7 @@ int ath11k_mac_register(struct ath11k_base *ab)struct ath11k_pdev *pdev;int i;int ret; -u8 mac_addr[ETH_ALEN ] = {0 }; +u8 device_mac_addr[ETH_ALEN ] = {0 };if (test_bit (ATH11K_FLAG_REGISTERED , &ab->dev_flags))return 0 ;
@@ -9305,18 +9306,22 @@ int ath11k_mac_register(struct ath11k_base *ab)if (ret)return ret; -device_get_mac_address (ab->dev, mac_addr); +device_get_mac_address (ab->dev, device_mac_addr);for (i =0 ; i < ab->num_radios; i++) { +u8 radio_mac_addr[ETH_ALEN ]; + pdev = &ab->pdevs[i]; ar = pdev->ar; -if (ab->pdevs_macaddr_valid) { +if (!of_get_mac_address (ar->np, radio_mac_addr)) { +ether_addr_copy (ar->mac_addr, radio_mac_addr); + }else if (ab->pdevs_macaddr_valid) {ether_addr_copy (ar->mac_addr, pdev->mac_addr); }else { -if (is_zero_ether_addr (mac_addr)) +if (is_zero_ether_addr (device_mac_addr))ether_addr_copy (ar->mac_addr, ab->mac_addr);else -ether_addr_copy (ar->mac_addr, mac_addr); +ether_addr_copy (ar->mac_addr, device_mac_addr); ar->mac_addr[4 ] += i; }
Signature · 7 lines
2.34.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Rob Herring
maintainerQuoted 11 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Qualcomm ath11k chipsets can have up to 3 radios. Each radio may need to be additionally described by including its MAC or available frequency ranges.
Signed-off-by Rafał Miłecki <[email protected]>--- .../bindings/net/wireless/qcom,ath11k.yaml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.example.dtb: wifi@c000000: radio@0: Unevaluated properties are not allowed ('reg' was unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.example.dtb: wifi@c000000: '#address-cells', '#size-cells' do not match any of the regexes: '^radio@[0-2]$', 'pinctrl-[0-9]+'
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k