Commit Graph

52971 Commits

Author SHA1 Message Date
Anas Nashif
1a814fc0fd VERSION: bump version to 2.6.1-rc2
Update version to 2.6.1-rc2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-26 12:02:16 -04:00
Anas Nashif
69f162f6c9 requirements: pin west to 0.11.1
Some backward compatibility issues with latest west and building
documentation for this branch. Pin the version to fix doc builds.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-26 12:02:16 -04:00
Gerard Marull-Paretas
86cd2c84c3 ci: manifest: do not persist git credentials
With this setting enabled, Git credentials are not kept after checkout.
Credentials are not necessary after the checkout step, since we do not
do any further manual push/pull operations.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-25 07:10:24 -05:00
Gerard Marull-Paretas
b590a4f64a ci: bsim: split workflow
Split workflow into 2 chunks:

- One that runs tests
- A second one that publishes results

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-25 07:10:24 -05:00
Gerard Marull-Paretas
05d334baa0 ci: clang: do not persist git credentials
With this setting enabled, Git credentials are not kept after checkout.
Credentials are not necessary after the checkout step, since we do not
do any further manual push/pull operations.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-25 07:10:24 -05:00
Lucas Dietrich
c388f1a17e net: mqtt: Add support for TLS option TLS_CERT_NOCOPY
Add an option in MQTT client context to take advantage of the
"TLS_CERT_NOCOPY" option when using  TLS socket transport.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2021-12-14 15:20:44 +01:00
Lucas Dietrich
42cd204d3a net: sockets: tls: Support for DER cert chain and NOCOPY optimisation
Add TLS socket option "TLS_CERT_NOCOPY" to prevent the copy of
certificates to mbedTLS heap if possible.

Add support to provide a chain of DER certificates by registering
them with multiple tags.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
2021-12-14 15:20:44 +01:00
Vinayak Kariappa Chettimada
707162ce93 Bluetooth: Controller: Fix node rx memory corruption regression
Fix the node rx memory pool corruption regression introduced
due to same peer connection being rejected.

