Commit graph

82298 commits

Author SHA1 Message Date
Flavio Ceolin
20c9bb856f x86-64: Early TLS initialization
Allow early boot code to use thread local storage
when it is enabled.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-08-08 19:08:04 -04:00
Flavio Ceolin
596e77f562 x86: Early TLS initialization
Allow early boot code using thread local storage when
it is enabled.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-08-08 19:08:04 -04:00
Benjamin Perseghetti
654863944d board: mimxrt1160_evk: Add missing CANFD fields
Add the missing bus-speed-data field to the 1160 evk
to fix CI build problems.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2023-08-08 22:16:48 +00:00
Diego Elio Pettenò
762a1f8b42 ev11l78a: initial import of the UPD301C Basic Sink board.
This board is a relatively inexpensive development kit for USB-PD
controllers, using an UPD301C controller.

This Zephyr config includes support for:

 * UART (present on he debug header of the board), tested with the
   hello_world sample application;
 * the one standalone LED (CAP_MIS), tested with the blinky sample
   application;
 * the rotary encoder (PDO_SEL), via ADC, tested with the adc sample
   application;
 * the current sense amplifier (I_SENSE), currently untested;
 * the SPI bus, connected internally in the UPD301C to the UPD350;
 * the I2C bus, exposed on the debug header, currently untested.

Note that the drivers.uart.async_api.rtt has to be disabled, as it is
for other m0 boards with no dma or it fails to build.

Signed-off-by: Diego Elio Pettenò <flameeyes@meta.com>
2023-08-08 19:02:15 +00:00
Benjamin Perseghetti
79796d5c74 tests: net/socket/socketpair: exclude vmu and 1160
This has failed in repeated CI runs. Filed an issue
for having it checked. Excluding it until it's
fixed.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2023-08-08 12:09:10 -05:00
Benjamin Perseghetti
41e0a2e9df soc: nxp_rt11xx: add CANFD compatible.
Enable CANFD for rt11xx by including nxp,flexcan-fd
compatibility for all CANFD capable CAN with associated
properties.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2023-08-08 12:09:10 -05:00
Benjamin Perseghetti
8b8ddb9bab soc: nxp_rt11xx: add unique PWM names.
Enable PWM to use unique device names.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2023-08-08 12:09:10 -05:00
Benjamin Perseghetti
109d91aaf8 board: Add NXP VMU RT1170 board support package
Adds support for the NXP VMU RT1170 board. This Vehicle
Management Unit based on the i.MX RT1176 brings a fantastic
combination of sensors and IO all on one board for development
of various systems. It is also the featured board for
CogniPilot's Cerebri - VMU autopilot software based on Zephyr.

Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2023-08-08 12:09:10 -05:00
Benjamin Cabé
68b1930309 include: rb: doc: Move code to make Doxygen happy
Moved alloca.h trick further down the file to workaround Doxygen
getting confused with #ifdef/#ifndef.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-08 13:02:47 -04:00
Benjamin Cabé
9dbb1ecc53 include: rb: doc: RB-tree doc wording
Small tweaks to balanced RB-tree's doc wording

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-08 13:02:47 -04:00
Benjamin Cabé
72f5923981 include: doc: Add missing docs for data structures
Data structures in Modules > Utilities > Data Structures were missing
some documentation.
Also properly hid the structures' internals (note that for some of the
files touched by this commit, some internals were already de-facto
hidden by Doxygen as they begin with an _ character).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-08 13:02:47 -04:00
Benjamin Cabé
e00e2108c9 include: doc: Properly document data structures
Move brief and description under group instead of file so that they show
up nicely in the documentation.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-08 13:02:47 -04:00
Benjamin Cabé
1a85866935 drivers: peci: doc: Doxygen cleanup
Put command format defines in proper sections and fix improperly
documented struct.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-08 13:01:28 -04:00
YuLong Yao
959e0e829d net: wifi: shell: fix parameter description error
command `wifi ap enable` not have SSID LENGTH parameter, remove it.

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-08-08 13:28:12 +00:00
Ryan McClelland
bf1efa868e tests: lib: cbprintf_package: fix long-double promotion warning
Long Double promotion warnings are generated with the flag
-Wdouble-promotion

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-08-08 13:27:47 +00:00
Grzegorz Swiderski
d821655def doc: sysbuild: Document the BUILD_ONLY parameter
Add a brief subsection about how to build a Zephyr application without
flashing it.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-08-08 12:35:21 +00:00
Grzegorz Swiderski
93b1fb2713 sysbuild: Support BUILD_ONLY images
Add a new parameter to `ExternalZephyrProject_Add()`, which determines
whether a given sysbuild image should only be built and not considered
for flashing and debugging. By adding the following arguments:

   BUILD_ONLY TRUE

