Skip to content

Conversation

@lopeztel
Copy link
Contributor

softperipheral/CHANGELOG.rst contains the list of changes.

@lopeztel lopeztel requested a review from b-gent as a code owner March 31, 2025 08:55
@CLAassistant
Copy link

CLAassistant commented Mar 31, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the doc-required PR must not be merged without tech writer approval. label Mar 31, 2025
@lopeztel lopeztel changed the title softperipheral: rev cf28ddf86b89fb647ee876546770c2676b3bc63c softperipheral: Add sQSPI Mar 31, 2025
@lopeztel lopeztel changed the title softperipheral: Add sQSPI softperipheral: Add initial sQSPI Mar 31, 2025
@b-gent b-gent requested a review from annwoj March 31, 2025 10:48
@lopeztel lopeztel force-pushed the v0.1.0-rc1 branch 2 times, most recently from 7c47965 to bb0e307 Compare April 1, 2025 08:49
@lopeztel lopeztel requested a review from carlescufi as a code owner April 1, 2025 08:49
@lopeztel lopeztel force-pushed the v0.1.0-rc1 branch 2 times, most recently from 4dd7e0e to a25fe76 Compare April 1, 2025 09:18
@carlescufi carlescufi requested review from anangl and nordicjm April 1, 2025 11:27
See the following list changes:

* Added:
* First implementation of Soft Peripheral **sQSPI**.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* First implementation of Soft Peripheral **sQSPI**.
* The first implementation of Soft Peripheral sQSPI for the nRF54L15 and nRF54H20 SoCs.

empty line needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in f5a9456

It also allows to include additional instances of a peripheral in case the platform lacks sufficient hardware peripherals.

In most cases, the features and performance of a soft peripheral are equivalent to those of a hardware peripheral.
However, there may be some limitations. For more information, see the corresponding limitations page.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
However, there may be some limitations. For more information, see the corresponding limitations page.
However, there may be some limitations. For more information, see the :ref:`sqspi_limitations` page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in f5a9456

Comment on lines 12 to 13
v0.1.0
************
Copy link
Contributor

Choose a reason for hiding this comment

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

tbc - Is a separate versioning needed?

Suggested change
v0.1.0
************
|NCS| v3.0.0
************

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changelog at root level is meant to track changes for NCS releases, but as we add more softperipherals we will have each of them have their own version


* Added:

* TX, RX, and TX/RX :ref:`SPI transfer modes<sqspi_features_spi_modes>`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* TX, RX, and TX/RX :ref:`SPI transfer modes<sqspi_features_spi_modes>`.
* TX, RX, and TX/RX :ref:`SPI transfer modes<sqspi_features_spi_modes>` support.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in f5a9456

Comment on lines 204 to 205

The sQSPI application requires FastPad bias configuration to run at high frequency on SCLK.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The sQSPI application requires FastPad bias configuration to run at high frequency on SCLK.
Additionally, the sQSPI application requires FastPad bias configuration to run at high frequency on SCLK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in f5a9456

Memory retention configuration
******************************

The sQSPI Soft Peripheral requires RAM retention in order to go into the lowest power consumption mode (API call to :c:func:`nrfx_qspi2_deactivate`).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The sQSPI Soft Peripheral requires RAM retention in order to go into the lowest power consumption mode (API call to :c:func:`nrfx_qspi2_deactivate`).
The sQSPI Soft Peripheral requires RAM retention in order to go into the lowest power consumption mode, which can be called through the :c:func:`nrfx_qspi2_deactivate` API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in f5a9456

*****************

The sQSPI Soft Peripheral operates directly from non-cached RAM.
Your build environment must reserve the required RAM and ensure that it is readable/writable by both the Application Core and the FLPR.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Your build environment must reserve the required RAM and ensure that it is readable/writable by both the Application Core and the FLPR.
Your build environment must reserve the required RAM and ensure that it is readable and writable by both the application core and the FLPR core.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in f5a9456

