Commit Graph

1236 Commits

Author SHA1 Message Date
Flavio Ceolin 6451626ce7 pm: Use pm_device_action_run instead of state_set
Since drivers implement a callback based on action and not the state,
we should be using the API based on the action instead of the one based
on the state.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-24 14:21:50 -05:00
Tilmann Unte a9ba637ac9 tests: drivers: pwm: stm32 board for loopback test
Add overlay file for disco_l475_iot1 board to pwm_loopback test.

The file is based on the existing overlays for twr_ke18f and frdm_k64f.

The new configuration uses both a 16-Bit timer with active prescaler
as well as a 32-Bit timer with deactivated prescaler for coverage.

It is assumed that other STM32 boards will behave like the
disco_l475_iot1. Only this board was available for testing.

Signed-off-by: Tilmann Unte <unte@es-augsburg.de>
2021-11-22 22:24:45 -05:00
Gerard Marull-Paretas 1123b80aee tests: drivers: pinctrl: gd32: add DT AFIO parse test
Add a test to check that DT information for the AFIO model is extracted
correctly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Gerard Marull-Paretas f5ed5e6d0f tests: drivers: pinctrl: gd32: add DT AF parse test
Add a test to check that DT information for AF model is extracted
correctly.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-11-22 16:30:28 -05:00
Wealian Liao eb5f711b7b test: driver: buildall: Add NCT38XX gpio
Add support NCT38XX I2C-based GPIO in build all test.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2021-11-20 08:00:38 -05:00
Johann Fischer c77903996b tests: remove usage of CONFIG_USB_UART_CONSOLE
Remove option CONFIG_USB_UART_CONSOLE where it has no influence
or enable CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR without taking
a detour through CONFIG_USB_UART_CONSOLE.

Check the compatibility of chosen property instead
of usage of CONFIG_USB_UART_CONSOLE option.
Align how to wait for the readiness of CDC ACM UART.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-18 14:29:18 +01:00
Thomas Stranger 9e852644a8 tests: drivers: flash: change integration_platforms
drivers.flash.nrf_qspi_nor and drivers.flash.soc_flash_nrf:
keep nrf52840dk_nrf52840 as integration_platform

drivers.flash.default:
Use mimxrt1060_evk instead as integration_platform,
this is the only platform allowed.

drivers.flash.stm32:
Add a bunch of boards as integration_platforms for
this test configuration.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-11-17 11:06:59 -05:00
Alexandre Bourdiol 022bb25691 tests: drivers: move "st,prescaler" to timers instead of pwm
Prescaler was misplaced in pwm binding, instead of timers binding.
For example, TIM6/TIM7 doesn't have PWM capability,
but have a prescaler.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-11-16 09:55:30 -06:00
Francois Ramu eeb6921f34 tests: spi: spi loopback test running on the stm32f767zi nucleo
Add support of the tests/drivers/spi/spi_loopabck
with dma (V1).
Connect MISO pin (D12) to MOSI (D11) pin on the board
to pass the test.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-11-16 10:12:39 -05:00
Francois Ramu dfc6611a31 tests: spi: loopback testing with NOCACHE MEMORY buffers for DMA
This patch is defining Tx buffers in NON CACHE memory for using
with DMA transfers. This requires the CONFIG_NOCACHE_MEMORY=y
flag when mcu is using CACHE.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-11-16 10:12:39 -05:00
Bartosz Bilas 203b474c4b tests: spi_loopback: enable GPIO driver for cy8ckit_062_ble_m0 board
Enable GPIO driver which is needed to handle CS GPIOS in SPI driver.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2021-11-11 07:25:45 -05:00
Bartosz Bilas 587d207244 tests: spi_loopback: enable GPIO driver for sam_v71* boards
Enable GPIO driver which is needed to handle CS GPIOS in SPI driver.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2021-11-11 07:25:45 -05:00
Francois Ramu eac10ef384 tests: drivers: adc testing the adc_api on stm32u585 disco board
This PR configures the test case to run the adc_api on the
b_u585i_iot02a disco board from STMicroelectonics.
Channel 15 is choosen

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-11-09 15:59:23 -06:00
Henrik Brix Andersen 5bc0451f72 drivers: can: remove DT_CHOSEN_ZEPHYR_CANBUS_LABEL macro
Remove the DT_CHOSEN_ZEPHYR_CANBUS_LABEL macro and replace it with
DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)) were possible.