the image will be marked as build-only and excluded from `domains.yaml`.

For cases where this setting should be controlled by users or individual
samples, Kconfig can be used:

   ExternalZephyrProject_Add(
     APPLICATION foo
     SOURCE_DIR /path/to/foo
     BUILD_ONLY ${CONFIG_FOO_IS_BUILD_ONLY}
   )

This would be particularly fitting for "general-purpose" images, defined
in-tree or via Zephyr modules (whose inclusion in the multi-image build
should also be Kconfigurable).

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-08-08 12:35:21 +00:00
Natalia Pluta
76bb1d7453 modules: hal_nordic: Add nrfx specific drivers logging Kconfig
This commit introduces Kconfig symbols for enabling logging
for each nrfx drivers in Zephyr.

Example Usage:
To enable logging for the NRFX ADC driver, add the following
line to the project's configuration file (prj.conf):
CONFIG_NRFX_ADC_LOG=y

The purpose of this change is to enable selective logging
in Zephyr for specific nrfx drivers.

Signed-off-by: Natalia Pluta <natalia.pluta@nordicsemi.no>
2023-08-08 12:34:19 +00:00
Natalia Pluta
764466a6da modules: hal_nordic: nrfx: Add zephyr to nrfx logging symbols mapping
A Kconfig symbol mapping is necessary to enable logging for specific
nrfx drivers in Zephyr, allowing the association of these symbols with
their corresponding nrfx-specific symbols.

Signed-off-by: Natalia Pluta <natalia.pluta@nordicsemi.no>
2023-08-08 12:34:19 +00:00
Markus Fuchs
fb5e1464ec boards: efr32_radio: Enable on-chip DC-DC converter
The BRD4187C uses the on-chip DC-DC converter to power the RF radio and
power amplifier supplies (RFVDD and PAVDD).

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2023-08-08 12:33:51 +00:00
Markus Fuchs
81e7fd17e1 boards: efr32_radio: Fix CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
The BRD4187C has a 39 MHz high frequency crystal oscillator and
runs at a 78 MHz operating frequency.
Fix the CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC setting, so it reflects
the actual SYSCLK frequency.

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2023-08-08 12:33:29 +00:00
Grzegorz Ferenc
8b07bf150e doc: app_development: add header tags
Added several header tags on Application Development.
Edited header hierarchy under Create Application.

Signed-off-by: Grzegorz Ferenc <Grzegorz.Ferenc@nordicsemi.no>
2023-08-08 12:32:43 +00:00
Jamie McCrae
84e4ffcd56 doc: services: device_mgmt: smp_groups: Fix OP values
Fixes an issue with the wrong OP values in some parts of the
documentation

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-08 11:12:00 +00:00
Robert Lubos
32bd3aa781 net: iface: Allow NULL pointer to be handled in net_if_is_ip_offloaded
In case native interface is used with NET_OFFLOAD enabled, the
net_if_is_ip_offloaded() could lead to a crash, if called on unbound
net_context (i.e. with no iface assigned to net_context yet).

