Commit graph

9552 commits

Author SHA1 Message Date
Gerard Marull-Paretas 4d32558038 drivers: display: ili9xxx: use spi_dt_spec
Use the recently introduced struct spi_dt_spec to store SPI information
and operate with it.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-07-14 13:19:32 -05:00
Gerard Marull-Paretas 51e53ee73f drivers: display: ili9xxx: use gpio_dt_spec
Use the recently introduced struct gpio_dt_spec to store GPIO
information and operate with them.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-07-14 13:19:32 -05:00
Johann Fischer 0500ec214c drivers: usb_dc_mcux_ehci: use K_NO_WAIT in k_heap_alloc()
This is called in ISR context and timeout must be set
to K_NO_WAIT.

Reported-by: Pieter De Gendt <pieter.degendt@basalte.be>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-07-14 13:05:18 -05:00
Johann Fischer 8eeec634ea drivers: usb_dc_mcux_ehci: fix style
Fix style, two lines are indented too far.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-07-14 13:05:18 -05:00
Thomas Stranger 94f7ed356f drivers: serial: add a dummy driver for vnd,serial
This commit adds a serial dummy driver compatible to vnd,serial.
This is needed that devices can access the uart device in tests
like tests/drivers/build_all/... .

Add myself as codeowner to avoid complicance check failure.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-14 11:10:08 -05:00
Tim Lin abe27c5bca ITE: driver/i2c: add I2C recovery function
Use GPIO output high and low to simulate I2C start and stop
conditions to restore i2c to normal.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2021-07-14 07:32:16 -04:00
Tim Lin 8fdcc11d6b ITE: drivers/i2c: create pinmux phandle to the I2C driver node
Create the pinmux phandle to the I2C driver node in the
devicetree. When the pinmux_pin_set function in
i2c_it8xxx2_init can refer to the setting of this phandle.
It is more flexible to use.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2021-07-14 07:32:16 -04:00
Rup Gajurel 113413ad43 drivers: ethernet: stm32: add support for disabling auto-negotiation
drivers: support disabling auto-negotiation for stm32 eth drivers

Signed-off-by: Rup Gajurel <rup@fb.com>
2021-07-14 07:28:57 -04:00
Gerson Fernando Budke 0ff3616bdf drivers: usb: device: Rename usb_dc_sam to usb_dc_sam_usbhs
The SoC driver name is 'USB High-Speed Interface (USBHS)'. This rename
from usb_dc_sam to usb_dc_sam_usbhs allowing add others SoC drivers
like 'USB Device Port (UDP)' that is found at SAM4S/E variations.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-07-14 07:23:38 -04:00
Dino Li 7d5411d6e0 soc: it8xxx2: introduce SOC_IT8XXX2_PLL_FLASH_48M option
Enable SOC_IT8XXX2_PLL_FLASH_48M at default to reduce latency of
fetching code from flash.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2021-07-13 09:44:29 -04:00
Watson Zeng 1103402e90 driver: gpio: add initial support for synopsys creg gpio
Add single-register MMIO GPIO driver for complex cases where
only several fields in register belong to GPIO lines and each GPIO
line owns a field with different length and on/off value.

Such CREG GPIOs are used in Synopsys em_starterkit and HSDK boards.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-07-13 09:42:59 -04:00
Aymeric Aillet 54c481980e drivers: uart: Add "Interrupt driven" to R-Car
This commit add the support of "Interrupt driven UART"
to the R-Car UART driver and enable it in the related
Kconfig.

The driver is supporting nearly all the methods that are
described in the "Interrupt driven UART" part of the
uart_driver_api.

This new version of the driver has been tested on
H3ULCB board by running "uart_basic_api" test suite.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2021-07-13 09:42:22 -04:00
Thomas Stranger a587c25156 drivers: entropy: add support for stm32wl and stm32g0
This commit adds entropy support for stm32wl and stm32g0.

