Commit graph

15409 commits

Author SHA1 Message Date
Carlo Caione
7cb91be0c0 ipc_service: Extend API with nocopy functions
Add several new functions to the IPC service API:
  - ipc_service_get_tx_buffer()
  - ipc_service_drop_tx_buffer()
  - ipc_service_send_nocopy()
  - ipc_service_release_rx_buffer()
  - ipc_service_hold_rx_buffer()

This set of function is used to support backends with nocopy capability.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-01 09:05:06 -05:00
Carlo Caione
065eda4675 ipc_service: Use dir indication in parameters
And add some more details in documentation.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-01 09:05:06 -05:00
Tom Burdick
fda02eebf7 dma: Add read and write positions in dma_status
When using DMA with a circular buffer an application needs to know
where the hardware is in terms of its read and/or write positions.
Without this information, the circular buffer isn't very useful!

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-01 09:12:20 -04:00
Mohan Kumar Kumar
5d37de8551 net: add rcvbuf socket option
Introduce set/get SO_RCVBUF option using the setsockopt
function. In addition, use the rcvbuf value to set the
tcp recv window.

Signed-off-by: Mohan Kumar Kumar <mohankm@fb.com>
2022-04-01 13:30:09 +02:00
Daniel Leung
f7d3d0268e logging: v2: add kconfig to always add indexes to msg packages
This adds a new CONFIG_LOG2_MSG_PKG_ALWAYS_ADD_RO_STRING_IDXS
kconfig. If enabled, the log message packages will always have
the indexes of read-only string arguments appended to the package.
This will be selected only by those backends requiring it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Carles Cufi
00636682ca Bluetooth: host: Introduce a new bt_hci_le_rand() call
In order to get rid of the duplication of the code that we had until now
in the tree, consolidate the handling of multiple calls to
bt_hci_cmd_send_sync(BT_HCI_OP_LE_RAND, ...) in a single location,
namely in hci_core.

This allows all of the users of this HCI command to use a single
implementation of the iterated sending of the HCI command to fill a
buffer with random bytes.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-04-01 11:21:51 +02:00
Benjamin Bigler
6807d75e16 net: lwm2m: Fix TLS_HOSTNAME is always set
LWM2M Client Sample with DTLS enabled fails because TLS_HOSTNAME is set
but MBEDTLS_X509_CRT_PARSE_C is disabled which leads to error
'net_lwm2m_engine: Failed to set TLS_HOSTNAME option: 109'
Add new field hostname_verify to let the application decide if hostname
should be checked.

Signed-off-by: Benjamin Bigler <benjamin.bigler@securiton.ch>
2022-03-31 14:33:04 -05:00
Maciej Zagrabski
ac71af1001 cfb: introduce invert area function
Allow user to invert part of a screen, as a part of rendering.

Signed-off-by: Maciej Zagrabski <maciej.zagrabski@grinn-global.com>
2022-03-31 11:58:29 -05:00
Gerard Marull-Paretas
94e50a7a9b devicetree: deprecate DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL
DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL was the last macro to be
deprecated from the DT_CHOSEN_()_LABEL series. All its usages have been
replaced with DT_CHOSEN(zephyr_flash_controller), usually combined with
DEVICE_DT_GET to obtain references at compile time.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-31 13:55:10 +02:00
Carlo Caione
18914ccdd4 devicetree_regions: Remove path fallback and sanitize name
This patch is doing two things:

- it is removing the fallback on the path. This is not possible anymore
  since the DT binding file is now actually requiring the
  'zephyr,memory-region' property to be present from which the region
  name is obtained.

- it is sanitizing the name when CONFIG_CMAKE_LINKER_GENERATOR is used
  or not.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-03-31 10:29:31 +02:00
Francois Ramu
7216665501 dts: pwm : flag to enable a complementary output of a stm32 pwm channel
Depending on the stm32 soc and the timer instance, several channels
can enable the complementary output for the PWM signal
This flag completes the PWM_POLARITY for a PWM channel in the
upper byte of the pwm_flags_t.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-31 10:28:47 +02:00
Francois Ramu
2c4566f343 include: drivers: pwm: extend the pwm flags to be soc specific
Add 8 bits to the pwm_flags_t so that upper byte is reserved
for non-standard but soc specific dts flags and keeping the low
Byte for standard flags.
Some of SoC like STM32 mcus can then define their own flags
in their dt-bindings/pwm.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-31 10:28:47 +02:00
Krzysztof Chruscinski
b98f8e39fa logging: Adapt logging to use new cbprintf feature
Adapt logging to always use static packaging. Runtime packaging
is used only when configuration requires that. Static packaging
significantly speeds up logging when there are string arguments.

Update log_stack test to new stack usage.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-30 16:16:40 -04:00
Ryan Erickson
69ffc1f228 modem: hl7800: add API to set bands
Add API to set LTE bands at runtime.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-03-30 11:39:06 +02:00
Emil Gydesen
78fe76156b Bluetooth: Host: Add const to bt_conn_index
The `bt_conn_index` simply returns the index
of a `bt_conn` struct. There is no reason why
such a function should not use `const`.

