Commit Graph

45573 Commits

Author SHA1 Message Date
YAMAMOTO Takashi
045f8753e2 Documentation: esp32-devkitc: Improve html rendering 2022-05-27 11:04:59 +03:00
Xiang Xiao
3b136771ff sched: Move the call of pthread_mutex_inconsistent to nxtask_recover
to avoid it spread around all possible exit path

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-27 09:39:09 +03:00
Xiang Xiao
d05b031d8d arch/sparc: Remove FILE dump code from _up_dumponexit
since the kernel build can't access the userspace memory
inside other process directly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-26 16:34:56 -03:00
Oki Minabe
f0fb530eaa arch: imx6: add support kernel build and smp
Summary:
- add support BUILD_KERNEL and SMP for imx6
- prepare page tables of cpu1,2,3
- add sabre-6quad:knsh_smp config

Impact:
- imx6

Testing:
- getprime, smp on sabre-6quad:knsh_smp w/ qemu

Signed-off-by: Oki Minabe <minabe.oki@gmail.com>
2022-05-27 01:31:58 +08:00
klmchp
d9e95a8f9b fix devname array size
Fix drivers/mtd/smart.c devname overflow issue.
2022-05-26 10:00:14 -03:00
Xiang Xiao
feb54fc272 sched/pthread: Should call up_exit in pthread_exit
since _exit may kill all sibling thread when
HAVE_GROUP_MEMBERS equal true. Regressed by:
commit 622677d4a1
Author: Ville Juven <ville.juven@unikie.com>
Date:   Mon May 2 15:15:06 2022 +0300

    libc: Implement exit, atexit, on_exit and cxa_exit on the user side

    For CONFIG_BUILD_KERNEL using the sched/task/task_exithook implementation
    will just not work. It calls user code with kernel privileges which is
    a bit of a security issue.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-26 08:16:46 +03:00
chao.an
3f65b562bb arch: inline up_interrupt_context()
inline the up_interrupt_context() to avoid unnecessary stack pushes

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-05-26 04:36:07 +08:00
Alan Carvalho de Assis
d4b0fc9eb4 xtensa/esp32s3: Add basic support to SPI
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
Co-authored-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-25 16:10:29 -03:00
Ville Juven
2d57694855 esp32:wamr_wasi_debug: Remove CONFIG_SCHED_ONEXIT
This file got merged just before merging the patch that removes this
config from the kernel, this cleans it up
2022-05-25 13:44:13 +02:00
Alexey Matveev
684f2cbbac Fix stm32 pwm HAVE_ADVTIM 2022-05-25 12:16:16 +03:00
Ville Juven
5800dd2af5 boards/xxx: Remove CONFIG_SCHED_ATEXIT/ONEXIT from all defconfigs 2022-05-25 15:28:43 +08:00
Ville Juven
a54c3d13f9 sched: Remove SCHED_ATEXIT / SCHED_ONEXIT
Remove the kernel side implementations altogether. These will be
replaced by user land implementations.
2022-05-25 15:28:43 +08:00
Ville Juven
622677d4a1 libc: Implement exit, atexit, on_exit and cxa_exit on the user side
For CONFIG_BUILD_KERNEL using the sched/task/task_exithook implementation
will just not work. It calls user code with kernel privileges which is
a bit of a security issue.
2022-05-25 15:28:43 +08:00
YAMAMOTO Takashi
5d03e1a3b4 esp32-devkitc: Document wamr_wasi_debug config 2022-05-25 14:47:16 +08:00
YAMAMOTO Takashi
1b9694ab98 esp32-devkitc: Add an example config wamr + wasi 2022-05-25 14:47:16 +08:00
Gustavo Henrique Nihei
b4392f7323 xtensa/esp32: Fix leak of semaphores created by Wi-Fi kernel thread
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-25 09:46:30 +09:00
Gustavo Henrique Nihei
18d74dbea0 risc-v/esp32c3: Fix leak of semaphores created by Wi-Fi kernel thread
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-25 09:46:30 +09:00
Gustavo Henrique Nihei
b2d77c0e9c Revert "risc-v/esp32c3: Use onexit to free thread private semaphore"
This reverts commit f5eaf82c93.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-25 09:46:30 +09:00
chao.an
4b308f6cbd mutex/recursive: minor style fix
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-05-25 01:39:15 +08:00
Cis van Mierlo
12469dd15e SSD1306: Added option to force reconfigure display after power off 2022-05-24 23:25:24 +08:00
anjiahao
247a13cc02 include:add recursive lock
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-05-24 22:00:28 +08:00
zhuyanlin
0e478e559f xtensa: coproc: modify coproc_save/restore to macro
As coproc_save/restore only used in context_restore/save.
Use macro instead of function.
Some register use optimize.
Unify with arm/riscv.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-24 14:11:58 +09:00
Abdelatif Guettouche
4896623be2 build: Fix dependencies of kernel targets.
Targets build during the kernel phase did not have their dependencies
specified and thus they were not rebuilt after their dependencies have
changed, for example by changing options in menuconfig.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-05-24 10:45:39 +08:00
Abdelatif Guettouche
2a8b2cad17 esp32_cpuidlestack.c: Remove unnecessary code.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-05-24 08:59:10 +09:00
zhuyanlin
23d35336ad xtensa:esp32: enable cp processor of app core
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-23 22:02:24 +02:00
Petro Karashchenko
7a6253cb89 arch/arm/samv7: Fix PWM operation for single channel mode
The current SAMv7 PWM driver assumes that all PWM channels should
work in sync mode, but that is a partial case of a generic PWM
driver operation.

Start SAMv7 PWM channels in async mode. The sync mode should be
implemeted either using ioctl command or via a separate Kconfig
option.

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-05-24 03:26:13 +08:00
Eero Nurkkala
3ea7d4bab4 risc-v/mpfs: amend OpenSBI to utilize IHC
Linux kernel uses M-mode trap for handling Inter-Hart Communication (IHC).
This patch provides all the required functionalities for this purpose.
Previously, HSS bootloader was required. Now, NuttX is run as the
bootloader providing OpenSBI vendor extensions instead. This setup has
been tested on the following configuration:

 - Hart 0 has NuttX in bootloader mode with OpenSBI
 - Hart 1 unused
 - Hart 2 has NuttX configured at 0xa2000000
 - Hart 3 has U-boot / Linux kernel (at 0x80200000)
 - Hart 4 has U-boot / Linux kernel (at 0x80200000)

Upon startup, NuttX on hart 0 will initialize SD-card driver, loads
the hart 2 NuttX from the SD-card and loads the U-boot to 0x80200000.
Also the nuttx.sbi -binary is loaded from SD-card into address 0x80000000,
which is also marked as reserved area in the Linux kernel device tree (for
the chuck 0x80000000 - 0x80200000).

Hart 2 NuttX waits until Linux kernel (IHC master) is started. After the
initial handshake, RPMsg / virtIO bus along with the IHC may be used for
proper AMP mode.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-05-24 03:25:37 +08:00
Masayuki Ishikawa
84bcb075d7 arch: risc-v: Fix crt0.c if CONFIG_HAVE_CXX is not set
Summary:
- I noticed that rv-virt:knsh64 crashes when it executes the init.
- This commit fixes this issue.

Impact:
- None

Testing:
- Tested with rv-virt:knsh64

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-05-23 21:19:01 +08:00
wangbowen6
200109fd28 arm/tlsr82: optimize the adc driver.
1. Add vbat mode for chip internal voltage sample;
2. Add adc channel config;
3. Using DFIFO2 to get the sample value, follow telink sdk.
4. Add calibration function and config;

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-05-22 23:10:06 +08:00
Ville Juven
621062dc1d MPFS: Implement S-mode head and start function
- Remove S-mode initializations from the M-mode head file, they are not
  required
- Writing mstatus->tvm from S-mode will result in illegal instruction
2022-05-22 15:42:30 +03:00
YAMAMOTO Takashi
5edf5e5585 mm: Add CONFIG_MM_PANIC_ON_FAILURE option
While allocation failure here is not necessarily abnormal enough to
warrant a panic in general, it can be useful in certain situations.
2022-05-21 14:28:41 +08:00
YAMAMOTO Takashi
b05320cac2 mm: Move backtrace stuff into a separate option
The functionality has too much overhead for CONFIG_DEBUG_MM.
2022-05-21 14:28:41 +08:00
YAMAMOTO Takashi
c546c0b647 mm: Do not abort on allocation failue with CONFIG_DEBUG_MM
When allocation failed, it isn't too uncommon for the caller
to fall back to other allocation method.
(eg. esp32 textheap code tries iram heap when an allocation from rtc heap
failed.)
DEBUGASSERT(false) is too much in that case.

This commit removes the DEBUGASSERT, and also makes the heap dump
a separate option.
2022-05-21 14:28:41 +08:00
Karel Kočí
2f03b42bfc boards: arm: kl: keep cfmconfig sections in linker script
This makes sure that this section is present even if LTO is enabled.
2022-05-21 00:03:03 +08:00
Karel Kočí
a74c707da6 arch: arm: armv6-m: fix LTO build
This imports changes from armv7-m.
2022-05-21 00:03:03 +08:00
YAMAMOTO Takashi
f2bc4555bb kmalloc.h: Add kmm_heapmember for !CONFIG_MM_KERNEL_HEAP case 2022-05-20 21:16:42 +08:00
YAMAMOTO Takashi
0b547e2384 esp32: Implement up_textheap_heapmember 2022-05-20 21:16:42 +08:00
YAMAMOTO Takashi
c60bb81387 esp32c3: Implement up_textheap_heapmember 2022-05-20 21:16:42 +08:00
YAMAMOTO Takashi
a9317b1895 cxd56xx: Implement up_textheap_heapmember 2022-05-20 21:16:42 +08:00
YAMAMOTO Takashi
35a5cc27ac include/nuttx/arch.h: Add up_textheap_heapmember 2022-05-20 21:16:42 +08:00
YAMAMOTO Takashi
de27cfeec7 kmalloc.h: Remove extra semicolons 2022-05-20 21:13:21 +08:00
Xiang Xiao
ba6ee2a407 pthread/spinlock: Call up_testsest directly in the flat build
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-20 09:51:53 -03:00
YAMAMOTO Takashi
0a1ac4762a littlefs_stat: Fix directory size
lfs_info.size is only valid for LFS_TYPE_REG.
For directory, use 0 instead of stack garbage.
2022-05-20 15:37:28 +03:00
Ville Juven
91063e85f0 risc-v/vfork: FPU was not saved correctly
The FPU register saving upon vfork entry was missing.

Also added macro that tells the actual size of an FPU reg, instead
of just having a coefficient for qfpu/no-qfpu.
2022-05-20 15:59:24 +08:00
Xiang Xiao
b39d70fe25 libxxmini: Fix error: use of undeclared identifier 'nullptr'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-19 23:23:01 +03:00
Xiang Xiao
efc863217b Fix error: converting the result of '<<' to a boolean always evaluates to true
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-19 23:23:01 +03:00
Xiang Xiao
1067b6afc9 boards/sim: Remove the unnecessary CONFIG_SIM_M32
to enable build on macOS

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-19 23:23:01 +03:00
Xiang Xiao
ce7113387b board/sim: Enable hellocxx in loadable config
to test the support of C++ ELF binary

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-19 23:23:01 +03:00
Xiang Xiao
9d2dae2fd8 sched/wqueue: Add work_timeleft macro to get the left time to start
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-19 23:21:54 +03:00
Xiang Xiao
5b0b4bd586 sched/wdog: Change the return type of wd_gettime from int to sclock_t
to handle 64bits sclock_t correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-19 23:21:54 +03:00