Regression introduced in commit 30f260dfaa ("Bluetooth:
controller: Fix adv/scan context access post release").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-08 11:15:40 -05:00
Thomas Wendtland
42d7e71206 drivers: display: fix faulty PM symbol in st7789v driver
the driver for the st7789v display uses an old define and therefore
does not compile. fix for the 2.6 branch, the 2.7 driver is already
correct.

Signed-off-by: Thomas Wendtland <twendtland@gmail.com>
2021-10-18 15:43:04 +02:00
Daniel Leung
2d6322d74a demand_paging: eviction/nru: fix incorrect dirty bit return val
In k_mem_paging_eviction_select(), the returned dirty bit value
may not be actually associated with the page selected, but
rather the last page examined. So fix this.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-09-22 07:28:33 -04:00
Alexandre Bourdiol
25771e6928 drivers: clock_control: stm32: enable PWR clock unconditionally
Enable PWR clock unconditionally for L4, L5 and U5
like it is done on other stm32 series

Fixes #37781

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-09-18 09:15:32 -04:00
Scott Worley
92e36185e8 [Backport v2.6-branch] Microchip: XEC GPIO driver interrupt enable part 2
Fixes issue #34879
This PR updates previous PR's 37138 and 37139.
Refer to issue 34879 for information from MCHP HW
designers. A delay after enabling interrupts is a
more appropriate work-around than depending upon
behavior of ARM DMB instruction.

Comparing to the original PR #37479 left changes only related to the
drivers/gpio/gpio_mchp_xec.c file
Tested  mec15xxevb_assy6853 board, no bugs GPIO detected.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2021-09-14 20:11:02 -04:00
Dylan Hung
68d33e3834 libc/minimal: locate the memory pool for malloc() to .bss
When CONFIG_USERSPACE is turned off, the POOL_SECTION will be located in
.data section.  This will increase the target binary size.  Since the
memory pool is for malloc() use and it doesn't need for initial values,
locate it in the .bss section to reduce binary size.

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Change-Id: Iee52ac06a48414c083518c79775fe31334eab674
2021-09-10 15:43:23 -04:00
Nicolas Marty
7f3abab9bf net: tcp: accept [FIN, PSH, ACK] in TCP_FIN_WAIT_2 state
TCP state machine gets stuck in TCP_FIN_WAIT_2 state
when server responds with [ FIN, PSH, ACK ]

Fixes #37842

Signed-off-by: Nicolas Marty <nicolas.marty@zuehlke.com>
2021-09-08 10:29:58 -04:00
Nicolas Pitre
533dcaf374 lib/os/cbprintf_nano.c: avoid sign extension on unsigned formats
There might be a sign extension when a long is promoted to
int_value_type and the former type is smaller than the later.
This produces the wrong output if the specified format is unsigned.

Let's avoid this problem by handling signed and unsigned cases
explicitly. When the type already matches int_value_type then the
compiler is smart enough to recognize the redundancy and removes
unneeded duplications automatically, meaning that the code will stay
small when code size matters.

A similar issue also existed in the restricted %llu case.
The fix is the same as above.

Those fixes exposed wrong results in the printk.c test with %llx
so fix that as well.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-09-03 08:17:19 -04:00
Daniel Leung
ea55ebfa74 tests: schedule_api: use stack array extern macro
The stack array tstacks was declared in the header file using
the same macro which defines the same stack array but with
an added "extern" in front. This macro adds alignment and section
attribute which are actually not the same as the actual stack array
defined in main.c. The section name used in the section attribute
contains the file name where the stack array is defined or extern
declared. So the same symbol, in this case z_interrupt_stacks, has
different attributes in two places, and GCC 11 starts to complain
about this. So use the newly introduced macro to extern declare
the stack array without adding/replacing any symbol attributes.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-30 09:17:47 -04:00
Daniel Leung
95bb8841b8 tests: mem_protect: fix warning on uninitialized variable
In test_kobject_release_null(), dummy is not initialized
before being fed to k_object_release(). So set it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-30 09:17:47 -04:00
Daniel Leung
1f8c53dfaf tests: kernel/common: avoid using compiler builtin popcount
Not all arch has native support for __builtin_popcount() on
hardware and GCC falls back in using software only implementation.
However, with GCC 11, this is no longer included automatically
and requires linking explicitly with libgcc.a. This is not
trivial as it requires changes some linker magic and a sizable
change to most linker scripts. So opt for an easy solution
by implementing our own popcount in the test.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-30 09:17:47 -04:00
Daniel Leung
7bb7454a00 kernel: use proper macro to declare extern interrupt stacks
The z_interrupt_stacks was declared extern in the kernel internal
header file using the same macro which defines the same stack
array but with an added "extern" in front. This macro adds
alignment and section attribute which are actually not the same
as the actual stack array defined in kernel/init.c. The section
name used in the section attribute contains the file name where
the stack array is defined or extern declared. So the same
symbol, in this case z_interrupt_stacks, has different
attributes in two places, and GCC 11 starts to complain about
this. So use the newly introduced macro to extern declare
the stack array without adding/replacing any symbol attributes.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-30 09:17:47 -04:00
Daniel Leung
25fd176014 kernel: add macros to allow declaring extern stack arrays
A stack can already be declared extern via K_KERNEL_STACK_EXTERN().
This adds similar macros for stack arrays.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-30 09:17:47 -04:00
Daniel Leung
e1cde092ac kernel: move Z_KERNEL_STACK_LEN higher in thread_stack.h
Moves Z_KERNEL_STACK_LEN() higher in the header file so it is
near the other stack size calculation macros. Also, it was
actually declared after it is first used in the header.
So this seems a logical move.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-30 09:17:47 -04:00
Daniel Leung
244049bd71 x86: type cast to uint8_t* for bit ops
This changes the type casting of the incoming addresses to
the bit ops from uint32_t* to uint8_t*. This avoids compilers
and static analyzers complaining about the incoming out of
bound access if incoming argument is an array smaller than
4 bytes.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-30 09:17:47 -04:00
Daniel Leung
5dae0c1bf0 kernel: ignore array bound warnings for generated syscall funcs
Compilers and static code analyzers do not understand Zephyr's
syscall mechanism so they always complain about out of bound
array access inside the generated syscall header functions.
So add a flag for GCC to ignore this type of warning for these
functions.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-30 09:17:26 -04:00
Daniel Leung
5666e4d525 cmake: force GCC to emit DWARF version 4
GCC 11 defaults to output DWARF version 5 which pyelftools cannot
currently parse. So keep output at version 4 for the time being.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-30 09:17:26 -04:00
Vinayak Kariappa Chettimada
91a78866ca Bluetooth: Controller: Fix advertising after connections from same peer
Fix the missing resumption of connectable advertising and
release of received connection complete buffers from LLL
after detecting connection from same peer.

Relates to commit 010c5c2f20 ("Bluetooth: controller:
Ignore connections from same peer").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-08-30 09:16:58 -04:00
Dong Wang
0afddb2341 x86/cache: fix issues in arch dcache flush function
Correct the wrong operand of clflush instruction. The old operand
points to a location inside stack and doesn't work. The new one
works well by taking linux kernel code as reference.

End address instead of size should get round up

Add Kconfig option to disable the usage of mfence intruction for
SoC that has clfulsh but no mfence supported.

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2021-08-30 09:16:39 -04:00
Michael Zimmermann
9bcf9b6a53 json: fix parsing first array-array element
Previously, the first element inside the array-array didn't contain the
decoded data.

Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
2021-08-30 09:15:58 -04:00
Chen Peng1
2595cce714 cmake: oneApi: add oneApi support on windows.
add .S file extension suffix into CMAKE_ASM_SOURCE_FILE_EXTENSIONS,
because clang from OneApi can't recongnize them as asm files on
windows, then they won't be added into build system.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2021-08-03 22:58:32 -04:00
Chen Peng1
18d314e750 cmake: oneApi: add oneApi support on windows
The icx compiler of oneApi will invoke clang-cl on windows,
this is not supported in zephyr now, so change to use
clang directly.
And the clang from oneApi can't recognize those cross
compiling target variables of cmake, such as
CMAKE_C_COMPILER_TARGET, so used other cmake functions
to pass them to clang.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2021-08-03 22:58:32 -04:00
Chen Peng1
c8755e0b46 tests/benchmarks: add dynamic memory allocation measurement
add a test into latency_measure test case to measure
the average time for dynamic memory allocation and release.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2021-08-03 16:17:15 -04:00
Anas Nashif
a4d35f0a3e doc: 2.6.1 release notes
Start release note section for 2.6.1.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-08-03 15:31:51 -04:00
Anas Nashif
7094aaee55 release: Bump release to 2.6.1-rc1
Bump version to 2.6.1-rc1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-08-03 15:31:51 -04:00
Erwan Gouriou
585c03a0b6 drivers/clock_control: stm32: Fix macro to get HCLK freq
__LL_RCC_CALC_HCLK1_FREQ is only available for WL and WB series,
for other series __LL_RCC_CALC_HCLK_FREQ should be used.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-07-24 18:18:16 -05:00
Patrick Rathje
cacb0a4e59 Bluetooth: L2CAP: Fix missing net_buf_unref()
In case of non-recoverable errors (e.g. the connection breaks while
transmitting), the l2cap_chan_tx_process deques the net_buf but does
not unreference it. As this is inside a work queue thread, the sending
thread gets no information on this error, relying on the tx_process to
ultimately free the buffer.

Signed-off-by: Patrick Rathje <git@patrickrathje.de>
2021-07-22 07:26:40 -05:00
Daniel Leung
78ab750540 timer: hpet: convert register access to functions
This converts register access from macro to functions.
This allows SoCs to override these functions if needed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-07-22 07:26:17 -05:00
Daniel Leung
d9df404d47 timer: hpet: don't force TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
This allows the HPET timer to use kconfig to specify clock
frequency instead of relying on calculation at runtime.
When the frequency is known at build, this allow the toolchain
to optimize some calculations.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-07-22 07:26:17 -05:00
Daniel Leung
8e80955511 timer: hpet: allow overriding MIN_DELAY
This renames MIN_DELAY to HPET_CMP_MIN_DELAY, and also allows it
to be overridden. The default delay is for HPET with relative
high frequency, and may not suitable for all HPET
implementations.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-07-22 07:26:17 -05:00
Daniel Leung
99dc33faaf timer: hpet: extract Counter Clock Period into a macro
This extracts the hard-coded value into a macro which can be
overridden. This is in preparation for SoCs where the period
is not in femptoseconds.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-07-22 07:26:17 -05:00
Marcin Niestroj
02fbe652a5 logging: fs: fix leak of opened directories in check_log_file_exist()
Opened directory descriptor is leaked when returning 1. Fix that by
utilizing goto in function return path.

Fixes: 6b18e6992d ("subsys/loggin/log_backend_fs: added recovery after
  file lost")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-07-21 05:50:18 -04:00
Daniel Leung
80b406d784 x86: acpi: limit search on where EBDA can be
This limits the search for Extended BIOS Data Area (EBDA) to
0x80000 to 0x100000 as this is usually the area for it.
If 0000:040e has an address not pointing to this area, it is
probably an invalid address, and should not be de-referenced
to avoid segfault.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-07-20 20:02:52 -04:00
Evgeniy Paltsev
837ab4a915 ARC: save/restore accumulator registers on all ARCv2 HS CPUs by default
Accumulator registers (ACCL, ACCH) are used on HS CPUs not only
in case of FPU usage but also in case of MPY usage. We enable MPY
for all ARCv2 HS in commit
18a24c3f6 ARC: gcc-m-cpu: use -mcpu=archs as a default for ARCv2 HS
but we didn't enable accumulator registers management.

Let's enable accumulator registers save/restore on all ARCv2 HS CPUs
by default.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-07-06 21:29:22 -04:00
Kumar Gala
0943608550 riscv: openisa_rv32m1: Fix booting of rv32m1_vega
rv32m1_vega don't boot due to device init ordering and changes with the
device model.  The soc code is looking for a device pointer for the
intmux.  Change to using DEVICE_DT_GET here as that will ensure we get
a valid pointer and by the time we need to utilize the pointer the
intmux driver will have been initialized and thus the device pointer
will be ready.

Also set BUILD_OUTPUT_HEX since we utilize openocd to flash and west
flash is looking for a hex file for openocd targets.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-07-02 06:36:28 -05:00
Stephanos Ioannidis
3c56e0df0b cmake: ld: Disable manual linking of libgcc components for host
When the host toolchain is used, `-nostdlib` option is not specified
and therefore all default libraries, including the libgcc and its
components, are automatically linked -- so it is not necessary to
manually link them here.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-07-01 07:24:48 -05:00
Stephanos Ioannidis
b0cb7412b9 cmake: host-gcc: Remove libgcc library path resolution
The host toolchain makes use of the host toolchain libraries (i.e.
`-nostdlib` is not specified), so it is not necessary to detect the
toolchain libgcc path and specify one manually.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-07-01 07:24:48 -05:00
Stephanos Ioannidis
80e1b785dc cmake: host-gcc: Detect libgcc for all archs
This commit updates the build system to always detect the libgcc path
for the host platforms regardless of the target architecture.

The native_posix_64 target previously used the x32 ABI (`-mx32`) and
the multilib for this ABI was not commonly available in the x86-64 host
toolchains.

That is no longer the case because native_posix_64 had been updated to
use the x86-64 ABI (`-m64`).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-07-01 07:24:48 -05:00
Stephanos Ioannidis
e72a327107 cmake: gcc: Remove no_libgcc exclusion for libgcc detection
This commit removes the `NOT no_libgcc` condition for the automatic
libgcc path detection.

The `no_libgcc` variable was previously set in this file to exclude
libgcc detection for the x86-64 targets because the x86-64 arch used
x32 ABI (`-mx32`) and the multilib for this ABI was not commonly
available. This is no longer the case (x86-64 targets now use `-m64`)
and libgcc must always be available.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-07-01 07:24:48 -05:00
Vinayak Kariappa Chettimada
1cf1d75d3f Bluetooth: Controller: Fix Data Length Update node Rx reservations
Reserve a minimum node rx of 2 that can happen when local
central initiated PHY Update reserves 2 node rx, one for PHY
Update complete and another for Data Length Update complete
notification. Otherwise, a peripheral only needs 1
additional node rx to generate Data Length Update complete
when PHY Update completes.

Relates to #36381.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-06-30 08:24:55 -05:00
Vinayak Kariappa Chettimada
e43afd10f7 Bluetooth: Controller: Fix free rx buffer MFIFO enqueue
Replace the post decrement in loop's conditional into
explicit decrement inside the loop so as to avoid
decrementing the maximum count without enqueueing free rx
buffers into the free rx buffer MFIFO.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-06-30 08:24:55 -05:00
Vinayak Kariappa Chettimada
6d9b318dca Bluetooth: Controller: Minor change to use IS_ENABLED
Minor changes to use IS_ENABLED and updates to comments in
code.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-06-30 08:24:55 -05:00
Martí Bolívar
d4d362d081 doc: api: fix devicetree modification version
This was modified in 2.6.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-06-29 13:25:42 -04:00