Commit Graph

65595 Commits

Author SHA1 Message Date
Kumar Gala 01640b9cda boards: remove usage of DT_LABEL
A number of boards utilize device_get_binding(DT_LABEL(...)) to
get a gpio for some purpose.  Switch over to using DEVICE_DT_GET
and device_is_ready() instead.  This is part of the ongoing
cleanup towards phasing out usage of the "label" property in DTS.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-27 12:45:19 +02:00
Ederson de Souza b56088ba6d drivers/clock_control: Add cAVS clock driver
Simple driver that allows one to choose the clock speed of xtensa cores.
It's basically a shim layer on top of SOC level driver.
Also, a really simple test case was added, mainly to ensure things are
build and are sane.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-06-27 12:42:04 +02:00
Ederson de Souza 0ce9446978 soc/xtensa/intel_adsp: Add cAVS clock driver
Simple driver that allows one to choose the clock speed of xtensa cores.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-06-27 12:42:04 +02:00
Keith Packard 88ca3aca98 tests/kernel: Provide expected output for picolibc in printk test
Picolibc has subtly different output from the minimal libc as a result
of different handling for code built without real long long support.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-24 20:30:03 +02:00
Keith Packard d90fa562b2 lib/printk: Use picolibc's vfprintf instead of cbvprintf
When using picolibc, change vprintk to use picolibc's vfprintf instead of
cbvprintf.

Building samples/hello-world for qemu-cortex-m3.

old:

Memory region         Used Size  Region Size  %age Used
           FLASH:        9056 B       256 KB      3.45%
            SRAM:        3960 B        64 KB      6.04%
        IDT_LIST:          0 GB         2 KB      0.00%

new:

Memory region         Used Size  Region Size  %age Used
           FLASH:        7900 B       256 KB      3.01%
            SRAM:        3960 B        64 KB      6.04%
        IDT_LIST:          0 GB         2 KB      0.00%

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-24 20:30:03 +02:00
Keith Packard d465dbba6d lib/printk: Removed unused 'count' field in printk context
There's no use of the 'count' field of the context, so remove it. Because
that's the only member of struct out_context, remove the whole struct.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-24 20:30:03 +02:00
Keith Packard ecee708e4b lib/printk: Use picolibc's snprintf/vsnprintf for snprintk/vsnprintk
Replace wrapper functions that use cbprintf with direct calls to picolibc
stdio functions.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-24 20:30:03 +02:00
Benjamin Björnsson 9d1668b365 samples: sensor: lsm6dsl: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-24 20:29:54 +02:00
Benjamin Björnsson 1a0159518b drivers: sensor: lsm6dsl: Update driver to use gpio_dt_spec
Simplify driver by using gpio_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-24 20:29:54 +02:00
Benjamin Björnsson 07587e7826 drivers: sensor: lsm6dsl: Change parameters of helper functions
Change parameter list of functions for consistency with other drivers.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-24 20:29:54 +02:00
Benjamin Björnsson bae6af4acc drivers: sensor: lsm6dsl: Remove unused variable and label
Remove variable and label that are not used to remove compiler
warnings.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-24 20:29:54 +02:00
Benjamin Björnsson 20b1fdb39c drivers: sensor: lm75: Update driver to use i2c_dt_spec
Simplify driver by using i2c_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-24 20:29:46 +02:00
Robert Lubos 4ec098ac5a doc: net: Document POSIX wrappers for socket operations
Document POSIX wrappers for socket operations, by referencing a
corresponsding `zsock_*` function. The documentation will generate a
link where user can read the actual documentation on the socket
operation.

In order to include the POSIX wrappers in to the documentation however,
it's needed to add CONFIG_NET_SOCKETS_POSIX_NAMES to predefined symbol
list in zephyr.doxyfile.in.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-24 20:29:37 +02:00
Emil Gydesen 9bc71bdfb6 Bluetooth: Shell: Fix wrong channel for getting iso broadcast len
The length was taken from `iso_chan` instead of `bis_iso_chan`.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-24 20:29:28 +02:00
Carlo Caione d6df78e3b0 gen_isr_tables: Cleanup IRQ vector table generation
Under no circumstances the generated IRQ vector table can and should
contain NULL values. This is correctly enforced at generation time by
the gen_isr_tables.py script making the existence of the ISR_WRAPPER
define useless.

