Commit graph

7589 commits

Author SHA1 Message Date
Arjav Patel
70d918324b wireless/lpwan/sx127x: Update default TX power and enable CRC
Increase default TX power from 14 to 17 dBm and enable CRC
by default to improve link reliability and data integrity.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-03-08 16:08:39 -03:00
vrmay23
45651ea6e5 drivers/lcd: Refactor ST7796 to use Kconfig and add Power Management
Previously, the ST7796 driver required the board to pass a struct
st7796_config_s at initialization time, carrying display resolution,
color depth, orientation (MADCTL), BGR flag, SPI frequency, and
initial rotation.

All of these are chip-level properties, not board wiring details.
This created an awkward split: board code computed MADCTL values,
selected BPP, and derived effective resolution depending on orientation
(knowledge that belongs exclusively in the generic driver).

This commit removes that split entirely, following the same pattern used
by the ST7789 driver in drivers/lcd/Kconfig. It also implements the
getpower/setpower interface for standard framebuffer power management.

What was changed (per file):

drivers/lcd/Kconfig:
- Added a full 'if LCD_ST7796' ... 'endif # LCD_ST7796' block containing
  all chip-level configuration.
- Includes LCD_ST7796_XRES/YRES, LCD_ST7796_BPP, LCD_ST7796_FREQUENCY,
  LCD_ST7796_SPIMODE, LCD_ST7796_BGR, LCD_ST7796_INVCOLOR,
  and orientation/rotation choices.

drivers/lcd/st7796.c:
- Removed struct st7796_config_s from struct st7796_dev_s.
- Moved struct st7796_cmd_s from public header to Private Types.
- Added compile-time macros derived from Kconfig:
  ST7796_XRES/YRES (swapped for landscape),
  ST7796_MADCTL_BASE,
  ST7796_SPIMODE,
  ST7796_BYTESPP,
  ST7796_COLORFMT.

- Implemented st7796_getpower() and st7796_setpower() using the
  st7796_board_power() board callback.
- Registered power functions in st7796_fbinitialize() vtable.
- Updated st7796_init_display() to make INVON/INVOFF conditional on
  CONFIG_LCD_ST7796_INVCOLOR.
- Simplified st7796_fbinitialize() signature to only take
  'struct spi_dev_s *spi'.

include/nuttx/lcd/st7796.h:
- Removed legacy macros (ST7796_XRES_RAW, etc.) and configuration
  structures.
- Updated st7796_fbinitialize() prototype.
- Added st7796_board_power() callback prototype.
- Removed private implementation details from the public header.

boards/arm/stm32h7/nucleo-h753zi/Kconfig:
- Removed chip-level menus (settings, orientation) now handled by the
  generic driver.
- Retained only board-specific wiring concerns (pins and SPI bus).

boards/.../stm32_st7796.c:
- Removed g_st7796_config and associated board-side macros.
- Updated st7796_fbinitialize() call to the new signature.
- stm32_st7796_flush_fb() now queries effective resolution
  via g_fb_vtable->getvideoinfo().

Verified on nucleo-h753zi:
Orientation: Landscape (480x320),
Rotation: 180 deg,
BGR: enabled,
INVCOLOR: disabled,
BPP: RGB565,
Frequency: 40 MHz.
Making INVCOLOR a Kconfig option (default n) fixes cases where panels
previously showed inverted colors due to hardcoded INVON.

Signed-off-by: vrmay23 <vmay.sweden@gmail.com>
2026-03-08 15:46:52 -03:00
yintao
621da5bc5c drivers/rpmsg_virtio: Add VIRTIO_RPMSG_F_BUFADDR to support specify the address
support specify the address by h2r_buf_addr and r2h_buf_addr
so is can split shared memory pool

Signed-off-by: yintao <yintao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-03-05 12:39:13 +08:00
Chip L.
440ad137b8 wireless/cc1101: Add standard RF IOCTL support.
Implement `cc1101_file_ioctl` to map common NuttX wireless IOCTL commands
to CC1101 hardware registers. This allows dynamic configuration of radio
parameters from user-space applications.

* Map `WLIOC_SETRADIOFREQ` and `GETRADIOFREQ` to `FREQ[2:0]`.
* Map `WLIOC_SETADDR` and `GETADDR` to `ADDR`.
* Map `WLIOC_SETTXPOWER` and `GETTXPOWER` to internal PATABLE indexing.
* Map `WLIOC_SETMODU` and `GETMODU` to `MDMCFG2`.
* Map `WLIOC_FSK_SETBITRATE` and `GETBITRATE` to `MDMCFG4` and `MDMCFG3`.
* Map `WLIOC_FSK_SETFDEV` and `GETFDEV` to `DEVIATN`.
* Normalize positive SPI status byte returns from `cc1101_access` to `OK` (0)
  to ensure POSIX compliance and prevent silently skipped register writes.

