Commit Graph

6610 Commits

Author SHA1 Message Date
yangsong8 e00fbc5557 syslog: enable LF to CRLF config as default
This commit fixes the issue #14418

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-10-21 10:50:36 +02:00
Xiang Xiao 8c882cb790 ramlog: Remove RAMLOG_CRLF config and related code
since the conversion is moved to common layer after:
https://github.com/apache/nuttx/pull/14362

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-21 16:27:35 +08:00
yezhonghui 317d7a7f59 Fix make warn as error in pci drivers
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2024-10-21 15:35:39 +08:00
wanggang26 adc52bf968 syslog: fix ramlog not work issue with cmake
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-19 12:37:07 +02:00
chao an 68d6b18f9a drivers/misc/devmem: add dev_mem.c into cmake build
Signed-off-by: chao an <anchao@lixiang.com>
2024-10-18 21:32:48 +08:00
chao an 11af0e476f drivers/misc/devmem: remove unnecessary register parser
Signed-off-by: chao an <anchao@lixiang.com>
2024-10-18 21:32:48 +08:00
zhangshoukui a7f7afe019 bmi160: fix Parameter passing error when use spi
nuttx/drivers/sensors/bmi160_uorb.c:596:18: warning: passing argument 1 of ‘bmi160_getreg8’ from incompatible pointer type [-Wincompatible-pointer-types]
  596 |   bmi160_getreg8(priv, 0x7f);
      |                  ^~~~
      |                  |
      |                  struct bmi160_dev_uorb_s *
In file included from nuttx/drivers/sensors/bmi160_uorb.c:25:
nuttx/drivers/sensors/bmi160_base.h:235:49: note: expected ‘struct bmi160_dev_s *’ but argument is of type ‘struct bmi160_dev_uorb_s *’
  235 | uint8_t bmi160_getreg8(FAR struct bmi160_dev_s *priv, uint8_t regaddr);
      |                            ~~~~~~~~~~~~~~~~~~~~~^~~~
nuttx/drivers/sensors/bmi160_uorb.c:597:18: warning: passing argument 1 of ‘bmi160_getreg8’ from incompatible pointer type [-Wincompatible-pointer-types]
  597 |   bmi160_getreg8(priv, 0x7f); /* workaround: fail to switch SPI, run twice */
      |                  ^~~~
      |                  |
      |                  struct bmi160_dev_uorb_s *

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-10-18 19:58:22 +08:00
zhangshoukui 50f16c840c bmi160: fix compile warning and %zu replace %u
VELAPLATFO-45270

nuttx/drivers/sensors/bmi160.c: In function ‘bmi160_set_normal_imu’:
nuttx/drivers/sensors/bmi160.c:79:3: warning: implicit declaration of function ‘up_mdelay’ [-Wimplicit-function-declaration]
   79 |   up_mdelay(30);
      |   ^~~~~~~~~

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-10-18 19:58:22 +08:00
lipengfei28 e259aba31c fix build error shift-count-overflow
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-18 17:23:41 +08:00
Xiang Xiao 24cb8c25ab bluetooth: Fix the incompatibility made by https://github.com/apache/nuttx/pull/14224
that pr requires chip turn on CONFIG_DRIVERS_BLUETOOTH to use bluetooth,
but not all defconig enable this option, so let's map bt_driver_register
to bt_netdev_register in header file in this case, and revert the unnessary
change in the related chip and board folders.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-18 09:05:54 +08:00
jihandong d802912cba nuttx ai driver update
Signed-off-by: jihandong <jihandong@xiaomi.com>
2024-10-17 22:35:40 +08:00
chengkai 6aeb2e2996 Add space before error, bt_driver_register_internal not trigger error, add defconfig DRIVERS_BLUETOOTH.
Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
fangzhenwei d97b715e5c drivers: append bt_driver.c to bluetooth drivers Cmakelist.
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2024-10-17 18:09:32 +08:00
fangzhenwei 7a97eef679 serial: use dev references count make sure the driver only opened once
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2024-10-17 18:09:32 +08:00
duqunbo dfbeba3536 filter redundant hci reset commands due to dual Bluetooth protocol stacks
Signed-off-by: duqunbo <duqunbo@xiaomi.com>
2024-10-17 18:09:32 +08:00
wangzhi7 8b68f9d816 [bt_uart.c] fix bug:cant receive data
rootcause: in btuart_rxwork, read data in blocking mode and btuart_read do three times, maybe remote send some packets one time,so it wont read the sencond packets.