Pll is used as clock source and has to be enabled,
other clock sources are not supported at the moment.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-13 09:37:48 -04:00
Thomas Stranger 7422ce6265 drivers/clock_control: stm32wl set cpu2 prescaler only for STM32WL5X
To support single core stm32wlex series, cpu2 prescaler is set
only on dual core soc variants.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-13 09:37:29 -04:00
Gerard Marull-Paretas 26ad8376bd pm: remove callback from control function
The callback is not used anymore, so just delete it from the pm_control
callback signature.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-13 09:36:45 -04:00
Gerard Marull-Paretas 217e610d8f pm: remove redundant callback usage
the device PM callback is not used anymore by the device PM subsystem,
so remove it from all drivers/tests using it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-13 09:36:45 -04:00
Huifeng Zhang 7bf6d88029 driver: pm_cpu_ops: change PM_CPU_OPS_PSCI's dependency
Armv8-A and Armv8-R both support PSCI. So PM_CPU_OPS_PSCI's
dependency should be "ARM64" rather than "ARMV8-A".

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2021-07-13 09:30:29 -04:00
Johan Hedberg b10287cd69 drivers: edac: Fix PCIe Kconfig dependency
It's not possible to build the IBECC driver without PCIe support.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2021-07-12 20:02:00 -04:00
Gerard Marull-Paretas 165ae60e40 drivers: pinmux: stm32: fix name clashes with G4 series
There is a name clash when using G4 series LL TIM driver depending on
the inclusion order of the LL TIM and pinmux headers. If the LL headers
are included after pinmux is included, AF1 and AF2 definitions used by
pinmux clash with the AF1 and AF2 TIMx register names.

In order to solve this problem with minimum impact, the following has
been done:

1. Prefix the AFx and ANALOG definitions with STM32
2. In order to avoid changing all *-pinctrl.dtsi files, the STM32_PINMUX
   macro contatenates STM32_ with the provided mode.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-07-12 16:03:18 -05:00
Jun Lin 1974ea97a4 driver: clock: npcx: add a option to generate LFCLK via XTSOC
This commit adds a new Kconfig option CLOCK_CONTROL_NPCX_EXTERNAL_SRC.
With this option enabled, the internal 32.768 KHz clock (LFCLK) is
generated by the on-chip Crystal Oscillator (XTOSC). Otherwise, the
LFCLK is generated by the Low-Frequency Clock Generator (LFCG).

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2021-07-12 23:34:42 +03:00
Marcin Niestroj c28d372d33 drivers: pwm: nrf_sw: drop deprecated 'timer-instance' DT prop
This property has been marked as deprecated in 2.5.0 and was replaced by
'generator' property.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2021-07-12 08:20:47 -05:00
Laczen JMS 294e2df2d9 flash_page_layout: refactor flash_page_get_info
refactor flash_page_get_info to simplify and to avoid using mixing the
usage of an off_t (offs) and an uint32_t (page_index).

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2021-07-10 14:48:22 -04:00
Krishna Mohan Dani ca0b261b7f drivers/dma: STM32: Initialising DMA_InitStruct with 0 for stm32l5xx
In stm32l5xx soc, the LL_DMA_InitTypeDef has 2 more fields
(DoubleBufferMode and TargetMemInDoubleBufferMode) that must be
initialised with 0 else the configuration is wrong and gives
wrong values to the LL_DMA_Init function. Due to this the test
tests/drivers/dma/loop_transfer too would fail.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-07-10 12:43:19 -04:00
Flavio Ceolin db9756045e drivers: intc_arcv2_irq_unit: Fix arc_v2_irq_unit_device_ctrl
Fix some leftovers from the pm_device_state changes.

Fixes build problem introduced in
cc2f0e9c08.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-07-09 12:51:36 -05:00
Dino Li cb307e2c64 driver: intc: it8xxx2: wait until two equal interrupt values are read
This change ensures the CPU won't get an interrupt number which is
being generated.

it8xxx2 has a limitation for interrupt vector register.
CPU may read incorrect interrupt number in ISR.