As since commit 40d2240226 the net_context
allocated on offloaded interface is always assigned with the iface
pointer during its creation, it can be safely assumed that in case of
NULL pointer is provided we deal with a native interface. Therefore
instead of asserting on the iface pointer, indicate that the interface
is native when NULL pointer is provided.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-08-08 08:15:53 +00:00
Jeppe Odgaard
90b5554bd6 boards: doc: Update mimxrt1024 docs with FlexSPI DQS info
Add GPIO_SD_B1_05 to "Connections and I/Os". The signal is reserved for
the QSPI interface for the integrated flash.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2023-08-08 08:15:12 +00:00
Ryan McClelland
ad7ae7cc12 test: drivers: sensor: generic: fix double-promotions
Double promotion warnings are generated with the flag -Wdouble-promotion

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-08-08 08:06:07 +00:00
Fabio Baltieri
1e58610b2a MAINTAINERS: add samples/boards/google to Google platforms
Add the board samples path to Google platforms group so PRs there are
assigned.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-07 19:30:04 -04:00
Ryan McClelland
cea56b0409 drivers: sensor: icp10125 fix double-promotion warnings
sensor_value_from_double was used, but sensor_value_from_float
should be used as the parameter is a float

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-08-07 16:12:13 -07:00
Anas Nashif
37da312439 Revert "ztest: Fix test statistics reporting"
This reverts commit 2af5ac8fbb.

Failures are not being captured correctly now:

 - PASS - [test_c_lib.test_strtoul] duration = 0.001 seconds
 - PASS - [test_c_lib.test_strxspn] duration = 0.001 seconds
 - FAIL - [test_c_lib.test_that_fails] duration = 0.002 seconds
 - PASS - [test_c_lib.test_time] duration = 0.001 seconds
 - PASS - [test_c_lib.test_tolower_toupper] duration = 0.001 seconds

------ TESTSUITE SUMMARY END ------

===================================================================
PROJECT EXECUTION SUCCESSFUL

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-07 15:40:24 -04:00
Keith Packard
cbc5ee3683 samples/boards/google_twinkie_v2_pda: fix main return
switch to int

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-08-07 19:07:43 +00:00
Ryan McClelland
8f55774eae test: drivers: build_all: add cdns uart build only test
As the cadence uart, has no off-the-shelve microprocessor out there.
Add a build only test case for the cadence uart using the qemu cortex
m3 as the board.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-08-07 18:51:28 +00:00
Ryan McClelland
652cabeb85 drivers: serial: fix zephyr.h warning
When compiling the cadence uart, a warning is generated for the
zephyr/zephyr.h include. Fix it to be zephyr/kernel.h.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-08-07 18:51:28 +00:00
Mykyta Poturai
d7241b0a2c fs: littlefs: use uintptr_t instead of int for dev_id
dev_id is used as a pointer at the end of the call chain, so passing it
as an int makes no sense and can cause crashes if the pointer and int
types have different sizes. For example, if we have 64-bit pointers on
a board, the higher part of dev_id will be removed due to an type cast.

Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2023-08-07 17:45:22 +00:00
Jason Mitchell
74d08d69b2 drivers: serial: cmsdk_apb: fix irq_rx_ready deviation
The docstring for uart_cmsdk_apb_irq_rx_ready says "@return 1 if an
interrupt is ready, 0 otherwise" but the function actually returns 2 on
success. This commit fixes this to conform with serial driver API.

Signed-off-by: Jason Mitchell <jmitchell@radicalsemiconductor.com>
2023-08-07 12:01:25 -04:00
Maciej Sobkowski
112e48eb28 samples: alarm: Add support for apollo4p_evb
Add support for apollo4p_evb to the counter alarm sample.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
2023-08-07 16:12:58 +02:00
Maciej Sobkowski
5a71c35bff boards: arm: apollo4p_evb: Enable counter
This commit enables counter instance for apollo4p_evb board.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
2023-08-07 16:12:58 +02:00
Maciej Sobkowski
b557d96c59 dts: arm: ambiq: Add counter instance to SoC
This commit instantiates the counter peripheral.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
2023-08-07 16:12:58 +02:00
Maciej Sobkowski
9bc3ee67be drivers: counter: Add Ambiq counter driver
This commit adds Ambiq counter driver for Apollo4p SoCs.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
2023-08-07 16:12:58 +02:00
Grzegorz Swiderski
04a7fcf321 tests: lib: devicetree: api: Add test_fixed_partitions
Add test suite for the DT fixed-partitions API. It is verified on two
kinds of MTD nodes, one of which is meant to represent external memory.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-08-07 15:45:23 +02:00
Grzegorz Swiderski
b69be2cb48 doc: release: 3.5: Add note on new fixed partition API
List `DT_MEM_FROM_FIXED_PARTITION()` and `DT_FIXED_PARTITION_ADDR()` as
the newly added macros.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-08-07 15:45:23 +02:00
Grzegorz Swiderski
e28cbb3633 devicetree: Add DT_FIXED_PARTITION_ADDR macro
This convenience API returns the absolute address of a fixed partition,
i.e., relative offset + base address. It's distinct from `DT_REG_ADDR()`
and `FIXED_PARTITION_OFFSET()`, both of which return just the offset.

