Commit Graph

21348 Commits

Author SHA1 Message Date
Petteri Aimonen
d68c8ec560 stm32_eth: Fix excessively long critical section in ifdown handler
stm32_ifdown() holds critical section when calling stm32_ethreset().
That function used to call up_mdelay(10) while waiting for the ethernet
peripheral reset to complete. This resulted in excessively long
critical section time with interrupts disabled.

The actual expected delay is a few clock ticks of the 50 MHz clock domain.
This commit changes polling interval to 1us and maximum to 10us.
2023-09-26 22:13:24 +08:00
Xiang Xiao
167c4ae2a4 arch/arm: Fix error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'}
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-26 15:03:59 +08:00
Xiang Xiao
1edcea3997 arch/Kconfig: Add prompt string to ARCH_CHIP_CUSTOM
so the user could enable it from defconfig

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-25 23:02:37 +08:00
raiden00pl
ade23b92d1 arch/{nrf52|nrf53}/pwm: fix compilation for MULTICHAN not set 2023-09-24 10:32:29 +08:00
makejian
cb3abc48d7 crypto/cryptodev: expansion hash operation
(1) remove size restriction for single hash operation
(2) support hash operation to update uint32_t data
Signed-off-by: makejian <makejian@xiaomi.com>
2023-09-24 03:49:33 +08:00
yinshengkai
4f25c287d2 arch/sim: add sim uart_ram support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-09-23 15:22:42 +08:00
wanggang26
d827ee5ffc refine: set file mode when oflags contains O_CREAT
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-23 15:20:51 +08:00
wangming9
029bbf6bbd arch/arm: Enable FPU on qemu and goldfish platforms
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-09-23 08:42:00 +02:00
yintao
da7d6ef37b sim_rptun: unlink shm when quit
if not unlink shm, the shared memory object still exists in host /dev/shm after quit
if nuttx is started with administrator privileges, or if it is restarted with user
privileges, there will be a problem with the permission to open this shm file

Signed-off-by: yintao <yintao@xiaomi.com>
2023-09-23 08:39:38 +02:00
laoniaokkk
4256dd934f Fix onchip flash erase fail 2023-09-23 12:36:11 +08:00
wanggang26
7f5e6bd383 hostfs: mask bit fields of not support
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-23 05:28:57 +09:00
raiden00pl
8833501084 arch/stm32h7/dualcore: don't use stm32_hsem interface for cores synchronisation
stm32_hsem functions can use debug messages but cores synchronisation is done when
the OS is not yet fully initialized
2023-09-22 19:46:26 +08:00
raiden00pl
0e01836f09 serial: add an option that selects uart rpmsg as console 2023-09-22 19:46:26 +08:00
wanggang26
e930476b4b enable O_CLOEXEC explicit
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-22 13:51:00 +08:00
simbit18
4f985f4367 Fix Kconfig style
Remove spaces from Kconfig
Add comments
2023-09-22 00:35:48 +08:00
raiden00pl
4c9c0c8be2 debug: add support for IPC (interprocessor communication) debug messages 2023-09-22 00:02:51 +08:00
simbit18
34bb0b6544 Fix nuttx coding style
Remove TABs
Remove spaces
Fix indentation
2023-09-21 10:03:13 -04:00
raiden00pl
dafa4e4413 arch/nrf{52|53|91}/serial: fix serial registration when ther is no console on serial 2023-09-21 20:31:03 +08:00
raiden00pl
f0155b9099 arch/nrf{52|53|91}/serial: fix warning if HAVE_UART_CONSOLE not defined
warning: control reaches end of non-void function [-Wreturn-type]
2023-09-21 20:31:03 +08:00
raiden00pl
3e79d21100 arch/arm: fix undefined reference to arm_serialinit when RTT console used 2023-09-21 20:30:27 +08:00
TimJTi
b406a30398 Fix historic %08x style printf format warnings 2023-09-21 09:04:07 +08:00
TimJTi
42093bbd54 Fix printf format warnings 2023-09-21 09:03:47 +08:00
Eero Nurkkala
8f5a6930e8 riscv/riscv_pmp.c: fix broken TOR checks
PMPCFG_A_TOR region may have zero size. The pmp configuration
currently fails for zero-sized TOR. This patch bypasses such a
restriction.