Signed-off-by: Chip L. <chplee@gmail.com>
2026-03-04 10:51:16 -03:00
chao an
0a6a2e5e04 serial/uart_rpmsg: Remove redundant CONFIG_RPMSG_UART_CONSOLE macro check
Remove the unnecessary CONFIG_RPMSG_UART_CONSOLE preprocessor guard around
the console registration logic in uart_rpmsg_init().

The uart_rpmsg_init() function already accepts a bool isconsole parameter to
dynamically control console registration, which is designed to support flexible
console setup in distributed multi-core SOC systems. Adding the macro check on
top of this runtime parameter is redundant and negates the dynamic registration
capability.

This change fixes a regression introduced by PR #18410, which broke the functionality
of sim/rpproxy and sim/rpserver due to the incorrect macro guard preventing proper
console registration for the rpmsg UART device.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2026-03-03 11:55:34 -05:00
Chip L.
47c7169825 wireless/nrf24l01: Implement common RF IOCTLs and fix missing register reads.
Update the nrf24l01_ioctl function to fully comply with the common wireless
character driver interface defined in nuttx/wireless/ioctl.h, and complete
previously unimplemented device-specific commands.

* Add support for WLIOC_SETRADIOFREQ and WLIOC_GETRADIOFREQ with
  quantitative conversion between Hz (API) and MHz (Hardware).
* Add support for WLIOC_SETTXPOWER, WLIOC_GETTXPOWER, WLIOC_SETFINEPOWER,
  and WLIOC_GETFINEPOWER.
* Add WLIOC_SETMODU and WLIOC_GETMODU, strictly enforcing WLIOC_GFSK
  modulation as required by the nRF24L01 physical layer.
* Map WLIOC_SETADDR and WLIOC_GETADDR to the existing TX address routines.
* Resolve -ENOSYS in NRF24L01IOC_GETRETRCFG by reading the
  NRF24L01_SETUP_RETR register and decoding ARD/ARC shift bits.
* Resolve -ENOSYS in NRF24L01IOC_GETDATARATE by parsing RF_DR_LOW and
  RF_DR_HIGH bits from the NRF24L01_RF_SETUP register.

Signed-off-by: Chip L. <chplee@gmail.com>
2026-03-02 08:07:39 -03:00
Matteo Golin
6cffe9b0b4 drivers/sensors: Legacy sensor warning
This commit implements a compile-time warning and in-code comment
warning for legacy sensor drivers. This is intended to:

- Warn users that legacy drivers may eventually be removed
- Warn developers that they should not use a legacy driver as a
  reference for their new driver contributions

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-03-01 16:37:20 -03:00
chao an
2306cae933 serial/xlnx_ps: add help chapter for XUARTPS
N/A

Signed-off-by: chao an <anchao.archer@bytedance.com>
2026-02-27 08:14:03 -03:00
yinshengkai
45c38d8592 drivers/serial/16550: add polling mode support for serial drivers
Adds CONFIG_16550_POLLING options to enable polling mode for
transmission. This avoids TX interrupts and reduces interrupt latency
at the cost of blocking during TX.

Implements sendbuf() method for efficient buffer transmission
in polling mode.

Signed-off-by: yinshengkai <yinshengkai@bytedance.com>
Signed-off-by: chao an <anchao.archer@bytedance.com>
2026-02-27 08:14:03 -03:00
yinshengkai
8c035a2414 drivers/serial/xlnxps: add polling mode support for serial drivers
Adds CONFIG_UART_XLNXPS_POLLING options to enable polling mode for
transmission. This avoids TX interrupts and reduces interrupt latency
at the cost of blocking during TX.

Implements sendbuf() method for efficient buffer transmission
in polling mode.

Signed-off-by: yinshengkai <yinshengkai@bytedance.com>
Signed-off-by: chao an <anchao.archer@bytedance.com>
2026-02-27 08:14:03 -03:00
chao an
cfd1771981 serial/xlnx_ps: add common Xilinx UART Peripheral System (XUARTPS) support
This PR adds complete driver support for the Xilinx UART Peripheral System (XUARTPS)
in the NuttX serial driver framework. The implementation includes the core driver code
(uart_xlnx_ps.c), configuration files (Kconfig-xlnxps), header definitions (uart_xlnx_ps.h),
and integration with the existing NuttX build system (CMakeLists.txt, Make.defs, Kconfig).