The base address is taken from the parent memory node as given by the
newly added `DT_MEM_FROM_FIXED_PARTITION()`. This is expected to ensure
that the returned address is directly addressable by the CPU. This is
also meant to prevent `DT_FIXED_PARTITION_ADDR()` from working with
external memory partitions.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-08-07 15:45:23 +02:00
Grzegorz Swiderski
99599b5d3b devicetree: Add DT_MEM_FROM_FIXED_PARTITION macro
This is a new fixed-partitions API, which serves as a companion to the
existing `DT_MTD_FROM_FIXED_PARTITION()`. In the following example:

  flash-controller@0 {
          compatible = "flash-controller";
          flash@1000000 {
                  compatible = "soc-nv-flash";
                  partitions {
                          compatible = "fixed-partitions";
                          partition@3a000 {};
                  };
          };
  };

`DT_MTD_FROM_FIXED_PARTITION()` would let us map `partition@3a000` to
`flash-controller@0`. Now, the new `DT_MEM_FROM_FIXED_PARTITION()` can
let us retrieve the memory node (`flash@1000000`) as well, in a manner
consistent with the existing API.

Caution: if a fixed partition is not said to belong to a memory node,
like in this alternative example:

  flash@0 {
          compatible = "spi-nor";
          partitions {
                  compatible = "fixed-partitions";
                  partition@0 {};
          };
  };

then `DT_MEM_FROM_FIXED_PARTITION()` will map `partition@0` to an
invalid node identifier. This partition belongs to `flash@0`, which
could be an MTD on a SPI bus.

For consistency, the existing `DT_MTD_FROM_FIXED_PARTITION()` is now re-
expressed in terms of the new `DT_MEM_FROM_FIXED_PARTITION()`.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-08-07 15:45:23 +02:00
Jordan Yates
a5895d6464 cmake: extensions: board revisions can be optional
Add a new option to `board_check_revision` that can make specifying a
board revision optional. This makes it easier to work with boards that
can come in a base variant with extensions. For example Fanstel BLE
modules that come with/without power amplifiers.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-08-07 13:26:35 +02:00
Madhurima Paruchuri
3bc694dd8d drivers: flash: npcx: Fix offset alignment check bug
Removed single offset alignment check mechanism and replaced it with
offset alignment check for each iteration

Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com>
2023-08-07 13:08:27 +02:00
Andreas Deininger
571f8591b9 documentation: Fix several typos
Correcting typos in various documentation files

Signed-off-by: Andreas Deininger <andreas@deininger.net>
2023-08-07 13:07:50 +02:00
Grzegorz Swiderski
cb46ed6a32 cmake: kconfig: Preserve correct CLI assignments across re-runs
This tiny patch makes two improvements:

1. Preserve boolean (=n) assignments from command-line.

This fixes an issue where, if a symbol with `default y` were turned off
via command-line, e.g., `-DCONFIG_BOOT_BANNER=n`, a CMake re-run would
revert that symbol back to its default value.

To avoid this, the assignment should have been preserved in CMake cache
as `CLI_CONFIG_BOOT_BANNER:INTERNAL=n`. However, `kconfig.cmake` clears
unset variables from cache, and (=n) symbols become unset variables, so
an exception had to be made for them.

2. Discard invalid assignments from command-line.

Although `kconfig.cmake` takes care to discard assignments to symbols
which get unset by Kconfig, it wasn't handling the case where Kconfig
would keep the symbol but replace its value, making the CMake-cached
assignment invalid.

For example, this assignment:

   west build . -DCONFIG_PRINTK=n

could be invalidated if PRINTK were selected by, e.g., BOOT_BANNER,
producing this warning:

   PRINTK (...) was assigned the value 'n' but got the value 'y'. (...)

Still, the old value of (=n) was being cached. One way in which this was
evident was when setting an unrelated symbol in a separate invocation:

   west build . -DCONFIG_MAIN_STACK_SIZE=512

