Commit Graph

21284 Commits

Author SHA1 Message Date
Xiang Xiao
dfa0283d83 spinlock: Rename spin_islocked to spin_is_locked
align with Linux naming style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-06 20:03:19 -04:00
TaiJu Wu
1b843633e6 format: modify spin_lock_irqsave format
spin_lock_irqsave() should be spin_lock_irqsave(NULL)

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
2023-10-06 20:00:04 -04:00
TaiJu Wu
ffba0d15a5 Feature: implement ticket spinlock
test config: ./tools/configure.sh -l qemu-armv8a:nsh_smp

Pass ostest

No matter big-endian or little-endian, ticket spinlock only check the
next and the owner is equal or not.

If they are equal, it means there is a task hold the lock or lock is
free.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>

Co-authored-by: Xiang Xiao <xiaoxiang781216@gmail.com>
2023-10-07 01:38:37 +08:00
fengsi
7248b728bf UART needs to be disabled before changing setup 2023-10-06 20:49:26 +08:00
Ville Juven
7901ed0fe3 riscv_addrenv_utils.c: Determine page table flags by type of vaddr
Use kernel page table flags if the mapped virtual address is in kernel
space.
2023-10-05 20:38:35 +08:00
Tiago Medicci Serrano
6521bdfa1f esp32s3/ble: fix saving/restoring the interrupt status flags
Whenever we enter/leave a critical section, the interrupt status is
saved and, then, restored. However, for the ESP32-S3's BLE adapter,
entering/leaving a critical section is done on separate functions
that need to be registered as a callback.

The status flag was being saved as a global variable. However,
calling nested enter_critical_section would overwrite this global
variable that was storing the previous flag and, when leaving the
last critical section, the restored status would be different from
the one expected. The proposed solution for this issue is to create
a global array to store the interrupt status flags for nested calls.
2023-10-05 11:25:43 +08:00
Tiago Medicci Serrano
a71a3258b7 esp32s3/ble: enable the BLE interrupt during a SPI flash operation
This commit sets the BLE's interrupt as a IRAM-enabled interrupt,
which enables it to run during a SPI flash operation. This enables
us to create a cache to off-load semaphores and message queues
operations and treat them when the SPI flash operation is finished.
By doing that, we avoid packet losses during a SPI flash operation.
2023-10-05 11:25:43 +08:00
Tiago Medicci Serrano
0ddb64555a esp32s3/irq: Allow IRAM ISRs to run during SPI flash operation
This commit provides an interface to register ISRs that run from
IRAM and keeps track of the non-IRAM interrupts. It enables, for
instance, to avoid disabling all the interrupts during a SPI flash
operation: IRAM-enabled ISRs are, then, able to run during these
operations.
2023-10-05 11:25:43 +08:00
Tiago Medicci Serrano
86b118854e esp32s3/irq: Fix erroneous interrupt allocation for each CPU core
When allocating a CPU interrupt, make sure to select the correct
CPU core to query for it. Simply checking for the current CPU does
not satisfy this requirement because the CPU allocation thread may
be executed by the other core: it's necessary to stick with the
intended CPU passed as an argument of the `esp32s3_setup_irq`.
2023-10-05 11:25:43 +08:00
Tiago Medicci Serrano
2e93882bcf esp32/ble: Fix task_create_wrapper CPU core ID passed as argument
The registered `task_create_wrapper` receives the `core_id`, but
the current implementation ignores this parameter while calling
`esp_task_create_pinned_to_core`. This commit fix this.
2023-10-05 00:37:55 +03:00
Eren Terzioglu
071fb18501 xtensa/esp32s2: add UART RS485 support 2023-10-04 10:18:45 +03:00
ThomasNS
2ffb72917d The character U+ff0c "," could be confused with the ASCII character U+002c ",", which is more common in source code. 2023-10-03 16:53:12 -04:00
Tiago Medicci Serrano
b8b0ae9238 esp32/irq: Fix erroneous interrupt allocation for each CPU core
When allocating a CPU interrupt, make sure to select the correct
CPU core to query for it. Simply checking for the current CPU does
not satisfy this requirement because the CPU allocation thread may
be executed by the other core: it's necessary to stick with the
intended CPU passed as an argument of the `esp32_setup_irq`.
2023-10-03 16:51:49 -04:00
raiden00pl
d889b7362d arch: auto-select ARCH_PERF_EVENTS if some debug features enabled 2023-10-03 12:53:10 +08:00
raiden00pl
696d67870a arch/Kconfig: set ARCH_PERF_EVENTS default to n
This is a debugging feature so it should be disabled by default
2023-10-03 12:53:10 +08:00
raiden00pl
917fa624b9 arch/{all stm32 | all nordic | at32}: simplify the enable condition for up_perf_init 2023-10-03 12:53:10 +08:00
Carlos Sanchez
8e80d05fbb arch/arm/src/stm32h7/stm32_oneshot.c: Fix format warnings.
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-10-02 16:41:13 -04:00
Carlos Sanchez
f3576a41f5 arch/arm/src/s32k1xx: Fix warnings in PWM code. 2023-10-02 23:36:37 +08:00
Carlos Sanchez
33cfd630ad arch/arm/src/s32k1xx: Fix LPUART inversion warnings & config. 2023-10-02 23:36:01 +08:00
raiden00pl
c93c0ecd81 samv7/adc: always increase initialization counter when adc_setup called 2023-10-02 23:34:24 +08:00
raiden00pl
cf4b8dbfa3 imxrt/adc: always increase initialization counter when adc_setup called 2023-10-02 23:34:24 +08:00
raiden00pl
b7fca7ff75 at32/adc: always increase initialization counter when adc_setup called 2023-10-02 23:34:24 +08:00
raiden00pl
577bdbf1fc stm32{f7}/adc: always increase initialization counter when adc_setup called 2023-10-02 23:34:24 +08:00
Ville Juven
8c6be8e1f3 riscv/addrenv: Fix the user VMA end address
The end address was off by 1, making it overflow to 0 (u32 value).
2023-09-29 22:34:40 +08:00
raiden00pl
761bddcab8 arch: add a flag indicating that the chip doesn't support DMA transfer from/to FLASH 2023-09-29 21:04:02 +08:00
raiden00pl
20a65fa21b arch/nrf{52|53|91}: add support for up_perf 2023-09-29 19:56:21 +08:00
raiden00pl
4ea825ef9e arch/nrf{52|53|91}: fix timer for small intervals and correct CC overflow check 2023-09-29 18:21:01 +08:00
Petteri Aimonen
76f6d340ee stm32: Add architecture adjtime() support
Based on the samv7 implementation, adjusts systick period.
2023-09-29 13:03:10 +08:00
Xiang Xiao
cb11747f36 arch: add use_data to g_tcbinfo
to avoid compiler/linker remove it from the final image

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-29 08:00:18 +03:00
Ville Juven
7b18f5eb6f risc-v/riscv_addrenv.c: Fix bug where SHM area page tables are not freed
The SHM physically backed memory does not belong to the user process,
but the page table containing the mapping does -> delete the page table
memory regardless.
2023-09-28 22:17:55 +08:00
Ville Juven
2cd1fd1145 risc-v/pgalloc.h: Add SHM area to riscv_uservaddr query
If the vaddr resides within the user's SHM, it is a user memory mapping.
2023-09-28 22:17:55 +08:00
Ville Juven
9be93addea mpfs/mpfs_corespi: Several speed optimizations to the FPGA driver
This is a collection of tweaks / optimizations to the driver to limit
CPU usage as well as interrupt processing times.

