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

SDP MSPI driver #18893

Merged
merged 5 commits into from
Jan 15, 2025
Merged

SDP MSPI driver #18893

merged 5 commits into from
Jan 15, 2025

Conversation

jaz1-nordic
Copy link
Contributor

@jaz1-nordic jaz1-nordic commented Nov 14, 2024

SDP MSPI driver

@jaz1-nordic jaz1-nordic requested a review from a team November 14, 2024 12:13
@github-actions github-actions bot added manifest changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. labels Nov 14, 2024
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Nov 14, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Nov 14, 2024

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 34

Inputs:

Sources:

sdk-nrf: PR head: e7aa8d4771810f535f3db720b857570c4aeb81c7

more details

sdk-nrf:

PR head: e7aa8d4771810f535f3db720b857570c4aeb81c7
merge base: 12223d7199383ef98dcb220ada6d9912e36306a1
target head (main): b65f69a952107a821e23c0a222a1d2545db8b437
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (23)
CODEOWNERS
applications
│  ├── sdp
│  │  ├── mspi
│  │  │  ├── boards
│  │  │  │  │ nrf54l15dk_nrf54l15_cpuflpr.overlay
│  │  │  ├── prj.conf
│  │  │  ├── sample.yaml
│  │  │  ├── src
│  │  │  │  ├── hrt
│  │  │  │  │  ├── hrt.c
│  │  │  │  │  │ hrt.h
│  │  │  │  │ main.c
cmake
│  ├── sysbuild
│  │  │ sdp.cmake
drivers
│  ├── CMakeLists.txt
│  ├── Kconfig
│  ├── mspi
│  │  ├── CMakeLists.txt
│  │  ├── Kconfig
│  │  ├── Kconfig.nrfe
│  │  │ mspi_nrfe.c
dts
│  ├── bindings
│  │  ├── mspi
│  │  │  │ nordic,nrfe-mspi-controller.yaml
include
│  ├── drivers
│  │  ├── mspi
│  │  │  │ nrfe_mspi.h
scripts
│  ├── twister
│  │  ├── alt
│  │  │  ├── zephyr
│  │  │  │  ├── tests
│  │  │  │  │  ├── drivers
│  │  │  │  │  │  ├── mspi
│  │  │  │  │  │  │  ├── api
│  │  │  │  │  │  │  │  │ testcase.yaml
snippets
│  ├── sdp
│  │  ├── mspi
│  │  │  ├── app.conf
│  │  │  ├── sdp-mspi-app.overlay
│  │  │  ├── snippet.yml
│  │  │  ├── soc
│  │  │  │  │ nrf54l15_cpuapp.overlay
sysbuild
│  ├── Kconfig.sdp
│  │ sdp.cmake

Outputs:

Toolchain

Version: 11349092be
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:11349092be_912848a074

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister - Skipped: Skipping Build & Test as it succeeded in a previous run: 33
  • ✅ Integration tests
    • ✅ test-sdk-audio
    • ✅ desktop52_verification - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-boot - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-apps - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test_ble_nrf_config - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-ble_mesh - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-ble_samples - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-chip - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nfc - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_libmodem-nrf - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_serial_lte_modem - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_zephyr_lwm2m - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_samples - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ doc-internal - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_thingy91 - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf_crypto - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-rpc - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-rs - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-fem - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-tfm - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-thread - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-zigbee - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-sdk-find-my - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_mosh - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_positioning - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-sdk-sidewalk - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-sdk-wifi - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-low-level - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_nrf_provisioning - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-sdk-pmic-samples - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-sdk-mcuboot - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-sdk-dfu - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-ps - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-secdom-samples-public - Skipped: Job was skipped as it succeeded in a previous run

Note: This message is automatically posted and updated by the CI

@NordicBuilder
Copy link
Contributor

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publishing GitHub Action.

@jaz1-nordic jaz1-nordic force-pushed the nrfx-6633_mSPI_SDP branch 2 times, most recently from e660c0e to 04e12ea Compare November 18, 2024 09:55
@github-actions github-actions bot removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Nov 18, 2024
@jaz1-nordic jaz1-nordic marked this pull request as ready for review November 18, 2024 09:56
@jaz1-nordic jaz1-nordic requested review from a team as code owners November 18, 2024 09:56
@NordicBuilder
Copy link
Contributor

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publish GitHub Action.

sysbuild/sdp.cmake Outdated Show resolved Hide resolved
drivers/mspi/mspi_nrfe.c Outdated Show resolved Hide resolved
drivers/mspi/mspi_nrfe.c Outdated Show resolved Hide resolved
@jaz1-nordic jaz1-nordic force-pushed the nrfx-6633_mSPI_SDP branch 3 times, most recently from 91bb39f to c2e11f9 Compare November 21, 2024 15:23
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Nov 21, 2024

Memory footprint analysis revealed the following potential issues

sample.matter.template.debug[nrf7002dk/nrf5340/cpuapp]: High ROM usage: 911938[B] - link (cc: @kkasperczyk-no @ArekBalysNordic @markaj-nordic)
sample.matter.template.release[nrf7002dk/nrf5340/cpuapp]: High ROM usage: 820770[B] - link (cc: @kkasperczyk-no @ArekBalysNordic @markaj-nordic)

Note: This message is automatically posted and updated by the CI (latest/sdk-nrf/PR-18893/32)

sysbuild/Kconfig.sdp Outdated Show resolved Hide resolved
drivers/mspi/mspi_nrfe.c Outdated Show resolved Hide resolved
drivers/mspi/mspi_nrfe.c Outdated Show resolved Hide resolved
drivers/mspi/mspi_nrfe.c Outdated Show resolved Hide resolved
drivers/mspi/mspi_nrfe.c Outdated Show resolved Hide resolved
@jaz1-nordic jaz1-nordic force-pushed the nrfx-6633_mSPI_SDP branch 5 times, most recently from 2df40f2 to 81dc879 Compare November 27, 2024 13:46
Copy link
Contributor

@nordic-piks nordic-piks left a comment

Choose a reason for hiding this comment

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

Test configuration look ok.

@jaz1-nordic jaz1-nordic force-pushed the nrfx-6633_mSPI_SDP branch 3 times, most recently from fd6a31a to bb4ab6a Compare December 16, 2024 09:08
@carlescufi carlescufi requested a review from anangl December 16, 2024 12:52
@jaz1-nordic jaz1-nordic force-pushed the nrfx-6633_mSPI_SDP branch 3 times, most recently from bfa93e8 to c4b8b0c Compare December 17, 2024 10:38
Copy link
Contributor

@magp-nordic magp-nordic left a comment

Choose a reason for hiding this comment

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

Mostly nit comments.