The following is an example that got incorrect interrupt number:
1. Register IVECT = 0x10. (no interrupt pending/IVECT_OFFSET_WITH_IRQ)
2. Chip INT6 interrupt occurs (IVECT = 0x16) and jump to ISR.
3. Read interrupt vector register to determine interrupt number.
4. Higher priority interrupt occurs (for example: INT158, IVECT = 0xAE)
while the CPU is reading the interrupt vector register for EC INT6,
CPU may end up with an incorrect interrupt number between 0x16 and 0xAE.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2021-07-09 12:45:01 -05:00
Erwan Gouriou 491775549d drivers/clock_control: stm32: Fix macro to get HCLK freq
__LL_RCC_CALC_HCLK1_FREQ is only available for WL and WB series,
for other series __LL_RCC_CALC_HCLK_FREQ should be used.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-07-09 12:42:00 -05:00
Abram Early bdae64279e drivers: flash: nrf_qspi_nor: Configurable RXDELAY
The nRF QSPI has a configurable delay from the rising
clock signal to the actual sample point measured in
clock cycles. This commit exposes that delay as a DTS
parameter without modifying existing behavior.

Signed-off-by: Abram Early <abram.early@gmail.com>
2021-07-09 12:23:45 -05:00
Dominik Ermel f36569db0d drivers/flash/nrf_qspi_nor: Fix get_parameters layout dependency
The definition of qspi_flash_get_parameters, that implements
the mandatory get_parameters API call for the driver, was incorrectly
placed within block conditionally compiled when
CONFIG_FLASH_PAGE_LAYOUT is defined.
The commit fixes the issue that was causing compilation error
when the config has not been set.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-07-09 12:19:06 -05:00
Krishna Mohan Dani b09e6fb3c5 drivers/entropy: stm32: selecting the right rng clock source
This commit selects LL_RCC_RNG_CLKSOURCE_CLK48 as a clock source
to rng peripheral. LL_RCC_RNG_CLKSOURCE_CLK48 is CLK48 divided by 3.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-07-09 09:19:39 -05:00
Aurelien Jarno 0d543f1742 drivers/sensor: Add basic TI HDC20XX support
Add basic support for TI HDC20XX series (e.g. HDC2010, HDC2021, HDC2022,
HDC2080). It is able to get temperature and humidity in the default
14-bit resolution. Triggers, resolution selection, interrupt line, auto
measurement mode are currently not supported.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2021-07-09 07:48:15 -04:00
Andrei Emeltchenko f818d8770b pcie: msi: Map only actual table
Map only actual table of size n_vector * PCIE_MSIR_TABLE_ENTRY_SIZE.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-07-08 14:36:32 -04:00
Henrik Brix Andersen b7b7709eec drivers: hwinfo: add NXP MCUX RCM hwinfo driver
Add driver shim for the NXP MCUX Reset Control Module (RCM) for
determining reset cause.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-08 09:33:32 -05:00
Crist Xu c21bfdca9c driver: gpt: the gpt driver for the rt1170
reuse the gpt driver for the rt10xx, and add the related code

Signed-off-by: Crist Xu <crist.xu@nxp.com>
2021-07-07 20:59:42 -04:00
Felipe Neves 600f8c64e1 soc: riscv: esp32c3: use the new esp_rom prefix
For esp32c3 related ROM located functions instead
of esp32c3_rom.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-07-07 20:58:50 -04:00
Felipe Neves 132ab922a8 drivers: timer: esp32c3: add esp32c3 systimer driver to CODEOWNERS
Also added maintainer to the entry

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-07-07 20:58:50 -04:00
Felipe Neves 5d736766ed soc: esp32c3: added initial soc support files for esp32c3
by adding the soc specific files such: soc initialization code,
linker scripts and support for esp32c3 devkitm

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-07-07 20:58:50 -04:00
Sylvio Alves 4303cfdb3c hal: esp32: driver changes to allow HAL update
hal_espressif repository was updated from esp-idf v4.2
to esp-idf v4.3 to allow latest Espressif chips integration.
As a consequence, it added a few changes in drivers
and peripherals. To maintain bisectability, changes in this
PR cannot be split. Here are some details:

wifi: update linker script by adding libphy and new attributes.

spi: update some APIs and fixed missing wait_idle check

