Commit Graph

15942 Commits

Author SHA1 Message Date
adriendesp
42f471ba4d Fix xmc4_spi.c DX select.
Added option to have different DX for each USIC channel.
2024-09-10 11:36:59 +08:00
meijian
a7224cf35a net/netstatistics: add tx/rx bytes statistics for dev
We can see them in ifconfig:

ap> ifconfig
wlan0   Link encap:Ethernet HWaddr 42:64:7f:b3:12:03 at UP mtu 1500
        inet addr:10.0.1.2 DRaddr:10.0.1.1 Mask:255.255.255.0
        inet6 DRaddr: ::

        RX: Received Fragment Errors   Bytes
            00000b9b 00000000 00000000 21daf5
            IPv4     IPv6     ARP      Dropped
            00000a33 00000137 00000031 00000000
        TX: Queued   Sent     Errors   Timeouts Bytes
            00000ac4 00000ac4 00000000 00000000 1a2103
        Total Errors: 00000000

Signed-off-by: meijian <meijian@xiaomi.com>
2024-09-10 11:36:03 +08:00
yanghuatao
c43c91816d toolchain/ghs: add ghs link script for mps2-an500 platform
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-09-09 01:26:13 +08:00
George White
3f00c4aae0 rp2040: support pico-sdk 2.0.0
Since the introduction of the rp2350, the pico-sdk project has been
re-arranged and elf2uf2 has been merged in to a new 'picotool' binary
which is supplied and installed separately.
2024-09-08 21:43:22 +08:00
yinshengkai
6ac1299218 nrf91: fix cmake compiler error
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-09-06 09:42:53 +08:00
hujun5
608b59e401 smp: enable smp_call in all smp arch
reason:
In subsequent implementations, we will replace up_cpu_pause with smp_call.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 07:11:38 +09:00
hujun5
ea181e2621 arm: armv7-a/r and armv8-r up_cpu_index inline
reason:
inline small code to improve performance

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-06 03:44:49 +08:00
yinshengkai
da6ddea8d4 arch/arm: support kernel heap in BUILD_FLAT mode
Make umm & kmm heap alloc more clear, and possible support FLAT build to
enable kernel heap.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-05 11:19:47 -03:00
chao an
dedb4c95c9 armv8-r/r52: add neon support into compiler line
1. correct the armv8-r fpu flag from vfpv3-d16 to fpv5-sp-d16
2. add neon support

This commit updates the build script to specify the FPU type of
`fpv5-sp-d16` when the processor is configured with a single-precision
FPU, and `neon-fp-armv8` when the processor is configured with a
double-precision + Advanced SIMD-capable FPU.

Note that the `fp-armv8` FPU type is an alias for double-precision FPv5
with 32 double-precision registers (refer to the GCC
`gcc/config/arm/arm-cpus.in` for more details); NEON is always
specified in case of a double-precision configuration because the
Cortex-R52 can only be configured as such.

Reference:
https://developer.arm.com/Processors/Cortex-R52

Instruction set:

Arm and Thumb-2. Supports DSP instructions and a configurable Floating-Point
Unit either with single-precision or double precision and Neon.

Signed-off-by: chao an <anchao@lixiang.com>
2024-09-05 09:52:51 -03:00
tfzou
fad8a22074 arm: Add support for CSK6011A SOC and CSK6011A-NANO board
Signed-off-by: tfzou <tfzou@listenai.com>
2024-09-05 09:34:33 -03:00
hujun5
198630a809 sched: use this_task replace nxsched_self
reason:
We can reduce a function call to improve performance.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 09:33:50 -03:00
fangxinyong
7b05a550dc sched: replace up_cpu_index with this_cpu
Make this_cpu is arch independent and up_cpu_index do that.
In AMP mode, up_cpu_index() may return the index of the physical core.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-09-05 12:09:24 +08:00
chao an
6098747c4f arm/giv3: add g_ prefix to some global variables
Signed-off-by: chao an <anchao@lixiang.com>
2024-09-05 09:58:21 +08:00
hujun5
433f159c06 arch: remove unused up_cpu_pausereq waiting
reason:
After the up_cpu_pause call completes, it guarantees that other CPUs have fully stopped.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-05 07:15:54 +09:00
chao an
b15c1a441a arm/gicv3: set routing affinity before enable IRQ
In corner case, the pending ISR will be triggered immediately
after enable the IRQ, this PR will setting CPU affinity first
to avoid routing the unexpected IRQ to other CPUs.

Signed-off-by: chao an <anchao@lixiang.com>
2024-09-03 19:14:14 -03:00
chao an
cf4a92c81e armv8-r/gicv3: correct cpu index of irouter
interrupt routing cpu should be index not cpuset

Signed-off-by: chao an <anchao@lixiang.com>
2024-08-30 21:48:58 +08:00
yangsong8
5a39e83c05 usbdev: extend the usb req len to size_t
Some USB controllers can receive or send multiple data packets then
generate one interrupt. This mechanism can reduce the number of data
copies. Extend req buf to accommodate this.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-08-30 01:32:02 +08:00
pangzhen1
dee4c63adb protected build: userspace threads will unexpectly work in privileged mode after syscall
In protected build mode, the syscall returns without setting correct value for the CONTROL register, which causes the userspace threads working in privileged mode after syscall.

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2024-08-28 13:44:37 +08:00
guoshichao
2d7c47ce16 greenhills: fix the build option warning
Warning: Unknown option "-fno-optimize-sibling-calls" ignored.  Did you mean "-mno-long-calls"?

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-28 01:22:03 +08:00
jinxiuxu
575c9b12ab drivers/audio: fix samp rate conversion issue
use ac_controls.hw to get the correct sample rate intead of ac_controls.b

Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-27 22:00:39 +08:00
simbit18
1661a66843 [cmake]: added initial support for MSYS2
Currently concerns only arm.

tools/ci/testlist/msys2.dat:
At the moment I only added the board nucleo-l152re:nsh

.github/workflows/build.yml:
Enabled cmake for msys2
2024-08-27 21:36:12 +08:00
SPRESENSE
2cc9221c09 arch: cxd56xx: Add logic for i2c reset
Add ARCH_HAVE_I2CRESET configration to ARCH_CHIP_CXD56XX
and implement i2c reset function.
2024-08-27 12:29:46 +02:00
SPRESENSE
de8829f8cd arch: cxd56xx: Fix SCU sensor data format
Add offset setting for sensor data to be written to SCU math function.
Fix comments in function descriptions.
2024-08-27 12:28:50 +02:00
yangguangcai
352e3a6873 armv7-a timer:fix timer overflow.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2024-08-26 17:50:47 -04:00
yanghuatao
33ddf1a297 toolchain/ghs: Fix green hills toolchain build Vela warnings
ccarm: Warning: Option "-fomit-frame-pointer" not supported in this product
ccarm: Warning: Unknown option "-Wno-cpp" ignored.  Did you mean "--nocpp"?
ccarm: Warning: Unknown option "-pipe" passed to linker
ccarm: Warning: Unknown option "-Wno-psabi" ignored.  Did you mean "-Wno-convert64"?
ccarm: Warning: Option "-fomit-frame-pointer" not supported in this product
ccarm: Warning: Unknown option "-Wno-cpp" ignored.  Did you mean "--nocpp"?
ccarm: Warning: Unknown option "-pipe" passed to linker
[asarm] (warning #2073) unknown option: -mimplicit-it=always
Warning: Unknown option "-pipe" passed to linker
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-08-27 01:56:34 +08:00
guoshichao
3bb30231a9 greenhills: fix the file build path error
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 01:56:34 +08:00
guoshichao
e5f40db601 greenhills: fix the "etc/init.d/rc.sysinit" file preprocess error
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 01:56:34 +08:00
guoshichao
c2d26988fd greenhills: fix double-precision float operation running error
since not all Armv7-m platform support double-precision floating
operations, so we add an extra option that help those specific platform
could define the single-precision floating operations.
for example, qemu-mps platform(armv7-m) support double-precision
floating operations, so we do not need to open
CONFIG_ARM_FPU_SINGLE_HARDWARE build options;
but for fc7300 platform(armv7-m) only support single-precision floating
operations, so if we pass "-fhard" build option to "ghs" compiler, then
the following instruction will be generated:
vcvt.f64.s32    d9, s18
which will fail to execute on fc7300 platform.
with "-fsingle" build option, the "ghs" compiler will generate hardware
instruction for single-precision floating operation, and generate
software instruction for double-precision floating operation.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 01:56:34 +08:00
guoshichao
90a6ced9c1 arch/arm/toolchain: add --entry_std LDFLAGS for different toolchain
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 01:56:34 +08:00
pangzhen1
d2ec034ada support inputting multiple ldscript files when linking the nuttx.bin
To support greenhill compilation, LDFLAGS removes the code that adds -T through addprefix to ARCHSCRIPT(greenhill requires a space between -T and ldscript files, but addprefix didn't do it). However,if we modified like this, when ARCHSCRIPT has more than one ldscript, the -T is only added to the first ldscript, but not to the following ldscripts, which results in a warning when linking.
To solve this problem, we can just add a space after $(SCRIPT_OPT) when using addprefix, instead of deleting addprefix.

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2024-08-27 01:56:34 +08:00
guoshichao
67f0b5131b arch/arm/toolchain: add greenhills toolchain config
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 01:56:34 +08:00
guoshichao
dd8b630b0d nuttx: add GREENHILLS compiler config option
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-08-27 01:56:34 +08:00
Xiang Xiao
fcb3e84c24 can: Merge netpacket/can.h into nuttx/can.h
To align with the layout of Linux can header file.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-08-26 05:05:31 -04:00
yanghuatao
fac44ab8aa nuttx/mps2: Support NuttX running on qemu cortex-m7
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-08-25 22:56:46 +08:00
Xiang Xiao
d3be25d90c arch/arm: Add the support of MPS2 AN386 and AN500
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-08-25 22:56:46 +08:00
hujun5
1d6a099180 irq: remove restore_critical_section in irq
Only in the non-critical region, nuttx can the respond to the irq and not hold the lock
When returning from the irq, there is no need to check whether the lock needs to be released
we also need keep restore_critical_section in svc call

test:
Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
   -machine virt,virtualization=on,gic-version=3 \
   -net none -chardev stdio,id=con,mux=on -serial chardev:con \
   -mon chardev=con,mode=readline -kernel ./nuttx

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-08-25 21:14:19 +08:00
Petro Karashchenko
d499ac9d58 nuttx: fix multiple 'FAR', 'CODE' and style issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-08-25 19:22:15 +08:00
Petro Karashchenko
f40b09cbc9 style: remove redundant spaces
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-08-25 19:22:15 +08:00
Petro Karashchenko
d252b6229f nuttx: use sizeof instead of define or number in snprintf
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-08-25 19:22:15 +08:00
chao an
a0afd38f24 arm/spinlock: up_testset() sould not depends on SMP
up_testset() sould not depends on SMP

Signed-off-by: chao an <anchao@lixiang.com>
2024-08-23 20:20:06 +08:00
Yanfeng Liu
74080e8659 arm/qemu: use WFI to avoid busy loop
This adds WFI based up_idle() for arm/qemu to fix busy loop.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-08-23 15:09:44 +08:00
Matheus Catarino
93b520f7b0 swift6 embedded support 2024-08-23 09:02:20 +08:00
jinxiuxu
b874d95beb drivers/audio: fix samp rate conversion issue
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-22 09:13:51 -03:00
Yanfeng Liu
01219b415c board/qemu-armv7a: add Cmake support
This adds Cmake support for `qemu-armv7a` device.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-08-22 15:25:02 +08:00
fangxinyong
9b3fe17743 arch/arm/arm_mpu.c: fix build warning
armv7-m/arm_mpu.c: In function 'mpu_dump_region':
armv7-m/arm_mpu.c:621:13: warning: format '%X' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
armv7-m/arm_mpu.c:621:13: warning: format '%X' expects argument of type 'unsigned int', but argument 6 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
armv7-m/arm_mpu.c:621:13: warning: format '%X' expects argument of type 'unsigned int', but argument 7 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
armv7-m/arm_mpu.c:621:13: warning: format '%u' expects argument of type 'unsigned int', but argument 8 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-08-22 01:58:46 +08:00
chenrun1
054c564a2d arm_mpu:Fix mpu_initialize not taking effect
Modified the input parameters of mpu_initialize to require the caller to provide the number of entries in the table

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:58:46 +08:00
chenrun1
62f598e547 arm_mpu:Reentrant allocation Region
Changes have been completed:
1.armv7m
2.armv8m
3.armv7r
4.arm64

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:58:46 +08:00
chenrun1
8e1a042eef nuttx/atomic.h:Fix missing type declarations at compile time
Summary:
  1.Modify the conditions for entering different include header files
  2.Added pre-definition for _Atomic _Bool when it is missing
  3.Added nuttx for stdatomic implementation. When toolchain does not support atomic, use lib/stdatomic to implement it

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:44:29 +08:00
chenrun1
91cf97ed84 arm_cache:Disable clean/flush optimization in case of SMP restriction
In a multicore task scenario, there may be a situation where the task runs on different cores at different time slices (when the task is not bound to a particular core).
When the task calls cache clean/flush(range > cache size), depending on the optimization, clean_all, flush_all are called. however, at this point, there may be dirty data or incomplete data profiles in the cache on the kernel that is running the task, which may result in dirty data being flushed into memory or make the application think that the flushed data should be successfully flushed into memory, leading to unknown consequences.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-21 03:04:41 +08:00
wangming9
0c12fb9237 arm/armv8-r: Fix cache interface
Signed-off-by: wangming9 <wangming9@xiaomi.com>
2024-08-21 03:04:41 +08:00