Commit Graph

64 Commits

Author SHA1 Message Date
Alberto Escolar Piedras
c883d397f6 tests/drivers/flash common: Allow on nrf53_bsim boards
Add the new simulated nrf53 targets to this test, as they
can run it without problems.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-29 18:56:33 +03:00
Alberto Escolar Piedras
f8e34e6684 tests/drivers/flash common: Allow on nrf52_bsim
903a79431a
seems to have attempted to limit in how
many platforms this test runs due to issues in some
platforms. But how it was done (using platform allow apart
from integration platform) it prevents it running on
other platforms in which it works.
Add the nrf52_bsim target to this allow list so the
test can be run on it too.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-27 15:48:17 +02:00
YuLong Yao
b83a0580aa tests: drivers: flash: add esp32c3_luatos_core
add overlay and conf for esp32c3_luatos_core board

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-09-15 14:17:50 +02:00
J.P. Hutchins
477ff70230 test: drivers: flash: build spi_nor.c wp & hold
Test spi_nor.c driver builds with or without wp-gpios and hold-gpios.

Signed-off-by: J.P. Hutchins <jp@intercreate.io>
2023-09-13 12:07:27 +02:00
Alberto Escolar Piedras
69643d575d tests drivers.flash.common.default: Fix allow list
qemu_x86 was listed as an integration platform but not in the
allow list causing twister to fail:

Error found:
tests/drivers/flash/common/drivers.flash.common.default
on qemu_x86 (Not in testsuite platform allow list but is one
of the integration platforms)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-01 08:59:49 -04:00
Hake Huang
903a79431a tests: driver: flash_default limited on tier one boards
remove mcux test scenario, which is overlapped with default
limit test to boards listed in the boards list

fixing: #62067

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2023-09-01 13:22:42 +02:00
Daniel Leung
121b4d2d62 tests: drivers: rename shadow variables
Renames shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Manuel Argüelles
23259aecdd tests: enable flash tests for mr_canhubk3 board
Various tests enabled to use the on-board QSPI memory.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-07-26 09:44:14 +02:00
Anas Nashif
b835b02136 tests: cleanup metadata and filtering
- Add integration_platforms to avoid excessive filtering
- Make sure integration platforms are actually part of the filter
- Fix some tags and test meta data

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-13 09:38:27 -04:00
Anas Nashif
0064b6e8b6 tests: samples: cleanup test tags, add integration_platforms
Use integration platforms and sanitize tags.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-02 04:47:06 -04:00
Gerard Marull-Paretas
93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Sreeram Tatapudi
98858f1e6a drivers: flash: Add Infineon CAT1 Flash driver
- Added initial version of Infineon CAT1 Flash driver
- Added binding file for infineon,cat1-flash-controller.yaml
- Added overlays for subsys/nvs and drivers/flash_shell
to support cy8cproto_063_ble, cy8cproto_062_4343w boards
- Defined erase-block-size in PSoC6 MPN dtsi.

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2023-05-08 11:16:09 +02:00
Alberto Escolar Piedras
67e3c21260 tests/flash: Fix max test size check
The condition just needs to be <=, as it is ok
to write say 128KB in a 128KB storage partition.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-05-08 10:08:35 +02:00
Patryk Duda
69226e96e9 drivers: flash: Add tests for STM32 extended operations
Introduced tests covers following features:
- Write protection - enabling, disabling, confirming that it works.
- Readout protection - checking current status.

These features are implemented on STM32F4 boards, so we only allow these
boards.

Signed-off-by: Patryk Duda <pdk@semihalf.com>
2023-03-28 15:43:16 +00:00
Patryk Duda
32fbe27054 test: drivers: Move existing flash tests to flash/common directory
After 'flash_ex_op' syscall was added we are able to expose vendor
specific features to the user.

This patch moves existing tests to 'tests/drivers/common'. New tests for
vendor specific operations should go to vendor directory under
'tests/drivers/flash'.

