From: Shawn Guo <shawn.guo@linaro.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: "Rob Herring" <robh+dt@kernel.org>,
"Rafał Miłecki" <rafal@milecki.pl>,
"Arend van Spriel" <aspriel@gmail.com>,
"Franky Lin" <franky.lin@broadcom.com>,
"Hante Meuleman" <hante.meuleman@broadcom.com>,
"Chi-hsien Lin" <chi-hsien.lin@infineon.com>,
"Wright Feng" <wright.feng@infineon.com>,
"Chung-hsien Hsu" <chung-hsien.hsu@infineon.com>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
brcm80211-dev-list.pdl@broadcom.com,
SHA-cyfmac-dev-list@infineon.com
Subject: Re: [PATCH 1/2] dt-binding: bcm43xx-fmac: add optional brcm,ccode-map
Date: Tue, 13 Apr 2021 15:28:19 +0800 [thread overview]
Message-ID: <20210413072818.GC15093@dragon> (raw)
In-Reply-To: <87im4rlnuh.fsf@codeaurora.org>
On Mon, Apr 12, 2021 at 02:54:46PM +0300, Kalle Valo wrote:
> Shawn Guo <shawn.guo@linaro.org> writes:
>
> > On Sun, Apr 11, 2021 at 10:57:54AM +0300, Kalle Valo wrote:
> >> Shawn Guo <shawn.guo@linaro.org> writes:
> >>
> >> > Add optional brcm,ccode-map property to support translation from ISO3166
> >> > country code to brcmfmac firmware country code and revision.
> >> >
> >> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> >> > ---
> >> > .../devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt | 7 +++++++
> >> > 1 file changed, 7 insertions(+)
> >> >
> >> > diff --git a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
> >> > index cffb2d6876e3..a65ac4384c04 100644
> >> > --- a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
> >> > +++ b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
> >> > @@ -15,6 +15,12 @@ Optional properties:
> >> > When not specified the device will use in-band SDIO interrupts.
> >> > - interrupt-names : name of the out-of-band interrupt, which must be set
> >> > to "host-wake".
> >> > + - brcm,ccode-map : multiple strings for translating ISO3166 country code to
> >> > + brcmfmac firmware country code and revision. Each string must be in
> >> > + format "AA-BB-num" where:
> >> > + AA is the ISO3166 country code which must be 2 characters.
> >> > + BB is the firmware country code which must be 2 characters.
> >> > + num is the revision number which must fit into signed integer.
> >> >
> >> > Example:
> >> >
> >> > @@ -34,5 +40,6 @@ mmc3: mmc@1c12000 {
> >> > interrupt-parent = <&pio>;
> >> > interrupts = <10 8>; /* PH10 / EINT10 */
> >> > interrupt-names = "host-wake";
> >> > + brcm,ccode-map = "JP-JP-78", "US-Q2-86";
> >>
> >> The commit log does not answer "Why?". Why this needs to be in device
> >> tree and, for example, not hard coded in the driver?
> >
> > Thanks for the comment, Kalle. Actually, this is something I need some
> > input from driver maintainers. I can see this country code mapping
> > table is chipset specific, and can be hard coded in driver per chip id
> > and revision. But on the other hand, it makes some sense to have this
> > table in device tree, as the country code that need to be supported
> > could be a device specific configuration.
>
> Could be? Does such a use case exist at the moment or are just guessing
> future needs?
I hope that the patch [1] from Rafał (copied) is one use case. And
also, the device I'm working on only needs to support some of the
countries in the mapping table.
>
> From what I have learned so far I think this kind of data should be in
> the driver, but of course I might be missing something.
I agree with you that such data are chipset specific and should ideally
be in the driver. However, the brcmfmac driver implementation has been
taking the mapping table from platform_data [2][3], which is a logical
equivalent of DT data in case of booting with device tree.
Shawn
[1] https://gitlab.dai-labor.de/nadim/powquty-coap/-/blob/563b2bd658822375dcfa8e87707304b94de9901c/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch
[2] https://elixir.bootlin.com/linux/v5.12-rc7/source/include/linux/platform_data/brcmfmac.h#L154
[3] https://elixir.bootlin.com/linux/v5.12-rc7/source/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c#L433
next prev parent reply other threads:[~2021-04-13 7:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 11:30 [PATCH 0/2] brcmfmac: support parse country code map from DT Shawn Guo
2021-04-08 11:30 ` [PATCH 1/2] dt-binding: bcm43xx-fmac: add optional brcm,ccode-map Shawn Guo
2021-04-09 18:46 ` Rob Herring
2021-04-12 1:19 ` Shawn Guo
2021-04-13 12:43 ` Arend van Spriel
2021-04-11 7:57 ` Kalle Valo
2021-04-12 1:25 ` Shawn Guo
2021-04-12 11:54 ` Kalle Valo
2021-04-13 7:28 ` Shawn Guo [this message]
2021-04-12 7:48 ` Arend van Spriel
2021-04-08 11:30 ` [PATCH 2/2] brcmfmac: support parse country code map from DT Shawn Guo
2021-04-12 8:09 ` Arend van Spriel
2021-04-13 7:45 ` Shawn Guo
2021-04-13 8:10 ` Arend van Spriel
2021-04-12 8:22 ` Arend van Spriel
2021-04-13 7:46 ` Shawn Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210413072818.GC15093@dragon \
--to=shawn.guo@linaro.org \
--cc=SHA-cyfmac-dev-list@infineon.com \
--cc=aspriel@gmail.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=chi-hsien.lin@infineon.com \
--cc=chung-hsien.hsu@infineon.com \
--cc=devicetree@vger.kernel.org \
--cc=franky.lin@broadcom.com \
--cc=hante.meuleman@broadcom.com \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rafal@milecki.pl \
--cc=robh+dt@kernel.org \
--cc=wright.feng@infineon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).