The driver supports UART0 configuration with customizable parameters (base address,
clock frequency, IRQ number, baud rate, parity, data bits, stop bits), RX/TX buffer sizing,
hardware flow control (RTS/CTS), interrupt-driven data transfer, and console mapping for XUARTPS UART0.
It also provides standard serial driver operations (setup, shutdown, attach/detach, ioctl, send/receive)
and early serial initialization for boot-time console access.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2026-02-27 08:14:03 -03:00
Chip L.
3582497909 wireless/cc1101: Add Kconfig option to bypass strict version check
Many third-party CC1101 modules (such as those populated on the Evil Crow
RF V2) feature clone silicon that hardcodes the VERSION register to 0x00
instead of the official 0x14.

Previously, the cc1101_checkpart() function strictly enforced
VERSION == 0x14, which caused cc1101_register() to return -ENODEV (-19)
and abort initialization on these compatible modules.

This commit introduces the CONFIG_WL_CC1101_IGNORE_VERSION Kconfig option.
- When disabled (default), the driver maintains strict official silicon
  validation. This preserves the diagnostic ability to catch hardware
  faults, such as a MISO line shorted to GND (which also reads as 0x00).
- When enabled, the driver explicitly permits VERSION == 0x00, allowing
  successful initialization and interoperability with clone chips while
  printing a warning to the syslog.

Signed-off-by: Chip L. <chplee@gmail.com>
2026-02-27 08:10:04 -03:00
liwangzhu
19fa9c1c67 drivers/syslog: add millisecond option for syslog timestamp formatting
This commit introduces a new Kconfig option SYSLOG_TIMESTAMP_MS to allowconfiguring
syslog timestamps to use milliseconds (ms) instead of the default microseconds (µs).

Key changes:
1. Add CONFIG_SYSLOG_TIMESTAMP_MS boolean Kconfig option (depends on SYSLOG_TIMESTAMP),
   default disabled. This option lets users choose between millisecond and microsecond
   precision in syslog timestamps.

2. Modify the timestamp format string in nx_vsyslog():
  a. When CONFIG_SYSLOG_TIMESTAMP_MS is enabled: Use [%5ju.%03ld] (3 digits for ms).
  b. When disabled (default): Retain original [%5ju.%06ld] (6 digits for µs).

3. Adjust the timestamp value calculation:
  a. For ms: Divide nanoseconds by NSEC_PER_MSEC (1,000,000) to get millisecond value.
  b. For µs (default): Retain division by NSEC_PER_USEC (1,000) for microsecond value.

This enhancement provides flexibility in syslog timestamp precision:

1. Millisecond precision reduces log line length and is sufficient for many use cases.
2. Maintains backward compatibility (microseconds remain the default).
3. The Kconfig dependency ensures the option is only visible when timestamps are enabled.

The change is fully conditional and has no impact on existing behavior unless the new option is explicitly enabled.

Signed-off-by: liwangzhu <liwangzhu@bytedance.com>
Signed-off-by: chao an <anchao.archer@bytedance.com>
2026-02-27 08:09:31 -03:00
zhanghongyu
e404fe4b8d rndis.c: move ifup in setconfig to the work queue
Move network interface up operation (ifup) to work queue in RNDIS USB
device driver to avoid calling netdev_carrier_on API in interrupt context.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-02-27 15:39:38 +08:00
wangchengdong
1608223eb3 drivers/xbee: remove nxsig_notification when signal support is disabled
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-02-26 20:03:05 +08:00
wangchengdong
800d39cdbf drivers/timers: remove nxsig_notification when signal support is disabled
When all signals are disabled, nxsig_notification is not available and
 should not be invoked. Remove the call to avoid build and runtime issues
 in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-02-26 20:03:05 +08:00
