Commit graph

23128 commits

Author SHA1 Message Date
Huang Qi
8a6e8320cf riscv: Suppress LOAD RWX linker warning
Suppress the warning message "nuttx has a LOAD segment with RWX permissions" in case of RAM boot mode is selected.
RAM MODE: BOOT_RUNFROMEXTSRAM/BOOT_RUNFROMISRAM/BOOT_RUNFROMSDRAM/BOOT_COPYTORAM

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-11 23:44:41 +08:00
guoshichao
6036a318f4 compiler: add __ARM_ARCH, __ARM_FEATURE_DSP macro definition in ghs
when we build mbedtls in vela with ghs compiler, the mbedtls need to
access __ARM_ARCH and __ARM_FEATURE_DSP, and to construct the inline asm
code based on these two macros.
With ghs compiler, these two macros are not defined, and will be
evaluated as 0 by default, and thus will using to wrong inline asm code,
in order to handle this issue, we need to add conversion between the ghs
and gcc with __ARM_ARCH, __ARM_FEATURE_DSP

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-11-11 22:18:05 +08:00
guoshichao
0679d45d5b nuttx/qemu: Fix funciton up_idle multiple definition
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-11-11 19:56:40 +08:00
guoshichao
a044e1896f arm_svcall: fix the naked_function function non-compatible issue
when build with greenhills_202354, the naked_function should only
contains the basic asm statements, so if the naked_function contains the
statements that using to accept params from C lang runtime, then build
error will reported:

error #101112: Only basic asm expressions are allowed for functions
with __attribute__((naked)): dispatch_syscall

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-11-11 19:56:13 +08:00
robert
5e8f1eefb0 Bluetooth: improved pairing process and host layer now successfully receives ACL packets 2024-11-10 14:33:52 -03:00
stbenn
cd479f6752 arch/stm32h5: Add ethernet hardware support files
This commit adds files in preperation of adding ethernet drivers for the STM32H563 and Nucleo-H563ZI board.
It also modifies the pinmap to include ethernet pins (and cleaned up leftover comments from L5 file), as well as
add those pins to the board.h for the nucleo-h563zi.

Files added:
  - arch/arm/src/stm32h5/hardware/stm32_ethernet.h
  - arch/arm/src/stm32h5/hardware/stm32_sbs.h
    - Not fully implemented, just register necessary for ethernet driver.
2024-11-10 01:11:10 +08:00
Kyle Wilson
19fc0628ae Update BOARD_USExxx naming, input clock selection, and setting of HSIDIV
The naming scheme in board.h changed from STM32H5_ to STM32_. As a result we needed to adjust the naming of the STM32H5_BOARD_USExxx variables in stm32h5xx_rcc.c. Also made changes to allow the enabling of all 3 of HSI, CSI, or HSE in stm32_stdclockconfig. Lastly, the HSIDIV bits in RCC_CR were not being cleared before being set. Added logic to clear these bits.

defined CSIRDY_TIMEOUT
2024-11-09 11:36:09 +01:00
Ville Juven
65cfd8a6ca riscv_syscall.S: Fix a massive bug in syscall dispatch logic
There is an enormous error in the system call dispatch logic; if a task
is inside a critical section (local interrupts disabled) there is a chance
that during a context switch when the task resumes, local interrupts are
erroneously ENABLED. This obviously leads to unexpected crashes and such.

This happens when the CPU status has Previous Interrupt Enable (PIE) set
to 1, even though Interrupt Enable (IE) is set to 0.

When the system call returns via ERET, the CPU sets PIE->IE and if PIE=1
interrupts get enabled.

This is fixed easily by explicitly CLEARING PIE from the register save
area, if IE=0 when the system call was started.
2024-11-08 12:51:39 -03:00
ouyangxiangzhen
f7abf7446f arch/arm64: Optimized SGI to avoid VM exit.
In the virtualized environment, each time an SGI is sent, the value of IGROUPR0 needs to be read once. Since the GIC Redistributor is a purely emulated device, each read of IGROUPR0 will cause a VM exit, causing serious performance degradation. This patch replaces the read with the value previously set in `gicv3_cpuif_init`, and we assume that this value has not been modified after initialization.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-11-08 01:23:46 +08:00
Jouni Ukkonen
ed8bfdd26a arch/arm64/imx9: Reset rx fifo in mode change
instead of looping just reset rxfifo

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-07 21:34:04 +08:00
Jouni Ukkonen
8c98194182 arc/arm64/imx9: Improve flexspi nor performance
-Increase clock to 133MHz
-Enable prefetch

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-07 16:51:13 +08:00
Jouni Ukkonen
a3d1b06214 arch/arm64/imx9 4byte addressing to nor
-Use 4byte addressing in flexpi nor
-report 4k blocksize to userland
-increase clock to 100MHz
-some cleanup

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-07 16:51:13 +08:00
Jouni Ukkonen
d260e7f59e imx9/flexcan: Add disable/enable cycle
Add enable/disable cycle to initialize
function to speed up soft reset

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-07 16:20:29 +08:00
lipengfei28
e29258391f arch/arm64: add have fork config
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-11-07 15:21:10 +08:00
Kyle Wilson
ad2db7a387 Fix Serial APB Clock Sources
The apbclock sources for lpuart1, usart6, usart10, and usart11 were set to the wrong PCLK (default).
2024-11-07 11:37:28 +08:00
stbenn
ca74d81a04 H5 Kconfig add ethernet, cleanup comments.
This is a combination of 2 commits:

H5 Kconfig ethernet options added.
  - This commit cleans up unecessary comments in the Kconfig and adds the the Ethernet/MAC menu.
    The menu is copied from the H7 menu, since the peripheral IP is identical.

Remove trailing whitespaces.

Update suggested mask
2024-11-07 09:55:01 +08:00
Kyle Wilson
400f2960e6 Added PLLxFRACN definitions. Updated board.h to use them. Updated board.h to set SYSCLK to 250 MHz properly.
PLL1FRACN was being set improperly. stm32h5xxx_rcc.c does not shift the value provided by board.h. So it was being set wrong. The defintions in stm32h5xxx_rcc.h shift the FRACN value and are now used by board.h. Also, board.h was not setting PLL1P properly. PLL1P can not have odd divisors. Therefore a value of 0 was invalid. Set it to a value of 1 (divide by 2), then adjust PLL1N to 31 and PLL1FRAC1 to 2048 to actually set SYSCLK to 250MHz.
2024-11-06 16:25:09 -03:00
Jukka Laitinen
4ba8723ab8 arch/arm64/src/common/arm64_fatal.c: Fix compilation warning with -Wextra
Wextra complains on some silly issues, like this one. Work around the issue in code directly.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-11-07 00:56:40 +08:00
Eren Terzioglu
3f77e97b03 esp32[s2|s3]: Add SPI bitbang support 2024-11-06 19:47:42 +08:00
Eren Terzioglu
243a2adcaf esp32[c3|c6|h2]: Add SPI bitbang support 2024-11-06 19:47:42 +08:00
wangmingrong1
f32f25c31e ci: Fix ci problem
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-06 17:30:27 +08:00
stbenn
904b6ff85b H5 with NSH support for Nucleo-H563ZI.
Made fixes to issues from CI. Nxstyle and defconfig syntax.

This is a combination of 6 commits.

Adding STM32H5 arch files. With comments addressed.

Created stm32h5 directory to add support for the H5 chip, and used a Nucleo-H563ZI dev board during development. The goal was to get a working nutshell through the STLink connector on the board.

Remove board/docs changes for PR update.

Squash commits into one for PR guideline conformity.

trying to fix build issues

Fix format from review

Nucleo-H563ZI support for NSH.

Created stm32h5 directory to add support for the H5 chip, and used a Nucleo-H563ZI dev board during development. The goal was to get a working nutshell through the STLink connector on the board.

Fix switch default case placement.

NXstyle fixes

Renaming files

rename stm32h5_gpio.x files

rename h5 hsi48 files

Rename h5 idle file

rename stm32h5_irq.c

Rename some rcc functions and stm32h5_rcc.c

rename stm32h5_rcc.h

Rename stm32h5_pwr.x

lowputc renames

timerisr renames

uart renamed

rename serial file

rename start

Turn off the defines that enable DMA on serial

remove DMA Kconfig options

Remove H5 documentation. Will add in a future PR.

Fix styling and defconfig improper syntax.
2024-11-06 10:28:49 +08:00
parallels
2b110ab64e Adding STM32H5 arch files. With comments addressed.
Created stm32h5 directory to add support for the H5 chip, and used a Nucleo-H563ZI dev board during development. The goal was to get a working nutshell through the STLink connector on the board.

Remove board/docs changes for PR update.

Squash commits into one for PR guideline conformity.

trying to fix build issues

