diff --git a/arch/arm/src/rp2040/rp2040_cyw43439.h b/arch/arm/src/rp2040/rp2040_cyw43439.h index 110dffbc14..e6a8df0981 100644 --- a/arch/arm/src/rp2040/rp2040_cyw43439.h +++ b/arch/arm/src/rp2040/rp2040_cyw43439.h @@ -106,6 +106,8 @@ gspi_dev_t *rp2040_cyw_setup(uint8_t gpio_on, void rp2040_cyw_remove(gspi_dev_t *dev); +void init_cyw43439_config_data(void); + #undef EXTERN #if defined(__cplusplus) } diff --git a/boards/arm/rp2040/common/src/rp2040_firmware.c b/boards/arm/rp2040/common/src/rp2040_firmware.c index 74148893fc..14a77efbb4 100644 --- a/boards/arm/rp2040/common/src/rp2040_firmware.c +++ b/boards/arm/rp2040/common/src/rp2040_firmware.c @@ -34,6 +34,10 @@ #define ROUNDED_FIRMWARE_LEN ((CONFIG_CYW43439_FIRMWARE_LEN + 0xff) & ~0xff) +#ifndef CYW43_RESOURCE_ATTRIBUTE +#define CYW43_RESOURCE_ATTRIBUTE __attribute__((aligned(4))) +#endif + /**************************************************************************** * Public Data ****************************************************************************/ @@ -110,9 +114,6 @@ const unsigned int g_cyw43439_nvram_len = sizeof(g_cyw43439_nvram_image); * pointers and arrays are interchangable in C. */ -extern const uint8_t g_cyw43439_firmware_image[]; -extern const uint8_t g_cyw43439_clm_blob_image[]; -extern const unsigned int g_cyw43439_clm_blob_len; /* This assembly code does the following: * - Force 16-byte alignment @@ -127,19 +128,11 @@ extern const unsigned int g_cyw43439_clm_blob_len; * contains the length of the clm_blob. */ -__asm__("\n .balign 16" - "\n .globl g_cyw43439_firmware_image" - "\n .globl g_cyw43439_clm_blob_image" - "\n .globl g_cyw43439_clm_blob_len" - "\n g_cyw43439_firmware_image:" - "\n .incbin \"cyw43439.firmware.image\"" - "\n firmware_end:" - "\n g_cyw43439_clm_blob_image=g_cyw43439_firmware_image+" - STR(ROUNDED_FIRMWARE_LEN) - "\n .balign 4" - "\n g_cyw43439_clm_blob_len:" - "\n .word firmware_end-g_cyw43439_clm_blob_image" - "\n"); +#include + +const uint8_t *g_cyw43439_firmware_image = w43439A0_7_95_49_00_combined; +const uint8_t *g_cyw43439_clm_blob_image = w43439A0_7_95_49_00_combined + ROUNDED_FIRMWARE_LEN; +const unsigned int g_cyw43439_clm_blob_len = CYW43_CLM_LEN; /**************************************************************************** * Other CYW43439 Firmware global definitions diff --git a/boards/arm/rp2040/raspberrypi-pico-w/Kconfig b/boards/arm/rp2040/raspberrypi-pico-w/Kconfig index e3c680b757..8e7a7ef3df 100644 --- a/boards/arm/rp2040/raspberrypi-pico-w/Kconfig +++ b/boards/arm/rp2040/raspberrypi-pico-w/Kconfig @@ -15,7 +15,7 @@ if RP2040_INFINEON_CYW43439 config CYW43439_FIRMWARE_BIN_PATH string "Path to Infineon 43439 firmware file" - default "${PICO_SDK_PATH}/lib/cyw43-driver/firmware/43439A0-7.95.49.00.combined" + default "${PICO_SDK_PATH}/lib/cyw43-driver/firmware/w43439A0_7_95_49_00_combined.h" ---help--- This should be a path to a file containing both the cyw43439 firmware and the CLB blob. The firmware should be padded to a 256 byte boundary and diff --git a/boards/arm/rp2040/raspberrypi-pico-w/configs/telnet/defconfig b/boards/arm/rp2040/raspberrypi-pico-w/configs/telnet/defconfig index 3093e640f0..d2ac8a97c4 100644 --- a/boards/arm/rp2040/raspberrypi-pico-w/configs/telnet/defconfig +++ b/boards/arm/rp2040/raspberrypi-pico-w/configs/telnet/defconfig @@ -5,12 +5,13 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # +# CONFIG_DEV_CONSOLE is not set # CONFIG_LIBC_LONG_LONG is not set # CONFIG_NSH_ARGCAT is not set # CONFIG_NSH_CMDOPT_HEXDUMP is not set # CONFIG_NSH_DISABLE_DATE is not set # CONFIG_NSH_DISABLE_LOSMART is not set -# CONFIG_STANDARD_SERIAL is not set +# CONFIG_RP2040_UART0 is not set CONFIG_ALLOW_BSD_COMPONENTS=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="raspberrypi-pico-w" @@ -23,6 +24,8 @@ CONFIG_ARCH_STACKDUMP=y CONFIG_BOARDCTL_RESET=y CONFIG_BOARD_LOOPSPERMSEC=10450 CONFIG_BUILTIN=y +CONFIG_CDCACM=y +CONFIG_CDCACM_CONSOLE=y CONFIG_DEBUG_ASSERTIONS=y CONFIG_DEBUG_FEATURES=y CONFIG_DEBUG_FULLOPT=y @@ -65,6 +68,7 @@ CONFIG_NET_UDP=y CONFIG_NSH_ARCHINIT=y CONFIG_NSH_BUILTIN_APPS=y CONFIG_NSH_READLINE=y +CONFIG_NSH_USBCONSOLE=y CONFIG_RAM_SIZE=270336 CONFIG_RAM_START=0x20000000 CONFIG_READLINE_CMD_HISTORY=y @@ -88,10 +92,8 @@ CONFIG_SYSTEM_PING=y CONFIG_SYSTEM_TELNET_CLIENT=y CONFIG_TESTING_GETPRIME=y CONFIG_TESTING_OSTEST=y -CONFIG_TTY_FORCE_PANIC=y -CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGTSTP=y -CONFIG_UART0_SERIAL_CONSOLE=y +CONFIG_USBDEV=y +CONFIG_USBDEV_BUSPOWERED=y CONFIG_WIRELESS_WAPI=y CONFIG_WIRELESS_WAPI_CMDTOOL=y CONFIG_WQUEUE_NOTIFIER=y diff --git a/boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_bringup.c b/boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_bringup.c index e99e43c196..eb5beef0e3 100644 --- a/boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_bringup.c +++ b/boards/arm/rp2040/raspberrypi-pico-w/src/rp2040_bringup.c @@ -79,6 +79,8 @@ int rp2040_bringup(void) #ifdef CONFIG_RP2040_INFINEON_CYW43439 + init_cyw43439_config_data(); + g_cyw43439 = rp2040_cyw_setup(CYW43439_POWER_ON_GPIO, CYW43439_CHIP_SELECT_GPIO, CYW43439_DATA_GPIO, diff --git a/drivers/wireless/ieee80211/bcm43xxx/cyw_chip_43439.c b/drivers/wireless/ieee80211/bcm43xxx/cyw_chip_43439.c index 828e72e5bf..09f74f4f11 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/cyw_chip_43439.c +++ b/drivers/wireless/ieee80211/bcm43xxx/cyw_chip_43439.c @@ -42,18 +42,18 @@ extern unsigned int g_cyw43439_nvram_len; #ifndef CONFIG_IEEE80211_BROADCOM_FWFILES -extern const uint8_t g_cyw43439_firmware_image[]; +extern const uint8_t *g_cyw43439_firmware_image; extern const unsigned int g_cyw43439_firmware_len; #ifdef CONFIG_IEEE80211_BROADCOM_HAVE_CLM -extern const uint8_t g_cyw43439_clm_blob_image[]; +extern const uint8_t *g_cyw43439_clm_blob_image; extern const unsigned int g_cyw43439_clm_blob_len; #endif #endif -const struct bcmf_chip_data g_cyw43439_config_data = +struct bcmf_chip_data g_cyw43439_config_data = { /* General chip stats */ @@ -77,17 +77,22 @@ const struct bcmf_chip_data g_cyw43439_config_data = .nvram_image = (FAR uint8_t *)g_cyw43439_nvram_image, .nvram_image_size = (FAR unsigned int *)&g_cyw43439_nvram_len, +}; +void init_cyw43439_config_data(void) +{ #ifndef CONFIG_IEEE80211_BROADCOM_FWFILES - .firmware_image = (FAR uint8_t *)g_cyw43439_firmware_image, - .firmware_image_size = (FAR unsigned int *)&g_cyw43439_firmware_len, + g_cyw43439_config_data.firmware_image = (FAR uint8_t *)g_cyw43439_firmware_image; + g_cyw43439_config_data.firmware_image_size = (FAR unsigned int *)&g_cyw43439_firmware_len; + #ifdef CONFIG_IEEE80211_BROADCOM_HAVE_CLM - .clm_blob_image = (FAR uint8_t *)g_cyw43439_clm_blob_image, - .clm_blob_image_size = (FAR unsigned int *)&g_cyw43439_clm_blob_len + g_cyw43439_config_data.clm_blob_image = (FAR uint8_t *)g_cyw43439_clm_blob_image; + g_cyw43439_config_data.clm_blob_image_size = (FAR unsigned int *)&g_cyw43439_clm_blob_len; + #endif #endif -}; +} /**************************************************************************** * Public Functions