Signed-off-by: wangzhi7 <wangzhi7@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 772807c50f bluetooth: add bt_driver_register interface
add bt_driver_register interface, which could handle
these cases:bth4 bth5 btbridge btslip and btuart_lowerhalf_s etc.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 3144971704 bluetooth: extract btuart_register interface
add btuart_create interface, which would be more
flexible in complex cases. And extract btuart_register interface.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai cae60fb4a0 bluetooth: increase HCI RX buffer size.
BLUETOOTH_MAX_FRAMELEN  buffer size is only for LE only mode.
then we need to increase HCI buffer size in BR/EDR and LE mode.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai aeb3051aba bluetooth: fix bt_slip_send would always block
rootcause: semcount maybe zero when nxsem_wait_uninterruptible

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 00eb8f6461 bluetooth: remove noblock mode handle
rootcause: move block and noblock handle to BTH4 handle.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 3fb63c20d4 bluetooth: fix packet pointer may refer to null
rootcasue: when packet is null, packet var in for loop would
refer to null memory.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
cuiziwei a55d62f477 gnu++20:fix build warning to [-Wmaybe-uninitialized].
17:10:41  wireless/bluetooth/bt_slip.c:300:7: error: 'byte' may be used uninitialized [-Werror=maybe-uninitialized]
17:10:41    300 |       wlerr("err: invalid escape byte %x\n", *byte);
17:10:41        |       ^
17:10:41  wireless/bluetooth/bt_slip.c: In function 'bt_slip_receive':
17:10:41  wireless/bluetooth/bt_slip.c:766:11: note: 'byte' was declared here
17:10:41    766 |   uint8_t byte;
17:10:41        |           ^~~~

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 65fdc5548e bluetooth: add slip SLIP_ESC case break
H5 SLIP_ESC magic payload whould be encode with
SLIP_ESC and SLIP_ESC_ESC

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai af843eb798 bluetooth: check work_available with retxworker
retxworker would delay when there are many tx hci data

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 946dad5ff0 bluetooth: add nxmutex_lock check
Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai fee8b443dd bluetooth:add btslip checksum log for debug
add send btslip checksum log for debug

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai cc36c44824 bluetooth:add btslip driver
add btslip driver.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 67d51bdf4c bluetooth:add bth5 with btslip and bth4
add bth5 with btslip and bth4, which will be more flexible in
btbridge or rpmsghci cases.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai 8e17e1657b bluetooth: fix bt bridge would not filter vendor hci cmd
when downloading rtk firmware with vendor hci cmd sending to
bt bridge, which would not filter that hci cmd.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai f0b7f48adf bluetooth:fix h5 ack to controller timeout
h5 ack which send to controller always timeout, which causing
controller would send repend hci data until host send back h5 ack.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai c55fcb59b8 bluetooth:fix bt bridge acl data connect handle not match
bt bridge filter would not match when ACL in data
head with Packet_Boundary_Flag 0b10. in that case connect handle
is the first 3 octets of the packet, which not match
BT_HCI_EVT_LE_CONN_COMPLETE hci event alloc handle.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai a9db2f12de wireless/bluetooth: fix ioctl no match driver param
Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai ab991be178 serial/uart/h5: fix hci cmd error when splitting type and value
Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
yangsong8 8c13b8df1d syslog: convert \n to \r\n in syslog framework layer
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-10-17 02:29:51 +08:00
gaohedong cfc90ad1f3 nuttx/can: support to Send message priority sorting function.
Linked list-based priority sorting function for sending messages.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2024-10-16 18:37:01 +08:00
yezhonghui 72e7935431 Fix disable msi when msi capability not exist issue
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2024-10-16 17:12:34 +08:00
zhaohaiyang1 9985b0551e nuttx/can.h: support timestamp for can frame
and update "can.rst" file for add struct timeval ch_ts info.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-10-16 17:04:31 +08:00
wanggang26 23c39f9dab mmcsd: add multi partitions support
include boot0,boot1,gp1,gp2,gp3,gp4,rpmb

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-16 16:58:37 +08:00
renzhiyuan1 91ce3de250 AI engine driver
Add AI engine driver for heterogeneous NPU backends.

Signed-off-by: renzhiyuan1 <renzhiyuan1@xiaomi.com>
2024-10-16 13:57:23 +08:00
Peter Bee c3506448c2 drivers/serial: fix cmsdk serial driver warning
serial/serial_cmsdk.c: In function 'uart_cmsdk_ioctl':
serial/serial_cmsdk.c:544:10: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
  544 |   return ret;
      |          ^~~

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2024-10-16 08:05:01 +08:00
zhanghu5 32717ae353 sdio_probe: set voltage use CMD5
reference doc: https://www.infineon.com/dgdl/Infineon-SDIO_platform_support_guide-UserManual-v01_00-EN.pdf?fileId=8ac78c8c8c3de074018c8ba3a9973619

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2024-10-15 21:04:28 +08:00
yangsong8 0beceeb745 usb: Fix issue with the calculation descriptor length error
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-10-15 21:00:29 +08:00
dongjiuzhu1 74c9b6f544 drivers/rpmsgdev: support get more battery info by rpmsgdev
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-14 18:08:14 -03:00
wanggang26 9ee4566b4d mmcsd:add reset card to idle state (CMD0) support
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 03:15:24 +08:00
chenrun1 b613863bad fs:replase all asprintf / strdup in fs with fs_heap_xxx
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-10-15 01:16:48 +08:00
wanggang26 243148241a mmcsd:add STATUS_SEND (CMD13) support
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 01:09:16 +08:00
xuxingliang cef56fbdb6 drivers/segger: inline note_sysview_get_timestamp
Avoid another layer of function call to get time.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-14 17:03:57 +02:00
xuxingliang d655569a7c cmake: add newly added sources to cmake
These newly added files are missing from cmake.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-14 17:19:45 +08:00
wangjianyu3 223088d847 misc/rpmsgdev: The private data should be freed only when endpoint is released
A use-after-free problem occurs when there are multiple remotes in the list `g_rpmsg` and the matching remote is not the last item in the list.

Log
  # Export the device "/dev/LOCAL_DEV" to remote "REMOTE_CPU"
  ap> testdev -d 2 -c "REMOTE_CPU" -l "/dev/LOCAL_DEV"
  [ap] kasan_report: kasan detected a read access error, address at 0x3c3d4740,size is 4, return address: 0x2c33620f
  [ap] kasan_show_memory: Shadow bytes around the buggy address:
  [ap] kasan_show_memory:   0x3c3d46f0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4700: aa aa aa aa cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4710: 40 47 3d 3c ed 61 33 2c 00 00 00 00 00 00 00 00
  [ap] kasan_show_memory:   0x3c3d4720: 00 00 00 00 00 00 00 00 00 00 00 00 cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4730: 55 55 55 55 38 00 00 00 02 2c 00 00 cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4740:[00 00 00 00]66 e0 42 3c cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4750: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4760: aa aa aa aa 38 00 00 00 01 2c 00 00 cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4770: 50 57 44 3d 2f 00 cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4780: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] dump_assert_info: Current Version: NuttX ****** ***** *** 12.3.0 **********-***** *** ** 2024 **:**:** arm
  [ap] dump_assert_info: Assertion failed panic: at file: kasan/hook.c:187 task: testdev process: testdev 0x2ca20495

  $ addr2line -fe nuttx/nuttx 0x2c33620f
  rpmsgdev_server_created
  /workspace/nuttx/drivers/misc/rpmsgdev_server.c:529
  # Line 529 => strcmp()

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-13 14:42:30 +08:00