- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.2k
drivers: flash: update nrf_qspi_nor with JESD216 support #31045
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
Conversation
1b4a8f2    to
    ba178a2      
    Compare
  
    ba178a2    to
    3eec958      
    Compare
  
    3eec958    to
    9649428      
    Compare
  
    | Rebased on merged #31042. | 
        
          
                drivers/flash/jesd216.c
              
                Outdated
          
        
      There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite right; fixed; thanks.
9649428    to
    f492964      
    Compare
  
            
          
                drivers/flash/jesd216.h
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HODE=>HOLD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
f492964    to
    61fddbc      
    Compare
  
    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]>
| Rebase in attempt to fix bogus compliance failure https://github.com/zephyrproject-rtos/zephyr/pull/31045/checks?check_run_id=1722975715 | 
61fddbc    to
    29c3129      
    Compare
  
    There was a problem hiding this 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]>
29c3129    to
    91687c7      
    Compare
  
    
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:
Those enhancements are not in the scope of this PR.