Rename the can_state enumerations to contain the word STATE to make their
meaning more clear:
- CAN_ERROR_ACTIVE => CAN_STATE_ERROR_ACTIVE
- CAN_ERROR_WARNING => CAN_STATE_ERROR_WARNING
- CAN_ERROR_PASSIVE => CAN_STATE_ERROR_PASSIVE
- CAN_BUS_OFF => CAN_STATE_BUS_OFF
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Expand the error return values reported by the CAN timing calculation
functions to be able to distinguish between an an out of range
bitrate/sample point, an unsupported bitrate, and a resulting sample point
outside the guard limit.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
The two macros are the same in this context. But an SoC may
redefine the GROUP_LINK_IN() macro which could introduce an
unintended change in this part of the linker script.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Currently __rom_region_end points to the virtual memory address, while
__rom_region_start points to the load memory address. In most cases the
two address spaces will be the same. In the case of the infineon xmc4xxx
series they can be different because flash can be read via a different
cachable address space.
Evaluate __rom_region_end as an offset from __rom_region_start to fix this
possible issue.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
If the rom region can be accessed via a virtual memory address,
then __rodata_region_end will point to the vma, while __rom_region_start
is the lma. This patch makes sure the two values are in the vma address
space.
This is in prepartion for a future patch which will allow the rom to be
accessed via a virtual memory address.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
This is needed when the flash can be accessed via a different vma
address as in the case of the infineon xmc4xxx series where 0xc000000
is the uncached start address and 0x8000000 is the cached start address.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Move gpio_cmsdk_ahb.h out of drivers/gpio and into include/drivers/gpio.
This is used by few board files so it should be in include.
This allows to remove few odd
"zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)".
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
We have now:
- CPU_HAS_{D,I}CACHE: when the CPU has support for d-cache and i-cache
- {D,I}CACHE: to enable / disable d-cache and i-cache
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This adds client support for switching the active preset along with bsim
tests implementation.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add support for reading the VFOCV register, which contains the model
estimated open circuit voltage for the cell.
Link: https://pdfserv.maximintegrated.com/en/an/AN6358.pdf
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Verify that the HCI ISO data packet is smaller than
the maximum SDU size we support, based on the group
settings.
Since we do not yet support fragmentation we also
verify that the data length is smaller than the
HCI ISO buffer size.
For the ISO peripheral is it not possible to know
the SDU, and we are forced to not send any value larger
than the PDU size.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
In the case that an endpoint goes down, it needs to be deregistered
from the ipc_service for cleanup. This function deregisters the endpoint
from the ipc_rpmsg instance and sets the endpoint to zero.
Signed-off-by: Jackson Cooper-Driver <jackson.cooper---driver@amd.com>
Per the HCI spec it is not possible to send the
HCI_LE_Create_CIS command while an outstanding request
is pending. To avoid failing the command we can
check and verify if any ISO connections are in the
pending state.
Since multiple ISO channels can be connected
in a single request, the solution implemented was
to iterate over all ISO connections and see if there was
any unicast ISO channels in the connecting state.
It also checks for the encryption pending state, as
we should not start the encryption procedure if we know
that the connect ISO command cannot be completed afterwards.
This adds a new return value to bt_iso_chan_connect,
and decided to properly document the return values the
function can return.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Decouple the zephyr/net/socketcan.h and zephyr/drivers/can.h header files
by moving the SocketCAN utilities to their own header.
This is preparation for including the SocketCAN types defined in
socketcan.h in a native posix (Linux) SocketCAN driver context without name
clashes.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
SocketCAN transfers an entire "struct socketcan_frame", not just the
embedded payload data. Fix the MTU to reflect this.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
SocketCAN does not support CAN-FD data lengths of up to 64 bytes
payload. Decouple the maximum supported SocketCAN data length from the
maximum supported CAN controller data length.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Rename the SocketCAN header from socket_can.h to socketcan.h to better
match the naming of the functionality.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Rename the SocketCAN utility functions to reflect the new naming of the CAN
controller API and SocketCAN API data types.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Remove the "z" prefix from the public CAN controller API types as this
makes them appear as internal APIs.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Rename the SocketCAN data types to "socketcan_*" in preparation of renaming
the low-level CAN controller API data types.
This breaks the naming compatibility with the similar SocketCAN data types
from the Linux kernel, but Zephyr and Linux SocketCAN are not 100%
compatible anyways (only the structure fields are compatible, extended
functionality such filtering, error reporting etc. are not).
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Move the SocketCAN data types and helper functions from
zephyr/drivers/can.h to zephyr/net/socket_can.h as these are not used by
the low-level CAN controller driver API.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Add spi0 and spi1 configuration to rp2040.
spi0 and spi1 are declared as compatible with
"raspberrypi,pico-spi" and "arm,pl022".
"raspberrypi,pico-spi" is just inherited from
"arm,pl022" and "reset-device"
spi0 and spi1 declare as compatible with "raspberrypi,pico-spi"
and "arm,pl022".
"raspberrypi,pico-spi" is just inheriting "arm,pl022" and
"reset-device" for declaring the 'reset' property,
with no additional property and implementation.
Add also pinctrl macros to dt-bindings header.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
This new implementation of pipes has a number of advantages over the
previous.
1. The schedule locking is eliminated both making it safer for SMP
and allowing for pipes to be used from ISR context.
2. The code used to be structured to have separate code for copying
to/from a wating thread's buffer and the pipe buffer. This had
unnecessary duplication that has been replaced with a simpler
scatter-gather copy model.
3. The manner in which the "working list" is generated has also been
simplified. It no longer tries to use the thread's queuing node.
Instead, the k_pipe_desc structure (whose instances are on the
part of the k_thread structure) has been extended to contain
additional fields including a node for use with a linked list. As
this impacts the k_thread structure, pipes are now configurable
in the kernel via CONFIG_PIPES.
Fixes#47061
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
These macros now have more conventionally named replacements, and the
old names are unused.
Part of #45976.
Signed-off-by: Abe Levkoy <alevkoy@google.com>
Give struct emul objects defined by EMUL_DEFINE external linkage.
Generate a struct emul prototype for each node in the device tree in
emul.h.
Define EMUL_DT_NAME_GET and deprecate EMUL_REG_NAME, which was only used
in EMUL_DEFINE.
This partially addresses #45976 by making it possible to statically
refer to struct emuls.
Signed-off-by: Abe Levkoy <alevkoy@google.com>
The cbprintf formatter cbvprintf_exteral_formatter_func has a typo
in it with a missing 'n'. So add it.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add support for setting sync-word and iq-inverted in lora_modem_config. By
being able to set the sync-word it's possible to send "raw" public-network
packets using lora_send and using iq-inverted both uplink and downlink
messages can be sent.
Signed-off-by: Tim Cooijmans <timcooijmans@gmail.com>
This extends the bt_conn_info with security information. This is needed
by LE Audio profiles to check if security requirements are met.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The bt_conn_get_security and bt_conn_enc_key_size do not
modify the conn thus the parameter can be guarded with const modifier.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
CONFIG_ISR_STACK_SIZE and CONFIG_ARC_EXCEPTION_STACK_SIZE are
used in arc asembler code without C wrapper on them with following
manner:
---------------------------->8----------------------------
/#define INIT_STACK z_interrupt_stacks
/#define INIT_STACK_SIZE CONFIG_ISR_STACK_SIZE
mov_s sp, INIT_STACK
add sp, sp, INIT_STACK_SIZE
---------------------------->8----------------------------
In result we can get stack unaligned if we have
CONFIG_ISR_STACK_SIZE or CONFIG_ARC_EXCEPTION_STACK_SIZE
values unaligned. There is no point to have unaligned stack
size - so let's check against such configurations in
compile time.
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
The macro DT_FOREACH_STATUS_OKAY_NODE is only available if devicetree
is supported. Using it for platforms that do not support devicetree
causes compilation errors.
Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
prevent `Wundef` warnings from occurring due to
missing CONFIG_ symbols and __cplusplus.
Signed-off-by: Christoph A Schnetzler <Christoph.Schnetzler@husqvarnagroup.com>
230ddd9a7f added unreachable path hint for assertion failure. Xcc does
not support __builtin_unreachable and this was defined as a call to
ASSERT, which generated some recursion.
Replace the definition with __builtin_trap() to work around this issue.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove the Kconfig option for configuring the maximum value of the CAN-FD
Data Length Code in order to ensure standard compliance.
Allowing users to configure the max DLC allows the user to save a number of
bytes per CAN frame in RAM, but it also renders the Zephyr CAN-FD
implementation non-compliant with the CAN-FD standard.
There are no guarantees that a Zephyr CAN-FD node will not receive a CAN
frame with a DLC higher than the Kconfig limit, which opens up for all
sorts of bugs when trying to handle received CAN-FD frames.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Upcoming versions of breathe highlight code embedded in Doxygen blocks.
In this case, the Devicetree fragment contained invalid syntax leading
to Sphinx warnings.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This reverts commit 5b2ba9aaeb, restoring
commit 0224f2c508.
Restore the original change now that the underlying issue has been fixed
in 6cfb18686e.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
i2c_transfer_async is the asynchronous version of i2c_transfer where
the completion of the transfer is notified to the caller using a callback.
This can be used in conjuction with the common callbacks and datatypes
in async.h for directly doing an async transfer with an IPC object
to notify a thread.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Because the fixup files do not exist anymore, stop using "unfixed"
naming in favor of "generated".
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Devicetree fixup files existed previous to the current stable Devicetree
API. While they served their purpose, they are no longer necessary nor
used in-tree. This patch drops support for this legacy feature.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Channels are not unique across bands, they need to be interpreted along
with frequency band. Add a separate band parameter that supports 2.4, 5
and 6 GHz bands.
Also, 6GHz has maximum channel of 233 (as of now), so, change the
maximum channel to that, this is a global maximum, per-band channel
validation is left to the offload driver as that depends on regulatory
rules (not a simple maximum check).
Signed-off-by: Krishna T <krishna.t@nordicsemi.no>