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

spi nor sfdp runtime: nph offset #30211

Closed
sandroklarer-pingpong opened this issue Nov 24, 2020 · 0 comments · Fixed by #30371
Closed

spi nor sfdp runtime: nph offset #30211

sandroklarer-pingpong opened this issue Nov 24, 2020 · 0 comments · Fixed by #30371
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@sandroklarer-pingpong
Copy link

Describe the bug
Using the CONFIG_SPI_NOR_SFDP_RUNTIME configuration, by reading out the SFDP, the parameter nph is wrong interpreted.
A value of 0 means 1 parameter headers

So on my flash, where i get a 0 for nph, the flash layouting failed.

code (spi_nor.c) :
const struct jesd216_param_header *phpe = php + MIN(decl_nph, hp->nph);

proposal to fix:
const struct jesd216_param_header *phpe = php + MIN(decl_nph, hp->nph+1);

The JEDEC Standard No. 216 says:
Number of Parameter Headers (NPH)
Specifies the number of parameter headers in the SFDP data structure.
This number is 0-based. Therefore, 0 indicates 1 parameter header.
This number must be revised by a vendor or JEDEC when a new parameter header is
added

To Reproduce
Steps to reproduce the behavior:

  1. connect a nor flash like EN25QH64A to your board
  2. set up device tree
  3. CONFIG_SPI_NOR_SFDP_RUNTIME=y
  4. log shows: [00:00:00.003,000] <err> spi_nor: layout setup failed: -134

Expected behavior
Flash setup successful.

[00:00:00.003,000] <inf> spi_nor: PH0: ff00 rev 1.0: 9 DW @ 30
[00:00:00.003,000] <inf> spi_nor: EN25QH64A: 1 MiBy flash

Impact
Useing CONFIG_SPI_NOR_SFDP_MINIMAL

Logs and console output

Environment (please complete the following information):

  • OS: Linux
  • Toolchain: Zephyr SDK
  • zephyr-v2.4.0
@sandroklarer-pingpong sandroklarer-pingpong added the bug The issue is a bug, or the PR is fixing a bug label Nov 24, 2020
@nashif nashif added the priority: low Low impact/importance bug label Dec 1, 2020
@pabigot pabigot self-assigned this Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants