Commit graph

6994 commits

Author SHA1 Message Date
wangzhi16
35a62b7d5e Revert "Reduce the size of tcb by four bytes."
This reverts commit 893c5e92c2.
2025-05-27 16:30:35 +08:00
raiden00pl
1775528beb drivers/sensors: add missing SENSORS prefix after d68476796a
add missing SENSORS prefix after d68476796a for some sensors

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-25 09:50:53 +08:00
Tim Hardisty
a28367f507 drivers/usbdev/cdcncm.c: Fix issue with unplug/replug of USB causing link not to re-establish
Signed-off-by: Tim Hardisty <timh@jti.uk.com>
2025-05-24 12:29:07 +08:00
raiden00pl
d68476796a drivers/sensors: fix various coding style issues
fix various coding style issues for drivers/sensors:

- remove redundant `#define CONFIG_XXX` that should be provided from Kconfig
- correct section banners
- remove empty section banners
- fix some function banners

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-23 11:29:58 -03:00
Lars Kruse
3dc53adb28 arch | boards | drivers: fix whitespace issues for switch case statements 2025-05-23 10:48:41 +08:00
Lars Kruse
3ce85ca54e style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
p-szafonimateusz
49ad027c60 drivers/ctucanfd_pci.c: fix frame reception
Fix frame reception when CANFD is not enabled and there are many message in
the RX buffer.

The previous implementation assumed that the size of the data in the RX buffer
is constant, which is not true. Fortunately, the amount of
data in the buffer can be easily read from frame->fmt.rwcnt.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-05-21 21:10:17 -03:00
raiden00pl
3a31da9585 sensors: add support for BME688 sensor
Add support for BME688 sensor based on BME680 implementation.
The BME688 is nearly identical to the BME680, and this implementation
reuses much of the existing BME680 code. However, there are some differences
related to gas measurements that make it impractical to use the same driver
without significantly complicating it. BME688 also supports parallel mode
which isn't yet supported.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-17 12:16:54 +08:00
Yanfeng Liu
55f85dd727 drivers/ctucan: fix IRQ ctrl
This revises the post-IRQ interruption control logic so that to balance
the disable/enable operations for both chardev and socketcan cases.

Checked with chardev/socketcan on qemu-intel64.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-05-16 18:21:07 +08:00
p-szafonimateusz
fab4f68b6f drivers/usbhost: add xHCI support
add xHCI PCI driver (usbhost).

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-05-15 21:58:57 +08:00
p-szafonimateusz
3dc1ac91d6 usbhost: add common usb host waiter and drivers initialization
add common usb host waiter and drivers initialization which is
required for xHCI support

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-05-15 21:58:57 +08:00
Lars Kruse
4568110d63 fix misspelled names in locally scoped code
These misspelled words are used in strictly local scopes.
Renaming these variables should not cause any problems.
2025-05-15 10:12:12 +08:00
p-szafonimateusz
ce99762b36 drivers/ctucanfd_pci.c: fix pointer unaligned GCC error
fix an unaligned pointer error for arm32 build:

  ctucanfd_pci.c:1361:7: warning: converting a packed 'struct ctucanfd_frame_s'
  pointer (alignment 1) to a 'uint32_t' {aka 'long unsigned int'} pointer (alignment 4)
  may result in an unaligned pointer value [-Waddress-of-packed-member]
   1361 |       ptr = (FAR uint32_t *)&rxframe;

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-05-15 10:00:22 +08:00
raiden00pl
dc73324ed0 drivers/can: fix codespell errors
drivers/can: fix codespell errors

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-14 10:30:25 -03:00
raiden00pl
5d95d0871f drivers/can: move CAN utils to CAN common files
Move can_bytes2dlc() and can_dlc2bytes() to a common CAN file
that can be shared between socketCAN implementation and CAN
character driver.

This is the first step to simplifying the logic repeated in
many CAN drivers.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-14 10:30:25 -03:00
simbit18
ea47f0cf42 [Kconfig]: Fix Kconfig style
Remove spaces from Kconfig files
Add comments
Add TABs

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-14 21:15:14 +08:00
George Poulios
47064e42df drivers/misc/optee: Fix non-registered memory ref passing
So far the NuttX implementation of OP-TEE has been using
registered memory references to pass non-registered memory
to OP-TEE OS, passing the physical address of the memory
in what is normally used as a 'cookie'. This was compatible
with the Openvela framework, but no other OP-TEE OS.

Fix this by passing temporary memory instead with the standard
non-contiguous (OPTEE_MSG_ATTR_NONCONTIG) flag.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-13 10:14:01 +08:00
George Poulios
6f77cb6dce drivers/misc/optee: Proper cleanup of registered shm
This is mostly to handle the case that the user calls
close() before calling close() on the shm. In that case
optee_close() frees the shm and then optee_shm_close()
operates on an invalid reference. Fix that.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-13 10:14:01 +08:00
George Poulios
7f20487f56 drivers/misc/optee: Rename optee_shm_entry to optee_shm
This is no longer (exactly) the linked list entry that it
used to be, but rather an associated pointer in an idr tree
entry. Plain 'optee_shm' is more concise, and more appropriate.

Changes also reg_pair_to_uintptr() to reg_pair_to_ptr() for
better readability in invocations.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-13 10:14:01 +08:00
George Poulios
a2a689fee0 drivers/misc/optee: Fix GP API compatibility
Previous implementation was not compatible with GlobalPlatform
API in the following ways:
 - Registered mem IDs would begin from negatives when it should
   have been greater than or equal to 0
 - Register IOCTL would return 0 on success, when it should have
   been returning a file descriptor.
 - Register IOCTL would expect the user-space client to specify
   TEE_SHM_* flags dictating its behaviour when in fact, libteec
   never specifies flags.

This commit fixes all those issues. It uses nuttx/idr.h instead
of a linked list, and it uses `file_allocate` to provide file
descriptors for registered shared memory. Upon close(fd), the
memory is de-registered and freed accordingly. It also updates
the documentation accordingly.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-13 10:14:01 +08:00
George Poulios
c497ee249b drivers/misc/optee: Harmonize invalid user addr errors
Some calls to `optee_is_valid_range()` would return
-EINVAL and some would return -EACCESS. Change all to
-EFAULT (Bad Address) which is more appropriate.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-13 10:14:01 +08:00
Michal Lenc
c0a6afff11 drivers/usbdev/Kconfig: fix COMPOSITE_VENDORSTR description
Option COMPOSITE_VENDORSTR should be described as composite vendor
string, not vendor id. This is consistent with other USB devices.

Also fixes a typo in USBDEV_EPBUFFER_ALIGNMENT.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-05-13 09:57:30 +08:00
Windrow14
b05ec7729d drivers/mmcsd/mmcsd_sdio.c: use dma to receive setup if dma is enabled
Call SDIO_DMARECVSETUP instead of SDIO_RECVSETUP if CONFIG_SDIO_DMA
is defined, aligning with other callings of in mmcsd_sdio.c.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2025-05-11 20:28:55 +08:00
George Poulios
b103a64a87 drivers/misc/optee: Add SMC backend for arm archs
So far NuttX has supported OP-TEE interfacing over
local and RPMsg sockets. This commit introduces support
for direct invocation of OP-TEE through arm SMCs. The
SMC transport is enabled through CONFIG_DEV_OPTEE_SMC.

This SMC implementation has been tested only with arm64,
OP-TEE rev 4.4.

Note that it does not support reverse direction RPCs,
i.e. from the Secure World to the Normal World to
something like optee supplicant. A basic RPC handling
skeleton is provided with implementation for some
basic functions (alloc/free mem, and foreign interrupts)
but no supplicant command handling.

(+one minor change s/parm/param in arch/arm64/include/syscall
to satisfy the spellchecker during PR)

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-09 10:29:26 +08:00
George Poulios
a2b8c9d1d8 drivers/misc/optee.c: Add shm registration support
Adds support for SHM_REGISTER IOCTL. Registration can
be requested both against the driver (for automatic cleanup)
and against the secure OS (for sharing).

Introduces also `optee_{msg,free}_alloc()` to allocate
aligned memory for message arguments depending on the
`alignment` specified in the driver's private data. For
alignment greater than word size, memory is allocated on the
heap, otherwise it's allocated on the stack (similar to the
previous implementation but using `alloca()` instead).

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-09 10:29:26 +08:00
George Poulios
8546fb080d drivers/misc/optee.c: Add memory sanity checks
Besides a few checks for NULL IOCTL argument values, this
commits introduces also a check to ensure that user specified
memory (mainly IOCTL arguments) indeed belongs to the user.
This is applicable only with `CONFIG_ARCH_ADDRENV`.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-09 10:29:26 +08:00
George Poulios
5c8e5d2ef2 drivers/misc/optee.c: Close session on open error
Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-09 10:29:26 +08:00
George Poulios
da0586c7e3 drivers/misc/optee.c: Decouple transport from driver
Prepares the ground for introducing new transports to
the OP-TEE driver. "transports" as in alternatives to
RPMsg and local network.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-05-09 10:29:26 +08:00
Tim Hardisty
ed0c18c66c drivers/video/fb.c: Add startup splashscreen option
Adds Kconfig-selected splashscreen options used when the driver is first registered

* Includes a new Python script in ./tools to create RLE bitmap files
* Includes default NS logo btimaps in 320x320, 160x160 and 80x80 resolutions along with their PNG files

Signed-off-by: Tim Hardisty  timh@jti.uk.com>
2025-04-30 06:38:05 -03:00
Lars Kruse
9b3914b740 drivers/analog/mcp47x6: Add support for MCP47X6 DAC series
The MCP47X6 series consists of the following single channel DAC chips:
- MCP4706 (8 bit)
- MCP4716 (10 bit)
- MCP4726 (12 bit)

The driver supports the following configurations:
- gain
- power down
- voltage reference

