Commit graph

56486 commits

Author SHA1 Message Date
Sylvio Alves
69311ccc3d soc: esp32: update clock configuration calls
Removed duplicated calls in clock subsystems.
Move proper includes to soc specific.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-09-30 21:42:20 -04:00
Martí Bolívar
a627666e06 device: add fudge factor for handle padding
When CONFIG_USERSPACE is enabled, the ELF file from linker pass 1 is
used to create a hash table that identifies kernel objects by address.
We therefore can't allow the size of any object in the pass 2 ELF to
change in a way that would change those addresses, or we would create
a garbage hash table.

Simultaneously (and regardless of CONFIG_USERSPACE's value),
gen_handles.py must transform arrays of handles from their pass 1
values to their pass 2 values; see the file's docstring for more
details on that transformation.

The way this works is that gen_handles.py just pads out each pass 2
array so its length is the same as its pass 1 value. The padding value
is a repeated run of DEVICE_HANDLE_ENDS values. This value is the
terminator which we look for at runtime in places like
device_required_handles_get(), so there must be at least one, and we
error out in gen_handles.py if there's no room in the pass 2 array for
at least one such value. (If there is extra room, we just keep
inserting extra DEVICE_HANDLE_ENDS values to pad the array to its
original length.)

However, it is possible that a device has more direct dependencies in
the pass 2 handles array than its corresponding devicetree node had in
the pass 1 array. When this happens, users have no recourse, so that's
a potential showstopper.

To work around this possibility for now, add a new config option,
CONFIG_DEVICE_HANDLE_PADDING, whose value defaults to 0.

When nonzero, it is a count of padding handles that are inserted into
each device handles array. When gen_handles.py errors out due to lack
of room, its error message now tells the user how much to increase
CONFIG_DEVICE_HANDLE_PADDING by to work around the problem.

It looks like a real fix for this is to allocate kernel objects whose
addresses are required for hash tables in CONFIG_USERSPACE=y
configurations *before* the handle arrays. The handle arrays could
then be resized as needed in pass 2, which saves ROM by avoiding
unnecessary padding, and would avoid the need for
CONFIG_DEVICE_HANDLE_PADDING altogether.

However, this 'real fix' is not available and we are facing a deadline
to get a temporary solution in for Zephyr v2.7.0, so this is a good
enough workaround for now.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-30 21:37:59 -04:00
Martí Bolívar
2c99173d64 Revert "device: simplify structure of handles array"
This reverts commit ec331c6fe2.

Although it's a valid simplification under the assumption that we're
going to be padding the array out anyway, it would use extra ROM if we
fix the build system issues that are currently forcing gen_handles.py
to introduce extra padding in the handles arrays for linker pass 2.

On the (perhaps optimistic) assumption that we're going to fix the
build system, let's get rid of a commit that would get in the way. The
extra "complexity" in device_required_handles_get() is trivial.

This gets rid of a comment describing the linker passes, but the
structure of the comment is a bit misleading (and it contains
incorrect information for the results of pass 2: the terminator at the
end is DEVICE_HANDLE_ENDS, not DEVICE_HANDLE_NULL).

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-30 21:37:59 -04:00
Martí Bolívar
288bcb90da Revert "device: iterable supported devices"
This reverts commit 0c6588ff47.

It's not clear that the supported devices are being properly computed,
so let's revert this for v2.7.0 until we've had more time to think
it through.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-30 21:37:59 -04:00
Martí Bolívar
b94a11f5d0 Revert "device: supported devices visitor API"
This reverts commit b01e41ccdd.

It's not clear that the supported devices are being properly computed,
so let's revert this for v2.7.0 until we've had more time to think
it through.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-30 21:37:59 -04:00
Martí Bolívar
e643464b20 Revert "tests: devicetree: test supported devices API"
This reverts commit 4c32e21fc7 with some
manual conflict resolution.

It's not clear that the supported devices are being properly computed,
so let's revert this for v2.7.0 until we've had more time to think
it through.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-30 21:37:59 -04:00
Alexandre Bourdiol
25432ecfa4 tests: kernel: sched: schedule_api: enlarge timeslice criterion
From time to time, measured slice time is one less/more than requested.
Fixes #35793

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-09-30 20:39:31 -04:00
Peter Mitsis
0153b7dc50 doc: Add deadline scheduling information
Adds information to the kernel scheduling documentation explaining
how a thread's deadline is used to determine the thread's relative
priority.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2021-09-30 17:01:09 -04:00
Peter Mitsis
4e8569a7ba kernel: fix deadline typo
Corrects the spelling of "dealine" to "deadline".

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2021-09-30 17:01:09 -04:00
Gerard Marull-Paretas
7845da576c tests: pm: power_mgmt: use PM_STATE_SUSPEND_TO_IDLE
Since the tests expects devices to change states, PM_STATE_RUNTIME_IDLE
can't be used. The first state that cares about devices is
PM_STATE_SUSPEND_TO_IDLE.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-30 16:05:59 -04:00
Gerard Marull-Paretas
93de9b1d80 pm: stop handling devices on PM_STATE_RUNTIME_IDLE
According to the state documentation, this state does not need to handle
devices:

> Runtime idle is a system sleep state in which all of the cores enter
deepest possible idle state and wait for interrupts, no requirements for
the devices, leaving them at the states where they are.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-30 16:05:59 -04:00
Christopher Friedt
c4ecd78ce1 Revert "drivers: spi: stm32 can support TI mode for the SPI frame format"
This reverts commit d563313ab1.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-09-30 16:04:37 -04:00
Christopher Friedt
137594c666 Revert "dts: stm32 spi can configure the frame-format"
This reverts commit 394996313a.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-09-30 16:04:37 -04:00
Szymon Janc
6cfc6fa8e1 tests: bluetooth: tester: Add support for L2CAP Credits command
This allows IUT to return credits on specified L2CAP channel when
requested by Upper Tester.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-09-30 08:28:34 -04:00
Felipe Neves
6020afe46a soc: riscv: esp32c3: update west version
to enable wifi subsystem for esp32c3, also
update the linker with proper wlog sections.

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-09-30 06:39:55 -04:00
Felipe Neves
d4ed7f69d4 drivers: entropy: esp32: enable rng driver
for esp32c3 allowing wifi subsystem to use inside
its driver.

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-09-30 06:39:55 -04:00
Aurelien Jarno
bb881407fb dts/arm/st: wl: add DMA and DMAMUX nodes
The STM32WL family has two stm32-dma-v2 controllers and one stm32-dmamux
controller.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2021-09-30 06:37:43 -04:00
Anas Nashif
e993883ab5 VERSION: bump main branch to 2.7.99
Move main branch to 2.7.99. 3.0.0 is the next release coming out of this
branch.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-09-30 06:36:53 -04:00
Vinayak Kariappa Chettimada
b3f31f567b manifest: EDTT: Update revision
Update revision of EDTT tools.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-30 11:47:57 +02:00
Vinayak Kariappa Chettimada
273cf4687b tests: Bluetooth: bsim: Use separate DUT and TST EDTT builds
Use separate DUT and TST builds in EDTT HCI tests so that
the tester can send Data Length Requests with txOctets and
maxTxTime as required by the test specification. TST build
has HCI parameter checks disabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-30 11:47:57 +02:00
Vinayak Kariappa Chettimada
5cb3721313 Bluetooth: Controller: Fix HCI command parameter check failures
Fix assorted HCI command parameter check failures faced
during conformance testing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-30 11:47:57 +02:00
Aleksandr Khromykh
5130db3005 test: Bluetooth: Mesh: OOB public key provisioning
PR includes test that combines and checks OOB public key
provisioning with all possible OOB authentications
and OOB public key provisioning without auithentication.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-09-29 15:34:13 -04:00
Aleksandr Khromykh
797c17436b Bluetooth: Mesh: logging public key in big endian
Local public key has been logged in little endian but
remote public key in big endian. That has been changed.
Both are logged in big endian to be able to compare in logs.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-09-29 15:34:13 -04:00
Aleksandr Khromykh
ebf9a591d6 Bluetooth: Mesh: split debug for prov and prov_device
Debug configuration for prov and prov_device has been split
since prov general modul and it is used for provisioner as well.
It is not necessary to enable prov_device debugging
to debug provisioner.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-09-29 15:34:13 -04:00
Frank Audun Kvamtrø
fb90efef1b modules: mbedtls: Allow custom mbedtls implementation
-The current scheme in zephyr has the two choices MBEDTLS_BUILTIN
 and MBEDTLS_LIBRARY, but the choice of MBEDTLS_LIBRARY requires
 setting CONFIG_MBEDTLS_INSTALL_PATH for includes and library linking.
 This may not be neccesary when an alternative implementation of the
 library is being used. This adds support for custom choices in
 MBEDTLS_IMPLEMENTATION which can be added in an out-of-tree Kconfig
 file.
-Made else an elseif(CONFIG_MBEDTLS_LIBRARY.
-Removed reduntant assertion between the two choices.

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
2021-09-29 15:32:40 -04:00
Robert Gałat
464cd567a9 coredump_log: coredump log in panic mode
Current impementation assumes that CONFIG_LOG_IMMEDIATE=y
guarantees complete transfer, and it is not true.
In my opinion core dump should always be printed in panic mode.

Signed-off-by: Robert Gałat <robert.galat@nordicsemi.no>
2021-09-29 14:50:12 -04:00
Rubin Gerritsen
ca088aafbe Bluetooth: host: Warn on incomplete adv reports
When the controller forwards incomplete reports to the host,
the application currently has no way of reassembling them.
Therefore the application may fail to parse the data.

Issue a warning until
https://github.com/zephyrproject-rtos/zephyr/issues/37368
is resolved.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2021-09-29 14:47:47 -04:00
Francois Ramu
d563313ab1 drivers: spi: stm32 can support TI mode for the SPI frame format
Depending of the soc and SPI peripheral, the Frame-Format of the
SPI can be configured to support TI or Motorola protocol.
This is configured through a new DTS property.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-09-29 14:47:31 -04:00
Francois Ramu
394996313a dts: stm32 spi can configure the frame-format
If supported by the SPI instance and soc, this property will
configure the frame-format to be compliant with the TI mode.
By default, if supported, the frame-format is Motorola mode.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-09-29 14:47:31 -04:00
Andrzej Głąbek
5473b22275 drivers: i2s_nrfx: Fix a few minor fixes
- correct the names of buffers used by message queues so that it
  is possible to have multiple instances of the driver (in case
  such need appears in the future)
- make `stop` and `discard_rx` normal structure members, not bit
  fields, as they are modified in the interrupt handler and that
  could lead to overwriting of other bit fields located in the
  same memory unit
- add a log message providing the actual frame clock (WS) frequency
  (i.e. PCM rate) that the driver was able to configure (due to
  hardware limitations, it is not always possible to achieve the
  exact requested frequency and the driver selects the closest one
  available, so make it more visible to users

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-09-29 14:46:29 -04:00
Andrzej Głąbek
953f35f130 drivers: i2s_nrfx: Do not enforce two channels for I2S format
Remove unnecessary condition that effectively limits the usability
of the I2S format to two channels mode only.
Although the description of the `i2s_config` structure contains
a remark that for the I2S format the specified number of channels
is ignored and always two are used, in fact only one other in-tree
driver (i2s_sam_ssc) applies such limitation.
The nRF I2S hardware has no problem with handling the I2S format
with audio data for only one channel, so there is no need for having
this limitation in the driver, and without such mode of operation of
the driver it is impossible to feed it with PCM data directly from
the PDM peripheral working in one channel mode.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-09-29 14:46:29 -04:00
Henrik Brix Andersen
7cc24c370a boards: arm: mimxrt1024_evk: enable watchdog
Enable the on-chip watchdog of the NXP i.MX RT1024 Evaluation Kit.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-09-29 14:45:39 -04:00
Vinayak Kariappa Chettimada
aa4b75b58c Bluetooth: Controller: Separate address get and read functions
Have separate Bluetooth Device address get and read
functions, remove use of function just to return Extended
Advertising Random address and replace with simple
assignment statement.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-29 14:44:47 -04:00
Vinayak Kariappa Chettimada
d7cfb5473b Bluetooth: Controller: Use defines for aux pointer offset unit value
Use defines for aux pointer offset unit value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-29 14:44:47 -04:00
Vinayak Kariappa Chettimada
651137ee11 Bluetooth: Controller: Fix Extended Advertising channel use
Add implementation defined channel index in the auxiliary
pointer of the common extended payload format in the primary
channel PDUs and the same be used in the transmission of
auxiliary PDUs.

Fixes #35668.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-29 14:44:47 -04:00
Vinayak Kariappa Chettimada
3075ba92d1 Bluetooth: Controller: Add FIXME for Per Adv chain channel use
Add FIXME comments for missing use of channel selection
algorithm for Periodic Advertising chained PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-29 14:44:47 -04:00
Vinayak Kariappa Chettimada
ec784fd420 Bluetooth: Controller: Add advertiser clock accuracy value
Add implementation to set correct Advertiser's clock
accuracy value in the auxiliary pointer field in the common
extended payload format.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-29 14:44:47 -04:00
Vinayak Kariappa Chettimada
6af9a433c2 Bluetooth: controller: Fix populate offset in latest advertising PDU
Fix implementation to populate the aux, and sync offset
in the latest PDU. If both the current and latest of the
double buffer has been filled and LLL did not pick the
latest PDU, then the offset should be filled into the latest
PDU (and not into the first/current PDU).

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-29 14:44:47 -04:00
Vinayak Kariappa Chettimada
3ce9b2f2f5 Bluetooth: Controller: Minor indentation fixes
Minor indentation fixes.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-29 14:44:47 -04:00
Vinayak Kariappa Chettimada
3a8bf279d9 Bluetooth: Controller: Explicitly typecast void return for memcpy calls
Explicitly typecast void return for memcpy calls.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-29 14:44:47 -04:00
Vinayak Kariappa Chettimada
ec10ef601d Bluetooth: Controller: Minor rename of ULL internal function
Rename ULL internal helper function to get the random
address.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-29 14:44:47 -04:00
Pieter De Gendt
f68929067b boards: arm: Enable hwinfo driver on mimxrt1064_evk
Enable the status reset controller on mimxrt1064.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-09-29 14:44:21 -04:00
Pieter De Gendt
4e2bb0e762 drivers: hwinfo: add reset cause support for iMX RT series
Add a shim driver to get/clear the reset reason on NXP i.MX
RT controllers

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-09-29 14:44:21 -04:00
Pieter De Gendt
00596182fc drivers: hwinfo: add reset causes
Add reset causes for temperature (e.g. overheating), hardware faults
and a user initiated reset.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-09-29 14:44:21 -04:00
Jim Shu
8d8d6d9a6a riscv: linker: fix PMP support on non-XIP system.
On non-XIP system, RAM region overlaps ROM region which cause PMP region
overlapping. Padding RAM region by adding a output section to update
the next free address of RAM region.

Signed-off-by: Jim Shu <cwshu@andestech.com>
2021-09-29 14:44:04 -04:00
Jim Shu
c1dc4a6f61 riscv: linker: fix __rom_region_end in non-XIP system
In non-XIP system, because ROMABLE_REGION == RAMABLE_REGION, setting
__rom_region_size/end symbol at linker script end will mistakely
contain RAMABLE_REGION in it.

Move __rom_region_end symbol to end of common ROMABLE_REGION (text
and rodata) instead in non-XIP system.

Signed-off-by: Jim Shu <cwshu@andestech.com>
2021-09-29 14:44:04 -04:00
Anas Nashif
4a35785240 templates: fix label for feature request
Fix label to match what we have on Github.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-09-29 14:13:48 -04:00
Carles Cufi
301a7103a0 Bluetooth: common: Add build asserts for address struct sizes
In some HCI packed structures we place non-packed structs inside (in
particular the address structs).
Alignment is not an issue for those because all their members are just
byte-aligned, but size is. If the compiler ever packs those it would
become a real problem, and so detect this at build time.
See the link below for more info:
https://stackoverflow.com/a/66389167

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-29 19:07:52 +02:00
Joakim Andersson
da31a33905 Bluetooth: host: Access local IRKs consistently
Change the way the local IRKs are accessed to be consistent with the
all other uses.
Coverity thinks using the pointer to the array is suspicious in this
case.

Fixes: #38130

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-09-29 10:44:38 -04:00
Joakim Andersson
b7ad63362c Bluetooth: host: Verify valid local identity loaded from settings
Verify that the local identity loaded from the settings key is
valid for the current configuration.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-09-29 10:44:38 -04:00