Commit Graph

20826 Commits

Author SHA1 Message Date
Roy Feng
8f66b033db change free to kmm_free as it was allocated via kmm_alloc 2023-07-05 16:40:23 +08:00
raiden00pl
91be7781f5 arch/armv8-m/arm_secure_irq.c: fix writing to the NVIC_AIRCR register
Register key (VECTKEY) must be written, otherwise the write is ignored.

Reference:
https://developer.arm.com/documentation/100235/0004/the-cortex-m33-peripherals/system-control-block/application-interrupt-and-reset-control-register
2023-07-05 00:02:42 +08:00
SPRESENSE
a03b09c34d arch: cxd56xx: Fix bug when watchdog restart
Fix a bug that watchdog is expired in less time than the specified time
when restarting without clearing interrupt.
2023-07-04 10:37:17 -03:00
Xiang Xiao
6b11672310 arch/sim: Remove the unused sim_camera_uninitialize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-04 20:15:30 +09:00
Xiang Xiao
af50cdd21b arch/sim: Rename sim_video to sim_camera
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-04 20:15:30 +09:00
libei1
63774125d9 arch/sim : Audio driver add AUDIOIOC_GETLATENCY ioctl
add AUDIOIOC_GETLATENCY definition, and add reference code in sim alsa.

Signed-off-by: libei1 <libei1@xiaomi.com>
2023-07-04 13:48:58 +08:00
Michal Lenc
d470c3f268 samv7/sam_serial.c: reset all DMA pointers on DMA setup
This small fix ensures all DMA pointers are correctly reseted during
DMA setup (when the driver is opened). Without this there could be rare
occurrence of driver pointer to incorrect (invalidate) DMA buffer and thus
saving incorrect characters to upper layer.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-07-03 17:09:20 +03:00
Michal Lenc
49f153abb1 samv7/sam_xdmac.c: use sam_freelinklist only if circular buffer not used
Circular buffer does not use DMA linked list therefore function
sam_freelinklist() cannot be called as it would fail on assertion (csa
not defined). Peripheral that calls DMA should care of buffer invalidation
instead.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-07-03 17:09:20 +03:00
liuwei35
63ac8fbdfd sim/audio register mixer device
add amixer register code

Signed-off-by: liuwei35 <liuwei35@xiaomi.com>
2023-07-03 10:18:37 -03:00
qiaohaijiao1
de5c35382a sim/sim_alsa.c: add paused variable instead of snd_pcm_pause.
snd_pcm_hw_params_can_pause return false on sim.
add paused variable to support pause.

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2023-07-03 13:51:09 +08:00
raiden00pl
76cf66165a arch/nrf91: simplyfy modem option names 2023-07-03 00:52:01 +08:00
raiden00pl
1a6d507422 arch/{nrf52|nrf53|nrf91}: rename NRFxx to nRFxx to be compatible with the manufacturer's nomenclature 2023-07-03 00:52:01 +08:00
raiden00pl
56961d9f34 arch/arm: initial support for NRF91
Port based on arch/arm/nrf53.

Modem not fully supported yet. At the moment, initialization and AT interface work.
Sockets and GNSS interface will be added later.
2023-07-02 10:10:35 -03:00
tjwu1217
4969f8faf9 risc-v Toolchain.defs compatibility.
Reference:https://xpack.github.io/blog/2022/05/18/riscv-none-elf-gcc-v12-1-0-2-released/

RISC-V ISA updates

Compared to previous releases, starting from 12.x, the compiler implements the new RISC-V ISA, which introduces an incompatibility issue, and builds might throw error messages like unrecognized opcode csrr.

The reason is that csr read/write (csrr*/csrw*) instructions and fence.i instruction were separated from the I extension, becoming two standalone extensions: Zicsr and Zifencei.

The solution is to add _zicsr and/or _zifencei to the -march option, e.g. -march=rv32imac becomes -march=rv32imac_zicsr_zifencei.
2023-07-01 13:19:30 +08:00
Alan Carvalho de Assis
245db6742c esp32s2: Fix UART1 default pins
The default pins to UART1 should be 17 (TXD) and 18 (RXD).
2023-07-01 13:11:39 +08:00
Jani Paalijarvi
78a2c91a04 risc-v/mpfs: cache: Fix cache and scratchpad init
Initialize ICACHE way with correct mask.
Initialize scratchpad with constant g_init_marker as it has been done in HSS

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2023-06-30 20:19:54 -03:00
ThomasNS
f51d6b8c72 add userled driver initialization 2023-06-30 10:29:33 -03:00
ThomasNS
7864bf4870 spi4 working xmc4700-relax 2023-06-30 10:29:33 -03:00
Masayuki Ishikawa
9861d49cd4 arch: arm64: Add arm64_gic_raise_sgi() for SMP
Summary:
- I noticed that arm64_gic_raise_sgi() is not implemented for
  GICv2 which is used for SMP + hypervisor such as qemu + kvm.
