Commit Graph

6312 Commits

Author SHA1 Message Date
Bowen Wang
d27a9c516f rpmsg/Kconfig: move RPMSG_PORT outside RPMSG and select RPMSG direclty
All the RPMSG transport should direcly select the RPMSG like RPMSG_VIRTIO
does.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
f7939a8081 rpmsg_port_spi: add spi transport layer
Add Rpmsg-Port-SPI transport layer.
Rpmsg Port SPI is a new rpmsg transport layer based on the Rpmsg Port,
it provides the capability for two SPI-connected (and two extra GPIO)
chips to communicate with each other using Rpmsg.

All already implemented Rpmsg Services can be used with this new transport
layer without any modifications.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
dd66a6b203 rpmsg_port:reduce len and avail of rpmsg_port_header_s to uint16_t
uint16_t is enough and more suitable

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
3d6abb1d86 rpmsg_port:add rpmsg_port_queue_nused api
Add nused api for lower layer to get the used buffer number

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
liaoao
6d604ec487 rpmsg: add physical transport layer support
Rpmsg Physical Transport Layer is a new rpmsg transport, it's a
common part for the physical communication based rpmsg transport
layers such as Rpmsg-SPI and Rpmsg-Uart.

It implements three common parts:
1. Implement the NuttX and OpenAMP rpmsg frameworks' ops and the
rpmsg name service;
2. The buffer management and provide some APIs to lower layer to use;

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-17 01:55:51 +08:00
p-szafonimateusz
1e212981b9 drivers/net: add support for Intel I225 network card
add support for Intel I225 network card

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-17 01:42:38 +08:00
p-szafonimateusz
bc0c7b0db3 drivers/net: add Intel e1000 network card support
add Intel e1000 network card support

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-17 01:42:38 +08:00
p-szafonimateusz
8723aa7125 drivers: fix gcc14 errors for virtio
fix gcc14 errors for virtio

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-16 11:25:40 -03:00
dongjiuzhu1
a9bc198bc3 composite.c warning
usbdev/composite.c:649:36: warning: implicit declaration of function 'board_usbdev_pid' [-Wimplicit-function-declaration]
649 | uint16_t pid = board_usbdev_pid(); usbdev/composite.c:650:36: warning: implicit declaration of function 'board_usbdev_vid'
[-Wimplicit-function-declaration] 650 | uint16_t vid = board_usbdev_vid();

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-16 10:33:01 +08:00
dongjiuzhu1
e0d82fdf3a drivers/usedev: remove unnecessary mdelay because remain req info had beed push to serial buffer
this mdelay causes cpu busy wait, affects other process running.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-16 10:33:01 +08:00
dongjiuzhu1
1a69d3c6ee cdcacm: Add cdcacm bulkout request buffer config
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-16 10:33:01 +08:00
wanggang26
702068e62c ftl: should pre-allocate eblock for car case
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-16 10:25:36 +08:00
dongjiuzhu1
97d684847b drivers/reset: support rpmsg reset
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-15 20:21:41 +08:00
Masayuki Ishikawa
df298c186f Revert "build depend:Revert Make.dep intermediate ddc file"
This reverts commit ddc3119c4e.
2024-09-15 19:29:47 +08:00
liwenxiang1
868b17bc5a misc/goldfish: Compatible with x86_64 goldfish pipe
x86_64 uses 4-5G virtual addresses, we need to convert them into physical addresses and pass them to qemu, otherwise qemu will fail to map

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-09-15 19:28:55 +08:00
Xiang Xiao
908cd1b10a misc/goldfish_pipe: Refine the implementation
1.Merge goldfish_pipe_qemu.h into goldfish_pipe.c
2.Change all enum to macro

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-09-15 19:28:55 +08:00
yangguangcai
12ecfe365f driver/goldfish_pipe:remove pipe interrupt task delay.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-09-15 19:28:55 +08:00
zhanghu5
9642d8dae6 fix goldfish_pipe poll error
when multiple processes call poll and a event occured,
all the processes are waked up. it should wake up one
process based on pipe->id

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2024-09-15 19:28:55 +08:00
Shanmin Zhang
e793a741cc goldfish_pipe: Fix pointer-to-int-cast warning
Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2024-09-15 19:28:55 +08:00
rongyichang
69af7eef54 drivers/goldfish_pipe: notify poll event in interrupt task
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2024-09-15 19:28:55 +08:00
zhanghu5
3fd404a4c5 fds pointer not initialized cause dereference error
Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2024-09-15 19:28:55 +08:00
rongyichang
ce6382cc0c drivers/misc: enable irq for goldfish pipe
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2024-09-15 19:28:55 +08:00
zhanghu5
2ce2844480 drivers/misc: support nuttx goldfish_pipe
Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2024-09-15 19:28:55 +08:00
dongjiuzhu1
1bad603fe7 drivers/gpio: save memory if dont support signal
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-15 11:29:55 +08:00
dongjiuzhu1
28815fb7c5 drivers/gpio: add poll function for gpio device
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-15 11:29:55 +08:00
xuxin19
ec99359812 cmake:add mtd driver dhara cmake build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-15 10:29:21 +08:00
xuxin19
a3e7fee595 cmake:add missing libc regex CMake support
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-15 10:29:21 +08:00
wangjianyu3
1af4cdf500 driver/ftl: Read the consecutive eraseblocks
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 10:21:45 +08:00
wangjianyu3
a6080e4502 Revert "driver/ftl: Read the current eraseblock only"
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 10:21:45 +08:00
wangjianyu3
c40f9b8d9f driver/ftl: Read the current eraseblock only
case: The next eraseblock is bad

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 10:21:45 +08:00
wangjianyu3
b2221806cb rpmsgdev_server: Support oneway polling
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 10:18:08 +08:00
wangjianyu3
f2ca3753dd rpmsgdev_server: Support exporting devices
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 10:18:08 +08:00
xuxin19
ddc3119c4e build depend:Revert Make.dep intermediate ddc file
Revert "Parallelize depend file generation"
This reverts commit d5b6ec450f.

parallel depend ddc does not significantly speed up compilation,
intermediately generated .ddc files can cause problems if compilation is interrupted unexpectedly

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-09-15 10:01:58 +08:00
wangjianyu3
6013591cb1 dev_mem: Fix config judgment
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 09:58:55 +08:00
wangjianyu3
3c0befbdbd dev_mem: Add config for segment regions
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 09:58:55 +08:00
wangjianyu3
9553506b1f dev_mem: Fix range and pos of region
Test:
  fastboot oem filedump /dev/mem 0 748544
  fastboot get_staged mem1.txt
  fastboot oem memdump 0x44000000 0xb6c00
  fastboot get_staged mem2.txt
  diff mem1.txt mem2.txt

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-15 09:58:55 +08:00
p-szafonimateusz
51909ed59f drivers: fix gcc14 errors for PCI
fix gcc14 errors for PCI

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz
8ab0785d71 drivers: add UART 16550 compatible PCI device support
add support for UART 16550 compatible PCI device.
For now we support qemu serial PCI devices and AX99100 based cards.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz
ceb2921d79 drivers: prepare 16550 UART driver to support PCI
prepare 16550 UART driver to support PCI:

- [breaking change] change argument of uart_ioctl() from `struct file *filep` to `FAR struct u16550_s *priv`
  Also fix moxart_16550.c build related to this change

- [breaking change] change argument of uart_getreg() and uart_putreg from `uart_addrwidth_t base` to `FAR struct u16550_s *priv`
  Also fix arch/x86/src/qemu/qemu_serial.c and arch/x86_64/src/intel64/intel64_serial.c related to this change

- [breaking change] change argument of uart_dmachan() from `uart_addrwidth_t base` to `FAR struct u16550_s *priv`

- move `struct u16550_s` to public header

- generalize UART_XXX_OFFSET so we can use it with any register increment

- make u16550_bind(), u16550_interrupt(), u16550_interrupt() public

- remove arch/or1k/src/common/or1k_uart.c and use common 16550 MIMO interfacve

- change irq type in `struct u16550_s` from uint8_t to int to match MSI API

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz
c7e8fd43a4 drivers/uart_16550: configure MCR_OUT2 bit from Kconfig
move MCR_OUT2 configuration from qemu-intel64/src/qemu_boot.c to common code
also leave this option disabled for qemu-intel64 as it's not required

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz
a0e00b993a intel64: register PCI controller early but postpone PCI drivers init
Some of PCI drivers require OS interfaces that can't be executed in the INIT context.
In that case we have to postpone PCI drivers probing and call it for example
in board initialization logic.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
p-szafonimateusz
393ed71d81 pci_drivers.c: initialize ret to avoid compiler warnings
initialize ret to avoid compiler warnings in pci_drivers.c

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-15 03:37:58 +08:00
Xiang Xiao
1d586c3bee pci: Add driver_data to pci_device_id_s
so driver writer could save the private data here
and get it back in the probe function.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-09-15 03:37:58 +08:00
wangyongrong
639843ade3 virtio-pci: fix set virtio device features error
Should assgin back the feature to the vdev->features

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-15 02:22:16 +08:00
wangyongrong
b0d70b76cb virtio-pci.c: polling mode support
1. Some platforms do not support interrupt mode (PCI_MSI/MSIX),
so add polling mode support, so these platforms can also use virtio-pci;
2. In some cases, we do not want to use the interrupt for virtio driver
to avoid time jitter, so add the polling mode support;
3. If CONFIG_DRIVERS_VIRTIO_PCI_POLLING_PERIOD <= 0, interrupt mode.
   if CONFIG_DRIVERS_VIRTIO_PCI_POLLING_PERIOD > 0, polling mode.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-15 02:22:16 +08:00
wangyongrong
ee6bc2e7df virtio-pci: extract common part of virtio pci modern and leagcy
Extrace common part of virtio pci modern and legacy to virtio-pci to
reduce the duplicated code.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-15 02:22:16 +08:00
wangyongrong
d54d07b62c virtio-pci: add virtio pci legacy support
Follow the virtio spec, support the virtio pci Legacy

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
Signed-off-by: andi <andi6@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-15 02:22:16 +08:00
wangyongrong
decfc9ad65 virtio-pci-modern: replace pci_read/write_mmio_xxx with pci_read/write_io_xxx
Use IO api to access the io region

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-15 02:22:16 +08:00
wangyongrong
877e462990 vitrio-pci.c: add virtio-pci transport support for Nuttx
1. only support pci modern device;
2. need the pci controller support MSI/MSI-X;
It has been verified based on virtio-rng and virtio-net.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-15 02:22:16 +08:00
yintao
38af7001b6 drivers/rpmsg: fix the race condtion about rpmsg_device_created
xxx_rpmsg_device_created may be called repeatedly.

rptun thread				app thread

rptun_dev_start				xxx_rpmsg_init

...					rpmsg_register_callback
priv->...= rpmsg_ns_unbind;
priv->..= rptun_notify_wait;
					if (ns_unbind_cb)
(switch app thread)				device_created()
						xxx_rpmsg_device_created

					metal_list_add_tail(g_cb);
...
rpmsg_device_created();
	cb->device_created
	xxx_rpmsg_device_created;

Signed-off-by: yintao <yintao@xiaomi.com>
2024-09-14 17:34:52 +08:00
wangyongrong
00b6495419 rpmsg/CMakeLists.txt: add rpmsg_virtio_ivshmem.c in this file
rpmsg_virtio_ivshmem support Cmake compile too

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-14 17:34:52 +08:00
Xiang Xiao
a235ada719 rpmsg_virtio_ivshmem: Replace work with wdog
Just rename, since it's a wdog, not a work.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-09-14 17:34:52 +08:00
wangyongrong
ff399054c1 rptun/rpmsg_virtio: fix addrenv/raddrenv num error
Buf fix, simple_addrenv assume the last addrenv in addrenv array
be zero value

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-14 17:34:52 +08:00
liaoao
58c9c23765 rpmsg_ping:only sleep when ping->sleep is larger than 0
To avoid call sleep when sleep <= 0

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-14 17:34:52 +08:00
wangyongrong
c84409a2cd rpmsg_virtio_ivshmem.c: Replace work queue with wdog
rpmsg_virtio_ivshmem polling mode use wdog to loop instead work
queue, beacause wdog has better performance

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-14 17:34:52 +08:00
wangyongrong
57cb0cb66f rpmsg_virtio_ivshmem.c: rpmsg virtio ivshmem msix interrupt support
Change the rpmsg_virtio_ivshmem from pci bus based to
pci-ivshmem bus based, so rpmsg_virtio_ivshmem can support interrupt
mode and also support the multi instance.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-14 17:34:52 +08:00
wangyongrong
3ca717ef4a rpmsg_virtio_ivshmem.c: fix VIRTIO_RPMSG_F_BUFSZ not used caused restart err
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-14 17:34:52 +08:00
wangyongrong
d96fe98591 nuttx/rpmsg_virtio.c: fix invalid use of undefined type ‘struct rpmsg_hdr’ err
rpmsg/rpmsg_virtio.c:320:49: error: invalid use of undefined type ‘struct rpmsg_hdr’
  320 |                                         rx ? hdr->dst : hdr->src);

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-14 17:34:52 +08:00
Bowen Wang
1f96a0b5e9 drivers/rpmsg: fix recursive assert when call rpmsg_dump_all() in irq
Because call mutex lock is forbidden in interrupt.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-14 17:34:52 +08:00
Yongrong Wang
67e41d0e32 rpmsg/rpmsg_virtio_ivshmem: add rpmsg virtio ivshmem support
rpmsg_virtio_ivshmem is a ivshmem based rpmsg virtio driver,
with this driver, we can use the rpmsg virtio in qemu platfrom

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-14 17:34:52 +08:00
Yongrong Wang
af0bde8bca rpmsg virtio: add rpmsg virtio wrapper support
Rpmsg VirtIO is a virtio transport implementation for Rpmsg, and
it's different to the rptun framework.

rpmsg_virtio.c implements the rpmsg virtio transport layer by itself
to avoid use the remoteproc implementation in OpenAMP to save code
size, so it can be treated as a lightweight version of rptun.
Therefore, rpmsg_virtio.c only support the communication feature and
do not support contoll the life cycle of the remote core.
But benefit by it's small footprint, it can be used in the chips with
small flash.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-14 17:34:52 +08:00
Yongrong Wang
e359c661d8 rpmsg ping: fix rpmsg_ping_ept_cb rpmsg send length
The rpmsg ping response length should not include the data length.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-09-14 17:34:52 +08:00
ligd
981bda5cf0 ramlog: workaround the unsafe critical section
thread1:                           thread2:
ramlog_addbuf()
    enter_critical_section()
    ramlog_pollnotify()
       foreach rl_list
             --> switch out
                                   ramlog_file_close
                                   enter_critical_section()
                                   list_delete()
                                   leave_critical_section()
             <--- switch back
       rl_list error
    leave_critical_section()

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-14 13:13:39 +08:00
ligd
78d93eb628 ramlog: unify the lock to critical section
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-14 13:13:39 +08:00
fangpeina
11f06eb0f5 drivers/serial: fix deadlock when executing rexec in a user task
CPU0                                                  CPU1
task:nsh_main     task:user_app                       rexecd
nsh_consolemain	  system
uart_read         rexec				      ---
got recv.lock     poll			              ---
	          uart_poll       rpmsg_socket_poll   rpmsg_socket_close
wait recvsem      get recv.lock   poll_notify
                  deadlock        routine work

the error accurs in CPU0 when waiting console input

resolve: unlock recv.lock when waiting recvsem

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-09-14 10:27:40 +08:00
zhanghu5
10e7d8fe44 set min read length in uart_ioctl
set min read length in uart_ioctl

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2024-09-14 10:27:40 +08:00
Bowen Wang
7a495fabb6 pci/pci_uio_ivshmem: pci uio ivshmem msix interrupt support
1. Change pci uio ivshmem driver from pci bus based tp pci-ivshmem
bus based;
2. Add the interrupt support by usin the pci_ivshmem API;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-14 08:39:52 +08:00
liaoao
40e34b5b58 spi_slave: keep consistent with the parameter of the spi_slave_receive function declaration
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 12:27:31 +08:00
p-szafonimateusz
4a147fc86b drivers/pci_qemu_edu: add MSI test
Add simple MSI test for QEMU PCI EDU device so we can verify if MSI works correctly

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-13 09:42:08 +08:00
p-szafonimateusz
db6d0bd356 drivers/pci: add MSI/MSI-X support
Add support for MSI and MSI-X in PCI framework

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-13 09:42:08 +08:00
liaoao
e4ad92cb03 rpmsgblk: split multi_cmd only when it is too large to be placed into payload buffer
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:26:35 +08:00
rongyichang
83c2a7f54e drivers/fb: add panbuffer clear ioctl
Some devices need to clear the fb panbuf when waking up from sleep
to avoid outputting residual buffers from before sleeping

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2024-09-13 09:15:38 +08:00
liaoao
d8d7f3c38e bits.h: replace all inline defination of __set_bit/__clear_bit
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
liaoao
d04e1ebf4e coresight: return -EEXIST when register a device which has been registered
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
liaoao
6f770fb4b1 coresight: disable device before unregister
coresight_claim_device will fail when unregister device
which has been enabled. device should be the init state when
it is unregistered.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
liaoao
8a57dafdcf coresight: add clk control for coresight system
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
liaoao
df33c392ae coresight:add tmc device support
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
liaoao
79af05c4ae coresight:add etb device support
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
liaoao
71e4267a7a coresight: add etm3 device support
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
liaoao
e3e23f7eaf coresight:add stm device
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
liaoao
c0e40fc19f coresight:add tpiu device support
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
liaoao
5324f69b58 coresight:add link coresight device support
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
liaoao
8cc0c24318 coresight:add common api for coresight system
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
liaoao
24050ba59f coresight: add coresight_core
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
ligd
6a2c03732f clock: Replace all ts and tick conversion functions
Using the ts/tick conversion functions provided in clock.h

Do this caused we want speed up the time calculation, so change:
clock_time2ticks, clock_ticks2time, clock_timespec_add,
clock_timespec_compare, clock_timespec_subtract... to MACRO

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-12 18:14:39 +08:00
chao an
7223a1d0d4 serial/uart_16550: remove up_putc spinlock
putc atomicity should be guaranteed by common code rather than add similar hack to lower half driver

Signed-off-by: chao an <anchao@lixiang.com>
2024-09-12 18:11:30 +08:00
p-szafonimateusz
ff2fe986cf cmake: add support for PCI
PCI framework can be build with cmake

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-12 18:11:13 +08:00
Bowen Wang
4fe2a0daf8 pci/pci.c: fix some pci BUGs
fix some pci BUGs that make it impossible to match PCI device

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-12 18:10:46 +08:00
chao an
c19bdf204c serial/uart_pl011: default syslog needs to check flow control in up_putc
default syslog needs to check flow control in up_putc(), otherwise
up_puts() will lose character if the hardware fifo is full.
2024-09-12 17:15:40 +08:00
caijie
fe4526c7f9 mtd:ramtron MB85RS256B address length is 2 2024-09-12 13:41:51 +08:00
dongjiuzhu1
881cd3f7db driver/usbdev: support userspace to access ep0
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-11 22:00:26 +08:00
ligd
ccd87767da timers: add weak function up_timer_gettime()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-10 23:32:30 +08:00
zhangshoukui
1413fc0c1b drivers/rwbuffer: Set nblocks 0 after using wrflush(skip rwbuffer)
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-10 15:22:03 +08:00
fangpeina
cd15d37396 drivers/input: add dummy force feedback driver
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-09-10 15:21:42 +08:00
fangpeina
947a32184b drivers/include: clean up compilation warning about aw86225.c
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-09-10 15:21:42 +08:00
dongjiuzhu1
84b3b1daa0 ff/aw86225: implement aw86225 vibrator driver base on ff
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-10 15:21:42 +08:00
dongjiuzhu1
f65491ba44 input/ff: support force feedback driver framework
Add new driver frameworks: force feedback for vibrator, like linux,
unify vendor vibrator driver using.

Incorporating a force feedback-based driving framework to replace the
conventional driver/motor setup for controlling vibrators not only
enhances the precision and responsiveness of the haptic feedback but
also aligns better with the advancements in Linux-based driver systems.

refs docs link: https://www.kernel.org/doc/html/v4.19/input/ff.html

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-10 15:21:42 +08:00
Bowen Wang
6c339daa86 rptun/rptun_ivshmem: interrupt mode support
1. Change rptun_ivshmem from pci bus based to pci_ivshmem bus based;
2. Support the interrupt mode.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-10 14:34:31 +08:00
Bowen Wang
9c91ed2360 pci/pci_ivshmem: fix bug in remove and add vmid check
1. Should check the vmid in ivshmem_remove() when release irq instead
check the ivdev->reg;
2. Add vmid check in ivshmem_probe() because ivshmem driver only support
vmid == 0 or 1 for now in NuttX;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-10 14:34:31 +08:00
Bowen Wang
218210d26e pci/pci_ivshmem: add pci ivshmem driver support
Add common ivshmem driver, provide the ivshmem bus mechisam, so
many ivshmem based driver can change to pci_ivshmem based

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-10 14:34:31 +08:00
Bowen Wang
ccb17f2bb4 pci/pci_uio_ivshmem: add pci uio ivshmem driver support
Application can open "/dev/uioX" and use `mmap()` to get the
memory provided by ivshmem device.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-10 14:34:31 +08:00
Bowen Wang
fa761a6be7 rptun/rptun_ivshmem: rptun_ivshmem to be compliable with 32 bit arch
Fix the compile waring in 32 bit arch

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-10 14:34:31 +08:00
Bowen Wang
f8ba836174 rptun/rptun_ivshmem: add rptun ivshmem support
Rptun is a rptun fremework driver base on the Inter-Virtual Machine
Share Memory Device.
With this driver, two NuttX runs in different QEMU can communicate
with each other by the rpmsg api.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-10 14:34:31 +08:00
meijian
a7224cf35a net/netstatistics: add tx/rx bytes statistics for dev
We can see them in ifconfig:

ap> ifconfig
wlan0   Link encap:Ethernet HWaddr 42:64:7f:b3:12:03 at UP mtu 1500
        inet addr:10.0.1.2 DRaddr:10.0.1.1 Mask:255.255.255.0
        inet6 DRaddr: ::

        RX: Received Fragment Errors   Bytes
            00000b9b 00000000 00000000 21daf5
            IPv4     IPv6     ARP      Dropped
            00000a33 00000137 00000031 00000000
        TX: Queued   Sent     Errors   Timeouts Bytes
            00000ac4 00000ac4 00000000 00000000 1a2103
        Total Errors: 00000000

Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-10 11:36:03 +08:00
Bowen Wang
0fbfcf4caf virtio-blk: support called read/write in interrupt
Coredump need call the block read/write ops in interrupt
Not consider the ops called in thread and intterupt simultaneously.
Only used for coredump now.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-10 11:35:35 +08:00
zhanghongyu
420648b0c6 drivers/pipes: add fcntl(F_SETPIPE_SZ/F_GETPIPE_SZ) support
allows user programs to modify pipe size, but not larger than
CONFIG_DEV_PIPE_MAXSIZE

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-09-10 11:35:15 +08:00
dongjiuzhu1
33f3c3552f Revert "Fix unwanted flush in the SPI slave driver"
because if priv->rx_length is zero , need to call SPIS_CTRLR_QPOLL to
receive new data from lower half and update priv->rx_length.

This reverts commit 6cb649ecf6.
2024-09-09 11:05:07 -03:00
dongjiuzhu1
c978f2fe4c drivers/mtd/bch: fix size_t overflow when offset > 4GB
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-09 01:23:02 +08:00
dongjiuzhu1
5f0230d79f drivers/bch: fix uint32 overflow issue
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-08 21:42:38 +08:00
Luchian Mihai
eadc2f5690 feat: add basic driver for amg88xx sensor
Basic amg88xx sensor handling (open, close, read, ioctl).
No interrupts supported. I intend to add support for this feature when I
gain more know-how on nuttx/posix.
2024-09-07 12:03:38 +08:00
chenrun1
44351959ee mmcsd_sdio:Limit the use of sleep in mmcsd.
reference:https://github.com/apache/nuttx/pull/12971

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-06 12:25:55 +08:00
chenrun1
0e13ea9ed1 mmcsd_sdio:Fix performing read and write in irq
In some usage scenarios, read and write tasks will be performed during interruptions. If sleep is used at this time, it will cause a timeout crash. Therefore, a macro is added to determine whether it is currently interrupted to select sleep/delay.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-06 12:25:55 +08:00
lipengfei28
aeb98d9c05 fix Compile error
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
b70922cb24 pci: add ioctl for userspace
which is same as OpenBSD:
https://github.com/openbsd/src/blob/master/sys/sys/pciio.h

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
dba7700813 pci: add rom addr and rom size to resource
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
3250625a15 pci: add find device from bus
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
9dc9500aaf pci add register drivers
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
c25f839b06 pci: add pci bus find capability interface
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
45f1597562 pci: add pci read/write config/io space interface
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
lipengfei28
d9c8838319 pci: use g_pci_ctrl_list replace g_root_bus_list
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
75f8c72dbb drivers/pci/pci_qemu_edu: update qemu edu driver code
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
9c07b369e9 drivers/pci/pci_qemu_test: update qemu pci test code
Change the qmeu pci test code for new pci driver framework

Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
7cbb7d36d8 Changed the x86 64 pci driver
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
yangshuyong
125884ae95 Changed the pci bus for arm architecture
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-06 10:01:11 +08:00
fangxinyong
7b05a550dc sched: replace up_cpu_index with this_cpu
Make this_cpu is arch independent and up_cpu_index do that.
In AMP mode, up_cpu_index() may return the index of the physical core.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-09-05 12:09:24 +08:00
Saurav Pal
fc31c61730 boards/sim: Defconfigs for nand and mnemofs
Adds nand and mnemofs sim configs.

Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2024-09-05 11:02:05 +08:00
yangsong8
918ae4cc84 drivers: usbdev: Fix USB descriptor
This commit fixes the regression from https://github.com/apache/nuttx/pull/13190

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-09-03 11:45:45 -03:00
chao an
85c39e96d6 global/variables: add g_ prefix to some global variables
Signed-off-by: chao an <anchao@lixiang.com>
2024-09-02 18:23:57 +08:00
zhaoxingyu1
79199e25f1 mtd/nvs: fix align size
when gc, move data requires byte alignment

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2024-08-30 21:25:33 +08:00
daichuan
e48d5d8271 add for support cmake with netdev_notify_recvcpu.c
Signed-off-by: daichuan <daichuan@xiaomi.com>
2024-08-30 01:45:06 +08:00
daichuan
b5753d06f2 support rss/arfs with device
Signed-off-by: daichuan <daichuan@xiaomi.com>
2024-08-30 01:45:06 +08:00
yangsong8
5a39e83c05 usbdev: extend the usb req len to size_t
Some USB controllers can receive or send multiple data packets then
generate one interrupt. This mechanism can reduce the number of data
copies. Extend req buf to accommodate this.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-30 01:32:02 +08:00
chenzhijia
f526b91165 nuttx/drivers:Modify errcode returned by relay_ioctl
Fixed system function call failure due to return errcode error

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-08-29 01:04:03 +08:00
yangguangcai
efbf43cdfa driver/mem:add Mem Driver.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-08-28 13:59:04 +08:00
yangsong8
a2e7265adb cdcacm: align cdcacm_epconfigure function parameters
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-28 13:48:55 +08:00
yangguangcai
45625cbe3b timer driver:support poll.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-08-28 13:46:47 +08:00
yangsong8
fa1c094e65 usbdev: add usb3.0 ep companion struct and descriptor
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-27 12:53:15 -03:00
yangsong8
1dd38fe974 usbdev: unify the parameter of mkconfdesc function
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-27 12:53:15 -03:00
yangsong8
07aa8a5c57 usbdev: modify usb device support USB3.0 MaxPacketSize
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-27 12:53:15 -03:00
yangsong8
0788e68285 usbdev: usb device descriptor support USB3.0
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-27 12:53:15 -03:00
yangsong8
af017a5c30 usbdev: fix usb cdcecm build error
usbdev/cdcecm.c:295:3: error: invalid type argument of '->' (have 'struct net_driver_s')
  295 |   NETDEV_TXPACKETS(self->dev);
      |   ^~~~~~~~~~~~~~~~
usbdev/cdcecm.c: In function 'cdcecm_txdone':
usbdev/cdcecm.c:495:3: error: invalid type argument of '->' (have 'struct net_driver_s')
  495 |   NETDEV_TXDONE(priv->dev);
      |   ^~~~~~~~~~~~~

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-27 12:53:15 -03:00
jinxiuxu
575c9b12ab drivers/audio: fix samp rate conversion issue
use ac_controls.hw to get the correct sample rate intead of ac_controls.b

Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-27 22:00:39 +08:00
likun17
7913b249ca drivers/regmap: add exit function interface.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-08-27 21:43:58 +08:00
yangguangcai
3fa6cfc41e rpmsg_rtc:Update g_basetime from rpmsg.
When ipc is busy, g_basetime may be inconsistent
on different cores.

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-08-27 21:35:17 +08:00
yangguangcai
234c7d58bf rtc alarm:fix doesn't call nxsig_notification
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-08-27 10:18:10 -03:00
guoshichao
599d41d806 greenhills: fix the pointless comparison build warning
"ioexpander/gpio.c", line 529: warning #186-D: pointless comparison of
          unsigned integer with zero
            if (pintype < GPIO_INPUT_PIN || pintype >= GPIO_NPINTYPES)
                        ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 07:33:09 -04:00
zhaoxingyu1
517d55a2ce nvs: modify nvs block size and block numbers
mtd_config_fs/Kconfig: update nvs block size and block number to configurable

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2024-08-26 20:55:24 -04:00
wanggang26
dfffaee706 mmcsd: add write ext csd reg support
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-08-26 17:45:43 -04:00
Zhe Weng
90c0acce05 net/tun: Support changing carrier state of TUN/TAP
Add TUNSETCARRIER ioctl, then we may change the carrier state of TUN dynamically. Note that we don't need an ioctl for getting carrier, it can be done by SIOCGIFFLAGS already.

Ref: https://github.com/torvalds/linux/blob/v6.10/drivers/net/tun.c#L3374-L3380

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-08-26 17:34:23 -03:00
Xiang Xiao
56745e300a rpmsg: Reformat drivers/rpmsg/rpmsg.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-08-27 01:48:16 +08:00