Commit graph

41120 commits

Author SHA1 Message Date
Kumar Gala
aa63b07019 drivers: spi: spi_sam0: rework devicetree support
Rework the devicetree to utilize new DT_INST macros and extract per
instance data for clocks and dma from devicetree.  We update the
atmel,sam0-spi binding for dma to replace the rxdma and txdma
properties with proper 'dmas' property.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 09:30:16 -05:00
Kumar Gala
b8ade7856d drivers: i2c: i2c_sam0: rework devicetree support
Rework the devicetree to utilize new DT_INST macros and extract per
instance data for clocks and dma from devicetree.  We update the
atmel,sam0-i2c binding for dma to replace the dma property with
proper 'dmas' property.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 09:30:16 -05:00
Kumar Gala
dbeb3ba32e drivers: spi: spi_sam: rework device tree support
Reworked spi_sam driver to utilize new DT_INST macros as part of
this rework we also now get pin ctrl/mux configuration information
from the device tree instead of via Kconfig and defines in soc_pinmap.h

We remove defines from dts_fixup.h and soc_pinmap.h and associated
Kconfig symbols that are no longer needed due to getting all that
information from devicetree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 09:29:54 -05:00
Kumar Gala
cb8ee73692 dts: atmel sam: Add pinctrl support for SAM SPI
Add pinctl support for the SAM SPI device.  We update the SPI
binding to have pinctrl-0 bindings that are expected to have
at least phandles for MISO, MOSI, and SPCK, but might also have
various chip selects as well.

The pinctrl nodes will have an 'atmel,pins' property that describes the
GPIO port, pin and periphal configuration for that pin.