Signed-off-by: Patryk Duda <pdk@semihalf.com>
2023-03-28 15:43:16 +00:00
Erwan Gouriou
36ffed2a89 tests: drivers: flash: _ns target test case should be build only
Flash test can't be tested automatically on (at least some) _ns targets
by CI.
Set a dedicated test scenario for _ns targets in build_only.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-02-08 01:14:38 +09:00
Erwan Gouriou
391aef215b tests: drivers: flash: Update b_u585i_iot02a_ns overlay
Update overlay after b_u585i_iot02a_ns flash partition was revisited

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2023-02-01 17:16:13 +09:00
Dominik Ermel
f05e8e8f27 tests: drivers: flash: Fix filter using non-existent partition
Filtering used image_1_nonsecure as DTS node label, while correct
one is slot1_ns_partition.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-01-23 10:06:50 +00:00
Fabio Baltieri
7db1d17ee3 yamllint: fix all yamllint line-length errors
Fix all line-length errors detected by yamllint:

yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
  grep '(line-length)'

Using a limit is set to 100 columns, not touching the commandlines in
GitHub workflows (at least for now).

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 01:16:45 +09:00
Anas Nashif
ba7d730e9b tests/samples: use integration_plaforms in more tests/samples
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-29 16:03:23 +01:00
Francois Ramu
f3973dfd07 tests: drivers: flash: size to erase equal to size to write
Need to erase as many bytes as the size to write.
The size to erase is expressed aligned on the page size.
(assuming the page_info.size is constant)
In case the page_info.size is lower than the size to write,
the next write operation will fail.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-23 16:10:03 +00:00
Gregers Gram Rygg
f9b5138097 drivers: flash: spi_nor: add macronix high performance mode
Add property mxicy,mx25r-power-mode to jedec,spi-nor binding for
controlling low power/high performance mode on Macronix MX25R* Ultra Low
Power flash devices.

- "low-power" configures the flash in ultra low power mode.
- "high-performance" configures the flash in high performance mode.

Signed-off-by: Gregers Gram Rygg <gregers.gram.rygg@nordicsemi.no>
2022-11-15 14:58:26 +01:00
Maciej Perkowski
9018338863 tests: drivers: flash: Fix nrf_qspi_nor_4B_addr requirements
The test requires external memory connected but it was not
reflected in the yaml decription. Therefore, the test was failing
instead of being skipped. It is the same story as with #47241

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-10-04 19:16:37 +00:00
Andriy Gelman
072a428f78 drivers: flash: Add xmc4xxx flash drivers
Add xmc4xxx flash drivers.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-10-03 13:56:49 +02:00
Gerson Fernando Budke
b5f65f201d boards: arm: stm32l562e_dk_ns: Add flash partitions
The current stm32l562_dk_ns has no flash partitions defined. This add
flash partitions following partition sizes that are compatible with
the TF-M platform defined at flash_layout.h and removes the redundant
overlays board files.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-09-09 16:40:20 +00:00
Michał Barnaś
dae8efa692 ztest: remove the obsolete NULL appended to zassert macros
This commit removes the usage of NULL parameter as message in
zassert_* macros after making it optional

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-09-09 07:05:38 -04:00
Francois Ramu
735921fa68 tests: drivers: flash on stm32l475 requires higher stack size
Increasing the stack size to pass the
tests/drivers/flash testcase on the disco_l475_iot1 disco kit.
Note that CONFIG_MPU_ALLOW_FLASH_WRITE is set.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-09-07 15:38:08 +02:00
Francois Ramu
6205866143 tests: drivers: flash driver for the non-secure stm32u5 board
this commit adds an overlay to run the tests/drivers/flash
on the b_u585i_iot02a_ns target platform.
It renames the non-secure partition to slot1_ns_partition
to match the testcases.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-09-07 15:38:08 +02:00
Dominik Ermel
25b8c199a3 tests: drivers: flash: Switch to FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Gerard Marull-Paretas
79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Enjia Mai
f2cbd8405b tests: drivers: move the flash test to new ztest API
Migrate the testsuite tests/drivers/flash to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-02 11:09:09 +00:00
Daniel DeGrasse
8a0e4aa744 tests: drivers: flash: Make testcase depend on FLASH_HAS_DRIVER_ENABLED
Change default flash driver testcase to depend on FLASH_HAS_DRIVER_ENABLED,
and the presence of a storage partition in the output DTS, so that the test
will run on all platforms that report flash support.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-08-25 08:26:53 -05:00
Daniel DeGrasse
3dca5c0617 tests: drivers: flash: enable heap for ESP32 boards
Enable heap for ESP32 boards that require it for flash driver support.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-08-25 08:26:53 -05:00
Daniel DeGrasse
8eb493ffaf tests: drivers: flash: increase write size of test
Some SOCs, such as NXP's LPC family, expect a minimum write size of 512
bytes. Increase the EXPECTED_SIZE definition for flash driver test to
512 so that test can pass on these platforms.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-08-25 08:26:53 -05:00
Gerard Marull-Paretas
e0125d04af devices: constify statically initialized device pointers
It is frequent to find variable definitions like this:

```c
static const struct device *dev = DEVICE_DT_GET(...)
```

That is, module level variables that are statically initialized with a
device reference. Such value is, in most cases, never changed meaning
the variable can also be declared as const (immutable). This patch
constifies all such cases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Dominik Ermel
7aa386e288 tests: drivers: flash: Rework and cleanup flash area definitions
Simplify and reduce the definitions.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-08-12 14:19:18 +01:00
Andrzej Głąbek
65976137dc boards: nrf: Activate pull-up on QSPI CSN line in "sleep" state
When there is no external pull-up on the CSN line and the line
is put into the low-power mode (input direction and disconnected
buffer), after some time its level falls to low and some flash
chips, like for example MX25R64, exit the Deep Power-down mode
when that happens. To prevent this, activate the GPIO internal
pull-up for this line in boards that do not have the external
pull-up on it.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-08-10 16:08:23 +02:00
Fabio Baltieri
def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Fabio Baltieri
969a361366 test: flash: fix nrf52840dk_mx25l51245g test variant
The SPI flash were recently changed to use an alias to identify the
flash chip in:

64fbbd9a44 boards: Add alias to boards with spi-flash node

This caused some CI test failure for the nrf52840dk test with the
nrf52840dk_mx25l51245g overlay, as it changes the flash nodelabel of the
board dts file. Adding the correct alias to the overlay file to point to
the correct one.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-07-23 12:50:30 +09:00
Kumar Gala
b97a9ee21c tests: drivers: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from tests.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-22 16:44:08 +00:00
Chay Guo
a4c9e13ea8 boards: arm: Enable flash for storage on mimxrt595_evk
- The MX25UM51345G flash is connected to FLEXSPI PortA for
  mimxrt595_evk.
- Updated flexspi_mx25um51345g driver to support DTR OPI mode.
- Tested with tests/drivers/flash.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-13 12:10:57 +02:00
Gerard Marull-Paretas
ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Gerard Marull-Paretas
a5a768ec0f tests: drivers: flash: use DEVICE_DT_GET
Obtain the flash device at compile time using DEVICE_DT_GET.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-31 13:55:10 +02:00
Andrzej Puzdrowski
37644f83e3 tests/drivers/flash: fix TEST_AREA_MAX
There was mistake in parentheses application in
the expression which calculates the value.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-03-24 10:14:26 +01:00
Andrzej Puzdrowski
6d57cbaef1 tests/drivers/flash: fix TEST_AREA_MAX calculation
The `size` property is expressed in `bits` unit.
The value should be calculated as bits to bytes conversion.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-03-23 15:05:24 -04:00
Andrzej Puzdrowski
be3186d39c tests/drivers/flash: fix testcase.yaml
Fixed indentation which cause the testcase.yaml
parsing failure.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-03-23 12:19:52 -04:00
Andrzej Puzdrowski
b5b05bc9b1 tests/driver/flash: overlay for MX25L51245G
Added overlay with DTS of MX25L51245G qspi flash
memory. DTS configures qspi clock to 2 MHz which is supported
by nRF52840.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-03-23 16:02:49 +01:00
Håkon Øye Amundsen
7aeef175e8 dts: nrf_qspi_nor: add option for specifying size in bytes
If a user has a 1GB external flash it is currently not possible
to configure this through DTS. To allow for such a configuration
we add an option which specifies the size in bytes not bits.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2022-03-23 12:48:08 +01:00
Nazar Kazakov
f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Hake Huang
f5864b50ff test: flash: add rt685 support for flash driver test
enable flash test for rt685

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-03-07 09:46:26 -06:00