Persistent configuration storage in the internal EEPROM is not
implemented.
2025-04-29 16:17:44 -03:00
p-szafonimateusz
33a6e70077 serial/uart_pci_16550.c: fix multiport ax99100
ax99100 export each serial port as a separate PCI device function
so we have to handle this properly.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-04-29 15:33:23 -03:00
Serg Podtynnyi
9566b2b908 drivers/lcd/ili9341: Add custom width/height display options
Add ability to set custom height/width for each two lcd ifaces

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-04-27 08:37:54 -03:00
Michal Lenc
8832136b69 drivers/ioexpander/icjx: add option to set filters during initialization
This adds filters field to icjx_config_s structure that is passed
as an argument in icjx_initialize function. This field allows to
configure I/O filters (control world 1 and 3) with three possible
filters or disable them at all.

The filter configuration is currently only configurable during the
initialization, not at run time (the same as current source)

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-04-24 10:05:56 -03:00
Matteo Golin
0cb7bd7f76 wireless/lpwan/rn2xx3: Fix invalid sync word bug.
This commit resolves issue #16009, where a sync word of less than 64
bytes was printed as 0-padded hex. 0-padding is invalid for the RN2xx3
modules, so now it has been removed.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-04-20 16:55:45 -03:00
Matteo Golin
da982e113e drivers/sensors/lis2mdl: Fix SYSLOG call.
This call to syslog was missing the '%' in its format string, and also
was using the wrong format string (lu instead of d) to print the `cmd`
argument. It is corrected and the compiler warning resolved.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-04-20 16:54:47 -03:00
Jukka Laitinen
b5144afd03 drivers/video/vnc: Replace direct semcount access with nxsem_get_value
Use the dedicated nuttx internal interface for debugging semaphore value,
instead of accessing it directly.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-04-16 18:11:01 +08:00
zhangshoukui
927fe5bc2a drivers/serial/Kconfig: TTY_LAUNCH depends on SCHED_HPWORK
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-04-13 11:58:08 +08:00
Chongqing Lei
29da7fc824 wireless/bt_uart: Fix ACL data buffer length verification.
Driver now validates ACL provided buffer length agaist the size of
the data buffer which is defined by CONFIG_BLUETOOTH_UART_RXBUFSIZE.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-04-11 15:57:53 +08:00
chao an
4e1e833b05 drivers/rpmsg: correct crc16 catalogue to CRC-16/IBM
This is the pair implementation relative to the Linux kernel

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-10 11:45:26 +08:00
wangjianyu3
7ffa06a78d drivers/ft5x06: Remove wakeup and nreset check
Remove unused wakeup and nreset check of FT5X06.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-04 09:50:19 -03:00
Jani Paalijarvi
02c9030e88 drivers/bch: Add CONFIG_BCH_FORCE_INDIRECT
This implements similar functionality than CONFIG_FAT_FORCE_INDIRECT
because in some use cases (e.g. when CONFIG_BUILD_KERNEL) it is not possible to
write directly from user buffer.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-04-03 16:21:51 +08:00
chao an
0bfb850b52 drivers/serial/uart_rpmsg: simplify initialization process of uart_rpmsg
Merge multiple heap allocate into one

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-02 20:56:01 +08:00
wangjianyu3
38652e19aa drivers/lcd/st7789: Support mirror V
Mirror X and V can rotate the screen 90 degrees.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-02 09:51:32 +08:00
liujp
c9fd44a0ec fix(bug): fix ft5x06_sample error
Signed-off-by: liujp <liujp@xiaomi.com>
2025-04-02 01:42:59 +08:00
wangjianyu3
c5afcd78f1 drivers/lcd/st7789: Send RAMCTRL if little endian
Send RAMCTRL command only when RGB data in little endian.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-02 01:03:48 +08:00
Daniel Byshkin
504f838577 sensors/nau7802: Add support for the NAU7802
This patch adds support for the NAU7802 24 bit ADC from Nuvoton.
Please read the documentation for more details.

Signed-off-by: Daniel Byshkin <online@bskdany.com>
2025-04-01 09:38:37 +08:00
wangjianyu3
f42b784349 drivers/lcd/st7789: Add option for RGB data endian
Big endian by default.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-31 10:06:45 -03:00
raiden00pl
c4f142e45c syslog: add an option to completely disable syslog logic
Add an option to completely disable syslog() and replace it with an empty functions.
This option can be useful for small systems when we don't have any logging support,
but compiler is not able to remove useless code.

This way the final image also won't contain the strings that are present in
syslog() calls when compiler optimization is enabled (for example from /boards
where syslog is often used instead of debug macros).

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 11:36:19 +08:00
yangsong8
48af14beca driver/serial: Check again the RX buffer, then check file flags
The UART driver (cdcacm...) might have buffered data received, Just continue
processing the RX queue if this happens. If not, then check the file or dev
flags.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-29 10:34:00 +08:00
zhangshoukui
0550355c92 drivers/mtd/mtd_cfi: Add MTDIOC_ERASESTATE
We need to give a default erase value when we register cfi flash for mtd devices
he pseudo-code is as follows:
register_cfi_driver(xxx)
find_mtddriver("xxx", &inode);
mtdconfig_register(inode->u.i_mtd);

https://github.com/Zhangshoukui/nuttx/blob/master/drivers/mtd/mtd_config.c#L1775C28-L1775C45

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-03-28 19:19:35 +08:00