Commit Graph

187 Commits (mbed-os-5.14)

Author SHA1 Message Date
Kyle Kearney 649234e7e7 Disable attempted 4-byte addressing for some boards
4-byte addressing has been seen to cause failures on NORDIC
boards and with Macronix memories. Suppress the attempt to enable it
on that hardware (via vendor quirks and a target check) until either
the failure cause can be fixed or a more robust suppression mechanism
is implemented.
2019-11-18 15:48:17 +00:00
Kyle Kearney 3b80a9ba1e QSPIF: Handle fast mode enable via vendor quirks
Use a vendor id check to only perform this enable on devices which define the
 second configuration register where the fast mode enable bit lives.
Change _enable_fast_mode to use the standard status register reading and writing functions
2019-11-18 15:48:17 +00:00
Kyle Kearney c40de052d5 QSPIF: Handle parts with extra config registers
Default to 2 status registers, but update this value if necessary
 during vendor quirk handling for parts (currently only Macronix)
 which have one status register and two control registers. For the
 purposes of QSPIFBlockDevice, these are all considered status
 (or at least "status-like") registers because they are all written
 via the Write Status Register instruction.
Set the custom RDCR instruction for Macronix during quirk handling.
Update reading and writing of status registers to handle a variable
 number of status registers.
2019-11-18 15:48:17 +00:00
Kyle Kearney d70ad784a3 QSPIF: Centralize handling of vendor quirks
Introduce a separate function for handling alterations to device interaction
which are not covered by the SFDP tables and therefore require checking against
the vendor id.
2019-11-18 15:48:17 +00:00
Kyle Kearney b6b8ffb830 Don't clear quad enable when clearing block protection
QSPIFBlockDevice::_clear_block_protection() has logic to retain the
WIP and WEL bits in status register 1, but it failed to account for
the situation where the QE bit is also in status register 1.
In _sfdp_set_quad_enabled, note the status register and bit therein
for the quad enable, so that _clear_block_protection can retain it.
2019-11-18 15:48:17 +00:00
Kyle Kearney 96bb6541cb QSPIF: Add back enable_fast_mode
This function writes a "config" register to ensure that the flash part
is in high performance mode, not low-power mode. This is required at
by at least MX25R6435F in order to operate at frequencies > 33MHz
(for reference, DISCO_L475VG_IOT01A runs the QSPI interface at 80 MHz).
The config register that this writes does not appear to be covered by
the SFDP spec (JESD216D.01) so this remains the status quo of
unconditional execution, as has been done on master since #8352.
2019-11-18 15:48:17 +00:00
Kyle Kearney 1647f21b8d Fix Astyle issues 2019-11-18 15:48:17 +00:00
Matthew Macovsky 9451167bbb Remove redundant QSPI erase alignment 2019-11-18 15:48:17 +00:00
Matthew Macovsky 835504d30a Update QSPI format after enabling 4-byte addressing 2019-11-18 15:48:17 +00:00
Matthew Macovsky a9a9a6ca14 Correct typos and formatting 2019-11-18 15:48:17 +00:00
Matthew Macovsky a8ac9ffeae Add missing debug prints to command functions 2019-11-18 15:48:17 +00:00
Matthew Macovsky a48d88c1da Streamline setting of instruction member variables 2019-11-18 15:48:17 +00:00
Matthew Macovsky 4886cc2cbe Replace power function with bit shift 2019-11-18 15:48:17 +00:00
Matthew Macovsky c0ea38c079 Update SDFP erase detection to properly handle legacy erase instruction 2019-11-18 15:48:17 +00:00
Matthew Macovsky 21a1e81a68 Move configuration of QSPI format to within commands where it is necessary 2019-11-18 15:48:17 +00:00
Matthew Macovsky f4c8b18282 Clear block protection on non-SST flash devices 2019-11-18 15:48:17 +00:00
Matthew Macovsky 3136b1cc20 Enable 4-byte addressing when supported in accordance with the SFDP standard 2019-11-18 15:48:17 +00:00
Matthew Macovsky 814fe6d5b6 Update flash device reset to conform to SFDP standard 2019-11-18 15:48:17 +00:00
Matthew Macovsky 9bd8c17cdf Reorder some functions 2019-11-18 15:48:17 +00:00
Matthew Macovsky 7176af9b48 Update reading/writing of status registers to conform to SFDP standard 2019-11-18 15:48:17 +00:00
Seppo Takalo d842762dd5 Remove commented-out code 2019-11-18 15:47:40 +00:00
Seppo Takalo 4f86135dc4 Remove linefeeds from debug prints 2019-11-18 15:47:40 +00:00
Seppo Takalo 5fecf6afa2 Add storage related files to baseline unittest.
* Refactor some headers to use relative path from Mbed OS root.
* Refactor some data types to compile on 64bit machines.
* Refactor some debug traces to use mbed_trace.
2019-11-18 15:47:40 +00:00
Kyle Kearney b9d824d67c Avoid stale mutex in QSPIFBlockDevice::read
Update to follow the same `goto exit_point` pattern that is used
by the rest of the functions to avoid leaving the mutex locked
when errors are detected and require the function to abort.
2019-11-18 15:42:08 +00:00
Kyle Kearney 6003dbe6b0 Reuse existing error for _qspi_configure_format
Use QSPIF_BD_ERROR_DEVICE_ERROR instead of introducing a new error code.
Add tr_error calls whenever _qspi_configure_format fails to aid in debugging.
2019-11-18 15:42:08 +00:00
Kyle Kearney 2b3ee26f62 Report errors returned by _qspi_configure_format
The function returns a qspi_status_t but most usages in QSPIFBlockDevice
assume that it always succeeds.
2019-11-18 15:42:08 +00:00
Kyle Kearney 4917bfabdf QSPIFBlockDevice: Fix incomplete propagation of qspi_inst_t 2019-11-18 15:42:08 +00:00
Martin Kojtal a69a2efae7 QSPIFBlockDevice: fix type on the namespace mbed 2019-11-18 15:42:08 +00:00
Matthew Macovsky 3b86b35616 Introduce qspi_inst_t type for QSPI instructions
Encourage the usage of consistent types (there are currently
 a mix of `int` and `unsigned int` used for qspi instructions)
