Fix handling of strncpy in cgnsinf parsing function to avoid
potentially getting a non-null terminated string.
Fixes#58573 / CID: 248403
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Do not enable subsystem/driver shell modules by default and stop abusing
CONFIG_SHELL_MINIMAL, which is internal to the shell subsystem, to decide
when to enable a driver shell.
The list of shell modules has grown considerably through the
years. Enabling CONFIG_SHELL for doing e.g. an interactive debug session
leads to a large number of shell modules also being enabled unless
explicitly disabled, which again leads to non-negligible increases in
RAM/ROM usage.
This commit attempts to establish a policy of subsystem/driver shell
modules being disabled by default, requiring the user/application to
explicitly enable only those needed.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Previously, the PLIC's registers were accessed through uint32_t *,
so all calculated offsets were effectively multiplied by
sizeof(uint32_t). Do the same manuallly now that we have
mem_addr_t/sys_read32.
Signed-off-by: Piotr Wojnarowski <pwojnarowski@antmicro.com>
`get_claim_complete_offset` and `get_threshold_priority_offset` actually
return addresses directly. Rename them to `_addr` for consistency within
the driver. Also change their return type to `mem_addr_t`.
Signed-off-by: Piotr Wojnarowski <pwojnarowski@antmicro.com>
This commit introduces the SOF host DMA driver.
This driver is used by NXP platforms in the context of
SOF's host component to copy data from the host memory
to the firmware (local) memory. This is possible because
NXP platforms can access the host memory directly w/o
an actual DMA engine.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This moves the k_* memory management functions from sys/ into
kernel/ includes, as there are kernel public APIs. The z_*
functions are further separated into the kernel internal
header directory.
Also made a quick change to doxygen to group sys_mem_* into
the OS Memory Management group so they will appear in doc.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
At present, if you want to set a periodic timer again with
set_top_value, the last triggered event is not cleared. This could
result in an old event being served at the next interrupt activation.
The solution proposed in this patch adds the nrf_timer_event_clear
function into set_top_value to prevent this from happening in the
above case.
Signed-off-by: Flavia Caforio <flavia.caforio@amarulasolutions.com>
Adds a clock control device for a PWM node, allowing the PWM
to be controlled using the clock control API.
It is a similar idea to the device driver in linux:
linux/Documentation/devicetree/bindings/clock/pwm-clock.yaml
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
The timer driver doesn't annouce/set the timeout at the tick boundary
but at the absolute next expiration time.
It will cause the accumatlation of the tick drift and cannot pass the
kernel/timer/timer_behavior test suite.
This commit fixes the tick drift problem by annouce the time at the tick
bouandry.
Fixes#59594
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Interrupt-driven mode was not working, and disabled by default.
When it was forced on, the behavior was to only have a few bytes:
as many as min(CONFIG_SHELL_BACKEND_SERIAL_TX_RING_BUFFER_SIZE, 9).
After the hardware FIFO was filled by software and emptied by hardware,
no interrupt occured, and enqueuing more data did never happen.
By letting the events enabled for TX (only), then interrupts are still
generated after the first transfer, and the software can then add the
subsequent transfers until all data is print: the UART works.
It does not generate endless interrupts either, which was tested by
adding litex_write8('%', UART_RXTX_ADDR) in liteuart_uart_irq_handler()
to log all interrupts events, and when there is nothing to print, no
interrupt is fired.
It was tested with the Zephyr shell.
Fixes#63794
Signed-off-by: Josuah Demangeon <me@josuah.net>
Use gpio toggle api instead of manually toggling.
Remove redundant text.
Print error and break from blinking if it occurs.
Only print 'how to exit' text if first toggle is successful.
Saves roughly 40 bytes.
Signed-off-by: Nick Ward <nix.ward@gmail.com>
Usage:
gpio info [device]
The new command prints gpio controller information
for a specific device if specified or if no device is specified
it prints out all controller information ordered by line name.
Also added Kconfig option so this command can be removed if
resources need to be conserved.
Signed-off-by: Nick Ward <nix.ward@gmail.com>
This commit implements this enhancement:
https://github.com/zephyrproject-rtos/zephyr/issues/63018
The forms of the gpio commands are now:
gpio conf device pin ol0
gpio set device pin 1
gpio get device pin
gpio blink device pin
Device name and pin subcommands now are
suggested/completed when tab is used.
Pin names are suggested with numbers and line names if
available from the gpio controller’s Devicetree node.
GPIO pin command is now limited to pins that are not assigned
as reserved.
Signed-off-by: Nick Ward <nix.ward@gmail.com>
nRF5340 SoC has `TASK_STOP` this patch implements disabling
watchdog for that SoC and enables allowing WDT to STOP in WDT setup.
Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
The field config of `nrfx_wdt_config_t` type is redundant in device
config structure. Instead of that local variable is used in the setup
function.
Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
Move a couple of automatic variable assignment off the declaration
block, leaves only structure aliases there, makes it a bit easier to
read.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Move the scan_cycles_idx increment in input_kbd_matrix_update_state
as it's only used there, use a modulo operation rather than the if to
handle the index wrapping condition.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Replace the wait_period_us clamping functions using a single CLAMP,
reposition the debug log as well.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
For some STM32 MCUs the busy flag of SPI is unreliable. This is a known
issue of the device and described in the device errata.
As a fix implement a configurable timeout which ensures that a call
to spi_transceive will eventually return.
Fixes#64927
Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
Remove syscalls that allows user threads to set callbacks that
will be invoked by the kernel.
Userspace is not trusted we can't allow a user thread set callbacks
that will be invoked by the kernel and run with supervisor privileges.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This reverts commit 415b6fc945.
This does not even compile as it attempts to do assignment to a read-only
object (config->config.behaviour).
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Split the common keyboard scanning code out of the ITE specific driver
and use the generic code instead.
Note that this changes few timing defaults, the change is not
significant though so I suspect there's no difference in practice.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The SoC header already includes the necessary device headers for
all SoC variants supported.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
Drop the input_ prefix fromthe internal functions. Trying to unify the
input drivers to use the same style for function naming, this makes it a
bit more compact and makes it easier to distinguish the common keyboard
structures and functions from the driver ones.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Set Spi StateIndex equal to index of DT Spi node.
Because number of State array is set base on
number of DT Spi node used. If StateIndex is set
equal to Spi instance, StateIndex can be over array.
Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
nRF5340 SoC has `TASK_STOP` this patch implements disabling
watchdog for that SoC.
Changed body of `wdt_nrf_setup()` to utilize `nrfx_wdt_reconfigure()`
driver API.
Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
Fixes an unhandled interrupt runtime crash if CONFIG_SPI_XMC4XXX_DMA=y and
CONFIG_SPI_XMC4XXX_INTERRUPT=n.
The unhandled interrupt error is triggered because irq_enable() was called
without calling IRQ_CONNECT() when CONFIG_SPI_XMC4XXX_INTERRUPT=n.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
In the interrupt driven spi, spi_context_update_tx() is called once
from the calling thread and then once in spi_xmc4xxx_isr() after each
new byte is received. This actually means that there is one extra call to
spi_context_update_tx(). This is fine if spi_context_update_tx() complete
it's call in the calling thread before the interrupt fires, however, this
cannot be guaranteed especially if the calling thread is pre-emptive and
has a low priority.
Fix this by calling spi_context_update_tx() in the calling thread before
transmitting the first byte.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Get GPR base address using nodelabel as this will align for all the
current in tree platforms. Currently inst 0 of the compat gets wrong
node and base address on RT11xx.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
GPR17 calculation for configuration of RAM banks is incorrect,
bit shift should be 2 per idx, not 1, this is major bug that needs
correcting, currently all RT boards are affected with wrong
configuration.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Currently, the NXP S32 SoCs have three redundant Kconfig hidden
options to define the part number. To streamline this, we will
retain `CONFIG_SOC_PART_NUMBER` to store the part number as a
string and `CONFIG_SOC_PART_NUMBER_<part>` that can be selected
by the boards.
Furthermore, for drivers requiring conditional code compilation
based on the target SoC, they should utilize the series or SoC
config option as applicable, instead of the part number config.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
The existing S32K3 Kconfig options employ the `M7` suffix, which is
redundant given that all cores in this series utilize an Arm Cortex-M7
core. Therefore, we should remove it.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
A proper netmask should be set on the loopback interface, so that
source address selection work properly when there are multiple
interfaces in the system.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add Renesas rzt2m gpio driver with basic functionality.
It supports pin mode configuration and writing/reading to/from gpio ports.
Includes dts changes to build blinky sample.
Signed-off-by: Jakub Michalski <jmichalski@internships.antmicro.com>
This adds a new driver for Renesas RZ/T2M.
The driver allows configuration of pin direction,
pull up/down resistors, drive strength and slew rate,
and selection of function for a pin.
Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
This adds a UART driver for the Renesas RZ/T2M
Serial Communication Interface.
The driver implements:
* Polling API,
* Interrupt-driven API.
Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>