Commit Graph

53358 Commits

Author SHA1 Message Date
Yanfeng Liu
28eaa08cbc arch/riscv: fix PMP in sbi_start()
This fixes PMP setting for open everything before going S-mode, which
has been broken since pull/12398.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-06-28 21:30:53 +08:00
hujun5
13bbea0f1c arm64: inline up_cpu_index
reduce the time consumed by function call

test:
We can use qemu for testing.
compiling
make distclean -j20; ./tools/configure.sh -l qemu-armv8a:nsh_smp ;make -j20
running
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-06-28 21:29:33 +08:00
p-szafonimateusz
c6170286ca arch/intel64: add cpu specific data and per-cpu interrupt stacks
Use GS base regsiter to store reference to CPU private data.
Then we can easily refer to private CPU data using the GS segment.

Required for SMP support.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-06-28 09:40:32 -03:00
yanghuatao
87dfcd1020 include/sched.h: CPU_XXX macros can also be used without CONFIG_SMP
Allow CPU_XXX macros to be used without CONFIG_SMP=y

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
Co-authored-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-06-28 20:35:54 +08:00
Yanfeng Liu
cd57bc16c7 riscv/pmp: add all region in NAPOT
This allows using 0 base and size to depict the whole region.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-06-28 17:54:46 +08:00
SPRESENSE
34426416e7 arch: cxd56xx: Add audio sources to CMakeLists.txt
Add audio source files to CMakeLists.txt.
2024-06-28 17:53:56 +08:00
SPRESENSE
b4d6e585c2 arch: cxd56xx: Add gnss source to CMakeLists.txt
Add a gnss source file to CMakeLists.txt.
2024-06-28 17:53:56 +08:00
SPRESENSE
573fb2b016 drivers/audio: Remove useless descriptions from CMakeLists.txt
Remove useless descriptions from CMakeLists.txt.
2024-06-28 17:53:56 +08:00
SPRESENSE
00c821eaa7 boards: cxd56xx: Fix CMakeLists.txt
Fix CMakeLists.txt to match Make.defs.
2024-06-28 17:53:56 +08:00
SPRESENSE
aadee2cb1d boards: cxd56xx: Add CMakeLists.txt for the specific drivers
Add CMakeLists.txt for the specific drivers.
2024-06-28 17:53:56 +08:00
Eren Terzioglu
dcea703bae esp32[c3|c6|h2]: Add GDMA support 2024-06-28 17:52:56 +08:00
Eren Terzioglu
43a4f2fbea esp32[c3|c6|h2]: Add BMP180 sensor support 2024-06-28 17:27:46 +08:00
Eren Terzioglu
dda55419f9 esp32[c3|c6|h2]: Add I2C master support 2024-06-28 17:27:46 +08:00
Henry Rovner
63375bf9cd BL808: Replace courier with M0 interrupt controller
It turns out that the D0 core of the BL808 has an IRQ that represents all interrupt sources for the M0 core. This change uses this IRQ to access these sources, eliminating the need for IPC between M0 and D0.
2024-06-28 17:23:02 +08:00
Henry Rovner
7d2dbc00f6 Revert "Add courier system driver"
This reverts commit 50dd04c0f6832a73a6392c54b6580978e418f727.
2024-06-28 17:23:02 +08:00
SPRESENSE
8c816dee14 cmake: Fix build failure when -DNUTTX_APPS_DIR is specified
Fix cmake build failure that apps directory is not found
when -DNUTTX_APPS_DIR is specified.
2024-06-28 17:19:22 +08:00
p-szafonimateusz
97726d9747 arch/x86_64/intel64/intel64_rtc.c: fix compilation
fix missing reference to comm_region->tsc_khz and
fix 'defined but not used' warnings in arch/x86_64/intel64_rtc.c

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-06-28 09:47:46 +02:00
Alan Carvalho de Assis
9cfe255a81 Fix allocated memory test
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-06-28 09:30:42 +02:00
p-szafonimateusz
09146beee9 x86_64: hide --whole-archive behind Kconfig option
Hide --whole-archive behind Kconfig option for x86.
This option is not needed and breaks ELF modules build.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-06-28 02:31:53 +08:00
yanghuatao
7e342b3422 arch: Add --whole-archive linker option for some of architectures
Add Kconfig option that enable --whole-archive linker option for some of architectures

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-06-28 02:31:40 +08:00
p-szafonimateusz
7afee44c22 arch/x86_64: addrenv should add offset only for RAM region
addrenv should add LOAD offset only for RAM region, the rest of memory is maped 1:1

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-06-28 02:31:09 +08:00
p-szafonimateusz
c932fe3045 libm/newlib: disable optimization for sincos
Disable sincos optimization for all functions in this file,
otherwise gcc would generate infinite calls.
Refer to gcc bug 46926.
-fno-builtin-sin or -fno-builtin-cos can disable sincos optimization,
but these two options do not work inside optimize pragma in-file.
Thus we just enforce -O0 when compiling this file.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-06-28 01:26:18 +08:00
p-szafonimateusz
23b2f96c9d libm/libm: disable optimization for sincos
Disable sincos optimization for all functions in this file,
otherwise gcc would generate infinite calls.
Refer to gcc bug 46926.
-fno-builtin-sin or -fno-builtin-cos can disable sincos optimization,
but these two options do not work inside optimize pragma in-file.
Thus we just enforce -O0 when compiling this file.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-06-28 01:26:18 +08:00
p-szafonimateusz
c5d1eaae72 arch/intel64: get TSC frequency only when not provided from Kconfig
on ACRN hypervisor obtaining frequency from CPUID seems to be broken,
so we have to specify this value from Kconfig.

If frequency autodetection is enabled but the returned data are
incorrect - crash early.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-06-27 11:49:50 -03:00
rushabhvg
05842e726f risc-v/bl808: Add GPIO Driver
- This PR adds the GPIO Driver for BL808 SoC. This will be used by the upcoming LED Driver for Ox64 Board.
- The BL808 GPIO Driver was derived from the NuttX Driver for BL602 GPIO

Co-Authored-By: Lup Yuen Lee <luppy@appkaki.com>
2024-06-27 11:49:25 -03:00
Filipe Cavalcanti
365e9e967c arch/xtensa: add support for capture driver on ESP32 and ESP32|S3|
Squashed:
Initial settings for MCPWM Capture on board level
Created lower half files - compilation ok
Using capture debug features. Simple example on fops works
Successful duty and freq calculation
Documentation update
Fixed and added interupt capabilities for all 3 capture channels
Cleaned defconfig
Renamed macros, added S3 options and moved arch source to common dir
Added support for ESP32S3
Added capture example to defconfig and renamed
2024-06-27 18:14:59 +08:00
Jani Paalijarvi
92747b7529 drivers/net/ksz9477: Add port mirroring support
Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2024-06-27 18:09:57 +08:00
Tiago Medicci Serrano
f594859d99 esp32s3/wifi: Fix bug related to IOB off-loading with SMP
For now, IOB off-loading in the wireless driver was removed because
it is not compatible with SMP-enabled devices, which is valid for
ESP32-S3. The performance gain by keeping the IOB off-loading in
the wireless drivers is not exceeded by keeping the flat buffer
approach and enabling `CONFIG_SMP=y`.
2024-06-27 18:09:46 +08:00
Tiago Medicci Serrano
e913828955 espressif: Enable SMP (when applicable) and iPerf for sta_softap
- Enable SMP by default (when the device supports it);
- Increase IOB buffers;
- Enable iPerf;

These changes enable testing the device throughput easily.
2024-06-27 18:09:46 +08:00
hujun5
ddf1410312 sched/signal: There is no need to use sched_[un]lock
purpose:
1 sched_lock is very time-consuming, and reducing its invocations can improve performance.
2 sched_lock is prone to misuse, and narrowing its scope of use is to prevent people from referencing incorrect code and using it

test:
We can use qemu for testing.
compiling
make distclean -j20; ./tools/configure.sh -l qemu-armv8a:nsh_smp ;make -j20
running
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

We have also tested this patch on other ARM hardware platforms.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-06-27 11:51:16 +08:00
Huang Qi
a14d94c548 gdbstub: Minor style fix
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-06-26 10:19:14 -03:00
Peter van der Perk
6899add8e3 imxrt: imxrt11xx set core clock to 1p15v regardless of ocotp 2024-06-26 09:08:32 -04:00
zhanghongyu
e14ae3e681 pthread: add pthread_self/pthread_gettid_np function
explicitly defined functions can support assignment as function pointers

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-06-26 17:40:55 +08:00
Huang Qi
c3b05bde44 riscv: Improve exception and irq mapping
Allow chip to define the custom exception on demand.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-06-26 09:07:52 +08:00
Henry Rovner
d5657196d5 ox64:nsh - normalize defconfig after adding UART parameters 2024-06-26 09:06:38 +08:00
Henry Rovner
023bd08faa BL808: Add support for UARTs 0-2 and serial configuration
This commit modifies the existing serial driver to add support for the remaining UARTs on the BL808. It also introduces support for setting baud rate, character length, stop bits, parity, flow control and which serial port acts as the console.
2024-06-26 09:06:38 +08:00
Tiago Medicci Serrano
126c83a7dc espressif: Fix error while evaluating Wi-Fi task ID
Use `nxsched_gettid` instead of `nxsched_getpid`. Previously each
kernel thread was modelled as a task, so the pid is the same of the
kthread id. Now, with shared kthread group (introduced by #12320),
the pid of all kthreads will be 0 by design in shared group.
2024-06-25 18:40:27 -03:00
xuxin19
0e8aecfe64 cmake:reuse OpenAMP own CMake script for CMake build
Check whether 64-bit atomic is supported

Co-authored-by: xuxin19 <xuxin19@xiaomi.com>
Co-authored-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-06-26 00:22:03 +08:00
anjiahao
1b2ad4ff7d gdbstub: fix typo
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-06-26 00:20:58 +08:00
buxiasen
756d9508bc mm: mm_threshold perfer from init
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-06-26 00:20:44 +08:00
Yanfeng Liu
c8f18767de sched/tcb: fix 12320 regression
This patch attempts to fix regressions reported for pull# 12320.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-06-26 00:20:26 +08:00
raiden00pl
e01fb50541 compiler.h: rename CMSE extension attribute macros
rename CMSE extension attribute macros to avoid conflicts with 3rd party code:

  cmse_nonsecure_entry -> tz_nonsecure_netry
  cmse_nonsecure_call -> tz_nonsecure_call
2024-06-25 14:58:36 +02:00
dependabot[bot]
9d0894fd51 build(deps): bump docker/build-push-action from 5 to 6
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-25 16:42:24 +08:00
buxiasen
cf574fa466 mm: add mm_initialize_pool, make pool more flexible
now allow enable pool for extra heap, and disable umm/kmm pool.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-06-25 16:42:06 +08:00
Tiago Medicci Serrano
50aeea2dc0 mm/iob: Simplify IOB alloc/free logic
- `g_iob_sem.semcount` must be equal to the total number of free IOBs.
It can also be negative if there are no free IOBs and there are threads
waiting for an IOB.
- g_throttle_sem.semcount represents the number of IOBs available for
throttled IOB allocations. Like any other semaphore, it should only go
negative if there is a thread waiting for it.
- Both semaphores are related to the same resource (free IOBs), hence,
they must be incremented/decremented simultaneously:
  - Whenever a IOB buffer is freed, if a thread is waiting for a
non-throttled IOB or a thread is waiting for a throttled IOB and we
have at least `CONFIG_IOB_THROTTLE` buffers available, the IOB is put
in the committed list (`g_iob_committed`). Otherwise, it is put in the
common free list (`g_iob_freelist`).
  - `g_iob_sem` is always incremented when an IOB buffer is freed, but
`g_throttle_sem` is incremented only if we have at least CONFIG_IOB_THROTTLE
buffers free.
  - Both semaphores are posted with the schedule locked to avoid any
mismatches in the semaphores count.
  - If a task is waiting for an IOB semaphore (`iob_allocwait`) is
awakened and would check the `g_iob_committed`. The highest priority
task waiting for a semaphore will be awakened first.
2024-06-25 15:21:00 +08:00
Xu Xingliang
69d8a17dda fs: add backtrace to where file opens
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-06-24 23:53:59 +08:00
Huang Qi
add8b71fee serial/gdbstub: Change GDBSTUB_ to GDB_
Fix nameing convention inconsistent

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-06-24 23:51:43 +08:00
anjiahao
3c7162338d gdbstub:support gdbstub_debugpoint_add/remove smp call
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-06-24 23:51:43 +08:00
Xiang Xiao
e9558a88cd gdbstub: Change GDBSTUB_ to GDB_
Make the naming convention more consistent

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-06-24 23:51:43 +08:00
Stuart Ianna
3b4626acc8 fs/fat/fs_fat32.c Return EOF when reading past the end of the file.
When fseek is used to set the file pointer past the end of the file,
fread should return EOF. See #12496.
2024-06-24 22:14:07 +08:00