Also replace log2ceil with LOG2_CEIL from lib/math32.h.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-09-21 01:10:49 +08:00
ThomasNS
a2c806027f fix led panic feature 2023-09-21 00:35:12 +08:00
zhangyuan21
f47991e34d arch/arm64: select ARCH_HAVE_IRQTRIGGER for all arm64 chip
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-20 20:52:03 +08:00
Michal Lenc
c5209e6189 samv7: add support for one wire driver over UART/USART
This commit adds support for 1 wire interface over serial driver. SAMv7
MCU does not have build in one wire support therefore external hardware
still has to be used (connection of RX/TX for example).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-09-20 17:27:26 +08:00
Michal Lenc
2e08750daf samv7: rework U(S)ART config option to allow more driver configurations
UART/USART peripheral can be used for more than just standard serial
driver. It can for example be used for 1 wire interface communication
(with external circuitry added). This changes the Kconfig for SAMv7 to
allow future implementation of these drivers. Now user can select
what kind of a driver he wants on UART/USART (serial or something else).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-09-20 17:27:26 +08:00
Huang Qi
ac5e99d330 espressif: Force cast param in libc stubs
Fix:
```
chip/esp_libc_stubs.c: In function '__retarget_lock_init':
Error: chip/esp_libc_stubs.c:246:14: error: passing argument 1 of '_lock_init' from incompatible pointer type [-Werror=incompatible-pointer-types]
  246 |   _lock_init(lock);
      |              ^~~~
      |              |
      |              struct __lock **
chip/esp_libc_stubs.c:181:26: note: expected 'int *' but argument is of type 'struct __lock **'
  181 | void _lock_init(_lock_t *lock)
      |                          ^
chip/esp_libc_stubs.c: In function '__retarget_lock_init_recursive':
Error: chip/esp_libc_stubs.c:251:24: error: passing argument 1 of '_lock_init_recursive' from incompatible pointer type [-Werror=incompatible-pointer-types]
  251 |   _lock_init_recursive(lock);
      |                        ^~~~
      |                        |
      |                        struct __lock **
chip/esp_libc_stubs.c:187:36: note: expected 'int *' but argument is of type 'struct __lock **'
  187 | void _lock_init_recursive(_lock_t *lock)
      |                                    ^
chip/esp_libc_stubs.c: In function '__retarget_lock_close':
Error: chip/esp_libc_stubs.c:256:15: error: passing argument 1 of '_lock_close' from incompatible pointer type [-Werror=incompatible-pointer-types]
  256 |   _lock_close(&lock);
      |               ^~~~~
      |               |
      |               struct __lock **
chip/esp_libc_stubs.c:193:27: note: expected 'int *' but argument is of type 'struct __lock **'
  193 | void _lock_close(_lock_t *lock)
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-09-20 17:04:56 +08:00
Huang Qi
74e59feaaa rv32m1: Fix compile error
Follow other risc-v based chips, and fix:
```
chip/rv32m1_irq.c: In function 'up_irqinitialize':
Error: chip/rv32m1_irq.c:98:3: error: array subscript -2048 is outside array bounds of 'uint8_t[2147483647]' {aka 'unsigned char[2147483647]'} [-Werror=array-bounds]
   98 |   riscv_stack_color(g_intstacktop - intstack_size, intstack_size);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /github/workspace/sources/nuttx/arch/risc-v/src/common/riscv_internal.h:40,
                 from chip/rv32m1_irq.c:36:
/github/workspace/sources/nuttx/arch/risc-v/src/common/riscv_common_memorymap.h:72:16: note: at offset -2048 into object 'g_intstacktop' of size [0, 2147483647]
   72 | EXTERN uint8_t g_intstacktop[];   /* Initial top of interrupt stack */
      |                ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-09-20 17:04:56 +08:00
SPRESENSE
104dfb983d arch: cxd56xx: Return error for RTC alarm setting before initialization
Return EBUSY error for alarm setting before completion of RTC initialization.
2023-09-20 11:50:07 +03:00
xiao
1487aa267e add Artery at32
check nxstyle

check nxstyle
2023-09-20 02:07:55 +08:00
yintao
f3c9a8643b nuttx: change RPTUNIOC_START and RPTUNIOC_STOP to synchronous
Support quit remote when server poweroff

Signed-off-by: yintao <yintao@xiaomi.com>
2023-09-20 00:42:02 +08:00
Shanmin Zhang
e8550a02b9 arm64: support reboot / poweroff for qemu virt arm64
Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2023-09-20 00:40:44 +08:00
Roy Feng
d98367693d esp32s3: fix build error 2023-09-20 00:35:28 +08:00
Dong Heng
6ac28d5526 xtensa/esp32s3: LCD controller driver 2023-09-19 11:38:05 +08:00
liaoao
3a08c0a1e6 qemu:fdt:add device tree support for goldfish arm/arm64
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-09-19 11:34:26 +08:00
qinwei1
cb3e6667e3 arm64: add PSCI support for qemu platform
Summary
   Add ARM PCSI (Power State Coordination Interface) Support
for qemu. With the interface, Poweroff/PowerReset can be support

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-09-19 11:34:26 +08:00
zhangyuan21
1e55ca43ef arm64: set cpuid according to mpidr
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-19 11:34:26 +08:00
qinwei1
8eea6d2e2a arm64: GoldFish add miss arm64_netinitialize
Summary
    add miss arm64_netinitialize function for goldfish
platform

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-09-19 11:34:26 +08:00
qinwei1
c7e70b6967 arm64: GoldFish Platform support
Summary:
   Adding virtual evaluate platform GoldFish. Which is based on
Android Goldfish Emulator, it's a ARM virt board but Android enhance
it with more featue
   The patch set goldfish as a chip

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-09-19 11:34:26 +08:00
Xiang Xiao
15e78470f8 arch/sim: Guard frame buffer related setting in SIM_X11FB
and remove SIM_VNCSERVER

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-19 10:33:52 +08:00
qiaohaijiao1
31da767cfc sim/alsa: add AUDIO_FMT_PCM query handler
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2023-09-19 09:39:44 +08:00
chao an
ce6330bf29 arch/arm64: sync with mainline change
Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-19 09:38:52 +08:00
qinwei1
a42448feb4 arch/arm64: fix link RWX warning for NuttX arm64
Summary
  when using new gcc verion like:
  GNU ld (Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 2.39.0.20221210)

  we will get link warning like:

  aarch64-none-elf-ld: warning: XXX/nuttx has a LOAD segment with RWX permissions

  The patch fix the warning through add link option --no-warn-rwx-segments

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-09-19 09:38:52 +08:00
qinwei1
cbf76e96c7 arm64: add mcpu option for all Cortex CPU
Summary
   add mcpu option for all Cortex CPU, from Spec of gcc

https://gcc.gnu.org/onlinedocs/gcc-12.3.0/gcc/AArch64-Options.html

testing with ostest for every option

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-09-19 09:36:29 +08:00
qinwei1
335c83e3c0 arm64: sync make file rules from arch/arm
Summary:
  sync makefile build rules from arch/arm to fix some compile
issue

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-09-19 09:32:53 +08:00
Simon Filgis
8853e72502 add phy bordinit functionality
on boardlevel one can do reset, cable-check, diagnostics, check link
quality and more on every link up
2023-09-19 02:41:55 +08:00
chao an
5026a96cfa nxstyle: cleanup UTF-8 Unicode to ASCII
Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-18 11:54:17 -04:00
hujun5
02a3bbc73b sim/posix: Add the host_system interface
Encapsulate the host system interface to host_system.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-18 11:41:24 -04:00
Huang Qi
43610f75f1 tools: Use GCC 13.2 from xPack for risc-v 2023-09-18 21:25:13 +08:00
qiaohaijiao1
9334ae47c7 sim/sim_alsa: reset alsa pcm device when snd_pcm_avail < 0
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2023-09-18 21:24:02 +08:00
Ville Juven
1532ccbd59 risc-v/mpfs: Add DMA buffer allocator for eMMC access
The MPFS eMMC DMA has some requirements that are only fulfilled by
enabling separate DMA access buffers (FAT DMA buffers) and by forcing
indirect access to the media via FAT_FORCE_INDIRECT.

Why? Direct access to user buffers violates two things:
- Buffer alignment is not ensured
- Buffers are user memory (problematic in BUILD_KERNEL)
2023-09-18 21:03:36 +08:00
TaiJuWu
68b8006ee9 fix arm64_start_cpu 2023-09-17 01:20:25 +08:00
Xiang Xiao
8dbe86084e Remove FAR from source code under 32bit arch and board
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-16 19:12:13 +03:00
chao an
9f049b47bf backtrace/unwind: add more unwind instruction support
Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-16 19:51:17 +08:00
chao an
b52070a70e unwinder: fix unwind abort for uleb128 case
When unwind instruction is 0xb2,the subsequent instructions
are uleb128 bytes.
For now,it uses only the first uleb128 byte in code.

For vsp increments of 0x204~0x400,use one uleb128 byte like below:
0xc06a00e4 <unwind_test_work>: 0x80b27fac
  Compact model index: 0
  0xb2 0x7f vsp = vsp + 1024
  0xac      pop {r4, r5, r6, r7, r8, r14}

For vsp increments larger than 0x400,use two uleb128 bytes like below:
0xc06a00e4 <unwind_test_work>: @0xc0cc9e0c
  Compact model index: 1
  0xb2 0x81 0x01 vsp = vsp + 1032
  0xac      pop {r4, r5, r6, r7, r8, r14}
The unwind works well since the decoded uleb128 byte is also 0x81.

For vsp increments larger than 0x600,use two uleb128 bytes like below:
0xc06a00e4 <unwind_test_work>: @0xc0cc9e0c
  Compact model index: 1
  0xb2 0x81 0x02 vsp = vsp + 1544
  0xac      pop {r4, r5, r6, r7, r8, r14}
In this case,the decoded uleb128 result is 0x101(vsp=0x204+(0x101<<2)).
While the uleb128 used in code is 0x81(vsp=0x204+(0x81<<2)).
The unwind aborts at this frame since it gets incorrect vsp.

To fix this, add uleb128 decode to cover all the above case.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-16 19:51:17 +08:00
Daniel Appiagyei
5bfda12634 c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
Petro Karashchenko
017ccca5d6 arch/risc-v/esp32c6: fix compilation of esp32c6 serial driver
The commit fix regression introduced by c56aa7b527

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 18:29:59 +08:00
Petro Karashchenko
69b6a1f09c arch/arm[64]: fix nxstyle issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 14:17:47 +08:00
Petro Karashchenko
c56aa7b527 esp32: use ESP32 specific macro for register values extraction
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 14:17:47 +08:00
Petro Karashchenko
dbc37a0165 nuttx: fix nxstyle issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 14:17:47 +08:00
Petro Karashchenko
88c1a55efd arch/arm/samv7: fix print specifiers issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 14:17:47 +08:00
Petro Karashchenko
afaa2028f6 arch/arm/sama5: populate MCAN fixes from SAMv7 to SAMa5
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 14:17:47 +08:00
Petro Karashchenko
b0a42f0146 arch/xtensa/esp32: fix return values in BLE adapter
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 14:17:47 +08:00
Petro Karashchenko
816cb3cfaf style: fix multiple style issues and remove unused
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 14:17:47 +08:00
chenwen@espressif.com
827c2df889 xtensa/esp32s3: Fix octal lines mode SPIRAM blocking issue
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2023-09-15 20:40:52 +03:00
shipei
0beba027e7 audio:add 24K sample rate support
Signed-off-by: shipei <shipei@xiaomi.com>
2023-09-15 02:26:03 +08:00
chenwen@espressif.com
75999d247f xtensa/esp32s3: SPI support psram and flash timing tuning
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2023-09-15 00:35:17 +08:00
Peter van der Perk
0d4b42255b s32k3: emac use semi-unique MAC address 2023-09-14 20:54:21 +08:00
simbit18
50e6dcb1e0 Fix nuttx coding style
Correct forming guard names
2023-09-13 22:49:38 +08:00
simbit18
b3973496cd Fix Kconfig style
Remove spaces from Kconfig
Add comments
2023-09-13 21:39:49 +08:00
wangming9
72cf51faf3 arm/psci: Fixed arm psci related compilation errors
Summary
include/arch/syscall.h: Assembler messages:
include/arch/syscall.h:133: Error: bad instruction `struct arm_smccc_res'
include/arch/syscall.h:134: Error: junk at end of line, first unrecognized character is `{'
include/arch/syscall.h:135: Error: bad instruction `unsigned long a0'
include/arch/syscall.h:136: Error: bad instruction `unsigned long a1'
include/arch/syscall.h:137: Error: bad instruction `unsigned long a2'
include/arch/syscall.h:138: Error: bad instruction `unsigned long a3'
include/arch/syscall.h:139: Error: bad instruction `unsigned long a4'
include/arch/syscall.h:140: Error: bad instruction `unsigned long a5'
include/arch/syscall.h:141: Error: bad instruction `unsigned long a6'
include/arch/syscall.h:142: Error: bad instruction `unsigned long a7'
include/arch/syscall.h:143: Error: junk at end of line, first unrecognized character is `}'
include/arch/syscall.h:145: Error: bad instruction `typedef struct arm_smccc_res

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-09-13 21:06:51 +08:00
Jukka Laitinen
bd52ae1ad9 arch/risc-v/src/mpfs/mpfs_i2c.c: Clean up using priv->status and STOP interrupts
- There are occasional extra STOPs being sent due to an IP bug when using an
  FPGA based I2C. Add a flag "inflight" to mask out extra STOP interrupts when
  using the FPGA based implementation
- There are no MPFS_I2C_ST_STOP_SENT irq's "initally". It is just already
  either success or still in progress

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-09-12 22:11:24 +08:00
jianglianfang
479bfd5414 sim_framebuffer: add double buffer for sim
support double framebuffer mode and adapter to the new vsync queue.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-09-12 22:10:10 +08:00
pengyiqiang
6536ddcdcf sim/framebuffer: remove duplicate poll notify
The framebuffer of the emulator is a single buffer mode, and the pan_display method is not implemented, so as long as the fb device is created and poll notify once, the fb can be kept in a writable state.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-09-12 22:10:10 +08:00
Shanmin Zhang
b9fb9bea1d arm: support reboot / poweroff for qemu virt arm
Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2023-09-12 21:57:13 +08:00
Tomáš Pilný
98b43752d5 esp32/rmt: fix bug in rmt_reset 2023-09-12 17:44:42 +08:00
Tomáš Pilný
103270be1d esp32/rmt: Improve comments in ESP32's RMT peripheral 2023-09-12 17:44:42 +08:00
Xiang Xiao
d4fd9f53cd Fix error: arch/sim/src/sim/posix/sim_alsa.c:290:18: error: 'flags' undeclared
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-12 10:02:50 +08:00
daniellizewski
a75b3bad15 Fixed typo in CRC define 2023-09-12 00:41:59 +08:00
Petro Karashchenko
a003a7ea36 arch/xtensa/esp32s3: add UART RS485 support
This commit adds support of RS485 support in ESP32-S3 serial driver

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-11 23:20:49 +08:00
Pavel Pisa
b9472129c8 arch/arm/samv7: fix typos in quadrature encoder and timer drivers
The typo s/.timid/.tcid prevents to compile NuttX with
quadrature encoder configured for timer1 (CONFIG_SAMV7_TC1_QE)
and s/SAM_TC789_BASE/SAM_TC678_BASE prevented use of the
of the timer 2.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2023-09-11 23:11:43 +08:00
yintao
9e43a4d31c sim: To avoid system calls being interrupted when use host api
Signed-off-by: yintao <yintao@xiaomi.com>
2023-09-11 20:33:49 +08:00
hujun5
70a67099b3 timer/trustzone: set CPU frequency in tee environment
In an implementation that supports the ARM Security Extensions, only
software executing in a Secure PL1 mode can write to CNTFRQ

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-10 23:10:06 +08:00
liaoao
d63e3962bf qemu:fdt:add device tree support for goldfish arm/arm64
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-09-10 23:10:06 +08:00
wangming9
c8a4bdf21a arch/arm: GoldFish Platform support
Summary:
    Adding virtual evaluate platform GoldFish. Which is based on
    Android Goldfish Emulator, it's a ARM virt board but Android
    enhance it with more featue.
    The patch set goldfish as a arm chip.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-09-10 23:10:06 +08:00
liaoao
78c942a05a devicetree: add devicetree support for arm/arm64
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-09-10 14:28:41 +03:00
hujun5
90fba56d2e timer/trustzone: set CPU frequency in tee environment
In an implementation that supports the ARM Security Extensions, only
software executing in a Secure PL1 mode can write to CNTFRQ

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-10 14:28:41 +03:00
hujun5
d9cbf84d86 arm/oneshot: rm sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-09 20:26:32 +08:00
hujun5
3f8f3340d1 pic32mx: sched_lock should replace with enter_critical_secion
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-09 10:26:03 +08:00
hujun5
0b23a316ca sam_hsmci: rm sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-09 00:21:29 +08:00
shipei
f150699d7a audio:add media session support for sim_alsa audio_ops_s interface
fix Compiler Warning:initialization of ‘int (*)(struct audio_lowerhalf_s *, void *)’
from incompatible pointer type ‘int (*)(struct audio_lowerhalf_s *)’ [-Wincompatible-pointer-types]

Signed-off-by: shipei <shipei@xiaomi.com>
2023-09-09 00:13:06 +08:00
Jukka Laitinen
a6388b8843 arch/risc-v/src/mpfs: Add ksz9477 initialization
This adds initialization of the ksz9477 switch when used instead of
a PHY, directly connected to SGMII

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-09-08 22:34:27 +08:00
Michal Lenc
6d0151c8da sam_usbdevhs.c: fix compile warning
chip/sam_usbdevhs.c:2474:11: warning: 'response' may be used uninitialized [-Wmaybe-uninitialized]
 2474 |           sam_ctrlep_write(ep0, response.b, nbytes);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
chip/sam_usbdevhs.c:1845:13: note: by argument 2 of type 'const uint8_t *' {aka 'const unsigned char *'} to 'sam_ctrlep_write' declared here
 1845 | static void sam_ctrlep_write(struct sam_ep_s *privep, const uint8_t *buffer,
      |             ^~~~~~~~~~~~~~~~
chip/sam_usbdevhs.c:2001:24: note: 'response' declared here
 2001 |   union wb_u           response;
      |                        ^~~~~~~~

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-09-08 15:56:52 +03:00
Petro Karashchenko
f39de6fd1a arch/arm/armv[7|8]-m: implement dcache clean as barrier in write-through mode
This change fixes the issue when SAMv7 GMAC sometimes does not start packet
transmission. The issue is that EMAC_NCR_TSTART is written to EMAC_NCR register
while tx descriptor is not delivered to memory.

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-08 11:54:04 +08:00
Eren Terzioglu
a26996fb3b xtensa/esp32s3: Add support to TWAI/CANBus controller 2023-09-08 01:49:43 +08:00
hujun5
83ba72e4b4 cxd56xx: rm sched_[un]lock
According to the current implementation, "cxd56_cpu1siguninit" will only
be called once during the NuttX startup phase,
and it won't involve scenarios of multi-threaded concurrent access.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-08 01:47:40 +08:00
Michal Lenc
c2bc3dfb12 samv7: add support for SD card detection from CD/DAT3 line
Some SD card connectors do not have separate card detection pin. In that
case card detection has to be done on CD/DAT3 data line. This means
software (i.e. architecture level driver) has to take care of pin
configuration switching (pin has to be set as data pin in case of
transfer and as interrupt card detection pin when there is no action
on data line).

This commit adds CD/DAT3 line card detection support for SAMv7 MCU.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-09-08 01:13:36 +08:00
yanxiaowei
5c780f6697 sim/framebuffer: fix memory leak
LeakSanitizer: detected memory leaks in XStringListToTextProperty

Signed-off-by: yanxiaowei <yanxiaowei@xiaomi.com>
2023-09-07 11:21:58 +03:00
cuiziwei
ba73272f67 nuttx/sim:add up_irq_enbale function.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-09-06 21:42:42 +03:00
Jukka Laitinen
b750f94896 arch/risc-v/src/mpfs: Generate an unique locally administrated MAC address
Add a function to read PolarFire's serial number from system controller, and use the first five digits as device's mac address

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-09-07 00:53:00 +08:00
Jari Nippula
ef18d2b599 arch/riscv/src/mpfs/mpfs_ethernet.c: discard err rxframe in int work
Workaround to avoid deadlock situation: The RX shall not try to wait for complete
frame in case there is RX errors detected.

In case mpfs_receive is called, it keeps waiting for complete frame and
also keeps the net_lock locked. In the mean while, the TX may run out of free
descriptors, but can not get net_lock mutex lock to be able to release used
descriptors. If there are no free TX descs it disables RX interrupts because
it may require to send response to the received frame.
So, TX side keeps RX interrupts disabled due to lack of free descriptors and
RX blocks TX to release those descs by stubbornly waiting for complete frame.
2023-09-07 00:53:00 +08:00
Xu Xingliang
a2df576ecf kasan: add option to disable read/write checks
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2023-09-07 00:41:43 +08:00
yintao
cb105192c7 nuttx/sim: Sim_rptun support configuring whether the master will automatically boot slave
Signed-off-by: yintao <yintao@xiaomi.com>
2023-09-06 17:05:55 +03:00
Eero Nurkkala
0152b031a4 risc-v/mpfs: enhance rpmsg throughput
RPMSG is associated with the use of HPWORK / LPWORK queues.
After sending a message to the remote end (Linux), the system
waits for an ack before proceeding. Unfortunately this may
take sometimes more time than one would expect. Ack waiting is
also unnecessary: nothing is done with that information. Even
worse, the net_lock() is also held during the blocked time so
it blocks other network stacks that are unrelated to this.

Also reorganize the mpfs_opensbi_*.S so that the trap
handler is easily relocated in the linker .ld file without
the need to relocate the utils.S. This makes it easier to
separate the files into own segments. The trap file should be
located in the zero device.

Moreover, provide support for simultaneous ACK and message
present handling capabilities in both directions. There are
times when both bits are set but only other is being handled.

In the end, the maximum throughput of the RPMSG bus increases
easily 10-20% or even more.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-09-06 14:32:11 +08:00
Seppo Hirvela
67ad63c7a4 risc-v/mpfs: ihc: fix to work with the latest NuttX OpenAMP version 2023-09-06 14:32:11 +08:00
Jani Paalijarvi
a1aebb7a64 risc-v/mpfs: ihc: Minor fixes
Remove unnecessary VQID shifting (16 -> 0).
Give an error if RPTUN init fails.
2023-09-06 14:32:11 +08:00
Jani Paalijarvi
cc5e8222b3 risc-v/mpfs: ihc: Increase RPMSG buffer size
Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2023-09-06 14:32:11 +08:00
Jani Paalijarvi
3bd4bd6196 risc-v/mpfs: ihc: Make Vring addresses configurable 2023-09-06 14:32:11 +08:00
Jani Paalijarvi
00cb72bc09 risc-v/mpfs: ihc: Make IHC HSS workaround configurable 2023-09-06 14:32:11 +08:00
Philippe Leduc
87cec56154 Handle GPIO IRQs
Add board buttons
2023-09-06 12:30:35 +08:00
Philippe Leduc
5b7c948aef Add GPIO
Add userleds
2023-09-06 12:30:35 +08:00
Petro Karashchenko
12ea47b10f arch/xtensa/esp32s3: add UART2 support
This commits adds support of UART2 for EPS32S3 and fixes pin mode
assignment for iomux mode

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-06 02:40:49 +08:00
Stuart Ianna
99d630b18d arch/risc-v/litex/litex_sdio: Address race condition in eventwait.
Wraps litex_eventwait in a critical section to handle the case that an event can occur before it's waited on.
2023-09-06 02:23:57 +08:00
Tiago Medicci Serrano
8a51534903 esp32s3/i2s: Check compatibility of the current master clock set
The master clock frequency should be multiple of the sample rate
and bit clock at the same time. Then, check if the current master
clock satisfies such a condition and set it accordingly otherwise.
2023-09-05 13:33:05 +08:00
Tiago Medicci Serrano
f1b459347b esp32s3/i2s: Add interface to stop the I2S streams
In order to gracefully stop the I2S stream, add an interface to set
a `streaming` status variable that sets the `AUDIO_APB_FINAL` flag
that will be handled by the upper layers of the audio subsystem.
2023-09-05 13:33:05 +08:00
Alan Carvalho de Assis
5065849ab6 esp32s3/i2s: Add initial support to I2S peripheral
The I2S peripherals are now supported for both receiving and
transmitting controllers.
2023-09-05 13:33:05 +08:00
Tiago Medicci Serrano
45d17551b3 esp32s3/dma: Set the DMA descriptor according to RX or TX operation
According to RX/TX operation, the DMA descriptors (inlink/outlink)
should be set differently. When setting the inlink, the `suc_eof`
field must be cleared by software (it will be set by hardware when
a packet is received). Similarly, the `length` field will be set
by hardware a packet is received.
2023-09-05 13:33:05 +08:00
Tiago Medicci Serrano
e7eeb99139 esp32s3/dma: Define macros on header files to be used by the system
Define macros used to access the registers of the GDMA channels
according to the selected channel in the header file, enabling them
to be used by other drivers.
2023-09-05 13:33:05 +08:00
Tiago Medicci Serrano
a513770fcb esp32s3/dma: Split the setup and load of the DMA descriptors
By splitting into two different functions the setup of the DMA
descriptors and the action of loading it to the GDMA outlink
register, it enables us to "cache" DMA descriptors ready to be send
and, then, just load them whenever we are able to actually send it.
2023-09-05 13:33:05 +08:00
Tiago Medicci Serrano
d26212bd39 esp32s3/dma: Fix loading the DMA descriptor address
The macro `SET_BITS` only sets the bits according to the bit mask
and, once it's being used to set the address field of the GDMA
inlink/outlink register, it's necessary to clean all the bits
corresponding to that field that were eventually setup previously
to avoid messing with the bits that correspond to the current
address being setup.
2023-09-05 13:33:05 +08:00
Jakub Zdroik
96a2196beb fix argument of nxsem_wait_uninterruptible 2023-09-04 23:20:32 +08:00
wangjianyu3
8a13da322d binfmt: Support arch copy section by self for dynamic code loading
This option enables architecture-specific memory copy for dynamic code loading.

For example, Ambiq has MRAM regions for instruction which can't load by
the memcpy directly.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2023-09-04 12:23:26 +08:00
Eero Nurkkala
f5cdfa73dc risc-v/mpfs: clear L2 before use
SiFive document: "ECC Error Handling Guide" states:

"Any SRAM block or cache memory containing ECC functionality needs to be
initialized prior to use. ECC will correct defective bits based on memory
contents, so if memory is not first initialized to a known state, then ECC
will not operate as expected. It is recommended to use a DMA, if available,
to write the entire SRAM or cache to zeros prior to enabling ECC reporting.
If no DMA is present, use store instructions issued from the processor."

Clean the cache at this early stage so no ECC errors will be flooding later.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-09-01 19:28:54 +08:00
simbit18
a642b7a54f Fix Kconfig style
Remove extra TABs
Add comments
2023-08-31 18:08:22 +03:00
Philippe Leduc
98e998b934 Add i2c support for the i.MX8MP
Enable INA219 on the Verdin board
2023-08-31 10:35:46 -03:00
Ville Juven
779741d1d9 riscv/riscv_pmp.c: Improve NAPOT area validity checks
Check that the base address and region size are properly aligned with
relation to each other.

With NAPOT encoding the area base and size are not arbitrary, as when
the size increases the amount of bits available for encoding the base
address decreases.
2023-08-30 19:04:22 +03:00
Jukka Laitinen
697472dc07 arch/risc-v/src/mpfs/mpfs_ddr.c: Re-write write calibration
Clean up the code and remove un-used global variables & structs

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
f10dab5531 arch/risc-v/src/mpfs: Sync some of the libero config macros with HSS reference code
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
Co-authored-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
c80b8fdf24 arch/risc-v/src/mpfs/mpfs_ddr.c: Add a simple prng for memory training code
Implement the previously empty mpfs_ddr_rand with adapted "seiran128" code
from https://github.com/andanteyk/prng-seiran

This implements a non-secure prng, which is minimal in size. The DDR training
doesn't need cryptographically secure prng, and linking in the NuttX crypto
would increase the code size significantly for bootloaders.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
f9b5918462 arch/risc-v/src/mpfs/mpfs_ddr.c: Make sure that DDRC is in reset when starting the training
Also move the DDRC clock enablement and reset to mpfs_init_ddr. This doesn't
change the functionality, but is the cleaner place for it.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
6baeb7217e arch/risc-v/src/mpfs/mpfs_ddr.c: Correct memory test timeouts
Especially the write calibration must bail out if the memory test timeouts,
otherwise the device will get stuck in running the memory test in sequence,
and it will always timeout.

Negative error value was also not properly returned from mpfs_mtc_test.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
d38eebc0e9 arch/risc-v/src/mpfs/mpfs_ddr.c: Don't auto-determine the write latency
It doesn't make sense to try to auto-determine write latency, it may pass with too low value.

Keep the existing implementation if the write latency has been set to minimum
value, otherwise just set it.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
Jukka Laitinen
8fb2e41994 arch/risc-v/src/mpfs/mpfs_ddr.c: Correct the DDR training dq/dqs status check
It was checking a wrong register for dq/dqs window size.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-30 12:28:21 +03:00
chao an
664927c86e mm/alloc: remove all unnecessary cast for alloc
Fix the minor style issue and remove unnecessary cast

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 14:34:20 +08:00
chao an
b60f01a55b inode/i_private: remove all unnecessary cast for i_private
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 08:58:07 +02:00
chao an
7aa45305b7 fs/inode: remove all unnecessary check for filep/inode
Since VFS layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 09:47:11 +08:00
Michal Lenc
03e5c0217b samv7: allow usage of QSPI in SPI mode for all MCUs
Current implementation of QSPI in SPI mode was available only for MCUs
that do not have standard SPI at all. MCUs with both QSPI and SPI can
however also use QSPI in SPI mode and thus have one more SPI bus. This
commit adds required defines and config options to support QSPI in SPI
mode for all SAMv7 MCUs.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-28 17:39:51 +03:00
chao an
518dcbdaad sim/internal: add typedef pid_t to enhance sim compatibility
enhance sim compatibility on windows

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-28 17:12:45 +03:00
Ville Juven
01cc1687b3 mpfs/mpfs_i2c.c: Replace 1 second timeout with Time-on-Air based timeout
Calculate how long an I2C transation will take in microseconds, and use
this as the timeout for mpfs_i2c_sem_waitdone.

The reason for doing this is not to keep an i2c bus reserved for the full
1 second timeout, if e.g. a sensor is not on the bus / is faulty and
non-responsive. Reading the other sensors will be blocked for a relatively
long time (1 second) in this case. This fixes such behavior.
2023-08-28 21:16:23 +08:00
Xiang Xiao
47faeeb360 tls: Move task_tls_alloc and task_tls_destruct to libc
so task_tls_destruct can be called from usrspace, which is required by:
https://github.com/apache/nuttx/pull/10288

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-28 11:02:18 +03:00
raiden00pl
2fffd7dad6 arch/stm32h7: add RPTUN support 2023-08-26 03:35:32 +08:00
raiden00pl
a6c25f657d arch/stm32h7: add CM4 core support 2023-08-26 03:35:32 +08:00
raiden00pl
86134461f3 arch/stm32h7: use STM32_CPUCLK_FREQUENCY to initialize perf 2023-08-26 03:35:32 +08:00
raiden00pl
4c358419f0 arch/stm32h7: add an option to bypass clock configuration 2023-08-26 03:35:32 +08:00
raiden00pl
5ddded5561 arch/stm32h7/rcc: default value for BOARD_FLASH_PROGDELAY 2023-08-26 03:35:32 +08:00
raiden00pl
4c9d405a97 arch/stm32h7: add HSEM support 2023-08-26 03:35:32 +08:00
Xiang Xiao
a967da5270 arch/riscv: Move -mcmodel=medany from Make.defs to Toolchain.defs
to avoid the code duplication

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-25 21:22:47 +03:00
chao an
563125fde3 make/archive: Use the full path name when matching or storing names in the archive
This pr will avoid targets with the same name can not be archive in the same library

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-26 01:21:10 +08:00
SPRESENSE
6d44c42707 arch/arm/src/cxd56xx: Fix file path on top comment
Fix file path described in top comment for each files.
2023-08-26 01:20:32 +08:00