Comment on lines 230 to 246
The build environment described in the :ref:`nrf54h20_porting_guide_code` section must comply with this requirements.
This includes proper settings in linker scripts, device tree specifications (DTS), and resource allocation.
Copy link
Contributor

Choose a reason for hiding this comment

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

If it's a general remark, shouldn't this appear somewhere at the beginning of this guide?

Suggested change
The build environment described in the :ref:`nrf54h20_porting_guide_code` section must comply with this requirements.
This includes proper settings in linker scripts, device tree specifications (DTS), and resource allocation.
The build environment described in the :ref:`nrf54h20_porting_guide_code` section must comply with these requirements.
This includes proper settings in linker scripts, device tree specifications (DTS), and resource allocation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in f5a9456

Application Core and FLPR configuration
***************************************

For an sQSPI application to run properly, nRF54L15 must run at highest base clock frequency. The user/integrator should take care of this.
Copy link
Contributor

Choose a reason for hiding this comment

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

all suggestions are the same for nRF54L15 (as in case of nRF54H20 section)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in f5a9456

@@ -0,0 +1,231 @@
.. _nrf54H20_porting_guide:

nRF54H20 porting guide
Copy link
Contributor

@carlescufi carlescufi Apr 1, 2025

Choose a reason for hiding this comment

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

I find there is too much duplication between this section and the 54L15 one, but I will leave it to @annwoj and @b-gent to comment on it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, there's a lot of duplication, but when I ran a diff on it, it showed few changes across the doc (additional tables and code-blocks), so if we were to create tabs for it I think it could be confusing. For now I'd leave it as is but I'll keep thinking of some other solution

* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#ifndef SP_SQSPI_FIRMWARE_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 personally dislike using "firmware" here. This is really a full VPR image, so I would call it "image".

#endif