- This commit fixes this issue

Impact:
- None

Testing:
- Tested with qemu-7.1 + kvm (linux) and qemu-7.1 + hvf (macOS)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-06-30 16:10:26 +08:00
Masayuki Ishikawa
745f443cbf arch: arm64: Fix to access psci with hypervisor
Summary:
- I noticed that pcsi version can not be obtained with qemu + kvm.
- Also, pci_detect hangs with qemu + hvf.
- This commit fixes this issue by using hvc (hypervisor call).

Impact:
- None

Testing:
- Tested with qemu-7.1 + kvm (linux) and qemu-7.1 + hvf (macOS)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-06-30 16:10:26 +08:00
Jorge Rodriguez Herranz
a40f07640f Fix gpio outputs from being configured as interrupts in stm32f0l0g0 gpio driver 2023-06-30 02:28:37 +08:00
Masayuki Ishikawa
cf6a134684 arch: arm64: Do not set cntfrq_el0 in qemu_boot.c
Summary:
- During testing with qemu + kvm, I noticed that nuttx hangs
  when setting cntfrq_el0. With qemu + kvm, it starts from
  EL1 because we can not specify virtualization=on
- However, I noticed that it works without setting cntfrq_el0
- This commit fixes this issue

Impact:
- None

Testing:
- Tested with qemu-7.1 (both with kvm and without kvm)
- NOTE: to work with kvm, GICv2 must be used.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-06-29 20:11:29 +08:00
Alexander Lunev
7af151aa51 arch/arm: move -mthumb option back to ARCHCPUFLAGS
CONFIG_ARM_TOOLCHAIN_GNU_EABI build got broken when -mthumb option was moved
from ARCHCPUFLAGS to ARCHOPTIMIZATION variable:

arm-none-eabi-ld: error: .../build/nuttx/nuttx uses VFP register arguments, /usr/lib/gcc/arm-none-eabi/5.4.1/libgcc.a(_fixunsdfdi.o) does not
arm-none-eabi-ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/5.4.1/libgcc.a(_fixunsdfdi.o)
arm-none-eabi-ld: error: .../build/nuttx/nuttx uses VFP register arguments, /usr/lib/gcc/arm-none-eabi/5.4.1/libgcc.a(_udivmoddi4.o) does not
arm-none-eabi-ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/5.4.1/libgcc.a(_udivmoddi4.o)
2023-06-29 18:18:23 +08:00
Mingjie Shen
1d6e51220d cxd56_dmac, lcd_dev: fix null pointer dereference
Check return values of following functions for null:
   - board_lcd_getdev
   - get_device

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2023-06-28 10:16:38 +03:00
Stuart Ianna
5b00c31396 boards/litex/arty_a7: Support building fully linked executables.
Changes the executable type built against the `make export` target fully linked by default. This greatly improves performance when loading applications, as relocations no longer need to be processed.
2023-06-28 15:16:28 +08:00
Stuart Ianna
6492f0172e binfmt/elf: Allow the userspace ELF type to be defined by board configuration.
This change allows boards to define an additional kconfig option, which specifies the final link format of application executables.

By selecting `CONFIG_BINFMT_ELF_RELOCATABLE`, and providing an appropriate linker script, applications can be fully linked, removing the need to process relocations.
2023-06-28 15:16:28 +08:00
Lucas Saavedra Vaz
9bd1d5ddda arch/risc-v/espressif: Add USB-Serial-JTAG driver
Add support for USB-Serial-JTAG on ESP32-C3/C6/H2 using the Espressif HAL
2023-06-28 08:47:55 +08:00
Michal Lenc
9a9c35fa45 samv7: fix compile warnings for sam_wdt.c
Incorrect types in wdinfo and wderr functions were fixed to PRIu32 and
PRIx32.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-06-27 10:03:25 -03:00
GD32-MCU
ec2a62c397 add gd32f470 support 2023-06-27 14:59:33 +08:00
Stuart Ianna
d94013837e risc-v/litex: Improve ethernet packet reception.
In the default configuration, the Litex ethernet peripheral contains two RX and two TX buffers. The active buffer for the peripheral should be swapped as soon as possible, in order to reduce packet loss.

