Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2459548pxb; Tue, 13 Apr 2021 02:22:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxurpx8m/NGNSF/tKjmQ6ZOaM94LDxgijub2IgAz1QZ4jsKxK8zV5Bex5kr1SYpnnBKNZkT X-Received: by 2002:a17:90b:3b43:: with SMTP id ot3mr3793598pjb.100.1618305751131; Tue, 13 Apr 2021 02:22:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618305751; cv=none; d=google.com; s=arc-20160816; b=Ls7Iwf8X6MS5/5CJNoyof3DYFDSVq8GuEaGP0e2CMiI5cl3ChU+yS26VBfVG3hceoO 4C6Y9sK5rtLrC1kfedul7ipn1JN72R6J5vvknRTPqowzzcMU0EyuvcsSn7wH1QzaidyA iJ6sE1SvQWdROUpZggajeW4IrXmj/d8XYXFvuN/DCzULWroOgaSeC3/vd+jrfq0o7ZSH TbhyrlEJsYnb600rt6XUjI+9HFDsg0Uud5kWN7lgV+1TGJT1MwippoGrPRzqJZ4mepbk KqPnDQ3JgWdKGDbTvZefhBNQGOJ4sSbbC3ZDuaqFZn5xbDB1goIff47RAP+ybiZtAFRx PToQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Th8DLSdO2vvzDGZNvM1EiNQqBiiC+GmcxeXMizucGzE=; b=XDWpZNLJxe6V7h7GlGH2U2hnItwQq2x+1Fxph4GdquNxQtzUiJZa3IU6q8QizxLsYD nRGgYb4cHTAjX9Rf0UrcNhe8RC+zARm/B1oH1VR52P+0kBBCstQCx2B02krLqm+Rxk0X u9rmyQ29n/Os61Uol5aayXSgOHhTdFJk4gFBZgfHLsCgbf+JSLH++s/DEzfQ6rqpjgR4 nDW2e5qNBVGKVQwUIXZoq1v6ed1DsxT3VG6eAkP7dcEfhl7YVHk8Flz/9YHk39qxtcqe lFKPFm1vru3Fcljs7M75boYAo+nRvRdJD33sCPUa4fR+CKHAkWMFM7M4Bv3e2s+KZLaJ /F1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a02KKelz; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p8si16007971plw.9.2021.04.13.02.22.17; Tue, 13 Apr 2021 02:22:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a02KKelz; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239454AbhDMH24 (ORCPT + 99 others); Tue, 13 Apr 2021 03:28:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239274AbhDMH2s (ORCPT ); Tue, 13 Apr 2021 03:28:48 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 434BCC06175F for ; Tue, 13 Apr 2021 00:28:28 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id b17so11306088pgh.7 for ; Tue, 13 Apr 2021 00:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Th8DLSdO2vvzDGZNvM1EiNQqBiiC+GmcxeXMizucGzE=; b=a02KKelz8nmBQ6Q/ZySI9iRYnHg4uPjz1jdtG/Xp+FCAd23bAAOpqIp/6DgFkPlhSq prNDwyKTQfxM9SP/k28AdVMDlpz1zCuHF64xyWZpCb1qlH0pRWLZrz4wgLrdnj0u1Sl1 1/m4Zqc4kZwgo5mBNlyWn0kd67R5A4DCAnTZpYCMbM00aKQLKeafXAF2yY0VDAMv2NkU 2AHbc1lJ4xvZkmUtGyF5viQAdrork6huoW8zmSwQDUcCJYzFBlwKv3caoaggI71n05Wq gB4+e8UxMaJ8sgylOh7jcfe10qmm1SNTE7bizE1n+I8WY5q2wQcgZUQhjIy0+urvRmwP 5IEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Th8DLSdO2vvzDGZNvM1EiNQqBiiC+GmcxeXMizucGzE=; b=BJCwF2MgCaEQZv2s9OS1P7REjB7x4EwNILMBrayAH6IzsR6gztsHR8IjUneBzZqvBk 3mpaoahyEhMqVZDSSKFiCW+wr+/AycVqqpENEK/j1dPQLaioOyAe0mYIe4qBwjyVIllg JM9xd87PBNtpevQu2hsFoCOHgcOsbRvGvvRmduADpprMuqT/auY+LZD8l1xujBdjXX4g 8Vj6KaGCYJkXiW0wysai/sSQUYaLGm/Hxn24TysVV4WCaaknYt23x+e89Wc9Lf2iCi7Y ahBEEHwKD9mkPa6bWiFB/n431ZPshD/SNTcnDpFbe82g3Mle7sgshHXiAVselJ3ngPks pOgQ== X-Gm-Message-State: AOAM530FpDl1wmF7s9V53fKBk7JVNBkCKb/PfvFar6uW1bdzv94RRvsT G74NaO6jIwoRODYrGyxfuSHoPw== X-Received: by 2002:a63:2507:: with SMTP id l7mr30951603pgl.198.1618298907404; Tue, 13 Apr 2021 00:28:27 -0700 (PDT) Received: from dragon (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id n21sm1422205pjo.25.2021.04.13.00.28.23 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Apr 2021 00:28:26 -0700 (PDT) Date: Tue, 13 Apr 2021 15:28:19 +0800 From: Shawn Guo To: Kalle Valo Cc: Rob Herring , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-hsien Lin , Wright Feng , Chung-hsien Hsu , 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 Message-ID: <20210413072818.GC15093@dragon> References: <20210408113022.18180-1-shawn.guo@linaro.org> <20210408113022.18180-2-shawn.guo@linaro.org> <87k0p9mewt.fsf@codeaurora.org> <20210412012528.GB15093@dragon> <87im4rlnuh.fsf@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87im4rlnuh.fsf@codeaurora.org> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, Apr 12, 2021 at 02:54:46PM +0300, Kalle Valo wrote: > Shawn Guo writes: > > > On Sun, Apr 11, 2021 at 10:57:54AM +0300, Kalle Valo wrote: > >> Shawn Guo 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 > >> > --- > >> > .../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