the same warning for PRINTK would show up again.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-08-07 13:04:44 +02:00
Grzegorz Swiderski
9228c379cd cmake: extensions: Improve import_kconfig() bool/tristate parsing
This function has been working fine for parsing Kconfig fragments as
processed by Kconfiglib, but it can be made more robust for parsing
fragments from other sources, including handwritten ones.

Previously, Kconfig fragment lines of the form `# CONFIG_FOO is not set`
were ignored entirely, while lines of the form `CONFIG_FOO=n` would set
the corresponding CMake variable or target property to a literal `n`.
However, Kconfiglib treats both equivalently - as assignments to `n` -
so `import_kconfig()` should too.

Due to the fact that `.config` files output by Kconfiglib always show
disabled options as `# CONFIG_FOO is not set` (which was being ignored),
existing CMake code expects `CONFIG_FOO` to be unset. To avoid breakage,
the variable/property will now be unset explicitly by `import_kconfig()`
when it encounters either representation of `CONFIG_FOO=n`.

Moreover, for bool and tristate symbols, Kconfiglib accepts assignments
like `CONFIG_FOO=yeah`, `CONFIG_FOO=maybe`, or `CONFIG_FOO=nope`, and it
transforms the value of `CONFIG_FOO` into `y`, `m`, or `n` respectively.
This effect is now replicated in CMake.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-08-07 13:04:44 +02:00
Grzegorz Swiderski
0d12e1b5c0 cmake: kconfig: Keep symbol names sorted in EXTRA_KCONFIG_OPTIONS
This makes checksum calculation over Kconfig fragments more consistent,
which prevents writing a new `.config` when nothing really changes.

To explain this, consider the following sequence:

1. west build . -DCONFIG_XXXX=y -DCONFIG_YYYY=y
2. west build . -DCONFIG_YYYY=y
3. west build . -DCONFIG_XXXX=y

At (1), we set new values for XXXX and YYYY, so the `.config` changes.

At (2), we set a value for YYYY, but it's the same value as before, so
the `.config` doesn't get overwritten.

At (3), we set a value for XXXX, but it's the same value as before, so
the `.config` shouldn't get overwritten... but it does. What happened?

The reason is that the generated `extra_kconfig_options.conf` fragment,
which is included in the checksum calculation, was being populated using
two sets of CMake cache variables:

- past assignments, prefixed with `CLI_${KCONFIG_NAMESPACE}_`.
- new assignments, prefixed with just `${KCONFIG_NAMESPACE}_`.

Usually, past assignments would appear before new assignments, because
the default `${KCONFIG_NAMESPACE}` is CONFIG, which goes after CLI in
alphabetical order. As a result, the contents of EXTRA_KCONFIG_OPTIONS
at (1) and (2):

   CONFIG_XXXX=y
   CONFIG_YYYY=y

were not identical to its contents at (3):

   CONFIG_YYYY=y
   CONFIG_XXXX=y

resulting in a different checksum.

This is resolved by stripping out the CLI prefix first, then effectively
"mergesorting" the past and new assignments, before starting to populate
EXTRA_KCONFIG_OPTIONS.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-08-07 13:04:44 +02:00
Aedan Cullen
5fc2586b8f drivers: sensor: lis3mdl: always use continuous mode
The LIS3MDL driver misunderstands the MD[1:0] bits in CTRL_REG3.
Correct this so that all ODR settings are functional.

Currently, single-conversion mode is enabled when fast ODR is set,
resulting in only one measurement being taken before the device
immediately returns to power-down mode. The result is that all fast-ODR
rates (155 and higher) are not usable when assigned to CONFIG_LIS3MDL_ODR.

Continuous mode is the only mode truly supported by this driver and should
always be used.

Signed-off-by: Aedan Cullen <aedan@aedancullen.com>
2023-08-07 11:28:02 +02:00
Xiao Qin
b102e55084 boards: arm: xiao_ble: Fix mismatched spi peripheral
As per #54658, spi2 is configured to be used on XIAO BLE (Sense) board.
This commit updates its connector devicetree to use this configured spi
peripheral.

Signed-off-by: Xiao Qin <xiaoq@google.com>
2023-08-07 11:27:45 +02:00