Commit graph

8529 commits

Author SHA1 Message Date
Lingao Meng
aeb12304b3 Bluetooth: Mesh: Add common section for ext_adv
Use section for omit macro config.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-12-02 09:23:54 +02:00
Emil Lindqvist
5af3bbb27b pm: remove irrelevant type qualifier on pm_power_state_next_get
The type qualifier of the return type is causing warnings if
-Wignored-qualifiers, and it's irrelevant anyways since
the function returns a value and not a pointer

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2021-12-01 14:03:55 -06:00
Lukasz Majewski
ab1f0b55d5 net: dsa: ksz8794: Use CONFIG_DSA_KSZ_TAIL_TAGGING in preprocessor macros
The name of macro to enable tail tagging support in DSA KSZ driver is
CONFIG_DSA_KSZ_TAIL_TAGGING, not DSA_KSZ_TAIL_TAGGING.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-12-01 13:58:08 -06:00
Markus Fuchs
c6bc548b73 json: Add top-level array decoding support
The library supports encoding JSON objects and arrays as well as
parsing JSON objects. Introduce a new function json_arr_parse() adding
support for parsing top-level JSON arrays.

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2021-12-01 12:21:19 -05:00
Ederson de Souza
53fb94c7e3 tracing: Fix k_fifo_put_list tracing for CONFIG_TRACING_NONE=yes
k_fifo_put_list() tracing entry points are called
sys_port_trace_k_fifo_put_list_enter and
sys_port_trace_k_fifo_put_list_exit, however, they were misnamed in
"tracing.h". So anyone using tracing and CONFIG_TRACING_NONE=yes would
see compilation errors if they tried to use k_fifo_put_list().

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2021-12-01 05:03:43 -05:00
Daniel Leung
dc34f6c84d xtensa: introduce support for GDB stub
This adds basic support for GDB stub on Xtensa. Note that
this only provides the common bits on the architecture side.
SoC support is also required to fully enable GDB stub on
each Xtensa SoC.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung
31f148a88e debug: gdbstub: add stubs to support breakpoint/watchpoint
This adds the architecture interface so that the GDB stub can
deal with breakpoints and watchpoints. By default, weak
functions are implemented to indicate breakpoints and
watchpoints are not supported.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung
48da4dbb2a debug: gdbstub: add bits to restrict memory read/write
This adds bits for architectures, SoCs or boards to restrict
memory access in GDB stub. This is mainly to make sure
GDB stub only read/write to memory that can be legally accessed
without resulting in memory faults.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung
6eaaaa9acc debug: gdbstub: introduce gdb_bin2hex()
Adds a new function gdb_bin2hex() to convert binary into
hexadecimal string representation. This is similar to
bin2hex() but does not force a null character at the end
of the output buffer. This avoids an issue where the last
character of the hexadecimal string is replaced with
null character before sending to GDB.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung
9486cf7482 x86: gdbstub: remove ARCH_GDB_NUM_REGISTERS
Common GDB Stub no longer uses ARCH_GDB_NUM_REGISTERS.
So remove it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung
e76d385e49 debug: gdbstub: add arch-specific funcs to read/write registers
This adds architecture-specific functions to read/write registers.
This allows architecture to have a sparse representation of
the register file as not all registers are saved during context
switches. This saves some runtime space, and provides some
flexibility on what architectures can do.

Remove from header the need to define ARCH_GDB_NUM_REGISTERS as
it is no longer used in the common gdbstub code.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung
e1180c8cee x86: gdbstub: add arch-specific funcs to read/write registers
This adds some architecture-specific functions to read/write
registers for the GDB stub. This is in preparation for the actual
introduction of these functions in the core GDB stub code to
avoid breaking the build in between commits.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Stephanos Ioannidis
d67c1f389d riscv: Fix C++ exception handling info linking
The RISC-V architecture linker script was including `cplusplus-ram.ld`
linker script before `__data_region_start`, and this caused the content
of `.gcc_except_table` section to be not copied to the RAM by the
`z_data_copy` function; leading to the C++ exception handling
malfunction.

This commit relocates the `cplusplus-ram.ld` linker script inclusion
such that the contents of the relevant sections are properly copied by
the `z_data_copy` function.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-11-30 14:36:44 -05:00
Flavio Ceolin
e9fb33ebff drivers: clock_control: Opaque type for clock rate
Add an opaque type that is platform specific to be used when setting a
clock rate.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-30 14:04:38 -05:00
Flavio Ceolin
2c9fdbfb17 drivers: clock_control: Add API to set the clock rate
Add a new API to set the clock rate synchronously and asynchronously.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-30 14:04:38 -05:00
Dominik Ermel
d788bc6df0 mgmt/mcumgr: Correct packet length information
The packet length should include length of CRC16.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-30 11:44:26 +01:00
Flavio Ceolin
00252b8d9e pm: Fix documentation section
pm_power_state_next_get does not belong the pm subsys hooks section.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-29 19:37:55 -05:00
Jakob Krantz
2f6b9ce406 Bluetooth: host: Expose per adv evt counter in CTE IQ report.
Allows the application to access the periodic advertising counter.