wangchengdong
913aa99f05 drivers/sensors: remove nxsig_notification when signal support is disabled
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-02-26 20:03:05 +08:00
wangchengdong
784a469e02 drivers/net: remove nxsig_notification when signal support is disabled
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-02-26 20:03:05 +08:00
wangchengdong
317a39a3e9 drivers/lcd: remove nxsig_notification when signal support is disabled
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-02-26 20:03:05 +08:00
wangchengdong
8d99ce1b62 drivers/ioexpander: add DEV_GPIO_NSIGNALS dependency on signals
DEV_GPIO_NSIGNALS relies on signal support. Add an explicit Kconfig
dependency on SIGNALS to prevent invalid no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-02-26 20:03:05 +08:00
wangchengdong
7aa761c69d drivers/input: remove nxsig_notification when signal support is disabled
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-02-26 20:03:05 +08:00
wangchengdong
a7daf0a04d drivers/alt1250: remove altmdm_timer for no signals
When all signals are disabled, remove the altmdm_timer-related
  implementation and API definitions.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-02-26 20:03:05 +08:00
Matteo Golin
2d768c294e arch/delays: Invalid default value for BOARD_LOOPSPERMSEC
Changes the default value for CONFIG_BOARD_LOOPSPERMSEC to -1, which is
invalid. All boards that forget to configure this value will encounter a
static assertion at compile time, enforcing that configurations
upstreamed to NuttX have calibrated values for correct delay timings.

Boards which implement ALARM_ARCH or TIMER_ARCH do not rely on the
busy-loop delay implementation and thus only have a run-time check to
ensure proper delay-timings (in the case where delays are used before
the alarm/timer driver is registered).

Some boards already in the NuttX upstream do not have calibrated values,
but there are no users who currently own the board to submit a
calibrated value for the configurations to use. In this scenario, the
value is temporarily set to 0 and a warning is displayed so that users
of these boards are informed of the calibration process.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-02-25 15:00:03 -03:00
Maarten Zanders
65207ae1c5 serial/uart_rpmsg: add _raw version of driver
Mainline Linux doesn't use data encapsuation or flow control in its
tty_rpmsg driver. Create a NuttX counterpart which matches this
implementation.
This driver uses the static "rpmsg-tty" name to connect with the
remote service.

Signed-off-by: Maarten Zanders <maarten@zanders.be>
2026-02-23 09:19:57 -03:00
Maarten Zanders
be66d39552 serial/uart_rpmsg: use config option for console registration
Parameter isconsole in uart_rpmsg_init() has two effects: set uart
terminal flags for typical console use and register the device as
/dev/console. These are separate things. The latter might not be
wanted in all cases.

Use the already existing config option CONFIG_RPMSG_UART_CONSOLE to
conditionally register the uart as console device.

Signed-off-by: Maarten Zanders <maarten@zanders.be>
2026-02-23 09:19:57 -03:00
vrmay23
96a49bc7f7 drivers/lcd: Add ST7796 TFT LCD framebuffer driver
Add support for ST7796 TFT LCD controller (320x480). The driver
implements the NuttX framebuffer interface for SPI-connected displays.

Features:
- SPI interface with CONFIG_SPI_CMDDATA for D/C pin control;
- RGB565 (16-bit) and RGB666 (18-bit) color formats;
- Runtime rotation support (0, 90, 180, 270 degrees) via MADCTL;
- Board-provided configuration via st7796_config_s structure;
- Partial screen update via updatearea for efficient rendering;
- Persistent swap buffer to avoid per-frame allocations;
- Proper ST7796S initialization sequence with documented timing;

The driver uses a board-provided configuration structure allowing
flexible setup of resolution, SPI frequency, color depth, and
initial MADCTL value without requiring Kconfig options in the
generic driver.

Architecture changes in this revision as per request:

- Moved internal register commands to .c file (private)
- Moved MADCTL bit definitions to .c file (private)
- Moved struct st7796_cmd_s to .c file (private)
- Converted MADCTL orientation macros to absolute values
- Moved CONFIG_SPI_CMDDATA error check to beginning of file
- Removed duplicated CONFIG_SPI_CMDDATA guards
- Public header contains only board configuration API
- Changed the Kconfig auto-select FB from 'select' to 'depends on'

Tested with LVGL graphics library on STM32H753ZI board (my own port).

Signed-off-by: Vinicius May <vmay.sweden@gmail.com>
2026-02-19 09:19:13 -03:00
SPRESENSE
72b67832ea Makefile: Remove make depend files by make distclean
Intermediate files of make depend like .ddc and .dds may remain
when make is interrupted. Remove them using make distclean.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2026-02-16 16:27:57 +01:00
Ari Kimari
1c36ba764f drivers/usbdev: Fix usbmsc_unbind() function for composite device
1. Move DEBUGASSERT to correct place
2. Leave it out if composite device
3. Move working thread stop to separate function
4. Call it from unbind function for composite device