This modification acknowledges the receive buffer as soon as the pending data is copied into the NuttX device data buffer. Improving reliability under heavy load.
2023-06-27 03:33:40 +08:00
Xiang Xiao
7f80b4aeba clock: Move the content of include/nuttx/time.h to include/nuttx/clock.h
and remove include/nuttx/time.h to reduce the nuttx specific header files

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-26 19:14:08 +03:00
Xiang Xiao
b5c48f3ed8 binfmt: Always include arch/elf.h in include/nuttx/elf.h
since symbols defined in arch/elf.h is also used in other case, for example:
CC:  pthread/pthread_testcancel.c machine/arm/gnu_unwind_find_exidx.c:32:8: error: unknown type name '__EIT_entry'
   32 | static __EIT_entry *__exidx_start_elf;
      |        ^~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-25 19:02:53 -03:00
Mingjie Shen
cbe4edd479 arch/arm/imxrt: Fix implicit function declaration
The function 'imxrt_config_gpio' was implicitly declared.
Fix by include the header 'imxrt_gpio.h'.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2023-06-25 11:29:42 -03:00
Mingjie Shen
49afeb4d63 arch/arm/stm: Fix duplicate include guard
The following macros
  __ARCH_ARM_SRC_STM32F7_HARDWARE_STM32F74XX75XX_FLASH_H
  __ARCH_ARM_SRC_STM32L4_HARDWARE_STM32L4X6XX_RCC_H
are used in other header files.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2023-06-25 12:23:23 +03:00
Lucas Saavedra Vaz
8aeba210e4 arch/risc-v/espressif: Add full GPIO support
Full GPIO support using Espressif's HAL
2023-06-24 13:11:45 +08:00
Stuart Ianna
2db6ea9984 litex/gpio: Fix incorrect declaration name. 2023-06-23 12:29:59 +08:00
Xiang Xiao
0eeca0f375 build: Replace "$(shell $(INCDIR) $(CC) ...)" with $(INCDIR_PREFIX)
to unify the way to get include directories

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-23 00:11:25 +03:00
anjiahao
4ae17a6f7b sched:Automatically find deadlocks when assert
When asserting, automatically analyze whether
there is a deadlock in the thread, and if there
is a deadlock, print out the deadlocked thread.

The principle is to analyze whether there is
a lock ring through the tcb holder.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-06-22 16:08:03 +08:00
simbit18
f0a74eb492 Fix Kconfig style
Remove spaces from Kconfig files
2023-06-22 11:46:09 +09:00
simbit18
f930b4f6f5 Fix Kconfig style
Remove TABs from Kconfig files
Replace help => ---help---
Add comments
2023-06-20 12:54:50 -03:00
Masayuki Ishikawa
c5641b0252 Revert "riscv/swint: Give the full tcb to the context switch routine"
This reverts commit 040eb3c990.
2023-06-20 06:17:11 +09:00
Masayuki Ishikawa
2c6ad5c2bf Revert "riscv/fpu: Restore correct lazy-FPU functionality"
This reverts commit 35c27b5a9a.
2023-06-20 06:17:11 +09:00
Masayuki Ishikawa
9d84d79b29 Revert "riscv/saveusercontext: Fix FPU state save"
This reverts commit 669196910c.
2023-06-20 06:17:11 +09:00
Masayuki Ishikawa
0124533cc3 Revert "riscv/addrenv: Move addrenv_switch() to correct place after FPU change"
This reverts commit da319bbd85.
2023-06-20 06:17:11 +09:00
Masayuki Ishikawa
7410f4a6b8 Revert "riscv/lazyfpu: Add option to disable lazy FPU"
This reverts commit 425cc89989.
2023-06-20 06:17:11 +09:00
simbit18
3f4151525d Fix Kconfig style
Remove TABs from Kconfig files
Add comments
2023-06-19 20:05:57 +03:00
Ville Juven
425cc89989 riscv/lazyfpu: Add option to disable lazy FPU
Adds option to use the old implementation where FPU is stored into
the process stack.
2023-06-19 19:28:07 +08:00
Ville Juven
da319bbd85 riscv/addrenv: Move addrenv_switch() to correct place after FPU change
The new address environment must be instantiated prior to restoring FPU
state as the CPU status register is in tcb->regs, which is user stack.
2023-06-19 19:28:07 +08:00
Ville Juven
669196910c riscv/saveusercontext: Fix FPU state save 2023-06-19 19:28:07 +08:00
Ville Juven
35c27b5a9a riscv/fpu: Restore correct lazy-FPU functionality
- Save the FPU registers into the tcb so they don't get lost if the stack
  frame for xcp.regs moves (as it does)
- Handle interger and FPU register save/load separately
- Integer registers are saved/loaded always, like before
- FPU registers are only saved during a context switch:
  - Save ONLY if FPU is dirty
  - Restore always if FPU has been used (not in FSTATE_OFF, FSTATE_INIT)
- Remove all lazy-FPU related logic from the macros, it is not needed
2023-06-19 19:28:07 +08:00