Commit Graph

56050 Commits

Author SHA1 Message Date
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
Ville Juven e384a6a625 libs/modlib.c: Set VMA for empty and unallocated sections
This fixes issue where empty and unallocated sections are left without
a VMA. Some relocations depend on the section VMA being set even if there
is no data there, as the binary can refer to the symbols. Linker defined
symbols do not contain data -> they can produce empty sections.

This issue is seen when building a loadable file which declares _sctors /
_sdtors linker defined symbols for ctor/dtor sections which are empty.
crt0 references these symbols, so they need to be relocated, but the
section VMA is not set -> they go outside of the addressable range of the
user binary causing a potential crash.
2024-10-17 13:38:01 +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
yinshengkai 5aa48061c9 mm: fix mempool default recording backtrace
Need to initialize procfs.backtrace to false if it's disabled.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-17 09:05:11 +08:00
Neo Xu 9c6c56c255 mempool: use backtrace_format
There's no need to manually format the backtrace any more.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-17 09:05:11 +08:00
anjiahao 62850f3163 mempool:when deinit mempool,need mark dict NULL before free
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-17 09:05:11 +08:00
Matteo Golin 394530e3c2 ci: documentation workflow is now only triggered when the Documentation subdirectory has modifications, and does not build pdfs. 2024-10-17 09:04:50 +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
Xiang Xiao 67ed036227 libc: Make getcwd() work even CONFIG_DISABLE_ENVIRON is enabled
since getcwd() can be implemented correctly without using environ

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-16 23:59:07 +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
wangchen addfe127a9 socketpair.c:Replace kmm with fs heap
due to https://github.com/apache/nuttx/pull/13722/commits, In the socketpair.c,fs_heap interface replaces kmm interface

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-10-16 20:56:39 +08:00
qiaohaijiao1 c59c6b08f3 audio: remove started from audio_complete
dependson:3767214

Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2024-10-16 20:27:45 +08:00
anjiahao b98b263246 Revert "sabre-6quad:by pass coredump ci ci"
This reverts commit b503b323ce.
2024-10-16 20:27:36 +08:00
cuiziwei 499de61ec3 libxx: Globally reference the header file of libcxxabi and remove duplication code.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-16 20:05:17 +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
yangguangcai 5de562347d libc/memmem:porting open source memmem to Nuttx.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-10-16 18:41:50 +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 3e9c2e00ea mps:support bootloader and ap defconfig build
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 67cbd7491a mps3-an547:add defconfig for pic run ostest
1. ./tools/configure.sh mps3-an547:picostest
2. make -j20
3. genromfs -f romfs.img -d ../apps/bin/
4. qemu-system-arm -M mps3-an547 -m 2G -nographic \
   -kernel nuttx.bin -gdb tcp::1127 \
   -device loader,file=romfs.img,addr=0x60000000
5. nsh> /pic/hello
5. nsh> /pic/ostest

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 18:40:06 +08:00
anjiahao dae3b8e551 mps3-an547:use common elf cflags
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-16 18:40:06 +08:00
anjiahao a72e9e5621 modlib:if elf in romfs/tmpfs, try use xipbase
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
gaohedong cfc90ad1f3 nuttx/can: support to Send message priority sorting function.
Linked list-based priority sorting function for sending messages.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2024-10-16 18:37:01 +08:00
dongjiuzhu1 8e2f8be671 fs/rpmsgfs: return real err value when open failed
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-16 18:12:21 +08:00
dongjiuzhu1 2cf8c25292 drivers/power/battery: add charge/battery health interface support
Signed-off-by: liangdongdong<liangdongdong@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-16 17:33:20 +08:00
yinshengkai 6fbe16f40f libs: remove lib_libbsprintf automatic line wrapping
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-16 17:26:14 +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
yezhonghui 72e7935431 Fix disable msi when msi capability not exist issue
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2024-10-16 17:12:34 +08:00
zhaohaiyang1 9985b0551e nuttx/can.h: support timestamp for can frame
and update "can.rst" file for add struct timeval ch_ts info.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-10-16 17:04:31 +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
chenjiahua1 c1fb6974ac strptime.c:len is not defined.
Bring all code that uses the variable len under the CONFIG_LIBC_LOCALE

Signed-off-by: chenjiahua1 <chenjiahua1@xiaomi.com>
2024-10-16 17:02:51 +08:00
chenjiahua1 64eecbfede libc/time: add lib_strptime
The community deleted strptime due to license reasons, and we replaced it with musl.

Signed-off-by: chenjiahua1 <chenjiahua1@xiaomi.com>
2024-10-16 17:02:51 +08:00
Bowen Wang 8cfe8a0f3e circbuf: fix circbuf_get_read/writeptr return *size = 0 when circbuf full
In circbuf_get_read/writeptr, when circbuf is full, off == pos, and
*size = off - pos = 0. So add circbuf_is_full() condition to return
correct *size.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-16 16:59:51 +08:00
wanggang26 23c39f9dab mmcsd: add multi partitions support
include boot0,boot1,gp1,gp2,gp3,gp4,rpmb

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-16 16:58:37 +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
wurui3 42e416d054 nuttx/audio: increase bits of samplerate in struct audio_info_s.
Current 8 bits of uint8_t cannot represent sample rate bigger than
255,change uint8_t to uint32_t to expand sample rate range.

Signed-off-by: wurui3 <wurui3@xiaomi.com>
2024-10-16 15:40:35 +08:00
Jukka Laitinen ef827e88a7 net: Copy out also can cmsg data into the end of packet
This has been broken at some point. Just fix it by copying the can frame and
the cmsg data into IOB, and fix devif_poll to copy out the full data.

The can drivers expect to find the timeout timestamp in the end of the frame.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-16 15:39:11 +08:00
Jukka Laitinen 313b2cd1ed net/netdev/netdev_default.c: Exclude socket can from default devices
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-16 15:39:11 +08:00