sys_heap alloc and free are not thread safe so lock is needed to
prevent data corruption.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit updates the DTS for the da1469x and defconfig for the
da1469x_dk_pro and da14695_dk_usb boards to support the ARMv8-M MPU.
Signed-off-by: Loek Le Blansch <loek@pipeframe.xyz>
Same error had to be fixed in the branch where optimizations were done.
This is probably a good example of where using `if (IS_ENABLED()) ...`
is a better choice than using `#ifdef`. Because the compiler would have
caught this error last time as well.
Anyway, same problem - different line(s)!
A warning was propogated to error when building for
native_sim/native.
```
timeutil.h:682:17: error: result of comparison of constant \
-9223372036854775808 with expression of type '__time_t' (aka 'long') \
is always false [-Werror,-Wtautological-constant-out-of-range-compare]
timeutil.h:680:17: error: result of comparison of constant \
-9223372036854775808 with expression of type '__time_t' (aka 'long') \
is always false [-Werror,-Wtautological-constant-out-of-range-compare]
```
This is due to the issue described in #90029.
Add workarounds for `timespec_to_timeout()` and `timespec_negate()`
until 90029 is resolved.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Generator was enabled some time ago to use sys_rand32_get() however this
function is no longer in use.
Signed-off-by: Bartlomiej Buczek <bartlomiej.buczek@nordicsemi.no>
Sets the SYS_CLOCK_HW_CYCLES_PER_SEC Kconfig from devicetree
entries. Also fixes invalid configuration on nrf54h20 whereby it
attempts to take the clock frequency from a peripheral that does
not exist
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds the default 32.768KHz clock frequency to this peripheral, as it is
used as the system timing source
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds a function which can be used to get the integer value of a
devicetree property in Kconfig from a nodelabel
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The new Nordic platforms use GRTC instead of RTC
as the system timer.
Also the nrf54h20 CPUPPR target does not have enough memory
to execute the `timer_behavior` test.
Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
Add yangbolu1991 and Zhiqiang-Hou as the collaborators for NXP MPU,
yangbolu1991 has contributed a lot of in scope of MPU M-core and
Zhiqiang-Hou has contributed a lot of in scope of MPU A-Core, they
could help to fast the review process.
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Commit 0e41b07309 ("drivers : flash:
update way to get flash size") changed the way to get flash size from
the LL_FLASH_GetSize() HAL function to the current DT_REG_SIZE() macro.
However, they are not equivalent:
- With LL_FLASH_GetSize(), REAL_FLASH_SIZE_KB returned the *total* size
of the Flash memory, reading it from a ROM register of the CPU. For
example, it was 2048 (2MB) for a STM32H747xI.
- The current DT_REG_SIZE() applies to a flash *bank*, therefore it only
returns half of the total Flash size on dual bank devices.
This mismatch causes issues with the DISCONTINUOUS_BANKS logic below,
incorrectly matching partitions close to the end of the first bank as
appearing to span both and triggering the "range overlaps discontinuity"
check later.
Fix it by doubling the size when appropriate, in the same way it is
already done for the M4 core.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
- Use DEVICE_MMIO_* macros for getting the registers.
- These macros automatically used the proper RAM/ROM address.
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
Add an spi overlay for the audio build_all tests.
Add the pcm1681 to both i2c and spi overlays.
Signed-off-by: Jaro Van Landschoot <jaro.vanlandschoot@basalte.be>
Fix regression introduced by dormant state, where the
carrier does not get closed when Cellular Modem driver
is suspended.
Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
With Clang you can't set long_call attribute on function basis. Instead
of converting all calls to long calls let the linker create veneers when
necessary.
Signed-off-by: Veijo Pesonen <veijo.pesonen@alifsemi.com>
A warning was propogated to error when building for
native_sim/native.
```
timeutil.h:519:17: error: result of comparison of constant \
-9223372036854775808 with expression of type '__time_t' (aka 'long') \
is always false [-Werror,-Wtautological-constant-out-of-range-compare]
```
This is due to the issue described in #90029.
Add workarounds for `timespec_to_timeout()` and `timespec_negate()`
until 90029 is resolved.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The RX floating-point hardware only works on 32-bit values
so default gcc will build doubles as 32-bit, this make many
test fail on RX build test.
This commit force the build for RX arch to use 64-bit doubles
FPU will be supported later on this arch
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
Use the newly added timespec util functions to manipulate and
compare timespec structures with overflow detection.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Add documentation in the timeutil group for recently added functions
for validating, comparing, and manipulating `struct timespec`
objects as well as functions for converting between representation
of time durations as either `struct timespec` or `k_timeout_t`.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Add a timespec util testsuite. This should have reasonably high enough
coverage to be useful.
I would have preferred to add this as an architecture-independent
unit test (for the unit_testing platform) under tests/unit/timeutil but
there is an inconsistency about the size of time_t on the unit_testing
and native_sim/native platforms. On every other platform supported by
Zephyr, time_t is 64-bits. However, on those platforms, time_t is only
32-bits.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Add a number of utility functions for manipulating struct timespec.
* timespec_add()
* timespec_compare()
* timespec_equal()
* timespec_is_valid()
* timespec_negate()
* timespec_normalize()
* timespec_sub()
* timespec_from_timeout()
* timespec_to_timeout()
If the `__builtin_add_overflow()` function is available, then the
API is mostly branchless, which should provide decent performance on
systems with an instruction cache and branch prediction. Otherwise,
manually written alternatives exist that are also perhaps more
readable.
The two functions at the end convert time durations between
representation as `struct timespec` and `k_timeout_t`.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Add the device name to the error logs so we can differentiate which
device caused the error and not just which port.
Signed-off-by: Yuval Peress <peress@google.com>
struct usb_setup_packet represents the setup data payload of a USB control
message which is exactly 8-bytes in length.
On a legacy build of GCC 4.1.2 for an OpenRISC-like architecture it was
found that the compiler added padding after the bmRequestType anonymous
union, and subsequently the bRequest field causing the structure to be
padded to 12-bytes in length with the fields incorrectly laid out.
This patch corrects the issue by applying the __packed attribute to the
anonymous union. This corrects the issue.
The __packed attribute is also applied to the outer structure for the sake
of consistency.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
The string_create_helper function has the arguments: load_address_in_flash
and is_copy. These arguments take logical values, but previously the
calling code used 1 and 0 rather than the more idiomatic True and False.
This patch corrects the issue by replacing use of int values with bool
values.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
This patch makes various simplifications to the code structure which make
it more concise by reducing repetition.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>