Where both devicetree CAN controllers and Kconfig specified CAN loopback
controllers are supported, the macro is replaced with
DT_LABEL(DT_CHOSEN(zephyr_canbus)) for now.

This is the first pass for removing the requirement for devicetree
labels for CAN controllers.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-11-09 11:19:50 +01:00
Henrik Brix Andersen c817a09b0a canbus: rename zephyr,can-primary chosen property to zephyr,canbus
Rename the Zephyr chosen property for specifying the default CAN bus
controller from "zephyr,can-primary" to "zephyr,canbus".

The "zephyr,can-primary" property name was selected in antipation of
adding support for redundant CAN networks, which we have yet to
add. Meanwhile, the "primary" term causes confusion for non-redundant
CAN bus configurations (and the "can" term doesn't match the name of the
Zephyr CAN bus subsystem).

The CAN in Automation (CiA) 302-6, which deals with CANopen network
redundancy, uses the terms "default interface" and "redundant
interface". If/when we add support for redundant CAN networks, the
"zephyr,canbus" chosen property can be supplemented with a
"zephyr,canbus-redundant" chosen property.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-11-07 09:05:39 -05:00
Maureen Helm 32b4950c61 drivers: eeprom: Refactor drivers to use shared init priority
Refactors all of the EEPROM drivers to use a shared driver class
initialization priority configuration, CONFIG_EEPROM_INIT_PRIORITY, to
allow configuring EEPROM drivers separately from other devices. This is
similar to other driver classes like I2C and SPI.

The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEVICE to preserve the
existing default initialization priority for most drivers. The
exceptions are at2x and emul drivers which have dependencies on SPI,
I2C, or flash drivers and must therefore initialize later than the
default device priority.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-11-04 07:33:01 -04:00
Tilmann Unte 471622a9c2 test: drivers: pwm: extends pwm_loopback test
Adds a new zassert to check whether PWM capture has previously been
enabled and correctly returns -EBUSY on a second call.
While working on #39694 this was found to be a missing test case.
The new test case has been verified against the suggested changes of
that PR.

Signed-off-by: Tilmann Unte <unte@es-augsburg.de>
2021-11-04 07:20:10 -04:00
Daniel DeGrasse 7cd8c06bb3 boards: mimxrt1160: Enable watchdog timer on RT1160
Enable watchdog timer on RT1160 evk. This was tested using
the watchdog timer api test (tests/drivers/watchdog/wdt_basic_api)

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-03 16:18:25 -04:00
Dawid Niedzwiecki dc8d301fc9 i2c: tests: update i2c_api test
Add testing of the new i2c_get_config function to the i2c_api test.

Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
2021-11-02 16:46:33 +01:00
Dawid Niedzwiecki 65277d4770 i2c: emul: Add get_config function
Add get_config function to I2C emulator.