We update sam*-pinctrl.dtsi files with all the various pin ctrl
configuration operations supported by the given SoC family.  These
files are based on data extracted from the Atmel ASF HAL
(in include/sam<FAMILY>/pio/*.h).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 09:29:54 -05:00
Kumar Gala
fa6c990583 soc: arm: atmel_sam: Add helper macros to init array of pins
Added ATMEL_SAM_DT_NUM_PINS macro which will return the number of pins
to initialize for "pinctrl-0" devicetree property.

Added ATMEL_SAM_DT_PINS macro which will create an array initializer
with all the pins associated with "pinctrl-0" devicetree property.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 09:29:54 -05:00
Stephanos Ioannidis
e9e868be15 boards: arm: sam4s_xplained: Enable MPU
This commit enables the ARM memory protection unit for the SAM 4S
Xplained board, since the `CPU_HAS_ARM_MPU` is now selected by the SoC
Kconfig.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-25 04:57:15 -05:00
Stephanos Ioannidis
503e6449a5 boards: arm: sam4e_xpro: Enable MPU
This commit enables the ARM memory protection unit for the SAM 4E
Xplained Pro board, since the `CPU_HAS_ARM_MPU` is now selected by the
SoC Kconfig.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-25 04:57:15 -05:00
Anas Nashif
45a1d8aca9 kernel: rename initializers to be internal
Rename internal macros to use Z_ prefix instead of _K..

Those macros were missed when we did the global renaming activities.

Fixes #24645

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-24 22:27:08 +02:00
Martí Bolívar
11fbc0b2fa drivers: i2c: nordic: move to new DT API
Keep existing per-instance Kconfig options around.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-24 19:46:18 +02:00
Martí Bolívar
df8be2d2e0 drivers: i2c: nordic: cosmetics
Adjust whitespace.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-24 19:46:18 +02:00
Martí Bolívar
4508b6fc01 boards: nordic: add 'i2c' to supported for a couple of DKs
This ensures they get picked up by sanitycheck for build testing the
twi driver.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-24 19:46:18 +02:00
Martí Bolívar
9b85c5c699 boards: nordic: yaml cosmetics
Sort the supported lists alphabetically for some boards. I'm not
trying to do this for all boards, just some DKs I'm using for testing.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-24 19:46:18 +02:00
Martí Bolívar
eca99d810f drivers: watchdog: nordic: move to new DT API
Straightforward API conversion only.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-24 19:35:41 +02:00
Martí Bolívar
644f9ecbf0 dts: nordic: introduce wdt0 / wdt1 distinction
Add wdt0 node labels for all watchdogs. Keep the existing wdt node
labels in place for backwards compatibility.

Add a wdt1 node to the nRF5340 application core .dtsi, but leave it
disabled. Leave the wdt node's label set to "WDT" on this core for
backwards compatibility also, in case any users are getting it with a
string literal instead of asking the devicetree. This can be changed
later after this round of watchdog changes has been shaken out and
tested more.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-24 19:35:41 +02:00
Alexey Brodkin
0d5416acc4 runners: openocd: Reset target before running Elf
In case of flashing (which is typically used with OpenOCD)
we do reset of the target after programming application binary
in the non-volatile memory.

In case of Elf execution we need to reset the target before
loading Elf sections so that we might be sure our target
is in sane & expected state before we start execution.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2020-04-24 19:35:25 +02:00
Ryan Erickson
6243557e5f drivers: nrf: uarte: check if RXSTARTED before issue STOPRX
Only issue STOPRX is RX has started.
This prevents getting stuck in while loop.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-04-24 19:34:50 +02:00
Erwan Gouriou
5776c82c85 drivers/timer: stm32_lptim: Move to new DT api
Use NODELABEL macros rather than DT_INST as this driver is so far
limited to support of LPTIM1 instance.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-24 12:09:17 -05:00
Kumar Gala
50414c40f7 boards: arm: hexiwear_k64: Replace some missed old style DT macros
Replace DT_NXP_KINETIS_GPIO_GPIO_x_LABEL with
DT_LABEL(DT_NODELABEL(gpioX)).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-24 12:05:33 -05:00
Kumar Gala
7b2fde91d8 drivers: serial: uart_psoc6: Convert to new dt macros
Convert the driver to use the new dt macros.  As part of this change we
remove a bunch of defines that happened in dts_fixup.h that didn't
belong there.  Some of these should be converted to devicetree
properties at some point.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-24 10:57:33 -05:00
Martí Bolívar
be84c4ebbf drivers: pwm: nordic: move to new DT API
DT API conversion only.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-24 17:00:13 +02:00
Pawel Dunaj
ed5e247f63 drivers: gpio_nrfx: Pass only pins associated with handler
When notifying the handler that GPIO interrupt has occurred
pass only pins that are associated with this handler.

Fixes: #24634

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2020-04-24 16:56:10 +02:00
Mark Olsson
1ca4aedc35 tests: drivers: fixes for failing tests
Tests were failing as they were looking for an alias which didn't exist
Also, because some code in kscan_handlers.c wasn't compilable

Signed-off-by: Mark Olsson <mark@markolsson.se>
2020-04-24 09:49:46 -05:00
Mark Olsson
1bb8a42422 boards: Change dependency for I2C on i.mx rt boards
Changes dependency for I2C so that it's enabled if kscan is enabled.
This is to allow the kscan_ft5336 sample to run.
Note: LVGL has KSCAN as a dependency.
Applies to the mimxrt10{50,60,64}_evk boards.

Signed-off-by: Mark Olsson <mark@markolsson.se>
2020-04-24 09:49:46 -05:00
Mark Olsson
6b593a51d2 samples: drivers: kscan: Add sample for touch panel drivers
Simple sample to test touch panel drivers.
Outputs a message to the console on every touch event.

Signed-off-by: Mark Olsson <mark@markolsson.se>
2020-04-24 09:49:46 -05:00
Mark Olsson
9b3330d935 boards: Configure ft5336 touch panel on stm32f746g_disco board
Adds device tree nodes, pinmux definitions and configures Kconfig
defaults for the ft5336 touch panel driver on the
stm32f746g_disco board.

Signed-off-by: Mark Olsson <mark@markolsson.se>
2020-04-24 09:49:46 -05:00
Andy Ross
3e729b2b1c kernel/timer: Correctly clamp period argument
The period argument of a k_timer needs an offset of one tick from the
value computed in user code (because periods get reset from within the
ISR, see the comment above this code for an explanation).  When the
computed tick value was 1, it would become 0.  This is actually
perfectly correct as a k_timeout_t to be passed to z_add_timeout().

BUT: to k_timer's API, K_NO_WAIT means "never" (i.e. the same as
K_FOREVER) and not "as soon as possible", so the period timer would
not be reset.  This is sort of a wart, but it's the way the API has
been specified forever.

The upshot is that for the case of calling k_timer_start() with a
minimal period argument (i.e. one that produces "one tick"), the
period would be ignored and the timer would act like a one shot.  Fix
the clamp so it can't produce K_NO_WAIT.

This also adds a filter for absolute timeouts, which (while that's
sort of a pathological usage) were getting that one tick offset when
it wasn't appropriate.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-24 16:38:33 +02:00
Kwon Tae-young
84817f4906 drivers: pinmux: stm32l4: I2C_1, CAN pinmuxes added
Add pin configuration for I2C_1 and CAN.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-04-24 06:36:35 -05:00
Kwon Tae-young
15ed490df0 dts: arm: st: Add support for stm32l433Xb
Add support for the STM32L433Xb SoC.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-04-24 06:36:35 -05:00
Kumar Gala
25c0eac109 sys/util.h: Make IS_ENABLED work for linker scripts
Z_IS_ENABLED2 uses true and false, however when we preprocess the linker
scripts we invoke the compiler with `-x assembler-with-cpp` so
_ASMLANGUAGE ends up being defined and thus stdbool.h wouldn't convert
'true' and 'false' to '1' and '0'.

Move the include of stdbool.h outside the #ifndef _ASMLANGUAGE check so
that 'true' and 'false' get converted correctly.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-24 06:29:01 -05:00
Stephanos Ioannidis
9f9e46822a CODEOWNERS: Add CMSIS-DSP test code owner
This commit adds @stephanosio as a code owner for the CMSIS-DSP tests.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-24 06:28:36 -05:00
Stephanos Ioannidis
845d8852a5 dts: arm: atmel: samd5x: Fix CPU compatible
The SAM D5x and E5x series SoCs include the "Cortex-M4F" core, not the
FPU-less "Cortex-M4" core.

This commit fixes the incorrect CPU compatible for the SAM D5x and E5x
SoCs (note that this file is included by `same5x.dtsi`, which is used
as the base device tree header for the SAM E5x series).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-24 06:27:58 -05:00
Stephanos Ioannidis
c716ef50a6 soc: arm: same54: Add missing FPU selection
The SAM E54 series SoCs include a single-precision FPU; therefore, the
`CPU_HAS_FPU` symbol should be selected.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-24 06:27:58 -05:00
Stephanos Ioannidis
bd74021107 soc: arm: same53: Add missing FPU selection
The SAM E53 series SoCs include a single-precision FPU; therefore, the
`CPU_HAS_FPU` symbol should be selected.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-24 06:27:58 -05:00
Stephanos Ioannidis
06378ed60a soc: arm: same51: Add missing FPU selection
The SAM E51 series SoCs include a single-precision FPU; therefore, the
`CPU_HAS_FPU` symbol should be selected.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-24 06:27:58 -05:00
Stephanos Ioannidis
b22af57033 soc: arm: samd51: Add missing FPU selection
The SAM D51 series SoCs include a single-precision FPU; therefore, the
`CPU_HAS_FPU` symbol should be selected.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-24 06:27:58 -05:00
Stephanos Ioannidis
0fc63f6490 soc: arm: atmel_sam0: Add missing arch selection
The SAM D51, E51 and E53 SoC series Kconfig files were missing the
`ARM` architecture symbol selection.

This symbol must be selected at the SoC level; otherwise, build will
fail because the symbol is not selected by anything and other ARM-
specific configurations depend on it.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-24 06:27:58 -05:00
Krzysztof Chruscinski
2c54ea49f7 tests: drivers: counter: Add nrf9160_pca10090 board
Add board with nrf9160 to counter tests.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-04-24 10:17:48 +02:00
Krzysztof Chruscinski
58dcfd51ce CODEOWNERS: Adding codeowner for tests/drivers/counter
Added @nordic-krch as the codeowner.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-04-24 10:17:48 +02:00
Gerson Fernando Budke
65c9b34abf soc: arm: atmel_sam: sam4s: Enable MPU
Add missing definitions to enable MPU support.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-24 10:16:10 +02:00
Gerson Fernando Budke
adcfd09b1b soc: arm: atmel_sam: sam4e: Enable MPU/FPU
Add missing definitions to enable MPU and FPU support.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-24 10:16:10 +02:00
Brian Kubisiak
fdf22d1072 arm: stm32f0: Add STM32F030XC support.
Add initial support for the stm32f030xc series of SoCs.

Signed-off-by: Brian Kubisiak <brian@kubisiak.com>
2020-04-24 09:56:46 +02:00
Luiz Augusto von Dentz
440f647013 Bluetooth: hci_raw: Fix pushing H4 headers in bt_buf_get_rx
User of bt_buf_get_rx may attempt to push their own headers, e.g. ACL
headers, so move the H4 header logic to bt_recv after logging into the
monitor since otherwise the buffer would contain H4 headers which is
not expected by the monitor.

Fixes #24646

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-04-24 10:00:02 +03:00
Kumar Gala
8b6acb5e91 soc: arm: replace DT_CPU_CLOCK_FREQUENCY with new dt macros
Replace DT_CPU_CLOCK_FREQUENCY with a PATH based reference to cpu@0
(DT_PATH(cpus, cpu_0)) and than getting the clock_frequency property:

DT_CPU_CLOCK_FREQUENCY -> DT_PROP(DT_PATH(cpus, cpu_0), clock_frequency)

This lets us remove DT_CPU_CLOCK_FREQUENCY from dts_fixup.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 23:55:37 -05:00
Kumar Gala
5dbfbbcfa9 samples: sensor: bq274xx: Fix platform whitelist
The sensor is on the nrf9160_innblue22 not nrf9160_innblue21.  This
causes CI build failures since there is no dts node for the sensor
on the nrf9160_innblue21 board.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 18:39:20 -05:00
Kumar Gala
d4f24a1bdc boards: arm: 96b_wistrio: Convert to using DT_NODELABEL for gpio ports
Convert old DT defines of the form DT_ST_STM32_GPIO_40021400_LABEL to
DT_NODELABEL(gpioc).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 17:31:25 -05:00
Vincent Wan
0915ccca46 drivers: cc13xx_cc26xx: use DT_INST_FOREACH to reduce code duplication
Use DT_INST_FOREACH macro to combine code used for multiple instances.
Remove unnecessary Kconfig options for UART instances.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-04-23 17:29:53 -05:00
Vincent Wan
984988285b dts: bindings: cc13xx-cc26xx: add port info for uart tx and rx pins
Adding port information for uart tx and rx pins in dts, so that it can
be more systematically retrieved in the uart driver.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-04-23 17:29:53 -05:00
Vincent Wan
9d89ce1d6d drivers: cc13xx_cc26xx: Convert drivers to use more new DT_INST macros
Changing more of DT_* prefixed macros that refer to instances to use
DT_INST macros.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-04-23 17:29:53 -05:00
Kumar Gala
0e862107d3 soc: arm: silabs_exx32: DT_GPIO_GECKO_SWO_LOCATION rework
Change DT_GPIO_GECKO_SWO_LOCATION to use new DT_INST and DT_PROP macros
and remove defining it in dts_fixup.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 17:16:52 -05:00
Kumar Gala
22e65cb9ba gpio: mcux: Convert convert to DT_INST defines
Convert driver to use DT_INST_ defines.  As part of this conversion we
remove the Kconfig options for per GPIO controller enables and instead
get that information from device tree.  This means we now disable each
GPIO controller by default in the DTS and have each board dts enable the
GPIO controller ports it needs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 17:07:41 -05:00