Commit graph

41176 commits

Author SHA1 Message Date
Piotr Mienkowski
ebc5bc62b0 samples: blinky: update to use new GPIO API
Update gpio_pin_configure() to take into account GPIO flags defined by
the devicetree.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
30a97ce28e drivers: gpio_mcux: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on frdm_k64f board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
ff90b2c1d6 drivers: gpio_nrfx: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on nrf52840_pca10056 board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
39effb4397 drivers: gpio_sam: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on sam_e70_xplained board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
1fdc3bed14 drivers: gpio_gecko: update to use new GPIO API
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.

Tested on efr32_slwstk6061a board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
7f57737319 tests: add gpio_api_1pin testcase
gpio_api_1pin testcase verifies following new GPIO API functionality:
- pin active level flags
- input/output configuration flags
- pin drive flags
- gpio_port_*, gpio_pin_* functions
- pin interrupts

The test is using only 1 GPIO pin (defined in DTS as LED0) and relies on
the ability of the driver to configure pin simultanously as in/out.
Drivers that do not allow to configure pins in in/out mode should still
pass the test, however, most of the testcases will be skipped.

The test does not require any modifications to board hardware.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Peter Bigot
48b674b570 gpio: use named types to distinguish pin sets from pin values
Both pin sets and values encoding pin values are ultimately represented
by 32-bit unsigned integers. Provide typedefs that make the role of a
parameter explicit.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
33193a57eb gpio: add gpio_pin_interrupt_configure function
This commit moves interrupt configuration for a single pin from
gpio_pin_configure to gpio_pin_interrupt_configure function.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
d6191b5781 gpio: add new functions to set/get pin/port values
This commit adds following functions which work with pin logical levels
(take into account GPIO_ACTIVE_LOW flag):
- gpio_port_get, gpio_port_set_masked, gpio_port_set_bits,
  gpio_port_clear_bits, gpio_port_set_clr_bits
- gpio_pin_get, gpio_pin_set
Functions which work with pin physical levels:
- gpio_port_get_raw, gpio_port_set_masked_raw, gpio_port_set_bits_raw,
  gpio_port_clear_bits_raw, gpio_port_set_clr_bits_raw
- gpio_pin_get_raw, gpio_pin_set_raw
As well as functions:
- gpio_port_toggle_bits, gpio_pin_toggle_bits

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski
af972c2c47 api: gpio: Align GPIO dt-bindings flags with Linux DTS
This commit makes following changes to GPIO dt-bindings flags:
- Added GPIO_ACTIVE_LOW, GPIO_ACTIVE_HIGH to indicate pin active state.
- Added GPIO_OPEN_DRAIN, GPIO_OPEN_SOURCE to configure single ended pin
  driving mode.
- Added GPIO_PULL_UP, GPIO_PULL_DOWN flags.
- GPIO_INPUT, GPIO_OUTPUT to configure pin as input or output.
- Added GPIO_OUTPUT_LOW, GPIO_OUTPUT_HIGH flags to initialize output
  in low or high state.
- reworked GPIO_INT_* flags to configure pin interrupts.
- following flags were deprecated: GPIO_DIR_*, GPIO_DS_DISCONNECT_*,
  GPIO_PUD_*, GPIO_INT_ACTIVE_*, GPIO_INT_DOUBLE_EDGE, GPIO_POL_*.

To be aligned with Linux DTS standard any GPIO flags that should not be
used in DTS files are moved from include/dt-bindings/gpio/gpio.h file to
include/drivers/gpio.h with an exception of several old flags which
removal would cause DTS compilation errors. Those remaining old flags
will be removed from include/dt-bindings/gpio/gpio.h at a later stage.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Vinayak Kariappa Chettimada
ca0e8595d9 Bluetooth: host: Added new LE Feature Support bit masks
Added new LE Feature Support bit mask as documented in
Bluetooth Spec. v5.2 Vol 6, Part B, Section 4.6 Feature
Support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-02-05 12:29:39 +02:00
Johann Fischer
7a1ab24891 usb: rework USB transfer logging
Rework USB transfer logging.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 11:28:12 +01:00
Johann Fischer
7bd0de0c61 usb: move USB transfer functions to appropriate file
Move USB transfer functions to appropriate file.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 11:28:12 +01:00
Vincent Wan
47a51d4698 samples: http_get: exclude cc32xx for sample.net.sockets.http_get.posix
Eliminates CI build warnings such as this which breaks the build:

  warning: NET_SOCKETS_POSIX_NAMES
  (defined at subsys/net/lib/sockets/Kconfig:13) was assigned the value
  'n' but got the value 'y'.