Not using `const` will make other lookup/index
functions that perhaps relies on the bt_conn index
unable to use `const` as well.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-30 11:32:08 +02:00
Robert Lubos
22f970b97f net: pkt: Add net_pkt_rx_clone() function
Add a function which allows to clone a packet, using RX packet poll to
create the clone.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-03-30 11:08:22 +02:00
Krzysztof Chruscinski
a33f7de86a lib: os: cbprintf: Add CBPRINTF_PACKAGE_COPY_KEEP_RO_STR flag
Add flag to copy function which indicates that read-only
string locations shall be kept in the output package.

Updated cbprintf_package test to pass.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-29 23:03:35 -04:00
Tomislav Milkovic
352a6bec9b include: dt-bindings: display: add defines for STM32 LTDC
Add defines for specifying RGB interface signal
polarities for STM32 LTDC peripheral

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-03-29 18:30:02 -07:00
Henrik Brix Andersen
372cee4268 drivers: can: convert can_calc_timing*() to syscalls
Convert can_calc_timing() + can_calc_timing_data() to syscalls and use
the newly added syscalls calls for determing the minimum/maximum
supported timing parameter values.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-29 17:05:56 -07:00
Henrik Brix Andersen
15fde0a357 drivers: can: add syscalls for getting min/max timing values
Add CAN system calls for getting the minimum/maximum timing values
supported by a given CAN controller device driver instance:
- can_get_timing_min()
- can_get_timing_max()
- can_get_timing_min_data()
- can_get_timing_max_data();

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-29 17:05:56 -07:00
Stephanos Ioannidis
44ddb308c7 toolchain: Override __INTN_C macros to match Zephyr stdint types
This commit overrides the toolchain internal `__INTN_C(value)` integer
constant macros to match the types defined by the `zephyr_stdint.h`
header.

For more details, refer to the GitHub issue #44199.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-03-29 12:34:08 -07:00
Emil Obalski
d877e1dded ipc_service: Automatically include source files for backends
The purpose of this change is to allow to enable more than one
backend at once by removing choice from ipc-service backend Kconfig
and depending backend Kconfig option on existing of correct compatible.

Overwriting IPC_SERVICE_BACKEND option in some places is removes
as no longer needed.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2022-03-29 12:30:50 -07:00
Adrian Bonislawski
8ea474e8fc dma: Status gives free bytes in buffer
Adds to the dma_status struct the number of free bytes available
in the current transfer buffer.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-03-29 14:33:48 -04:00
Adrian Bonislawski
b19e8cf979 dma: Add config option for cyclic transfer lists
Adds a bit flag config option for cyclic transfer lists, where the
transfer list tail may link to its head creating a never ending
loop of transfer descriptors.

DesignWare DMA supports such cyclic transfers.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-03-29 14:33:48 -04:00
Daniel DeGrasse
585eb7f9cb include: dt-bindings: fix overlap between SYSCON clock constants
Fix all syscon dt bindings clock constants to avoid any overlap, to
prevent case statement in mcux syscon clock driver from failing to
build.

Fixes #44216

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-29 10:31:21 -05:00
Wilfred Mallawa
378e75ea0c include: app_memory: mem_domain: fixup single typo
Fixup a single typo in `mem_domain.h`.

Signed-off-by: Wilfred Mallawa <thulith.mallawa@uqconnect.edu.au>
2022-03-29 10:29:34 -05:00
Davide Bortolami
bd4d7fb5bd include: usb: add missing HID collection types
Add Logical, Report, Named Array, Usage Switch,
and Modifier collections types.

Signed-off-by: Davide Bortolami <davide.bortolami@thinksmartbox.com>
2022-03-28 17:59:47 +02:00
Carlo Caione
92d8329d5b ipc_service: static_vrings: Move to one WQ per instance
Instead of having one single WQ per backend, move to one WQ per
instance instead and add a new "zephyr,priority" property in the DT to
set the WQ priority of the instance. Fix the sample as well.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-03-28 12:46:15 +02:00
Emil Gydesen
a7ed7b7250 Bluetooth: Audio: Make bt_tbs_client_cb const
Add `const` for the bt_tbs_client_cb as it is a singleton
that should not change over time.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-28 12:45:03 +02:00
Emil Gydesen
ab4056ad8a Bluetooth: Audio: Add Telephone Bearer Service client
Add a client for the telephone bearer service (TBS).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-28 12:45:03 +02:00
Emil Gydesen
2a08b9e73c Bluetooth: Audio: Add Telephone Bearer Service server
Add the telephone bearer service server implementation.
This support multiple service instances as well as the
generic telephone bearer service, but is still a work in
progress and should be treated as such.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-28 12:45:03 +02:00
Martí Bolívar
0faa4d04ca devicetree: fix DT_STRING_UPPER_TOKEN docstring
The return value is misleading.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-03-26 12:14:48 +01:00
Carlo Caione
b9e61d199b mbox: Move MBOX_DT_* macros
Move MBOX_DT_* macros to include/devicetree/mbox.h and use the correct
DT_MBOX_* prefix.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-03-25 16:02:09 -07:00
Erwan Gouriou
2bbd44e767 include/dt-bindings/pinctrl: stm32: Style and comment fixes
Add spaces around '<<'.
Remove an outdated comment.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-25 15:52:02 -07:00
Erwan Gouriou
48039bc555 drivers/pinctrl: stm32: Allow plain GPIO configuration
Based on introduction of plain GPIO configurations in STM32 pinctrl
bindings, update STM32 pinctrl/gpio drivers to make this functionality
available.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-25 15:52:02 -07:00
Erwan Gouriou
d017886a76 include/dt-bindings/pinctrl: stm32: Clean up unused defines
These are not used.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-25 15:52:02 -07:00
Emil Gydesen
66479fd001 Bluetooth: Host: Remove duplicated bt_auth callbacks
Remove the duplicated pairing_complete, pairing_failed
and bond_deleted informational callbacks from bt_auth.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-25 15:17:18 -07:00
Emil Gydesen
9c2cf4ded5 Bluetooth: Host: Add auth_info_cb struct
Add a new callback structure for Bluetooth authentication

This struct is meant to replace the information-only
callbacks in bt_conn_auth_cb. The reason for this is that
due to the nature of bt_conn_auth_cb, it can only be registered
once. To allow mulitple users gain information about pairing
and bond deletions, this new struct is needed.

Samples, tests, etc. are updated to use the new struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-25 15:17:18 -07:00
Ruibin Chang
a21d043f5b ITE drivers/sensor: add voltage comparator driver
Add voltage comparator driver for ITE it8xxx2 chip.

Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
2022-03-25 15:00:35 -07:00
Emil Gydesen
432c18e6dd doc: Bluetooth: Add generic audio framework (GAF) documentation
Add a brief overview and description of the GAF.
This also creates initial references to the LE Audio
implementations.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-25 15:44:03 +01:00
Emil Gydesen
fe91c1dbc4 Bluetooth: ISO: Add named enum for bt_iso_state
Add an enum for the state field, to provide more
semantics to it.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-25 15:36:02 +01:00
Emil Gydesen
9e862411b3 Bluetooth: ISO: Add STATE infix for ISO state enum
Change from BT_ISO_<state> to BT_ISO_STATE_<state>
to make the value more descriptive.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-25 15:36:02 +01:00
Emil Gydesen
5d25e34d89 Bluetooth: ISO: Add ing to the bt_iso (dis)connect-ing state
Add `ing` to the `BT_ISO_CONNECT` and `BT_ISO_DISCONNECT`
states, so that the name better matches the actual state.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-25 15:36:02 +01:00
Emil Gydesen
dc4d70da26 Bluetooth: conn: Expose simplified connection state in get_info
Add a state field in struct bt_conn_info that is a simplified
version of the internal state value (bt_conn_state_t).

This should provide an application to better determine the state
of the connection whne calling bt_conn_get_info, in case the
application does not keep track of the state itself.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-25 15:36:02 +01:00
Neil Armstrong
acd38cb30e pcie: controller: add generic controller MSI/MSI-X API core functions
Define the MSI/MSI-X APIs to be used with the Generic PCIe Controller API.

It notably adds the msi_device_setup() callback to the PCI Express
Controller API used to allocate and setup the MSI/MSI-C vectors on the
MSI message translater HW.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2022-03-25 12:56:25 +01:00
Neil Armstrong
432154749d pcie: msi: add generic MSI vector entry
Define a generic MSI vector entry to be used with the Generic PCIe
Controller API.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2022-03-25 12:56:25 +01:00
Neil Armstrong
318999d656 interrupt_controller: gicv3_its: add get_msi_addr API
Add get_msi_addr() callback to ITS API to retrieve the GITS_TRANSLATER
physical address to be set in the MSI message address field.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2022-03-25 12:56:25 +01:00
Asbjørn Sæbø
98fa332527 Bluetooth: Audio: Media control - guard callback
Exclude callback from struct when not needed.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-03-25 10:41:29 +01:00
Mariusz Skamra
a5d9322105 Bluetooth: gatt: Skip MTU exchange if already initiated by peer
This implements Core 5.3 recommendation to skip MTU Exchange procedure
if already performed by peer.

Core 5.3 | Vol 3, Part F 3.4.2.2:
If MTU is exchanged in one direction, that is sufficient for both
directions.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-03-25 10:41:19 +01:00
Mariusz Skamra
f619ca24d4 Bluetooth: gatt: Disallow repeated attempts to exchange MTU
The MTU can be exchange once during the connection by the client.
This ensures the ATT MTU Exchange request will not be sent again.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-03-25 10:41:19 +01:00