Commit Graph

5218 Commits

Author SHA1 Message Date
David Sidrane
d570a93945 mmcsd_sdio:Insure a error exiting via mmcsd_removed will not Hang system.
mmcsd_removed will be called if the card is in invalid state.
   This can happen if the card is bad, or vibrations causes a power
   loss.

   mmcsd_removed resets:
     priv->capacity     = 0; /* Capacity=0 sometimes means no media */
     priv->blocksize    = 0;
     priv->probed       = false;
     priv->mediachanged = false;
     priv->wrbusy       = false;
     priv->type         = MMCSD_CARDTYPE_UNKNOWN;
     priv->rca          = 0;
     priv->selblocklen  = 0;
     priv->widebus      = false;

  If blocksize is set to 0 will cause the log2 to result
  in an infinate loop in some drivers.

  IS_EMPTY will check for priv->type = MMCSD_CARDTYPE_UNKNOWN
  and return ENODEV.
2023-02-17 15:26:19 +08:00
Nathan Hartman
409e2f3701 drivers/serial, libc/termios: Implement tcsendbreak
The TERMIOS(3) function tcsendbreak() and the IOCTLs TCSBRK and TCSBRKP
transmit a serial line Break.

Previously NuttX included an extern declaration for tcsendbreak() and
defines for TCSBRK and TCSBRKP but none of these were implemented.
Attempting to build programs that called tcsendbreak() would fail with
a linker error; attempting to use TCSBRK and TCSBRKP would result in an
error at runtime.

This changeset adds the tcsendbreak() function and handling for TCSBRK
and TCSBRKP; tcsendbreak() is implemented in terms of TCSBRK. Both
TCSBRK and TCSBRKP are implemented in terms of the BSD-compatible Break
IOCTLs TIOCSBRK and TIOCCBRK, which must be provided by the lower half
serial driver. Currently, not all lower half serial drivers in NuttX
support these IOCTLs. Those that do implement them may need one or more
Kconfig options to be set, such as `CONFIG_*_U[S]ART_BREAKS` and, on
some architectures, a separate `CONFIG_*_SERIALBRK_BSDCOMPAT`.

* drivers/serial/serial.c
  (uart_tcsendbreak): New function.
  (uart_ioctl): Implement TCSBRK and TCSBRKP.

* libs/libc/termios/lib_tcsendbreak.c
  (): New file.

* libs/libc/termios/Make.defs
  (CSRCS): Add lib_tcsendbreak.c to the build.

Thanks to Xiang Xiao for PR feedback.

Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
2023-02-15 07:50:02 +08:00
zhangyuan21
32513cedf0 usbdev/adb: add adb usbclass_unbind function
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-02-14 22:20:12 +08:00
jihandong
a1e04617f8 drivers/video/video: add poll support to capture
support part of Linux std:
https://www.kernel.org/doc/html/v4.9/media/uapi/v4l/func-poll.html

Capture devices set the POLLIN and POLLRDNORM flags in the revents field

Signed-off-by: jihandong <jihandong@xiaomi.com>
2023-02-13 23:17:45 +08:00
jihandong
ae7bc4e300 drivers/video/video: add NONBLOCK support
Signed-off-by: jihandong <jihandong@xiaomi.com>
2023-02-13 23:17:45 +08:00
zhangyuan21
b4aa5b0d0b usbdev: fixed DUALSPEED issue for adb/cdcecm/rndis
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-02-13 18:47:42 +08:00
TimJTi
98e47a1770 FUSB302
Update fusb302.c

Update fusb302.c
2023-02-12 16:48:44 +08:00
zhangyuan21
8f4cb0fec3 rndis: add endpoint configure
ep3 is not avaliable in dummy hcd, so need to
make the endpoint number configurable.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-02-12 16:38:11 +08:00
zhangyuan21
f77a824105 usbdev/composite: remove excess uninitialize code
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-02-12 16:37:21 +08:00
zhangyuan21
4ddcb88c65 usbhost: fixed cdcacm issue
1. fixed cdcacm build issue
2. unregister uart driver when usbhost destroy

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-02-12 14:17:51 +08:00
Michal Lenc
824e6b3271 lcd/st7789: raise compilation error when CONFIG_SPI_CMDDATA is not set
CONFIG_SPI_CMDDATA is required for correct functionality of the display.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-02-11 20:32:20 +08:00
David Sidrane
ac50b3a473 ioexpander/gpio:Add gpio_pin_register_byname 2023-02-11 18:31:40 +08:00
Peter Bee
1949991fe0 drivers/video: add sequence number to video frames
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-02-09 23:27:15 +08:00
Peter Bee
2ebccd82b6 drivers/video: add timestamp support
Add support for timestamp and change in related drivers

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-02-09 23:27:15 +08:00
chao an
74ce3b81d3 build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
First decoupling changes related to CMAKE