The testcase involves no offloading, which means it does not apply to
cc32xx.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 10:41:08 +02:00
Vincent Wan
801077f03e samples: http_get: fix build warnings on cc32xx
This PR eliminates the Kconfig warnings seen in build by setting the
options to the appropriate values for cc32xx platforms. They were
causing CI failures.

Fixes #22388

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 10:41:08 +02:00
Jukka Rissanen
529195e276 samples: net: modem: Remove extra DTS setting from cmake
The setting was commented anyway, so removing it for now.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-05 10:19:15 +02:00
Jukka Rissanen
7b22f683d0 samples: net: modem: Fix the name of the app
The name of the application was wrong.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-05 10:19:15 +02:00
Jukka Rissanen
1474b4ea14 drivers: modem: gsm: Use modem log level instead of ppp
Use the same log level as the other modems.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-05 10:19:15 +02:00
Vinayak Kariappa Chettimada
3e8b4918f3 Bluetooth: Add HCI Error codes defined in BT 5.2 Spec.
Add missing and new HCI Error code values as defined in
Bluetooth Core Specification v5.2.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-02-05 09:11:57 +02:00
Gerson Fernando Budke
4fea711f5e west.yml: Enable missing tests for SAMV71
Added 'adc' and 'usb_device' missing tests for SAMV71 platform.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 17:55:22 -05:00
Gerson Fernando Budke
c6d3d81acb CODEOWNERS: add owner for the same4 platform
Add recent collaborator as codeowner.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 17:51:41 -05:00
Gerson Fernando Budke
c6a8ca3935 boards: arm: Add sam4e_xpro board
Add sam4e_xpro board files. This enable use of Atmel sam4e SoC.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 17:51:41 -05:00
Gerson Fernando Budke
4a5de7bb87 soc: arm: atmel: Add sam4e mcu
Add sam4e related soc files.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 17:51:41 -05:00
Gerson Fernando Budke
527ebe131d dts: arm: atmel: Add sam4e device tree
Add device tree for Atmel sam4e SoC

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 17:51:41 -05:00
Andy Ross
5737b5c843 kernel/sched: Re-add IPI calls on k_wakeup() and k_thread_priority_set()
These got dropped by an earlier patch, but are required on SMP systems
so synchronously notify other CPUs of changed scheduler state.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-02-04 17:50:11 -05:00
Andy Ross
c44d566aee kernel/sched: Re-fix SMP wait-for-switch on interrupt exit
This got clobbered by commit adac4cbafa in what I think was a rebase
mistake.  Without it, on SMP systems it's possible to select a new
_current thread and try to return into it before another CPU has
actually finished switching away from it.

Interestingly: the frequency with which this bug got caught once it
was reintroduced was much, much higher than it was when it was fixed
the first time due to the instruction pointer poisoning introduced in
the interrim.  Incompletely saved threads now have deliberately broken
state when assertions are enabled and will panic synchronously.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-02-04 17:50:11 -05:00
Kumar Gala
6d1a32a60d drivers: dma: stm32: Fix compiler warning
When building the i2s tests on 96b_argonkey we get the following
warnings:

drivers/dma/dma_stm32.c: In function 'dma_stm32_configure':
drivers/dma/dma_stm32.c:181:2: error: 'periph_addr_adj' may be used
  uninitialized in this function [-Werror=maybe-uninitialized]
  181 |  switch (increment) {
      |  ^~~~~~
drivers/dma/dma_stm32.c:161:2: error: 'memory_addr_adj' may be used
   uninitialized in this function [-Werror=maybe-uninitialized]
  161 |  switch (increment) {
      |  ^~~~~~

Fix by initialzing periph_addr_adj and memory_addr_adj to 0.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-04 15:49:48 -06:00
Carles Cufi
1a37baf24a drivers: ieee802154: rf2xx: Enable sub-GHz L2 conditionally
Enable the sub-GHz L2 only if the main L2 is enabled too.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-04 15:49:35 -06:00
Carles Cufi
afd1db6c9a boards: arm: atsamr21_xpro: Fix default configuration
This board enabled the IEEE802154_RF2XX driver unconditionally. Instead
make it depend on the IEEE802154 subsystem being enabled.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-04 15:49:35 -06:00
Carles Cufi
6048d554c9 boards: arm: degu_evk: Fix default configuration
Move conditionals that depend on USB to Kconfig.defconfig so that unmet
dependencies don't issue a warning.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-04 14:57:34 -06:00
Gerson Fernando Budke
f21aaeffaa soc: atmel: sam: Add spi pinmap
This add SPI pinmap definitions to spi0/1 for SAMV71 series.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 14:55:45 -05:00
Gerson Fernando Budke
b1b60ac1d8 drivers: spi: sam: Add support to samv71 soc
Add depends on SOC_SERIES_SAMV71 to enable spi driver for samv71 soc.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 14:55:45 -05:00
Gerson Fernando Budke
ff7f71b8e0 boards: arm: Fix sam_e70_xplained spi conf warning
The symbol SPI_SAME70_PORT_0_PIN_CS3 was defined without a type.
A non-whitelisted Kconfig warning is generated which results on a
configuration error. This associate the bool type to symbol.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 14:55:45 -05:00
Gerson Fernando Budke
7422cff736 drivers: spi: sam: Enable generic config
The current sam spi driver uses soc dependent name which duplicate
configuration to enable other platforms. This refactor current
definitions to a generic way to reuse symbols by multi soc definitions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 14:55:45 -05:00
Gerson Fernando Budke
17ccd9ee1b drivers: usb: sam: Add support to samv71 soc
Add depends on SOC_SERIES_SAMV71 to enable usb driver for samv71 soc.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 14:02:59 -05:00
Gerson Fernando Budke
62cda9532c tests: drivers: adc: Add support to samv71 soc
Add sam_v71_xult board conf to enable adc driver tests for samv71 soc.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 14:01:55 -05:00
Kumar Gala
c8696293a9 libc: fix build issue with posix fs APIs on xtensa
On xtensa we always need to implement the reentrant fs syscall
functions.  So remove the #ifndef CONFIG_POSIX_API protection around
them and add needed externs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-04 20:59:52 +02:00
Ismael Fillonneau
84a0b32210 drivers: spi: nrfx: factorise spi_context_lock()
spi_context_lock() & spi_context_release() are called in transceive()
function for a better readability.

Signed-off-by: Ismael Fillonneau <ismael.fillonneau@stimio.fr>
2020-02-04 20:58:05 +02:00
Gerson Fernando Budke
4a1bb71694 drivers: gpio: Add samv71 defines
Enable samv71 MCU gpio specifics.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 13:56:42 -05:00
Morten Priess
c1cb5ea540 Bluetooth: controller: Remove compiler specific warning
Some compilers can't resolve the conditional if/else/else construction
in ull_conn event_len_prep function, and fail with an 'uninitialized
variables' error. The change has no functional impact.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2020-02-04 18:11:18 +01:00
Jim Shu
baa72d8c32 riscv_machine_timer: optimize MTIME/MTIMECMP registers access in riscv64
riscv64 CPUs can access full 64-bit memory-mapped register by a single
instruction, so we can directly access these registers.

Signed-off-by: Jim Shu <cwshu@andestech.com>
2020-02-04 17:42:48 +02:00
Emil Obalski
d290dccfec usb: audio: Fixed switching to alternate interface
For USB audio class interface may have alternate interfaces.
Those alternates may have different endpoint configurations.

When Standard Request SET_INTERFACE is served it choses between
alternate interfaces and configuring associated endpoints.

When switching between alternate interfaces, endpoints
associated with them must be disabled/enabled accordingly.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-02-04 17:37:06 +02:00
Gerson Fernando Budke
e6ba235376 CODEOWNERS: add owner for the samv71 platform
Add recent collaborator as codeowner.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 08:56:19 -06:00
Gerson Fernando Budke
d70ad947db boards: arm: Add sam_v71_xult board
Add sam_v71_xult board files. This enable use of Atmel samv71 SoC.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 08:56:19 -06:00
Gerson Fernando Budke
9e52789054 soc: arm: atmel: Add samv71 mcu
Add samv71 related soc files.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 08:56:19 -06:00
Gerson Fernando Budke
47c034e4d9 dts: arm: atmel: Add samv71 device tree
Add device tree for Atmel samv71 SoC.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 08:56:19 -06:00
Gerson Fernando Budke
e937ef652b west.yml: update hal_atmel for SAM4E/SAMV71
Update hal_atmel to include vendor files for SAM4E and SAMV71 series.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-04 08:56:19 -06:00
Martí Bolívar
54ddd514ae scripts: grutils: tweak sort keys to group siblings
Change the key function used to sort nodes so that unit addresses, if
present, break ties between sibling nodes. This orders siblings in
increasing order by unit-address in any gen_defines output that is
sorted by ordinal.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-04 07:28:45 -06:00
Martí Bolívar
d406439570 gen_defines: don't emit comments with "# " lines
If the line is empty, just emit a single "#\n" instead of "# \n".

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-04 07:28:45 -06:00
Martí Bolívar
c63069489c gen_defines: emit output for all nodes in dependency order
This makes the results easier to read, since node output appears in
the same order as the top level comment summarizing the tree.

Reorganize how flash partitions are emitted so they also appear in
dependency order, allowing us to extend the comment at the top of the
file to say that nodes are emitted in that order, along with other
useful information.

Print comments even for nodes that are disabled or have no binding,
to make it clearer that the script considered them and decided not to
output anything for them.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-04 07:28:45 -06:00