Signed-off-by: Jakob Krantz <jakob.krantz@u-blox.com>
2021-11-29 18:56:13 -05:00
Erwan Gouriou
aad0f000c6 include/dt-bindings/pinctrl: stm32: Remove c pinmux api leftover
Following definitive transition to dts pinmux then pinctrl api
remove C pinmux api leftover definitions.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-29 18:26:29 -05:00
Krzysztof Chruscinski
7831bfcce8 lib: os: cbprintf: Add flags to CBPRINTF_MUST_RUNTIME_PACKAGE
Add flags to macro which checks if string must be packaged
using runtime approach.

Added flag CBPRINTF_MUST_RUNTIME_PACKAGE_CONST_CHAR. When flag
is set then const char pointers are considered as pointers to
fixed strings and do not require runtime packaging.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-11-29 21:13:56 +01:00
Tomasz Bursztyka
1c1a2ccdbd dts/bindings: Add a dedicated frame format property on SPI device
Most of the time SPI devices use TI's frame format. But some may use
Motorola's. This is already taken care of in the SPI API and now it will
be possible to select the right format from DTS. Like:

    ...
    frame-format = <SPI_FRAME_FORMAT_MOTOROLA>;
    ...

This is only meant to be used for devices supporting both formats (so
the format is not hard-coded in the driver) and selected by hardware
configuration or else.  Which, in such case, it will need to use
DT_INST_PROP(<instance number>, frame-format) macro call to retrieve
the property value. Others can fully ignore it.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2021-11-29 17:17:36 +01:00
Tomasz Bursztyka
bc1124cf86 spi: Adding a new configuration bit for the frame format
So TI will no longer be the only frame format available, though it will
still be the default one. It will be possible to select the Motorola
frame format when relevant.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2021-11-29 17:17:36 +01:00
Ruibin Chang
fad78a2c07 ITE drivers/sensor: add tachometer driver for it8xxx2_evb
Add tachometer driver for it8xxx2_evb.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2021-11-29 08:25:19 -05:00
Alexandre Bourdiol
20e46c240c include: drivers: clock_control: stm32u5 missing MSIS define
Missing definition of STM32_SYSCLK_SRC_MSIS
especially needed for STM32U5

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-11-29 05:27:19 -05:00
Gerard Marull-Paretas
89a4f36fc8 device: remove inclusion of pm/device.h
The device PM subsystem _depends_ on device, not vice-versa. Devices
only hold a reference to struct pm_device now, and initialize this
reference with the value provided in Z_DEVICE_DEFINE. This requirement
can be solved with a forward struct declaration, meaning there is no
need to include device PM headers.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-29 11:08:38 +01:00
Gerard Marull-Paretas
84cb35cc04 drivers: timer: remove declaration for non-existing function
The clock_device_ctrl function is no longer available, so remove its
declaration.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-29 11:08:38 +01:00
Vinayak Kariappa Chettimada
9d84f7727b Bluetooth: Add defines for Periodic Advertising Enable and ADI support
Add defines for Periodic Advertising Enable and ADI support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-26 10:26:17 -05:00
Gerard Marull-Paretas
6399ad50f4 drivers: pinctrl: nrf: add support for uart/uarte peripheral
Add support for configuring UART/UARTE peripheral pins.

Co-authored-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-26 14:20:51 +01:00
Gerard Marull-Paretas
22c8c02145 drivers: pinctrl: nrf: initial support
Add initial support for nRF pin controller driver. The implementation in
this patch does not yet support any peripheral. Only states
representation and basic driver functionality is introduced.

Note:
The nrf_pin_configure function has been marked as __unused since it may
not be used in certain scenarios until all peripherals are supported by
the pinctrl driver. For example, if only UART/E is supported but the
board does not enable UART, the function will never get called. However,
that board will likely have other peripherals that will gain support in
the future.

Thanks to Marti Bolivar for bindings documentation.

Co-authored-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-26 14:20:51 +01:00
Gerard Marull-Paretas
b5d6aa29e8 pm: device: move Z_DEVICE_PM_DEFINE_PM_SLOT to pm
The macro has been moved to the pm/device.h header, being now called by
the Z_PM_DEVICE_DEFINE macro. This means that a slot will only be
created if the device uses PM, thus reducing memory usage.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-26 10:42:55 +01:00
Neil Armstrong
f8f2936dba pcie: add initial controller support
This adds :
- Generic PCIe Controller layer implementing the current PCIe API
- Generic PCIe Controller in ECAM mode driver

The Generic PCIe Controller layer provides:
- Configuration space read/write
- single bus endpoint enumerations
- Endpoint I/O, MEM & MEM64 BARs allocation
- Endpoint I/O, MEM & MEM64 BARs get & translation for drivers

The Generic PCIe Controller in ECAM mode driver provides:
- Raw DT RANGES properties into usable PCIe regions
- Configuration space read/write into ECAM config space
- PCIe regions allocation & translation

The limitations are:
- No support for PCIe prefetchable regions
- No support for PCIe bus configuration (only bus0 is supported)
- No support for multiple controllers (no domain-id in BDF)

Support has been designed to initially support Root Complexes with
Root Complex Integrated Endpoint, which was designed for Embedded
Systems with internal-only PCIe Endpoints on bus 0.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-11-25 18:37:15 +01:00
Neil Armstrong
c714368691 pcie: add PCIe Controller API
This adds a generic PCIe Controller driver API providing the
necessary callbacks & config structure to handle the PCIe
config space and BAR regions handling.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-11-25 18:37:15 +01:00
Robert Lubos
666e9f80d6 net: ipv6: Remove in6_addr from packed net_ipv6_hdr struct
Replace unpacked in6_addr structures with raw buffers in net_ipv6_hdr
struct, to prevent compiler warnings about unaligned access.

Remove __packed parameter from `struct net_6lo_context` since the
structure isn't really serialized.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-25 10:46:35 -05:00
Robert Lubos
064200b420 net: ipv4: Remove in_addr from packed net_ipv4_hdr struct
Replace unpacked in_addr structures with raw buffers in net_ipv4_hdr
struct, to prevent compiler warnings about unaligned access.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-25 10:46:35 -05:00
Robert Lubos
bbdeef4ac4 net: arp: Remove in_addr/in6_addr from packed net_arp_hdr struct
Replace unpacked in_addr/in6_addr structures with raw buffers in
net_arp_hdr struct, to prevent compiler warnings about unaligned
access.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-25 10:46:35 -05:00
Robert Lubos
0da228c57c net: ip: Verify that in_addr/in6_addr struct sizes are correct
Make sure that in_addr/in6_addr structure size match the respective
binary IP address size with BUILD_ASSERT.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-25 10:46:35 -05:00
Maik Vermeulen
f2ca6a8c22 net: lwm2m: Add observe callback for observe and notification events
Added an observe callback so that the application can register to
receive events like observer added/deleted, and notification acked/
timed out. The notifications can be traced back to the exact data
contained within them by use of the user_data pointer.

Fixes #38531.

Signed-off-by: Maik Vermeulen <maik.vermeulen@innotractor.com>
2021-11-25 10:45:36 -05:00
Lucas Dietrich
0a0e9079c3 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-11-25 10:44:17 -05:00
Lucas Dietrich
4e103bcb20 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-11-25 10:44:17 -05:00
Zheng Huajiang
513517fa5c Bluetooth: Host: Fix ble event mask macro define
Arrange ble event mask bits in order, according to LE Set Event Mask
command parameters.

Signed-off-by: Zheng Huajiang <hjzheng@bouffalolab.com>
2021-11-25 16:10:33 +02:00
Abe Kohandel
a6f932a194 bluetooth: ots: Add Create and Delete procedures
Add the ability to perform an OTS Create or Delete Procedure.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2021-11-24 21:49:11 +02:00
Daniel Leung
5f20e31b5b lib/os: bitarray: introduce SYS_BITARRAY_DEFINE_STATIC()
This allows to declare a static bitarray struct that is local
to the source file.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-24 14:22:23 -05:00
Flavio Ceolin
f95370c413 pm: device: Deprecate pm_device_state_set
Deprecate pm_device_state_set in favor of pm_device_action_run.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-24 14:21:50 -05:00
Flavio Ceolin
9adffd620a pm: device: Add pm_device_action_run
Devices PM callback receive an action and not a state. Add a new API
that receives an action instead of a state.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-24 14:21:50 -05:00
Nicolas Pitre
61c300f92c net: bridge: make the orig_iface info available
The per-packet orig_iface information is available when
CONFIG_NET_ROUTING is set. It is pretty useful to have it
available with CONFIG_NET_ETHERNET_BRIDGE as well.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-11-24 14:21:32 -05:00
Jordan Yates
1d7b63d0fe net: buf: STRUCT_SECTION_ITERABLE for pool decl
Use the `STRUCT_SECTION_ITERABLE` helper macro when declaring buffer
pools instead of manually doing the same thing.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Jordan Yates
8e99db5801 Kconfig: net: deprecate NET_BUF_USER_DATA_LEN
As user data sizes are now set on a per pool basis, this Kconfig option
has no purpose.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Jordan Yates
df327eeb58 net: buf: POOL_FIXED_DEFINE explicit user data
Update the macro prototype to explicitly require the length of the
desired user data. Update all in-tree usage of this macro.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Jordan Yates
d17e0439c2 net: buf: POOL_HEAP_DEFINE explicit user data
Update the macro prototype to explicitly require the length of the
desired user data. Update all in-tree usage of this macro.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Jordan Yates
8236b600f7 net: buf: POOL_VAR_DEFINE explicit user data
Update the macro prototype to explicitly require the length of the
desired user data. Update all in-tree usage of this macro.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00