Also update tests using I2C emulator to use i2c_get_config.

Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
2021-11-02 16:46:33 +01:00
Krzysztof Chruscinski 97007abf65 tests: drivers: watchdog: Add counter watchdog to test
Added support for counter watchdog device in wdt_basic_api.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-11-02 13:22:58 +01:00
Felipe Neves 0a0fed7879 drivers: spi: esp32: add esp32c3 support
to the esp32 spi unified driver

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-11-01 21:47:26 -04:00
Mahesh Mahadevan 131f04c32a tests: drivers: pwm: pwm_api: add support of LPCXpresso55s69
Add support for NXP LPCXpresso55s69 board

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-11-01 11:14:29 -04:00
Henrik Brix Andersen 265cdf8dc6 cmake: use find_package() instead of literal include in tests and samples
Convert remaining tests and samples to using find_package() instead of
literally including the CMake boilerplate code.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-11-01 10:33:09 -04:00
Jamie McCrae 9c5a534461 boards: arm: bt610: Rename from bt6x0
The BT6x0 board configuration is only valid for the BT610 device,
therefore rename the boards file to BT610

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-10-28 13:53:21 -04:00
Daniel DeGrasse 813a74d415 boards: mimxrt1020_evk: Enable ADC on RT1020 EVK
Enables ADC1 on the RT1020 evaluation board. Channels 10 and 11 of this
ADC are exposed as pins 1 and 2 of J18 on the evk.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Daniel DeGrasse ac174d3075 boards: mimxrt1015_evk: Enable ADC on RT1015
Enables ADC on RT1015 evaluation board. Channels 1 and 13 are exposed as
pins 2 and 1 of J18 on the EVK.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Daniel DeGrasse 4e6ac9324b boards: mimxrt1010_evk: Added ADC support to RT1010
Added ADC support to RT1010 evaluation board. ADC channels 1 and 2 are
exposed as pins 10 and 12 of J26.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Daniel DeGrasse b0d613d9ba boards: mimxrt1024_evk: Add ADC support to RT1024
Adds ADC support to RT1024 EVK. ADC channels 10 and 11 are enabled as
pins 2 and 4 on J18 of the evaluation board

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Daniel DeGrasse 19983e605a boards: mimxrt1060_evk: Enable ADC on RT1060
Enables the ADC on the RT1060 evaluation board. Channels 0 and 15 of
ADC1 are available on pins 1 and 0 of J23, respectively.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Daniel DeGrasse 478d6a45ee boards: mixmrt1064_evk: Enable ADC on RT1064 EVK
Enables ADC inputs 0 and 15 on the RT1064

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Radoslaw Koppel d1a93c1426 drivers: sensor: Const sensor trigger data in trigger handler
This commit adds const modifier in second argument for
sensor trigger handler.
There is no reason to modify this data and this change
would allow to store trigger configuration also in FLASH.

Fixes: #38929

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2021-10-27 15:09:35 -04:00
Maureen Helm fc9347cf52 boards: arm: Configure DAC driver on bl5340_dvk
Moves DAC driver configuration defaults from the application level to
the board level for the bl5340_dvk board.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-27 10:58:33 +02:00
Maureen Helm 1d7d294a58 boards: arm: Configure DAC on bl654_dvk
Moves DAC dts node and driver configuration defaults from the
application level to the board level for the bl654_dvk board.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-27 10:58:33 +02:00
Maureen Helm 96c7875f40 boards: arm: Configure DAC on bl653_dvk
Moves DAC dts node and driver configuration defaults from the
application level to the board level for the bl653_dvk board.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-27 10:58:33 +02:00
Maureen Helm 192d710c45 boards: arm: Configure DAC on bl652_dvk
Moves DAC dts node and driver configuration defaults from the
application level to the board level for the bl652_dvk board.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-27 10:58:33 +02:00
Maureen Helm b88111bcf0 tests: build_all: Add device pm configuration for sensor drivers
Adds another test configuration to ensure we build sensor drivers with
device power management enabled, in addition to the existing test that
builds sensor drivers with device power management disabled.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-26 20:51:13 -04:00
Henrik Brix Andersen 770694f0f1 tests: drivers: entropy: enable neorv32 trng for testing
Enable the NEORV32 True Random Number Generator (TRNG) device for
testing.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-10-26 17:53:15 -04:00
Gerard Marull-Paretas a578bb70b6 tests: drivers: pinctrl: add tests for API
Add a set of tests to check the API behavior. The API tests can only run
on a platform that does not have an actual pinctrl driver, e.g.
native_posix. The test itself implements a pinctrl mock driver and
provides the required "pinctrl_soc.h" header with required types/macros.
The implementation is used in the tests to verify the behavior of the
API or Devicetree macros.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-10-25 15:26:47 -05:00
Francois Ramu 0162f4c67a tests: drivers: dac test running on the b_u585i_iot02a board
This commit enables target board to run the dac_api
testcase on the b_u585i_iot02a board
DAC 1 channel 1 is used.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-10-23 21:18:51 -04:00
Maureen Helm 165963c115 drivers: counter: Refactor drivers to use shared init priority
Refactors all of the counter drivers to use a shared driver class
initialization priority configuration, CONFIG_COUNTER_INIT_PRIORITY, to
allow configuring counter drivers separately from other devices. This is
similar to other driver classes like I2C and SPI.

