Commit graph

69056 commits

Author SHA1 Message Date
Sylvio Alves
3c50237460 drivers: gpio: esp32: fix config function to allow changes
Current implementation misses disabling input/output mux
once GPIO has already been configured. It means that after 1st
configuration, if GPIO is reconfigured, it won't disable previous
definitions, causing unexpected behavior.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-08-26 21:27:50 -04:00
Enjia Mai
595e07c8b1 tests: drivers: move the entropy test to new ztest API
Migrate the testsuite tests/drivers/entropy/api to the
new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-26 19:36:37 -04:00
Sam Hurst
6f9e8f459d doc: smf: Add Event Driven Example
Add an example that demonstrates how the State Machine Framework
can be event driven. See Issue #48534

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2022-08-26 10:23:39 -07:00
Anas Nashif
6c7bf09222 intel_adsp: fix leakage of Kconfigs in soc family defconfig
Add missing conditionals and move CAVS related configs into own series
defconfig.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-08-26 13:17:02 -04:00
Anas Nashif
b04dc92c52 xtensa: make xtensa cache/uncache operations optional
Do not build those on platforms not supporting them.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-08-26 13:17:02 -04:00
Gerard Marull-Paretas
db798f7edb boards: thingy52_nrf52832: use SYS_INIT
There's no need to define a device entry, SYS_INIT is sufficient to run
a routine at boot time.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-26 10:06:43 -07:00
Gerard Marull-Paretas
05e30fac74 boards: thingy52_nrf52832: remove unused include
Code is not using printk, so remove zephyr/sys/printk.h

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-26 10:06:43 -07:00
Gerard Marull-Paretas
4876def53e boards: thingy52_nrf52832: use gpio_dt_spec
Obtain CCS GPIO pin from the regulator node (done like this because we
can't make use the regulator framework yet).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-26 10:06:43 -07:00
Gerard Marull-Paretas
9026073200 boards: thingy52_nrf52832: disable unused regulators
Some regulators can't be used in practice due to the limitations of the
Zephyr init priorities system. To make use of regulators using SX1509B
GPIOs, we would need regulators to be initialized at different
priorities, something not possible because we have a fixed priority
(CONFIG_REGULATOR_FIXED_INIT_PRIORITY) for all instances.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-26 10:06:43 -07:00
Gerard Marull-Paretas
2884f95d3f boards: thingy52_nrf52832: remove manual VDD init code
Rely on regulators infrastructure to turn VDD on. VDD was already
defined in Devicetree, but never used because CONFIG_REGULATOR=n.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-26 10:06:43 -07:00
Gerard Marull-Paretas
a6ffe37ee4 boards: thingy52_nrf52832: add vdd startup delay
A startup delay is required for the VDD power rail, otherwise certain
devices fail to respond. This delay is present in the existing board.c
file.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-26 10:06:43 -07:00
Gerard Marull-Paretas
0e43d70dd5 boards: thingy52_nrf52832: drop redundant entries in Kconfig.defconfig
CONFIG_GPIO is selected in board defconfig, I2C is no longer needed as
GPIO expander selects I2C.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-26 10:06:43 -07:00
Gerard Marull-Paretas
ac89fce3be drivers: gpio: sx1509b: select I2C
Select I2C instead of depending on it, following latest upstream policy.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-26 10:06:43 -07:00
Kumar Gala
05faddc923 dma: remove defconfig/proj setting of DMA drivers
Now that DMA drivers are enabled based on devicetree we can
remove any cases of them getting enabled by *.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-26 14:27:23 +00:00
Kumar Gala
8d9f9d50f4 dma: remove Kconfig.defconfig* setting of DMA drivers
Now that DMA drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-26 14:27:23 +00:00
Kumar Gala
0a57488719 drivers: dma: Update drivers to use devicetree Kconfig symbol
Update DMA drivers to use DT_HAS_<compat>_ENABLED Kconfig symbol
to expose the driver and enable it by default based on devicetree.

We remove 'depend on' Kconfig for symbols that would be implied by
the devicetree node existing.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-26 14:27:23 +00:00
Enjia Mai
8ae7fd7bd9 tests: board: esp32: move the cache_coex test to new ztest API
Migrate the testsuite tests/boards/espressif_esp32/cache_coex/
to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-08-26 14:27:12 +00:00
Tom Burdick
4c20403629 spi: callback API for asynchronous transcieve
Adds a new spi_transcieve_cb API which enables asynchronous
SPI transactions with callback notification.

The exist spi_transcieve_async API remains and uses the new
spi_transcieve_cb API to provide a k_poll_signal notifier.

The driver API changes to provide a callback and userdata
parameter to async transcieve. All drivers in the tree
have been updated to the change.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-08-26 09:29:48 -04:00
Herman Berget
096fc3b826 Bluetooth: Increase RX thread stack size
Normal usage for Bluetooth applications are getting close to or
already overflowing the default BT RX stack size of 1024.

For example:
 - Discovery using the fixed ATT channel used 984 bytes.
 - Discovery using an enhanced ATT channel used 1048 bytes,
   which would lead to stack overflow using the default BT RX thread
   stack size.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-08-26 12:52:22 +02:00
Krzysztof Chruscinski
bb74b4f028 lib: os: cbprintf: Renamed flags used for conversion function
At some point, package copy function was extended and renamed
to cbprintf_package_convert. However, flags used by this
function were not renamed and used contained COPY idiom.
Deprecating flags with COPY and replacing them with flags
with CONVERT idiom to match function which is utilizing them.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-08-26 12:52:08 +02:00
Kumar Gala
f3ff449524 tests: devicetree: device: Rename gpio@0 to avoid name conflict
There are some platforms like the lpcxpresso54114 that utilize gpio@0
so rename gpio@0 to gpio@ffff as this is a highly unlikely to conflict
with any real device.

Fixes #49439

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-26 12:51:45 +02:00
Jeremy Bettis
562b291704 twister: Set stdin explicitly on stty calls
stty operates on the file descriptor from stdin, but we want to operate
on stdout. If stdin and stdout are not the same tty then stty prints an
error.

Redirect stdout to stdin for stty calls.

Tested by running twister -T tests/subsys/shell </dev/null

Signed-off-by: Jeremy Bettis <jbettis@google.com>
2022-08-26 12:51:28 +02:00
Jakob Krantz
605d8c85d8 Bluetooth: Host: Fix invalid sync term callback params
When using periodic advertising list and receiving
hci_le_per_adv_sync_established event from controller with
an error code the bt_le_per_adv_sync_term_info would be
incorrectly populated with le_addr and sid. This is because
the current pending advertising sync object is not populated
with any le_addr and sid from bt_le_per_adv_sync_create as
those are not used when option
BT_LE_PER_ADV_SYNC_OPT_USE_PER_ADV_LIST is set.

Instead the bt_le_per_adv_sync_term_info shall be populated
with the le_addr and sid coming in the event from controller.

Signed-off-by: Jakob Krantz <jakob.krantz@u-blox.com>
2022-08-26 12:51:05 +02:00
Andy Ross
7f5e1904cc samples: Add fuzz sample
This is a simple example of fuzz test integration with Zephyr apps
that displays LLVM libfuzzer's most important feature: it's ability to
detect and explore deep and complicated call trees by exploiting
coverage information gleaned from instrumented binaries.

See README.rst and the inline comments for details

Signed-off-by: Andy Ross <andyross@google.com>
2022-08-26 11:57:46 +02:00
Andy Ross
65d657685e arch/posix: Add libfuzzer support
Add support for LLVM's libfuzzer utility.  This works by building an
executable with a "LLVMFuzzerTestOneInput()" entry point (which is
external to Zephyr, running in the host process environment!), which
it drives out of its own main() routine.  The toolchain API is exposed
as just another sanitizer variant, which is clean.

Signed-off-by: Andy Ross <andyross@google.com>
2022-08-26 11:57:46 +02:00
Andy Ross
bb950b2d63 boards/native_posix: Unwrap main loop to expose external event API
Some applications of native_posix (libfuzzer in particular) want to
drive the native_posix environment from "outside" as a caller.

Unwrap the hwm_main_loop() utility into a callable hwm_one_event()
function instead, and move the loop into the main() function instead.
Likewise split out the initialization path into a API-visible
posix_init() function.

Finally adds a posix_exec_for() entry point which iterates over the
event interface for a given timeout.

Signed-off-by: Andy Ross <andyross@google.com>
2022-08-26 11:57:46 +02:00
Gerard Marull-Paretas
038ce40c7a doc: add nitpicky mode ignores
The nitpicky mode warns about any broken reference. It is useful to keep
docs in good shape, however, there are some references that will never
be resolvable. Provide an initial list to decrease the number of
warnings that are not relevant/can't be fixed.

Note that the Sphinx nitpicky mode can be enabled by either setting
`nitpicky = True` in `doc/conf.py` or by setting the `-n` flag in
`SPHINXOPTS`.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-26 11:57:26 +02:00
Meng xianglin
cd288ff907 tests: settings: functional: move to new ztest API
All test cases in tests/subsys/settings/functional are moved
to new ztest API.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-08-26 11:56:51 +02:00
Meng xianglin
96484695e7 tests: settings: move to new ztest API
test cases in tests/subsys/settings/fcb, tests/subsys/settings/littlefs,
tests/subsys/setttings/nvs all depend on tests/subsys/settings/src and
tests/subsys/settings/fs, so update them in one commit.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2022-08-26 11:56:51 +02:00
Erik Brockhoff
7719bc6785 Bluetooth: controller: llcp: fix unhandled rsp in periph phy upd proc
Re. peripheral phy update procedure: UNKNOWN_RSP from central was not
handled, leading to stall of procedure and subsequent procedure timeout

Proper handle and unit test for case added.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-08-26 11:56:33 +02:00
Emil Gydesen
70dfbb6747 Bluetooth: Audio: Add missing NULL checks when looking up audio_iso streams
Multiple places we assumed that we could simply just do
sink_stream->iso == chan without checking if sink_stream
was NULL.

This commit fixes that by adding proper NULL checks for that,
as well as additional checks before defaulting to the
source_stream.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-08-26 11:56:15 +02:00
Wei-Tai Lee
2ac6eafe66 boards: riscv: adp_xc7k_ae350: add Kconfig options for hwinfo driver
Add Kconfig options to support hwinfo driver on adp_xc7k_ae350.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2022-08-26 11:55:55 +02:00
Wei-Tai Lee
00b97feb56 drivers: hwinfo: add Andes hwinfo driver
Add hwinfo driver for Andes.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2022-08-26 11:55:55 +02:00
Jimmy Zheng
86b04c8a33 boards: riscv: adp_xc7k_ae350: support Andes atcpit100 counter driver
Support counter driver on Andes adp_xc7k_ae350.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2022-08-26 11:55:36 +02:00
Jimmy Zheng
b24c3b9fe9 dts: riscv: andes_v5_ae350.dtsi: add PIT prescaler property
Add prescaler property to prevent counter driver imprecise when CPU clock
is close to the PIT clock.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2022-08-26 11:55:36 +02:00
Jimmy Zheng
94e1c09a31 dts: bindings: timer: add Andes atcpit100 yaml
Add Andes atcpit100 yaml file.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2022-08-26 11:55:36 +02:00
Jimmy Zheng
a2cc4b702f drivers: counter: add Andes atcpit100 counter driver
atcpit100 counter driver support 4 32-bit PIT channel, using channel 3 as
the default counter.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2022-08-26 11:55:36 +02:00
Martí Bolívar
88aa873fbc twister: improve logging of cmake commands
With verbose output enabled, twister logs the cmake arguments as a
python array whenever it invokes cmake to generate a build system.

This is clunky output for manual reproduction, because it forces the
developer to manually join the arguments together for consumption by
the shell.

As an enhancement for this use case, use the standard library
shlex.join() function to produce a string that can be copy/pasted
directly into the shell on POSIX platforms.

We should use this function instead of str.join, because it correctly
handles things like shell quoting for options with spaces in them.

This function is not available on Windows, so we fall back on behavior
that is similar to the old one there.

The main difference on Windows is that the output now includes the
path to cmake as well, and not just its arguments. (This is the same
on POSIX, and is intended to help debug if multiple cmakes are
installed on the same machine.)

We are running cmake from a couple of different places, so doing this
cleanly requires adding a shared module with the platform abstraction.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-08-26 08:53:14 +02:00
Diego Herranz
66d47cae04 doc/develop/getting_started: update for Ubuntu 22.04
In Ubuntu 22.04 there is no need to add any extra repositories
to meet the minimum required versions for tools like cmake and dtc.
In fact, the Kitware repos don't even work in Ubuntu 22.04.

So, instructions updated to explain that step is only required for
Ubuntu versions older than 22.04.

Signed-off-by: Diego Herranz <diegoherranz@diegoherranz.com>
2022-08-25 23:39:23 -07:00
Martí Bolívar
6c03cb9fb4 MAINTAINERS: remove my doc collaborator status
I am still interested in contributing to the documentation, but I am
tired of the spam I'm getting from zephyrbot whenever any pull request
touches anything in doc/.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-08-25 18:30:07 -07:00
Martí Bolívar
f739b85c8d MAINTAINERS: remove redundant files entry
The dts/bindings/test/ entry is already covered by dts/bindings/
above.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-08-25 18:30:07 -07:00
Kumar Gala
f1660f4d51 edtlib: allow const arrays
Allow for having array types (array, uint8-array, string-array) be const.
This would allow for something like:

properties:
    reg-names:
        const: ["foo", "bar"]

To be supported.

Renamed function _check_prop_type_and_default to _check_prop_by_type
as part of this change and Moved the check for 'const' types into
_check_prop_by_type as its similar to the prop_type check and it was
easier to implement in _check_prop_by_type as we already extract
prop_type from the option in that function.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-25 18:11:27 -07:00
Torsten Rasmussen
4cb2ef83bf cmake: kconfig: preserved quotes for Kconfig string values
Fixes: #48950

Kconfig requires quoted strings in its configuration files, like this:
> CONFIG_A_STRING="foo bar"

But CMake requires expects that strings are without additional qoutes,
and therefore qoutes are stripped when loading Kconfig config filers
into CMake.

This is particular important when the string in Kconfig is a path to a
file. In this case, not stripping the quotes leads to an error as the
file cannot be found.

When users pass a string to Kconfig through CMake, they are expected to
pass it so that qoutes are correct seen from Kconfig, that is:
> cmake -DCONFIG_A_STRING=\"foo bar\"

In CMake, those qoutes are written as-is to Kconfig extra config file,
and then removed in the CMake cache.
After Kconfig processing, the Kconfig settings are read back to CMake
but without quotes. Settings that was passed through the CMake cache,
for example using `-D` are written back to the cache, but this time
without the qoutes. This results in Kconfig errors on sub-sequent CMake
runs.

Instead of writing the Kconfig value setting back to the CMake cache,
introduce an internal shadow symbol in the cache prefixed with `CLI_`.
This allows the CMake cache to keep the value correctly formatted for
Kconfig extra config creation, while at the same time keep existing
behavior for CONFIG_ symbols read from Kconfig.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-08-25 17:53:11 -07:00
Kumar Gala
8a5d568a79 dts: Standardize string token names for arrays
Use the same postfixes for string arrays as we use for strings.  Keep
just the _STRING_*_TOKEN) variants.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-25 15:00:24 -07:00
Kumar Gala
04adb949d1 soc: xilinx: zynq7000: move to using DT_STRING_UPPER_TOKEN_BY_IDX macro
Replaced hand coded use with DT_STRING_UPPER_TOKEN_BY_IDX.  We should have
introduced the APIs when this was needed since the token values in
devicetree_generated.h should only be accessed via an API macro.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-25 15:00:24 -07:00
Gerard Marull-Paretas
18fe7bc630 tests: drivers: pinctrl: nrf: test disconnected pins
Update test to cover disconnected pins.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-25 14:38:26 -07:00
Gerard Marull-Paretas
223cc3c6bd drivers: pinctrl: nrf: add support for disconnecting a pin
It was not possible to disconnect a pin using the nRF pinctrl driver.
That is, it was not possible to set PSEL to 0xFFFFFFFF (indicating pin
is not connected). This can be useful in certain scenarios, e.g. a
bootloader configures all signals of a certain peripheral but
application then needs to disconnect certain signals.

A new DT macro has been introduced to accomplish this:
NRF_PSEL_DISCONNECT. It can be used like this to explicitely disconnect
a peripheral signal:

```
&pinctrl {
	uart0_default: uart0_default {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 1)>,
				<NRF_PSEL_DISCONNECTED(UART_RX)>;
		};
	};
};
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-25 14:38:26 -07:00
Andrei Emeltchenko
7c81ee9d18 pcie: shell: Add help and argument check
Use SHELL_CMD_ARG() for argument check and add help, looking like:

...

$ pcie -h
  pcie - PCI(e) device information
  Subcommands:
    ls  :List PCIE devices
         Usage: ls [bus:device:function] [dump]

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-08-25 21:14:51 +00:00
Andrei Emeltchenko
d46c7595d9 pcie: shell: Verify command parameters
Exit on wrong parameter for pcie ls command.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-08-25 21:14:51 +00:00
Sylvio Alves
7e9e3116e4 dtsi: esp32c3: add missing wifi node
Add ESP32C3 wifi entry in dtsi file.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-08-25 21:12:08 +00:00