The enforced behaviour is:
- When the ISR software table exists defaults to _isr_wrapper
- Otherwise defaults to z_irq_spurious

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-06-24 20:29:20 +02:00
Andrzej Głąbek 800b086908 samples: code_relocation_nocopy: Update documentation
Extra steps for programming the external memory on nRF5340 DK are
no longer needed. Now west is capable of handling this itself.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-06-24 20:29:00 +02:00
Andrzej Głąbek fb3e8138a2 west_commands: nrfjprog: Add handling of data targeting the XIP region
When a hex file contains some data that needs to be programmed using
the QSPI peripheral (because it targets the XIP region), nrfjprog
needs to be provided with an option that specifies the QSPI erase
method to be used (otherwise, reprogramming will fail).
This commit adds the "--qspisectorerase" option when needed and it
also fixes the programming routine for nRF53, so that data for the
XIP region is not incorrectly interpreted as intended for the network
core.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-06-24 20:29:00 +02:00
Andrzej Głąbek 788fe5b4bf samples: code_relocation_nocopy: Fix initialization of external memory
Despite the comment it contains, the initialization procedure for
the external memory chip on nRF5340 DK does not enable the High
Performance Mode in the chip, so communication using a frequency
higher than 8 MHz fails and the sample crashes (it works only right
after programming the chip with nrfjprog, which enables the High
Performance Mode, but the chip returns to the Low Power mode after
the board is power-cycled).
This commit fixes the initialization procedure and performs some
additional clean-up.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-06-24 20:29:00 +02:00
Andrzej Głąbek e329353f21 samples: code_relocation_nocopy: Disable gap filling
... to prevent producing a huge (over 700 MB) hex file for nRF5340 DK.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-06-24 20:29:00 +02:00
Aleksandr Khromykh e552b27117 Bluetooth: Mesh: fix pb gatt fast advertising
pb gatt server starts fast advertising for the first 60 seconds.
After that, server goes into slow mode.
When pb gatt and pb adv work in parallel pd gatt changes fast to
slow modes after the first tx frame in pd adv (about 110ms)
since they both are handled in the same thread.
Actually, pb gatt never worked in fast mode
if pb adv was enabled (in most configuration cases).

Signed-off-by: Aleksandr Khromykh <Aleksandr.Khromykh@nordicsemi.no>
2022-06-24 20:26:48 +02:00
Marc Herbert f7414ab859 cmake: dts: resolve symlinks before de-duplicating DTS_ROOT
DTS directories can come from multiple places. Some places like a user's
CMakeLists.txt can preserve symbolic links. Others like
`scripts/zephyr_module.py --settings-out` resolve symbolic
links.

list(REMOVE_DUPLICATES ...) does not know anything about directories;
only about strings. To fix it the de-duplication, resolve all symbolic
links in DTS_ROOT first using file(REAL_PATH ...).

Fixes this somewhat confusing error:
```
-- Found BOARD.dts:    /home/proj/mymodule/boards/myboard/myboard.dts
devicetree error: both /home/proj/mymodule/dts/bindings/intel,stuff.yaml
             and /disk1/home/proj/mymodule/dts/bindings/intel,stuff.yaml
have 'compatible: intel,stuff'
```

Also, print `gen_defines.py` arguments in case of an error so anyone can
see what failed and not just west+CMake experts.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-06-24 20:26:02 +02:00
Aurelien Jarno 46618e4b86 boards: arm: nucleo_h7a3zi_q: add USB support
The Nucleo H7A3ZI-Q board has a micro USB connector connected to the USB
OTG HS controller. Enable it and update the documentation.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-06-24 20:25:52 +02:00
Aurelien Jarno f6adb3b38d dts: arm: st: h7: add USB OTG HS controller
Add the USB OTG HS controller to the device tree and the corresponding
FS PHY.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-06-24 20:25:52 +02:00
Aurelien Jarno b2f969e562 drivers: usb: device: stm32: only disable the ULPI clock for USB FS
On SoCs with two USB controller, Zephyr selects the FS one, and in that
case the ULPI clock needs to be disabled in sleep mode for the
controller to work.

On SoCs with a single USB HS controller, this operation is not needed.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-06-24 20:25:52 +02:00
Aurelien Jarno e19be674fc drivers: usb: device: stm32: fix disabling the ULPI clock on STM32H7X
The ULPI clock uses slightly different names on STM32H7X as those
SoC can have more than one USB controller.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-06-24 20:25:52 +02:00
Aurelien Jarno a9f044e0d2 drivers: usb: device: stm32: fix a wrong comment STM32H7X and ULPI clock
On STM32H7X SoCs, both USB controllers are HS capable, however it is not
possible to connect an ULPI PHY to the USB2 one, which limit it to FS.
Therefore the ULPI clock in sleep mode has to be disabled for USB2 in
all cases. The ULPI clock for USB1 is already disabled when needed in
the usb_dc_stm32_clock_enable() function like for other SoCs.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-06-24 20:25:52 +02:00
Aurelien Jarno 58674926a9 drivers: usb: device: stm32: do not manually enable the clock on STM32H7
Do not manually enable the USB clock on STM32H7, as it is already done
in usb_dc_stm32_clock_enable() using the values in the device tree.

This partially fixes the build for STM32H7 devices with a single USB
controller.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-06-24 20:25:52 +02:00
Aurelien Jarno 278bf9883f drivers: usb: device: stm32: do not disable ULPI clock in run mode
The ULPI clock is disabled by default in run mode, there is no need to
disable it again. It is however enabled by default in sleep/low power
mode, so it needs to be disabled.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-06-24 20:25:52 +02:00
Alexandr Kolosov fc88a2a1fe boards: riscv: tlsr9518adk80d: add IMG_BLOCK_BUF_SIZE to board defconfig
Add IMG_BLOCK_BUF_SZE config into tlsr9518adk80d_defconfig due to
limitations for buffer image writter. The buffer shall be less (multiple
of access alignment) or equal to flash page. tlsr9518adk80d boards use
external P25Q16 IC as flesh memory. Flash page size of the IC is 256
bytes. So that, it is maximum image writer buffer size for such kind of
boards.

Signed-off-by: Alexandr Kolosov <rikorsev@gmail.com>
2022-06-24 20:25:33 +02:00
Alex Kolosov ef418aab40 drivers: serial: telink_b91: fix uart unknown state after boot from mcuboot
mcuboot may use a uart as logger. After application boot from mcuboot,
uart remains in some unknown state. It could leads to some unpredictable
uart behaviour. This commit fixes the issue by resetting of uart state
at the beginning of uart init.

Signed-off-by: Alex Kolosov <rikorsev@gmail.com>
2022-06-24 20:25:33 +02:00
Alex Kolosov 1ddabc22f7 boards: riscv: tlsr9518adk80d: add new flash partition to the board dts
- Remove flash_mspi node that contains old one flash partition
- Add new partition in flash node
- Add the partition into choosen
- Add led2, led3 into aliases

Signed-off-by: Alex Kolosov <rikorsev@gmail.com>
2022-06-24 20:25:33 +02:00
Alex Kolosov 4a52bc22b6 soc: riscv: telink_b91: add dfu related configurations for b91 platform
Modify Telink b91 config files and linker script with necessary config
settings required for DFU.

Signed-off-by: Alex Kolosov <rikorsev@gmail.com>
2022-06-24 20:25:33 +02:00
Christopher Friedt 9d433c89a2 lib: posix: semaphore: use consistent timebase in sem_timedwait
In the Zephyr implementation, `sem_timedwait()` uses a
potentially wildly different timebase for comparison via
`k_uptime_get()` (uptime in ms).

