Commit Graph

54674 Commits

Author SHA1 Message Date
Yongrong Wang
a20cc9f04c sim rpmsg virtio: add sim rpmsg virtio support
add sim_rpmsg_virtio.c to verify the new rpmsg virtio wrapper layer,
new the rpmsg virtio can be used in sim platfrom

Signed-off-by: Yongrong Wang <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
fangpeina
401a06fb17 input/ff: modify FF_MAX to support 64-bit machine
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-09-14 13:44:49 +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
raiden00pl
28efb282d8 add .gdb_history to .gitignore
.gdb_history is created next to NuttX ELF when working with pwndbg GDB plug-in
2024-09-14 12:14:12 +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
ouyangxiangzhen
733a68002c arch/riscv: Fixed hardware timer warps-around issue
This commit fixed the issue where the hardware timer wraps around and causes the system to halt.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-14 00:07:13 +08:00
hujun5
908df725ad arch: use up_current_regs/up_set_current_regs replace CURRENT_REGS
reason:
1 On different architectures, we can utilize more optimized strategies
  to implement up_current_regs/up_set_current_regs.
eg. use interrupt registersor percpu registers.

code size
before
    text    data     bss     dec     hex filename
 262848   49985   63893  376726   5bf96 nuttx

after
       text    data     bss     dec     hex filename
 262844   49985   63893  376722   5bf92 nuttx

size change -4

Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
   -machine virt,virtualization=on,gic-version=3 \
   -net none -chardev stdio,id=con,mux=on -serial chardev:con \
   -mon chardev=con,mode=readline -kernel ./nuttx

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-13 23:18:58 +08:00
makejian
222840e135 crypto/rsa: add exp mod in software crypto
Implemented a simple exponentiation.
Signed-off-by: makejian <makejian@xiaomi.com>
2024-09-13 23:08:39 +08:00
ligd
72bdc9d9b4 armv7/8-m: change enter_critical_section to up_irq_save
caused critical_monitor will gettime, that will caused
enter_critical_seciton recursive

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-13 23:08:00 +08:00
ligd
32f56c3c62 armv8m: support busfault forward to TEE in REE handler mode
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-13 23:08:00 +08:00
ouyangxiangzhen
cb7894d644 arch/x86_64: Add ARCH_INTEL64_DISABLE_CET
Intel CET (Control-flow Enforcement Technology) is a hardware enhancement aimed at mitigating the Retpoline vulnerability, but it may impact CPU branch prediction performance. This commit added ARCH_INTEL64_DISABLE_CET, which can disable CET completely with compilation option `-fcf-protection=none`.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-13 17:01:24 +02:00
ouyangxiangzhen
126221df97 arch/x86_64: Add elf32 multiboot1 wrapper for NuttX binary
It was discovered that attempting to load x86-64 format ELF files with a multiboot1 header using the qemu `-kernel` command would result in an error, as multiboot1 only allows x86-32 format ELF files. To address this limitation, we have developed a simple x86_32 bootloader. This bootloader is designed to copy the `nuttx.bin` file to the designated memory address (`0x100000`) and then transfer control to NuttX by executing a jump instruction (`jmp 0x100000`).

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-13 21:25:51 +08:00
p-szafonimateusz
2b1da40832 arch/x86_64/intel64: fix compilation errors in intel64_oneshot_lower.c
clock_time2ticks and clock_ticks2time macros changes but this file was not update

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-13 21:24:39 +08:00
p-szafonimateusz
d6a6a0a7cc arch/intel64/hpet: add FSB interrupts support and support for 32-bit mode
These are changes to make HPET work with ACRN hypervisor:

- FSB interrupt delivery (which works like PCI MSI)
- 32-bit mode support

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-13 09:28:08 -03:00
Jukka Laitinen
78d2d884d3 arch/arm64/src/imx9/imx9_lpi2c.c: Ignore spurious RX interrupts
Check remaining data count, just in case an extra RX interrupt occurs
after receiving a message

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-09-13 09:18:30 -03:00
ouyangxiangzhen
dd88c7fcfa sys/mman: Add dummy implementations of shm_open and shm_unlink
This patch added dummy implementations of shm_open and shm_unlink.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-13 16:08:25 +08:00
ouyangxiangzhen
020dbe51e3 sched/pthread: Add dummy pthread_setaffinity_np
This patch added dummy pthread_setaffinity_np implementation if CONFIG_SMP is disabled.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-13 16:08:25 +08:00
ouyangxiangzhen
28d943b226 sys/resource: Add RLIMIT_RTPRIO and RLIMIT_RTTIME definition
This commit add the definition of RLIMIT_RTPRIO and RLIMIT_RTTIME.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-13 16:08:25 +08:00
Lup Yuen Lee
d36197266a build.yml: Limit the GitHub Runners
This PR modifies NuttX CI and GitHub Actions, to comply with ASF Policy. Right now, every NuttX Pull Request will trigger 24 Concurrent Jobs (GitHub Runners), executing them in parallel: https://lupyuen.github.io/articles/ci

According to ASF Policy: We should run at most 15 Concurrent Jobs: https://infra.apache.org/github-actions-policy.html

Thus we'll cut down the Concurrent Jobs from 24 down to 15. That's 12 Linux Jobs, 2 macOS, 1 Windows. (Each job takes 30 mins to 2 hours)

(1) Right now our "Linux > Strategy" is a flat list of 20 Linux Jobs, all executed in parallel

(2) We change "Linux > Strategy" to prioritise by Target Architecture, and limit to 12 concurrent jobs

(3) So NuttX CI will initially execute 12 Build Jobs across Arm32, Arm64, RISC-V, Simulator and Xtensa. As they complete, NuttX CI will execute the remaining 8 Build Jobs (for Arm32).

(4) This will extend the Overall Build Duration from [2 hours](https://github.com/apache/nuttx/actions/runs/10817443237) to [2.25 hours](https://github.com/lupyuen4/ci-nuttx/actions/runs/10828246630)

(5) We'll also limit macOS Jobs to 2, Windows Jobs to 1
2024-09-13 14:33:13 +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
0659b333b4 arch/x86_64/intel64: add MSI/MSI-X support
Add MSI and MSI-X support for intel64

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
chao an
2b4ab6cd29 stream/syslograw: remove support for iob buffer in syslog
IOB buffer participates in the calculation of the congestion strategy
in the protocol stack, if the iob buffer is exhausted or there are
too many syslog printing tasks, the behavior of the protocol stack
and log printing will unable to determined, this PR will remove support
for iob buffer in syslog

Signed-off-by: chao an <anchao@lixiang.com>
2024-09-13 09:14:56 +08:00
ouyangxiangzhen
0451ead2c5 fs/mmap: Ensure anonymous pages are initialized to zero
According to the mmap(2) specification, anonymous pages should be initialized to zero unless the MAP_UNINITIALIZED is specified.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-13 09:10:21 +08:00
ouyangxiangzhen
53c7612faf fs/mmap: Add MADV_HUGEPAGE definitions
This commit add MADV_HUGEPAGE and MADV_NOHUGEPAGE definitions for madvise. Notice that none of these flags have been implemented yet.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-09-13 09:10:04 +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
b98d68599e coresight: add document for coresight
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