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

pkg/flash: update flash to use chips package #2849

Merged
merged 2 commits into from
Jan 13, 2024

Conversation

rminnich
Copy link
Member

Check for the chip ID first, before trying to read the SFDP. If it is found, use those values for density and so on.

In any case, always try to read the sfdp. As time goes by, more and more chips will implement it, and it will go from mostly failing to mostly working.

@rminnich rminnich added the Awaiting reviewer Waiting for a reviewer. label Jan 12, 2024
@rminnich
Copy link
Member Author

I know it seems weird to read the SFDP even when we find the chip, but bear with me.

Most important: as time goes by, more and more chips will have an SFDP, and it makes sense to read it.

Less important: the packages assumes a valid sfdp in many places, and it's actually a lot simpler to make the effort to read it in, get an empty one, and have operations like DWord fail. Short form: a test was doing a nil deref if I don't read in an empty SFDP :)

Copy link

codecov bot commented Jan 12, 2024

Codecov Report

Attention: 39 lines in your changes are missing coverage. Please review.

Comparison is base (bc840e9) 75.73% compared to head (3aad902) 75.69%.

Files Patch % Lines
pkg/flash/flash_linux.go 26.66% 33 Missing ⚠️
pkg/spidev/spidev_linux.go 80.64% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2849      +/-   ##
==========================================
- Coverage   75.73%   75.69%   -0.04%     
==========================================
  Files         425      425              
  Lines       42808    42855      +47     
==========================================
+ Hits        32419    32438      +19     
- Misses      10389    10417      +28     
Flag Coverage Δ
.-amd64 67.87% <ø> (ø)
cmds/...-amd64 71.71% <ø> (+0.04%) ⬆️
integration/generic-tests/...-amd64 0.00% <ø> (ø)
integration/generic-tests/...-arm 0.00% <ø> (ø)
integration/generic-tests/...-arm64 0.00% <ø> (ø)
integration/gotests/...-amd64 73.95% <48.68%> (-0.05%) ⬇️
integration/gotests/...-arm64 74.88% <48.68%> (-0.05%) ⬇️
pkg/...-amd64 76.09% <51.25%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Check for the chip ID first, before trying to read the
SFDP. If it is found, use those values for density and so on.

In any case, always try to read the sfdp. As time goes
by, more and more chips will implement it, and it will go
from mostly failing to mostly working.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
@rminnich
Copy link
Member Author

FYI: wit this change, I can ID a flash part from an RPI4, connected to QSPI MUX. Next step is read and write.

pkg/flash/flash_linux.go Outdated Show resolved Hide resolved
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
@rminnich rminnich merged commit 00ccdc3 into u-root:main Jan 13, 2024
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting reviewer Waiting for a reviewer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants