Commit Graph

21778 Commits

Author SHA1 Message Date
Tiago Medicci Serrano
62fbb7f03a esp32s3/ble: Update the name of the interrupt status flags
In order to avoid confusion with other interrupt status flags used
by the system and the common source, rename it to be more specific.
2024-03-29 16:14:27 +08:00
Tiago Medicci Serrano
c07f8ab312 esp32s3: use common espressif code instead of chip-specific.
Most of the functions used to set the peripherals are available for
all Espressif's chips. This commit uses this set of functions and
remove outdated functions that perform the same operations in a
chip level.
2024-03-29 16:14:27 +08:00
Tiago Medicci Serrano
09464ff9bc esp32/[ble/wifi]: Update the wireless drivers
This commit updates the Wi-Fi and the BLE driver of ESP32. Most of
the changes rely on using the common sources and header files for
xtensa-based Espressif's SoCs.

The new Wi-Fi driver supports WPA3-SAE for both Station and SoftAP
mode. BLE's coexistence mode was enhanced according to the latest
libraries.

Please note that other sources required minor changes in order to
be compatible with the common sources.
2024-03-29 16:14:27 +08:00
Tiago Medicci Serrano
007dd34ce8 esp32s3/spiflash: Fix error to pause the other CPU during operation
Whenever a SPI flash operation will take place, it's necessary to
disable the cache and run no code from the flash. This includes
pausing the other CPU (when `CONFIG_SMP=y`). This commit prevents
an error to occur when the CPU core is evaluated before the task
is increased to the max priority.
2024-03-29 16:14:27 +08:00
Tiago Medicci Serrano
78fbc2fc64 esp32/spiflash: Fix error to pause the other CPU during operation
Whenever a SPI flash operation will take place, it's necessary to
disable the cache and run no code from the flash. This includes
pausing the other CPU (when `CONFIG_SMP=y`). This commit prevents
an error to occur when the CPU core is evaluated before the task
is increased to the max priority.
2024-03-29 16:14:27 +08:00
chao an
c7770fddfe qemu/armv7a: add Symmetric Multi-Processing (SMP) support
Bringup Co-Processor by PSCI(Power State Coordination Interface)

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-28 19:30:26 +08:00
chenwen@espressif.com
ffc7442af2 xtensa/esp32s3: Add ESP32-S3 AES driver
1. Support AES-128/AES-256 encryption and decryption

Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-03-28 09:34:04 +08:00
xuxin19
741de4b450 cmake:init protected-mode for CMake build
adjust link options for userspace elf
specify system libs and apps lib to only link with nuttx target in flat build mode

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-03-27 23:01:08 +08:00
chenwen@espressif.com
2911c3aed6 xtensa/esp32s3: Add 16-byte-align SPI-Flash encryption write
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-03-27 17:10:32 +08:00
Dong Heng
397396c587 xtensa/esp32s3: Fix one page program span over 2 pages
One page program can't span over 2 pages.
2024-03-27 17:08:17 +08:00
David Sidrane
3932cb2a3b stm32h7:Serial Fix Logic error in up_dma_txavailable 2024-03-26 20:11:49 -03:00
Tiago Medicci Serrano
075b0e5ac0 esp32s2: Update libc stubs to properly acquire/release locks.
Avoid using static mutex and recursive mutex as the resource to be
acquired/release. Instead, create a specific lock for each call if
it does not exist.
2024-03-26 13:53:39 -03:00
Tiago Medicci Serrano
d56e6de628 esp32: Update libc stubs to properly acquire/release locks.
Avoid using static mutex and recursive mutex as the resource to be
acquired/release. Instead, create a specific lock for each call if
it does not exist.
2024-03-26 13:53:39 -03:00
Tiago Medicci Serrano
44e2e9011f esp32s3: Update libc stubs to properly acquire/release locks.
Avoid using static mutex and recursive mutex as the resource to be
acquired/release. Instead, create a specific lock for each call if
it does not exist.
2024-03-26 13:53:39 -03:00
Eren Terzioglu
f5030573b7 esp32[c3|c6|h2]: Fix filesystem test support 2024-03-26 20:56:48 +08:00
Eren Terzioglu
d322140464 boards/esp32c6: Add esp32c6 DevKitM board support 2024-03-26 09:43:08 +08:00
Eren Terzioglu
cfcedab76b arch/espressif: Fix esp32c6 strange characters on boot 2024-03-26 09:39:12 +08:00
Anthony Merlino
d808ed450c stm32h7: Fix race condition in ADC interrupt handling 2024-03-26 01:20:48 +08:00
Yanfeng Liu
56b125bb82 risc-v/arch.h: revising comments
This revises comments about page tables to help understanding.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-25 20:39:24 +08:00
Ville Juven
6a6798ed31 arch/arm64: Add the head obj to libarch.a as well
On other platforms libarch.a contains the head object. Some projects
depend on this fact so let's provide the head object in the archive here
as well.
2024-03-25 20:38:53 +08:00
GC2020
8a08190394 Modify the enable logic of FDCAN (all STM32H7 series are FDCAN pins) 2024-03-25 01:36:52 +08:00
Ville Juven
738bdb95b7 arm64_head.S: Add explicit input section for __start
As __start must be placed at a precise location, a separate, explicit
input section is needed to guarantee this.

