Commit Graph

722 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
Vikas Katariya 6685025ef0 Add PSA auto-generated files to components
To support online compiler build for PSA targets, some files are
auto-generated (LPC55S69_NS and ARM_MUSCA_A1_NS) by the script
from offline build system. Since these files are identical for these
V8-M targets it would be good to check them in to support online
compiler as they are COMPONENT_SPE and services related.

In folder: components/TARGET_PSA/
  --TARGET_MBED_SPM
    --COMPONENT_SPE
      psa_setup.c
  --TARGET_TFM
    --COMPONENT_SPE
      --inc
	tfm_partition_defs.inc
        tfm_partition_list.inc
        tfm_service_list.inc
        tfm_spm_signal_defs.h
  --services
    --inc
      autogen_sid.h
      mbed_spm_partitions.h

Signed-off-by: Vikas Katariya <Vikas.Katariya@arm.com>
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
Vikas Katariya b6f5046b67 Fix enum type to align with psa-arch-tests
This is related to https://github.com/ARMmbed/mbed-os/issues/11256
When TARGET_PSA is enabled on Cortex-A boards, the SECURE
is redeclared. So to minimize the impact we can redeclare this in
val.h which is used only by Mbed. And `security_t` itself is used in
mbed-os\components\TARGET_PSA\TESTS, but the SECURE string is not used.

Renamed to `caller_security_t` which aligns with
https://github.com/ARM-software/psa-arch-tests
2019-11-18 15:42:08 +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
jeromecoutant efea334014 STMOD_CELLULAR: update readme 2019-11-18 15:42:08 +00:00
jeromecoutant fb35091432 STMOD_CELLULAR: remove flow control support for DISCO_L4R9I 2019-11-18 15:42:08 +00:00
jeromecoutant 82ecd19e9c STMOD_CELLULAR: set CTS with PullDown 2019-11-18 15:42:08 +00:00
Jarkko Paso 48c445f358 S2-LP: sync with development repository 2019-10-16 11:58:32 +01: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
Dominika Maziec 392ecdbb5b ESP8266Interface buffer null-terminated and parameters of scan function in correct order 2019-10-16 11:53:52 +01:00
Hugues Kamba a840987dfa Sync with TF upstream code as much as possible to remove warning 2019-10-16 11:53:52 +01:00
Hugues Kamba 7bdc7b6a69 Remove minor build warnings 2019-10-16 11:53:52 +01:00
Veijo Pesonen 575109b22f Adds missing include required by fixed-width format specifiers 2019-09-12 17:18:37 +01:00
Martin Kojtal e001216b55
Merge pull request #11315 from Patater/psa-crypto-api-1.0b3
Update Mbed OS for PSA Crypto API 1.0b3
2019-09-03 09:20:15 +02:00
Jaeden Amero 43af68d630 attestation: Don't create attestation key twice
If psa_attestation_inject_key() is called twice, exit with a non-fatal
error status without attempting to create another attestation key. The
key already exists and doesn't need to be added again.
2019-09-02 17:10:59 +01:00
Jaeden Amero 3d1b8363db Use PSA Crypto API 1.0b3
The PSA Crypto API has moved on from 1.0b2 to 1.0b3, bringing along with
it some breaking changes. Update Mbed OS to use the 1.0b3 API.
2019-09-02 17:10:59 +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
Jaeden Amero 3e53118727 crypto: Add IPC for psa_copy_key() 2019-08-29 14:55:21 +01:00