QSPI commands are limited to 8 bits, to this is a typdef to char
2019-11-18 15:42:08 +00:00
toyowata 9ab22274a6 Add bootloader support for Seeed Arch-MAX 2019-11-18 15:42:08 +00:00
Maciej Bocianski 72760d7c7f EFM32GG11_STK3701: add QSPIF component config 2019-11-18 15:42:08 +00:00
Matthew Macovsky 53352717a2 Differentiate alt and dummy cycles in QSPIF
Propagate separate alt cycle and dummy cycle counts from QSPIFBlockDevice
down to the qspi driver, so that drivers which handle the two separately have
enough information to do so.
2019-10-16 11:58:32 +01:00
Matthew Macovsky 08a2709993 Allow for arbitrary QSPI alt sizes
The QSPI spec allows alt to be any size that is a multiple of the
number of data lines. For example, Micron's N25Q128A uses only a
single alt cycle for all read modes (1, 2, or 4 bits depending on
how many data lines are in use).
2019-10-16 11:58:32 +01:00
Kyle Kearney d41802fb75 Simplicy QSPIF target overrides for PSoC6
All current PSoC 6 targets support the same QSPI frequency and minimum
program size. So specify a single entry rather than duplicating for
each device.
2019-10-16 11:58:32 +01:00
Ben Cooke 9145b72433 Add MTS_DRAGONFLY_F413RH platform to mbed-os 2019-10-16 11:58:32 +01:00
Veijo Pesonen 575109b22f Adds missing include required by fixed-width format specifiers 2019-09-12 17:18:37 +01:00
Martin Kojtal c74d67ed52
Merge pull request #10711 from geky/add-i2cee-driver
Add i2cee-driver to components
2019-08-30 17:04:01 +02:00
Kyle Kearney 1facc76d22 Specify QSPI frequency for more Cypress targets
Provide values for CY8CKIT_062S2_43012 and CYW943012P6EVB_01
2019-08-28 17:56:27 -07:00
Michal Paszta 5a9183c549 storage: fix potential memory corruption and check return values 2019-08-21 09:26:35 +03:00
Martin Kojtal 101ae73b87
Merge pull request #11063 from linlingao/f_cc3220sf_launchxl
Add CC3220SF_Launchxl to Mbed OS
2019-08-19 12:08:11 +02:00
Pavel Slama 4974c86b54 astyle fix bracket 2019-08-13 21:48:18 +02:00
Pavel Slama 7b0a8f23a2 atyle format 2019-08-13 21:42:10 +02:00
Michal Paszta 73b122b2c4 Coverity and compilation warnings fixes 2019-08-07 10:30:52 +03:00
Pavel Slama 7ff5a45a24 replace wait with rtos sleep 2019-08-06 15:57:16 +02:00
Michal Paszta 1fe59b70e3 Bring back SPIF module-specific debug logs
The logs are switched off by default and can be enabled with a
module-specific compile switch in mbed_app.json.

Logs brought back from PR #10501
2019-08-06 10:53:36 +03:00
int_szyk ae6f8be146 Newline at the end of files 2019-08-01 08:44:58 +02:00
int_szyk 8b68a1ea58 Updated testcases 2019-07-31 10:46:38 +02:00
Lin Gao e74fbcd79e Add CC3220SF_Launchxl to Mbed OS 2019-07-17 13:19:32 -05:00
Kevin Bracey a522dcfa0a Replace deprecated wait calls 2019-07-15 10:13:50 +03:00
Kevin Bracey fc8e8f67c6 Deprecate wait/wait_ms APIs 2019-07-15 10:13:50 +03:00