Commit Graph

51484 Commits

Author SHA1 Message Date
Ville Juven
7c893ddfc2 kmm_map: Add function to map a single page of kernel memory
Mapping a physical page to a kernel virtual page is very simple and does
not need the kernel vma list, just get the kernel addressable virtual
address for the page.
2023-10-09 18:59:43 +03:00
Ville Juven
04bfaf3a55 kmm_map.c: Remember to free the temporary 'pages' variable
The temp variable was freed only in error cases, but it needs to be freed
in the happy case as well.
2023-10-09 18:59:43 +03:00
Ville Juven
5dd0474269 kmm_map.c: Add way to test if addr is within kmap area or not
is_kmap_vaddr is added and used to test that a given (v)addr is actually
inside the kernel map area. This gives a speed optimization for kmm_unmap,
as it is no longer necessary to take the mm_map_lock to check if such a
mapping exists; obviously if the address is not within the kmap area, it
won't be in the list either.
2023-10-09 18:59:43 +03:00
Ville Juven
d199264dca kmm_map: Fix incorrect function name field 2023-10-09 18:59:43 +03:00
Ville Juven
a444435f8b kmm_map.c: Fix user page mapping
User pages are mapped from the currently active address environment. If
the process is running on a borrowed address environment, then the
mapping should be created from there.

This happens during (new) process creation only.
2023-10-09 18:59:43 +03:00
Ville Juven
b2f9926a1b kmm_map.c: Fix call to gran_alloc
Provide the handle to gran_alloc, not pointer to handle.
2023-10-09 18:59:43 +03:00
Ville Juven
3e8575c39e riscv-v/pgalloc.h: Return kernel vaddr for kernel RAM paddr
All kernel memory is mapped paddr=vaddr, so it is trivial to give mapping
for kernel memory. Only interesting region should be kernel RAM, so omit
kernel ROM and don't allow re-mapping it.
2023-10-09 18:59:25 +03:00
Marco Casaroli
cba44cc9dc fix(esp32s3_i2c): i2c_clear_bus on for I2C_RESET
This function is only used now for I2C_RESET, so we wrap it with the
config macro.
2023-10-09 18:55:04 +03:00
Marco Casaroli
f25a382c1a feat(esp32s3_i2c): do not destuck every transaction
It looks like we do not need to send the 9 clock ticks whenever we reset
the FSM. We are already doing this in i2c_reset function if necessary.

This makes the i2c transfers much faster, for example the i2c(-tool) dev
scan feature.
2023-10-09 18:55:04 +03:00
Marco Casaroli
141dc1e3e7 fix(esp32s3_i2c): set regs order
It looks like we need to set this bit before the UPGATE, like we do on
the esp32c3 port.
2023-10-09 18:55:04 +03:00
Ville Juven
d72de58aa8 sched/assert.c: Print process name in assert dump
In addition to printing out the thread name (task name in flat mode),
print the parent process's name as well.

It is quite useful to know which process is the parent of a faulting
thread, although this information can be read from the assert dump, in
some cases the dump might be incomplete (due to e.g. stack corruption,
which causes another exception and PANIC().)
2023-10-09 21:30:33 +08:00
Xiang Xiao
28dee592a3 video/fb: Add fb_register_device
so the user could register fb device directly instead
go through the sequence of up_fbinitialize/up_fbgetvplane

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-09 13:18:36 +03:00
raiden00pl
4f8a2b3874 libds/lib_misc: use b16abs() 2023-10-07 21:25:56 +08:00
raiden00pl
819bec0888 libdsp/lib_observe: fix typo and use b16sign() 2023-10-07 21:25:56 +08:00
raiden00pl
ec5793db59 fixedmath: add abs and sign operations 2023-10-07 21:25:56 +08:00
chao an
a3d7abb1ae sys/types: supporting 32-bit IDs for gid_t/uid_t
Signed-off-by: chao an <anchao@xiaomi.com>
2023-10-07 18:21:21 +08:00
Xiang Xiao
c775ee1002 spinlock: Add spin_lock_init macro like Linux
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-06 20:03:19 -04:00
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
Xiang Xiao
aa0b3fcdf9 lib/memfd: shm_unlink or unlink anonymous file
https://man7.org/linux/man-pages/man2/memfd_create.2.html:
       The name supplied in name is used as a filename and will be
       displayed as the target of the corresponding symbolic link in the
       directory /proc/self/fd/.  The displayed name is always prefixed
       with memfd: and serves only for debugging purposes.  Names do not
       affect the behavior of the file descriptor, and as such multiple
       files can have the same name without any side effects.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-06 20:02:30 -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
Alin Jerpelea
643b9c1abf Documentation: add NuttX-12.3.0 release notes
Add release notes for 12.3.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2023-10-06 23:12:03 +08:00
laoniaokkk
aec0271e48 max31865:RTD-to-Digital Converter 2023-10-06 21:15:21 +08:00
fengsi
7248b728bf UART needs to be disabled before changing setup 2023-10-06 20:49:26 +08:00
Tiago Medicci Serrano
57bf9d44d2 Documentation: Fix search path for defconfig include list
Add `*` to make it being understood as a list.
2023-10-05 19:18:05 -04:00
Tiago Medicci Serrano
997b3422a3 Documentation: Update the recommended toolchain for ESP32-C3/C6/H2
Currently, this toolchain is being used for NuttX CI testing and
provide features that weren't available in the old toolchain based
on GCC 10.2.
2023-10-05 19:18:05 -04: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
SPRESENSE
bf6606f80c libxx: Use gnu++20 option only if using libcxx
Fix an issue that gnu++20 option is always used.
Essentially, when cxx is not used, gnu++17 should be retained.
2023-10-05 13:09:20 +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
dbe10a0fc8 boards: simplify the enable condition for up_perf_init 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
Xiang Xiao
414491e340 pm: Let PM_PROCFS depend on FS_PROCFS_REGISTER
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-02 14:30:18 -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
b90c6b5b20 cmake: raise error if previous make build was not cleaned
Uncleanded make build can cause various cmake errors.
It's better to stop cmake build early and display an error.
2023-10-02 23:35:19 +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
raiden00pl
c52188f0bf drivers/foc/foc_dummy.c: update dummy device state only if dev opened
This is fix for seg fault for sim/foc configuration
2023-10-02 23:33:05 +08:00