Fix format from review
2024-11-06 03:17:45 +08:00
Jouni Ukkonen
6a0c239c8e arch/arm64/imx9: Clear edma4 mux conf before set
Warm boot might fail if edma4 channel mux is
not written to default value

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-06 02:56:52 +08:00
cuiziwei
f1d180d56e nuttx/sim: Remove math.h in sim.
The reason for removing math.h is that undefining __GLIBC__ does not take effect. By default, sim will use the toolchain's math library and undef __GLIBC__ in the source file.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-11-06 02:56:24 +08:00
wangmingrong1
6381685a8b toolchains: Compiler versioning adds --print-memory-usage
1. The "-print-memory-usage" parameter introduced in GNU Link version 2.26

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-06 01:57:38 +08:00
Felipe Moura
0fad2ee73f riscv/common/espressif: Fix spi slave driver
Fix defconfigs and documentation
2024-11-05 14:59:37 +08:00
wangmingrong1
3e605c1f46 clang/cmake: Fix clang cmake can't find libgcc, align with makefile
makefile:
ifeq ($(CONFIG_BUILTIN_TOOLCHAIN),y)
  COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)
  ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y)
    ifeq ($(wildcard $(COMPILER_RT_LIB)),)
      # if "--print-libgcc-file-name" unable to find the correct libgcc PATH
      # then go ahead and try "--print-file-name"
      COMPILER_RT_LIB := $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name $(notdir $(COMPILER_RT_LIB))))
    endif
  endif
endif

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-04 22:39:40 +08:00
ligd
561e1fc879 x86_64: fix compile warning
In function ‘void* std::__1::__libcpp_operator_new(_Args ...) [with _Args = {long unsigned int}]’,
    inlined from ‘void* std::__1::__libcpp_allocate(size_t, size_t)’ at /home/ligd/platform/trunk/nuttx/include/libcxx/new:294:31,
    inlined from ‘_Tp* std::__1::allocator<_Tp>::allocate(size_t) [with _Tp = char]’ at /home/ligd/platform/trunk/nuttx/include/libcxx/__memory/allocator.h:114:62,
    inlined from ‘constexpr std::__1::__allocation_result<typename std::__1::allocator_traits<_Alloc>::pointer> std::__1::__allocate_at_least(_Alloc&, size_t) [with _Alloc = allocator<char>]’ at /home/ligd/platform/trunk/nuttx/include/libcxx/__memory/allocate_at_least.h:55:27,
    inlined from ‘void std::__1::basic_string<_CharT, _Traits, _Allocator>::__grow_by_and_replace(size_type, size_type, size_type, size_type, size_type, size_type, const value_type*) [with _CharT = char; _Traits = std::__1::char_traits<char>; _Allocator = std::__1::allocator<char>]’ at /home/ligd/platform/trunk/nuttx/include/libcxx/string:2325:49,
    inlined from ‘std::__1::basic_string<_CharT, _Traits, _Allocator>& std::__1::basic_string<_CharT, _Traits, _Allocator>::__assign_external(const value_type*, size_type) [with _CharT = char; _Traits = std::__1::char_traits<char>; _Allocator = std::__1::allocator<char>]’ at /home/ligd/platform/trunk/nuttx/include/libcxx/string:2431:26,
    inlined from ‘std::__1::basic_string<_CharT, _Traits, _Allocator>& std::__1::basic_string<_CharT, _Traits, _Allocator>::assign(const value_type*, size_type) [with _CharT = char; _Traits = std::__1::char_traits<char>; _Allocator = std::__1::allocator<char>]’ at /home/ligd/platform/trunk/nuttx/include/libcxx/string:2444:35:
/home/ligd/platform/trunk/nuttx/include/libcxx/new:270:24: warning: argument 1 value ‘18446744073709551599’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  270 |   return ::operator new(__args...);

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-11-04 18:06:09 +08:00
ligd
91b228fcdd arm64: fix compile failed when build ELF apps
aarch64-none-elf-gcc -c -D_LDBL_EQ_DBL -fno-common -Wall -Wstrict-prototypes -Wshadow -Wundef -Werror -Wno-attributes -Wno-unknown-pragmas -Wno-psabi "-O3" -fno-strict-aliasing -fno-omit-frame-pointer -fno-optimize-sibling-calls -fstack-protector-all -fsanitize=kernel-address --param asan-globals=1 -ffunction-sections -fdata-sections "-g3" -mcpu=cortex-a53 -isystem /home/ligd/platform/trunk/nuttx/include -D__NuttX__  -pipe -I /home/ligd/platform/trunk/apps/crypto/mbedtls/include -I /home/ligd/platform/trunk/apps/crypto/mbedtls/mbedtls/include -I /home/ligd/platform/trunk/apps/crypto/openssl_mbedtls_wrapper/include -I /home/ligd/platform/trunk/apps/external/android/frameworks/native/libs/binder/include_rpc_unstable -I /home/ligd/platform/trunk/apps/external/android/frameworks/native/libs/binder/ndk/include_ndk -I /home/ligd/platform/trunk/apps/external/android/frameworks/native/libs/binder/ndk/include_platform -I /home/ligd/platform/trunk/apps/external/android/system/chre/chre/chre_api/include/chre_api -DCHRE_MESSAGE_TO_HOST_MAX_SIZE=2048 -I /home/ligd/platform/trunk/apps/external/android/system/core/libcutils/include -I /home/ligd/platform/trunk/apps/frameworks/graphics/uikit/include -I /home/ligd/platform/trunk/apps/frameworks/runtimes/feature/include -I /home/ligd/platform/trunk/apps/frameworks/runtimes/feature/src -I /home/ligd/platform/trunk/apps/frameworks/security/include -I /home/ligd/platform/trunk/apps/frameworks/system/dfx/include -I /home/ligd/platform/trunk/apps/frameworks/system/topics/include -I /home/ligd/platform/trunk/apps/frameworks/system/utils/include -I /home/ligd/platform/trunk/apps/graphics/lvgl -I /home/ligd/platform/trunk/apps/graphics/lvgl/lvgl -I "/home/ligd/platform/trunk/apps/system/argtable3/argtable3/src" -I /home/ligd/platform/trunk/apps/system/libuv/libuv/include -DUV_HANDLE_BACKTRACE=CONFIG_LIBUV_HANDLE_BACKTRACE -I /home/ligd/platform/trunk/apps/system/uorb/ -I /home/ligd/platform/trunk/nuttx/arch/arm64/src/board/include -I /home/ligd/platform/trunk/nuttx/arch/arm64/src/chip -I /home/ligd/platform/trunk/apps/vendor/bes/drivers/best1600_ep/miwear_drivers/display -I /home/ligd/platform/trunk/apps/vendor/bes/drivers/best1600_ep/miwear_drivers/boards -I /home/ligd/platform/trunk/apps/vendor/bes/drivers/best1600_ep/miwear_drivers/include -I "/home/ligd/platform/trunk/apps/include" -fvisibility=hidden -mlong-calls    modprint.c -o  modprint.c.home.ligd.platform.trunk.apps.examples.sotest.modprint.o

aarch64-none-elf-gcc: error: unrecognized command-line option '-mlong-calls'

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-11-04 16:24:29 +08:00
xuxin19
1bb01d40fd cmake(build):add the specified armclang compiler to the cmake Toolchain file
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-03 14:06:40 +08:00
Xiang Xiao
e777234714 Fix Error: implicit declaration of function 'enter_critical_section'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-11-03 11:26:44 +08:00
xuxin19
6e81b1ed91 cmake:implement CMake build of xtensa arch
configure:cmake -B build -DBOARD_CONFIG=iss-hifi4:nsh
build:cmake --build build
run:xt-run build/nuttx

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-11-02 18:08:38 +08:00
Eren Terzioglu
3796f56748 esp32[s2|s3]: Add I2C bitbang support 2024-11-01 11:41:46 -03:00
Eren Terzioglu
4afaef1a30 esp32[c3|c6|h2]: Add I2C bitbang supoort 2024-11-01 11:41:46 -03:00
ouyangxiangzhen
17c51c0667 userspace: Exclude nuttx/arch.h
This patch fixed userspace headers conflict. Architecture-related definition and API should not be exposed to users.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-11-01 16:59:37 +08:00
xuxin19
b8523280c2 cmake(bugfix):fix cxx build error on fastDDS X86_64
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-31 17:55:13 +08:00
xuxin19
8da0206a40 cmake:fix sim gc-section option build failed
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-31 17:55:13 +08:00
Jukka Laitinen
da19d79656 arch/arm64/src/imx9/imx9_lpuart.c: Fix parity get in TCGETS
This is a partial revert / fix for regression from 44d1811ebb

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-31 17:54:22 +08:00
hujun5
9b1800d043 irq: force inline up_interrupt_context
reason:
Replace "inline" with "inline_function" for "up_interrupt_context" to ensure consistency with other arch

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-31 15:43:41 +08:00
Ville Juven
f36dff8105 riscv/syscall: Fix sched_note instrumentation for BUILD_KERNEL
The sched_note calls were missing from riscv_perform_syscall().
2024-10-30 23:18:07 +08:00
xuxin19
e60c60b691 cmake(sync):fix cmake SIM build error build nuttx upstream
/usr/lib/x86_64-linux-gnu/libSM.so  /usr/lib/x86_64-linux-gnu/libICE.so  /usr/lib/x86_64-linux-gnu/libX11.so  /usr/lib/x86_64-linux-gnu/libXext.so  -lpthread  -lrt  -lm  -lasound  -lmad  -lv4l2 && :
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSM.so: error adding symbols: file in wrong format

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-30 22:14:40 +08:00
xuxin19
c60b980968 cmake(bugfix):fix robot openlibm cmake build missing source error
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-30 22:14:40 +08:00
Ville Juven
9d4218666c mpfs/smp: Add riscv_macros to mpfs_shead
To get definition for riscv_set_inital_sp macro
2024-10-30 22:09:01 +08:00
YAMAMOTO Takashi
761ee81956 move readv/writev to the kernel
currently, nuttx implements readv/writev on the top of read/write.
while it might work for the simplest cases, it's broken by design.
for example, it's impossible to make it work correctly for files
which need to preserve data boundaries without allocating a single
contiguous buffer. (udp socket, some character devices, etc)

this change is a start of the migration to a better design.
that is, implement read/write on the top of readv/writev.

to avoid a single huge change, following things will NOT be done in
this commit:

* fix actual bugs caused by the original readv-based-on-read design.
  (cf. https://github.com/apache/nuttx/pull/12674)

* adapt filesystems/drivers to actually benefit from the new interface.
  (except a few trivial examples)

* eventually retire the old interface.

* retire read/write syscalls. implement them in libc instead.

* pread/pwrite/preadv/pwritev (except the introduction of struct uio,
  which is a preparation to back these variations with the new
  interface.)
2024-10-30 17:07:54 +08:00
wangmingrong1
e3d7d23618 gcov: Fix typographical errors
1. CONFIG_ARCH_COVERAGE has been replaced by CONFIG_SCHED_GCOV
2. Delete the SIM-specific GCOV_ALL configuration and change it to a universal configuration for all architectures

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-30 14:45:23 +08:00
nuttxs
0c5381a0a1 xtensa/esp32s3: add esp32s3 reset reasons interface 2024-10-29 23:03:37 +08:00
Gao Feng
782ab3b248 xtensa/esp32s3: enable encrypted flag based on partition and device
If device encryption is not enabled by eFuse, and partiton mark as
encrypted flag, then encrypted MTD is used.

That is no problem in write and read operation, but failed while
using spi_flash_mmap(...) since de-encrypt is not processed.

So, back to use non-encrypted MTD following API Guide:
If flash encryption is not enabled, the flag "encrypted" has no effect
2024-10-29 23:02:35 +08:00
cuiziwei
d42f16939e nuttx: Fix build warning with can't found xt-g++
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-29 22:27:58 +08:00
Jukka Laitinen
62194400f9 imx9/serial: Take proper use of RX/TX FIFOs, clean up interrupt service routine
- i.MX93 LPUARTs have 16-byte RX and TX FIFOs. Take those into use and correct some related register definitions
- There is no reason to loop inside interrupt handler, remove the looping

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-29 22:24:48 +08:00
Jukka Laitinen
44d1811ebb imx9/serial: Clean up the flow control code
- Remove GPIO (SW) based flow control. It didn't work, and pure HW flow control seems to work fine
- Remove some unneeded ifdefs and change bit-field flags to booleans to clean up the code

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-29 22:24:48 +08:00
wangmingrong1
083f9d162e clang/ld.lld: clang17 and above support the option --print-memory-usage
1. cmake uses clang++ as a connector, and does not currently support:
	clang++: error: unknown argument: '-wl,--print-memory-usage'
	clang++: error: no input files

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-29 20:43:35 +08:00
chao an
e3689cbb2f CMake/preprocess: fix typo PREPROCES -> PREPROCESS
correct the marco define from PREPROCES to PREPROCESS

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-29 17:41:01 +08:00
raiden00pl
716d898dda arch/arm/stm32/stm32_dumpgpio.c: fix print warnings
fix print warnings for stm32_dumpgpio.c
2024-10-29 02:23:36 +08:00
raiden00pl
7ebb8af454 arch/arm/stm32/Kconfig: fix Kconfig error
fix Kconfig error related to STM32_HAVE_HRTIM1_PLLCLK
2024-10-28 19:36:17 +08:00
wangmingrong1
e174d73cd9 clang:libclang_rt.builtins-xxx.a supports builtin
1. enable CONFIG_BUILTIN_COMPILER_RT  to built libclang_rt.builtins-xxx.a and no longer use the compiler's built-in
2. Modify clang version acquisition to get two decimal points
3. It has been ported to support four architectures: ARM, ARM64, RISCV, and x86_64, among which ARM has been validated

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-28 16:38:45 +08:00
Xiang Xiao
69100ef0e4 arch: Fix minor style issue
not real behaviour change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-28 09:24:55 +01:00
raiden00pl
b5e5cdd851 arch/arm/stm32h7: add workaround for Renode
Add an option to disable busy wait PWR_CSR1_ACTVOSRDY during boot
which doesn't work with Renode simulation
2024-10-26 20:49:49 +08:00
chao an
c6591c0f49 driver/serial: remove return value of up_putc()
modify the prototype of up_putc(): remove the return value

The architecture code does not care about the return value of up_putc(), so removing it saves two statements:

Before:                                                    After:
de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)    |  de4c: e52de004  push  {lr}    @ (str lr, [sp, #-4]!)
de50: e24dd014  sub sp, sp, #20                         |  de50: e24dd014  sub sp, sp, #20
de54: e58d0004  str r0, [sp, #4]                        |  de54: e58d0004  str r0, [sp, #4]
de58: e30030f8  movw  r3, #248  @ 0xf8                  |  de58: e30030f8  movw  r3, #248  @ 0xf8
de5c: e3423000  movt  r3, #8192 @ 0x2000                |  de5c: e3423000  movt  r3, #8192 @ 0x2000
de60: e58d300c  str r3, [sp, #12]                       |  de60: e58d300c  str r3, [sp, #12]
de64: e59d1004  ldr r1, [sp, #4]                        |  de64: e59d1004  ldr r1, [sp, #4]
de68: e59d000c  ldr r0, [sp, #12]                       |  de68: e59d000c  ldr r0, [sp, #12]
de6c: ebfffe66  bl  d80c <pl011_putc>                   |  de6c: ebfffe66  bl  d80c <pl011_putc>
de70: e59d3004  ldr r3, [sp, #4]                        |  de70: e28dd014  add sp, sp, #20
de74: e1a00003  mov r0, r3                              |  de74: e49df004  pop {pc}    @ (ldr pc, [sp], #4)
de78: e28dd014  add sp, sp, #20                         |
de7c: e49df004  pop {pc}    @ (ldr pc, [sp], #4)        |

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-26 13:21:29 +08:00
Haiyue Wang
d0f957ae85 qemu-intel64: Fixes the linker 'noexecstack' warning
Fix the linker warning based on these two commits:

 ld: warning: fork.o: missing .note.GNU-stack section implies executable stack
 ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

commit 36ac812114 ("sim: Fixes the following linker warning:"),
commit b5d640acc5 ("fix Cygwin/MSYS2  ld: unrecognized option '-z'")
2024-10-26 11:10:43 +08:00
raiden00pl
da1ff4cf77 arch/arm/stm32: convert error to warning when CCM is not enabled
User may set CONFIG_MM_REGIONS=1 on purpose to disable CCM.
This is a completely normal system config and should not be treated as error.

I found this problem trying to run Renode with stm32f4discovery/nsh but
Renode doesn't support CCM so we have to disable it
2024-10-26 11:02:19 +08:00
YAMAMOTO Takashi
6a2e21dd07 esp32: Fix a heap corruption bug with SPIRAM
Don't add SPIRAM ("HEAP2") to both of kernel/user heaps.

Sync with the corresponding logic in esp32s3.
2024-10-25 19:03:22 +08:00
chao an
b28f87e3f0 arm/gicv3: replace this_cpu() to up_cpu_index()
If the core id needs to be included in the hardware register
calculation, up_cpu_index() should be used instead of this_cpu().

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-25 14:27:34 +08:00
Jinliang Li
5fb0c44f38 arm/armv8-r: optimize generic timer initialization
1. Enable timer and irq finally to make sure timer callback was already
   registered. When the CPU resets, the values of some generic timer
   registers are undefined. Enabling the timer interrupt in advance may
   cause the timer to trigger early while the timer callback is not yet
   registered. This results in the timer ISR being executed, which masks
   the timer interrupt. Since the timer callback is not registered at
   this point, the timer interrupt is not unmasked, further causing the
   system scheduler to hang.
2. Remove timer mask for one-shot timer and that's in isr,
   irq/fiq is disabled. Masking generic timer is not necessary, and it
   may introduce risks, otherwise, mask/unmask must be pair in all
   situations.

Signed-off-by: Jinliang Li <lijinliang1@lixiang.com>
2024-10-25 13:17:08 +08:00
Jinliang Li
40bbe7f3e9 arm/armv8-r: init HSCTLR and HACTLR for EL2
1. init HSCTLR to enable i-cache/d-cache for EL2
2. init HACTLR to enable all access to implementation defined
   registers for EL1.
3. add dsb/isb before switch to EL1 from EL2

Signed-off-by: Jinliang Li <lijinliang1@lixiang.com>
2024-10-25 12:09:47 +08:00
chao an
ea4c4ef36a arm/armv8-r: fix unable to switch context in ISR context
Regression by:
| commit 35c8c80a00
| Author: ligd <liguiding1@xiaomi.com>
| Date:   Fri Jul 26 23:14:13 2024 +0800
|
| arch: change nxsched_suspend/resume_scheduler() called position

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-25 09:47:37 +08:00
Tim Hardisty
517c66daf8 sam_sfc.c incorrect EFUSEIOC name used 2024-10-25 08:42:40 +08:00
wangmingrong1
f11b04fc61 kconfig: Add link parameters that can print remaining memory information
LD: nuttx
Memory region         Used Size  Region Size  %age Used
           flash:      284272 B       512 KB     54.22%
           sram1:       13296 B         2 MB      0.63%
           sram2:          0 GB         2 MB      0.00%
CP: nuttx.hex
CP: nuttx.bin

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-25 00:55:50 +08:00
buxiasen
974db76cb9 sim/cmake: compatible when nuttx COMPILE_OPTIONS is not set yet
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-24 21:42:06 +08:00
wangmingrong1
d007193eef armv8m/clang.cmake: add armv8m clang config
Its makefile is implemented in arch/arm/src/armv8-m/Toolchain.defs as follows:
ifeq ($(CONFIG_ARM_TOOLCHAIN_CLANG),y)

  ifeq ($(CONFIG_ARCH_CORTEXM23),y)
    TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp
  else ifeq ($(CONFIG_ARCH_CORTEXM33),y)
    ifeq ($(CONFIG_ARCH_FPU),y)
      TOOLCHAIN_CLANG_CONFIG = armv8m.main_hard_fp
    else
      TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp
    endif
  else ifeq ($(CONFIG_ARCH_CORTEXM35P),y)
    ifeq ($(CONFIG_ARCH_FPU),y)
      TOOLCHAIN_CLANG_CONFIG = armv8m.main_hard_fp
    else
      TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp
    endif
  else ifeq ($(CONFIG_ARCH_CORTEXM55),y)
    ifeq ($(CONFIG_ARCH_FPU),y)
      TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_hard_fp
    else
      TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_soft_nofp_nomve
    endif
  else ifeq ($(CONFIG_ARCH_CORTEXM85),y)
    ifeq ($(CONFIG_ARCH_FPU),y)
      TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_hard_fp
    else
      TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_soft_nofp_nomve
    endif
  endif

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-24 18:41:11 +08:00
Michal Lenc
d8ed88c8a6 samv7: fix QSPI build
Commit 313d6df7 caused the following build error:

CC:  fixedmath/lib_b16atan2.c chip/sam_qspi.c: In function 'qspi_memory':
chip/sam_qspi.c:1552:7: warning: implicit declaration of function 'IS_ALIGNED' [-Wimplicit-function-declaration]
 1552 |       IS_ALIGNED((uintptr_t)meminfo->buffer, 4) &&
      |       ^~~~~~~~~~
In file included from chip/sam_qspi.c:41:
chip/sam_qspi.c: In function 'qspi_alloc':
chip/sam_qspi.c:1591:21: warning: implicit declaration of function 'ALIGN_UP' [-Wimplicit-function-declaration]
 1591 |   return kmm_malloc(ALIGN_UP(buflen, 4));

This was caused by missing include of nuttx.h header defining ALIGN_UP
and IS_ALIGNED.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-10-24 18:00:05 +08:00
zhanghongyu
c3a0155374 arch/Kconfig: remove ARCH_MATH_H if LIBCXX
Because some libraries do require a full libm implementation.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-24 17:44:22 +08:00
hujun5
9395669ac0 arm64: fix fvp smp faild to boot
reason:
we should give a busy wait addr

This commit fixes the regression from https://github.com/apache/nuttx/pull/13640

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-24 10:17:48 +08:00
cuiziwei
12fd5ec472 nuttx: Add LIBSUPCXX_TOOLCHAIN to link the prebuilt library provide by toolchain.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-24 01:38:03 +08:00
Tiago Medicci Serrano
d1fd1ed8f6 boards/esp32s3: Merge MCUboot and "simple-boot" linker scripts
To make it easier to keep the linker scripts updated for both
MCUboot and "simple-boot", this commit merges them into a single
linker script with macros to enable/disable specific sections.
2024-10-23 22:26:39 +08:00
cuiziwei
60e7a0074d nuttx/arch:Enabling ARCH_MATH_H is required when compiling sim with the 13.2 version of the toolchain.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-23 20:10:43 +08:00
Jukka Laitinen
cdd11112fd arch/arm64/src/imx9/imx9_lpspi.c: Small cache operation optimization
There is no need to invalidate the RX buffer before every transfer.
It is never gets dirty, so it is good to invalidate initially after allocation,
and after each transfer.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-23 19:46:42 +08:00
Jukka Laitinen
6cadfc16cd arch/arm64/src/imx9/imx9_lpspi.c: Fix 9-16 bit transfers
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-23 19:46:42 +08:00
Jinliang Li
52995452e5 arm/build: suppress LOAD RWX linker warning
Add --no-warn-rwx-segments in case of RAM boot mode to linker to
suppress the below warning:
"nuttx has a LOAD segment with RWX permissions"

Signed-off-by: Jinliang Li <lijinliang1@lixiang.com>
2024-10-23 19:38:31 +08:00
lipengfei28
3225aa853f arch/arm64: vector table 2K align
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-23 15:15:12 +08:00
liwenxiang1
eb722794b5 arch/x86_64:Fix variable used before assignment
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-23 14:28:59 +08:00
lipengfei28
877f42cde5 remove unused variable 'cpu_freq'
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-23 10:53:27 +08:00
wangmingrong1
45c5d3c143 arm64/toolchains:Add the following kasan compilation options
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-23 10:53:16 +08:00
lipengfei28
c95ed45ccc arhc/arm64: vector table may be far away form arm64_fatal_handle
use 33-bit (+/-4GB) pc-relative addressing to load
the address of arm64_fatal_handle

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-23 10:09:17 +08:00
buxiasen
105d47b9a6 arch/sim/cmake: remove the host specific -U when HOSTSRCS
fix macos compile hostfs.c compile issue.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/_string.h:131:62: error: expected function body after function declarator
  131 | char    *stpncpy(char *__dst, const char *__src, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
      |                                                              ^

Signed-off-by: buxiasen <buxiasen@gmail.com>
2024-10-23 10:08:23 +08:00
yangsong8
5b5f148178 sim_uart: rm LF to CRLF convertion
LF to CRLF has been converted in syslog framework

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-10-23 00:37:43 +08:00
qinwei1
9b0fc1277b arm: add memory map for DDR region
Summary
  add memory map for DDR region

fix arm-v7a/knsh boot dataabort on arm_addrenv_utils.c first time memset
after arm_pgvaddr.

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2024-10-22 13:33:39 +08:00
cuiziwei
8e95f6800b fix GCCVER cmake define.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-21 18:03:23 +02:00
xuxin19
82677145ed cmake(bugfix):Fixed the issue that the host toolchain version cannot be specified
SIM arch does not need to execute find_program

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-21 18:28:39 +08:00
Felipe Moura
0496f357c9 Fix spi slave communication issue 2024-10-21 12:21:39 +08:00
dongjiuzhu1
c4780f1a69 drivers/spi_slave: call SPIS_DEV_NOTIFY when rx or tx complete for all spi slave driver
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-20 15:48:00 -03:00
guoshichao
65aa5415a7 cmake: fix the fdiagnostics-color handle issue
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-10-19 14:32:35 +08:00
cuiziwei
9614e1fed5 Add GCCVER define to Toolchain.cmake
Since GCCVER will also be used in the toolchain, it needs to be defined in advance.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-19 14:32:08 +08:00
cuiziwei
541f30878a arch/x86_64:Add CXX configuration for enabling x86_64 support for C++ applications.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-18 23:53:35 +08:00
Eren Terzioglu
05ba822c41 esp32[c3]: Add BLE support 2024-10-18 21:33:58 +08:00
Ville Juven
5de9d957e6 ricv/riscv_cpuid: Return meaningful values for CPU/Hart ID when SMP=no
Return 0 for CPU ID for any hart ID, and return the current Hart ID for
any CPU ID. At least these values are somewhat usable / meaningful in
non-SMP configurations.
2024-10-18 21:31:17 +08:00
Ville Juven
cf95305934 mpfs/mpfs_plic: Add procedure to initialize per hart PLIC state
MPFS implements external interrupt control on a per-hart basis i.e. there
are PLIC control registers for each hart separately. This means we need
a procedure to initialize such registers for each hart individually,
instead of only for the boot hart like it is now.

Fix this by implementing mpfs_plic_init_hart which can be called by each
hart as needed.

Note: it is not a good idea to initialize all harts from the boot hart,
as the boot hart may not know which harts are used by NuttX in AMP
configuration. It is better that the hart initializes itself.

Note: The hartid must be provided as explicit parameter, as it cannot
be queried via riscv_mhartid() yet; the per-cpu structure is initialized
later on which means riscv_mhartid() would return 0 for all harts except
the boot hart.
2024-10-18 19:34:57 +08:00
Ville Juven
a33e63097a riscv/mpfs: Add boilerplate code for SMP 2024-10-18 19:34:57 +08:00
Ville Juven
c99de98995 mpfs_start: Initialize percpu as soon as possible
Otherwise querying for hartid doesn't work.
2024-10-18 19:34:57 +08:00
Xiang Xiao
24cb8c25ab bluetooth: Fix the incompatibility made by https://github.com/apache/nuttx/pull/14224
that pr requires chip turn on CONFIG_DRIVERS_BLUETOOTH to use bluetooth,
but not all defconig enable this option, so let's map bt_driver_register
to bt_netdev_register in header file in this case, and revert the unnessary
change in the related chip and board folders.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-18 09:05:54 +08:00
buxiasen
bc019cb913 arm/lc823450: use custom vectors to make smp_call work with exception_common
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-17 22:57:14 +08:00
buxiasen
15804c340a arm/sam4cm: use custom vectors to make smp_call work with exception_common
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-17 22:57:14 +08:00
buxiasen
d410eedfde arm/rp2040: use custom vectors to make smp_call work with exception_common
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-17 22:57:14 +08:00
buxiasen
9a73b28973 arm/cxd56: use chip specific vectors to allow smpcall update regs
When sig dispatch do up_schedule_sigaction, need to make a new frame to
run arm_sigdeliver. But the exception_direct cannot handle xcp.regs as
we are using c-function exception handler.
Need to use exception_common to handle SMP call.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-17 22:57:14 +08:00
buxiasen
4e2b77cb04 arch/arm: add support for chip to replace the default vector table
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-17 22:57:14 +08:00
Ville Juven
25b33f202e riscv_cpuindex.c: Fix usage of CONFIG_ARCH_RV_HARTID_BASE
The offset was supposed to assume hartid > cpuid, so when converting from
hartid we must subtract the offset to get the cpuid and vice versa.
2024-10-17 22:54:06 +08:00
chengkai
6aeb2e2996 Add space before error, bt_driver_register_internal not trigger error, add defconfig DRIVERS_BLUETOOTH.
Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai
31605b6335 bluetooth: call bt_driver_register common interface
Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai
113b660aa6 bluetooth: fix dev->rxlen is considered to have possibly overflowed
rootcause: fix the expression dev->rxlen is considered to
have possibly overflowed.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
chengkai
933841d985 bluetooth:support read imcompleted hci data from blueooth socket
hci data from bluetooth socket maybe imcompleted hci data.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2024-10-17 18:09:32 +08:00
Ville Juven
8811eee0f4 riscv_cpustart.c: Fix reading of interrupt status
Let's read the interrupt status correctly, by checking for the interrupt
source bit instead of assuming no other status bit is set.
2024-10-17 18:08:10 +08:00
Ville Juven
8fe3ab3e39 arch/arm64: Remove arm64_copystate.c
The file is not referenced from anywhere and is obsolete / dead code anyway
-> remove it from the index.
2024-10-17 18:07:54 +08:00
Ville Juven
737dc4fcdd arch/riscv: Implement cpuid mapping
Implement hartid<->cpuid mapping for RISC-V. This is necessary for some
platforms which cannot use 1:1 mapping between logical and physical CPU /
core IDs. One example is MPFS where hart0 cannot be used for NuttX SMP as
it is a less capable "monitor" core (E51) compared to the application
cores hart1...3 (E54).

Why not just use a generic offset then? We also need the physical hart ID
for many things:
- Communication between harts (IPI)
- External interrupt acknowledgment (interrupt claim for specific CPU)
- Communication to SBI

Thus, create procedures that can do this translation:
- The default mapping is still logical=physical.
- Another flavor is to use the existing CONFIG_ARCH_RV_HARTID_BASE config
  variable, which is just a simple offset
- The final flavor is to overload hartid<->cpuid on a per chip basis (no
  example for this is provided yet)
2024-10-17 13:43:06 +08:00
Ville Juven
2195b47655 smp: Implement empty macro for obtaining logical CPU index
This implements empty hooks to the arch/chip layer, which can implement
an optional translation between logical<->physical CPU/core id.

The default mapping is 1:1 i.e. logical=physical.
2024-10-17 13:43:06 +08:00
Ville Juven
f47c0a1953 arch/riscv: Remove CONFIG_ARCH_RV_HARTID_BASE offset from riscv_mhartid
The function is supposed to return the physical hart ID. It is needed
for e.g. external interrupt acknowledgment (see mpfs_plic.c).

This offset is moved initially to up_cpu_index (which is also wrong, but
less wrong than the current implementation). Finally, a translation
between physical <-> logical shall be provided.
2024-10-17 13:43:06 +08:00
lipengfei28
ef350afd28 Revert "arch/arm64: add CONFIG_ARCH_VMA_MAPPING"
This reverts commit e7326cfa62.
2024-10-17 12:28:58 +08:00
Petro Karashchenko
2048715134 serial: remove 'TIOCSLINID'
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-17 09:08:58 +08:00
Petro Karashchenko
919242d8b9 arch/arm/samv7: fix warnings in rswdt
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-17 09:08:01 +08:00
Petro Karashchenko
beda2abe3b arch/arm/samv7: fix preprocessor logic for ethernet
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-10-17 09:08:01 +08:00
Jukka Laitinen
d6c795dda3 imx9/flexcan: Make self reception disable to be configurable
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-17 09:02:17 +08:00
Xiang Xiao
c6aed84638 tools: Rename apps-or-nuttx-Make.defs to Make.defs
follow the same pattern as other Make.defs files

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-17 07:55:02 +08:00
yangsong8
8c13b8df1d syslog: convert \n to \r\n in syslog framework layer
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-10-17 02:29:51 +08:00
Ville Juven
526ba1ab34 riscv/cpustart: Ensure we receive Soft IRQ / IPI before booting CPU
Some spurious interrupt might wake WFI, ensure we got woken by IPI before
continuing CPU boot.
2024-10-16 23:19:33 +08:00
liwenxiang1
eb27ebba8a arch/x86_64: The AP retrieves this_task after storing the CPU private data
this_task obtains the CPU ID through the GS register, so the initial value of GS needs to be configured in x86_64_cpu_priv_set

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>

x86_64/intel64: fix SMP compilation warnings

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-16 22:09:00 +08:00
yaojingwei
aaace108fb sim_camera: modify sim camera init videosize using imgsensor extend params.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2024-10-16 19:50:19 +08:00
nuttxs
1a621bcb37 xtensa/esp32s3: Inspect if the MTD partition (factory/ota_0/ota_1)
is mapped as text.
Relocate the enum ota_img_ctrl_e and ota_img_bootseq_e to
a directory visible to the application.
2024-10-16 18:43:58 +08:00
anjiahao
15fa55f234 mps3-an547:let ap build with pic,and use bootloader boot it
Implement PIC loading in armv8-m qemu,
for example: load address-independent AP ELF in the bootloader,
and the text segment in AP ELF is XIP,
no need to apply for memory and modify it.

Two config:

bootloader abbreviation bl:
  use romfs to load ap elf, use the boot command to parse and jump to ap

application abbreviation ap:
  run os test

We need to compile ap first, then compile bl.

compile step:
  ./tools/configure.sh mps3-an547:ap
  make -j20
  mkdir -p pic
  cp boot pic/.
  genromfs -a 128 -f ../romfs.img -d pic
  make distclean -j20
  ./tools/configure.sh mps3-an547:bl
  make -j20

run qemu:
  qemu-system-arm -M mps3-an547 -m 2G -nographic -kernel nuttx.bin \
    -gdb tcp::1127 -device loader,file=../romfs.img,addr=0x60000000

  nsh> boot /etc/boot
  ap> ostest

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 18:40:06 +08:00
anjiahao
c11a2fa450 arm-m:let vectors address align
According to the ARM architecture manual,
the address of vectors need alignment

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 18:40:06 +08:00
anjiahao
b81b16ba97 arm7/8-m:support all nuttx iamge build with pic
Need to start up a new to setup special registers use
`arm_pic_setupxcp`.

Note that CONFIG_BUILD_PIC compiles the entire NuttX image
as position-independent(PIC), enable CONFIG_PIC to load PIC
application code.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 18:40:06 +08:00
anjiahao
112b6fd9a5 modlib:support modlib can load PIC elf
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 18:40:06 +08:00
fanjiangang
b6a4e91ef0 armv8-r/cp15: fix the problem of op1 operand confusion in ICC_SGI1R
Reference:

https://developer.arm.com/documentation/100026/0103/Generic-Interrupt-Controller/GIC-programmers-model/CPU-Interface-Registers

              CRn   Op1    CRm    Op2
    ICC_SGI0R  -     2     c12     -
    ICC_SGI1R  -     0     c12     -

Signed-off-by: fanjiangang <fanjiangang@lixiang.com>
Signed-off-by: chao an <anchao@lixiang.com>
2024-10-16 17:17:30 +08:00
yinshengkai
d01bbaecc1 sim/heap: malloc returns a valid pointer when allocating 0 bytes.
The default heap management in nuttx returns a valid memory address when malloc(0).
In sim_heap, malloc(0) returns NULL, aligning the behavior of sim_heap with mm_heap

The man manual describes malloc as follows:
https://man7.org/linux/man-pages/man3/malloc.3.html

The malloc() function allocates size bytes and returns a pointer
to the allocated memory.  The memory is not initialized.  If size
is 0, then malloc() returns a unique pointer value that can later
be successfully passed to free().  (See "Nonportable behavior"
for portability issues.)

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-16 17:03:40 +08:00
Jukka Laitinen
6a5b395459 arch/arm64/src/imx9: Add initial version of canbus driver
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-16 15:43:19 +08:00
Jukka Laitinen
bcfdb58686 arch/arm64/src/common/arm64_initialize.c: Add initializing of socket can interface
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-16 15:43:19 +08:00
wurui3
de2920605d sim_offload: add MONO channel encode method and set samplerate before encode.
According to different pcm data format, set real sample rate and encode separately.

Signed-off-by: wurui3 <wurui3@xiaomi.com>
2024-10-16 15:40:35 +08:00
wangmingrong1
bf70cd2bce bug/fix: Makefile expression error caused
expr: syntax error: unexpected argument "12"
expr: syntax error: unexpected argument "12"

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-16 15:35:04 +08:00
Peter Bee
8f77e3cfc4 select ARM_HAVE_MVE and ARCH_HAVE_FPU for mps platform
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2024-10-16 13:55:30 +08:00
ouyangxiangzhen
a45f903650 imx8qm-mek: Resolve boot issue for non-EL3 environments.
This commit addresses the issue of unauthorized writes to cntfrq_el0 during boot when not in EL3 mode.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-16 13:54:44 +08:00
liwenxiang1
8a1743d0a6 arch/x86_64: Resolving NUC Boot Failure Issue
The segment of the Xen PVH boot protocol was not specified during linking and was placed before .loader.text, causing the boot to fail

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-16 13:53:11 +08:00
wangming9
d9558a3583 arm/armv7-r: Correctly use CONFIG_ARMV7R_ASSOCIATIVITY_16WAY
Signed-off-by: wangming9 <wangming9@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-16 12:27:10 +08:00
qiaohaijiao1
54e128367d sim/alsa: clear AUDIO_APB_FINAL flag before DEQUEUE
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2024-10-16 12:23:17 +08:00
qiaohaijiao1
eba292f4b9 sim/alsa: add ptr check in _stop
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2024-10-16 12:21:19 +08:00
qiaohaijiao1
09afb4d7d0 sim/alsa: fix runtime warning.
sim/posix/sim_offload.c:369:18: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
    #0 0x3a146c2  (/home/qiaohj/disk1/work/vela/nuttx/nuttx+0x3a146c2)
    #1 0x3a0ecb0  (/home/qiaohj/disk1/work/vela/nuttx/nuttx+0x3a0ecb0)
    #2 0x3a1193a  (/home/qiaohj/disk1/work/vela/nuttx/nuttx+0x3a1193a)
    #3 0x3a13141  (/home/qiaohj/disk1/work/vela/nuttx/nuttx+0x3a13141)
    #4 0x39fc3ef  (/home/qiaohj/disk1/work/vela/nuttx/nuttx+0x39fc3ef)
    #5 0x38ca7f2  (/home/qiaohj/disk1/work/vela/nuttx/nuttx+0x38ca7f2)
    #6 0x39fc6cf  (/home/qiaohj/disk1/work/vela/nuttx/nuttx+0x39fc6cf)

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2024-10-16 12:17:35 +08:00
Gao Jiawei
d5c44de14c add missing source file
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-10-16 08:04:13 +08:00
Kyle Wilson
df47241a2b STM32G4 Flash Driver
Added a flash driver for the STM32G4 series. The primary change here is
the addition of stm32g4xxx_flash.c. This file uses the STM32L4 flash
driver as a template. The primary difference is the accounting for dual
banks with different page sizes.

Fixed error while building b-g474e-dpow1/buckboost. It was possible (technically) to have page be used uninitialzied. Changing the if statement to default to using a flash_page_size == 2048 fixes this issue.
2024-10-15 18:11:38 -03:00
cuiziwei
9d9857acd2 Change the judgment of GCCVER version to greater equal.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 23:32:13 +08:00
Tim Hardisty
bb7dce11a2 SAMA5 fix compiler warning in sam_adc.c 2024-10-15 11:37:54 -03:00
zhangyuan29
57650d841e armv8-m: set fpscr when do exception_direct
In armv8m the FPSCR[18:16] LTPSIZE field must be set to 0b100 for
"Tail predication not applied" as it's reset value.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-10-15 22:16:09 +08:00
anjiahao
ef9640c696 armv7-a:adjust gdb register order
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-15 21:46:41 +08:00
wangming9
5b14fb75bc arm/fpu: FPU is supported when the TEE is enabled
Summary:
1. Support armv7-a armv7-r armv8-r
2. The NSACR is read-only in Non-secure PL1 and PL2 modes.
3. The NSACR is read/write in Secure PL1 modes.
4. When the NSACR.{CP11,CP10} bit is set to 1,
   Non-secure access to coprocessor 11,10 enable

Signed-off-by: wangming9 <wangming9@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-15 21:11:15 +08:00
wangming9
f465443f37 cpuinfo: Decouple the fetch cpuinfo from up_perf_getfreq
Summary:
Add the default CPU frequency configuration.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-15 21:11:15 +08:00
wangming9
6ee747a1e6 arm/goldfish: add memory map for DDR region
Signed-off-by: wangming9 <wangming9@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-15 21:01:47 +08:00
hujun5
49b9aa0f33 arm/riscv: remove redundant judgment
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-15 15:32:40 +08:00
hujun5
aa0346610b arm64: we need to initialize the percpu register storing the current task more earlier.
A call stack looks like the following:
sched_idletask
syslog_write
nx_vsyslog
syslog
getreg64
gic_validate_redist_version
arm64_gic_init
arm64_gic_secondary_init
arm64_boot_secondary_c_routine

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-15 15:25:55 +08:00
hujun5
948ac9b4cc arm64: add up_this_task and up_change_task macro impl
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-15 15:25:55 +08:00
xuxin19
696e1a3f70 cmake(fix warning):toolchain do not have parent scope
toolchain file variable is global scope
dont need set parent scope

clear warning:
CMake Warning (dev) at /github/workspace/sources/nuttx/arch/arm/src/cmake/gcc.cmake:69 (set):
  Cannot set "GCCVER": current scope has no parent.
Call Stack (most recent call first):
  /github/workspace/sources/nuttx/arch/arm/src/cmake/Toolchain.cmake:56 (include)
  /github/workspace/sources/nuttx/build/CMakeFiles/3.26.0/CMakeSystem.cmake:6 (include)
  /github/workspace/sources/nuttx/build/CMakeFiles/CMakeScratch/TryCompile-ZJVOZO/CMakeLists.txt:5 (project)
This warning is for project developers.  Use -Wno-dev to suppress it.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-15 12:38:14 +08:00
cuiziwei
036a0674db nuttx/libc:Add _dl_find_object and dl_iterate_phdr function.
Add _dl_find_object() function, because when cxx_exception configuration is enabled, a link error occurs and that function cannot be found.

ld: /usr/lib/gcc/x86_64-linux-gnu/13/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `_Unwind_Find_FDE':
(.text+0x250c): undefined reference to `_dl_find_object'

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 12:35:54 +08:00
wanggang26
aef584a804 shm:fix build error
nuttx/arch/arm/src/armv7-a/arm_addrenv_shm.c:77:(.text.up_shmat+0x2e):
undefined reference to `shminfo'

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 11:40:34 +08:00
wanggang26
7e5fb8450f coredump: add architecture-specific registers dump, including NVIC and MPU
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 11:40:05 +08:00
cuiziwei
6f62ef0b6f nuttx/sim:Remove asan check in up_irq_save().
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 03:36:55 +08:00
hujun5
d77cb8af70 sched: fix nxsched_process_delivered did not call hook
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-15 01:50:06 +08:00
hujun5
10659a8bc2 irq: irq_attach_wqueue replace irq_attach_thread
reason:
using a shared same priority queue can reduce memory consumption.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-15 01:12:14 +08:00
wanggang26
3fad764804 arch/armv7:fix a typo
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 01:06:59 +08:00
Xu Xingliang
632feb2b51 arch/arm64: remove struct regs_context
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-14 23:05:56 +08:00
cuiziwei
a08df48774 arch/x86_64:Add CXX configuration for enabling x86_64 support for C++ applications.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-14 19:03:30 +08:00
xuxingliang
f031dc39a6 arch/arm64: fix build warnings
common/arm64_mpu.c:355:13: error: format '%llX' expects argument of type 'long long unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=]
  355 |       _info("MPU-%d, 0x%08llX-0x%08llX SH=%llX AP=%llX XN=%llX\n", i,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
common/arm64_mpu.c:355:29: note: format string is defined here
  355 |       _info("MPU-%d, 0x%08llX-0x%08llX SH=%llX AP=%llX XN=%llX\n", i,
      |                        ~~~~~^
      |                             |
      |                             long long unsigned int
      |                        %08lX
common/arm64_mpu.c:355:13: error: format '%llX' expects argument of type 'long long unsigned int', but argument 5 has type 'long unsigned int' [-Werror=format=]
  355 |       _info("MPU-%d, 0x%08llX-0x%08llX SH=%llX AP=%llX XN=%llX\n", i,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
common/arm64_mpu.c:355:38: note: format string is defined here
  355 |       _info("MPU-%d, 0x%08llX-0x%08llX SH=%llX AP=%llX XN=%llX\n", i,

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-14 17:59:56 +08:00
chao an
7288a8d000 arch/arm64: add support to config SPI interrupt affinity routing to CPU0 by default
Signed-off-by: chao an <anchao@lixiang.com>
2024-10-14 17:58:13 +08:00
chao an
83c483c1b4 arch/armv8-a: new config to set SPIs Configuration to edge-triggered
Configure all SPIs(Shared Peripheral Interrupts) as edge-triggered by default

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-14 17:58:13 +08:00
liwenxiang1
3e2e2132ca arch/x86_64:Adjust the position of the nm command to execute it after NuttX is generated
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-14 17:55:59 +08:00
p-szafonimateusz
c18f722185 arch/intel64: optimise context switch
We save interrupted TCB state on tcb->xcp.regs not interrupt stack now
which allows us to remove x86_64_savestate() from up_switch_context()
and other places.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-14 17:54:06 +08:00
xuxingliang
d655569a7c cmake: add newly added sources to cmake
These newly added files are missing from cmake.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-14 17:19:45 +08:00
nuttxs
9308675686 xtensa/esp32s3: add wapi support for getting country code
commands on ESP32-S3
2024-10-14 13:42:37 +08:00
cuiziwei
7246533aeb Unify the definition of GCCVER and remove duplicate code.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-13 11:41:22 +08:00
Marco Casaroli
c17ab3beb5 feat(esp32s3): add openeth ethernet driver for qemu
We add the config for esp32s3, then move the esp32 specifics to
esp32/chip.h, then add the esp32s3 specifics to esp32s3/chip.h.
2024-10-13 11:19:51 +08:00
Marco Casaroli
d5b32f0335 feat(esp32_openeth): move to common/espressif
Since this will be used for esp32s3 also, we can have this in
common/espressif.
2024-10-13 11:19:51 +08:00
xuxin19
57bfd02cef build ci:add msvc windows native ci workflow
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-13 10:25:19 +08:00
chenzhijia
505adfa277 nuttx:move "#define STRINGIFY(x)" to nuttx/macro.h
Franklin requirement, "#define STRINGIFY(x)" conflicts with https://github.com/mborgerding/kissfft define

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-13 03:16:25 +08:00
Bowen Wang
143466baed drivers/pci: fix pci framework warning in 32bit chip
In file included from pci/pci.c:30:
pci/pci.c: In function 'pci_setup_device':
pci/pci.c:449:66: warning: right shift count >= width of type [-Wshift-count-overflow]
  449 |           pci_write_config_dword(dev, base_address_1, res->start >> 32);
      |                                                                  ^~
pci/pci.c: In function 'pci_presetup_bridge':
pci/pci.c:541:51: warning: right shift count >= width of type [-Wshift-count-overflow]
  541 |                              ctrl->mem_pref.start >> 32);
      |                                                   ^~
pci/pci.c: In function 'pci_postsetup_bridge':
pci/pci.c:604:57: warning: right shift count >= width of type [-Wshift-count-overflow]
  604 |                              (ctrl->mem_pref.start - 1) >> 32);
      |                                                         ^~
CC:  pthread/pthread_release.c pci/pci_ecam.c:71:12: warning: initialization of 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  uint32_t *)' {aka 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  long unsigned int *)'} from incompatible pointer type 'int (*)(struct pci_bus_s *, uint32_t,  int,  int,  uint32_t *)' {aka 'int (*)(struct pci_bus_s *, long unsigned int,  int,  int,  long unsigned int *)'} [-Wincompatible-pointer-types]
   71 |   .read  = pci_ecam_read_config,
      |            ^~~~~~~~~~~~~~~~~~~~
pci/pci_ecam.c:71:12: note: (near initialization for 'g_pci_ecam_ops.read')
pci/pci_ecam.c:72:12: warning: initialization of 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  uint32_t)' {aka 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  long unsigned int)'} from incompatible pointer type 'int (*)(struct pci_bus_s *, uint32_t,  int,  int,  uint32_t)' {aka 'int (*)(struct pci_bus_s *, long unsigned int,  int,  int,  long unsigned int)'} [-Wincompatible-pointer-types]
   72 |   .write = pci_ecam_write_config,

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-13 02:28:32 +08:00
xuxin19
7def0983f6 cmake:sync arm sub arch CMake scripts missing sources
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-13 02:25:06 +08:00
lipengfei28
e7326cfa62 arch/arm64: add CONFIG_ARCH_VMA_MAPPING
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-13 02:09:38 +08:00
xuxin19
7b807a3947 cmake:fix x86_64 cmake configured warning
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-13 02:08:38 +08:00
yangguangcai
80f2890c17 systick:when isr_handle is NULL will be crash.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-13 00:32:55 +08:00
wangmingrong1
b12bf1ef33 arm/cmake: fix cmake compile error
1. The -c parameter should not be added during the link phase, otherwise the link will fail.
2. If it is the clang compiler, its toolchain library should use --print-file-name to find it, otherwise an error will occur

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-12 20:37:43 +08:00
ska
3b273b1e3e Revert "nuttx/arch: Enabling ARCH_MATH_H is required when compiling sim with …"
This reverts commit 57e901e5ea.
2024-10-12 19:45:25 +08:00
Jinliang Li
36c63705db armv8-r/gicv3: disable 64bits access gic 64bits registers
When neon is enabled, compiler may optimize 64bits access to vstr, that
will cause data aborts.
Split 64bits access to double 32bits access for GIC_IROUTER/GICR_TYPER,
just like linux.

Signed-off-by: Jinliang Li <lijinliang1@lixiang.com>
Signed-off-by: chao an <anchao@lixiang.com>
2024-10-12 18:11:00 +08:00
xuxingliang
38858b6cc3 arch: set current regs firstly in undefinedinsn
Need to save the regs firstly in case syslog triggers another crash.
Otherwise we may loose the register contents for the first exception.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-12 14:19:36 +08:00
fanjiangang
d8b042126e arch/arm: fix the bug of armv8-r macro GET_MPIDR
should be core not cpu

Signed-off-by: fanjiangang <fanjiangang@lixiang.com>
Signed-off-by: chao an <anchao@lixiang.com>
2024-10-12 14:00:32 +08:00
fanjiangang
044ee68e80 arm/armv8-r: add implements of arm_get_mpid()
Signed-off-by: fanjiangang <fanjiangang@lixiang.com>
Signed-off-by: chao an <anchao@lixiang.com>
2024-10-12 14:00:32 +08:00
hujun5
1ff49872a7 arch: There is no need to use sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-12 13:28:23 +08:00
hujun5
ef8d8ee627 rtc: There is no need to use sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-12 13:28:23 +08:00
anjiahao
e5f9b42ea0 binfmt/libelf:Remove libelf implementation [2/2]
this commit is part two, all logic move to modlib, so we can remove it.
and change all use defconfig

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
cuiziwei
57e901e5ea nuttx/arch: Enabling ARCH_MATH_H is required when compiling sim with the 13.2 version of the toolchain.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-12 12:05:05 +08:00
zhanghongyu
6f9543daec sim: fix crash caused by function recursion.
114 up_interrupt_context () at /home/zhhyu/source/vela/dev/nuttx/include/arch/irq.h:163
115 stack_monitor_enter (this_fn=0x400145dc <up_current_regs>, call_site=0x4002d5c7 <__cyg_profile_func_enter+120>, arg=0x0) at instrument/stack_monitor.c:63
116 0x000000004002d5c7 in __cyg_profile_func_enter (this_fn=0x400145dc <up_current_regs>, call_site=0x4002d5c7 <__cyg_profile_func_enter+120>) at misc/lib_instrument.c:68
117 0x00000000400156c7 in up_current_regs () at instrument/stack_monitor.c:62
118 up_interrupt_context () at /home/zhhyu/source/vela/dev/nuttx/include/arch/irq.h:163
119 stack_monitor_enter (this_fn=0x400145dc <up_current_regs>, call_site=0x4002d5c7 <__cyg_profile_func_enter+120>, arg=0x0) at instrument/stack_monitor.c:63
120 0x000000004002d5c7 in __cyg_profile_func_enter (this_fn=0x400145dc <up_current_regs>, call_site=0x4002d5c7 <__cyg_profile_func_enter+120>) at misc/lib_instrument.c:68
121 0x00000000400156c7 in up_current_regs () at instrument/stack_monitor.c:62
...

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-12 11:49:18 +08:00
liwenxiang1
43a8a80c74 arch/x86_64:Code style is consistent
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-12 11:20:24 +08:00
hujun5
302d2f3b56 x86_64: align some code
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-12 10:19:48 +08:00
Tim Hardisty
3027be72c3 Update sam_udphs.c 2024-10-12 09:51:19 +08:00
fangxinyong
55d7708fa0 boards/arm/qemu: enable kernel build for armv7a
See Documentation/platforms/arm/qemu/boards/qemu-armv7a/README.txt for details

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-10-12 09:28:45 +08:00
yanghuatao
323ee075be nuttx/qemu: Fix funciton up_idle multiple definition
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-10-12 09:28:45 +08:00
ligd
994e15710f goldfish: sync with qemu do rpmsg_syslog init at goldfish
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 22:42:34 +08:00
Bowen Wang
a1f3800a9d arm_gicv2_dump: optimize gic dump
1. Add config CONFIG_ARMV7A_GICv2_DUMP to control gic dump,
because irqinfo introduce too much other log;
2. Change the log api from irqinfo() to syslog(), syslog not
append the function name in the log, so the gic dump format
will not be destoried.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-11 19:56:41 +08:00
liwenxiang1
9eb7665822 arch/x86_64:Change extern g_intstackalloc to g_isrstackalloc
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-11 19:55:50 +08:00
wangyongrong
933e066118 common/Toolchain.defs: support CONFIG_DEBUG_NOOPT for x86_64
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-10-11 17:21:06 +08:00
Bowen Wang
20db146b64 x86/x86_64: change the build result from nuttx.elf to nuttx
Just sync with other architecture.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-11 17:20:15 +08:00
lipengfei28
631b551727 goldfish add gicv2m support
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-11 17:06:16 +08:00
lipengfei28
78a6ba6d5f PFU: do not cause execution of any instructions to be trapped
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-11 17:04:28 +08:00
Bowen Wang
313d6df787 include/nuttx.h: replace all the align macros to nuttx version
1. add IS_ALIGNED()  definitions for NuttX;
2. replace all the ALIGN_UP() and ALIGN_DOWN() to use common
   align implementation;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-11 16:55:43 +08:00
ouyangxiangzhen
0936c97d3e arch/x86_64: Fix SMP startup for ACRN Hypervisor
This patch fixed SMP startup for ACRN Hypervisor.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-11 15:43:01 +08:00
liwenxiang1
9189800760 arch/x86_64:Add configuration to disable vectorization optimization
With aggresive optimization enabled (-O3), ostest FPU test will fail.This is because the compiler will generate additional vector instructions between subsequent up_fpucmp() calls (loop vectorization somewhere in usleep() call), which will consequently overwrite the expected FPU context (XMM registers).The compilation option -fno-tree-vectorize can avoid this issue.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-11 15:40:55 +08:00
andi6
19e34b7f6e x64: modify addr limit to support 64 bits addr backtrace
Signed-off-by: andi6 <andi6@xiaomi.com>
2024-10-11 15:32:28 +08:00
cuiziwei
5e96e72cb6 X86_64: Add libcxx availability macros.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-11 13:53:10 +08:00
cuiziwei
1816d752af arch/x86_64:Fix build cxx warning.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-11 13:46:27 +08:00
lipengfei28
274ca2ea65 arch: arm64: Fix ARM64_CONTEXT_REGS number
This commit fixes the regression in https://github.com/apache/nuttx/pull/14063

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-11 13:26:54 +08:00
anjiahao
5076b0c74c risc-v:Unify module compilation options
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-11 11:20:45 +08:00
yinshengkai
211a56910a syslog: support syslog redirection to sched_note
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 01:30:11 +08:00
Xu Xingliang
f68d594420 arch/arm64: rename register names to align with arm32
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-11 01:17:24 +08:00
wangmingrong1
ec3c27df0d makefile/clang: Compare versions for upward compatibility
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-11 00:45:39 +08:00
yinshengkai
02eb280302 arch/perf: modify the return value of up_perf_gettime to clock_t
When using alarm_arch implementation, 64-bit time can be returned. Using unsign long will cause precision loss.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 23:17:14 +08:00
p-szafonimateusz
ed71aa810e arch/x86_64/intel64/intel64_irq.c: fix busy irq logic
use correct macro for cpu_set_t busy variable and remove obsolote check

also remove not needed #include <sched.h> and "Public data"

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-10 22:57:04 +08:00
yinshengkai
8abbd3cde5 nuttx-names.in: add feof
When running gcov in sim, nuttx feof is called and causes crash

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 22:55:04 +08:00
liwenxiang1
fee7e0ce81 arch/x86_64:Add macros related to CPUID
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 15:07:45 +02:00
ouyangxiangzhen
d0779e0eef arch/x86_64: Fix up_timer compilation error
This commit fix up_timer compilation error.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-10 15:07:22 +02:00
ouyangxiangzhen
e6548ead20 arch/x86_64: Fix up_timer_start
Fix according to up_alarm_start.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-10 15:07:22 +02:00
yinshengkai
d375a09c0a libs: add gprof arm64 support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 18:46:51 +08:00
yinshengkai
eb8449cb0c sched/gprof: add gprof support
gprof can analyze code hot spots based on scheduled sampling.
After adding the "-pg" parameter when compiling, you can view the code call graph.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 18:46:51 +08:00
Eren Terzioglu
f774afb4d9 esp32[s3|s2]: Add temperature sensor thread support 2024-10-10 18:45:01 +08:00
Eren Terzioglu
7556614732 esp32[c3|c6|h2]: Add temperature sensor thread support 2024-10-10 18:45:01 +08:00
Eren Terzioglu
4060f6ba80 esp32[s2|s3]: Add UORB support for internal temperature sensor 2024-10-10 18:45:01 +08:00
Eren Terzioglu
929f9ccfa2 esp32[c3|c6|h2]: Add UORB support for internal temperature sensor 2024-10-10 18:45:01 +08:00
hujun5
7216d566a6 sim: only POSIX implementation (ARCH_HAVE_MULTICPU) is provided
This commit fixes the regression from https://github.com/apache/nuttx/pull/13886

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-10 18:38:25 +08:00
liwenxiang1
24f54ba712 arch/x86_64: cache convert all asm() to __asm__()
asm() is not supported by -std=c99, __asm__() is more portable

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 18:36:09 +08:00
andi6
2ed88f8813 x64: add acrn ioapic init support
if we two step to set interrupt trigger and disable interrupt,
acrn will inject #GP exception

Signed-off-by: andi6 <andi6@xiaomi.com>
2024-10-10 17:49:40 +08:00
liwenxiang1
8d2fc5c9ee arch/x86_64:Add nanosecond delay interface to TSC
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 17:13:01 +08:00
cuiziwei
f86644141b x86_64:Fix ld error.
LD: nuttx.elf
ld:in function `std::__1::ios_base::imbue(std::__1::locale const&)':
nuttx/libs/libxx/libcxx/src/ios.cpp:129: undefined reference to `_Unwind_Resume'

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-10 16:51:38 +08:00
wangming9
1c2856dfcb arch/arm64: Fixed up_getusrsp getting stack Pointers
Signed-off-by: wangming9 <wangming9@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-10 15:40:03 +08:00
wangming9
b0ea6840e1 arch/arm64: Use serr to print fatal error messages.
Summary:
sinfo cannot print fatal error messages when CONFIG_DEBUG_SCHED_INFO is turned off.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2024-10-10 15:40:03 +08:00
wangming9
27d77b1aca arch/arm64: Fixed GIC3 for goldfish platform
Signed-off-by: wangming9 <wangming9@xiaomi.com>
2024-10-10 15:40:03 +08:00
wangming9
b3e640cf3f arch/arm64: GICv2 detection is compatible with different qemu versions
Summary:
- GICv2 cannot be detected on the golsfish platform
- Golsfish uses version 2.12.0 of qemu with a GICC_IIDR value of 0,
  read ICPIDR2 to determine the GIC version

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2024-10-10 15:40:03 +08:00
Bowen Wang
a847ee1675 qmeu_boot: add rpmsg syslog init for arm64 qemu chip
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-10 15:40:03 +08:00
wangming9
e48b81ebe9 arch/arm64: Supports cluster PMU
Summary:
Some processors implement cluster PMUs, such as Cortex-R82.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2024-10-10 15:40:03 +08:00
wangming9
fa96350574 arch/arm64: Modify the method for obtaining the CPU frequency
Summary:
1、cntfrq_el0 is used to store the timer frequency, which may
   be different from the CPU frequency.
2、Do not use up_perf interface for SMP.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2024-10-10 15:40:03 +08:00
yangguangcai
e9b77833e3 goldfish:config pl031.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-10 15:40:03 +08:00
liwenxiang1
f858026819 arch/x86_64:Add allsymbol functionality
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 14:56:08 +08:00
Huang Qi
20cba94a86 risc-v/espressif: Fix alert message in esp_setup_irq()
Correct the alert message in `esp_setup_irq()` if
irq number allocation fails, the parameter number is not
matched with format specifier.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-10-10 13:41:34 +08:00
liwenxiang1
e3b3a6145a arch/x86_64: idle convert all asm() to __asm__()
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 13:40:39 +08:00
liwenxiang1
1af831e139 arch/x86_64: cpuid expect 32 bit variables
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 12:03:27 +08:00
liwenxiang1
2448e8a59e arch/x86_64:Add perf tool
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 12:01:16 +08:00
liwenxiang1
f81c7dbc93 arch/x86_64:Use the checkstack function
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 11:40:15 +08:00
hujun5
e249dd2672 arch: support customized up_cpu_index() in AMP mode
Some app with same code runs on different cores in AMP mode,
need the physical core on which the function is called.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-10-10 02:38:40 +08:00
ligd
ff99745b22 arm-m: support zero interrupt back to game
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-10 01:01:17 +08:00
ligd
a9da6ab4b5 arm-M: set current regs for crash dump
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-10 01:01:17 +08:00