The standard specifies `CLOCK_REALTIME`. However, the real-time
clock can be modified to an arbitrary value via clock_settime()
and there is no guarantee that it will always reflect uptime.

This change ensures that `sem_timedwait()` uses a more
consistent timebase for comparison.

Fixes #46807

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2022-06-24 20:12:05 +02:00
Bartosz Bilas 63e9fb6190 soc: select HAS_MCUX_SRC for MIMXRT1062
Select missing HAS_MCUX_SRC Kconfig symbol for MIMXRT1062,
that allows using NXP i.MX mcux SRC hwinfo driver.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2022-06-24 12:30:11 -05:00
Christopher Friedt 0e4d7055e7 MAINTAINERS: gpio: add collaborators
Adding myself and Henrik Brix Andersen as collaborators on GPIO.

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-06-24 16:19:58 +02:00
Christopher Friedt f88264d7ca drivers: gpio: mcux: support port_get_direction
Support querying the direction of GPIO.

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-06-24 16:19:58 +02:00
Christopher Friedt 00004fb976 drivers: gpio: sifive: support port_get_direction
Support querying the direction of GPIO.

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-06-24 16:19:58 +02:00
Christopher Friedt 1d823c77c9 drivers: gpio: litex: support port_get_direction
Support querying the direction of GPIO.

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-06-24 16:19:58 +02:00
Christopher Friedt 22d2fc1e64 drivers: gpio: eos_s3: support port_get_direction
Support querying the direction of GPIO.

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-06-24 16:19:58 +02:00
Christopher Friedt 3f96752005 drivers: gpio: cc13xx_cc26xx: support port_get_direction
Support querying the direction of GPIO.

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-06-24 16:19:58 +02:00
Christopher Friedt 9526437e64 drivers: gpio_emul: support gpio_port_get_direction
Support querying the direction of emulated GPIO.

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-06-24 16:19:58 +02:00
Christopher Friedt 165c5db078 tests: drivers: gpio: tests for gpio_port_get_direction
Tests for gpio_port_get_direction(), gpio_pin_is_input(),
and gpio_pin_is_output().

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-06-24 16:19:58 +02:00
Christopher Friedt 27c431ff7e api: gpio: add gpio direction query functions and driver api
Some services require the ability to query whether a GPIO pin
is configured as an input, output, both, or neither prior to
performing any operations at the service level. This is done
in order to reduce state tracking within the service.

To that end, this change adds
* `gpio_port_get_direction()`
* `gpio_pin_is_input()`, and
* `gpio_pin_is_output()`

Signed-off-by: Christopher Friedt <cfriedt@fb.com>
2022-06-24 16:19:58 +02:00
Christopher Friedt e527ed3c4f include: drivers: gpio: use __unused instead of void cast
The __unused attribute is the preferred way of marking
a variable as unused when assertions are disabled.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2022-06-24 16:19:58 +02:00
Benjamin Björnsson 22fd253fea samples: sensor: ccs811: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:52:26 -05:00
Benjamin Björnsson d4f00fe3c4 drivers: sensor: ccs811: Update driver to use gpio_dt_spec
Simplify driver by using gpio_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:52:26 -05:00
Benjamin Björnsson 3ac870b03b drivers: sensor: ccs811: Update driver to use i2c_dt_spec
Simplify driver by using i2c_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:52:26 -05:00
Benjamin Björnsson 15aefccf17 drivers: sensor: ccs811: Change parameters of helper functions
Change parameter list of functions for consistency with other drivers.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:52:26 -05:00
Benjamin Björnsson 3710af9a1b drivers: sensor: bmi270: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:46:01 -05:00
Benjamin Björnsson 3b2f21e291 drivers: sensor: bmi270: Update driver to use i2c_dt_spec
Simplify driver by using i2c_dt_spec for bus access.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:46:01 -05:00