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

Add support Flash QSPI on S32Z270 #78073

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

Conversation

congnguyenhuu
Copy link
Contributor

@congnguyenhuu congnguyenhuu commented Sep 6, 2024

Introduce support HyperFlash memory devices on a NXP S32 QSPI bus. This driver uses a fixed LUT configuration that defined in HAL RTD HyperFlash driver and allows to read, write, and erase HyperFlash devices.
Add support QSPI secure flash protection (SFP) for memory control NXP S32 QSPI.
Enable support Flash QSPI on S32Z2XX, the on-board S26HS512T 512M-bit HyperFlash memory is connected to the QSPI controller port A1. This board configuration selects it as the default flash controller.

The test result:

west twister  --disable-warnings-as-errors --device-testing --device-serial=/dev/ttyUSB0 -v --runtime-artifact-cleanup --west-runner trace32 --west-flash="--config=./config.t32" -p s32z2xxdc2/s32z270/rtu1  -T samples/subsys/fs/littlefs -T samples/subsys/settings -T samples/subsys/shell/fs -T tests/drivers/flash -T tests/subsys/fs -T tests/subsys/settings -T tests/subsys/storage/flash_map -T tests/subsys/logging/log_backend_fs
INFO    - Using Ninja..
INFO    - Zephyr version: 8c53d91026a8
INFO    - Using 'zephyr' toolchain.
INFO    - Building initial testsuite list...

Device testing on:

| Platform                | ID   | Serial device   |
|-------------------------|------|-----------------|
| s32z2xxdc2/s32z270/rtu1 |      | /dev/ttyUSB0 |

INFO    - JOBS: 6
INFO    - Adding tasks to the queue...
INFO    - Added initial list of jobs to queue
INFO    - 58/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/storage/flash_map/storage.flash_map   PASSED (device 80.480s)
INFO    - 59/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/logging/log_backend_fs/logging.backend.fs.automounted PASSED (device 38.796s)
INFO    - 60/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/settings/functional/file/settings.file PASSED (device 28.017s)
INFO    - 61/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/logging/log_backend_fs/logging.backend.fs.manualmounted PASSED (device 40.086s)
INFO    - 62/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/settings/functional/nvs/settings.functional.nvs.chosen PASSED (device 27.685s)
INFO    - 63/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/settings/functional/fcb/settings.functional.fcb.chosen PASSED (device 27.686s)
INFO    - 64/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/settings/functional/fcb/settings.functional.fcb PASSED (device 27.692s)
INFO    - 65/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/settings/functional/nvs/settings.functional.nvs.dk PASSED (device 27.624s)
INFO    - 66/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/settings/functional/nvs/settings.functional.nvs PASSED (device 27.641s)
INFO    - 67/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/fs/fat_fs_api/filesystem.fat.api.sdmmc SKIPPED (runtime filter)
INFO    - 68/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/fs/fat_fs_api/filesystem.fat.api.mmc  SKIPPED (runtime filter)
INFO    - 69/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/storage/flash_map/storage.flash_map.mbedtls PASSED (device 80.335s)
INFO    - 70/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/storage/flash_map/storage.flash_map.psa PASSED (device 80.570s)
INFO    - 72/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/settings/file/settings.file.raw       PASSED (device 30.420s)
INFO    - 73/77 s32z2xxdc2/s32z270/rtu1   samples/subsys/settings/sample.subsys.settings     PASSED (device 27.357s)
INFO    - 74/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/fs/fs_api/filesystem.api              PASSED (device 26.865s)
INFO    - 75/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/settings/fcb/settings.fcb.raw         PASSED (device 47.201s)
INFO    - 76/77 s32z2xxdc2/s32z270/rtu1   tests/drivers/flash/common/drivers.flash.common.default PASSED (device 26.663s)
INFO    - 77/77 s32z2xxdc2/s32z270/rtu1   tests/subsys/fs/littlefs/filesystem.littlefs.default PASSED (device 39.218s)

INFO    - 77 test scenarios (77 test instances) selected, 59 configurations skipped (57 by static filter, 2 at runtime).
INFO    - 18 of 77 test configurations passed (100.00%), 0 failed, 0 errored, 59 skipped with 0 warnings in 808.67 seconds
INFO    - In total 134 test cases were executed, 355 skipped on 1 out of total 4 platforms (25.00%)
INFO    - 18 test configurations executed on platforms, 0 test configurations were only built.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Sep 6, 2024

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

Name Old Revision New Revision Diff
hal_nxp zephyrproject-rtos/hal_nxp@0ac8302 zephyrproject-rtos/hal_nxp#434 zephyrproject-rtos/hal_nxp#434/files

DNM label due to: 1 project with PR revision

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