/**
* @defgroup nrfx_qspi2 QSPI2 driver
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 we should rename this to something clearer and cleaner. For starters, this is not only QSPI, so it should not be called QSPI. I would suggest xspi or mspi. If we don't do it now, then we will have to do it later, breaking compatibility.

CC @masz-nordic

Choose a reason for hiding this comment

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

I agree this name is not perfect. The source of it is here: https://projecttools.nordicsemi.no/nightly/topic/wezen/qspi.html?cp=3_8_0_0_8_20 . So, unless we change the source, I don't think we should change the driver prefix.

Copy link

Choose a reason for hiding this comment

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

I would suggest reconsidering further name changes to your APIs:

  • for the HW SSI, there is an existing Zephyr driver using registers directly (so no reason for nrfx_qspi2.h)
  • we will need a secondary SHIM for any SW peripheral anyways as there is no mechanism in place to distinguish between HW and SW instances on nrfx level (so not possible to reuse SHIM)
  • reusing the same names it will not be possible to run in parallel HW and SW instances
  • using different APIs and SHIMs will enable sw developments at own paces
  • two sources of nrfx_* names may be confusing for customers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps renaming is out of scope for this PR? We took the existing API approved in this PR: https://github.com/nrfconnect/nrfx/pull/724

Copy link
Contributor

Choose a reason for hiding this comment

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

I disagree. Either we do it now or else we will be stuck with this name forever. I think we should rename the nrfx API and then merge this PR here.

https://projecttools.nordicsemi.no/nightly/topic/wezen/qspi.html?cp=3_8_0_0_8_20 . So, unless we change the source, I don't think we should change the driver prefix.

@hubertmis I disagree, you wrote in https://github.com/nrfconnect/nrfx/pull/724 that this API would serve multiple peripherals with different names, so I think we should rename the nrfx API to something like nrfx_xspi or nrfx_mspi

Copy link
Contributor

Choose a reason for hiding this comment

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

@barsok I am not quite sure what you are suggesting here. You are happy with the current name or do you think we should change it?

Copy link

@barsok barsok Apr 2, 2025

Choose a reason for hiding this comment

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

@barsok I am not quite sure what you are suggesting here. You are happy with the current name or do you think we should change it?

I suggest changing not only the "peripheral" part of the name, but nrfx prefix as well. The reasons are above, most important are confusion for customers and making it even more confusing when nrfx will get a hw version of the same driver. Then nrfxlib and hal_nordic will contain functions with the same names

Choose a reason for hiding this comment

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

I disagree, you wrote in nrfconnect/nrfx#724 that this API would serve multiple peripherals with different names, so I think we should rename the nrfx API to something like nrfx_xspi or nrfx_mspi

The two peripherals this API currently targets are called QSPI and sQSPI. So far, all nrfx drivers follow the nrfx_peripheralname prefix. As agreed in https://github.com/nrfconnect/nrfx/pull/724 and other discussions, I would prefer not to change this rule now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have dismissed my nack, but I want to state that I think this is a mistake that will confuse users and developers alike.


#ifndef SQSPI_FIRMWARE_H__
#define SQSPI_FIRMWARE_H__
#include "sqspi_firmware_v0.1.0.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

How about changing this to:

#if defined(NRF54L15_XXAA)
#include "nrf54l15/sqspi_firmware_v0.1.0.h"
#elif defined(NRF54H20_XXAA)
#include "nrf54h20/sqspi_firmware_v0.1.0.h"
#endif

and moving the file one level up (or maybe even place all of this next to nrfx_qspi2.c, I guess only this file is supposed to include this stuff)? This would simplify a bit the integration of the driver.


Refer to the following detailed descriptions of current limitations:

* sQSPI does not support slave mode operations; it can only operate as a controller (master).
Copy link
Contributor

Choose a reason for hiding this comment

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

spi slave has changed to spi peripheral I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my understanding is that the names were controller and target? is this what you mean?

Comment on lines 210 to 216
* If you set the :c:var:`nrfx_qspi2_cfg_t.skip_gpio_cfg` variable to ``true``, the GPIO configuration is not managed by the sQSPI driver and it must be manually handled by the application.
This is a requirement for the nRF54H20 device.
* If you set the :c:var:`nrfx_qspi2_cfg_t.skip_pmux_cfg` variable to ``true``, the GPIO multiplexing is not managed by the sQSPI driver and it must be manually handled by the application.
This is a requirement for the nRF54H20 device.
Copy link
Contributor

Choose a reason for hiding this comment

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

why can't dts be used for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any comments here @anangl ?

Choose a reason for hiding this comment

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

This driver does not depend on the .dts infrastructure. You can set skip_pmux_cfg = true and configure the GPIO multiplexing in any way available to the application, potentially using the device tree if that's the proper way in the integration environment (e.g. Zephyr).

Copy link
Contributor

@annwoj annwoj 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 suggestions, thanks!

************

This is an initial release for Soft Peripherals.
See the following list changes:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
See the following list changes:
See the following list of changes:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in c5b23b6

It also allows to include additional instances of a peripheral in case the platform lacks sufficient hardware peripherals.

In most cases, the features and performance of a soft peripheral are equivalent to those of a hardware peripheral.
However, there may be some limitations. For more information, see the :ref:`sqspi_limitations` page.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
However, there may be some limitations. For more information, see the :ref:`sqspi_limitations` page.
However, there may be some limitations.
For more information, see the :ref:`sqspi_limitations` page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in c5b23b6

Comparison between QSPI and sQSPI support
*****************************************

You should be aware of the differences between sQSPI and QSPI features:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You should be aware of the differences between sQSPI and QSPI features:
The following section provides a detailed comparison of the features supported by the standard Quad Serial Peripheral Interface (QSPI) and the sQSPI.
The comparison highlights the capabilities and limitations of each interface to aid in technical decision-making for your system design.
For more details on sQSPI support, see the :ref:`sqspi_features` page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in c5b23b6

Comment on lines 3 to 4
sQSPI
################
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
sQSPI
################
sQSPI
#####

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in c5b23b6

Comment on lines 32 to 33
* Full Duplex: SPI reads by switching to receiving data (MISO) after transmitting data (MOSI).
* Half Duplex: Three-wire setup (MOSI/MISO, SCLK, CSN).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Full Duplex: SPI reads by switching to receiving data (MISO) after transmitting data (MOSI).
* Half Duplex: Three-wire setup (MOSI/MISO, SCLK, CSN).
* Full duplex - SPI reads by switching to receiving data (MISO) after transmitting data (MOSI).
* Half duplex - Three-wire setup (MOSI/MISO, SCLK, CSN).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in c5b23b6

Application core and FLPR configuration
***************************************

For an sQSPI application to run properly, you must adjust the settings for the nRF54H20 SoC to run at highest base clock frequency. The user/integrator should take care of this.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For an sQSPI application to run properly, you must adjust the settings for the nRF54H20 SoC to run at highest base clock frequency. The user/integrator should take care of this.
For an sQSPI application to run properly, you must adjust the settings for the nRF54H20 SoC to run at highest base clock frequency.

These were not addressed for any of the occurrences, please fix


In as secure configuration, both the application core and the FLPR core of the nRF54H20 device must operate within a secure environment enabled by TrustZone Secure.

Non-Secure settings
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Non-Secure settings
Non-secure settings


.. _nrf54H20_porting_guide_ram_configuration:

RAM Configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
RAM Configuration
RAM configuration

Application core and FLPR configuration
***************************************

For an sQSPI application to run properly, you must adjust the settings for the nRF54L15 SoC to run at highest base clock frequency. The user/integrator should take care of this.
Copy link
Contributor

Choose a reason for hiding this comment

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

same as for nRF54H20, suggestions not applied

// NOTE: Setting FLPR to secure
NRF_SPU00_S->PERIPH[0xC].PERM = (SPU_PERIPH_PERM_SECATTR_Secure << SPU_PERIPH_PERM_SECATTR_Pos);

Non-Secure settings
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Non-Secure settings
Non-secure settings

Comment on lines 249 to 250
RAM Configuration
*****************
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
RAM Configuration
*****************
RAM configuration
*****************


Timing parameters
*****************

Copy link
Contributor

@annwoj annwoj Apr 2, 2025

Choose a reason for hiding this comment

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

is this section (heading) necessary?

Comment on lines 3 to 4
Timing
######
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Timing
######
Timing parameters
#################

@lopeztel lopeztel force-pushed the v0.1.0-rc1 branch 2 times, most recently from c5b23b6 to 706941e Compare April 2, 2025 13:25
@lopeztel
Copy link
Contributor Author

lopeztel commented Apr 2, 2025

After talking to @annwoj , we've decided to have a separate documentation only PR, the scope of this PR will be limited to source code

@carlescufi carlescufi dismissed their stale review April 2, 2025 13:43

Stale, the API name will be looked at in a separate PR

@carlescufi
Copy link
Contributor

@lopeztel @gbakke I will ack this PR to help you get it in on time but we do have an agreement on revisiting the nrfx_qspi2 API name with @hubertmis after this is merged.

@b-gent b-gent added the doc-postponed PR requires documentation updates, tech writer review happens later. label Apr 2, 2025
@b-gent
Copy link
Contributor

b-gent commented Apr 2, 2025

Some doc work is still needed ; will be done after rc-1.

Copy link
Contributor

@annwoj annwoj left a comment

Choose a reason for hiding this comment

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

Approving, the doc review will continue on a separate PR

@b-gent
Copy link
Contributor

b-gent commented Apr 2, 2025

Doc build needs to be fixed on the manifest PR if this is to be merged:
nrfconnect/sdk-nrf#21239

softperipheral/CHANGELOG.rst contains the list of changes.

Signed-off-by: Luis David Lopez <[email protected]>
@carlescufi carlescufi merged commit b4ebdea into nrfconnect:main Apr 2, 2025
5 checks passed
@lopeztel lopeztel deleted the v0.1.0-rc1 branch April 23, 2025 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-postponed PR requires documentation updates, tech writer review happens later. doc-required PR must not be merged without tech writer approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants