This fixes build error (Werror):
Error: chip/stm32_foc.c:1918:12: error: 'stm32_foc_info_get' defined but not used [-Werror=unused-function]
1918 | static int stm32_foc_info_get(struct foc_dev_s *dev, struct foc_info_s *info)
| ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
If a context switch occurs in syscall, the g_running_task need to be recorded for assert logic.
This copies the logic from arm platforms
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
When entering the function from an external bootloader, the CPU could be using PSP. But the following
code expects MSP to be in use.
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
We shouldn't panic the kernel when a user task excepts, we can just kill the user task and
it's children. Do this by returning to _exit() in kernel context.
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
Adds support for NXP i.MX9-series System-on-Module chips.
- Support for i.MX93 is added
- CPU is Cortex A55 / ARMv8.2A
- The chip also contains a Cortex M33, but no support is provided
- Supported drivers include lpuart only for now
We can decide whether use trustzone
After this patch, we can support the following mode:
ARCH_HAVE_TRUSTZONE ARCH_TRUSTZONE_DISABLED ARCH_TRUSTZONE_SECURE ARCH_TRUSTZONE_NONSECURE
Without Security Extensions n n n n
CHIP have NO trustzone
With Security Extensions y y n n
Only one bin in sec mode
With Security Extensions y n y n
TEE bin in sec mode
With Security Extensions y n n y
REE bin in non-sec mode
Signed-off-by: ligd <liguiding1@xiaomi.com>
Purpose: make the the os crash when busyloop with interrupt disable
Follow the arm gicv2 spec, if we want to use the IRQ and FIQ
simultaneously when not using the processor Security Externsions.
We should:
1. IRQ to Group 1 and FIQ to Group 0;
2. Set CICC_CTLR.FIQEn to 1;
Then in NuttX:
1. implement the arm_decodefiq and directly crash in it;
2. provide interface to change the IRQ to FIQ, e.g. change the
watchdog IRQ to FIQ, so the watchdog can trigger even with the
interrupt disabled (up_irq_save() called);
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
Currently only FLAT mode development can enjoy cmake build system. This
patch tries to add initial kernel mode support. It can build NuttX kernel
and libproxies.a, the latter will be further checked though.
This can already help to build an AMP remote node image as it can share
userland apps living in the AMP master node.
Major changes:
- in top folder:
- CMakeLists.txt adjust for KERNEL mode, separate from PROTECTED mode.
- in `syscall`:
- CMakeLists.txt add mksyscall target for stubs/proxies generation
- in `syscall/stubs`:
- CMakeLists.txt use dependency to mksyscall
- in `syscall/proxies`:
- CMakeLists.txt use dependency to mksyscall
- in `arch`:
- CMakeLists.txt separate KERNEL from PROTECTED mode.
- in `arch/risc-v/src`:
- CMakeLists.txt separate from PROTECTED mode, add sub folders.
- in `arch/risc-v/common`:
- CMakeLists.txt add sources and sub-folders for KERNEL mode.
- in `arch/risc-v/k230`:
- CMakeLists.txt add sources for KERNEL mode.
- in `boards/risc-v/k230/canmv230/src`:
- CMakeLists.txt adjust k230 specific scripts for kernel mode.
New additions:
- in `arch/risc-v/src/nuttsbi/` add CMakeLists.txt
- in `arch/risc-v/src/common/supervisor/` add CMakeLists.txt
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This patch fixes the issue that k230_hart_is_big() doesn't work in
S-mode. It also adds convenient debug macros to ease debugging process
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
Some stm32 has alternate USART6 pinout on G9/G14 but others have it
on A12/A11. Unfortunately it's very difficult to make proper ifdefs for
this since position is based on package (and pincount) and not chip
itself. Creating such list would take a lot of time. Because of that
I just added another possible config for this pin and moved responsibility
of proper selection onto board code.
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
Onewire driver wants to use "struct up_dev_s *priv", which is extracted
from "struct uart_dev_s" and "struct inode". But inode and uart dev are
only declared when TERMIOS or BSDCOMPAT is also enabled. Without these
driver fails to compile with missing declaration errors. Adding some
additional "#if defined()" to these declarations fix the issue and driver
compiles and works properly (tested with ds18b20 temp sensor).
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
This driver is used with QEMU, to make it possible
to use networking.
This is not the MAC in ESP32, however, it can be used with QEMU.
The code was shamelessly copied from 31dac92e5f
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>
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>
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>
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>
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>
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>