You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/06/13 13:03:10 UTC

[incubator-nuttx] branch master updated: wireless/bcm43xxx: add support of bcm43013 chip

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new c7fd1a113f wireless/bcm43xxx: add support of bcm43013 chip
c7fd1a113f is described below

commit c7fd1a113ff700ee6f07040fae23c87dd4326e79
Author: chao.an <an...@xiaomi.com>
AuthorDate: Mon Jun 13 17:01:49 2022 +0800

    wireless/bcm43xxx: add support of bcm43013 chip
    
    Reference:
    https://www.broadcom.cn/bcm43013
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 drivers/wireless/ieee80211/bcm43xxx/Kconfig        |  9 ++-
 drivers/wireless/ieee80211/bcm43xxx/Make.defs      |  4 ++
 .../wireless/ieee80211/bcm43xxx/bcmf_chip_43013.c  | 83 ++++++++++++++++++++++
 drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c    |  8 ++-
 drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c    | 10 +++
 .../wireless/ieee80211/bcm43xxx/bcmf_sdio_core.h   |  4 +-
 6 files changed, 114 insertions(+), 4 deletions(-)

diff --git a/drivers/wireless/ieee80211/bcm43xxx/Kconfig b/drivers/wireless/ieee80211/bcm43xxx/Kconfig
index 9badda82f3..53b76b52c0 100644
--- a/drivers/wireless/ieee80211/bcm43xxx/Kconfig
+++ b/drivers/wireless/ieee80211/bcm43xxx/Kconfig
@@ -11,6 +11,12 @@ config IEEE80211_BROADCOM_HAVE_CLM
 	bool
 	default n
 
+config IEEE80211_BROADCOM_BCM43013
+	bool "Broadcom 43013 chip support"
+	depends on IEEE80211_BROADCOM_FULLMAC
+	default n
+	select IEEE80211_BROADCOM_HAVE_CLM
+
 config IEEE80211_BROADCOM_BCM43362
 	bool "Broadcom 43362 chip support"
 	depends on IEEE80211_BROADCOM_FULLMAC
@@ -31,7 +37,8 @@ config IEEE80211_BROADCOM_BCM43455
 config IEEE80211_BROADCOM_FWFILES
 	bool "Firmware files"
 	default y
-	depends on IEEE80211_BROADCOM_BCM43362 || \
+	depends on IEEE80211_BROADCOM_BCM43013 || \
+               IEEE80211_BROADCOM_BCM43362 || \
                IEEE80211_BROADCOM_BCM43438 || \
                IEEE80211_BROADCOM_BCM43455
 	---help---
diff --git a/drivers/wireless/ieee80211/bcm43xxx/Make.defs b/drivers/wireless/ieee80211/bcm43xxx/Make.defs
index 42bf0c548e..b2632c5c23 100644
--- a/drivers/wireless/ieee80211/bcm43xxx/Make.defs
+++ b/drivers/wireless/ieee80211/bcm43xxx/Make.defs
@@ -33,6 +33,10 @@ ifeq ($(CONFIG_IEEE80211_BROADCOM_FULLMAC_SDIO),y)
   CSRCS += bcmf_sdpcm.c
 endif
 
+ifeq ($(CONFIG_IEEE80211_BROADCOM_BCM43013),y)
+CSRCS += bcmf_chip_43013.c
+endif
+
 ifeq ($(CONFIG_IEEE80211_BROADCOM_BCM43362),y)
 CSRCS += bcmf_chip_43362.c
 endif
diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_43013.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_43013.c
new file mode 100644
index 0000000000..90133d7d78
--- /dev/null
+++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_43013.c
@@ -0,0 +1,83 @@
+/****************************************************************************
+ * drivers/wireless/ieee80211/bcm43xxx/bcmf_chip_43013.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <stdint.h>
+
+#include "bcmf_sdio.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define WRAPPER_REGISTER_OFFSET  0x100000
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+extern const char bcm43013_nvram_image[];
+extern const unsigned int bcm43013_nvram_image_len;
+
+#ifndef CONFIG_IEEE80211_BROADCOM_FWFILES
+extern const uint8_t bcm43013_firmware_image[];
+extern const unsigned int bcm43013_firmware_image_len;
+#endif
+
+const struct bcmf_sdio_chip bcmf_43013_config_sdio =
+{
+  /* General chip stats */
+
+  .ram_base = 0,
+  .ram_size = 0xa0000,
+
+  /* Backplane architecture */
+
+  .core_base =
+  {
+    [CHIPCOMMON_CORE_ID]  = 0x18000000,  /* Chipcommon core register base   */
+    [DOT11MAC_CORE_ID]    = 0x18001000,  /* dot11mac core register base     */
+    [SDIOD_CORE_ID]       = 0x18002000,  /* SDIOD Device core register base */
+    [WLAN_ARMCM3_CORE_ID] = 0x18003000 + /* ARMCM3 core register base       */
+                            WRAPPER_REGISTER_OFFSET,
+    [SOCSRAM_CORE_ID]     = 0x18004000 + /* SOCSRAM core register base      */
+                            WRAPPER_REGISTER_OFFSET
+  },
+
+  /* Firmware images */
+
+  /* TODO find something smarter than using image_len references */
+
+  .nvram_image         = (FAR uint8_t *)bcm43013_nvram_image,
+  .nvram_image_size    = (FAR unsigned int *)&bcm43013_nvram_image_len,
+
+#ifndef CONFIG_IEEE80211_BROADCOM_FWFILES
+  .firmware_image      = (FAR uint8_t *)bcm43013_firmware_image,
+  .firmware_image_size = (FAR unsigned int *)&bcm43013_firmware_image_len,
+#endif
+};
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c
index 40124f5970..5ad5c93121 100644
--- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c
+++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_core.c
@@ -439,11 +439,13 @@ int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus)
 
   switch (sbus->cur_chip_id)
     {
-#if defined(CONFIG_IEEE80211_BROADCOM_BCM43362) || \
+#if defined(CONFIG_IEEE80211_BROADCOM_BCM43013) || \
+    defined(CONFIG_IEEE80211_BROADCOM_BCM43362) || \
     defined(CONFIG_IEEE80211_BROADCOM_BCM43438)
 
       case SDIO_DEVICE_ID_BROADCOM_43362:
       case SDIO_DEVICE_ID_BROADCOM_43430:
+      case SDIO_DEVICE_ID_BROADCOM_43013:
         /* Disable ARMCM3 core and reset SOCRAM core to set device in
          * firmware upload mode
          */
@@ -521,11 +523,13 @@ int bcmf_core_upload_firmware(FAR struct bcmf_sdio_dev_s *sbus)
 
   switch (sbus->cur_chip_id)
     {
-#if defined(CONFIG_IEEE80211_BROADCOM_BCM43362) || \
+#if defined(CONFIG_IEEE80211_BROADCOM_BCM43013) || \
+    defined(CONFIG_IEEE80211_BROADCOM_BCM43362) || \
     defined(CONFIG_IEEE80211_BROADCOM_BCM43438)
 
       case SDIO_DEVICE_ID_BROADCOM_43362:
       case SDIO_DEVICE_ID_BROADCOM_43430:
+      case SDIO_DEVICE_ID_BROADCOM_43013:
         up_mdelay(10);
         bcmf_core_reset(sbus, WLAN_ARMCM3_CORE_ID, 0, 0, 0);
 
diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c
index 346861e0de..e4a6023387 100644
--- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c
+++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c
@@ -75,6 +75,9 @@
 
 /* Supported chip configurations */
 
+#ifdef CONFIG_IEEE80211_BROADCOM_BCM43013
+  extern const struct bcmf_sdio_chip bcmf_43013_config_sdio;
+#endif
 #ifdef CONFIG_IEEE80211_BROADCOM_BCM43362
   extern const struct bcmf_sdio_chip bcmf_43362_config_sdio;
 #endif
@@ -813,6 +816,13 @@ int bcmf_chipinitialize(FAR struct bcmf_sdio_dev_s *sbus)
 
   switch (chipid)
     {
+#ifdef CONFIG_IEEE80211_BROADCOM_BCM43013
+      case SDIO_DEVICE_ID_BROADCOM_43013:
+        wlinfo("bcm43013 chip detected\n");
+        sbus->chip = (struct bcmf_sdio_chip *)&bcmf_43013_config_sdio;
+        break;
+#endif
+
 #ifdef CONFIG_IEEE80211_BROADCOM_BCM43362
       case SDIO_DEVICE_ID_BROADCOM_43362:
         wlinfo("bcm43362 chip detected\n");
diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio_core.h b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio_core.h
index d56d678a8e..e97cc66052 100644
--- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio_core.h
+++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio_core.h
@@ -36,6 +36,7 @@
 
 /* SDIO device ID */
 
+#define SDIO_DEVICE_ID_BROADCOM_43013        43013
 #define SDIO_DEVICE_ID_BROADCOM_43143        43143
 #define SDIO_DEVICE_ID_BROADCOM_43241        0x4324
 #define SDIO_DEVICE_ID_BROADCOM_4329         0x4329
@@ -85,7 +86,8 @@ enum
   CHIPCOMMON_CORE_ID = 0,
   DOT11MAC_CORE_ID,
   SDIOD_CORE_ID,
-#if defined(CONFIG_IEEE80211_BROADCOM_BCM43362) || \
+#if defined(CONFIG_IEEE80211_BROADCOM_BCM43013) || \
+    defined(CONFIG_IEEE80211_BROADCOM_BCM43362) || \
     defined(CONFIG_IEEE80211_BROADCOM_BCM43438)
   WLAN_ARMCM3_CORE_ID,
   SOCSRAM_CORE_ID,