Added AUX_SWEV0 and AUX_SWEV1 interrupts to allow the Sensor Controller to
trigger these events and the System CPU to evaluate them. Also changed
HwiP_Params_init and the enabling of interrupts in HwiP_construct to allow
interrupts to be constructed without directly enabling them. This is used
by the sensor controller interface when registering the interrupts.
Signed-off-by: Benedikt Streicher <streicher.b@posteo.de>
This include is causing a nemspace collision between the picolibc and
the Zephyr select definitions. Looks like this was originally a '#ifndef
CONFIG_NET_SOCKETS_POSIX_NAMES' but got inverted as a positive condition
at some stage, which is now causing a build fail.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Calculations based on the clock tick period produce series loss in
precision (~17250 ppm) when the system tick is based on the LF crystal.
This is inacceptable for most applications especially in the RF area and
leads to fatal timing errors there (e.g. the radio timer oversleeping
systematically during power down).
This change improves precision by rounding as late as possible. To this
end calculations are based on the precise tick frequency rather than
rounded tick periods.
While rounding later improves precision it will not completely remove
rounding error in most cases. Therefore an appropriate rounding approach
must be chosen for each individual use case.
Several helper functions with well-defined rounding semantics are
introduced and applied throughout the HAL to improve precision as much
as possible in the integers domain.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
TI's ClockP API requires clock timeout and period to be specified in
ticks rather than milliseconds.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Removes cruft from the ClockP implementation that seems to have
accumulated over time - especially with respect to the timer API.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
The fix of a race condition in the previous commit introduced a
regression in power management which disallowed transitions to
power-down state. This fixes the regression.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
The driver had a race condition that would systematically try to
schedule the power down procedure while already powering down when a RAT
timer was active during power down.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Add support for CC1352X7 device family in hal_ti, sources are fetched from latest
simplelink SDK simplelink_cc13xx_cc26xx_sdk_6_20_00_29 , should be able to merge
majority of the sources in the X1 and X7 directory. Tested on CC1352P7 launchpad.
Signed-off-by: Vaishnav Achath <vaishnav@beagleboard.org>
Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
Picolibc doesn't always use an __errno function, preferring to use TLS
errno variable instead as that's more efficient. But, that means
applications shouldn't dig through the original errno abstraction to
use the underlying implementation directly.
Signed-off-by: Keith Packard <keithp@keithp.com>
The normative spec says this returns `pthread_t`, not `void *`.
It's probably better to simply `#include <pthread.h>` outside
of this file explicitly (due to current non-standard prefixed
path in Zerphy) than to re-declare it with a potentially
conflicting signature.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
Used by Zephyr's TI CC13xx/CC26xx ADC driver which requires
additional functions not found inside the SOC ROM (e.g.,
`AUXADCEnableSync` errata workaround).
Signed-off-by: Stancu Florin <niflostancu@gmail.com>
The TI HAL requires certain definitions, e.g. DeviceFamily_XYZ to be
present when compiling, as some public headers require them. Instead of
manually injecting them to every file because one of its includes
requires it, just insert global level definitions. This makes sure
they'll be made available where necessary without the need of individual
hacks.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Update the HAL to TI SimpleLink SDK 4.40.
Retains Zephyr-specific patches.
Note: PRCMPowerDomainStatus was renamed to PRCMPowerDomainsAllOn, so Zephyr
drivers will require updating!
Signed-off-by: Stancu Florin <niflostancu@gmail.com>
These sources are required for CC13xx/CC26xx on-chip flash driver which
makes use of TI's HAL functions and some of them are not inside ROM.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Zephyr has prefixed all of its includes with <zephyr/...>. While the old
mode can still be used (CONFIG_LEGACY_INCLUDE_PATH) and is still enabled
by default, it's better to be prepared for its removal in the future.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Zephyr has prefixed all of its includes with <zephyr/...>. While the old
mode can still be used (CONFIG_LEGACY_INCLUDE_PATH) and is still enabled
by default, it's better to be prepared for its removal in the future.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Instead of using `#include <posix/time.h>`, just use `#include <time.h>`.
Required-by zephyrproject-rtos/zephyr#43998
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
The API has changed to:
pm_constraint_set: pm_policy_state_lock_get
pm_constraint_release: pm_policy_state_lock_put
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The constraints API offered by TI HAL is meant to be used externally,
for example, when implementing a policy using their policy mechanism
(not used on Zephyr). The API is likely designed for systems where a
thin RTOS is used (e.g., FreeRTOS, TI-RTOS?), places where you basically
get a Kernel and a few services around, but not a system like Zephyr
where you also get, for example, a power management subsystem. This
means that it gets difficult for an RTOS like Zephyr to use such HAL
APIs while using its own constraints API. The first question is why we
allowed such kind of HAL code to be part of upstream Zephyr. It
certainly does useful things, but it is also uses a HAL infrastructure
which is hardly exportable to an RTOS like Zephyr. Part of the
Power_init() code, for example, should likely be in a clock controller
driver, where Zephyr APIs can be used.
This patch forwards PM state constraints to Zephyr, so that we don't
need hacks on the Zephyr side like allowing re-implementations of the
constraints API.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
IRQ_CONNECT() requires that all parameters be known at compile-time, but
that is not the case with the interrupt priority. Instead, use
irq_connect_dynamic() which allows runtime arguments.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Temporarily revert the change from
9b56312f9a as zephyrproject-rtos#24873
is not yet merged, and without it, build errors would occur while
running sanitycheck.
Signed-off-by: Vincent Wan <vwan@ti.com>
Minor tweaks to the SlNetSock code to avoid errors/warnings
when building for Zephyr, due to its stricter build flags and its
idiosyncrasies around its posix implementations.
Signed-off-by: Vincent Wan <vwan@ti.com>
Bring in SlNetSock and its associated modules from the TI CC32xx
SimpleLink SDK 4.10.00.07. SlNetSock is a module that implements a
higher-level, BSD-socket-like abstraction that has the ability to
support multiple network interfaces. When used on top of the native
SimpleLink WiFi Host Driver API, it provides extra network-related
functionality such as getaddrinfo(), which is necessary for addressing
zephyrproject-rtos/zephyr#11890
Origin: Texas Instruments cc32xx SimpleLink SDK
License: BSD 3-Clause
URL: http://www.ti.com/tool/download/simplelink-cc32xx-sdk
Purpose: Provide access to SlNetSock functions for TI CC32XX SoC
Maintained-by: External
Signed-off-by: Vincent Wan <vwan@ti.com>
Support for patching radio core for BLE
Also, correct use of
zephyr_sources_ifdef -> zephyr_library_sources_ifdef
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
RFCC26X2_multiMode.c references Temperature_getTemperature()
but source/ti/drivers/temperature/TemperatureCC26X2.c was not
previously linked in.
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
rfc.c should be added back to the list of files in driverlib to be
compiled, as it is needed by IEEE 802.15.4 driver.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Fixing build warnings that are seen as an extra pair of braces is
missing around the initializer for a structure which first field
is another structure.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Update the HAL to new TI SimpleLink SDK, including driverlib, rf
patches and TI drivers.
Add the temperature driver in order to support new changes in the
Power Manager.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Replace DT_ARM_CORTEX_*_0_CLOCK_FREQUENCY with a PATH based reference
to cpu@0 (DT_PATH(cpus, cpu_0)) and than getting the clock_frequency
property:
DT_ARM_CORTEX_*_CLOCK_FREQUENCY ->
DT_PROP(DT_PATH(cpus, cpu_0), clock_frequency)
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Remove hacks that were introduced when it was not possible to include
this header earlier, and directly include the header from Zephyr. This
would allow new changes (such as the recent change to modify
clock_gettime() into a syscall) to be reflected in the HAL.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
When creating or constructing a semaphore, the count passed in is
incorrectly being ignored. We need to fix SemaphoreP_create/construct
to pass the initial count to k_sem_init().
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
This commit fixes ClockP to use correct struct size, to set the correct
period and timeout in call to k_timer_start, and to deal with NULL
parameters in ClockP_construct.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>