Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wifi: Add 54h support #14047

Merged
merged 3 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions boards/shields/nrf700x_nrf54h20dk/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

DT_COMPAT_NORDIC_NRF700X_SPI := nordic,nrf700x-spi

config SHIELD_NRF700X_NRF54H20DK
def_bool $(shields_list_contains,nrf700x_nrf54h20dk)

config NRF7002_ON_SPI
def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF700X_SPI))
depends on SHIELD_NRF700X_NRF54H20DK
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_SHELL_BACKEND_SERIAL=y
# nrf_security is WIP
CONFIG_WPA_SUPP_CRYPTO_NONE=y
CONFIG_TEST_RANDOM_GENERATOR=y

# External flash access is WIP
CONFIG_WIFI_CREDENTIALS=n
CONFIG_FLASH=n
CONFIG_NVS=n
CONFIG_SETTINGS=n
173 changes: 173 additions & 0 deletions boards/shields/nrf700x_nrf54h20dk/nrf700x_nrf54h20dk.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/
#include <freq.h>

/* Wi-Fi needs more flash (1M) and RAM (512K):
*
* To minimize the changes, only necessary nodes are added, so, delete
* any linked nodes. This was done here as it's applicable to most samples,
* if a sample needs anything extra, it can override this with a sample specific
* overlay.
*/
/delete-node/ &ipc0;
/delete-node/ &cpuppr_vpr;
/delete-node/ &mram1x;
/delete-node/ &cpurad_uicr;
Comment on lines +15 to +17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we deleting stuff like ppr vpr node here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not needed for Wi-Fi.


/ {
/delete-node/ ipc;
/delete-node/ reserved-memory;

/* Shift offsets by 512K */
soc {
mram1x: mram@e000000 {
compatible = "nordic,mram";
erase-block-size = <4096>;
write-block-size = <16>;
reg = <0xe000000 DT_SIZE_K(2048)>;
cpuapp_rx_partitions: cpuapp-rx-partitions {
compatible = "nordic,owned-partitions", "fixed-partitions";
status = "okay";
perm-read;
perm-execute;
perm-secure;
#address-cells = <1>;
#size-cells = <1>;

cpuapp_slot0_partition: partition@66000 {
reg = <0x66000 DT_SIZE_K(1024)>;
};
};

cpuapp_rw_partitions: cpuapp-rw-partitions {
compatible = "nordic,owned-partitions", "fixed-partitions";
status = "okay";
perm-read;
perm-write;
perm-secure;
#address-cells = <1>;
#size-cells = <1>;

storage_partition: partition@166000 {
reg = <0x166000 DT_SIZE_K(24)>;
};
};
};
};

reserved-memory {
compatible = "reserved-memory";
#address-cells = < 0x1 >;
#size-cells = < 0x1 >;
/* Shift offsets by 256K and remove IPC regions */
cpuapp_ram0x_region: memory@2f000000 {
compatible = "nordic,owned-memory";
reg = <0x2f000000 DT_SIZE_K(512)>;
status = "okay";
perm-read;
perm-write;
perm-secure;
perm-execute;
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x2f000000 DT_SIZE_K(512)>;

cpuapp_data: memory@0 {
reg = <0x0 DT_SIZE_K(512)>;
};
};

/* Below sections are unchanged, duplicated as delete the entire node */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is entire-node deletion required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The starting region is the CPU app and as we change the size all other regions have to be adjusted and for Wi-Fi we don't use those regions, so, instead of adjusting the node, deleted the node and only kept the relevant regions. I could delete all unused regions, but if an another region is added in the future, this will break, so, it's better to delete the full node.

shared_ram3x_region: memory@2fc12000{
compatible = "nordic,owned-memory";
reg = <0x2fc12000 DT_SIZE_K(4)>;
status = "okay";
perm-read;
perm-write;
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x2fc12000 0x2000>;

cpuapp_dma_region: memory@e80 {
compatible = "zephyr,memory-region";
reg = <0xe80 DT_SIZE_K(4)>;
status = "okay";
#memory-region-cells = <0>;
zephyr,memory-region = "DMA_RAM3x_APP";
};
};

cpuapp_uicr_ext: memory@e1ff800 {
reg = <0xe1ff800 DT_SIZE_K(2)>;
};
};

nordic_wlan0: nordic_wlan0 {
compatible = "nordic,wlan0";
status = "okay";
};

nrf70_tx_power_ceiling: nrf70_tx_power_ceiling_node {
status = "okay";
compatible = "nordic,nrf700x-tx-power-ceiling";
max-pwr-2g-dsss = <0x54>;
max-pwr-2g-mcs0 = <0x40>;
max-pwr-2g-mcs7 = <0x40>;
max-pwr-5g-low-mcs0 = <0x34>;
max-pwr-5g-low-mcs7 = <0x34>;
max-pwr-5g-mid-mcs0 = <0x34>;
max-pwr-5g-mid-mcs7 = <0x34>;
max-pwr-5g-high-mcs0 = <0x30>;
max-pwr-5g-high-mcs7 = <0x30>;
};

chosen {
zephyr,wifi = &nordic_wlan0;
zephyr,bt-hci-ipc = "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

@krish2718 krish2718 May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we had deleted the unnecessary IPC regions above, this was needed for build.

};
};

