boards: rpi_pico: WiFi configuration for Pico W

Configure the Raspberry Pi Pico W for WiFi.
Move Pico W configuration details to devicetree
Add pinctrl configurations for data/interrupt sharing
Make memory config selectable
Align devicetree with Linux ordering

Signed-off-by: Steve Boylan <stephen.boylan@beechwoods.com>
This commit is contained in:
Steve Boylan 2024-09-24 11:25:53 -04:00 committed by Benjamin Cabé
parent 37e39dee58
commit 4c22fc9ada
4 changed files with 89 additions and 0 deletions

View file

@ -13,4 +13,15 @@ endif # I2C_DW
config USB_SELF_POWERED
default n
if BOARD_RPI_PICO_RP2040_W && WIFI_AIROC
config MAIN_STACK_SIZE
default 4096
config HEAP_MEM_POOL_ADD_SIZE_BOARD
int
default 16384
endif # BOARD_RPI_PICO_RP2040_W && WIFI_AIROC
endif # BOARD_RPI_PICO

View file

@ -153,6 +153,23 @@ devices as well as both PIO devices).
Programming and Debugging
*************************
System requirements
===================
Prerequisites for the Pico W
----------------------------
Building for the Raspberry Pi Pico W requires the AIROC binary blobs
provided by Infineon. Run the command below to retrieve those files:
.. code-block:: console
west blobs fetch hal_infineon
.. note::
It is recommended running the command above after :file:`west update`.
Flashing
========

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2023 Dave Rensberger - Beechwoods Software
* Copyright (c) 2024 Steve Boylan <stephen.boylan@beechwoods.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -7,3 +8,60 @@
/dts-v1/;
#include "rpi_pico-common.dtsi"
&pinctrl {
pio0_spi0_default: pio0_spi0_default {
/* gpio 25 is used for chip select, not assigned to the PIO */
group1 {
pinmux = <PIO0_P29>;
};
};
airoc_wifi_default: airoc_wifi_default {
/* Control of GPIO24 is done through the WiFi driver */
group1 {
pinmux = <PIO0_P24>;
input-enable;
};
};
airoc_wifi_host_wake: airoc_wifi_host_wake {
/* Assign GPIO24 to SIO (GPIO) for use as an interrupt source */
group1 {
/* Lacking a specific SIO pin definition, use the RP2040_PINMUX macro */
pinmux = <RP2040_PINMUX(24, RP2_PINCTRL_GPIO_FUNC_SIO)>;
input-enable;
};
};
};
&pio0 {
status = "okay";
pio0_spi0: pio0_spi0 {
compatible = "raspberrypi,pico-spi-pio";
clocks = < &clocks RPI_PICO_CLKID_CLK_SYS >;
#address-cells = <1>;
#size-cells = <0>;
cs-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
clk-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
sio-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
pinctrl-0 = <&pio0_spi0_default>;
pinctrl-names = "default";
status = "okay";
airoc-wifi@0 {
compatible = "infineon,airoc-wifi";
reg = < 0 >;
wifi-reg-on-gpios = < &gpio0 23 GPIO_ACTIVE_HIGH >;
bus-select-gpios = < &gpio0 24 GPIO_ACTIVE_HIGH >;
wifi-host-wake-gpios = < &gpio0 24 GPIO_ACTIVE_HIGH >;
spi-max-frequency = < 10000000 >;
spi-half-duplex;
spi-data-irq-shared;
pinctrl-0 = <&airoc_wifi_default>;
pinctrl-1 = <&airoc_wifi_host_wake>;
pinctrl-names = "default", "host_wake";
status = "okay";
};
};
};

View file

@ -9,3 +9,6 @@ CONFIG_BUILD_OUTPUT_HEX=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_RESET=y
CONFIG_CLOCK_CONTROL=y
# Default networking configuration
CONFIG_CYW43439=y