Commit Graph

52676 Commits

Author SHA1 Message Date
Eren Terzioglu
11efa29192 esp32h2/scripts: Add simpleboot support for esp32h2 2024-03-09 11:53:47 +08:00
Eren Terzioglu
11a061cad8 esp32c6/scripts: Add simpleboot support for esp32c6 2024-03-09 11:53:47 +08:00
p-szafonimateusz
0fe777abd4 arch/intel64: move timer frequency configuration to common files
this logic can be common for intel64 chips

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-09 11:52:29 +08:00
p-szafonimateusz
636b2309e4 arch/intel64: cosmetic changes for TSC
cosmetic changes for TSC:
- remove unused variables
- add g_ prefix to global variables

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-09 11:52:29 +08:00
p-szafonimateusz
0a24f60e1b arch/intel64: select the system clock source with choice option
this will make it easier to add other sources as system clock

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-09 11:52:29 +08:00
Yanfeng Liu
02d097ac4d riscv/k230: minor revision on PMP settings
This patch simplifies PMP handling for K230 using common APIs.
It also uses `g_misa` variable to expose the MISA issue.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-09 11:52:13 +08:00
p-szafonimateusz
b1fd3da0f6 intel64/intel64_irq.c: support interrupts up to 255
From now all intel64 interrupts are supported.
Required step towards MSI/MSI-X

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-08 20:18:39 -03:00
p-szafonimateusz
2d3c9e00ab intel64/intel64_irq.c: check if IRQ is busy before using
check if interrupt is busy when IRQCHAIN is disabled

this allows user to catch configuration errors and fail early when the
already busy vector is reused

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-08 20:18:39 -03:00
p-szafonimateusz
53aef8e93d arch/x86_64: add SSE instruction support
at default x86_64 supports SSE, SSE2, this commit adds support for
SSE3, SSSE3, SSE41, SSE42 and SSE4A

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-08 08:51:20 +08:00
p-szafonimateusz
8fe76e1271 x86_64/x86_64_initialzie.c: remove up_calibratedelay
This function is not used anywhere.
For udelay calibration we have the calib_udelay app

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-08 08:50:35 +08:00
p-szafonimateusz
83abf9bd27 arch/x86_64: add addrenv support
this commit adds simple addrenv support for x86_64

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-08 08:50:35 +08:00
p-szafonimateusz
7d95bec148 qemu-intel64: move PCI initialization back to board logic
this partly revert 4123615621 which works OK for PCI serial and network cards
but breaks QEMU EDU due to usage of sem and usleep in IDLE thread context.
Another solution will be provided later.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-07 15:03:40 -03:00
chao an
beb2af8378 sched/group: skip child wait if here is only self in member list
Skip the child wait if here is only self in member list,
since the members of the task group should be 1 if task exit.

Fix Regression issue that the task could not terminate normally.

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-07 22:53:19 +08:00
chao an
2b7742fc08 binfmt/task/member: remove invaild membership reverse
As long as the process id reversed between parent and child,
the process member ship will automatically reversed.

Fix Regression by PR #11848:

| commit ec08031e4b
| Author: chao an <anchao@lixiang.com>
| Date:   Wed Mar 6 10:13:47 2024 +0800
|
|     sched/group: change type of task group member to single queue
|
|     Change the type of task group member to single list chain to
|     avoid accessing the memory allocator to improve the performance
|
|     Signed-off-by: chao an <anchao@lixiang.com>

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-07 22:53:19 +08:00
Xiang Xiao
1ba065db87 drivers/pipe: Change to the block mode by file_ioctl(FIONBIO)
it's simpler and safer than file_fcntl(F_SETFL)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-07 10:09:35 -03:00
Xiang Xiao
64ea027b1a Replace PRIxPTR with %p and remove the cast of (uintptr_t)
The cast of (uintptr_t) is not necessary, and it is better to use %p

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-07 09:59:42 -03:00
Yanfeng Liu
cc389b1984 riscv/nuttsbi: revise PMP manipulation in NuttX SBI
Current NuttX SBI assumes empty PMP settings but that is not always
true, for example some bootloaders may have PMP entries locked before
handling over to NuttX. This patch revises it by not using hardcoded
PMP region number.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-07 09:58:55 -03:00
Tiago Medicci Serrano
522c5c0eac boards/esp32: Increase init task stack size to 3072
This is done to avoid casual stack overflows. Especially after
PR #11777, that increased stack usage.
2024-03-07 20:47:40 +08:00
chenwen@espressif.com
53f50c8183 xtensa/esp32s3: Configure DMA maximum buffer size based on access to different RAM
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-03-07 13:32:28 +08:00
chao an
ec08031e4b sched/group: change type of task group member to single queue
Change the type of task group member to single list chain to
avoid accessing the memory allocator to improve the performance

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-07 12:39:29 +08:00
chao an
eb6fe17baa nuttx/list/queue: add helper macro list/sq/dq_is_singular()
add helper macro list/sq/dq_is_singular() to tests whether a list has just one entry.

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-07 12:39:29 +08:00
chao an
d29748258b fs/inode: add pre-allocated task files to avoid allocator access
Pre-allocated files to avoid allocator access during thread creation
phase, For functional safety requirements, increase
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK could also avoid allocator access
caused by the file descriptor exceeding the limit.

For Task Termination, the time consumption will be reduced ~3us (Tricore TC397 300MHZ):
10.65(us) -> 7.35(us)

NOTE:
This commit will not waste of extra heap, just pre-allocates the list of files for task_group.

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-07 10:58:55 +08:00
hujun5
236ec9844f fs: dup3 should pass the fdcheck & fdsan
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-07 09:08:48 +08:00
ligd
9f51c47c10 fs: remove un-useful memcpy() in nx_close_from_tcb()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-07 09:08:48 +08:00
ligd
e1cd082c29 fs: enhance dup3() mulit-threads saftey
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-07 09:08:48 +08:00
ligd
60b25556d4 fs: enhance file_allocate_from_tcb() mulit-threads saftey
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-07 09:08:48 +08:00
hujun5
577eb47966 fdcheck: Enable fdcheck to automatically detect ownership of fd
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-03-07 09:08:48 +08:00
Jorge Guzman
4b5ad956c3 stm32h7/linum-stm32h753bi: Add support to eeprom using the i2c3
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-03-07 01:55:56 +08:00
Sammy Tran
b4b7710c63 Disable interrupt during FTFC operation 2024-03-06 13:31:48 -03:00
chao an
89bd6ab74a sched/pthread: fix memory leak of pthread_tcb_s
pthread tcb should be released appropriately

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-06 20:37:06 +08:00
chenwen@espressif.com
09960c5c7d xtensa/esp32s3: Fix the issue of erasing a wide range of flash sectors
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-03-06 18:13:20 +08:00
Yanfeng Liu
850e64bc19 riscv/k230: remove unnecessary ARCH_LAZYFPU from defconfigs
The ARCH_LAZYFPU is unnecessary for risc-v so we can remove them from
the defconfigs.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-06 18:10:48 +08:00
chao an
6233680cad nuttx/sched: remove unused group link node
This change is missing from the below commit:

| commit 7cb1f3b3c0
| Author: chao an <anchao@lixiang.com>
| Date:   Tue Mar 5 10:23:30 2024 +0800
|
|     sched/group: replace group_findbypid to task_getgroup
|
|     Task group could find from process id, replace group_findbypid to
|     task_getgroup to simplify the search logic
|
|     Signed-off-by: chao an <anchao@lixiang.com>

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-06 13:32:02 +08:00
Yanfeng Liu
a66c7c3ee1 comments/docs: fix typos in comments
This fix some typos in comments.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-06 13:31:50 +08:00
trns1997
54e9e582d5 Use C++ standard lib from toolchain
Signed-off-by: trns1997 <trns1997@gmail.com>
2024-03-06 08:42:44 +08:00
ligd
113ab704c7 goldfish & qemu: handle MMU table and CONFIG_RAM_END
Reproduce:

configure:
./tools/configure.sh qemu-armv7a:nsh -j8
open kasan:
CONFIG_MM_KASAN=y
run:
qemu-system-arm -cpu cortex-a7 -nographic -machine virt,virtualization=off,gic-version=2 -net none -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx
error:
run hanged

Rootcause:

In Qemu armv7a, the ram-end reserved for MMU PGTABLE:

And the up_allocate_heap()  directly use the ram-end for heap in arch/arm/src/common/arm_allocateheap.c

*heap_size  = CONFIG_RAM_END - g_idle_topstack;

Then they are conflict.
Usually, we won't use the heap end, so can't find the error.
BUT, the KASAN will use the heap end for shadow, so found the error.

Resolve:

up_allocate_heap() consider of MMU, re-define the RAM_END at chip.h

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-06 09:26:44 +09:00
raiden00pl
a20b3e8335 arch/nrf{52|53|91}/spi: fix error message
wrong parameters were passed to spierr()
2024-03-06 00:50:00 +08:00
Eren Terzioglu
8b931b43b1 boards/esp32c6: Remove sotest config for esp32c6
boards/esp32c3: Add ostest config for esp32c3
boards/esp32h2: Add ostest config for esp32h2
2024-03-06 00:49:50 +08:00
chao an
8592e7e009 sched/task: save argument counter to avoid limit check
The maximum startup parameters have been checked accordingly in nxtask_setup_stackargs(),
let us save argument counter to avoid limit check.

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-05 22:25:28 +08:00
chao an
0902231deb drivers/sensors: fix comments typo
Signed-off-by: chao an <anchao@lixiang.com>
2024-03-05 22:25:28 +08:00
chao an
7cb1f3b3c0 sched/group: replace group_findbypid to task_getgroup
Task group could find from process id, replace group_findbypid to
task_getgroup to simplify the search logic

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-05 22:24:52 +08:00
chao an
dfd1e38b40 sched/environ: check envcp validity before hold sched_lock()
check envcp validity before hold sched_lock() to avoid unnecessary schedule lock

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-05 22:24:14 +08:00
Marco Casaroli
73c4f2f1e7 fix(esp32s3_spiflash_mtd): debug type specifiers
These log messages are wrong if we use CONFIG_FS_LARGEFILE.
2024-03-05 22:23:50 +08:00
ligd
d45a45da94 sched.h: add empty realize when NO CONFIG_SMP
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-05 17:50:58 +08:00
ligd
27de65edc0 sched.h: fix CPU_EQUAL(s1, s2) write error
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-05 17:50:58 +08:00
Michal Lenc
44a087111d samv7: add support for USART TX DMA transfers
This commit adds support for TX DMA transfers for USART peripheral. Code
refactor in sam_serial.h was also required in order to have correct
defines for all possible cases (both RX and TX DMA used, just one used,
none used).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-03-05 09:48:03 +08:00
Tiago Medicci Serrano
dcad39a962 arch: Fix style warnings regarding included header files
This commit fixes style warnings regarding including header files
outside the `Included Files` section.
2024-03-05 09:45:49 +08:00
Tiago Medicci Serrano
658dd94863 procfs: Change variable name to ease debugging 2024-03-05 09:45:49 +08:00
Tiago Medicci Serrano
e287ed9090 documentation: implement on-demand paging for RISC-V devices
It documents how the on-demand paging was implemented for RISC-V
devices and how it can be extended to other architectures.
2024-03-05 09:45:49 +08:00
Tiago Medicci Serrano
c67502d9b4 riscv: Implement page-fault exception and on-demand paging
When an application is being loaded `up_addrenv_create ` calls
`create_region` to create the address environment. Only the first
entry is mapped when the region is created. Virtual memory that is
not mapped will trigger an exception when accessed. Other memory
pages are allocated and mapped on-demand. This enables setting
larger heap and stack for the process without compromising the
overall system memory.
2024-03-05 09:45:49 +08:00