Skip to content

Conversation

@pabigot
Copy link
Contributor

@pabigot pabigot commented Dec 29, 2020

Based on #31042. The first several commits of this add DW15 and DW16 support, which could move to a separate PR as it's JESD216-specific, not Nordic-specific.

The rest updates the Nordic QSPI driver to be able to fetch SFDP data. This can be used to update several things, including but not limited to:

  • verifying that the opcodes for specific functions are compatible with the ones Nordic hard-codes into the peripheral;
  • adding support for 32-bit address modes;
  • adding support for power management.

Those enhancements are not in the scope of this PR.

@github-actions github-actions bot added area: Boards area: Devicetree area: Devicetree Binding PR modifies or adds a Device Tree binding area: Documentation area: Samples Samples area: Tests Issues related to a particular existing or missing test platform: NXP NXP platform: Silabs Silicon Labs platform: STM32 ST Micro STM32 labels Dec 29, 2020
@pabigot pabigot marked this pull request as ready for review January 4, 2021 17:13
@pabigot pabigot requested a review from erwango January 4, 2021 17:16
@pabigot
Copy link
Contributor Author

pabigot commented Jan 13, 2021

Rebased on merged #31042.

@carlescufi carlescufi requested a review from de-nordic January 18, 2021 15:25
Copy link
Contributor

Choose a reason for hiding this comment

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

The filed is 5 bit long, shouldn't the mask be 0x1F?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Quite right; fixed; thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

HODE=>HOLD

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

DW indexes start from 1, so the proper upper bound includes the value
of len_dw.

Signed-off-by: Peter Bigot <[email protected]>
DW15 provides information on entry and exit from QSPI modes.  In
particular, it specifies whether and how the status register must be
updated for this feature.

Add a JESD216 devicetree property for the Quad Enable Requirements
value.

Signed-off-by: Peter Bigot <[email protected]>
DW16 provides information on mechanisms to enter and exit 4-Byte
address modes, returning the device to reset state, and how to
manipulate the values in the first status register.

Signed-off-by: Peter Bigot <[email protected]>
Not all special commands require that a write-enable be issued first.
Allow the caller to decide.

Signed-off-by: Peter Bigot <[email protected]>
@pabigot
Copy link
Contributor Author

pabigot commented Jan 18, 2021

Rebase in attempt to fix bogus compliance failure https://github.com/zephyrproject-rtos/zephyr/pull/31045/checks?check_run_id=1722975715

Copy link
Contributor

@de-nordic de-nordic left a comment

Choose a reason for hiding this comment

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

Left some minor comments.

Generally looks OK.

The interface used to send commands supports only a command followed
by 8 bytes of data transfer.  Reject attempts to do more, as the
result will be a successful transfer of only the first 8 bytes.

Signed-off-by: Peter Bigot <[email protected]>
These are so long they can mandate line length mitigation.  Avoid that.

Signed-off-by: Peter Bigot <[email protected]>
Kconfig allowed selecting any bit in the status register as the QE
bit, and defaulted it to 6.  Devices need not require a QE bit at all,
and where JESD216 defines QE bit location the only place in first SR
byte that it can be is bit 6.  Further, the code unconditionally wrote
the value 0x40 without respecting configuration of other bits.  Some
of those bits control write protection of block-protected areas and
should not be changed.

Remove the Kconfig, instead using the jedec,jesd216-controlled
devicetree property.  Allow the driver to recognize whether or not
setting the bit is required, and when it is only use bit 6.  Only
update if the setting does not match the configuration.

Signed-off-by: Peter Bigot <[email protected]>
QSPI doesn't have a different length expectation than normal SPI, so
introducing a new name for an existing name is unnecessary.  Also
replace the constant with the actual buffer size where appropriate, in
somebody changes the the buffer definition.

Signed-off-by: Peter Bigot <[email protected]>
Refactor slightly so we can read SFDP tables with this driver.  Note
that the SFDP read command requires long frame mode transfers as data
exceeds 8 bytes.

Signed-off-by: Peter Bigot <[email protected]>
Remove the overlay and set up to enable the QSPI variant.

Signed-off-by: Peter Bigot <[email protected]>
@nashif nashif merged commit 855b39e into zephyrproject-rtos:master Jan 18, 2021
@pabigot pabigot deleted the nordic/20201229b branch January 22, 2021 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Boards area: Devicetree Binding PR modifies or adds a Device Tree binding area: Devicetree area: Documentation area: Flash area: RISCV RISCV Architecture (32-bit & 64-bit) area: Samples Samples area: Tests Issues related to a particular existing or missing test platform: NXP NXP platform: Silabs Silicon Labs platform: STM32 ST Micro STM32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants