Commit Graph

45469 Commits

Author SHA1 Message Date
Xiang Xiao
317cc6c174 tools/nxstyle: Add the suffix white list
and initialize it to "kHz", "Mbps", and "us"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-13 16:39:16 +03:00
zhuyanlin
ad57791fe0 arch:xtensa: remove struct xtensa_cpstate_s as no need used
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-13 15:28:45 +02:00
zhuyanlin
f423f94d08 arch:xtensa: modify xtensa_context_save/restore function
with FPU registers in xcp context, use pointer instead of double
pointer

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-13 15:28:45 +02:00
zhuyanlin
1dc39689ff xtensa: move fpu register to XCPTCONTEXT_REGS
1 move fpu register to XCP_REGS
2 move save & restore fpu register to context_save/restore

Consistency with other archs.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-13 15:28:45 +02:00
Xiang Xiao
323d8d9547 mmcsd: Add FAR to the pointer argument
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-13 15:41:27 +03:00
Xiang Xiao
679bc88cab drivers/sdio: Call SDIO_LOCK before and after the transaction
follow the same behaviour in drivers/mmcsd/mmcsd_sdio.c

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-13 15:41:27 +03:00
wangbowen6
f23ba7e761 arm/tlsr82: add hardware aes encrypt and decrypt support.
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-05-13 20:24:46 +08:00
Fotis Panagiotopoulos
8ef20c230b icmp: Fixed replies to broadcasts. 2022-05-13 20:22:06 +08:00
Eero Nurkkala
0a75a9556d risc-v/mpfs: apply IHC review fixes
PR#6249 was already merged without the review fixes. Provide the
fixes here on a separate patch.

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-05-13 10:38:51 +03:00
Petro Karashchenko
89fe6b1d24 include/nuttx/crypto: include sys/types.h insted of stdint.h
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-05-13 10:48:42 +08:00
Gustavo Henrique Nihei
ba2829adb2 xtensa: Fix argument passing for sys_call5 and sys_call6 functions
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-13 10:43:00 +09:00
Xiang Xiao
f7f8a21486 libs: Move aeabi_atexit from libxx/ to libc/machine/arm/
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-13 00:13:03 +03:00
Xiang Xiao
1ba316b5c7 arch: Remove board/libboard$(LIBEXT) from the rerequest of export_startup
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-12 23:34:31 +03:00
Xiang Xiao
23200471df arch/riscv: Remove & ~1 before assign signal_handler to REG_EPC
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-12 23:31:50 +03:00
Masayuki Ishikawa
dc2a01e75a boards: rv-virt: Add knsh64 related files
Summary:
- This commit adds knsh64 related files

Impact:
- None

Testing:
- Tested with qemu-6.2

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-05-13 04:14:01 +08:00
Masayuki Ishikawa
3193aa3c97 arch: risc-v: Add MMU support for qemu-rv
Summary:
- This commit adds MMU support for qemu-rv
- Please note that mtimer is disabled for S-mode because
  the mtimer needs to be accessed in M-mode

Impact:
- qemu-rv only

Testing:
- Tested with rv-virt:knsh64 (will be pushed later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-05-13 04:14:01 +08:00
Eero Nurkkala
77e36d1acc risc-v/mpfs: introduce IHC driver
This provides an example of Asymmetric Multiprocessing (AMP). The
master from Linux sends pings that this NuttX echoes back. The system
uses RPMsg from OpenAMP.

The Inter-Hart Communication module is present in the vendor's software
stack with the tag "2021.11". The software is present on github at the
polarfire-soc project. The following conditions must be met:

 1. FPGA programmed with 2021.11 software
 2. HSS (Vendor bootloader) with 2021.11 software
 3. U-boot and Linux kernel from 2011.11 software

Currently the IHC works as a slave only on the hart number 4.

On the NuttX side, this patch uses rptun that incorporates rpmsg and
virtio. If it used only rpmsg and virtio, the future maintenance would
likely be much heavier. Using rptun also simplifies many things.

Upon success, the master side from Linux may issue an example test:

root@icicle-kit-es-amp:/opt/microchip/amp/rpmsg-pingpong# ./rpmsg-pingpong

However, the rpmsg-pingpong.c (compiled on target with gcc), may need to
be modified as seen below to match the device id:
 - char *rpmsg_dev="virtio0.rpmsg-amp-demo-channel.-1.0";
 + char *rpmsg_dev="virtio0.rpmsg-amp-demo-channel.-1.1024";

This work uses a separate linker script. Due to a bug yet unknown to date,
a small NuttX, when loaded by the vendor HSS bootloader, will cause the
Linux kernel to hang at boot. Thus, the binary size is increased with
a section 'filler_area' whose only purpose is to increase the image size
so that the Linux kernel will boot up.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-05-12 22:56:12 +08:00
wangbowen6
bc61e71b94 crypto: change type uint32_t to size_t in aes_cypher() arguments.
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-05-12 22:28:54 +08:00
wangbowen6
568621fbcf crypto: fix compile error.
In file included from drivers_initialize.c:25:0:
/home/wangbowen/project/community/wbw_nuttx/nuttx/include/nuttx/crypto/crypto.h:74:20: error: expected ')' before 'void'

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-05-12 22:28:54 +08:00
Ville Juven
47e85b68fe arch/addrenv: Change text write enable/disable to generic mprot
Implement a generic access rights modification procedure instead
of the procedures that only do one thing (enable/disable write)
to one section (text).
2022-05-12 22:28:31 +08:00
YAMAMOTO Takashi
072c28fe8e Revert "tools/mkallsyms.sh: Disable the mismatch warning of builtin declaration"
This reverts commit 848d1ef0b7.

It doesn't make sense because the generated file just have names of
symbols as strings. Nothing to worry about builtins.
2022-05-12 22:19:52 +08:00
Ville Juven
5bcd1dbb64 sched: Remove task_restart in case of CONFIG_BUILD_KERNEL
Same treatment as task_delete, this is not usable in kernel build
either.
2022-05-12 22:08:19 +08:00
Ville Juven
fb1c1bfe6c libc: Rename lib_Exit lib__Exit
Naming collision with lib_exit on some systems
2022-05-12 14:24:18 +03:00
YAMAMOTO Takashi
30a1b4e359 tools/mkallsyms.sh: Make it work with llvm
The llvm version of c++filt doesn't have -p option.
Use sed instead.
2022-05-12 14:56:07 +08:00
Matthew Trescott
f6f826c09a Fix broken tiva_gpioirqclear 2022-05-12 14:49:35 +08:00
chao.an
04f7beea83 arm/tlsr82: fix kconfig warning
arch/arm/src/tlsr82/Kconfig:272:warning: leading whitespace ignored

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-05-12 14:58:47 +09:00
Masayuki Ishikawa
5c3d6bba6d libs: risc-v: Add R_RISCV_JAL support to arch_elf.c
Summary:
- This commit adds R_RISCV_JAL support to arch_elf.c
- The code only checks the immediate value but does not relocate it
  because it is done by the compiler.

Impact:
- None

Testing:
- Tested with rv-virt:knsh64 (not merged yet)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-05-12 10:36:03 +08:00
Ville Juven
b1d92159fa sched: Remove task_delete in case of CONFIG_BUILD_KERNEL
Deleting a task from another task's context will not do, so shut
this gate down for BUILD_KERNEL. In this case if a task wants another
task to terminate, it must ask the other task to politely kill itself.

Note: kthreads still need this, also, the kernel can delete a task
without asking.
2022-05-12 03:27:25 +08:00
wangbowen6
c39d3fa9e4 tlsr82/tc32: optimize the irq process
1. using armv6-m arm_irq();
2. simplify the interrupt number get process;
3. To improve the performance, move common exception code to ram_code.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-05-12 02:07:52 +08:00
wangbowen6
6caa8f1075 arm_createstack: fix warning for tc32 compiler.
fix warning:
common/arm_createstack.c: In function 'up_create_stack':
common/arm_createstack.c:154:11: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-05-11 20:14:30 +03:00
Masayuki Ishikawa
45beda286b arch: risc-v: Enable FPU for qemu-rv only if EXPERIMENTAL=y
Summary:
- Because a context switch issue still exists with FPU,
  it should be enabled only if EXPERIMENTAL=y

Impact:
- None

Testing:
- Tested with ostest

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-05-11 21:57:16 +08:00
wangbowen6
db1e6656dd arm/tc32/Make.defs: filter-out arm_udelay.c
tc32 architecture implement up_udelay by itself, so filter
out arm_udelay.c.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-05-11 21:57:01 +08:00
wangbowen6
28684f24b7 arm/tlsr82: pwm driver optimize and add pulse count support.
1. add pulse count support for pwm0;
2. add more detailed config for pwm;
3. pwm configuration and start process optimize;
4. tlsr82/Kconfig format;

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-05-11 13:15:44 +03:00
zhuyanlin
38f8032e31 libc:xtensa: move syscall to swint call
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-11 10:48:53 +02:00
zhuyanlin
b99ba04a8c arch:xtensa: Add SYS_flush_context syscall
This syscall do nothing as flush context was done in interrupt handler.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-11 10:48:53 +02:00
Xiang Xiao
6e93b440fe arch/sim: Fix warning: overriding recipe for target 'config.h'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-11 17:39:33 +09:00
Xiang Xiao
0cf2330e41 arch/arm: Fix target 'arm_vectortab.o' given more than once in the same rule 2022-05-11 17:39:33 +09:00
Xiang Xiao
06e36f6a13 boards/b-l475e-iot01a: Fix selects WL_SPIRIT which has unmet direct dependencies (DRIVERS_WIRELESS && ALLOW_BSD_COMPONENTS)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-11 17:39:33 +09:00
Masayuki Ishikawa
9af903dcf0 boards: lm3s6965-ek: Remove CONFIG_TIVA_ETHERNET from qemu-kostest
Summary:
- The configuration is no longer needed because Kconfig has
  been fixed in the previous commit

Impact:
- None

Testing:
- Tested with QEMU

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-05-11 15:09:34 +08:00
Masayuki Ishikawa
1277bcfd15 arch: tiva: Fix TIVA_WITH_QEMU in Kconfig
Summary:
- TIVA_WITH_QEMU is used to run the NuttX with QEMU
- The configuration should not depend on TIVA_ETHERNET
- This commit fixes this issue

Impact:
- None

Testing:
- Tested with QEMU

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-05-11 15:09:34 +08:00
Abdelatif Guettouche
12453bb623 xtensa_sigtramp.S: Remove the ENTRY instruction.
_xtensa_sig_trampoline is returned to after a context switch and not called
by the usual Window call instructions (call4, call8 and call12),
thus does not need the entry instruction.  Furthermore, the ENTRY instruction
in this case is messing up the backtrace as it creates an extra frame.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-05-11 08:17:25 +09:00
Abdelatif Guettouche
3f632bf12b xtensa_sigtramp.S: Fix call0 instruction.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-05-11 08:17:25 +09:00
Abdelatif Guettouche
1cf2fa75c4 arch/xtensa: Fix some typos and comments.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-05-11 08:17:25 +09:00
Juha Niskanen
a17bfec43d libc/string: simplify strrchr
Do not call strlen() here. Old implementation iterated
over string twice, if searched for position was at the
beginning. This commit changes strrchr() to scan string
only once, regardless of input.

Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2022-05-10 23:29:23 +08:00
Xiang Xiao
0c8d3489e6 arch/arm: Fix target 'arm_fpuconfig.o' given more than once in the same rule
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-10 16:42:43 +03:00
Xiang Xiao
b907a1fec7 cpuload: Support the internal computation in the tickless mode
just like how the same thing done in nxsched_process_timer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-10 21:21:19 +08:00
Xiang Xiao
f47cf7ba04 sched: Add nxsched_process_cpuload_ticks prototype to sched/sched/sched.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-10 21:21:19 +08:00
zhuyanlin
de3bb757d2 sched:sched_cpuload_period: add time compensate for idle task
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-10 21:21:19 +08:00
zhuyanlin
c75f4b62e0 sched:sched_cpuload_oneshot: add time compensate for idle task
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-10 21:21:19 +08:00
zhuyanlin
6facf18a01 cpuload: nxsched_cpu_process_cpuload: add ticks parameter
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-10 21:21:19 +08:00