Why is this an issue ? NuttX uses --entry=__start which puts __start in
its correct location, but out-of-tree builds won't work, so it more robust
to use an explicit section for the startup code and enforce its placement
in the linker script.
2024-03-23 00:21:54 +08:00
Ville Juven
00986bdd09 arm64/imx9: Add register definitions for LPTMR 2024-03-22 21:37:35 +08:00
Ville Juven
0b8f6af3d6 arm64/imx9: Add register definitions for LPIT 2024-03-22 21:37:35 +08:00
Ville Juven
d2373f4569 arm64/imx9: Add CCM (Clock Controller Module) 2024-03-22 21:37:35 +08:00
ligd
a1836de09a fdt: move fdx_xx extend APIs from boards to drivers
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-22 18:51:33 +08:00
Jukka Laitinen
a54f7ffaa8 arch/arm64/src/common: Remove void * arithmetic
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-03-22 09:48:31 +08:00
simbit18
ac2021b906 Fix Kconfig style
Replace help => ---help---
Remove spaces from Kconfig
Add comments
2024-03-21 22:28:49 +08:00
Ville Juven
7a2edf9414 stm32f7/stm32_foc.c: Set .info_get to foc_lower_ops
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
2024-03-21 19:53:29 +08:00
chao an
d90e1cb7b4 arch/tricore: add spinlock support
add atomic test and set operation

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-21 18:47:14 +08:00
Jukka Laitinen
1f6079814a arch/risc-v/src/common/supervisor/riscv_perform_syscall.c: Record the currently running task in risc-v syscall
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>
2024-03-21 18:45:41 +08:00
Jukka Laitinen
0dee4eb7f0 arch/arm/src/imxrt/imxrt_start.c: Clear CONTROL register at start to make sure we use MSP as the stack pointer
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>
2024-03-21 18:45:00 +08:00
Jukka Laitinen
f1c877d67d arch/risc-v/src/common/riscv_exception.c: Just _exit the user task causing an exception
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>
2024-03-20 18:03:15 -03:00
Stuart Ianna
401b3e682c arch/risc-v/litex: Allow FDT to be passed from previous boot change.
Allows a flattened device tree to be passed from either openSBI or the LiteX bios. The FDT is registered can be used, if supported.
2024-03-20 20:53:17 +08:00
Ville Juven
46bd210ae4 arm64/imx9: Add support for imx9 series SoMs, imx93 implemented
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
2024-03-20 20:13:14 +08:00
Ville Juven
8d52020fe1 arm64_internal.h: Expose prototype for arm64_lowputc
Useful procedure in many places.
2024-03-20 20:13:14 +08:00
Ville Juven
2bed7c4646 arm64_mmu: Add data synchronization barrier after page tables are written
The page tables must be committed to system memory before we can proceed
enabling the MMU. ISB() is not enough to do this.
2024-03-19 15:46:51 -03:00
ligd
327d0789e4 arch: add ARCH_TRUSTZONE_DISABLED choice
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>
2024-03-19 18:24:42 +09:00
zhangyuan21
9c0d2e1a3c armv7-a/gicv2: move IRQ to group1 and group0 as the FIQ
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>
2024-03-19 18:24:42 +09:00
Jorge Guzman
8e0bf9a0b4 stm32h7/linum-stm32h753bi: Add buzzer support
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-03-18 13:48:59 +08:00
Yanfeng Liu
ea8682572c build/cmake: add initial KERNEL mode support
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>
2024-03-15 16:21:23 +08:00
xuxin19
2c9d46f176 cmake:enable libxx for CMake build
distinguish whether to add the CXX header file search path
according to the target Language.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-03-15 01:28:53 +08:00
Yanfeng Liu
ea7dbdc8ac risc-v/k230: fix k230_hart_is_big issue
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>
2024-03-14 00:05:06 +08:00
Yanfeng Liu
1fa2559f00 riscv/k230: add ARCH_HAVE_RESET revise logging
This patch adds board_reset and revises debug logging.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-13 13:46:02 +08:00
Michał Łyszczek
87cec8d5c7 stm32f40xxx_pinmap: add 3rd alternate mapping for USART6
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>
2024-03-12 10:09:59 -03:00
Michał Łyszczek
02dc6fa219 stm32_serial.c: fix compilation of onewire driver mode
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>
2024-03-12 13:45:41 +01:00
Marco Casaroli
d048caf1d2 arch/esp32 add openeth mac driver
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
2024-03-12 08:31:06 -03:00
p-szafonimateusz
768c5a28a1 arch/x86_64: move common Make.defs to common
cosmetic change to simplify intel64 Make.defs

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-03-12 08:30:37 -03:00
chenwen@espressif.com
277ca97b44 xtensa/esp32: Fix wrong interrupt number
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-03-12 14:36:50 +08:00
Nicolas Lemblé
63782c7ff2 arch/xmc4 Add tickless support 2024-03-11 13:56:07 -03:00