Signed-off-by: Ari Kimari <ari.kimari@tii.ae>
2026-02-12 10:29:15 -03:00
yaojingwei
24a18d33af v4l2_cap: fix reqbuf return error when set count = 0.
Return success when reqbuf count is zero.


Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2026-02-10 16:20:21 -05:00
yangyalei
84bcb12fff nuttx/v4l2: Fix array access out of bounds
Fix out-of-bounds access in v4l2 array handling.


Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-02-10 16:20:21 -05:00
Felipe Moura
ef71625ede input: add keyboard matrix driver
Add a generic kmatrix lower-half with polling/debounce, STM32 board adapters, Kconfig options, a public API header, and a test example/documentation.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>

decouple kbd / keypad.

Fix some comments

add documentation

fix rule issues

Update CMakeLists.txt

update documentation.

improve documentation
2026-02-10 08:15:01 -03:00
zhangyuan29
6c37217c36 drivers/note: noteram ioctl FIONBIO should return -ENOTTY
In file_dup3, the file descriptor is initialized with the O_NONBLOCK flag.
If the inode's ioctl(FIONBIO) call fails with a result other than OK or
ENOTTY, the file may be mistakenly released.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-02-10 08:01:59 -03:00
yaojingwei
c2efa96002 drivers/video: optimize critical section.
use spin/mutex lock to replace critial section.

Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2026-02-09 20:56:46 -03:00
Jiri Vlasak
65f8053305 lcd/ili9341: Improve putrun's checks
Improve checks for the position outside of the LCD's area. Fix the input
when possible.

Slightly improve the documentation.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-02-06 14:15:36 -03:00
Bowen Wang
877a9af2d1 rpmsg_virtio/rptun: support fallback cpuname when VIRTIO_RPMSG_F_CPUNAME not set
When the VIRTIO_RPMSG_F_CPUNAME feature is not negotiated, the driver
previously would crash due to DEBUGASSERT. This commit adds support
for a fallback mechanism:

1. Add rpmsg_virtio_probe_cpuname() API that accepts an optional cpuname
   parameter to be used when VIRTIO_RPMSG_F_CPUNAME is not available.

2. Modify rptun driver to pass the cpuname from rptun device config
   to rpmsg_virtio_probe_cpuname().

3. Refactor rptun device register/unregister to prioritize RPMSG device
   handling before other virtio device types.

This ensures the system works correctly in scenarios where the remote
side does not support the VIRTIO_RPMSG_F_CPUNAME feature.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-02-04 20:01:13 -03:00
wangzhi16
2274c31950 drivers/vhost: add missing SCHED_WORKQUEUE dependency
The vhost driver uses work_queue() for deferred probe but was missing
the SCHED_WORKQUEUE Kconfig dependency, causing link errors on boards
that don't enable workqueue by default.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-02-04 02:32:02 +08:00
Yongrong Wang
b3314b3813 drivers/vhost: use MSEC2TICK for deferred probe period
Convert VHOST_DEFERED_PROBE_PERIOD from a raw value to use MSEC2TICK()
macro, ensuring the delay is correctly converted from milliseconds to
system ticks regardless of the configured tick rate.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2026-02-04 02:32:02 +08:00
Yongrong Wang
a286287f4e drivers/virtio and vhost: auto-select parent config from sub-drivers
Change DRIVERS_VIRTIO and DRIVERS_VHOST from menuconfig to hidden config
options. Each virtio/vhost sub-driver now automatically selects its parent
config, eliminating the need to manually enable DRIVERS_VIRTIO or
DRIVERS_VHOST in defconfig files.

This simplifies board configuration by removing redundant CONFIG_DRIVERS_VIRTIO
entries from affected defconfig files.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-02-04 02:32:02 +08:00
Bowen Wang
2fc2f44b61 drivers/vhost: add vhost_get_vq_buffers() to collect scatter-gather buffers
Add vhost_get_vq_buffers() API to retrieve all chained buffers from a
virtqueue in one call. This simplifies handling of scatter-gather I/O
where data spans multiple descriptors.

The function populates an array of virtqueue_buf structures with buffer
pointers and lengths, returning the descriptor head index on success.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-02-04 02:32:02 +08:00
Ari Kimari
f126e7575e drivers/analog: fix adc ads1115 driver
Signed-off-by: Ari Kimari <ari.kimari@tii.ae>

Fix write reg to work with all platforms
Fix compile warnings
2026-02-03 08:27:59 -05:00
Hyunjun Lee
8dbc3e3122 drivers/power/pm: Fix typos in comments
Fix typos in comments of drivers/power/pm/activity_governor.c and unify
comment style for consistency.