The changes are as follows:
- setfrequency is now no-op if the frequency does not change. Accessing
  MPFS_SPI_CONTROL requires synchronization to the FIC domain, which
  takes unnecessary time if nothing changes
- load/unload FIFO loops optimized so !buffer, priv->nbits and i==last are
  only tested once (instead of for every word written in loop).
- Disable the RX interrupt only once (again, FIC domain access is slow)
- In case a spurious MPFS_SPI_DATA_RX interrupt arrives, just wipe the
  whole RX FIFO, instead of trying to read it byte-by-byte
2023-09-28 09:36:07 +08:00
Eren Terzioglu
ded321a515 xtensa/esp32s2: Add support to TWAI/CANBus controller 2023-09-28 09:35:08 +08:00
TimJTi
fc76b9955c Sort XDMA support for SAMA5D2 ADC&TSD 2023-09-28 09:33:35 +08:00
Daniel P. Carvalho
e45e932a8a Adds low level operations to start and stop DMA. 2023-09-28 09:32:52 +08:00
TimJTi
7c4349fa9c TSD behaviour incorrect if ADC software trigger set. Pressure scaling wrong. 2023-09-27 00:15:20 +08:00
Petteri Aimonen
d68c8ec560 stm32_eth: Fix excessively long critical section in ifdown handler
stm32_ifdown() holds critical section when calling stm32_ethreset().
That function used to call up_mdelay(10) while waiting for the ethernet
peripheral reset to complete. This resulted in excessively long
critical section time with interrupts disabled.

The actual expected delay is a few clock ticks of the 50 MHz clock domain.
This commit changes polling interval to 1us and maximum to 10us.
2023-09-26 22:13:24 +08:00
Xiang Xiao
167c4ae2a4 arch/arm: Fix error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-26 15:03:59 +08:00
Xiang Xiao
1edcea3997 arch/Kconfig: Add prompt string to ARCH_CHIP_CUSTOM
so the user could enable it from defconfig

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-25 23:02:37 +08:00
raiden00pl
ade23b92d1 arch/{nrf52|nrf53}/pwm: fix compilation for MULTICHAN not set 2023-09-24 10:32:29 +08:00
makejian
cb3abc48d7 crypto/cryptodev: expansion hash operation
(1) remove size restriction for single hash operation
(2) support hash operation to update uint32_t data
Signed-off-by: makejian <makejian@xiaomi.com>
2023-09-24 03:49:33 +08:00
yinshengkai
4f25c287d2 arch/sim: add sim uart_ram support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-09-23 15:22:42 +08:00
wanggang26
d827ee5ffc refine: set file mode when oflags contains O_CREAT
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-23 15:20:51 +08:00
wangming9
029bbf6bbd arch/arm: Enable FPU on qemu and goldfish platforms
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-09-23 08:42:00 +02:00
yintao
da7d6ef37b sim_rptun: unlink shm when quit
if not unlink shm, the shared memory object still exists in host /dev/shm after quit
if nuttx is started with administrator privileges, or if it is restarted with user
privileges, there will be a problem with the permission to open this shm file

Signed-off-by: yintao <yintao@xiaomi.com>
2023-09-23 08:39:38 +02:00
laoniaokkk
4256dd934f Fix onchip flash erase fail 2023-09-23 12:36:11 +08:00
wanggang26
7f5e6bd383 hostfs: mask bit fields of not support
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-23 05:28:57 +09:00
raiden00pl
8833501084 arch/stm32h7/dualcore: don't use stm32_hsem interface for cores synchronisation
stm32_hsem functions can use debug messages but cores synchronisation is done when
the OS is not yet fully initialized
2023-09-22 19:46:26 +08:00
raiden00pl
0e01836f09 serial: add an option that selects uart rpmsg as console 2023-09-22 19:46:26 +08:00
wanggang26
e930476b4b enable O_CLOEXEC explicit
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-22 13:51:00 +08:00