Commit graph

1829 commits

Author SHA1 Message Date
Huang Qi
cfd0cc0d1a Remove duplicate includes across multiple files
This commit cleans up redundant header file includes throughout the codebase.
 The changes include:

 - Removing duplicate #include directives that were present in the same file
 - Consolidating includes that were split across multiple lines unnecessarily
 - Removing unused includes that were no longer needed
 - Fixing some formatting issues with includes

 The changes improve code organization and maintainability by:
 - Reducing unnecessary dependencies
 - Making include dependencies more explicit
 - Following consistent include patterns
 - Removing dead code

 No functional changes are made - this is purely a code cleanup commit.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-09 23:30:23 +08:00
nuttxs
cb980cc977 arch/esp32s3_partition: Read data from SPI Flash
at designated address (with decryption)
2025-01-09 07:52:40 +08:00
YAMAMOTO Takashi
c0eaf12661 esp32s3_wifi_adapter.c: Fix a deadlock
Fixes: https://github.com/apache/nuttx/issues/15314
2025-01-08 23:56:43 +08:00
Gao Feng
55da7d89b5 xtensa/esp32s3: porting of spi_flash_chip_generic_write_encrypted from ESP-IDF 2025-01-07 12:18:43 +08:00
buxiasen
89455bc9a1 arch: up_getusrsp change to inline and implement in irq.h
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-01-06 23:03:05 +08:00
buxiasen
9bdcc4dc4b arch/irq.h: update all inline to inline_function
Inline & inline_function both used make confuze, let's modify all inline
in irq.h to inline_function, also clear the always_inline_funcion
declaration.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-01-06 23:03:05 +08:00
Kevin Zhou
1bc2e1a175 xtensa/esp32s3: set cpuint to initial value after deallocate 2025-01-06 22:57:14 +08:00
wangzhi16
893c5e92c2 Reduce the size of tcb by four bytes.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-01-02 23:18:42 +08:00
Filipe Cavalcanti
75aa80dba8 arch/xtensa: enable SPIRAM test during boot of ESP32|S3 2025-01-02 23:12:39 +08:00
Gao Feng
da845163a3 xtensa/esp32: add lock for async operation work
g_work as singleton can be changed by context switching,
but previous one async operation have not finished yet.

adapt based on: 10a1d17a85
2024-12-30 18:14:32 +08:00
chenxiaoyi
ad8902a33e esp32[|s2|s3]: adapt to new syscall implementation
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2024-12-27 00:25:55 +08:00
chenxiaoyi
aa426d1edb xtensa: change write intset register to syscall instruction
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2024-12-27 00:25:55 +08:00
chenxiaoyi
1757ecc5c1 xtensa: add backtrace link from syscall exception
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2024-12-27 00:25:55 +08:00
hujun5
eb587d72e0 fix compile error
Configuration/Tool: esp32s2-kaluga-1/audio
Error: chip/esp32s2_lowputc.c:102:22: error: expected '}' before ';' token
  102 |   .lock = SP_UNLOCKED;
      |                      ^
chip/esp32s2_lowputc.c:62:1: note: to match this '{'
   62 | {

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-23 14:48:35 +08:00
hujun5
f25e3d2324 use small lock in following files
arch/risc-v/src/litex/litex_emac.c
arch/risc-v/src/mpfs/mpfs_coremmc.c
arch/risc-v/src/mpfs/mpfs_usb.c
arch/xtensa/src/esp32/esp32_idle.c
arch/xtensa/src/esp32/esp32_rtc_lowerhalf.c
arch/xtensa/src/esp32s2/esp32s2_idle.c
arch/xtensa/src/esp32s2/esp32s2_lowputc.c
arch/xtensa/src/esp32s2/esp32s2_lowputc.h
arch/xtensa/src/esp32s2/esp32s2_rtc_lowerhalf.c
arch/xtensa/src/esp32s3/esp32s3_idle.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-22 18:53:15 +08:00
hujun5
8411a97b85 use small lock in following files
arch/xtensa/src/esp32s3/esp32s3_rtc_lowerhalf.c
arch/z16/src/z16f/z16f_serial.c
arch/z80/src/z8/z8_serial.c
boards/arm/max326xx/max32660-evsys/src/max326_button.c
boards/arm/stm32/stm32f4discovery/src/stm32_gs2200m.c
drivers/i2c/i2c_bitbang.c
drivers/power/supply/act8945a.c
drivers/serial/uart_pci_16550.c
drivers/serial/uart_pl011.c
drivers/wireless/bluetooth/bt_uart_shim.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-22 18:43:26 +08:00
Tiago Medicci Serrano
7548db1980 arch/xtensa: Support __thread and thread_local keywords
Enable architecture-specific support for those keywords. This is a
"gcc-based" thread local storage implementation.
2024-12-21 20:49:07 +08:00
hujun5
67b95d0142 use small lock in following files
arch/arm/src/armv7-a/arm_gicv2.c
arch/arm/src/imx6/imx_serial.c
arch/arm/src/imxrt/imxrt_flexcan.c
arch/xtensa/src/esp32/esp32_himem.c
arch/xtensa/src/esp32s3/esp32s3_himem.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-20 20:58:43 +08:00
hujun5
ecdff659d1 modifyreg[8|32]: use small lock in modifyreg[8|32]
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-19 21:55:21 +08:00
hujun5
75ddce6e3a modifyreg16: use small lock in modifyreg16
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-18 20:28:26 +08:00
Alin Jerpelea
559b533863 arch/xtensa: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-18 17:51:57 +08:00
hujun5
e3717b3086 esp32_rtc: use small lock in arch/xtensa/src/esp32[s2]/esp32s2_rtc.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-18 11:53:15 +08:00
Eren Terzioglu
767c5f16f0 esp32[s2|s3]: Add pulse counter support 2024-12-17 13:35:42 -03:00
Filipe Cavalcanti
ac56285bf8 arch/xtensa: fix memcpy on AP password 2024-12-17 11:27:02 -03:00
chao an
33d717d3a0 tools/parsetrace.py: fix typo lenght -> length
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-17 20:48:07 +08:00
chao an
a59f59b9f5 libc/gnu: fix typo adress -> address
fix typo adress -> address

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-17 20:48:07 +08:00
hujun5
63f947941a esp32s3_rtc: use small lock in arch/xtensa/src/esp32s3/esp32s3_rtc.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-17 16:20:05 +08:00
Eren Terzioglu
970d1a1f7c esp32[c3|c6|h2]: Add efuse support 2024-12-17 01:04:39 +08:00
Gao Feng
9e8e7ace09 xtensa: support coredump by register set alignment 2024-12-13 18:21:37 +08:00
simbit18
e4705e7f62 Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2024-12-12 02:18:23 +08:00
chao an
4eeb6546ec esp/mcpwm: fix unpaired spin lock
N/A

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-11 21:36:51 +08:00
Tiago Medicci Serrano
f3ec1bd60c xtensa/esp32s3: Update the reserved size for struct __lock
After https://github.com/apache/nuttx/pull/15075, the static
assertion at `nuttx/arch/xtensa/src/esp32s3/esp32s3_libc_stubs.c`
was being triggered when building any of the ESP32-S3's defconfigs.
This commit updates the reserved size to reflect the changes
introduced by the related PR.
2024-12-11 21:36:20 +08:00
Gao Feng
10a1d17a85 xtensa/esp32s3: add lock for async operation work
g_work as singleton can be changed by context switching,
but previous one async operation have not finished yet.
2024-12-10 22:01:43 +08:00
Gao Feng
1c7d81881c xtensa/esp32: encrypted MTD for partition offset
Non-encrypted mtd can not be used for encrypted device.

Even without SPI Flash encryption,
encrypted MTD also can be used to read no-encrypted data.
2024-12-10 18:15:47 +08:00
Eren Terzioglu
001a663b74 esp32[s2|s3]: Add nxdiag without esptool wrapper 2024-12-07 11:45:59 +08:00
Xiang Xiao
60fb917eda Remove FAR from 32/64bit arch
since these arch doesn't distinguish between near and far pointers

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-12-05 22:55:39 +08:00
chenxiaoyi
f313ee5715 xtensa: inline up_switch_context
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-05 20:32:45 +08:00
zhangyuan29
1dc1e65202 arch/xtensa: use arch atomic when enable iram heap
S32C1I instructions may target cached, cache-bypass,
and data RAM memory locations. S32C1I instructions
are not permitted to access memory addresses in data ROM,
instruction memory or the address region allocated to
the XLMI port. Attempts to direct the S32C1I at these
addresses will cause an exception.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-05 00:05:15 +08:00
hujun5
dabf589940 remove redundant judgments *running_task != NULL
reason:
In irq, g_running_tasks is always valid.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-04 22:50:08 +08:00
hujun5
bc844509e2 addrenv: Ensure that the transmission parameter of addrenv_switch is not NULL
reason:
avoid obtaining this_task multiple times.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-04 14:20:12 +08:00
Tiago Medicci Serrano
5358f5b940 libm: Do not link the toolchain's libm unless explicitly selected
Fix CMake-based build system to include the toolchain's libm only
when `CONFIG_LIBM_TOOLCHAIN` is selected. Before this commit, if
the user selected `CONFIG_LIBM_NEWLIB`, for instance, the build
system would still link the toolchain's libm functions instead of
the ones provided by newlib.

PS: this commit applies the same changes previously introduced for
the other architectures.
2024-12-04 09:30:33 +08:00
hujun5
cc96289e2d xtensa: syscall SYS_switch_context and SYS_restore_context use 0 para
reason:
simplify context switch
sys_call0(SYS_switch_context)
sys_call0(SYS_restore_context)

size nuttx

before
   text    data     bss     dec     hex filename
 187620    1436  169296  358352   577d0 nuttx
after
   text    data     bss     dec     hex filename
 187576    1452  169280  358308   577a4 nuttx

size reduce -44

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-02 20:05:05 +08:00
Alin Jerpelea
8d50457dfc arch/xtensa: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-02 17:23:25 +08:00
hujun5
a0420df332 xtensa: remove g_running_tasks[this_cpu()] = NULL
reason:
We hope to keep g_running_tasks valid forever.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-02 13:29:59 +08:00
hujun5
321419491e missing update running_task
This commit fixes the regression from https://github.com/apache/nuttx/pull/14865

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-30 02:48:58 +08:00
hujun5
635da96bae xtensa: remove up_set_current_regs/up_current_regs
reason:
up_set_current_regs initially had two functions:

1: To mark the entry into an interrupt state.
2: To record the context before an interrupt/exception. If we switch to a new task, we need to store the upcoming context regs by calling up_set_current_regs(regs).

Currently, we record the context in other ways, so the second function is obsolete. Therefore, we need to rename up_set_current_regs to better reflect its actual meaning, which is solely to mark an interrupt.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-30 02:48:58 +08:00
YAMAMOTO Takashi
388ab6c2db esp32s3: don't clear pending interrupts on eg. up_putc
Fixes https://github.com/apache/nuttx/issues/14872
2024-11-28 19:00:21 +08:00
chao an
4dda9800b4 espressif/mcpwm: fix compile error
continue work of PR #14938

Signed-off-by: chao an <anchao@lixiang.com>
2024-11-26 16:34:19 +08:00
hujun5
53548509b1 fix build error
common/espressif/esp_rmt.c: In function 'rmt_set_tx_thr_intr_en':
common/espressif/esp_rmt.c:654:48: error: passing argument 1 of 'spin_lock_irqsave' makes pointer from integer without a cast [-Werror=int-conversion]
  654 |       flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
      |                                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~
      |                                                |
      |                                                spinlock_t {aka unsigned char}
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:617:55: note: expected 'volatile spinlock_t *' {aka 'volatile unsigned char *'} but argument is of type 'spinlock_t' {aka 'unsigned char'}
  617 | irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~~
CC:  nsh_script.c common/espressif/esp_rmt.c:662:48: error: passing argument 1 of 'spin_lock_irqsave' makes pointer from integer without a cast [-Werror=int-conversion]
  662 |       flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
      |                                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~
      |                                                |
      |                                                spinlock_t {aka unsigned char}
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:617:55: note: expected '

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 09:03:29 +08:00
hujun5
34e79f9618 spinlock: use spin_lock_init replace spin_initialize
reason:
1: spin_lock_init and spin_initialize have similar functionalities.
2: spin_lock and spin_unlock should be called in matching pairs.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 00:02:44 +08:00