Commit Graph

21896 Commits

Author SHA1 Message Date
nuttxs
8d3d93e001 Add ESP32-S3 ADC driver 2024-05-07 01:12:05 +08:00
simbit18
0e67a79b94 fix nxstyle
corrected comments in C89 style
2024-05-03 14:15:56 -03:00
Ville Juven
0cd5689bcb riscv/pgmap: Fix bug in kernel page directory init
The L2 table was not connected -> results in random crashes. Also add
missing data sync barrier to the end.
2024-05-03 23:49:11 +08:00
Jukka Laitinen
cc9c3ed80b arch/arm64/src/imx9: Add Ethernet driver
This adds a driver for i.MX93 ENET1 MAC block

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-05-02 16:30:41 -03:00
Inochi Amaoto
bd895222eb arch/risc-v: implement sbi_ipi_send
And SBI ipi support.

Fixup: 4f63ca1418 ("arch/risc-v: unfiy IPI access)
Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-05-02 16:08:13 +08:00
Inochi Amaoto
b283b949b6 arch/risc-v: implement standard ecall interface for nuttsbi
NuttSBI have a simple ecall interface for the kernel, which make
it hard to add new SBI call for NuttSBI. So implement standard
ecall interface for NuttSBI and make life easier.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-05-02 16:08:13 +08:00
YAMAMOTO Takashi
c4f199e929 esp32s3: add a variation with 32MB flash 2024-05-01 23:34:12 +08:00
David Sidrane
4482d7b882 imxrt:Add DMA preflight Support
With CONFIG_MMCSD_MULTIBLOCK_LIMIT not set. (No limit)
   The DMA driver would overwrite the internal buffer.

   By adding CONFIG_ARCH_HAVE_SDIO_PREFLIGHT and
   CONFIG_FAT_DMAMEMORY we can insure alignment and
   maximize performance using no CONFIG_MMCSD_MULTIBLOCK_LIMIT
2024-04-30 15:48:20 -03:00
Eren Terzioglu
622abe0230 arch/xtensa: Fix esp32s3 build warnings 2024-04-30 15:47:39 -03:00
Andre Heinemans
4f1ac5160c arch/mx8mp: add rptun/rpmsg client support
New target mx8mp:rpsmsg has been added which enables
a virtual tty and can be accessed from the A53 core
running linux-imx
2024-04-30 11:30:02 -03:00
Ville Juven
3b5b755d1e arch/imx9_lpspi: Use DMA safe buffers to do the DMA transfers
Using user allocated buffers for DMA transfers is not safe for two reasons:
- User space memory is virtual memory, DMA needs physical memory
- User memory buffer alignment cannot be guaranteed -> cache line ops
  are not safe
2024-04-30 19:46:58 +08:00
Ville Juven
3079caf2ce arm64/imx9: Add DMA memory allocator
Add a simple allocator for DMA safe memory. It will provide contiguous
blocks of memory with D-Cache line size alignment.

NOTE: The optimal granule size is the D-Cache line size (64), but due
to restrictions in the granule allocator this would result in a maximum
block size of 2K only, thus use 256B granules instead givin 8K max block
size.

Once the granule allocator is fixed this limitation can be removed.
2024-04-30 19:46:58 +08:00
chao an
8821a0396a arch/risc-v: correct minor issues regarding comments
The comment in riscv_vpu.S should be vector not floating

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-30 17:26:57 +08:00
YAMAMOTO Takashi
2295fa818d esp32s3: give ESP32S3_APP_FORMAT_LEGACY a prompt
So that users can enable it.
This fixes a regression in "esp32s3: add simple boot support".
2024-04-30 17:26:12 +08:00
Eren Terzioglu
891d67bb5e esp32[c3|h2|c6]: Add support to TWAI/CANBus controller 2024-04-30 10:03:22 +08:00
Michal Lenc
8f23a2db01 samv7: build sam_qencoder.c only if at least one timer counter is enabled
Option CONFIG_SENSORS_QENCODER might be configured even if SAMv7 qencoder
over timer counter is not used (for example encoder over GPIO is selected
with CONFIG_SAMV7_GPIO_ENC). This can cause compile warnings, also build
of sam_qencoder.c file is unnecessary in that case.

New hidden option CONFIG_SAMV7_QENCODER is added and automatically
selected if at least one timer counter is enabled for qencoder. Build
is triggered on this option.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-04-29 19:36:21 +08:00
Philippe Leduc
3dc6b4c9bd Add basic support for locales in order to C++ streams to build and work for simple cases (POSIX / C locale).
Fix build with C++ GCC toolchain
2024-04-29 17:34:10 +08:00
Pressl, Štěpán
88fa598ea2 arch/arm/src/samv7/sam_pwm.c: option to enable only the L PWM outputs
PWMx_CHy_LONLY options have been added to Kconfig, too.
If LONLY is selected, it's not possible to use complementary outputs.
If LONLY is not selected, it's possible to use H or complementary
output. If configured correctly with cpol and dcpol attributes,
a H-like behaviour can be achieved. May be useful when you run out
of free MCU pins.

Signed-off-by: Stepan Pressl <pressste@fel.cvut.cz>
2024-04-29 10:09:15 +08:00
Inochi Amaoto
c148e8f2af arch/risc-v: Fix typo in riscv_set_inital_sp
Set right name for the parameter description of riscv_set_inital_sp.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-04-28 17:24:31 +08:00
Inochi Amaoto
49b3f52db1 arch/riscv/qemu-rv: replace M-mode init code with SBI in kernel build
The qemu-rv use a small init code for M mode in kernel build.
It is hard-coding and is difficult to change. Due to the fact,
introduce a already mature SBI implement (e.g OpenSBI) to
replace existing code is a better choice.

This patch introduce some change for qemu-rv:
1. use SSTC to provide time interrupt in kernel build
2. remove uncessary M mode trap.

For simplicity, this patch does not add support for booting
nuttx for any core, but force boot core to start core 0 and
let core 0 do the initialization.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-04-27 22:09:22 -03:00
Inochi Amaoto
3cabc92427 arch/risc-v: add risc-v SSTC extension support
SSTC extension allows nuttx to implement S-mode timer directly,
which is useful for starting at S-mode.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-04-27 22:09:22 -03:00
Inochi Amaoto
1d7afb571f arch/risc-v: report correct interrupt stack base
As `up_get_intstackbase` supports per cpu stack base, fix
the report value with the cpu specific one.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-04-27 22:09:22 -03:00
Inochi Amaoto
a33313413d arch/risc-v: introduce dynamic stack allocation.
It is misleading to allocate stack from static array and heap,
make all stack allocated from heap area.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-04-27 22:09:22 -03:00
Inochi Amaoto
1ef3767f85 arch/risc-v: unfiy IPI access
Add ipi process abstract function support.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
2024-04-27 22:09:22 -03:00
raiden00pl
dd611b9c5b arch/nrf91: enable FPU
according to manual:
  The FPU is not affected by any security configuration.
  Thus, it appears as not present in PERIPHID[n].PERM
  register located in the SPU
2024-04-28 08:49:46 +08:00
Alan Carvalho de Assis
3edda2ab94 stm32f7: Add I2S audio driver 2024-04-27 13:12:47 +08:00
anjiahao
1ea10ddacc mps3:Support NuttX running on qemu cortex-m55
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-04-26 18:42:35 -03:00
p-szafonimateusz
f3b7329816 arch/x86_64: enable CUSTOMOPT
enable CUSTOMOPT for x86_64 arch

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-26 23:32:58 +08:00
Yanfeng Liu
3822d88669 mm/arch: userspace device mapping support
This patch adds definitions to support user space device mappings
that allows devices like frame buffer to be accessible from user
space in kernel mode.

The are mainly two changes:

- in `mm/`:
  added vm_map_region(), vm_unmap_region() for drivers to do
  device mapping easily.
- in `arch/`:
  extended ARCH_SHM_NPAGES as user-space mapping region size.
  decoupled ARCH_SHM_MAXREGIONS from region size calculations and
  limit its usage only for SysV shm purposes.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-26 12:11:35 +08:00
chao an
1f7147129a arch/risc-v: fix break on kernel mode
merge conflicts lead to incorrect ifdef/endif scope

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-26 12:44:57 +09:00
Ville Juven
0d9a3d94eb imx9_clockconfig: Add way to set PLL frequencies
This patch adds a way to configure PLL frequencies. The configuration is
given by board logic.

These values should only be modified by the bootloader, but we don't have
that yet so the flag is never activated.
2024-04-25 19:24:16 -03:00
Ville Juven
e3f4749a3c imx9_clockconfig: Add way to query / calculate PLL frequencies
The frequency LUT idea is not necessary as the PLL output can be calculated
by the CPU. It is better to do this as the clocks are set by the SPL (2nd
stage program loader) which means the NuttX payload would not have access
to such a LUT anyhow.

The mask PLL_DIV_RDIV_MASK is also fixed, as that was simply wrong.

Also add call to imx9_clockconfig (although it does not do anything yet).
2024-04-25 19:24:16 -03:00
chao an
a51ebeab4b arch/risc-v: decouple Per-CPU scratch with ARCH_USE_S_MODE
In some special chipsets, multiple CPUs may be bundled in one hardware
thread cluster, which results in hartid and cpuindex not being exactly
the same. The new option will decouple Scratch-based Per-CPU storage
with S-Mode to distinguish the real cpu index.

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-25 09:48:59 -03:00
chao an
da4c229312 arch/riscv: replace atomic operations to AMO
RISC-V provided fetch-and-op style atomic primitives as they scale
to highly parallel systems better than LR/SC or CAS. A simple
microarchitecture can implement AMOs using the LR/SC primitives,
provided the implementation can guarantee the AMO eventually
completes. More complex implementations might also implement AMOs
at memory controllers, and can optimize away fetching the original
value when the destination is x0.

Signed-off-by: chao an <anchao@lixiang.com>
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-04-25 18:23:58 +09:00
Tiago Medicci Serrano
dab1621442 esp32s3: use common espressif code instead of chip-specific.
Most of the functions used to describe the SoCs capabilities are
available for all Espressif's chips. This commit uses this set of
common functions and remove outdated functions that perform the
same operations in a chip level.
2024-04-25 13:43:15 +08:00
chenwen@espressif.com
9735abab36 xtensa/esp32s3: Fix static_assert compilation error 2024-04-25 13:43:15 +08:00
chenwen@espressif.com
ea5583b112 xtensa/esp32s3: Support ESP32-S3 PM standby and sleep.
1. pm configuration demonstrates the use of power management present on the ESP32-S3.
   2. You can use the pmconfig command to test the power management, for details look at
      ``Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst``

Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-04-25 13:43:15 +08:00
Fotis Panagiotopoulos
b2659424d5 lpc17_40 i2c: Fix I2C driver state desynchronization. 2024-04-25 01:24:40 +08:00
p-szafonimateusz
9a6fa489d8 x86_64_acpi.c: avoid debug messages in acpi_init()
acpi_init() must be called early during boot, some system components may be
unavailable at this stage, so debug messages won't work

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-24 12:55:58 -03:00
p-szafonimateusz
37a6806bb4 x86_64_acpi.c: cosmetic changes
cosmetic changes after review

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-04-24 12:04:08 +08:00
chao an
6086b1410b arch/risc-v: remove the hard code array of cpu idle stack
Do not limit the number of CPU idle stacks by hard code

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-24 11:58:19 +08:00
Ville Juven
89752e9993 arm64/imx9: Add eDMA driver
This driver supports both eDMA3 and eDMA4 (also referred to as DMA0 / DMA1
in some contexts..)

The IP blocks are almost identical, with sufficiently minor differences
to use them via a unified driver. The price is a great amount of code
obfuscation in the hardware description layer.
2024-04-24 11:52:53 +08:00
Yanfeng Liu
5c3fc2796b tools/export: fix names for app linker script and program entry.
This fixes names of program entry and linker script files so that to
support building kernel mode apps using CMake and export package.

flat and protected mode should be the same as before.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-24 11:40:16 +08:00
chao an
28044f7d5a arch/risc-v: add support of save/restore vector registers
Reference:
https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc
https://github.com/torvalds/linux/blob/master/arch/riscv/include/asm/vector.h

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-23 16:18:46 -03:00
Ville Juven
1b7a95c756 arch/imx9: Add PSCI (system reset) support
ARMv8.2-A has PSCI -> it also has support for system reset
2024-04-23 21:30:56 +08:00
p-szafonimateusz
d484e85bb9 x86_64_acpi.c: make sure that RSDP is mapped
rsdp memory may be not mapped when provided from multiboot2 header.
For some reason the previous code worked on some machines.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-23 11:29:21 +02:00
p-szafonimateusz
530f5cd324 arch/intel64: add cache support
Add dcache and icache support for intel64

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-22 23:13:44 +02:00
p-szafonimateusz
30226901c0 arch/x86_64: add simple ACPI parser
add simple ACPI parser for intel64.

For now RSDP signature can be found in BIOS legacy region or can be provided by multiboot2

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-22 23:47:09 +08:00
p-szafonimateusz
0aac7d929d intel64/arch.h: fix ist_t structure, there is no reserved5 field
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-22 23:46:10 +08:00
p-szafonimateusz
8b09118350 intel64/intel64_handlers.c: cosmetic changes
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-22 23:46:10 +08:00