Commit graph

57392 commits

Author SHA1 Message Date
Alin Jerpelea
2503b36b71 crypto/chacha: 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.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-16 14:18:35 +08:00
Alin Jerpelea
4c48884ddf crypto/cast: 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.

define NuttX local NuttX-PublicDomain identifier

 “Public Domain” is a concept distinct from copyright licensing;
it generally means that the work no longer has any copyright protection
or ownership, and therefore requires no license permission in order to
use, copy, modify, distribute, perform, display, etc.
In the United States – and many jurisdictions – copyright protections
attach automatically to creative works upon creation if they satisfy
certain minimum criteria.
“Public Domain” would thus represent a significant change to the legal
status of the work.
The rules around “Public Domain” often vary or are unspecified
jurisdiction to jurisdiction. Adding to the confusion, some
jurisdictions may not even recognize the concept of “Public Domain”
(or similar). As such, a license may nevertheless be required or implied
in these cases. Even in the U.S., there is no clear,
officially-sanctioned procedure for affirmatively placing
copyright-eligible works into the “Public Domain” aside from natural
statutory expiration of copyright. The bottom-line is, there are few if
any objective, brightline rules for proactively placing
copyright-eligible works into the Public Domain that we can broadly
rely on.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-16 14:18:35 +08:00
Alin Jerpelea
f65a17da37 tools/macar-qcs.sh: migrate license to ASF
Xiaomi has signed the SGA and we can migrate the license to ASF

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-16 14:14:55 +08:00
geniusdo
fdbf520a99 fix a typo 2024-12-15 17:53:48 -03:00
hujun5
a459280fac use atomic to protect f_refs
fix regresion from https://github.com/apache/nuttx/pull/14801

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-15 09:43:36 -03:00
Andre Heinemans
d15a20eac8 sensors: fix Make.defs for bmm150 2024-12-14 15:07:08 +08:00
Andre Heinemans
cfd79b89ab lpuart: fix build errors for SINGLEWIRE and INVERT without SERIAL_TERMIOS 2024-12-13 16:04:15 -03:00
simbit18
d90559f94e [cmake] windows native: fixed FAILED: System.map
fixed

[1025/1027] Generating System.map
FAILED: System.map C:/nuttxgit/nuttx/build/System.map
cmd.exe /C "cd /D C:\nuttxgit\nuttx\build && arm-none-eabi-nm nuttx | grep -v '(compiled)|($)|( [aUw] )|(..ng$)|(LASH[RL]DI)' | sort > System.map"
2024-12-13 15:54:55 -03:00
YAMAMOTO Takashi
566e1c3a7d tools/ci/platforms/darwin.sh: bump bloaty version
hopefully this can fix build failure on macos-13. (see below)

i tested "cibuild.sh -i" with macOS 15.2, x86-64, Xcode 16.1.

```
 [470/495] Linking CXX executable bloaty
FAILED: bloaty
: && /Applications/Xcode_15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -W -Wall -Wno-sign-compare -fdiagnostics-color=always -O2 -g1 -isysroot /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -mmacosx-version-min=13.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/bloaty.dir/src/main.cc.o -o bloaty  liblibbloaty.a  third_party/protobuf/cmake/libprotoc.a  third_party/re2/libre2.a  third_party/capstone/libcapstone.a  /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/libz.tbd  third_party/abseil-cpp/absl/strings/libabsl_strings.a  third_party/protobuf/cmake/libprotobuf.a  /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/libz.tbd  third_party/abseil-cpp/absl/strings/libabsl_strings_internal.a  third_party/abseil-cpp/absl/base/libabsl_base.a  third_party/abseil-cpp/absl/base/libabsl_spinlock_wait.a  third_party/abseil-cpp/absl/numeric/libabsl_int128.a  third_party/abseil-cpp/absl/base/libabsl_throw_delegate.a  third_party/abseil-cpp/absl/types/libabsl_bad_optional_access.a  third_party/abseil-cpp/absl/base/libabsl_raw_logging_internal.a  third_party/abseil-cpp/absl/base/libabsl_log_severity.a && :
ld: Undefined symbols:
  absl::debugging_internal::Demangle(char const*, char*, int), referenced from:
      bloaty::ItaniumDemangle(std::__1::basic_string_view<char, std::__1::char_traits<char>>, bloaty::DataSource) in liblibbloaty.a[2](bloaty.cc.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
2024-12-13 23:28:02 +08:00
Andre Heinemans
2c93e79e94 arm64/imx9: tpm: fix TPM_FILTER_CHXFVAL_MASK macro 2024-12-13 23:27:01 +08:00
hujun5
98ce36cdc7 remove fl_crefs
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-13 23:04:10 +08:00
Huang Qi
de5151c64b riscv_percpu: Replace critical section with irqsave/irqrestore
Since the SCRATCH register is used to store the percpu pointer,
which should not be accessed by other CPUs, we can replace the
critical section with irqsave/irqrestore.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-12-13 23:03:48 +08:00
YAMAMOTO Takashi
fce4f2b3ee tools/ci/platforms/darwin.sh: update bloaty pin
This seems to fix build errors on my environment.
(macOS 15.1.1, x86-64, xcode 16.1)

```
/Users/yamamoto/git/nuttx/tools/bloaty-src/third_party/abseil-cpp/absl/numeric/int128.cc:45:5: error: use of undeclared identifier 'ABSL_INTERNAL_ASSUME'
   45 |     ABSL_INTERNAL_ASSUME(hi != 0);
      |     ^
/Users/yamamoto/git/nuttx/tools/bloaty-src/third_party/abseil-cpp/absl/numeric/int128.cc:49:3: error: use of undeclared identifier 'ABSL_INTERNAL_ASSUME'
   49 |   ABSL_INTERNAL_ASSUME(low != 0);
      |   ^
/Users/yamamoto/git/nuttx/tools/bloaty-src/third_party/abseil-cpp/absl/numeric/int128.cc:141:9: error: redefinition of 'operator/'
  141 | uint128 operator/(uint128 lhs, uint128 rhs) {
      |         ^
/usr/local/Cellar/abseil/20240722.0/include/absl/numeric/int128.h:1040:16: note: previous definition is here
 1040 | inline uint128 operator/(uint128 lhs, uint128 rhs) {
      |                ^
/Users/yamamoto/git/nuttx/tools/bloaty-src/third_party/abseil-cpp/absl/numeric/int128.cc:152:9: error: redefinition of 'operator%'
  152 | uint128 operator%(uint128 lhs, uint128 rhs) {
      |         ^
```
2024-12-13 18:23:29 +08:00
YAMAMOTO Takashi
ac3aa0185c tools/ci/platforms/darwin.sh: Don't use PIP_USER if venv is activated
On my environment PIP_USER doesn't work well.
```
error: externally-managed-environment
```
(macOS 15.1.1, x86-64, xcode 16.1)

Also, I prefer to use virtualenv anyway.
2024-12-13 18:23:29 +08:00
YAMAMOTO Takashi
a3849afe9f linum-stm32h753bi/littlefs: bump littlefs version to 2.10.0 2024-12-13 18:22:30 +08:00
YAMAMOTO Takashi
760b557f3f esp32s3-devkit/toywasm: bump littlefs version to 2.10.0 2024-12-13 18:22:30 +08:00
YAMAMOTO Takashi
fa8d5cd53d littlefs: Use LFS_DEFINES if available 2024-12-13 18:22:30 +08:00
Gao Feng
9e8e7ace09 xtensa: support coredump by register set alignment 2024-12-13 18:21:37 +08:00
Windrow14
5cdc6c77cf fs/fat/fs_fat32util.c: fix potential exception due to dividing zero during mounting when fat is corrupted
Check fs_fatsecperclus' value when read from eMMC device. Return an error if it is zero.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-12-13 11:22:54 +08:00
p-szafonimateusz
15250540eb Documentation: add PCI CAN cards doc
Documentation: add PCI CAN cards doc

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-12-13 11:19:22 +08:00
p-szafonimateusz
7b8f01f2da drivers/can: add CTU CAN FD driver (qemu only)
Add CTU CAN FD driver for qemu only:
https://www.qemu.org/docs/master/system/devices/can.html#ctu-can-fd-support-examples

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-12-13 11:19:22 +08:00
p-szafonimateusz
033f203e2a drivers/can: add Kvaser PCI card driver (qemu only)
add Kvaser PCI card driver support, works only with QEMU now:

https://www.qemu.org/docs/master/system/devices/can.html#examples-how-to-use-can-emulation-for-sja1000-based-boards

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-12-13 11:19:22 +08:00
SPRESENSE
0df0a105d1 arch: cxd56xx: Fix not restart after TX error
Fix a bug that I2C driver can not transfer after TX abort error.
It caused by remaining NO_STOP flag status.
2024-12-13 10:51:17 +08:00
Tiago Medicci Serrano
38b41e5417 rv-virt/citest: Increase init task stack size to 3072
After https://github.com/apache/nuttx/pull/15075, the size of the
stack size has decreased 8 bytes and the init stack size for the
rv-virt:citest defconfig was near its full capacity, which lead to
crashing the `ps` command. The init stack size for this defconfig
was increased from 2048 to 3072 to avoid stack overflow.
2024-12-13 03:15:10 +08:00
chao an
7b85272b08 binfmt/exec: initialize binary_s to empty to avoid invaild access
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-13 01:31:21 +08:00
Huang Qi
4e9702c7fb risc-v: Move CSR register manipulation macros to csr.h
This patch allow public arch level code use them, make it possible to access system register in common code, such as percpu.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-12-13 01:29:26 +08:00
edbf2e21e7 CI: Move rv-virt:python from risc-v-06 to risc-v-07 2024-12-12 23:38:35 +08:00
Tiago Medicci Serrano
89d8a8a193 Documentation: Add entry for Python on NuttX
This commit adds entries in the documentation referring to the
Python's port for NuttX.
2024-12-12 23:38:35 +08:00
Tiago Medicci Serrano
598556c307 risc-v/qemu-rv/rv-virt: Add CPython (python) defconfig
This defconfig enables building NuttX's port of Python for RISC-V
QEMU.
2024-12-12 23:38:35 +08:00
hujun5
f301524cb9 sem: remove the additional assignment.
reason:
running tcb->waitobj should be NULL

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-12 22:01:50 +08:00
Takuya Miyasita
f66c4a0733 Documentation/guides: add the guide:how to port.
I think the guy who wants to port NuttX is expected to understand NuttX kernel code and related configurations,
but the getting enough knowledge needs to read the kernel codes deeply.

To reduce the time for NuttX beginner who wants to port,
I tried to make the guide (how to port) based on my porting journey.
2024-12-12 21:52:24 +08:00
Jukka Laitinen
366977b767 fs/shm/shmfs_alloc.c: Allocate zero-initialized memory in flat build
POSIX requires that the shm objects are zero-initialized. This has been broken
in some earlier commits (starting from 9af5fc5d09)

Also fix the flat build memory allocation to allocate both object data and payload
in the same chunk (as the comment also suggests). This saves allocations and memory
in a system with lots of shm objects.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-12-12 21:47:41 +08:00
yaojiaqi
890cf4764f drivers/timers/watchdog: support the configurations of Auto-monitor reset timeout and Auto-monitor keep alive interval in milliseconds.
In some areas with high security requirements such as vehicle control, in order to meet functional safety requirements, the timeout and feeding interval of the watchdog need to be configured in milliseconds

Signed-off-by: yaojiaqi <yaojiaqi@lixiang.com>
2024-12-12 17:02:05 +08:00
chao an
cafdcb1eb0 sched/clock: cleanup g_system_ticks reference if arch timer is enabled
continue work of: https://github.com/apache/nuttx/pull/15139

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 09:52:07 +01:00
ligd
4a51c21afc sched/clock: call up_timer_gettime() to get higher resolution
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-12-12 14:47:02 +08:00
chao an
083027b9dc binfmt/loadable: move binary_s to stack to avoid access allocator
Improve performance by reducing allocator accesses

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 14:00:08 +08:00
chao an
894b1431e3 arm64/imx9: refrash defconfig of imx93-evk
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 13:47:22 +08:00
chao an
b46edd1252 fs/reference_count: set default reference count option depends on DISABLE_PTHREAD
Most of developers will not have the scenarios of open/close file descriptors in multi-threads,
The default option will incur additional code size overhead for such devices.
this PR will preserve the behavior before PR#13296 was introduced, and ensure that the default code size is not affected.

Note that this option will ensure the safety of access to the file
system from multi-tasks (Task A blocking rw(fd), then Task B close(fd)),
the disadvantage is that it will increase the amount of code-size,
there is no need to enable this option if the application could ensure
he file operations are safe.

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 13:47:22 +08:00
anjiahao
e15fe23424 procfs:fix cmdline overflow
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-12-12 11:49:37 +08:00
chao an
b99e7617aa fs/inode: refresh tcb after each file sync() is completed
After tcb is destroyed, it is very dangerous to back reference tcb through file.
This commit will perform file operations while ensuring the validity of tcb during
fsync, with will avoid tcb check in each subsystem.

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 02:21:32 +08:00
simbit18
e4705e7f62 Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2024-12-12 02:18:23 +08:00
chao an
1efbe6b302 binfmt/modlib: reduce size of binary_s if CONFIG_LIBC_MODLIB is disabled
Test on nsh/sim

before:
sizeof(struct binary_s): 216

after:
sizeof(struct binary_s): 56(-160)

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-12 02:06:05 +08:00
Jukka Laitinen
fd3f0b7dd9 arch/risc-v/src/mpfs/mpfs_corespi.c: Add support for multiple bit widths
The corespi fpga block supports just one frame length, which is defined when
the block is instantiated on the FPGA.

This adds support for emulating different frame lengths if they are multiples
of 8-bit. That is, with 8-bit corespi one can do 8,16 and 24-bit transfers.

This is implemented by simply writing several 8-bit frames for a single word
when needed.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-12-12 02:05:16 +08:00
Tero Salminen
186b11c941 mpfs_corespi: fix semaphore race condition
SPI TX_DONE interrupt can be received after a semaphore timeout,
but before interrupts are disabled. This will leave the semaphore
to the signaled state.

After a timeout the semaphore is always reset to non-signaled state
to fix this race condition.

Signed-off-by: Tero Salminen <tero.salminen@unikie.com>
2024-12-12 02:05:16 +08:00
wangjianyu3
5a51d3b23f drivers/bch: Drivers may not support command BIOC_FLUSH
Calling `bchlib_flushsector()` maybe enough on some devices.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-12 01:56:55 +08:00
simbit18
1dcada4917 [ci] macOS platforms: added LLVM toolchain for Arm
added LLVM toolchain for Arm on Apple Intel
release-17.0.1

added LLVM toolchain for Arm on Apple Silicon
release-19.1.1

ì
2024-12-11 14:09:45 -03: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
Jouni Ukkonen
8a7f96e7f4 arch/arm64/imx9: Fix usdhc dma receive
Invalidate cache when dma transfer is ready

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-12-11 21:35:41 +08:00
chao an
a75e2704dc mps2-an500/knsh: disable SPINLOCK to avoid build break
workaround for remove libc depends from kernel api

build break on phase 2 userspace link:

| arm-none-eabi-ld -o nuttx_user.elf --undefined=nsh_main --entry=nsh_main -T /nuttx/boards/arm/mps/mps2-an500/scripts/memory.ld \
| -T /nuttx/boards/arm/mps/mps2-an500/scripts/user-space.ld -L/nuttx/staging/ -L/nuttx/staging/ -L/nuttx/staging/ -L/nuttx/staging/ \
| -L/nuttx/staging/ -L/nuttx/staging/ mps_userspace.o --start-group -lproxies -lc -lmm -larch -lxx -lapps --end-group \
| "prebuilts/linux/gcc/arm/bin/../lib/gcc/arm-none-eabi/13.3.1/thumb/v7e-m+fp/hard/libgcc.a"
|
| arm-none-eabi-ld: /nuttx/staging//libc.a(lib_pathbuffer.o): in function `spin_unlock_wo_note':
| /nuttx/include/nuttx/spinlock.h:380:(.text.lib_get_pathbuffer+0x298): undefined reference to `g_irq_spin_count'
| arm-none-eabi-ld: /nuttx/include/nuttx/spinlock.h:380:(.text.lib_get_pathbuffer+0x29c): undefined reference to `g_irq_spin'
| arm-none-eabi-ld: /nuttx/staging//libc.a(lib_pathbuffer.o): in function `lib_put_pathbuffer':
| /nuttx/libs/libc/misc/lib_pathbuffer.c:147:(.text.lib_put_pathbuffer+0x210): undefined reference to `g_irq_spin_count'
| arm-none-eabi-ld: /nuttx/libs/libc/misc/lib_pathbuffer.c:147:(.text.lib_put_pathbuffer+0x214): undefined reference to `g_irq_spin'
| make[1]: *** [Makefile:61: nuttx_user.elf] Error 1
| make[1]: Leaving directory '/nuttx/boards/arm/mps/mps2-an500/kernel'
| make: *** [tools/Unix.mk:540: nuttx] Error 2

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-11 20:33:34 +08:00