drivers/mspi/mspi_nrfe.c Outdated Show resolved Hide resolved
case NRFE_MSPI_TXRX: {
if (len) {
ipc_received = len - 1;
ipc_receive_buffer = (uint8_t *)&response->data;
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems a bit too much to save an address of one uint8_t, instead of copying it, especially because the pointer will most likely be of 32-bit size. So instead of creating one uint8_t, we create a uint32_t.
Unless it is supposed to be a preparation for receiving more data from FLPR. In that case, it can be left as it is.

drivers/mspi/mspi_nrfe.c Outdated Show resolved Hide resolved
drivers/mspi/mspi_nrfe.c Outdated Show resolved Hide resolved
drivers/mspi/mspi_nrfe.c Outdated Show resolved Hide resolved
drivers/mspi/mspi_nrfe.c Outdated Show resolved Hide resolved
return -EINVAL;
}

return xfer_packet(packet, xfer->timeout);
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is the only place xfer_packet function is used, then maybe xfer_packet should be deleted and its body pasted here?

Copy link
Contributor

@magp-nordic magp-nordic left a comment

Choose a reason for hiding this comment

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

Some more nit comments. You do not have to apply them in this PR, I do not want to block it.

#define D2_PIN 3
#define D3_PIN 4
#define CS_PIN 5
#include <drivers/mspi/nrfe_mspi.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there could be a separate header file for pin numbers/pin translation. I am not a fan of including the whole nrfe_mspi.h here, HRT does not need to know FLPR response struct, for example.
However, I guess the pin numbers/pin translation can be changed in the future when pin checking is added, so it can stay as it is for now.

Comment on lines +35 to +53
typedef struct __packed {
uint8_t opcode;
struct mspi_cfg cfg;
} nrfe_mspi_cfg_t;

typedef struct __packed {
uint8_t opcode;
struct mspi_dev_cfg cfg;
} nrfe_mspi_dev_cfg_t;

typedef struct __packed {
uint8_t opcode;
struct mspi_xfer xfer;
} nrfe_mspi_xfer_t;

typedef struct __packed {
uint8_t opcode;
struct mspi_xfer_packet packet;
} nrfe_mspi_xfer_packet_t;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: If these structs have to be defined anyway, in order to have the same enum sizes on APP and FLPR, then why not define them in nrfe_mspi.h and use them on APP side too while sending? Alternatively, a structure with union of Zephyr structures can be defined:

Suggested change
typedef struct __packed {
uint8_t opcode;
struct mspi_cfg cfg;
} nrfe_mspi_cfg_t;
typedef struct __packed {
uint8_t opcode;
struct mspi_dev_cfg cfg;
} nrfe_mspi_dev_cfg_t;
typedef struct __packed {
uint8_t opcode;
struct mspi_xfer xfer;
} nrfe_mspi_xfer_t;
typedef struct __packed {
uint8_t opcode;
struct mspi_xfer_packet packet;
} nrfe_mspi_xfer_packet_t;
typedef union __packed {
struct mspi_cfg cfg;
struct mspi_dev_cfg dev_cfg;
struct mspi_xfer xfer;
struct mspi_xfer_packet packet;
} nrfe_mspi_driver_data;
typedef struct __packed {
uint8_t opcode;
union nrfe_mspi_driver_data data;
} nrfe_mspi_ipc_data_t;

Comment on lines +114 to +121
* nrfe_mspi_pinctrl_soc_pin_t *pins_cfg = (nrfe_mspi_pinctrl_soc_pin_t *)data;
* response.opcode = pins_cfg->opcode;
*
* for (uint8_t i = 0; i < NRFE_MSPI_PINS_MAX; i++) {
* uint32_t psel = NRF_GET_PIN(pins_cfg->pin[i]);
* uint32_t fun = NRF_GET_FUN(pins_cfg->pin[i]);
* NRF_GPIO_Type *reg = nrf_gpio_pin_port_decode(&psel);
* }
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: there should be no commented-out code.

Comment on lines 325 to 327
data_buffer[XFER_COMMAND_IDX] = 0xe5b326c1;
data_buffer[XFER_ADDRESS_IDX] = 0xaabbccdd;

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: since sample data is removed, this can also be removed.

Add SDP MSPI driver, dts and include files.

Signed-off-by: Jakub Zymelka <[email protected]>
Add new snippet files for SDP MSPI.

Signed-off-by: Jakub Zymelka <[email protected]>
Add cmake files to be able to include the SDP MSPI
application in solutions where SDP MSPI is required.

Signed-off-by: Jakub Zymelka <[email protected]>
Add IPC solution based on icmsg to application for FLPR core
to communicate with SDP MSPI driver.

Signed-off-by: Jakub Zymelka <[email protected]>
Add yaml configuration to enable SDP MSPI API test.

Signed-off-by: Jakub Zymelka <[email protected]>
@masz-nordic masz-nordic added this to the 3.0.0 milestone Jan 14, 2025
# Extract SoC name from related variables
string(REPLACE "/" ";" split_board_qualifiers "${BOARD_QUALIFIERS}")
list(GET split_board_qualifiers 1 target_soc)
set(board_target_flpr "${BOARD}/${target_soc}/cpuflpr")
set(target_soc)

# Select the SDP application
if(SB_CONFIG_SDP_GPIO)
set(sdp_app_dir "${ZEPHYR_NRF_MODULE_DIR}/applications/sdp/gpio")
Copy link
Contributor

Choose a reason for hiding this comment

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

this really needs to come from a Kconfig like the network core image so people can add their own, will approve but fix in a follow up PR

@masz-nordic masz-nordic merged commit a14701b into nrfconnect:main Jan 15, 2025
13 checks passed
@jaz1-nordic jaz1-nordic deleted the nrfx-6633_mSPI_SDP branch January 15, 2025 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants