In target mode only, the IBI work queue is unnecessary and doesn't
compile. Take it out of the build chain by only selecting I3C_IBI_WORKQUEUE
if I3C_CONTROLLER is set
Signed-off-by: James Growden <jgrowden@tenstorrent.com>
During bus initialization we conditionally execute
GETCAPS and CRCAPS, however we do not store them
in our tracking of that target device.
This stores the information so that we can look at it later
(e.g. via i3c_shell info)
Signed-off-by: James Growden <jgrowden@tenstorrent.com>
User configurations can select to build with
CONFIG_TARGET_MODE_ONLY=y. This doesn't link because
the source file i3c_common registers the i3c log, and
is only compiled when CONFIG_I3C_CONTROLLER is set.
Instead, compile that file always. Take out compilation of the
(presumably unused) functions present in that file when compiling
for TARGET.
Signed-off-by: James Growden <jgrowden@tenstorrent.com>
find_last_checkblock() passes a NULL error pointer to
find_checkblock(), which is forwarded to dhara_nand_read().
If a read error occurs, dhara_nand_read() attempts to write
to the NULL pointer, causing a crash.
Fix this by guarding all error assignments and using
dhara_set_error(), which safely handles NULL error pointers.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Restore the mcux LPTMR compare period to the default top value
when an alarm is cancelled.
The counter basic API alarm-capability probe can arm and cancel
a short LPTMR alarm before test_valid_function_without_alarm()
runs. Without restoring the compare period, a later
counter_start() may still use the previous short match value.
That causes the FRDM-MCXC444 test to fail with counter ticks not
in tolerance.
Reset the timer period back to max_top_value and clear the
compare flag during cancel so the device is left in the expected
state for subsequent starts.
Keep a clarifying code comment near the cancel path to note that
LPTMR uses one CMR register for both the period and alarm value.
Signed-off-by: Hake Huang <hake.huang@nxp.com>
Extend the shared BFLB HCI driver with BL60x (BL602) support: BL60x
include paths, controller init macros, IRQ setup, and platform shim
forward declarations.
Kconfig adds BT_BFLB_BL60X with two controller variant choices
(m1s1, m8s1) and smart defaults based on enabled BT roles.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Add a driver for the MS5637-02BA03 digital pressure & temperature
sensor from TE Connectivity (Measurement Specialties).
The driver implements the Zephyr sensor API with support for
SENSOR_CHAN_PRESS (kPa) and SENSOR_CHAN_AMBIENT_TEMP (degrees C).
Oversampling ratio (OSR) is configurable at build time via Kconfig
and at runtime via SENSOR_ATTR_OVERSAMPLING.
Includes full PROM CRC-4 validation per AN520 and second-order
temperature compensation per the MS5637 datasheet.
Signed-off-by: William Markezana <william.markezana@gmail.com>
If first PWM sequence is set to 100% glitch free duty
cycle, period_cycles will remain uninitialized while
all used channels will use PWM. If following
sequences request non-100% duty cycle, period
cycles will have to be changed. Improve error
condition to allow changing period cycles for
running PWM if these are equal to 0.
Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
Add Kconfig options to control whether the GRTC timer is stopped
and/or cleared when the driver is uninitialized (e.g. when
sys_clock_disable() is called).
Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
Use the Clock controller to get the frequency of the WDT clock instead
of hand roling with some defines owned/intendet for the clock
controller.
Signed-off-by: Fiona Behrens <me@kloenk.dev>
Add System Clock Controller for the M480 nuvoton MCU.
This only adds the base driver to setup HIRC, HXT, LIRC, LXT and
PLL. Configuring the PLL driver from a target frequency with
calculating values to best match this frequency.
Signed-off-by: Fiona Behrens <me@kloenk.dev>
Implement the counter_api reset callback for the NXP LPC CTimer
driver to zero the timer counter register
while keeping the timer running.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
Don't report an error if the private data is empty when detaching.
This can happen if a device was attached, and then it didn't go
though entdaa, and was then detached.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Only disable the i2c and give the semaphore after the bus becomes
inactive.
Otherwise, software may observe that the transfer is complete while
data is still pending in the hardware fifo. Disabling the controller
too early can cut off the transfer and cause communication failure.
Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
Add promisc mode capability for bridge.
There's no filtering really so enabling promisc is a noop but
pretending to have support is needed to allow these
to be added to a bridge.
Signed-off-by: Fengming Ye <frank.ye@nxp.com>
This patch adds support for SCMI Base protocol.
It provides helpers if ARM_SCMI_BASE_HELPERS is enabled for:
- obtaining SCMI firmware revision information
- agent management helpers
scmi_base_discover_agent()
scmi_base_device_permission()
scmi_base_reset_agent_cfg()
Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
DT_SCMI_PROTOCOL_DEFINE_NODEV previously failed for the base SCMI protocol,
as it relied on DT_REG_ADDR_RAW to fetch protocol IDs. The base protocol is
not represented as a separate child node in the devicetree, but is enabled
by default when the transport node is present.
Modify DT_SCMI_PROTOCOL_DEFINE_NODEV and DT_SCMI_PROTOCOL_DEFINE to
handle protocol IDs correctly for all SCMI protocols, including the base
protocol.
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
according to the api in include/zephyr/storage/disk_access.h
a negative errno value should be returned on fail.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Use CODE_UNREACHABLE instead of __ASSERT_UNREACHABLE as the latter is only
for test cases.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Instead of hardcoded EXTI line numbers and raw LL API calls, align the
STM32 RTC Counter driver with its Real-Time Clock counterpart:
- obtain EXTI line number from Devicetree
- use the EXTI INTC API instead of raw LL API calls
Fixes the build issue observed on STM32N6.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
if NET_TEST is not used, we need the
chosen zephyr,ppp-uart in the devicetree,
therefore add that dependency to the
NET_PPP driver.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Even though the ivshmem ethernet driver can't be
directly run in the regular qemu, with west build -t run
we set this here, as we otherwise would get a build error.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Introduces SYS_MEM_BLOCKS_DEFINE_TYPE() and
SYS_MEM_BLOCKS_DEFINE_STATIC_TYPE() helpers to allow the user to declare
mem blocks without having to manually ensure the alignment is correct,
which was very error-prone.
Matches the new K_MEM_SLAB_DEFINE_TYPE.
Signed-off-by: Egill Sigurdur <egill@egill.xyz>
Introduces K_MEM_SLAB_DEFINE_TYPE() and K_MEM_SLAB_DEFINE_STATIC_TYPE()
helpers to allow the user to declare slabs for types without having to
manually ensure the alignment is correct.
Manual slab alignment was very error-prone and this change fixes several
instances of misalignment that would be trapped by the undefined
behavior sanitizer when running on 64-bit targets.
Signed-off-by: Egill Sigurdur <egill@egill.xyz>
Read the temperature sensor calibration value through the
NVMEM API instead of the legacy ROM OTP API. The calibration
data is exposed by the OCOTP node as an NVMEM cell, so the
driver no longer depends on fsl_romapi_otp.
Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
When the following conditions are met:
- center aligned mode
- trigger generation on update event
an additional update event is avoided during channel activation.
This may cause (depending on the up/down counting direction) a
de-synchronisation between pwm polarity and generated trigger.
Problematic when e.g. the adc should trigger during high- and
low phase of a pwm signal.
Signed-off-by: Matthias Plöger <matthias.ploeger@phoenixcontact.com>
Replace STM32 HAL SDIO API calls with custom LL-based wrapper
functions. This removes the dependency on the STM32 HAL SDIO driver.
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
Renamed the Kconfig and code references from SDHC_STM32_POLLING_SUPPORT
to SDHC_STM32_DMA_MODE for clarity.
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
Remove 1.8V capability check from
sdhc_stm32_switch_to_1_8v() since this
validation is expected to be handled by
zephyr subsystem.
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Replace CONFIG_SD_CMD_TIMEOUT with the actual timeout value
from the sdhc_data structure (data->timeout_ms) for waiting
on DMA completion semaphore.
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
- Replace multiple individual if statements in sdhc_stm32_log_err_type()
with a static const array of error masks and messages.
- Add some error log messages to improve visibility of SDMMC error
conditions.
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
- Extracted SDMMC interrupt flag clearing into a new helper function.
- Enhanced the event ISR to log errors, call error logging helpers.
- Deferred PM release to ISR only when a DMA-based command is
successfully launched
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
- Consolidate sdmmc_res error handling into a single check
at the end of the switch block, removing redundant per-case checks
- Rename goto label 'out' to 'end' in sdhc_stm32_set_io()
- Move DEVICE_API definition after sdhc_stm32_init() for better
code organization
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
The reset function should reset the host controller only, not the card.
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
When no CD GPIO is configured, assume the card is present instead
of sending commands to probe, to avoids sending unexpected commands
that the SD subsystem doesn't expect.
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
The PM_DEVICE_DT_INST_GET macro was defined but not passed to
DEVICE_DT_INST_DEFINE, meaning PM callbacks were not properly
registered.
Signed-off-by: Sara Touqan <zephyr@exalt.ps>
Signed-off-by: Sarah Younis <zephyr@exalt.ps>
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
This introduces APIs for input capture on the STM32.
Rename callback in data to alarm_cb to prevent confusion with other
callbacks.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
This introduces APIs for input capture.
A use case for this would be time stamping a rising and/or falling edge
where precision and lack of jitter is important. The only way to currently
do this in zephyr is to set up a GPIO interrupt and then read the counter
or kernel time... but this can have limitations of software such as the
processor may have a lot going on and can be subject to interrupt
latencies. Having a hardware 'latch' done of the rising and/or falling
edge with respect to a timer can eliminate these imprecisions.
How this is to be used, is that an application is to call
`capture_callback_set` with the configuration of the channel number, flags
(such as falling, rising, or both edges), and then a callback function.
Then the `capture_enable` function is to be called to enable this. The
callback has the timestamp of the edge in ticks and the edge that it
captured (rising or falling).
This also adds a 64 bit tick version for the capture callback.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
The base address is constant, it's wasteful to store it in device data.
`void *` type is used instead of hardware-specific `xxx_TypeDef *` since
the structure is shared by all controller drivers (QSPI, OSPI and XSPI).
Since this removes the need for a cast, this tangantially fixes a bug in
the OSPI driver which used the wrong type when casting device address:
`(XSPI_TypeDef *)` instead of `(OCTOSPI_TypeDef *)`.
While at it, move a `bool` field at the tail to avoid padding INSIDE the
structure (although there's sadly still some, due to struct mspi_cfg...)
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>