Signed-off-by: Hyunjun Lee <hyunjunk.lee@samsung.com>
2026-02-02 15:53:09 +01:00
ouyangxiangzhen
3eedf5f22b sched/wdog: Simplify timer expiration for hrtimer.
This commit simplified the timer expiration for hrtimer.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-02-02 13:26:22 +08:00
zhanghongyu
a7567677a8 netdev_driver: add carrier_on to xxx_ifup where carrier_on is absent
since the judgment for network card selection was changed from IS_UP to
IS_RUNNING, drivers that lack carrier_on need to add the carrier_on
operation; otherwise, network access issues will occur.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-02-02 13:23:05 +08:00
liaoao
425a760799 drivers/rpmsg: implement timestamp support for rpmsg_port
Add TX/RX timestamp tracking for rpmsg_port to enable latency
measurement and debugging:

- Add rpmsg_port_get_timestamp() to retrieve buffer timestamps
- Add rpmsg_port_update_timestamp() to record timestamps at TX/RX time
- Integrate timestamp recording in rpmsg_port_spi and rpmsg_port_spi_slave
- Reserve space for rpmsg_timestamp_s in buffer size calculations

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-02-01 01:14:49 +08:00
liaoao
198a8fe108 drivers/rpmsg: add rpmsg_get_timestamp to retrieve buffer timestamps
Add rpmsg_get_timestamp() API to get the TX/RX timestamps of an rpmsg
buffer. This is useful for latency measurement and debugging purposes.

The new rpmsg_timestamp_s structure contains:
  - tx_nsec: timestamp when the buffer was transmitted
  - rx_nsec: timestamp when the buffer was received

Signed-off-by: liaoao <liaoao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-02-01 01:14:49 +08:00
Bowen Wang
f1d06cbdcf drivers/virtio: fix the minor code style in virtio.c
Add empty line after `}`

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-31 13:09:30 -03:00
Bowen Wang
3237e25d70 drivers/virtio: use virtqueue_nused() to check pending buffers
Replace direct virtqueue internal field access with virtqueue_nused()
API to check for pending buffers in interrupt handlers. This improves
code maintainability and handles cached memory scenarios correctly.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-31 14:14:25 +08:00
wangmingrong1
fee69a2046 driver/virtio: Delete reset on initialization
Resetting during initialization can cause qemu to lock up, for example, virtio-gpu. qemu does not need to reset virtio during initialization.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2026-01-31 02:38:46 +08:00
paolovolpi
db50f0445a drivers/ioexapnder/mcp23x17 : Fix write gpio output values on OLAT registers
Gpio output value must be set on OLATA and OLATB registers.

Summary

Why is this change necessary?
This is a bug fix. The MCP23x17 driver was writing GPIO output values to incorrect registers, causing output
pins to not behave as expected.

What functional part of the code is being changed?
The MCP23x17 I/O expander driver (drivers/ioexpander/mcp23x17.c).

How does the change work?
The fix ensures GPIO output values are written to the OLATA and OLATB (Output Latch) registers instead of the
incorrect registers. The OLAT registers are the proper registers for controlling the actual output pin
states on the MCP23x17.

Impact

- User experience: No adaptation required. This fix corrects existing broken behavior.
- Build: No impact.
- Hardware: Affects boards using the MCP23x17 I/O expander.
- Documentation: None required.
- Security: No impact.
- Compatibility: Backward compatible - fixes incorrect behavior.

Testing

Build Host:
- OS: Ubuntu 22.04
- Compiler: arm-none-eabi-gcc

Target:
- Architecture: ARM (RP2350)
- Board: RP2350-based board
- Configuration: Custom config with MCP23x17 enabled over I2C0

Testing performed:
- Connected MCP23x17 to RP2350 via I2C0
- Attached an LED array to all 16 GPIO pins of the MCP23x17
- Configured all 16 GPIO as outputs
- Wrote a simple test application to toggle the LEDs on and off
- Before fix: LEDs did not respond correctly to output commands
- After fix: All 16 LEDs toggle on/off as expected

Signed-off-by: paolo <paolo.volpi@gmail.com>
2026-01-30 17:42:48 +01:00
Bowen Wang
521fcd964d virtio: should use size matched operation to read virtio config space
1. Use virtio_read_config_bytes() to read the string types in
rpmsg-virtio and virtio-net;
2. Use virtio_read_config_member() to read the elements in
virtio-snd configuration space;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-30 08:11:57 -03:00