From patchwork Sat Jan 14 23:18:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9517201 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 CBAFD607D6 for ; Sat, 14 Jan 2017 23:19:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0A4328464 for ; Sat, 14 Jan 2017 23:19:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93B2A2846F; Sat, 14 Jan 2017 23:19:12 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 CB6F928464 for ; Sat, 14 Jan 2017 23:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750782AbdANXTH (ORCPT ); Sat, 14 Jan 2017 18:19:07 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33099 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750770AbdANXTG (ORCPT ); Sat, 14 Jan 2017 18:19:06 -0500 Received: by mail-lf0-f65.google.com with SMTP id x1so3726903lff.0 for ; Sat, 14 Jan 2017 15:19:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=8EPib1AFabsYq1/cNs6aXjb+QQnANnB21fdv5DrMwIk=; b=uH0hJtWECrgFA17ZY09o2TbX4Of7kpAneQl5sLS2X+oSYbxF20xLmjFOGU4u+tcJwu gSzAnh+py8uGzohlX8eyV3Mys9VZ2O+mRJ0ppPjBmUUlK7ByCKF2NpNSAyoRSYzXbpyT HzYu4INvT8yiz5b4JtyrpsCCr2wgfdoy0J1ye3daasnb3V+ytXMhtX93BOB9bq1VxmKw hNoLK84cxAtCwi2Aaej803QE6qiOE44hI+7Ag1oO82deE62h13e3GSJWEP+8VS9rX9If f8I03UVJTZ3A+lWHhv9cGe7XomfWyCPG4M2Vr/PMrZvjcRbmgKyS7FDymNrgS/kU0Pam eFFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=8EPib1AFabsYq1/cNs6aXjb+QQnANnB21fdv5DrMwIk=; b=aJYDBp+NNDiz6ukO15SZboV5zmYqdB+mdIdWX0AVZbgNJPFyzW4Hn6MPjsINiDNp3I /XKkGS2KaUKHwwQNdlqlHgk/h1Pwya5J7uDsCUigYqtdbYoh94AX9kYimgpmIKcV4qbl Qyw3jOkMkk/ro8+HHc4Ns166Je/PBu9dohDUAcSEK+0sycjXTWC1hm6814TENeSofnuN NMkgJZ13sIo6J2s1+uI7OdHEBGixiq9N/Qif6RZQxzu+Hl9lUEbWVfOPCdoRxCNeYNKd 3cuL7SB+vbl2lWXjLjAZ2RHjGzPN+/B5KpPmpcSRmDJQO3eDjQYz58HD3VLMtLA9wPJz e9lg== X-Gm-Message-State: AIkVDXKHO+flYzgI6m3skCowlrvy3JqJlI+tT7LfKOTzR1/Xcoz1pmEDnNJ0fnZSvtBYfmnaprBW4UVFECIN9g== X-Received: by 10.46.33.75 with SMTP id h72mr9748427ljh.37.1484435944716; Sat, 14 Jan 2017 15:19:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.200.73 with HTTP; Sat, 14 Jan 2017 15:18:44 -0800 (PST) From: Martin Blumenstingl Date: Sun, 15 Jan 2017 00:18:44 +0100 Message-ID: Subject: support for Ampak AP6255 (bcm43455c0 with SDIO device ID 0xa9bf) To: brcm80211-dev-list.pdl@broadcom.com Cc: arend.vanspriel@broadcom.com, hante.meuleman@broadcom.com, linux-wireless@vger.kernel.org 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 Hello, I recently got a "Khadas VIM Pro" (see [0] for more information) The "Pro" version comes with an AP6255 wifi chipset. Looking at the vendor firmware this seems to be a bcm43455 device: [1] To my surprise brcmfmac from a mainline 4.10-rc3 kernel did not pick this device up. So I started investigating: $ grep "" /sys/class/mmc_host/mmc2/mmc2\:0001/mmc2\:0001\:*/{class,device,vendor} /sys/class/mmc_host/mmc2/mmc2:0001/mmc2:0001:1/class:0x00 /sys/class/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/class:0x00 /sys/class/mmc_host/mmc2/mmc2:0001/mmc2:0001:3/class:0x02 /sys/class/mmc_host/mmc2/mmc2:0001/mmc2:0001:1/device:0xa9bf /sys/class/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/device:0xa9bf /sys/class/mmc_host/mmc2/mmc2:0001/mmc2:0001:3/device:0xa9bf /sys/class/mmc_host/mmc2/mmc2:0001/mmc2:0001:1/vendor:0x02d0 /sys/class/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/vendor:0x02d0 /sys/class/mmc_host/mmc2/mmc2:0001/mmc2:0001:3/vendor:0x02d0 I then went ahead and added the device ID to drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c (sample patch attached) as a result of that the device is now being detected. it boots fine with the firmware found in linux-firmware: [2] (plus the nvram.txt from the vendor repo [1] renamed to brcmfmac43455-sdio.txt) $ cat /sys/kernel/debug/brcmfmac/mmc2\:0001\:1/revinfo vendorid: 0x14e4 deviceid: 0x43ab radiorev: 0.88.3.11 chipnum: 17221 (4345) chiprev: 6 chippkg: 2 corerev: 54 boardid: 0x06e4 boardvendor: 0x14e4 boardrev: P304 driverrev: 7.45.18 ucoderev: 0 bus: 0 phytype: 11 phyrev: 20 anarev: 0 nvramrev: 00079ac5 downloading a random 100MB file from the internet using curl confirms this. There are no hangs, connection drops, other devices are also working fine. the problem I'm facing is very simply (but unfortunately a very common development problem): naming things (the SDIO_DEVICE_ID_BROADCOM_TODO constant)! there's already a definition for SDIO_DEVICE_ID_BROADCOM_4345 with value 0x4345, does that mean 0xa9bf should be SDIO_DEVICE_ID_BROADCOM_43455? Regards, Martin [0] http://khadas.com/vim/ [1] https://github.com/khadas/android_hardware_amlogic_wifi/tree/b6709758755568e4a0ff6e80993be0fc64c77fb9/bcm_ampak/config/6255 [2] https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/commit/brcm/brcmfmac43455-sdio.bin?id=b9a38d041d38ac6cf47274e9933f8083e12fc601 diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c index 72139b579b18..7206bb1f9908 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c @@ -1106,6 +1106,7 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = { BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345), BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356), + BRCMF_SDIO_DEVICE(0xa9bf), { /* end: all zeroes */ } }; MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);