From patchwork Fri Dec 1 07:55:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chi-Hsien Lin X-Patchwork-Id: 10086453 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1FF706037E for ; Fri, 1 Dec 2017 07:56:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09D222A4EA for ; Fri, 1 Dec 2017 07:56:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F10002A50A; Fri, 1 Dec 2017 07:56:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 387822A4EA for ; Fri, 1 Dec 2017 07:56:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751250AbdLAH4J (ORCPT ); Fri, 1 Dec 2017 02:56:09 -0500 Received: from mail-bn3nam01on0111.outbound.protection.outlook.com ([104.47.33.111]:40304 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750957AbdLAH4I (ORCPT ); Fri, 1 Dec 2017 02:56:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cycorp.onmicrosoft.com; s=selector1-cypress-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tpODggLRtszloWzvrLUJWdJ+zfzjRI5BIfKJ2uq0BbQ=; b=LLCVkFo1ldN/+kdmtLNTIjPop/CAHyCynwl0gIEYJ0Ol0IkLhlpbjAHqa6a8WTuob9mWJTRDo5xhjEO+N0KGK9P4hv78u9GGNDsJaaJnkttHU2ENDCjRy+IekGxkIvrIRhjtTwPQ+3V4EVQYpUivEmsOqNNGlrTBgg+fclN+gP4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Chi-Hsien.Lin@cypress.com; Received: from aremote07.aus.cypress.com (12.110.209.130) by BN6PR06MB3218.namprd06.prod.outlook.com (10.174.232.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Fri, 1 Dec 2017 07:56:03 +0000 Date: Fri, 1 Dec 2017 01:55:50 -0600 From: Chi-Hsien Lin To: linux-wireless@vger.kernel.org Cc: Kalle Valo , brcm80211-dev-list@cypress.com, brcm80211-dev-list.pdl@broadcom.com, arend.vanspriel@broadcom.com, franky.lin@broadcom.com, hante.meuleman@broadcom.com, Wright Feng , Stanley Hsu Subject: [PATCH] brcmfmac: Add sg parameters dts parsing Message-ID: <20171201075542.GA31376@aremote07.aus.cypress.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-Originating-IP: [12.110.209.130] X-ClientProxiedBy: DM5PR06CA0070.namprd06.prod.outlook.com (10.168.110.160) To BN6PR06MB3218.namprd06.prod.outlook.com (10.174.232.156) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3809409a-c380-404d-4217-08d53890f927 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603286); SRVR:BN6PR06MB3218; X-Microsoft-Exchange-Diagnostics: 1; BN6PR06MB3218; 3:ZVyMdXn7nFzFXGbVG0IZqFuEwBR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YS5jbncXFFraWoF4dK8e/HpmCNqCkfEYFCgid+AZ5MaVB1JE7E3qXxZS1C2VIb+3rxTc7mGlaWkE86A1+HvTsYZ5ARPmoDZxbFmjTB51YNnd+ydxLMX7VIiuDANJGt/cVDrCDtaWHMpOkDNPIBBRfSthMyh+FHu4oB/K9i5R2OYsLVM9E9rCz2O8vsoohVsvZXqh0AzReAoiVeI+OJry55lgUmPAVMqBx8+DNYr4uYUKv/Z57xZEnO5s8VfFB8RVlWUrhRJe6RGGO9OJ3PVg3y4fi5L61PGt5HtdyN1pOx9EO67VDuwzth1o2dc+J2vdqo6eBEYK32mrrBfzptAytbzr7POf330MXnkjUf4oB0Hb95woYJdIh4AgriABtLSCh4aRhHaEsAq6IJPOR8hG2/NhpvDtpwo=; 4:J58vxUcWoHt64wzvN9fG3KtN9u1g1uDEdddh8s/dr5DlONaUcicL+7JWiQo8+r0H+l14Eha+W0EoYhZU6vxeNpTuuQkzsDJvZYbtAohTBJEqbRBmm1ZvzgtePtrqpXe7H5mOjhJpUT6JyMKbzXwdtRJUgjJZXGFv9uMmbBC84dlY1lwlmuK9eSbcsZj35dLWt1k9oD6hk7CGEmZLX2b5pigYBtcp41lClvg0nYCScxRJ1Uyicb2APlgrv989s0E3x/mXjD0AZAfYqvMW65foWLb2SvdAkoWwR/Y8r0MguPeiiEay5UhrRRGcnX 0ozV1X X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(258095267146985); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3231022)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011); SRVR:BN6PR06MB3218; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR06MB3218; X-Forefront-PRVS: 05087F0C24 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(346002)(376002)(366004)(199003)(189002)(6666003)(23726003)(4326008)(50466002)(58126008)(66066001)(16526018)(52116002)(316002)(54356011)(6916009)(7696005)(54906003)(1076002)(16586007)(25786009)(5660300001)(6116002)(47776003)(101416001)(3846002)(97736004)(68736007)(105586002)(7736002)(305945005)(53936002)(8936002)(106356001)(86362001)(107886003)(81166006)(81156014)(8676002)(2906002)(72206003)(478600001)(2361001)(2351001)(33656002)(55016002)(189998001)(83506002)(18370500001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR06MB3218; H:aremote07.aus.cypress.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR06MB3218; 23:x5XTei+wSYzdMziQEgEHQQShkFTn23ndtnIvIPGgR?= =?us-ascii?Q?iEVMEp7ZuOl4Hwbd8XGBYeZfYFRoQjHTkVV9kcah9y08ZMpl0q6DLp3utJke?= =?us-ascii?Q?9b5dBblo+JV4w9CBYI6sIaMeZLOtJmK4mLA80XKs6wfaFRsQYa2tBYTubzZA?= =?us-ascii?Q?BXQW0WCOVGQrHQGczmuI4S0f0COgnuaReJjEeO3Ioaw2DlgWjtazpJ8WraX+?= =?us-ascii?Q?dvokacOuCpBJwNiJbp0moIpZrZBIh3tH7wdXmENM26T1cySVWi+Lo9op3mMy?= =?us-ascii?Q?wGSFYawgRWyj/SE8kdyZ1mTzCh8u6cn1OWigpI7OIHPSoiUkYnqb7vS1UCMO?= =?us-ascii?Q?hK+7Jc2TBl68LsuW+4S46DWOCRObzqNPL32RAJaNL9PPZOhfnH5EK504z7nL?= =?us-ascii?Q?BenkQBDVOUBK1i4i/iDnaLpafaUD2fwWfPVmTnP+/uhwCQU+mRLOWacRXI9V?= =?us-ascii?Q?ojIrSPgcOBhYhWotM0O6kMJyfbZEHwZrhLm0FM8qk52JDSXO41ZpgKRIM3Sn?= =?us-ascii?Q?P7UkOVNq5F3gsEw7BfKqTWZCZCvY5wQs/0+5SgpGFSoKzJ/p6l7ePkTZuYLm?= =?us-ascii?Q?JaqWM+xtqr+TpkIQpvlO/ROsNUrvA0Fk8lqDD60LFfwJlMRWMLFDqYMe8RyT?= =?us-ascii?Q?NLIAe76TNuZU+KHVuSs3YZdxLnDb9cpE4bc03GBePXCbOgGvbkogFJsz72z9?= =?us-ascii?Q?GOpvPBFYvUBqWV9R1w7CFIREYYUhgG2kDD2zzEr4mksU1eJmXvD3HoOOfpH/?= =?us-ascii?Q?6OAIfkeYrLWyht3xc5qFILMTpWoegTonqsTMAjLAZNbLH0I+HGSCfW6Z24g2?= =?us-ascii?Q?64ArXCzz7hQ9NtRJP6A02sJiIIlp0t1r3I6TDnHiYLNk0ywNBVDFIchkcldv?= =?us-ascii?Q?fkcpBg1g4J8OIgKLicbD8i62I4FQiUkkuice4tAX3UnYS288HYvuKB2GND92?= =?us-ascii?Q?NoCPvDsuZ4NDscac+f8V7sn4Y4lLGG4kwjhVnIHfSlj7159h3T5fzDSE7vXI?= =?us-ascii?Q?sdlYaN14W+udCRqn9087n9fopcr+n8CxD7fTEQgFW0vT7K3UCsR/SDDJNvMV?= =?us-ascii?Q?CoTp91ufjrPgECWdJTj6AMPw9U3I2rG4FMqJ5WfKMGIpqUnw1nr7ODTJdGpz?= =?us-ascii?Q?v3YflYpPeMpiM/x/Y82Lkt4KW8YpwERDeDBHKHquheqt4VEIx06T/6owANCf?= =?us-ascii?Q?80JIgiJYrR1+rk=3D?= X-Microsoft-Antispam-Message-Info: dAniArBPmP1/9HxdExpA5I/LjM/PbEFgeU/gd4qGfsQiESNorOSSGfxsfqZ6v/q1i85FRJAoOHpZaIsW4m52QQ== X-Microsoft-Exchange-Diagnostics: 1; BN6PR06MB3218; 6:+Kmo1Izvg3bTtKiW8Oa3meSzcO3rHTrGJG30SOx4+H0qF6b1JvLVLnRdVX5NmXmjqsBWfvUKHleSA+x6U4zlQxIn8+AEPThp8xNf4FypR0atoCiNTEUZ0LN3MDh9QW//eDrbRz748uXIRDmzcR8AR8o5d+MjRKwCQ3bW4iQKVqIT4q8Hs8Tuemfz14Z70IHgNcOM1XbA5O5sN4WcjD0Lx/hzT1HK0dtjby/cj6ieKQJP8H32bt3fsiG+2O4XIGCSyGoiPuP9GtHY+FiY+iWj51lFcJsqH2eZsaA3QbRQYz75PVJmZ63ClniQ02z91g89ocyxc5PQtcXllu+BHkvtdGZV9MbVTV/2nfKfFCB1FR4=; 5:TEli6EVyXXtkjfaV2sJy243BN929+4Xf/UbF2+HmKqPEMSBRJ3ePDSQOwHFzsRQhdLGTkKt3srOFEfpmuG/arzPcof7RTcBmO6TXUMv5u+I4L3ZO8GulGlhE3dIvOe3Qm0YqwaqsFUWAX643Iw9Tf2NDj/HL27b4L2c91I+e4NU=; 24:ECjd2kiFrIv7If/HUYO5LwdvYUid+slN7UkWAMSS7jXsmLX9AknH7iaHejd+1teF/Jh/AzwK9IJkbM282KbdJtrhhrCaOBfTTopMxtjG5U0=; 7:6IsXWtlMU2/7A6F42GtJ2Vau/uSagegAGiy9fvYV1+I7LfJqbE2Ba9On3QKMd9Z2Vcd+2GhH+esgA5Xz6iL0xSIrU3uRzHjcTqlUbccF9viyupJfNNra19X09+QJZ//Ja9LcwZKML9WbQVQ/6Ff9Gx3a3l8vW9hUKWxuDeatXRunkUpTor07/zbl2yomHjvg/iIIBNVFa9iXhBCHt0UHLphT+EbvQIXT3RAyEhpL28dRGpGOuQLLZN8mDPMljaGr SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2017 07:56:03.1638 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3809409a-c380-404d-4217-08d53890f927 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR06MB3218 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP broken_sg_support, sd_head_align, and sd_sgentry_align are used in brcmfmac code but not configurable in dts file. Add the parsing logic. Now they can be configured like below in dts: brcm,broken_sg_support; brcm,sd_head_align = /bits/ 16 <4>; brcm,sd_sgentry_align = /bits/ 16 <4>; Signed-off-by: Chi-hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c index aee6e59..023f8ea 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c @@ -30,14 +30,22 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, struct device_node *np = dev->of_node; int irq; u32 irqf; - u32 val; + u32 val32; + u16 val16; if (!np || bus_type != BRCMF_BUSTYPE_SDIO || !of_device_is_compatible(np, "brcm,bcm4329-fmac")) return; - if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0) - sdio->drive_strength = val; + if (of_property_read_u32(np, "brcm,drive-strength", &val32) == 0) + sdio->drive_strength = val32; + + sdio->broken_sg_support = of_property_read_bool(np, + "brcm,broken_sg_support"); + if (of_property_read_u16(np, "brcm,sd_head_align", &val16) == 0) + sdio->sd_head_align = val16; + if (of_property_read_u16(np, "brcm,sd_sgentry_align", &val16) == 0) + sdio->sd_sgentry_align = val16; /* make sure there are interrupts defined in the node */ if (!of_find_property(np, "interrupts", NULL))