BINDIR/APPSBINDIR:
Output path of Kconfig which dynamically generated by NuttX Kernel/Apps
This option is consistent with the TOPDIR/APPSDIR by default, and will
be changed when out-of-tree compilation is supported

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:13:04 +08:00
chao an
e942a7c55e build/Kconfig: fix warnings detected by kconfiglib
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:07:46 +08:00
chao an
3a0fdb019d nuttx: replace all ARRAY_SIZE()/ARRAYSIZE() to nitems()
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:05:44 +08:00
Huang Qi
b250db5dba serial: Fix a warning if termios enabled
Fix:
```
 serial/serial.c: In function 'uart_ioctl':
Error: serial/serial.c:1397:46: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
 1397 |               FAR struct termios *termiosp = (FAR struct termios *)arg;
      |                                              ^
Error: serial/serial.c:1419:46: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
 1419 |               FAR struct termios *termiosp = (FAR struct termios *)arg;
      |
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-08 13:31:35 +08:00
Huang Qi
3e41bd8b35 driver/serial: Convert CR to LF in driver
Enable the behavior by default for console,
but configurable by termios.

Binary size:

Before:
   text    data     bss     dec     hex filename
 326460     409    8164  335033   51cb9 nuttx/nuttx

 After:
    text    data     bss     dec     hex filename
 326478     409    8164  335051   51ccb nuttx/nuttx

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-08 13:31:35 +08:00
Igor Mišić
0a4fbcd123 drivers/mtd: add Kconfig options for RAMTRON emulated page & sector size 2023-02-08 01:44:51 +08:00
chao an
1cb11968b7 net/ip: fix compile break if enable NET_LOCAL_SCM
1.
net/slip.c:865:29: warning: unused variable ‘priv’ [-Wunused-variable]
  865 |   FAR struct slip_driver_s *priv =
      |                             ^~~~
net/slip.c: In function ‘slip_rmmac’:
net/slip.c:895:29: warning: unused variable ‘priv’ [-Wunused-variable]
  895 |   FAR struct slip_driver_s *priv =
      |                             ^~~~
2.
local/local_sendmsg.c: In function ‘local_sendmsg’:
local/local_sendmsg.c:423:18: warning: ‘count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  423 |           return count;
      |                  ^~~~~
local/local_sendmsg.c:131:11: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  131 |   while (i-- > 0)
      |          ~^~
local/local_sendmsg.c:71:7: note: ‘i’ was declared here
   71 |   int i;
      |       ^

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 12:46:40 +02:00
Nathan Hartman
5f9cb6faf4 drivers/serial: Fix docstrings on UART interrupt handlers 2023-02-07 04:41:36 +08:00
chao an
1779433c35 wireless/bcm43xxx/qspi: try tx after rx fails
1. Try tx after rx fails to avoid gspi_thread busy to try rx
2. Add some delay if alloc frame buffer failed

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 04:40:38 +08:00
chao an
d5ac2be84f bcm43xxx/bcmf_ioctl.h: pack wl_* structure to avoid unaligned access
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 04:40:38 +08:00
chao an
d03b105160 drivers/syslog: correct Kconfig name
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-05 01:05:32 +08:00
chao an
7625126c91 Remove the remain MIN/MAX like macro
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-03 23:22:41 +08:00
chao an
d1162ac58f mmcsd/mmcsd_spi: remove redundant mmcsd_unlock()
Assertion on lm3s6965-ek/qemu-flat if enable CONFIG_DEBUG_ASSERTIONS:

_assert: Current Version: NuttX  12.0.0 666b224c35 Feb  3 2023 19:36:38 arm
_assert: Assertion failed : at file: misc/lib_mutex.c:336 task: nsh_main 0xb385

Backtrace:
nuttx/libs/libc/sched/sched_dumpstack.c:69
nuttx/sched/misc/assert.c:494
nuttx/libs/libc/assert/lib_assert.c:36
nuttx/libs/libc/misc/lib_mutex.c:336
nuttx/drivers/mmcsd/mmcsd_spi.c:421
nuttx/drivers/mmcsd/mmcsd_spi.c:2072
nuttx/boards/arm/tiva/lm3s6965-ek/src/lm_bringup.c:119 (discriminator 3)
nuttx/boards/boardctl.c:335
apps/nshlib/nsh_init.c:144
apps/system/nsh/nsh_main.c:68
nuttx/libs/libc/sched/task_startup.c:70 (discriminator 2)
nuttx/sched/task/task_start.c:134

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-03 16:34:04 +02:00
Xiang Xiao
09841300b0 Remove the remain MIN/MAX like macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-03 20:42:57 +08:00
chao an
4c8d244fae sched/getpid: replace syscall getpid/tid/ppid() to kernel version
NuttX kernel should not use the syscall functions, especially after
enabling CONFIG_SCHED_INSTRUMENTATION_SYSCALL, all system functions
will be traced to backend, which will impact system performance.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
Gustavo Henrique Nihei
e6b204f438 nuttx: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-01 23:47:44 +08:00
anjiahao
52eaefcc8e watchdog:fix Kconfig typo
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-02-01 19:50:47 +08:00
pengyiqiang
b1773934fe note_driver: fix build error
note/note_driver.c: In function 'note_isenabled':
note/note_driver.c:278:7: error: invalid type argument of unary '*' (have 'int')
  278 |   if (CPU_ISSET(&g_note_filter.mode.cpuset, this_cpu()) == 0)
      |       ^~~~~~~~~
note/note_driver.c:278:7: error: invalid operands to binary << (have 'int' and 'volatile cpu_set_t *' {aka 'volatile unsigned char *'})
  278 |   if (CPU_ISSET(&g_note_filter.mode.cpuset, this_cpu()) == 0)
      |       ^~~~~~~~~
      |                 |
      |                 volatile cpu_set_t * {aka volatile unsigned char *}

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-02-01 14:30:33 +08:00
Xiang Xiao
9f027208d4 fs: Add model field to geometry and mtd_geometry_s
the model is very useful to track the device info

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-31 11:50:28 -03:00
Ville Juven
da83836da7 drivers/mmcsd: Fix kconfig error regarding MMCSD_IOCSUPPORT
Something I noticed in CI:
drivers/mmcsd/Kconfig:32:warning: 'MMCSD_IOCSUPPORT': number is invalid
2023-01-31 13:56:17 +01:00
Xiang Xiao
55679aec5f drivers/camera: Support the private data for imgsensor and imgdata
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-31 08:04:39 +01:00
dongjiuzhu1
74e032e924 drivers/pipes: fix write busy loop because POLLOUT always ready.
the size of pipes buffer +1 as compensate the full indicator

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-01-31 12:45:16 +08:00
Xiang Xiao
004853d6d1 drivers/watchdog: Fix the wrong value of WATCHDOG_AUTOMONITOR_PING_INTERVAL
if CONFIG_WATCHDOG_AUTOMONITOR_PING_INTERVAL equals 0, we should set
WATCHDOG_AUTOMONITOR_PING_INTERVAL to CONFIG_WATCHDOG_AUTOMONITOR_TIMEOUT / 2, not 0

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-31 11:54:36 +08:00
Zhe Weng
d3dd349649 net: Implement shutdown() for usrsock
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-01-31 11:15:01 +08:00
lilei19
1d8af7e105 add holder for mutex
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-01-31 12:08:05 +09:00
Nathan Hartman
6b89b6f945 Remove executable permissions from source files
* arch/arm/src/sama5/sam_flexcom_spi.h,
  arch/risc-v/src/mpfs/mpfs_ihc_sbi.c,
  drivers/usbdev/adb.c,
  libs/libc/math/lib_scalbn.c,
  libs/libc/math/lib_scalbnf.c,
  net/ipfrag/Make.defs,
  net/ipfrag/ipfrag.c,
  net/ipfrag/ipfrag.h,
  net/ipfrag/ipv4_frag.c,
  net/ipfrag/ipv6_frag.c: Remove executable permission.
2023-01-30 20:34:51 -03:00
helei8
4b4004b874 drivers/mmcsd: Add MMC_IOC_CMD ioctl
Signed-off-by: helei8 <helei8@xiaomi.com>
2023-01-30 14:09:23 -03:00
Zhe Weng
ff68d9ac04 net/tun: Change TUN/TAP to use IOB
TUN/TAP is not working after IOB offload, try to fix.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-01-31 00:39:15 +08:00
Zhe Weng
af0a35f9ae net/slip: Change SLIP to use IOB
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-01-30 23:42:01 +08:00
anjiahao
6f2f62f4ce watchdog:fix Kconfig typo
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-30 15:49:50 +01:00
Oleksandr Oryshchenko
0842a291e0 [Drivers] Add smart_loop_register_driver call to drivers_initialize 2023-01-30 11:09:40 +08:00
Oleksandr Oryshchenko
28f92e8238 [MTD/SmartFS] Extract register_driver call to own function 2023-01-30 11:09:40 +08:00
Xiang Xiao
7d66a16c53 Minor style clean up
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-28 19:53:20 +02:00
chao an
94db8a9414 wireless/ieee80211: update ieee80211 header
Signed-off-by: chao an <anchao@xiaomi.com>
2023-01-29 00:34:26 +08:00
Xiang Xiao
c137abf4b0 drivers/wireless: Remove the duplicated bc_bifup check from bcmf_wl_auth_event_handler
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-28 11:31:28 -03:00
Petro Karashchenko
8e72b07a62 nuttx: Add missing FAR and CODE
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-27 13:23:25 +08:00
chentao9
1e8d9466d6 ref: charge: add support for voltage infomation
Signed-off-by: chentao9 <chentao9@xiaomi.com>
2023-01-27 00:40:43 +02:00
丁欣童
63879598fa sensors/fakesensor: fix timestamp is woring when batch.
Signed-off-by: 丁欣童 <dingxintong@xiaomi.com>
2023-01-27 00:39:15 +02:00
梁超众
7b8ef5dc1b usrsock: only TCP data should be aggregrated for rpmsg case
non-streaming socket's rx data should not be aggregrated.

Signed-off-by: 梁超众 <liangchaozhong@xiaomi.com>
2023-01-27 00:38:32 +02:00
Jiuzhu Dong
5bd448825b driver/sensor: sync set buffer number to remote proc
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2023-01-27 00:37:49 +02:00
Jiuzhu Dong
c9c5940382 driver/sensor: using recursive lock to fix deadlock beacuse rptun reentrancy
nxsem_wait
/home/neo/projects/monkey/nuttx/arch/arm/src/../../../sched/semaphore/sem_wait.c:155 (discriminator 2)
sem_wait
/home/neo/projects/monkey/nuttx/arch/arm/src/../../../sched/semaphore/sem_wait.c:273
nxmutex_lock
/home/neo/projects/monkey/nuttx/include/nuttx/mutex.h:161
nxrmutex_lock.isra.0
/home/neo/projects/monkey/nuttx/include/nuttx/mutex.h:348
sensor_rpmsg_unsub_handler
/home/neo/projects/monkey/nuttx/arch/arm/src/../../../drivers/sensors/sensor_rpmsg.c:1048
rpmsg_virtio_rx_callback
/home/neo/projects/monkey/nuttx/arch/arm/src/../../../openamp/open-amp/lib/rpmsg/rpmsg_virtio.c:334
virtqueue_notification
/home/neo/projects/monkey/nuttx/arch/arm/src/../../../openamp/open-amp/lib/virtio/virtqueue.c:623
up_block_task
/home/neo/projects/monkey/nuttx/arch/arm/src/common/arm_blocktask.c:82 (discriminator 2)
nxsem_tickwait
/home/neo/projects/monkey/nuttx/arch/arm/src/../../../sched/semaphore/sem_tickwait.c:116
rptun_wait_tx
/home/neo/projects/monkey/nuttx/arch/arm/src/../../../drivers/rptun/rptun.c:522
rpmsg_virtio_wait_tx_buffer
/home/neo/projects/monkey/nuttx/include/openamp/rpmsg_virtio.h:120
sensor_rpmsg_push_event_one
/home/neo/projects/monkey/nuttx/arch/arm/src/../../../drivers/sensors/sensor_rpmsg.c:778
sensor_rpmsg_alloc_stub
/home/neo/projects/monkey/nuttx/arch/arm/src/../../../drivers/sensors/sensor_rpmsg.c:547
sensor_rpmsg_sub_handler
/home/neo/projects/monkey/nuttx/arch/arm/src/../../../drivers/sensors/sensor_rpmsg.c:991
rpmsg_virtio_rx_callback
/home/neo/projects/monkey/nuttx/arch/arm/src/../../../openamp/open-amp/lib/rpmsg/rpmsg_virtio.c:334

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2023-01-27 00:37:49 +02:00
fangzhenwei
8a1489c291 driver/h4:increase h4 uart tx/rx buffer default size
tx buffer size 1024 to 2048
rx buffer size 1024 to 8096

Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2023-01-27 00:27:02 +02:00
xinbingnan
7076de9e8a sensors/bmi160.c: fix the problem Linux SPI doesn't working properly
CH341A chip only supports SPI MODE0, and BMI160 supports both MODE0 and MODE3. So, changing MODE3 to MODE0 makes all cases available.

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2023-01-27 00:26:13 +02:00
Petro Karashchenko
e3a8e1e3ef drivers/mtd/mtd_config: switch from semaphore to mutex for exclusive access
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-26 10:24:05 +08:00
Petro Karashchenko
6e3cb04531 drivers/sensors/msa301: switch from semaphore to mutex for exclusive access
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-26 10:24:05 +08:00
Petro Karashchenko
f952b8456c assert: switch from ASSERT(0/false) to PANIC
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-26 10:15:34 +08:00
Xiang Xiao
1280a2a8f9 Launch the initial task through task_spawn instead of nxtask_create
to share the code with the code path of posix_spawn

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-25 23:34:52 +02:00
raiden00pl
30015b862c drivers/foc: add ioctl interface that turn off all PWM switches 2023-01-21 12:28:16 +08:00
raiden00pl
91d43edffd drivers/foc: support for BEMF sensing 2023-01-20 21:26:27 +02:00
Masayuki Ishikawa
dc454765fb Revert "add holder for mutex"
This reverts commit fc176addeb.
2023-01-19 06:04:48 +09:00
To Doan Ngoc Hai
6ca75deec8 drivers/can/can.c: Change size_t type printf formatter %d -> %zu 2023-01-18 22:03:17 +08:00
lilei19
fc176addeb add holder for mutex
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-01-18 17:40:58 +08:00
ligd
5b22eba0bd rptun ping: fix warning when open CONFIG_SYSTEM_TIME64
rptun/rptun_ping.c: In function 'rptun_ping':
rptun/rptun_ping.c:171:20: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'time_t' {aka 'long long int'} [-Werror=format=]
  171 |   syslog(LOG_INFO, "avg: s %" PRIu32 ", ns %ld\n", ts.tv_sec, ts.tv_nsec);
      |                    ^~~~~~~~~~                      ~~~~~~~~~
      |                                                      |
      |

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 10:59:59 +08:00
ligd
354abd4e8e uinput: fix uinput compile failed, if no define CONFIG_UINPUT_TOUCH
input/uinput.c:81:28: error: field 'lower' has incomplete type
   81 |   struct touch_lowerhalf_s lower;
      |                            ^~~~~
CC:  pipes/pipe.c

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 10:55:52 +08:00
crafcat7
2ec117b3ca fs/fs_fsync:Fix the expected error of socket,fifo and pipe returning error in fsync case 2023-01-17 01:56:40 +08:00
ligd
23d1d4c42a power: avoid sem_wait called in IRQ handler
error backrace:
_assert  --- assert again
sem_wait
pm_unregister
wdog_notifier
panic_notifier_call_chain
_assert
dataabort

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 01:25:27 +08:00
ligd
38c6f20d17 pm: add pm_domain_lock/unlock support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 01:25:27 +08:00
ligd
d2ef505684 pm: add lock for pm_auto_updatestate_cb()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-01-17 01:25:27 +08:00
Xiang Xiao
a851ad84c3 net: consistent the net sem wait naming conversion
to prepare the new mutex wait function

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-15 12:31:30 -03:00
TimJTi
f5e8c30808 Add ACT8945A power driver
Update act8945a.c

Update Kconfig

Update act8945a.c

Corrections (xiaoxiang781216)
2023-01-14 18:49:25 +08:00
liushuai25
ea67dafd93 Fix scope issues with "switch ... case"
Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
2023-01-14 13:38:37 +08:00
liushuai25
57295d750d Use C89 compatible initializer and modify code format
Signed-off-by: liushuai25 <liushuai25@xiaomi.com>

Update drivers/video/mipidsi/mipi_dsi_device.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-13 23:10:56 +08:00
liushuai25
6b729487fb feat: add mipidsi support
add mipi dsi subsystem support.

reference links:
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_mipi_dsi.c
https://github.com/torvalds/linux/blob/master/include/video/mipi_display.h

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
2023-01-13 23:10:56 +08:00
Jani Paalijarvi
bd461a1016 drivers/eeprom/i2c_xx24xx.c: Fix compiler warnings
Debug prints were not able to handle 64bit off_t and size_t.
2023-01-13 23:08:58 +08:00
Lee Lup Yuen
6de5a862cd drivers/input: Add driver for Goodix GT9XX Touch Panel
This PR adds the driver for Goodix GT9XX I2C Touch Panel, which will be called by PINE64 PinePhone.

Our driver follows the design of the NuttX Driver for [Cypress MBR3108](https://github.com/apache/nuttx/blob/master/drivers/input/cypress_mbr3108.c).

We have documented our driver here: ["NuttX Touch Panel Driver for PinePhone"](https://lupyuen.github.io/articles/touch2#appendix-nuttx-touch-panel-driver-for-pinephone)

`drivers/input/Kconfig`: Added option `INPUT_GT9XX` to select GT9XX Driver

`drivers/input/Make.defs`: Added GT9XX Driver to Makefile

`drivers/input/gt9xx.c`, `gt9xx.h`: I2C Driver for GT9XX Touch Panel
2023-01-13 12:19:53 +08:00
zhanghongyu
48c9d10336 net_socket: add accept4 function
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-01-11 23:28:08 +08:00
xinbingnan
1ce93a7d9a sensors/bmi160.c: fix i2C read and write behavior
There is a problem with the original driver reading and writing behavior, refer to the driver of mpu60x0 to make corresponding changes.

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2023-01-11 21:12:29 +08:00
梁超众
aca1a065a8 move usrsock to kernel space
Signed-off-by: 梁超众 <liangchaozhong@xiaomi.com>
2023-01-11 15:14:03 +08:00
chengkai
f864e5f657 wireless/bluetooth: add interrupt_context hander for netsnoop
Signed-off-by: chengkai <chengkai@xiaomi.com>
2023-01-10 18:08:22 +08:00
田昕
587305723e drivers/pipe:add PIPEIOC_POLLTHRES to set POLLIN/POLLOUT threshold
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2023-01-10 13:33:13 +08:00
Zhe Weng
5e42bd97cd virtio/net: Try fix virtnet logic
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-01-09 10:10:49 +09:00
anjiahao
96ec6983db watchdog:use 'V' to stop watchdog
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-06 20:02:26 +08:00
yinshengkai
6064aa8bb5 drivers/note: remove choice in Kconfig
To support multiple note drivers to be used at the same time

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-06 16:23:00 +08:00
yinshengkai
2e4c4822eb segger/sysview: add up_perf_freq result chaeck
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-06 15:06:15 +08:00
Sebastien Lorquet
af6c990498 add support for more is25 mtd devices 2023-01-06 11:52:37 +08:00
anjiahao
5e878186c7 watchdog:add a callback when painc stop the watchdog
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-06 10:42:37 +08:00
Xiang Xiao
1a59f4ed00 mm/map: Remove the unnessary map.h inclusion in various drivers
and Fix include/nuttx/mm/map.h:55:28: error: 'struct task_group_s' declared inside parameter list will not be visible outside of this definition or declaration

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-05 16:06:53 +02:00
yinshengkai
8f823ce320 sergger: add note_ prefix to sysview
change 1: rename sysview.c to note_sysview.c
change 2: add note_ prefix to sysview's public function

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-05 22:04:52 +08:00
yinshengkai
77466742c7 drivers/segger: register sysview to note drivers list
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-05 22:04:52 +08:00
yinshengkai
4ba7624804 Revert "Sysview add prefix kconfig to add an option to decouple sched_note calls"
This reverts commit f72f7ebee0.
2023-01-05 22:04:52 +08:00
yinshengkai
e9ed994fec syslog: merge multiple lib_sprintf into one
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-05 02:00:43 +08:00
yinshengkai
74b8776872 syslog: put variable initialization in the front
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-05 02:00:43 +08:00
yinshengkai
72b19200b5 syslog: replace the switch statement with an array of strings
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-05 02:00:43 +08:00
Xiang Xiao
7179d57026 fs: Check offset and length more carefully in mmap callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Xiang Xiao
b0a0ba3ad7 fs: Move mmap callback before truncate in [file|mountpt]_operations
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Xiang Xiao
779a610ca3 Remove the unnecessary NULL fields in global instance definition of file_operations
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:32:13 +02:00
Xiang Xiao
1815f8b731 drivers/note: Add const to g_notelog_ops
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:21:18 +02:00
Xiang Xiao
98ab55ef68 drivers/note: Replace the scritical section with spin_xxx_wo_note
to avoid to generate the unexpected schedule information

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:21:18 +02:00
zouboan
56c6943311 sensors/mpu60x0: fix build warning about data type 2023-01-03 01:45:56 +08:00
yinshengkai
1cee890aa7 drivers/note: unify the spinlock operation in noteram
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-02 22:29:01 +08:00
Jukka Laitinen
f33dc4df3f Change FIOC_MMAP into file operation call
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Jukka Laitinen
41e9df2f3e Add ftruncate into file operation calls
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
yinshengkai
275b2e70a4 syslog: fix extra line breaks in syslog when SYSLOG_COLOR_OUTPUT is enabled
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-02 21:22:46 +08:00
Xiang Xiao
cc9166274a drivers/note: Fix the mismatch of va_end call
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-31 14:57:47 +02:00
yinshengkai
f85102d81b drivers/note: adjust note kconfig order
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-30 15:50:30 -03:00
yinshengkai
ca5fcc58c2 sched: move SCHED_INSTRUMENTATION_xxx to note Kconfig
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-30 15:50:30 -03:00
yinshengkai
64b6df42a4 drivers/note: register notelog device
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-30 22:21:12 +08:00
yinshengkai
376e30193b drivers/note: remove sched_note_syscall_xxx in notelog
syslog is a system call, which will cause recursion after turning on SCHED_INSTRUMENTATION_SYSCALL

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-30 22:21:12 +08:00
yinshengkai
bc7c520eca drivers/note: add note_syscall_enter parameter list
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-29 09:25:54 -03:00
yinshengkai
dd32eccfc3 drivers/note: Move taskname related functions to note_driver.c
so all note drivers can retrieve the task name even after the task exit

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-26 15:03:57 +08:00
Xiang Xiao
7322eafba7 drivers/usb: Fix the typo error in Kconfig
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-25 01:01:26 +02:00
Xiang Xiao
02e92d2ba5 Fix ower/pm/pm_procfs.c:46:15: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'time_t' {aka 'long long int'}
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-24 11:26:48 -03:00
wangbowen6
069fac1c67 power/relay: add relay driver framework for NuttX
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-12-22 20:30:49 +08:00
TimJTi
5f7bf743c5 Add LP503x RGB LED driver
style corrections

Update lp503x.h

Update lp503x.h

Update lp503x.c

Update lp503x.h

post review changes
2022-12-22 13:39:05 +08:00
Petro Karashchenko
b107e4f417 nuttx: unify MIN, MAX and ABS macro definition across the code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-12-21 09:31:28 +08:00
pengyiqiang
72fdea5c13 video/fb: initializes the info structure
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-12-21 01:16:55 +02:00
zhanghongyu
ba9ef06970 tun: add ioctl cmd TUNGETIFF implement
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-12-20 21:15:50 +08:00
Peter Bee
2b11fd585f drivers/video: fix typo
Wrong buf used

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-20 17:00:44 +08:00
jihandong
8e6185f4ad driver/fb: support linux info.
add struct fix_screeninfo and var_screeninfo, and related ioctl,
macro.

Signed-off-by: jihandong <jihandong@xiaomi.com>
2022-12-20 15:54:00 +08:00
Xiang Xiao
243983328a drivers/video: Correct the code style
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
21e35362a3 drivers/video: Add stop_capture function
and ensure imgsensor_ops_s::stop_capture get called

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
eb4dabaac6 drivers/video: Check th size for IMGSENSOR_CTRL_TYPE_U[8|16|32]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
4773eec916 drivers/video: Move the clip operation from video_s_selection to validate_frame_setting
to ensure the validation is same for VIDIOC_S_SELECTION, VIDIOC_S_PARM and VIDIOC_S_FMT

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
10d79195ba drivers/video: Replace malloc/realloc/free with kmm_[malloc/realloc/free]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
ec1cbed9b0 drivers/video: Zero all fields in an output struct
and don't zero fields which is used as input

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
5eb8189c26 drivers/video: Remove validate_frame_setting NULL check from video_[s|try]_fmt
since the check is already done in validate_frame_setting

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
yinshengkai
6f66c0ea0b drivers/note: sched_note support mulit-channel
call callbacks for different channels in sched_note_*
noteram channel is enabled by default

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-17 19:41:21 +08:00
Xiang Xiao
9cc608e4c4 drivers/serial: Don't call uart_shutdown if the serial work as a console
since uart_setup is skip at line 556 for the console device

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 01:04:15 +02:00
Xiang Xiao
d5689e070b net/arp: Remove nuttx/net/arp.h
1.move ARPHRD_ETHER to netinet/arp.h
1.move arp_entry_s to net/arp/arp.h
2.move arp_input to nuttx/net/netdev.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-16 22:10:59 +02:00
Xiang Xiao
06842c824a sched/note: Change sched_note_[begin|end] to macro
improve the speed

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-16 12:20:53 +02:00
yinshengkai
552cf4b549 merge sched_note_spinxx into sched_note_spincommon
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-16 17:03:53 +08:00
chao an
01eb4d586b mm/iob: iob members are initialized after allocate
Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-16 09:51:53 +08:00
yinshengkai
2460ff4f78 drivers/note: rename /dev/note to /dev/note/ram
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-15 15:53:49 +08:00
Xiang Xiao
03f07effc9 drivers/note: Fix the style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-14 21:24:13 +02:00
Xiang Xiao
c36640e205 drivers/segger: Rename nuttx/note/note_sysview.h to nuttx/segger/sysview.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-14 21:24:13 +02:00
Xiang Xiao
126c93015f drivers/node: Rename sched_note.c to to note_driver.c
prepare to support the multiple note driver

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-14 21:24:13 +02:00
Xiang Xiao
d7307ef26c drivers/node: Rename note_register to note_initialize
prepare to support the multiple note driver

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-14 21:24:13 +02:00
Xiang Xiao
1555c9b8f8 drivers/video: Zero next field of dequeued buffer before return dequeue_vbuf_unsafe
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
Xiang Xiao
e15bccaa71 drivers/video: Don't need update vbuf_tail in dequeue_vbuf_unsafe
since it is already done in video_framebuff_queue_container

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
Xiang Xiao
01d7f44480 drivers/video: Merge vbuf_next assignment in video_framebuff_queue_container
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
Xiang Xiao
d09f1fb186 drivers/video: Keep the old state in case of fail
and ensure the internal state get clear if sz equals zero

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
Xiang Xiao
ae3cadf03c drivers/video: Skip all action if video_framebuff_realloc_container doesn't change the container size
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
Xiang Xiao
aa20b1e8bd drivers/video: Zero all video_framebuff_t fields in video_framebuff_init
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
chao an
cda8b79950 virtio/net: reschedule interrupt work If rx data remaining
Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-12 16:56:11 +09:00
yinshengkai
026c8eede0 drivers/note: unify spinlock related functions
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-10 02:30:24 +08:00
Peter Bee
77504aa1b5 drivers/video: minor fix
Fix missing header for bool in imgsensor.h and FAR in video.c

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-09 23:37:49 +08:00
yinshengkai
09814831b8 sched: move sched_note.c to drivers/note
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-09 23:36:11 +08:00
Peter van der Perk
f72f7ebee0 Sysview add prefix kconfig to add an option to decouple sched_note calls 2022-12-08 17:49:55 +01:00
zhangyuan21
d2c52db68e usb/ft232r: fixed build issue
1. fixed build issue;
2. make sure the read data length must greater than or equal to 2;

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2022-12-08 22:49:26 +08:00
zhangyuan21
5dc4e23bb7 usbdev/adb: fixed usbclass steup issue
1. set usbdev when usb class bind
2. don't call EP_SUBMIT when receive OUT message

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2022-12-07 12:24:09 +08:00
sunkun3
d9acaeaccf usbdev:resolve ADB compilation errors
Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2022-12-07 12:24:09 +08:00
zhangyuan21
9150ea0e95 arch_alarm: don't init local variable for fpu test case fail
D16 register will be cleared when compiling with gcc on some boards.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2022-12-07 12:21:16 +08:00
Peter Bee
31347da187 drivers/video: add support for V4L2 mmap-ed buffer
Support V4L2_MEMORY_MMAP memory mode

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-07 01:21:46 +08:00
Xiang Xiao
b526e06de1 drivers/lcd: Reuse lib_meminstream_s as much as possible
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 14:27:55 +01:00
Xiang Xiao
055f1f33eb libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc)
to make the naming style consistent with each other

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 14:27:55 +01:00
Xiang Xiao
4be9ec774b Don't download tarballs if a local git repo found
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:47:36 +01:00
Xiang Xiao
f142cf0e55 drivers/video: Remove memset from cleanup_streamresources
since initialize_streamresources will do it

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Xiang Xiao
99311ed6a5 drivers/video: Should do uninitialization if is_initialized is true
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Xiang Xiao
92e72f8624 drivers/video: Return zero if gamma curve isn't supported in initialize_scene_gamma
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Xiang Xiao
c8868b3745 drivers/video: Return 0 in case g_video_sensor_ops or get_supported_value is NULL
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Xiang Xiao
c6e9edcbb6 net: Rename arp_arpin to arp_input
align with other similar function(e.g. ipv4_input and ipv6_input)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-04 20:39:21 +08:00
chao an
34d2cde8a8 net/l2/l3/l4: add support of iob offload
1. Add new config CONFIG_NET_LL_GUARDSIZE to isolation of l2 stack,
   which will benefit l3(IP) layer for multi-MAC(l2) implementation,
   especially in some NICs such as celluler net driver.

new configuration options: CONFIG_NET_LL_GUARDSIZE

CONFIG_NET_LL_GUARDSIZE will reserved l2 buffer header size of
network buffer to isolate the L2/L3 (MAC/IP) data on network layer,
which will be beneficial to L3 network layer protocol transparent
transmission and forwarding

------------------------------------------------------------
Layout of frist iob entry:

        iob_data (aligned by CONFIG_IOB_ALIGNMENT)
            |
            |                  io_offset(CONFIG_NET_LL_GUARDSIZE)
            |                                |
            -------------------------------------------------
      iob   |            Reserved            |    io_len    |
            -------------------------------------------------

-------------------------------------------------------------
Layout of different NICs implementation:

        iob_data (aligned by CONFIG_IOB_ALIGNMENT)
            |
            |                 io_offset(CONFIG_NET_LL_GUARDSIZE)
            |                                |
            -------------------------------------------------
 Ethernet   |       Reserved    | ETH_HDRLEN |    io_len    |
            ---------------------------------|---------------
 8021Q      |   Reserved  | ETH_8021Q_HDRLEN |    io_len    |
            ---------------------------------|---------------
 ipforward  |            Reserved            |    io_len    |
            -------------------------------------------------

--------------------------------------------------------------------

2. Support iob offload to l2 driver to avoid unnecessary memory copy

Support send/receive iob vectors directly between the NICs and l3/l4
stack to avoid unnecessary memory copies, especially on hardware that
supports Scatter/gather, which can greatly improve performance.

new interface to support iob offload:

  ------------------------------------------
  |    IOB version     |     original      |
  |----------------------------------------|
  |  devif_iob_poll()  |   devif_poll()    |
  |       ...          |       ...         |
  ------------------------------------------

--------------------------------------------------------------------

1> NIC hardware support Scatter/gather transfer

TX:

                tcp_poll()/udp_poll()/pkt_poll()/...(l3|l4)
                           /              \
                          /                \
devif_poll_[l3|l4]_connections()     devif_iob_send() (nocopy:udp/icmp/...)
           /                                   \      (copy:tcp)
          /                                     \
  devif_iob_poll("NIC"_txpoll)                callback() // "NIC"_txpoll
                                                  |
                            dev->d_iob:           |
                                                ---------------         ---------------
                             io_data       iob1 |  |          |    iob3 |  |          |
                                    \           ---------------         ---------------
                                  ---------------  |       --------------- |
                             iob0 |  |          |  |  iob2 |  |          | |
                                  ---------------  |       --------------- |
                                     \             |          /           /
                                        \          |       /           /
                                   ----------------------------------------------
                    NICs io vector |    |    |    |    |    |    |    |    |    |
                                   ----------------------------------------------

RX:

  [tcp|udp|icmp|...]ipv[4|6]_data_handler()(iob_concat/append to readahead)
                    |
                    |
      [tcp|udp|icmp|...]_ipv[4|6]_in()/...
                    |
                    |
          pkt/ipv[4/6]_input()/...
                    |
                    |
     NICs io vector receive(iov_base to each iobs)

--------------------------------------------------------------------

2> CONFIG_IOB_BUFSIZE is greater than MTU:

TX:

"(CONFIG_IOB_BUFSIZE) > (MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE + CONFIG_NET_LL_GUARDSIZE)"

                tcp_poll()/udp_poll()/pkt_poll()/...(l3|l4)
                           /              \
                          /                \
devif_poll_[l3|l4]_connections()     devif_iob_send() (nocopy:udp/icmp/...)
           /                                   \      (copy:tcp)
          /                                     \
  devif_iob_poll("NIC"_txpoll)                callback() // "NIC"_txpoll
                                                  |
                                             "NIC"_send()
                          (dev->d_iob->io_data[CONFIG_NET_LL_GUARDSIZE - NET_LL_HDRLEN(dev)])

RX:

  [tcp|udp|icmp|...]ipv[4|6]_data_handler()(iob_concat/append to readahead)
                    |
                    |
      [tcp|udp|icmp|...]_ipv[4|6]_in()/...
                    |
                    |
          pkt/ipv[4/6]_input()/...
                    |
                    |
     NICs io vector receive(iov_base to io_data)

--------------------------------------------------------------------

3> Compatible with all old flat buffer NICs

TX:
                tcp_poll()/udp_poll()/pkt_poll()/...(l3|l4)
                           /              \
                          /                \
devif_poll_[l3|l4]_connections()     devif_iob_send() (nocopy:udp/icmp/...)
           /                                   \      (copy:tcp)
          /                                     \
  devif_iob_poll(devif_poll_callback())  devif_poll_callback() /* new interface, gather iobs to flat buffer */
       /                                           \
      /                                             \
 devif_poll("NIC"_txpoll)                     "NIC"_send()(dev->d_buf)

RX:

  [tcp|udp|icmp|...]ipv[4|6]_data_handler()(iob_concat/append to readahead)
                    |
                    |
      [tcp|udp|icmp|...]_ipv[4|6]_in()/...
                    |
                    |
               netdev_input()  /* new interface, Scatter/gather flat/iob buffer */
                    |
                    |
          pkt/ipv[4|6]_input()/...
                    |
                    |
    NICs io vector receive(Orignal flat buffer)

3. Iperf passthrough on NuttX simulator:

  -------------------------------------------------
  |  Protocol      | Server | Client |            |
  |-----------------------------------------------|
  |  TCP           |  813   |   834  |  Mbits/sec |
  |  TCP(Offload)  | 1720   |  1100  |  Mbits/sec |
  |  UDP           |   22   |   757  |  Mbits/sec |
  |  UDP(Offload)  |   25   |  1250  |  Mbits/sec |
  -------------------------------------------------

Signed-off-by: chao an <anchao@xiaomi.com>
2022-12-03 11:47:04 +08:00
Peter Bee
c26fd6565d drivers/video: enhance v4l2 compatibility
Add common BSD v4l2 header file
Complete ioctls according to standard v4l2 drivers

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-03 02:48:01 +08:00
Peter Bee
87e16c3694 drivers/video: add support for yuv420p
Add calc functions for buffer size (yuv420p is 6Byte/4px)

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-02 13:18:20 +08:00
Peter Bee
365b1f4bb8 drivers/video: add support for YUYV format
Add YUYV format which is used by most USB Cameras

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-02 13:18:20 +08:00
wangbowen6
84fa994f51 rpmsgdev: rpmsgdegv ioctl and seek buf fix
1. rpmsgdev ioctl: should assgin back the client return value to
   cookie->result, then this return value can be returned to the
   application;
2. rpmsgdev seek: the type "off_t" may be 64bit, so modify the offset
   in "struct rpmsgdev_lseek" to int64_t too;
3. rpmsgdev_seek: the rpmsgdev_seek in client should update the
   filep->f_pos after the seek operation;

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-12-02 12:05:53 +08:00
FASTSHIFT
0ae242aa8d drivers/video/fb: add poll support
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-12-01 15:08:03 +08:00
pengyiqiang
c4535ee66a drivers/input/touchscreen_upper: add missing function code comments
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-12-01 10:26:11 +08:00
chao an
0de9e387a7 net/loopback: reuse devif_loopback() logic for device lo(loopback)
TX poll callback in device lo(loopback) can be replaced by devif_loopback()
from devif_poll() hook, remove duplicate code to reuse this logic

Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-30 10:07:14 +08:00
Masayuki Ishikawa
8b4ffb8d3e virtio: Add virtio drivers
Summary:
- This commit adds virtio-mmio and virtio-net drivers

Impact:
- None (new drivers)

Testing:
- Tested with rv-virt (will be updated later) with QEMU-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-11-29 13:16:44 +08:00
田昕
1d8d6e5ed2 drivers/syslog:support stream as syslog backend.
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-11-28 20:19:00 +08:00
yinshengkai
699e3e8291 let segger RTT kconfig sink one level
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-28 15:22:58 +08:00
Xiang Xiao
af2b491420 driver/segger: Move SYSLOG_RTT config from drivers/syslog to drivers/segger
and remove include/nuttx/syslog/syslog_rtt.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 23:10:39 +01:00
Xiang Xiao
fd268d7123 drivers/segger: Add STREAM_RTT option
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 23:10:39 +01:00
Xiang Xiao
ac365ab7e9 drivers/segger: Refine Kconfig option
1.Add SEGGER_SYSVIEW_RTT_CHANNEL option
2.SEGGER_RTT_BUFFER_SIZE_UP always default to 1KB
3.SEGGER_SYSVIEW_RTT_BUFFER_SIZE default to SEGGER_RTT_BUFFER_SIZE_UP

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 23:10:39 +01:00
Xiang Xiao
6d30726a1b Remove the unnecessary "return;" at the end of function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 22:23:50 +01:00
yinshengkai
126b33c488 drivers/segger: add Segger RTT stream support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-27 23:39:20 +08:00
chao an
6fa60627eb net/devif/ip: build l2 header on the IP layer
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-27 12:13:45 +08:00
chao an
8850dee746 net/devif: move preprocess of txpoll into common code
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-27 12:11:12 +08:00
TimJTi
4075509579 4 byte read mode bit position
GG25Q devices have the 4 byte read mode in bit 0 not bit 3 of the status register. This changes allows for both depending on the JEDEC DEVICE ID that is read back.
2022-11-25 10:11:11 -03:00
Xiang Xiao
5fd1379d3f syslog: Move syslog stream to libc like other stream implementation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-25 01:46:31 +08:00
Karel Kočí
221b098846 drivers/lcd/st7789: fix invalid displayed color
The write has to be in number of bytes per pixel as single SPI exchange
is used to identify single pixel write by the ST7789 driver. By issuing
only byte writes the displayed color is corrupted as it is stripped.

This fix consist of setting SPI to correct number of exchanged bytes and
then passing correctly number of words to the SPI exchange.

This also covers usage of st7789_wrram in st7789_putrun as that one was
passing just number of pixels as size but the correct is now number of
bytes.
2022-11-21 14:43:12 -03:00
Robert-Ionut Alexa
039262484a drivers/sensors: add LTR308 ambient light sensor
Add support for the LTR308 ambient light sensor through I2C. Currently,
the interrupt-driven mode of operation is not supported.

Signed-off-by: Robert-Ionut Alexa <robertalexa2000@gmail.com>
2022-11-21 23:48:52 +08:00
Xiang Xiao
a34230c954 Fix Error: chip/stm32_qencoder.c:989:46: error: format specifies type 'unsigned long' but the argument has type 'uint32_t' (aka 'unsigned int')
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-21 17:39:04 +08:00
Xiang Xiao
7bda8747b2 Fix Error: audio/wm8994.c:485:26: error: result of comparison of constant 65536 with expression of type 'uint16_t' (aka 'unsigned short') is always false
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-21 17:39:04 +08:00
Xu Xingliang
d1be53e748 drivers/segger: make RTT_MODE configurable
CHAMPION-2373

To allow use NO_BLOCK mode, so the system keeps running when debugger disconnected.

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2022-11-21 17:19:09 +08:00
chao an
dff81756cf drivers/regulator_rpmsg: destroy nxsem properly
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-21 01:15:48 +08:00
chao an
07604b3220 drivers/rpmsg/clk/ioe: destroy nxsem properly
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-21 01:15:48 +08:00
chao an
74cfa7ddb9 drivers/misc/rwbuffer: destroy nxmutex/nxsem properly
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-21 01:15:48 +08:00
chao an
a1abb818a9 drivers/misc/rpmsgdev: destroy nxmutex properly 2022-11-21 01:15:48 +08:00
chao an
40581558d3 drivers/loop: destroy nxmutex properly 2022-11-21 01:15:48 +08:00
chao an
d256b8334e drivers/mtd: destroy nxmutex properly 2022-11-21 01:15:48 +08:00
Xiang Xiao
3453fe799d Fix video/max7456.c:775:19: error: unused function '__mx7_write_reg__dmm'
video/max7456.c:792:19: error: unused function '__mx7_write_reg__dmdi'
video/max7456.c:809:19: error: unused function '__mx7_write_reg__dmah'
video/max7456.c:826:19: error: unused function '__mx7_write_reg__dmal'

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-20 14:34:44 +01:00
Xiang Xiao
a4eeeb23de Fix sensors/mpu60x0.c:650:23: error: unused function '__mpu_read_who_am_i'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-20 14:34:44 +01:00
Xiang Xiao
d8e53d7b4f Fix error: format specifies type 'unsigned long' but the argument has type 'unsigned int'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-20 14:34:44 +01:00
Xiang Xiao
416d7301c4 Fix wireless/ieee80211/bcm43xxx/bcmf_gspi.c:151:20: error: unused function 'bcmf_gspi_write_reg_32'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-20 14:34:44 +01:00