Adds support for using MCUmgr over UART (not via shell) in a raw
mode which does not include base64 and other SMP over console
encoding
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules and to save on code size.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules and to save on code size.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Correct the behavior when printing interger menu values.
Current loop is not correct since it is waiting for a 0 value
to stop while for integer menu any value is possible.
Modify in order to loop until reaching the maximum number of
entries listed at the ctrl init time.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
"integer menu" ctrl type is longer than the 8 bytes long
typebuf hence rename the type into "int menu" and increase
the typebuf buffer in addition to increase alignment during
print of the ctrl values.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
curr_state is known to be false when reaching the STARTING state
check, making the explicit '!curr_state' condition redundant.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Add a kconfig to be used as a flag for indicating if it supports 64b
ticks and another flag which will enable the 64b api. The kconfig
indicating that it supports 64b is a dependency of the kconfig that
will enable the api.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Some counters, such as those that use fractional adders, tick at
resolutions greater than 4294967295Hz. This changes the freq in the common
info to a uint64_t. This adds a KConfig that can be selected by a driver.
This also has the counter ticks to sec (and vice versa) helper functions
call the get frequency for 64 bits if the kconfig is selected.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
__parse_ipv4_address() never reports errors and always returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
The return value variable was initialized but always overwritten
before being evaluated.
Remove the redundant initialization to simplify the code.
No functional change.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
There are currently two other sdhc drivers that support this interrupt:
Infineon and Ambiq. Both those vendor HALs automatically mask the
interrupt after invoking the callback[1][2], expecting the user to
unmask it asynchronously once they've cleared the card's interrupt
condition.
The NXP usdhc driver doesn't do this and so is inconsistent with the
other two. This has caused bugs with higher-level drivers, such as the
AIROC Wi-Fi driver (#101100). Fix the issue by masking the interrupt
ourselves.
[1] 470f874ce4/mtb-hal-cat1/source/cyhal_sdhc.c (L1251-L1260)
[2] 5efc022852/mcu/apollo510/hal/mcu/am_hal_sdhc.c (L2256)Fixes#101100
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Moves clock selection/assignment from the clock driver to the
peripherals that subscribe to the clock. This allows multiple
devices such as PWM/Counters to share a peripheral clock.
Signed-off-by: John Batch <john.batch@infineon.com>
Adds making a peripheral clock connection to the initialization for
SDHC. Other updates to use the clk_dst field from the binding.
Signed-off-by: John Batch <john.batch@infineon.com>
Updates the Infineon Counter and PWM drivers based on the TCPWM device
to connect with a clock. This update allows multiple devices to connect
to the same peripheral clock, and supports the TCPWM architecture of the
PSC3 device family.
Corrects initialization of the PWM on the PSC3 family to select the
correct output type.
Signed-off-by: John Batch <john.batch@infineon.com>
Adds making a peripheral clock connection to the initialiazation for SCB
based drivers. These drivers are the UART/Serial driver, I2C driver, and
SPI driver.
Signed-off-by: John Batch <john.batch@infineon.com>
Add the `DEVICE_API` wrapper to the remaining `uart_driver_api` instances,
ensuring that each driver API is placed in its respective linker section.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
as we are only handeling rx interupts, we don't need
to call uart_irq_is_pending to check, we can just directly
use uart_irq_rx_ready.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
While in PRE_KERNEL stage, scmi_send_message_polling() attempts to acquire
the transmit channel mutex, which should not be allowed as the kernel is
not fully initialized at this point.
Since there's no multithreading at this point, there's no need to use a
mutex anyways. Therefore, perform mutex acquire()/release() only if not
in PRE_KERNEL phase.
Note that the return value of k_mutex_lock() is already suppressed via
an -EBUSY return value so no behavioral change here.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
In current implementation, the sending buffer size is 0x10000. This
will result in a very small amount of RAM available for the
application. Actually, the maximum required sending buffer size is
4KB.
Reduce the maximum sending buffer size by changing
`SEND_BUFFER_MAX_LENGTH` from 64KB to 4KB.
And add runtime assertions to prevent buffer overflows during firmware
upload.
- Change SEND_BUFFER_MAX_LENGTH from 0xFFFF to 4096 (4 KB)
* Reflects the actual maximum FW chunk size supported by hardware
* Reduces memory footprint from 64 KB to 4 KB
- Remove unnecessary +1 from send_buffer array size
- Add __ASSERT checks in fw_upload_v1_send_data() to validate
memcpy does not exceed buffer size
- Add __ASSERT checks in fw_upload_v3_send_data() to validate
memcpy does not exceed buffer size
This prevents potential buffer overflows when copying firmware data
and ensures the buffer size matches hardware capabilities.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This commit adds support for the Xilinx AXI Ethernet Lite device,
also known as the emaclite.
The emaclite is a light-weight 10/100 MII Ethernet device.
It foregoes a DMA to reduce chip area.
Instead, it uses memory-mapped transmit/receive buffers.
A selection of features can optionally be enabled:
- a second ("pong") RX/TX Buffer
- MDIO support
- Interrupt support
This driver handles the MAC functionality of the core;
a driver for the MDIO part is introduced separately
as an MDIO driver.
Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
This commit adds support for the Xilinx AXI Ethernet Lite device,
also known as the emaclite.
The emaclite is a light-weight 10/100 MII Ethernet device.
It can optionally be configured to include an MDIO.
The MMIO interface is controlled via MMIO registers and requires
the software to busy-wait until completion.
Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
dai_ssp_set_clock_control_ver_1() never reports errors and always
returns 0.
The error check at the call site is therefore dead code.
Make the function void and drop the unused error handling.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
RSI_ADC_PowerControl() enables the clock AND power on the ADC hardware
block.
The clock control should only access to the clock hardware block.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
RSI_ADC_ClkDivfactor() is called from system clock_control. But in fact, it
controls the internal division factor of the ADC hardware block.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
ADC_CONTEXT_USES_KERNEL_TIMER is required for ADC_CONTEXT_INIT_TIMER().
However, it should be defined in the Zephry driver, not in the Wiseconnect
integration.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Add IMSIC driver implementation with atomic mtopei claim using csr_swap
and EIE configuration for interrupt enable/disable.
Signed-off-by: Afonso Oliveira <afonsoo@synopsys.com>
Add the `DEVICE_API` wrapper to the remaining `gpio_driver_api` instances,
ensuring that each driver API is placed in its respective linker section.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add the `DEVICE_API` wrapper to the remaining `flash_driver_api`
instances, ensuring that each driver API is placed in its respective
linker section.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Update kernel level and priority(same with scmi clock control)
On i.MX95, there is an irqsteer instance in display mix.
when the irqsteer is enabled, must power on display mix before
accessing registers of the irqsteer(call irqsteer_hw_init).
the irqsteer drivers's kernel level is PRE_KERNEL_1 and it's
priority is 40. So update kernel level to PRE_KERNEL_1 and update
priority to 30 to ensure that the arm scmi power domain driver
is initialized before initializing irqsteer driver.
Signed-off-by: Biwen Li <biwen.li@nxp.com>
Verify that requested data can fit into the transmit buffer on send to
avoid out-of-bound memory writes.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Move the kStatus_FLEXCAN_UnHandled case from before the
kStatus_FLEXCAN_ErrorStatus case to just before the default case.
This prevents unnecessary execution of the CAN bus error handler
during message buffer interrupt processing. The issue occurred
because when CAN bus errors occur without any mailbox generating
an interrupt, FLEXCAN_MbHandleIRQ returns kStatus_FLEXCAN_UnHandled.
With the previous code structure, the fallthrough from
kStatus_FLEXCAN_UnHandled would cause the kStatus_FLEXCAN_ErrorStatus
handler to execute unnecessarily.
By separating these two cases, kStatus_FLEXCAN_UnHandled (which
represents unhandled status during Message Buffer processing)
now falls through only to the default case for logging, while
kStatus_FLEXCAN_ErrorStatus is handled independently only when
actual CAN bus error status needs processing.
Signed-off-by: William Tang <william.tang@nxp.com>
Replace FLEXCAN_TransferHandleIRQ() with separate calls to
FLEXCAN_BusoffErrorHandleIRQ() and FLEXCAN_MbHandleIRQ() to handle
FlexCAN interrupts.
The original FLEXCAN_TransferHandleIRQ() API accesses registers for
features that may not be used, including Enhanced RX FIFO. This can
cause issues when different FlexCAN instances have different hardware
features, as it may attempt to access non-existent registers.
By using the more targeted FLEXCAN_BusoffErrorHandleIRQ() and
FLEXCAN_MbHandleIRQ() functions, we only access the registers that
are actually needed for the enabled features. This approach:
- Prevents accessing non-existent registers on instances lacking
certain features
- Provides a more lightweight interrupt handling path
- Slightly improves code efficiency by avoiding unnecessary register
operations
The config structure is now used in the ISR to pass the number of
message buffers to FLEXCAN_MbHandleIRQ().
Signed-off-by: William Tang <william.tang@nxp.com>
Implement more co-processor commands in the FT8xx display driver.
The list of the new implemented commands consists of:
* CMD_FGCOLOR
* CMD_BGCOLOR
* CMD_SLIDER
* CMD_TOGGLE
* CMD_TRACK
Signed-off-by: Hubert Miś <hubert.mis@gmail.com>