Commit Graph

12 Commits (master)

Author SHA1 Message Date
Lingkai Dong b5e7dd9d32 SFDP: Add more parameters to the reader callback
The SFDP functions parse SFDP data which is fetched by a callback
called `sfdp_reader` provided by {SPIF,QSPIF,OSPIF}BlockDevice.
Currently, this callback interface only takes a read address and an RX
buffer to store output data. This has been enough, because other SPI
parameters are always the same when fetching the SFDP table only -
they are just hardcoded in each reader.

But in the future we will add support for flash devices with multiple
configurations (in a subsequent commit), and to detect which
configuration is enabled, we will need to send detection commands
which require device-dependent SPI parameters:
* address size
* instruction
* dummy cycles

This commit
* turns the above SPI parameters from predefined/hardcoded values
into parameters of the callback
* lets the SFDP functions pass the above parameters to the callback
(Note: To read the SFDP table itself, those values are constants
defined by the standard, not tied to any particular device, so they
can be known to the SFDP functions)
* updates the callbacks implemented by {SPIF,QSPIF,OSPIF}BlockDevice
* updates the mock callback for unit tests and expectations
2021-09-10 09:46:02 +01:00
rogeryou 6d90674546
Update OSPIFBlockDevice.cpp
modify the definition of the tables
2021-05-07 09:27:37 +08:00
rogeryou 8d00a6f39f modify config file 2021-02-04 15:12:26 +08:00
rogeryou 93b6d5554d add MX25LW51245G_config.h 2021-02-03 16:55:18 +08:00
rogeryou cc80212970 modify for Travis CI 2021-02-02 10:15:35 +08:00
rogeryou 0db8da1152 modify for the RWW function of Macronix Flash 2021-02-01 17:55:45 +08:00
Lingkai Dong 23702ff2b3 Update include paths to SFDP.h 2020-11-26 17:31:31 +00:00
Martin Kojtal 61e4b55a22
Merge pull request #13947 from LDong-Arm/erase_algorithm_fix
Fix erase type determination for [Q/O/]BlockDevice::erase()
2020-11-26 15:53:03 +00:00
Lingkai Dong c41f7cb864 Fix integer type warnings in SFDP and *SPIFBlockDevice 2020-11-26 10:28:58 +00:00
Lingkai Dong 7525134532 [Q/O/]SPIFBlockDevice: remove logic for unaligned erase, as alignment is checked
[Q/O/SPIFBlockDevice::erase() begin with an alignment check,
after which unaligned erases should not happen or be allowed.

If the erase address is not aligned to the value returned by
sfdp_iterate_next_largest_erase_type(), it indicates an
internal error in erase table parsing which should not be
hidden.
2020-11-23 15:55:24 +00:00
jeromecoutant 4cf3a7f0f2 OSPIF: dummy cycles update 2020-11-10 18:38:21 +01:00
rogeryou 48524f25ae add opsi driver 2020-09-16 11:27:23 +08:00