Commit Graph

22843 Commits

Author SHA1 Message Date
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