The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEVICE to preserve the
existing default initialization priority for most drivers. The
exceptions are the maxim_ds3231 and mcp7940n drivers which have a
dependency on a SPI driver and must therefore initialize later than the
default device priority.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-23 20:44:49 -04:00
Andrei Auchynnikau 822f2c3cb4 boards: add adc support to the mimxrt1050 board
add adc to board dts file,
update yaml files and documentation,
add adc 1 channel pins 1 and 15 to the pinmux file,
add overlay file to the board adc sample,
add board to the adc test file and

Signed-off-by: Andrei Auchynnikau <ovchinnikov@strim-tech.com>
2021-10-22 15:43:36 -05:00
Henrik Brix Andersen 3091bddafa tests: drivers: gpio: 1pin: exclude neorv32
The GPIO block of the NEORV32 contains fully independent inputs and
outputs (inputN is fully independent of outputN).

This scenario is not handled by the 1pin GPIO test case, so exclude the
neorv32 for now.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-10-15 09:46:53 -04:00
Henrik Brix Andersen 296ba9a7d0 tests: drivers: gpio: basic: add neorv32 test configuration
Add basic GPIO API test configuration for the NEORV32.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-10-15 09:46:53 -04:00
Daniel DeGrasse b18eb9569c tests: ethernet: Disable ethernet build test for RT10xx platforms
RT10xx platforms will fail to build with SPI and Ethernet enabled due to
a pin conflict. Exclude them from the ethernet build test as it enables
SPI and will fail.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-13 10:12:25 -04:00
Daniel DeGrasse 430224eacb boards: mimxrt1020_evk: Added support for SPI on RT1020
Adds support for LPSPI1 on RT1020. This peripheral is exposed on J19, as
pins 3, 4, 5, and 6

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-13 10:12:25 -04:00
Daniel DeGrasse ab9f95e92b boards: mimxrt1010_evk: Add SPI support for RT1010
Adds SPI support on LPSPI1 to the RT1010. LPSPI1 is available on pins
6, 8, 10, and 12 of J57 on the evaluation board

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-13 10:12:25 -04:00
Daniel DeGrasse 97b138e8c9 boards: mimxrt1015_evk: Enable SPI on RT1015
This commit enables the LPSPI1 peripheral on the RT1015 EVK. LPSPI pins
are not populated by default, but headers can be added to J19 on the EVK
to access these signals

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-13 10:12:25 -04:00
Daniel DeGrasse a474066288 boards: mimxrt1024_evk: Add SPI support
Add support for LPSPI to mimxrt1024_evk. LPSPI1 is exposed on pins
6,8,10, and 12 of J19 of the evaluation board

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-13 10:12:25 -04:00
Daniel DeGrasse da57f024da boards: mimxrt1060_evk: Added SPI support for RT1060
SPI support is available on LPSPI1 and LPSPI3. Both of these require
board modifications to expose headers. LPSPI1 is used for testing,
and requires that the board have solder jumpers R278, R279, R280,
and R281 bridged.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-13 10:12:25 -04:00