west.yml: esp32: update hal to new version

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-07-07 15:01:16 -04:00
Gerard Marull-Paretas cc2f0e9c08 pm: use enum for device PM states
Move all PM_DEVICE_STATE_* definitions to an enum. The
PM_DEVICE_STATE_SET and PM_DEVICE_STATE_GET definitions have been kept
out of the enum since they do not represent any state. However, their
name has not been changed since they will be removed soon.

All drivers and tests have been adjusted accordingly.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-07 14:13:12 -04:00
Marcin Niestroj 66766581c9 drivers: wifi: esp_at: notify send() caller about pending close
If stream socket is marked as pending close, make sure that send()
caller gets notified about it, so that application layer can decide to
stop trying to send anything more.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-07 08:25:34 -04:00
Marcin Niestroj 1ab0848eab drivers: wifi: esp_at: close stream socket after failure to send
So far send errors were silently ignored. This is okay for
UDP (datagram) sockets, as there is no guarantee that packets will
actually be sent successfully. In case of TCP (stream) stream sockets
however, application layer expects network stack to send requested data
as stream, without losing any part of it.

In case of send errors on stream sockets mark that socket to be closed
and stop sending any subsequent network packets, so that data stream
won't have any holes.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-07 08:25:34 -04:00
Mahesh Mahadevan c3567c6f33 tests: arch: arm_irq_vector_table: Update to run on MXRT685
Fix for Issue#35658.
Update the custom vector table to add the OS Event timer
interrupt which is used on RT685 as the kernel system timer

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-07-07 08:25:06 -04:00
Krishna Mohan Dani 4c38ca1625 drivers/flash: stm32: Gets maximum erase time from device tree
This commit removes the huge if condition section and is
replaced with DT APIs to get the maximum erase time of a
stm32 flash from dtsi.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-07-06 19:02:19 -04:00
Sidhdharth Yadav bdf425cd5c drivers: adc: Adding CONFIG_SOC_SERIES_STM32L5X in stm32l5 series
Allowing ADC to build in stm32l5 series.

Signed-off-by: Sidhdharth Yadav <sidhdharth.yadav@hcl.com>
2021-07-06 18:03:22 -04:00
Aurelien Jarno 2a96cc0347 drivers: adc: STM32: fix support for internal voltage reference source
Commit c045cbd336 added support for internal voltage reference source,
but in practice only the temp sensor is supported. Fix that.

Also change the code to keep the existing paths so that VREFINT and
TEMPSENSOR can be used at the same time.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2021-07-06 18:01:57 -04:00
Tomasz Michalec becfed481e drivers: i2c: emul: Link emulators to correct bus
Fix i2c emulated bus initialisation code to use children of specific i2c
bus DTS node instead of first i2c bus instance.

Signed-off-by: Tomasz Michalec <tm@semihalf.com>
2021-07-06 15:19:40 -05:00
Dario Binacchi c3a067e841 drivers: adc: stm32: fix f3x series
The patch fixes driver compile errors and ADC management for the f3x
series. It was developed and tested for the stm32f373 variant.

Tested-by: Dario Binacchi <dariobin@libero.it>
Signed-off-by: Dario Binacchi <dariobin@libero.it>
2021-07-06 15:08:04 -05:00
Fabio Baltieri 9c82898127 drivers: stm32_lptim_timer: add support for STM32WL series
Add the lptim1 device node definition and enable the corresponding
exti interrupt in sys_clock_driver_init().

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-07-06 09:51:22 -04:00
Anas Nashif 0898388080 Revert "drivers: ieee802154: configure IE header injection for nRF5"
This reverts commit bde592e91a.

This is causing build failures. Original PR #36008.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-07-05 18:54:35 -04:00
Tim Lin 91a6b286c9 ITE: drivers/i2c: it8xxx2: add mutex lock
Add mutex lock to prevent race conditions.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2021-07-03 08:03:10 -04:00
Jordan Yates fb76f47f86 flash: spi_nor: convert to spi_dt_spec usage
Converts the spi_nor flash driver to use `spi_dt_spec` as a
demonstration of the simplifications that the API enables.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-07-02 21:34:16 -04:00