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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

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
zephyr nrfconnect/sdk-zephyr@7f8d857 (main) nrfconnect/sdk-zephyr#2260 nrfconnect/sdk-zephyr#2260/files

DNM label due to: 1 project with PR revision

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: 28

Inputs:

Sources:

sdk-nrf: PR head: 167eea08bb5e67b603abaaadfa84ac7c3a69cff7
zephyr: PR head: 426937831167c6acc8920fa0f0957003230ede4e

more details

sdk-nrf:

PR head: 167eea08bb5e67b603abaaadfa84ac7c3a69cff7
merge base: 7b49c651f7dc839e9ff8d4d26f08416f6f0f9c96
target head (main): 0825ffbb8c6ce082e9b4d5139c86e20232a22599
Diff

zephyr:

PR head: 426937831167c6acc8920fa0f0957003230ede4e
merge base: 7f8d857bf1f57b07e832d52263beaa23c91fef24
target head (main): ebcb537514335164911127aa2b3dffd330239307
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 (28)
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
west.yml
zephyr
│  ├── drivers
│  │  ├── pinctrl
│  │  │  │ pinctrl_nrf.c
│  ├── include
│  │  ├── zephyr
│  │  │  ├── dt-bindings
│  │  │  │  ├── pinctrl
│  │  │  │  │  │ nrf-pinctrl.h
│  ├── tests
│  │  ├── drivers
│  │  │  ├── mspi
│  │  │  │  ├── api
│  │  │  │  │  ├── boards
│  │  │  │  │  │  │ nrf54l15dk_nrf54l15_cpuapp.overlay
│  │  │  │  │  ├── src
│  │  │  │  │  │  │ main.c

Outputs:

Toolchain

Version: b77d8c1312
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:b77d8c1312_912848a074

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

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
  • ❌ Integration tests
    • ✅ test-sdk-audio - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ 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
    • ✅ test-fw-nrfconnect-ble_mesh - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-ble_samples
    • ✅ 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
    • ✅ test-fw-nrfconnect-nrf-iot_lwm2m - 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
    • ✅ 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
    • ✅ 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/28)

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
@jaz1-nordic jaz1-nordic force-pushed the nrfx-6633_mSPI_SDP branch 3 times, most recently from 3b113cd to 2afc4b7 Compare December 4, 2024 13:18
@jaz1-nordic jaz1-nordic force-pushed the nrfx-6633_mSPI_SDP branch 2 times, most recently from 7b4e1bd to 98f3508 Compare December 11, 2024 12:56
@jaz1-nordic jaz1-nordic requested a review from a team as a code owner December 11, 2024 12:56
applications/sdp/mspi/sample.yaml Outdated Show resolved Hide resolved
applications/sdp/mspi/src/main.c Outdated Show resolved Hide resolved
@jaz1-nordic jaz1-nordic force-pushed the nrfx-6633_mSPI_SDP branch 3 times, most recently from 47238ee to 5b6c540 Compare December 11, 2024 13:34
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 changes related with SDP MSPI driver API test.

Signed-off-by: Jakub Zymelka <[email protected]>
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants