Commit Graph

55540 Commits

Author SHA1 Message Date
wangming9 b3e640cf3f arch/arm64: GICv2 detection is compatible with different qemu versions
Summary:
- GICv2 cannot be detected on the golsfish platform
- Golsfish uses version 2.12.0 of qemu with a GICC_IIDR value of 0,
  read ICPIDR2 to determine the GIC version

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2024-10-10 15:40:03 +08:00
Bowen Wang a847ee1675 qmeu_boot: add rpmsg syslog init for arm64 qemu chip
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-10 15:40:03 +08:00
wangming9 e48b81ebe9 arch/arm64: Supports cluster PMU
Summary:
Some processors implement cluster PMUs, such as Cortex-R82.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2024-10-10 15:40:03 +08:00
wangming9 fa96350574 arch/arm64: Modify the method for obtaining the CPU frequency
Summary:
1、cntfrq_el0 is used to store the timer frequency, which may
   be different from the CPU frequency.
2、Do not use up_perf interface for SMP.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2024-10-10 15:40:03 +08:00
yangguangcai e9b77833e3 goldfish:config pl031.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-10 15:40:03 +08:00
liwenxiang1 f858026819 arch/x86_64:Add allsymbol functionality
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 14:56:08 +08:00
ouyangxiangzhen 93890321c5 sched/wdog: Fix code style
This commit fixed code style issue left by the previous patch.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-10 13:57:46 +08:00
Huang Qi 20cba94a86 risc-v/espressif: Fix alert message in `esp_setup_irq()`
Correct the alert message in `esp_setup_irq()` if
irq number allocation fails, the parameter number is not
matched with format specifier.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-10-10 13:41:34 +08:00
liwenxiang1 e3b3a6145a arch/x86_64: idle convert all asm() to __asm__()
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 13:40:39 +08:00
liwenxiang1 1af831e139 arch/x86_64: cpuid expect 32 bit variables
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 12:03:27 +08:00
liwenxiang1 2448e8a59e arch/x86_64:Add perf tool
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 12:01:16 +08:00
liwenxiang1 f81c7dbc93 arch/x86_64:Use the checkstack function
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 11:40:15 +08:00
liwenxiang1 2f26323388 arch/libc: Integrate vfork into fork, and vfork directly call up_fork
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 08:45:03 +08:00
hujun5 67c9a7aabd sched: remove param in nxsched_remove_readytorun
after
   text    data     bss     dec     hex filename
 269732   51065   63335  384132   5dc84 nuttx

before
   text    data     bss     dec     hex filename
269784   51065   63335  384184   5dcb8 nuttx

size -50

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-10 08:44:52 +08:00
yintao 37a30023f5 nuttx/drivers: add ept_release_cb for destroy server resource
use ept_release_cb to destory rpmsg services server dile resource
to avoid the used-after-free issue

Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-10 08:44:29 +08:00
Lup Yuen Lee 80d03cb296 CI: Split the RISC-V Build Jobs into smaller jobs
To speed up the CI Workflow, this PR splits the CI Build Jobs for RISC-V into smaller jobs. Each job will now complete within 1 hour.

Before the PR: There are 2 jobs for RISC-V, each requiring more than 1.5 hours
- `risc-v-01` (1 hour 42 mins): BL602, Ox64, ESP32-C3 / C6 / H2
- `risc-v-02` (1 hour 41 mins): K230, Icicle, QEMU, RV32M1-Vega

After the PR: The build is spread across 6 jobs for RISC-V, each job completes within 1 hour
- `risc-v-01` (19 mins): BL602, Ox64
- `risc-v-02` (44 mins): ESP32-C3
- `risc-v-03` (45 mins): ESP32-C6, ESP32-H2
- `risc-v-04` (31 mins): K230, Icicle
- `risc-v-05` (41 mins): QEMU CITest
- `risc-v-06` (38 mins): Rest of QEMU, RV32M1-Vega

Following the same convention as the Arm32 Build Jobs, the above jobs are sorted by Target Name. Performance of the RISC-V Build Jobs is discussed in https://github.com/apache/nuttx/issues/13775
2024-10-10 08:44:02 +08:00
ouyangxiangzhen 110ab50f50 sched/wdog: Revert wd_cancel semantics
In the original implementation, if wdog is not ACTIVE, -EINVAL will be returned. The rp2040 i2c driver relies on this semantics to correctly release the semaphore.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-09 16:18:27 -03:00
hujun5 e249dd2672 arch: support customized up_cpu_index() in AMP mode
Some app with same code runs on different cores in AMP mode,
need the physical core on which the function is called.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-10-10 02:38:40 +08:00
Bowen Wang 092bdec20b drivers/serial: support force panic only when repeat the panic char
We can increase the panic repeat count to avoid abnormal crashes
caused by serial port interference.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-10 02:38:12 +08:00
Bowen Wang bbb7f436d4 serial.c: should protect the fds when calling poll_notify
1. Use critical_section to protect the fds array;
2. Use critical_section and sched lock to protect the poll notify, because
   poll notify may cause context switch, delay the context swtich to
   sched_unlock();

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-10 02:38:12 +08:00
Bowen Wang 39449c6069 sched/sched.h: add nxsched_lock/unlock_irq() function
These two macros can be called in interrupt context and:
1. Do nothing when called in interrupt;
2. Same behavior as sched_lock/unlock when called in thread;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-10 02:38:12 +08:00
ligd 0a70235b0c serial/pl011: fix can't up_putc() after setup
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-10 02:38:12 +08:00
ligd 80079f35e4 signal: add sig_tgkill() kenrnel version support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-10 02:38:12 +08:00
ligd 94cc99d01b serial: fix cu ctrl+c crash
__assert
/home/work/ssd1/workspace/MiRTOS-N62-Rel-4.0-Pre-Build/nuttx/libs/libc/assert/lib_assert.c:36
nxsem_recover
/home/work/ssd1/workspace/MiRTOS-N62-Rel-4.0-Pre-Build/nuttx/sched/semaphore/sem_recover.c:86 (discriminator 3)
nxtask_recover
/home/work/ssd1/workspace/MiRTOS-N62-Rel-4.0-Pre-Build/nuttx/sched/task/task_recover.c:79
nxtask_exithook
/home/work/ssd1/workspace/MiRTOS-N62-Rel-4.0-Pre-Build/nuttx/sched/task/task_exithook.c:448
nxtask_terminate
/home/work/ssd1/workspace/MiRTOS-N62-Rel-4.0-Pre-Build/nuttx/sched/task/task_terminate.c:110
pthread_cancel
/home/work/ssd1/workspace/MiRTOS-N62-Rel-4.0-Pre-Build/nuttx/sched/pthread/pthread_cancel.c:110
cu_main
/home/work/ssd1/workspace/MiRTOS-N62-Rel-4.0-Pre-Build/apps/system/cu/cu_main.c:485
nxtask_startup
/home/work/ssd1/workspace/MiRTOS-N62-Rel-4.0-Pre-Build/nuttx/libs/libc/sched/task_startup.c:70 (discriminator 2)
nxtask_start
/home/work/ssd1/workspace/MiRTOS-N62-Rel-4.0-Pre-Build/nuttx/sched/task/task_start.c:134

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-10 02:38:12 +08:00
sunjikun ee306d47fd drivers/serial: Add 16550_DLF_SIZE option for DesignWare UART.
Signed-off-by: sunjikun <sunjikun@xiaomi.com>
2024-10-10 02:38:12 +08:00
ligd c00d477671 Doc: add maskable nested interrupt description
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-10 01:01:17 +08:00
ligd ff99745b22 arm-m: support zero interrupt back to game
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-10 01:01:17 +08:00
ligd a9da6ab4b5 arm-M: set current regs for crash dump
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-10 01:01:17 +08:00
ligd 780acd7827 armv6/7/8m: use pendsv to handle context switch
This PR support Nested interrupt in armv6/7/8m:

There are two types of nested interrupt model:

Zero latency nested interrupt
Interrupt           Priority            Note
Data abort          Highest
SVC                 0x50
High irq1           0x60             ISR can't access system API
irq_save()          0x70
High irq2           0x80             ISR can't access system API
normal irq3         0xB0
We have already support this mode before this PR

Nested interrupt which interrupt level lower than up_irq_save()
Interrupt           Priority            Note
Data abort          Highest
SVC                 0x70
irq_save()          0x80
High irq1           0x90              ISR can access system API
High irq2           0xA0              ISR can access system API
normal irq3         0xB0
Now, this PR can support this mode

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-10 01:01:17 +08:00
ligd f221c9ecb4 armv6m: add up_trigger_irq() support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-10 01:01:17 +08:00
ligd f20ae064b0 armv7/8m: unmask all the IRQ when thread start
NVIC_SYSH_PRIORITY_MIN not the basepri loweest prio
spec says:
basepri 0 - Disables masking by BASEPRI

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-10 01:01:17 +08:00
Bowen Wang 89c49c53a7 virtio-mmio/pci: add alloc_buf/free_buf for mmio and pci transport layer
And remove the virtio_alloc/free_buf implementation in virtio.c, because
these two apis has been moved to the OpenAMP

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-09 23:32:58 +08:00
wangyongrong 0b1f45d600 rptun: rptun implements notify_wait through rvdev->notify_wait_cb
notify_wait has been remove in remoteproc ops and virtio_dispatch and
has been moved to the struct rpmsg_virtio_device in new OpenAMP,
so change the rptun too,

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-10-09 23:32:58 +08:00
Yongrong Wang 60ab9ae37e virtio_9p.c: fix compile error in OpenAMP upgrade feature reflow to dev
v9fs/virtio_9p.c:223:3: error: too few arguments to function 'virtio_negotiate_features'
  223 |   virtio_negotiate_features(vdev, 1 << VIRTIO_9P_MOUNT_TAG);
v9fs/virtio_9p.c:245:9: error: too few arguments to function 'virtio_create_virtqueues'
  245 |   ret = virtio_create_virtqueues(vdev, 0, 1, vqname, callback);

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-09 23:32:58 +08:00
Yongrong Wang 1b24139020 virtio-pci/mmio: Features change to 64 bit in all virtio_dispatch and fix compile warning
virtio/virtio-pci-legacy.c:399:48: warning: passing argument 2 of ‘pci_bus_write_io_dword’ makes integer from pointer without a cast [-Wint-con>
  399 |   pci_write_io_dword(vpdev->dev, vpdev->ioaddr + VIRTIO_PCI_GUEST_FEATURES,
      |                                                ^
      |                                                |
      |                                                void *
/home/wyr/work/code/project/vela/nuttx/include/nuttx/pci/pci.h:559:65: note: expected ‘uintptr_t’ {aka ‘long unsigned int’} but argument is of >
  559 | int pci_bus_write_io_dword(FAR struct pci_bus_s *bus, uintptr_t where,
      |                                                       ~~~~~~~~~~^~~~~

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-09 23:32:58 +08:00
wangyongrong 5aeb644bc5 virtio: adapt to the new OpenAMP
Sync all the virtio api usage to sync with new OpenAMP

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-10-09 23:32:58 +08:00
wangyongrong 8e799ff823 rpmsg: upgrade API passing on parameters with the upgrade of OpenAMP
All the rpmsg transport layer and rpmsg services sync the API
with new OpenAMP

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-10-09 23:32:58 +08:00
wangyongrong 2bc9256684 openamp/libmetal.defs: fix OpenAMP upgrade err
fix nuttx/openamp/libmetal/lib/cpu.h don't have <metal/processor/generic/cpu.h>
error, let's use generic/cpu.h for all arch in NuttX

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-10-09 23:32:58 +08:00
wangyongrong ef67a866f3 openamp: replace VIRTIO_DRIVER/DEVICE_ONLY to VIRTIO_DRIVER/DEVICE_SUPPORT
New OpenAMP change the VIRTIO_DRIVER/DEVICE_ONLY to the
VIRTIO_DRIVER_DEVCE_SUPPORT, so upgrade the NuttX OpenAMP config too

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-10-09 23:32:58 +08:00
Bowen Wang 8b4376683a openamp: sync the openamp and libmetal to the last commit
Upgrade the openamp is a troublesome thing, so diretly sync the
open-amp and libmetal the newest commit.

We can update the commit and remove the patch when this patch has
been merged in the OpenAMP repo.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-09 23:32:58 +08:00
buxiasen 264252497c pm: fix pm_wakelock_uninit api block, wd api need irq not disabled
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-09 23:31:49 +08:00
dongjiuzhu1 a005f4bff1 drivers/power: using baterr/batinfo to avoid frequency log output
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-09 23:31:49 +08:00
zhangshengchao e26a01d9a6 regulator:add bypass logic when registering
do not control regulators when set bypass flag

Signed-off-by: zhangshengchao <zhangshengchao@xiaomi.com>
2024-10-09 23:31:49 +08:00
zhangwenjian 18497e5bc6 long double need use the format of 'Lf'
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-09 23:00:59 +08:00
wanggang26 955a3838f7 mmcsd: refine emmc capacity calculate
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-09 22:24:18 +08:00
liwenxiang1 4c19e75ff5 libs/x86_64:Add the setjmp/longjmp function
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 22:24:03 +08:00
yinshengkai 3271142b87 note: print without relying on format strings
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-09 22:23:29 +08:00
yinshengkai b5cf4310cb gote: implement asynchronous printf formatting
Do not format immediately when calling sched_note_printf, but delay formatting until dump trace.
After turning on SYSTEM_NOTE, similar asynchronous syslog functions can be achieved.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-09 22:23:29 +08:00
liwenxiang1 fa48d9e972 drivers/timers:Arch_alarm and arch_timer add up_ndelay interface
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 22:11:03 +08:00
wangmingrong1 47fc3a67f7 sim/kconfig: delete non-existent dependencie
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-09 21:27:47 +08:00