@zephyrbot zephyrbot added manifest manifest-hal_nxp DNM This PR should not be merged (Do Not Merge) labels Sep 6, 2024
@congnguyenhuu congnguyenhuu changed the title Add support flash qspi on S32Z270 Add support Flash QSPI on S32Z270 Sep 6, 2024
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32ze-support-flash-qspi branch from eb86fa0 to a517164 Compare September 6, 2024 10:07
@Laczen Laczen removed their request for review September 6, 2024 11:05
dts/bindings/mtd/nxp,s32-qspi-hyperflash.yaml Outdated Show resolved Hide resolved
drivers/flash/flash_nxp_s32_qspi_hyperflash.c Outdated Show resolved Hide resolved
boards/nxp/s32z2xxdc2/s32z2xxdc2_s32z270_pinctrl.dtsi Outdated Show resolved Hide resolved
@congnguyenhuu
Copy link
Contributor Author

I rebased to fix conflict west manifest

@dleach02
Copy link
Member

dleach02 commented Dec 9, 2024

Don't worry about the west.yml conflict. Since we have a block of HAL PRs merging this will constantly be a problem

@congnguyenhuu couple of things to respond/resolve:

  • please ensure the west.yml update is occurring on the proper commit. Each commit needs to be bisectable.
  • @danieldegrasse asked a question on secure-flash-protection compatible. Where is this defined?

@congnguyenhuu congnguyenhuu force-pushed the nxp-s32ze-support-flash-qspi branch 2 times, most recently from 94697af to 115465c Compare December 11, 2024 02:22
@congnguyenhuu
Copy link
Contributor Author

Hello @danieldegrasse, Could you help me to review these changes. Thanks.

danieldegrasse
danieldegrasse previously approved these changes Dec 23, 2024
Dat-NguyenDuy
Dat-NguyenDuy previously approved these changes Dec 24, 2024
manuargue
manuargue previously approved these changes Dec 24, 2024
@de-nordic
Copy link
Collaborator

@congnguyenhuu please fix the ci failures.

@congnguyenhuu
Copy link
Contributor Author

Hello, I rebased to fix the CI check failure, but the current bsim test check is failing based on the latest code. Therefore, I logged issue #83388 to fix.

Following the commit f98fde0, DT_REG_ADDR now expands with a 'U'
suffix as an unsigned value. However, for compatibility with IS_EQ,
a raw value without any suffix is required. Therefore, this update is
necessary.

Signed-off-by: Cong Nguyen Huu <[email protected]>
Add support QSPI secure flash protection (SFP)

Signed-off-by: Cong Nguyen Huu <[email protected]>
Create common source code to use for supporting HyperFlash.

Rename 'FLASH_NXP_S32_QSPI_NOR_SFDP_RUNTIME' to
'FLASH_NXP_S32_QSPI_SFDP_RUNTIME' as a common kconfig.

Add the 'max-program-buffer-size' property to use for
setting memory pageSize, instead of using
'CONFIG_FLASH_NXP_S32_QSPI_LAYOUT_PAGE_SIZE' for setting.

Add the 'write-block-size' propertyto use for setting
the number of bytes used in write operations, it also
uses to instead of the 'memory-alignment' property.

Signed-off-by: Cong Nguyen Huu <[email protected]>
Add support HyperFlash memory devices on a NXP S32 QSPI bus.
This driver uses a fixed LUT configuration that defined in HAL RTD
HyperFlash driver.
Driver allows to read, write and erase HyperFlash devices.

Signed-off-by: Cong Nguyen Huu <[email protected]>
The on-board S26HS512T 512M-bit HyperFlash memory is connected to
the QSPI controller port A1.
This board configuration selects it as the default flash controller.

Signed-off-by: Cong Nguyen Huu <[email protected]>
Enable flash samples for s32z board

Signed-off-by: Cong Nguyen Huu <[email protected]>
Enable flash tests for s32z board

Signed-off-by: Cong Nguyen Huu <[email protected]>
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32ze-support-flash-qspi branch from 33ab075 to e2c6a90 Compare December 26, 2024 08:36
@congnguyenhuu
Copy link
Contributor Author

Hello @de-nordic, the CI failure is fixed, could you please revisit. Thanks.

@congnguyenhuu
Copy link
Contributor Author

Hello @de-nordic, Could you please review the changes again? We need your approval as the assignee to merge the HAL PR first, so we can update the west manifest file before merging this PR. Thanks.

@manuargue
Copy link
Member

@dleach02 can you please help us move forward with this merge? this PR have been approved a few times already and the HAL pr is also approved. Thanks

Copy link
Collaborator

@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.

Storage related tests and samples look ok.
@dleach02 NXP specific stuff is on your people to review.

Copy link
Collaborator

@mmahadevan108 mmahadevan108 left a comment

Choose a reason for hiding this comment

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

Needs to be sequenced behind #81012
@congnguyenhuu I merged the HAL side. After the gating PR merges, then we can update the HAL SHA and I'll clear my CR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: File System area: Flash area: Logging area: MEMC area: Samples Samples area: Settings Settings subsystem area: Shell Shell subsystem area: Storage Storage subsystem DNM This PR should not be merged (Do Not Merge) manifest manifest-hal_nxp platform: NXP S32 NXP Semiconductors, S32
Projects
None yet
Development

Successfully merging this pull request may close these issues.