&pinctrl {
spi130_default: spi130_default {
group1 {
/* SCK has to be 0..3 and other signals can't use these pins */
psels = <NRF_PSEL(SPIM_SCK, 1, 1)>,
<NRF_PSEL(SPIM_MISO, 1, 6)>,
<NRF_PSEL(SPIM_MOSI, 1, 5)>;
};
};

spi130_sleep: spi130_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 1)>,
<NRF_PSEL(SPIM_MISO, 1, 6)>,
<NRF_PSEL(SPIM_MOSI, 1, 5)>;
low-power-enable;
};
};
};

&spi130 {
status = "okay";
cs-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;

pinctrl-0 = <&spi130_default>;
pinctrl-1 = <&spi130_sleep>;
pinctrl-names = "default", "sleep";
memory-regions = <&cpuapp_dma_region>;
nrf700x: nrf7002@0 {
compatible = "nordic,nrf700x-spi";
status = "okay";
reg = <0>;
spi-max-frequency = <DT_FREQ_M(8)>;
bucken-gpios = <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
iovdd-ctrl-gpios = <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
host-irq-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
};
};

&gpio1 {
status = "okay";
};
6 changes: 6 additions & 0 deletions samples/wifi/shell/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ tests:
- nrf52840dk/nrf52840
platform_allow: nrf5340dk/nrf5340/cpuapp nrf52840dk/nrf52840
tags: ci_build
sample.nrf54h20dk_nrf7002ek.shell:
build_only: true
extra_args: SHIELD=nrf700x_nrf54h20dk
integration_platforms:
- nrf54h20dk/nrf54h20/cpuapp
platform_allow: nrf54h20dk/nrf54h20/cpuapp
# Used by QA and also acts as a memory stress test
sample.nrf7001.superset:
build_only: true
Expand Down
4 changes: 2 additions & 2 deletions samples/wifi/shell/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <zephyr/sys/printk.h>
#include <zephyr/kernel.h>
#if defined(CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT) || NRF_CLOCK_HAS_HFCLK192M
#if NRFX_CLOCK_ENABLED && defined(CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT) && NRF_CLOCK_HAS_HFCLK192M
#include <nrfx_clock.h>
#endif
#include <zephyr/device.h>
Expand Down Expand Up @@ -42,7 +42,7 @@ int init_usb(void)

int main(void)
{
#if defined(CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT) || NRF_CLOCK_HAS_HFCLK192M
#if NRFX_CLOCK_ENABLED && defined(CLOCK_FEATURE_HFCLK_DIVIDE_PRESENT) && NRF_CLOCK_HAS_HFCLK192M
/* For now hardcode to 128MHz */
nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK,
NRF_CLOCK_HFCLK_DIV_1);
Expand Down
Loading