Commit Graph

21307 Commits

Author SHA1 Message Date
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
SPRESENSE
f7400a857d drivers/audio/cxd56: Move cxd56 sources into arch/cxd56xx
CXD56 audio functions are inside of the CXD56.
So implementation of it should be under arch directory.
2023-08-26 01:20:32 +08:00
chengkai
d867c46bbc serial/uart/h5: add bt h5 uart serial driver
Signed-off-by: chengkai <chengkai@xiaomi.com>
2023-08-25 17:17:37 +08:00
Stuart Ianna
50f0fd4df2 risc-v/litex: Add system reset and access to core control registers. 2023-08-25 17:16:28 +08:00
Roy Feng
937312242e esp32: Fix build warning
And an incorrect log output
2023-08-25 17:06:32 +08:00
Michal Lenc
606b6d9310 samv7: add support for PWM polarity settings
This commit adds function pwm_set_polarity() that setups channel
polarity based on input info from application layer.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-24 18:25:47 -03:00
Philippe Leduc
e084c52e12 Add i.MX8MP Cortex-M7 port for NuttX 2023-08-24 20:10:48 +08:00
raiden00pl
c3f8753ecd Documentation: migrate STM32L4 2023-08-24 17:56:39 +08:00
Anner J. Bonilla
24e45d071e Pinephone Pro port just nsh
Pinephone Pro port just nsh

Status:
booting till GICD / IRQ issue

style cleanups

start to fix style checks

revert offset

whitespaces

revert a64 bringup file

prob last cleanup

more cleanups

remove dts

move changes from a64 hardware specific folders to rk3399

undo common changes (except head.s)

revert gitignore

missing irq.h and rk3399_serial.c need to finish cleaning them up

WIP

add source for load address

make debug print hex again add board include

Pinephone Pro port just nsh

Status:
booting till GICD / IRQ issue

style cleanups

start to fix style checks

revert offset

whitespaces

revert a64 bringup file

prob last cleanup

more cleanups

remove dts

move changes from a64 hardware specific folders to rk3399

undo common changes (except head.s)

revert gitignore

missing irq.h and rk3399_serial.c need to finish cleaning them up

WIP

add source for load address

remove ccache, add board memory map

remove board reset
2023-08-24 11:16:31 +08:00
chao an
ba2601deb6 Toolchain: strict GCC version check from GCC-12.2 to GCC-12
Toolchain related detection errors are still not resolved on GCC-12.3

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-23 23:52:17 +08:00
Tia
fc8848ec18 Fix bugs related to software flow control in file stm32_hciuart.c. 2023-08-23 23:23:42 +08:00
raiden00pl
7b82a1ac9c armv7-m/mpu.h: add macro to configure shared memory region 2023-08-22 23:34:57 +08:00
raiden00pl
3da199c71d armv8-m/mpu.h: add macro to configure shared memory region 2023-08-22 23:34:57 +08:00
Ville Juven
8071a55198 riscv/riscv_addrenv.c: Allocate heap for default task stacksize
1 page might not be enough, if the task has a bigger stack. Best effort
is to allocate the default amount, however this won't work will all
tasks either.
2023-08-22 23:21:09 +08:00
Eero Nurkkala
5bd0140d9f risc-v/mpfs: mpfs_usb: fix tx fifo size setup
Currently TX_FIFO_SIZE is not altered in mpfs_ep_set_fifo_size(),
but all paths (RX and TX) change MPFS_USB_RX_FIFO_SIZE only.
Fix the TX_FIFO_SIZE setup.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-08-22 20:26:45 +08:00
cuiziwei
1a8027d625 nuttx/arch:add -Wno-psabi to Toolchain.defs
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-22 01:33:30 +08:00
raiden00pl
d31402bf3c arch/{stm32|stm32f7}/stm32_mpuinit.h: cosmetics 2023-08-21 19:22:52 +08:00
liqinhui
0d39246b4e sim/posix: Add the host_system interface used to execute the host command
Encapsulate the host system/popen interface to host_system.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-08-21 17:40:40 +08:00
raiden00pl
78c88b5e78 arch/nrf53: FLASH cache only for netcore, disable by default as it breaks rptun
After sevaral resets of the chip after programming, rptun stops working correctly.
Simple test with RPMSG UART causes a lock:

  on the netcore:
    nsh>cat /dev/ttyproxy

  on the appcore:
    nsh>echo xxx > /dev/ttyproxy

The problem doesn't occur with NRF53_FLASH_PREFETCH=n
2023-08-21 17:34:36 +08:00
raiden00pl
187a067866 arch/nrf53/rptun: remove dependency on DEV_SIMPLE_ADDRENV 2023-08-21 17:34:36 +08:00
raiden00pl
45a542cb14 arch/nrf53: move SPU configuration to a separate file 2023-08-21 17:34:36 +08:00
raiden00pl
8ebc0dc9e8 cmake: port 99b0bad94e arch/armv8-m: DSP extension is optional 2023-08-21 17:34:36 +08:00
liaoao
9231dbe716 cpuinfo:armv6: select ARCH_HAVE_CPUINFO by default
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-21 17:33:50 +08:00
qinwei1
630b5f32a2 arm64: IMX8 MEK board support
Summary

   Support for imx8qm MEK evaluate board

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-08-21 14:23:05 +08:00
qinwei1
30354e5767 arm64: IMX8 platform (Cortex-A53) support
Summary

   Support for imx8 platform, this is a very initialize version

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-08-21 14:23:05 +08:00
yintao
4b5910efc1 nuttx/sim: simlulator rptun powerdown
Signed-off-by: yintao <yintao@xiaomi.com>
2023-08-21 13:21:50 +08:00
qinwei1
5b7267bf66 arm64: remove unnecessary trace interface
Summary
    this is a old implement for Arm64 trace but will failed
compile when enable CONFIG_SCHED_INSTRUMENTATION_SWITCH
    remove it since it will never use for trace framework

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-08-21 09:49:02 +08:00
hanqiyuan
1a832eb554 xtensa: enable -Oz for xtensa to reduce codesize 2023-08-21 02:58:25 +08:00
hujun5
f1b6cf78da arch/arm: add CONFIG_ARCH_TRUSTZONE_SECURE to some code
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-21 00:06:25 +08:00
hujun5
a96c6f1abf arch/arm: Add the secure handling to gic
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-21 00:06:25 +08:00
Xiang Xiao
7bb563dfe9 arch/arm: Remove CONFIG_ARCH_TRUSTZONE_BOTH related stuff
represent tee by CONFIG_ARCH_TRUSTZONE_SECURE instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-21 00:06:25 +08:00
raiden00pl
e8be4d0000 arch/nrf91: remove empty nrf91_modem_sock.h 2023-08-20 22:53:38 +08:00
raiden00pl
b927cf68c6 arch/nrf91: add missing include guards 2023-08-20 22:53:38 +08:00
huangkai8
8f297f79d8 Avoid hard fault when reading vectors in text section. 2023-08-20 14:35:05 +03:00
Xiang Xiao
7f32eaa13e arm/qemu: Remove qemu_net.c which isn't needed anymore
after the follow patch:
commit 9aa57b6c53
Author: wangbowen6 <wangbowen6@xiaomi.com>
Date:   Wed Mar 22 11:49:43 2023 +0800

    virtio: add virtio framework in NuttX

    1. virtio devics/drivers match and probe/remote mechanism;
    2. virtio mmio transport layer based on OpenAmp (Compatible with both
       virtio mmio version 1 and 2);
    3. virtio-serial driver based on new virtio framework;
    4. virtio-rng driver based on new virtio framework;
    5. virtio-net driver based on new virtio framework
       (IOB Offload implementation);
    6. virtio-blk driver based on new virtio framework;
    7. Remove the old virtio mmio framework, the old framework only
       support mmio transport layer, and the new framwork support
       more transport layer and this commit has implemented all the
       old virtio drivers;
    8. Refresh the the qemu-arm64 and qemu-riscv virtio related
       configs, and update its README.txt;

    New virtio-net driver has better performance
    Compared with previous virtio-mmio-net:
    |                        | master/-c | master/-s | this/-c | this/-s |
    | :--------------------: | :-------: | :-------: | :-----: | :-----: |
    | qemu-armv8a:netnsh     |  539Mbps  |  524Mbps  | 906Mbps | 715Mbps |
    | qemu-armv8a:netnsh_smp |  401Mbps  |  437Mbps  | 583Mbps | 505Mbps |
    | rv-virt:netnsh         |  487Mbps  |  512Mbps  | 760Mbps | 634Mbps |
    | rv-virt:netnsh_smp     |  387Mbps  |  455Mbps  | 447Mbps | 502Mbps |
    | rv-virt:netnsh64       |  602Mbps  |  595Mbps  | 881Mbps | 769Mbps |
    | rv-virt:netnsh64_smp   |  414Mbps  |  515Mbps  | 491Mbps | 525Mbps |
    | rv-virt:knetnsh64      |  515Mbps  |  457Mbps  | 606Mbps | 540Mbps |
    | rv-virt:knetnsh64_smp  |  308Mbps  |  389Mbps  | 415Mbps | 474Mbps |
    Note: Both CONFIG_IOB_NBUFFERS=64, using iperf command, all in Mbits/sec
          Tested in QEMU 7.2.2

    Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
    Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-20 14:33:17 +03:00
Petro Karashchenko
075738cf14 net/ip: print ip addresses using ip4_addrN macro
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-19 13:28:21 -03:00
Tiago Medicci Serrano
382debc996 esp32_c3_s3/wifi_ble: Use nxsem_trywait to take semphr from ISR
Use the non-blocking `nxsem_trywait` to try to take the semaphore
during the interrupt handler.
2023-08-19 18:40:31 +08:00
chenrun1
709301cbfd hostfs:support SEEK_CUR
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-08-19 01:48:48 +08:00
liaoao
c31e869fac cpuinfo: show cpufreq when hardware perfermance counting enabled
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-19 01:40:10 +08:00
Jukka Laitinen
f5575479f3 arch/risc-v/src/mpfs: Clean up BCLKSCLK training
This adds a config flag to remove manual bclksclk training if one wants
to just use the controller's own training.

Manual addcmd training depends on the manual bclksclk training, so this
also adds this dependency in Kconfig.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-19 01:27:56 +08:00
Jukka Laitinen
bcfa6a8c5d arch/risc-v/src/mpfs/mpfs_ddr.c: Remove unused fields in mpfs_ddr_priv_s
There are leftover unused parameters in mpfs_ddr_priv_s. Just remove them.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-19 01:27:56 +08:00
Jukka Laitinen
340ae8c753 arch/risc-v/src/mpfs/mpfs_ddr.c: Simplify code performing write calibration
This keeps the same functionality, the original code is just overly complicated

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-19 01:27:56 +08:00
simbit18
70ab01a20b Fix Kconfig style
Replace help => ---help---
Remove spaces from Kconfig
Add comments
2023-08-18 16:36:04 +03:00
Lucas Saavedra Vaz
e02b203311 arch/xtensa/esp32s3: Update MCUboot build process
Change the MCUboot build process to, in the future, deprecate the esp-nuttx-bootloaders repository.
2023-08-18 14:44:11 +08:00
Lucas Saavedra Vaz
4bcc930535 arch/xtensa/esp32s2: Update MCUboot build process
Change the MCUboot build process to, in the future, deprecate the esp-nuttx-bootloaders repository.
2023-08-18 14:44:11 +08:00
Lucas Saavedra Vaz
60fdc9cb72 arch/xtensa/esp32: Update MCUboot build process
Change the MCUboot build process to, in the future, deprecate the esp-nuttx-bootloaders repository.
2023-08-18 14:44:11 +08:00
yanghuatao
aa34885c8b arch/arm: Fix arm_backtrace_unwind.c -Wmaybe-uninitialized and -Wint-conversion warning on n606
(1)common/arm_backtrace_unwind.c:528:18: warning: 'ctrl.lr_addr' may be used uninitialized in this function [-Wmaybe-uninitialized]
(2)common/arm_backtrace_unwind.c:626:27: warning: assignment to 'long unsigned int' from 'uint8_t (*)[]' {aka 'unsigned char (*)[]'} makes integer from pointer without a cast [-Wint-conversion]

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-08-18 12:20:21 +08:00
Jukka Laitinen
6a5d00f68c arch/risc-v/src/mpfs: Add CFG_DDR_SGMII_PHY_RPC156 register setting for DDR training
Decreasing the value may increase DQ/DQS window size. Keep the default value
(1) for the existing board configurations.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-17 17:50:37 +08:00
Jukka Laitinen
cd9ac3cf70 arch/risc-v/src/mpfs/mpfs_ddr.c: Don't continue training process if "verify" step fails
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-08-17 17:50:37 +08:00
Stuart Ianna
34bfa2f7ba arch/risc-v/litex: Add platform specific tickless implementation.
Adds a platform specific implementation for tickless schedular operation. This includes:
 - Tickless operation for vexriscv cores.
 - Tickless operation for vexriscv-smp cores.
 - Ticked operation for vexriscv-smp cores.

Ticked operation for vexriscv core has been refactored.

Additional default configuration added to demonstrate operation.

Both tickless and ticked options use Litex timer0 for scheduling intervals. This is significantly faster than interfaceing with the risc-v mtimer through opensbi.
2023-08-16 16:59:27 +08:00
Ryan MacDonald
074cf51268 Fix: s32k1 s32k3 kinetis: add propseg to ctrl1 timing mask 2023-08-16 10:09:40 +03:00
Tiago Medicci Serrano
5adb9de00b espressif: Update esp-hal-3rdparty version
The newest version of the esp-hal-3rdparty includes general
bugfixes and includes components necessary to build the IDFboot.
2023-08-15 13:39:22 -03:00
wangming9
e953715e6d arch/arm: add qemu support for ARM32
Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-15 23:56:41 +08:00
yinshengkai
88f3bc77f1 toolchain: detect use of large stack variables
partition/fs_gpt.c:384:5: warning: stack usage might be 288 bytes [-Wstack-usage=]
  384 | int parse_gpt_partition(FAR struct partition_state_s *state,

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-15 14:50:27 +03:00
Tiago Medicci Serrano
281ab83309 esp32s3: Use PANIC() instead of assert(0)
Considering kernel code, it's reasonable to use `PANIC()` instead
of `assert(0)` to handle with situations that require abort. Unlike
`assert`, `PANIC()` doesn't dependent on `NDEBUG`.
2023-08-14 16:29:21 -03:00
Tiago Medicci Serrano
01b6c87b15 esp32s3: Implement the Wi-Fi/BLE coexistence
ESP32-S3 has only one 2.4 GHz ISM band RF module, which is shared
by Bluetooth and Wi-Fi, so Bluetooth can’t receive or transmit data
while Wi-Fi is receiving or transmitting data and vice versa.
Under such circumstances, ESP32-S3 uses the time-division
multiplexing method to receive and transmit packets.
2023-08-14 16:29:21 -03:00
Tiago Medicci Serrano
7d605551cd esp32s3/wifi: Enable peripheral interrupt to the same CPU interrupt
The low-level Wi-Fi driver registers two peripheral interrupts to
the same CPU interrupt. Although the registered ISR is the same for
both peripherals interrupt, it's needed to call `up_enable_irq` to
ensure that the interrupt matrix is being set accordingly.

Please note that the current implementation of the  ESP32-S3's IRQ
driver - although allow us to set a callback for each IRQ, which
represents the peripherals interrupt - doesn't allow us to call
both callbacks when these IRQs refers to a same CPU interrupt.
`g_cpu0_intmap` (or `g_cpu1_intmap`) associates each CPU interrupt
to a single IRQ/peripheral and, then, when a CPU interrupt is
triggered, only the last registered IRQ's callback will be called.
This isn't a problem here because 1) the registered callback is the
same for both IRQ's (in fact, it considers the CPU interrupt) and
2) we know in advance which peripheral interrupts will be attached
to which CPU interrupt and, then, we can set them directly.
2023-08-14 16:29:21 -03:00
Petro Karashchenko
655d00b1e7 arch/xtensa/esp32s3: initial effort to get BLE running on ESP32-S3
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-14 16:29:21 -03:00
Tiago Medicci Serrano
33f03fc98c esp32s3/wlan: Always run wlan_rxpoll work queue
Even if we were unable to get a free IOB, trigger the work queue
to make sure that no old packet is waiting to be handled by the
network upper layers.
2023-08-14 16:29:21 -03:00
Tiago Medicci Serrano
012dddf7c9 esp32s3/wlan: check for all connections on wlan_txpoll
This prevents us from getting stuck while polling the different
network structures in `devif_poll_connections`. This is useful for
Wi-Fi/Bluetooth coexistence, specifically.
2023-08-14 16:29:21 -03:00
Tiago Medicci Serrano
6589887284 esp32s3/wlan: check if the network device's IOB isn't null
Before adding the upper layer network device's IOB to the TX queue
of the wireless driver, check if it isn't null.
2023-08-14 16:29:21 -03:00
Tiago Medicci Serrano
ec4149c61d esp32s3/hardware: Update regi2c_ctrl.h functions name 2023-08-14 16:29:21 -03:00
Tiago Medicci Serrano
6089f58f00 esp32s3/irq: Enhance IRQ subsystem
- Fix macro values from `arch/xtensa/include/esp32s3/irq.h`
- Remove references to unexisting edge-triggered CPU interrupts
- Add `esp32s3_getirq` to get IRQ based on core and the `cpuint`
2023-08-14 16:29:21 -03:00
Tiago Medicci Serrano
31476bcb34 esp32s3/rtc: Initialize RTC subsystem
RTC subsystem controls not only the RTC itself but functions that
use RTC-enabled features like Bluetooth and Wi-Fi. Initialization
must be performed during the system start-up.
2023-08-14 16:29:21 -03:00
Tiago Medicci Serrano
7dafbb05a1 esp32s3/peripherals: Add initialization routine for the peripherals
It provides an initialization function that performs the
peripherals' initialization routine during the chip startup.
2023-08-14 16:29:21 -03:00
Xiang Xiao
14563aa48c arch/armv7r: Sync gic/timer with armv7-a and armv8-a
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-14 14:51:01 -03:00
Xiang Xiao
e4dea90725 arch/armv7-a: Update the macro definition in gic.h
https://developer.arm.com/documentation/ihi0048/b

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-14 14:51:01 -03:00
raiden00pl
89174e6a1a arch/stm32h7: use correct name for bit 2 in STM32_PWR_CR3 register 2023-08-14 23:42:37 +08:00
David Sidrane
60840f1ed2 imxrt:Serial Preserve all but W1C bit in SR
SR contains configuration bits that need to be preserved.
2023-08-14 18:23:59 +03:00
raiden00pl
b73e1b9591 arch/{nrf52|nrf53|nrf91}: handle I2C errors in interrupt mode 2023-08-14 17:51:48 +08:00
raiden00pl
5572552024 arch/nrf53: port 6e8f25ba3b change from nrf52
Added config setting for NRF53 I2C timing bug workaround
2023-08-13 11:45:06 -03:00
raiden00pl
eec59015f0 arch/{nrf53|nrf91}: port cc99d94cfd change from nrf52
Fixed NRF52 I2C register naming
2023-08-13 11:45:06 -03:00
raiden00pl
3a61db4c7b arch/nrf53: port d7aea88727 change from nrf52
Changed NRF53 USB initialization to check for power via USBREGSTATUS instead of waiting for interrupt
2023-08-13 11:45:06 -03:00
raiden00pl
fc4ddfb1f4 arch/nrf52/nrf52_twi.h: fix condition
missing prefix CONFIG_* in commit 6e8f25ba3b
2023-08-13 11:45:06 -03:00
raiden00pl
bcef7d32f5 arch/nrf52/nrf52_i2c.c: remove unnecessary include introduced in cc99d94cfd 2023-08-13 11:45:06 -03:00
simbit18
693b034827 arch/arm/src/nrf91/Kconfig: Fix Kconfig style
Add TABs
Add comments
Remove spaces from Kconfig file
2023-08-13 11:44:19 -03:00
Xiang Xiao
bd30d1a4d5 arch: Move trustzone related setting to common place
to share the security setting between arm32 and arm64

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-13 08:43:01 +02:00
Xiang Xiao
b183114d43 arch/arm: Change the default value to ARCH_TRUSTZONE_NONSECURE
since nuttx normally run inside the non secure execution environment

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-13 08:43:01 +02:00
Brian Doherty
d7aea88727 Changed NRF52 USB initialization to check for power via USBREGSTATUS instead of waiting for interrupt, in case we've been launched from a bootloader. 2023-08-13 06:47:14 +08:00
Brian Doherty
cc99d94cfd Fixed NRF52 I2C register naming. 2023-08-13 06:46:57 +08:00
Brian Doherty
6e8f25ba3b Added config setting for NRF52 I2C timing bug workaround. 2023-08-13 06:46:31 +08:00
wangming9
c928acc9ff perf: The new configuration supports hardware performance counting
Adding the CONFIG_ARCH_PERF_EVENTS configuration to enable
hardware performance counting,solve the problem that some platform
hardware counting support is not perfect, you can choose to use
software interface.

This is configured using CONFIG_ARCH_PERF_EVENTS, so weak_functions
are removed to prevent confusion

To use hardware performance counting, must:
1. Configure CONFIG_ARCH_PERF_EVENTS, default selection
2. Call up_perf_init for initialization

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-12 02:20:44 +08:00
TimJTi
d0613fa165 SAMA5D2 MCAN Error corrections plus changes to improve clarity
Kconfig typo
2023-08-12 02:20:09 +08:00
David Sidrane
2dc6365e24 s32k3xx:lpi2c fix status handeling & race
s32k3:lpi2c:Simplify DMA and Non DMA usage

s32k3xx: lpi2c dma invalidate cache after exchange

s32k3xx:lpi2c fix timeout not stopping dma
2023-08-11 13:41:49 -03:00
David Sidrane
afdce6e8c2 imxrt:lpi2c fix status handeling & race
imxrt:lpi2c:Simplify DMA and Non DMA usage

imxrt: lpi2c dma invalidate cache after exchange

imxrt:lpi2c fix timeout not stopping dma
2023-08-11 13:41:49 -03:00
David Sidrane
eb06843178 s32k1xx:lpi2c fix status handeling & race
s32k1:lpi2c:Simplify DMA and Non DMA usage

s32k1xx: lpi2c dma invalidate cache after exchange

s32k1xx:lpi2c fix timeout not stopping dma
2023-08-11 13:41:49 -03:00
Peter van der Perk
755e3beba9 s32k3xx: lpspi dma invalidate cache after exchange 2023-08-11 13:41:49 -03:00
Peter van der Perk
87a51f4faa imxrt: lpspi dma invalidate cache after exchange 2023-08-11 13:41:49 -03:00
Alexander Lunev
cfbee60932 arm/stm32h7: stm32h7x5: fixed typo on SPI header inclusion 2023-08-11 22:39:38 +08:00
chao an
fc354a1446 arm/clang: enhance compatibility of clang compiler
The naming of the clang configuration file has changed after version 14
This commit will enable the compatibility with clang-14/15/16/17

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-11 20:17:36 +08:00
chenxiaoyi
fd34be15eb sim: use correct size to avoid buffer overflow
Fix buffer overflow issue from PR #10128, since the sizeof
xcpt_reg_t is different on 32/64 bit platform.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2023-08-11 20:13:28 +08:00
liaoao
dffab1e0c6 qemu: add devicetree support for arm64
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-11 00:46:50 +08:00
chenxiaoyi
6d6e1aea3b sim: Fix sim stack smashing problem
The reason is that the new created task receives signal while
it has not entered its stack frame.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2023-08-10 23:30:22 +08:00
ligd
324aa7d17f sim: rptun support panic & reset
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-10 23:13:40 +08:00
qinwei1
37e69cdeb0 arch/arm64: enable for arm64 virt to choice CPU core
Summary
    Qemu virt board can choice CPU core with boot parameter
and we need to add Konfig option for choice
    the change do this

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-08-10 20:48:19 +08:00
hujun5
b82ccd6621 arch/timer: frequency 0 should not be set
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-10 17:59:21 +08:00
qinwei1
d8e1022b6f arm64: add hostfs support
Sumary
   add hostfs support for arm64, it's a copy
from arm32.

Note:
   it's not support for opendir and readdir, command
like ls will not work.

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2023-08-10 17:58:34 +08:00
wangbowen6
cbb594dcbc sim: add set/get_power for sim_framebuffer.c
add set/get_power operation for sim_framebuffer to avoid assert
in fb_ioctl(cmd= FBIOSET_POWER/FBIOGET_POWER)

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-08-10 15:57:57 +08:00
wangbowen6
8db4abd5dd arm_backtrace_sp: check the addr after every operation to addr
Should check the addr every time it changed to avoid crash in
backtrace.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-08-10 15:52:23 +08:00
liaoao
c1eecd7c4f procfs:add armv6-m cpuinfo
signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-10 14:13:35 +08:00
wangming9
f4e33e488d arch/arm64: Fixed arm64 backtrace support for other processes
Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-10 13:35:59 +08:00
zhangyuan21
b5f266d5af armv8-m: the FPSCR[18:16] LTPSIZE field in exception_common
In armv8m the FPSCR[18:16] LTPSIZE field must be set to 0b100 for
"Tail predication not applied" as it's reset value.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-10 13:11:45 +08:00
wangbowen6
9aa57b6c53 virtio: add virtio framework in NuttX
1. virtio devics/drivers match and probe/remote mechanism;
2. virtio mmio transport layer based on OpenAmp (Compatible with both
   virtio mmio version 1 and 2);
3. virtio-serial driver based on new virtio framework;
4. virtio-rng driver based on new virtio framework;
5. virtio-net driver based on new virtio framework
   (IOB Offload implementation);
6. virtio-blk driver based on new virtio framework;
7. Remove the old virtio mmio framework, the old framework only
   support mmio transport layer, and the new framwork support
   more transport layer and this commit has implemented all the
   old virtio drivers;
8. Refresh the the qemu-arm64 and qemu-riscv virtio related
   configs, and update its README.txt;

New virtio-net driver has better performance
Compared with previous virtio-mmio-net:
|                        | master/-c | master/-s | this/-c | this/-s |
| :--------------------: | :-------: | :-------: | :-----: | :-----: |
| qemu-armv8a:netnsh     |  539Mbps  |  524Mbps  | 906Mbps | 715Mbps |
| qemu-armv8a:netnsh_smp |  401Mbps  |  437Mbps  | 583Mbps | 505Mbps |
| rv-virt:netnsh         |  487Mbps  |  512Mbps  | 760Mbps | 634Mbps |
| rv-virt:netnsh_smp     |  387Mbps  |  455Mbps  | 447Mbps | 502Mbps |
| rv-virt:netnsh64       |  602Mbps  |  595Mbps  | 881Mbps | 769Mbps |
| rv-virt:netnsh64_smp   |  414Mbps  |  515Mbps  | 491Mbps | 525Mbps |
| rv-virt:knetnsh64      |  515Mbps  |  457Mbps  | 606Mbps | 540Mbps |
| rv-virt:knetnsh64_smp  |  308Mbps  |  389Mbps  | 415Mbps | 474Mbps |
Note: Both CONFIG_IOB_NBUFFERS=64, using iperf command, all in Mbits/sec
      Tested in QEMU 7.2.2

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-10 03:39:39 +08:00
Alan Carvalho de Assis
9914999715 stm32_qspi: Fix printf() format warnings 2023-08-09 11:06:23 +08:00
Petro Karashchenko
d113722eb2 style: fix indentation issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-08 11:58:29 -03:00
Petro Karashchenko
2c346c4c89 arch/esp32: use kernel internal API for libc stubs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-08 11:58:29 -03:00
xuxin19
4cd916d16b cmake:support armv7-r and tms570 chip
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-07 10:06:05 -07:00
wangming9
8d21bbf3be arch/armv8-m: Supports interrupt nesting between TEE and REE
The first time interrupt nesting occurs between REE and TEE,
CURRENT_REGS needs to be set.

If TEE nesting REE breaks, then EXC_RETURN.S=0,EXC_RETURN.ES=1;
Conversely, EXC_RETURN.S=1,EXC_RETURN.ES=0;
Interrupt nesting between TEE and REE can be determined based
on the S and ES bits of EXC_RETURN.
Only once nesting between TEE and REE is supported, and cyclic
nesting between TEE and REE is not supported.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-07 05:43:13 -07:00
wangming9
5cdfa6fec4 arch/armv8-m: Supports interrupt nesting
1、The process stack supports interrupt nesting, Execute in MSP;
2、The interrupt stack supports interrupt nesting;
   The thread mode use PSP, and the handle mode use MSP;
3、Adjust arm_doirq、exception_common implementation to meet interrupt nesting
4、Adjust the conditions for returning MSP and PSP;
5、remove setintstack;

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-07 05:43:13 -07:00
wangming9
f8aaed780a arch/armv8-m: Add CONTROL register to xcptcontext.
To simplify the interrupt handling in protected mode.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-07 05:43:13 -07:00
wangming9
2684642a7a arch/armv6-m: Supports interrupt nesting
1、The process stack supports interrupt nesting, Execute in MSP;
2、The interrupt stack supports interrupt nesting;
   The thread mode use PSP, and the handle mode use MSP;
3、Adjust arm_doirq、exception_common implementation to meet interrupt nesting
4、Adjust the conditions for returning MSP and PSP;
5、remove setintstack;

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-07 05:43:13 -07:00
wangming9
cedc034d9e arch/tlsr82: Port arm_doirq to tc32_doirq.c
Solve the dependency on ARMV6M when compiling tlsr8278adk80d:nsh.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-07 05:43:13 -07:00
wangming9
eba9c61cad arch/armv6-m: Add CONTROL register to xcptcontext.
To simplify the interrupt handling in protected mode.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-07 05:43:13 -07:00
wangming9
a4b6b158ce arch/armv6-m: By default, add REG_EXC_RETURN to xcptcontext.
Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-07 05:43:13 -07:00
wangming9
816b3fb399 arch/armv7-m: Supports interrupt nesting
1、The process stack supports interrupt nesting, Execute in MSP;
2、The interrupt stack supports interrupt nesting;
   The thread mode use PSP, and the handle mode use MSP;
3、Adjust arm_doirq、exception_common implementation to meet interrupt nesting
4、Adjust the conditions for returning MSP and PSP;
5、remove setintstack,add arm_initialize_stack;

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-07 05:43:13 -07:00
wangming9
4370487fd6 arch/armv7-m: Add CONTROL register to xcptcontext.
To simplify the interrupt handling in protected mode.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-07 05:43:13 -07:00
cuiziwei
c1ddfcfa83 nuttx/arch:support to obtain host cpuinfo in NSH. 2023-08-05 14:57:15 -07:00
Brennan Ashton
46b0f6d6ee fdt: Add initial FDT support and procfs for userspace export
VELAPLATFO-12536

This provides the initial hooks for Flattened Device Tree support
with QEMU RV. It also provides a new procfs file that exposes the
fdt to userspace much like the /sys/firmware/fdt endpoint in Linux.
See https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-firmware-ofw

Nodes in the fdt are not yet usable by the OS.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-05 12:41:06 -07:00
ligd
dfdb3aa2f4 armv8m: support busfault forward to TEE
For TEE & REE, securefault & busfault are not banked, so the faults can
only forword to TEE/REE.
But how to crash dump the other core which not handled faults ?

Here we provide a way to resolve this problem:
1. Set the securefault & busfault to TEE
2. busfault happend from TEE, then directly dump TEE
3. busfault happend from REE, then generate nonsecurefault
4. Back to REE, and dump

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-05 12:40:34 -07:00
ligd
b445029cf2 armv8m: fix up_secure_irq failed for NVIC_IRQ_BUSFAULT
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-05 12:40:34 -07:00
ligd
452211586e xtensa: fix compile miss file
comiple xtensa_mpu.c

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-05 12:40:16 -07:00
anjiahao
3a808bab19 support stm32f429i-disco run open flash loader
We can use the driver in nuttx to download
files with debugger

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-05 12:40:02 -07:00
Lucas Saavedra Vaz
d1b5558c8b arch/espressif: Add MCUboot support for ESP32-C3
Add MCUboot support for ESP32-C3 when using the Espressif HAL
2023-08-04 10:30:57 -07:00
Peter van der Perk
0b721ac21c imxrt: flexcan use hpwork for receiving frames
FlexCAN before used interrupts to process incoming frames.
This patch adds a HPWORK workqueue to process incoming frames in the workqueue
context instead. Also renamed mbi to txmb for better readability.
2023-08-04 19:28:52 +02:00
Lee Lup Yuen
856526adee arch/risc-v: Add support for StarFive JH7110 SoC
This PR adds support for the StarFive JH7110 RISC-V SoC. This will be used by the upcoming port of NuttX for PINE64 Star64 SBC. [The source files are explained in the articles here](https://github.com/lupyuen/nuttx-star64)

Modified Files in arch/risc-v:

Kconfig: Added ARCH_CHIP_JH7110 for JH7110 SoC

New Files in arch/risc-v:

include/jh7110/chip.h: JH7110 Definitions

include/jh7110/irq.h: Support 127 External Interrupts

src/jh7110/chip.h: Interrupt Stack Macro

src/jh7110/jh7110_allocateheap.c: Kernel Heap

src/jh7110/jh7110_head.S: Linux Header and Boot Code

src/jh7110/jh7110_irq.c: Configure Interrupts

src/jh7110/jh7110_irq_dispatch.c: Dispatch Interrupts

src/jh7110/jh7110_memorymap.h: Memory Map

src/jh7110/jh7110_mm_init.c, jh7110_mm_init.h: Memory Mgmt

src/jh7110/jh7110_pgalloc.c: Page Allocator

src/jh7110/jh7110_start.c: Startup Code

src/jh7110/jh7110_timerisr.c: Timer Interrupt

src/jh7110/hardware/jh7110_memorymap.h: PLIC Base Address

src/jh7110/hardware/jh7110_plic.h: PLIC Register Addresses

src/jh7110/Kconfig: JH7110 Config

src/jh7110/Make.defs: Makefile
2023-08-03 22:55:55 -07:00
yangsen5
d8ca744052 drivers/video: video driver supports NV12
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-08-03 22:37:53 -07:00
yintao
5d1536c5e3 nuttx/sim: use workquene instead of sim_bthcisock_loop
Signed-off-by: yintao <yintao@xiaomi.com>
2023-08-03 21:15:36 -07:00
Fotis Panagiotopoulos
f3945560c0 stm32f4/f7/h7_eth: Improvements in Ethernet DMA error handling.
* Error handling for abnormal interrupts and DMA errors is now
enabled for all builds, regardless of any DEBUG configuration.

* Error handling resets the MAC for the specific errors that
may halt the Ethernet operation, instead of everything as it
was before.
2023-08-03 18:11:23 -03:00
ligd
af3600436e perf: avoid div zero if up_perf_init() hasn't init
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:42:00 -07:00
ligd
2cfea55f95 armv7-r: idle stack should align with 8
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:42:00 -07:00
ligd
f3063ce12b armv7-a: align stack_top code with armv7-r
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:42:00 -07:00
jianglianfang
d5a8746be8 sim framebuffer: Optimize the timing of window to open and to close
The window opens when the fb opens and closes when the fb closes.
test step: run fb demo, 1. ./nuttx 2. fb

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-08-03 10:36:17 -07:00
ligd
ebaea6bd9f sim: set loop thread priority to configurable
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:15:43 -07:00
simbit18
580d09b5a1 Fix Kconfig style
Remove spaces from Kconfig
2023-08-03 15:40:24 +02:00
zhangyuan21
79242cc1e7 arm64: set cpuid according to mpidr
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-03 03:19:19 -07:00
zhangyuan21
dc55205ee5 arch/arm64: get_cpu_id according to the correct affinity level
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-03 03:19:19 -07:00
yanghuatao
51240c658f fix warning: [-Wunknown-pragmas]
/mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/hidl/HidlSupport.h:33: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   33 | #pragma clang diagnostic push
      |
/mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/hidl/HidlSupport.h:34: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   34 | #pragma clang diagnostic ignored "-Wpadded"
      |
In file included from /mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/android/hidl/base/1.0/types.h:4,
                 from /mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/android/hidl/base/1.0/IBase.h:4,
                 from android/hidl/base/1.0/BaseAll.cpp:1:
/mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/hidl/HidlSupport.h:40: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   40 | #pragma clang diagnostic pop
      |
In file included from /mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/android/hidl/base/1.0/IBase.h:4,
                 from android/hidl/base/1.0/BaseAll.cpp:1:
/mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/android/hidl/base/1.0/types.h:188: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
  188 | #pragma clang diagnostic push
      |
/mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/android/hidl/base/1.0/types.h:189: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
  189 | #pragma clang diagnostic ignored "-Wc++17-extensions"
      |
/mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/android/hidl/base/1.0/types.h:195: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
  195 | #pragma clang diagnostic pop
      |
CXX:  LightRefBase.cpp In file included from base/HidlSupport.cpp:18:
/mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/hidl/HidlSupport.h:33: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   33 | #pragma clang diagnostic push
      |
/mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/hidl/HidlSupport.h:34: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   34 | #pragma clang diagnostic ignored "-Wpadded"
      |
In file included from base/HidlSupport.cpp:18:
/mnt/yang/vela_keystore_waring/apps/external/android/system/libhidl/base/include/hidl/HidlSupport.h:40: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
   40 | #pragma clang diagnostic pop

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-08-03 00:52:53 -07:00
yuexinyi
4f0a8dc391 drivers/video: fix if video node do not exist on host of sim env, video driver init fail
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-08-02 22:50:03 -07:00
Tiago Medicci Serrano
17447622bf esp32s3/wifi: support the Wi-Fi to work with protected build
- Added Wi-Fi related symbols to the kernel-space linker;
- Allocate more RAM to the kernel (to be useb by the Wi-Fi driver).
- Create a specific defconfig.
2023-08-02 21:38:44 +02:00
Tiago Medicci Serrano
1197a80741 esp32s3: Enhance protected build linker scripts and memory layout
Instead of setting kernel/user space instruction and data ROM as
hard-coded values on linker, set them according to the max size
of the kernel image set by CONFIG_ESP32S3_KERNEL_IMAGE_SIZE. This
is done by making KIROM, UIROM, KDROM and UDROM dependent on the
kernel size value. Also, override CONFIG_NUTTX_USERSPACE config
according to CONFIG_ESP32S3_KERNEL_IMAGE_SIZE by using a custom
PREBUILD definition.
2023-08-02 21:38:44 +02:00
raiden00pl
1d858ec03f stm32: initialize perf counter if sytemview enabled 2023-08-02 08:05:37 -07:00
simbit18
8ce16e9bd9 Fix Kconfig style
Remove spaces from Kconfig
2023-08-02 16:57:09 +02:00
Alan Carvalho de Assis
bace5e9b59 Fix some ESP32 Peripheral help comments 2023-08-02 05:40:42 -07:00
shipei
238eba14ad alsa/sim_alsa.c:fix ioctl AUDIOIOC_GETBUFFERINFO error
when executing ioctl AUDIOIOC_GETBUFFERINFO,the priv->pcm is still NULL,
so it will return -ENXIO,we can remove this check at the start of ioctl
and add in the case where it is used.

Signed-off-by: shipei <shipei@xiaomi.com>
2023-08-02 03:27:12 -07:00
Peter van der Perk
2e3c144f44 imxrt: fix txdeadline add ecc/fd support 2023-08-01 10:10:41 -07:00
zhangyuan21
8f39ba6ae4 arch: update g_running_tasks when context switch occurred
When supporting high-priority interrupts, updating the
g_running_tasks within a high-priority interrupt may be
cause problems. The g_running_tasks should only be updated
when it is determined that a task context switch has occurred.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-01 09:35:18 -07:00
lpxiao
3341a6d2a9 Optimize stm32 RTC accuracy 2023-08-01 18:02:09 +02:00
Petro Karashchenko
f00c6d3047 arch/arm: fix declaration of extern types
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-31 18:56:40 -07:00
yangyalei
fde8affe71 singal: add stack_t define
stack_t used by sigaltstack, make it compile sucess in sim.

Signed-off-by: yangyalei <yangyalei@xiaomi.com>

ltp: fix compile errors

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-07-31 07:50:10 -07:00
Ville Juven
61460efe3c riscv/qemu-rv: Add FPU support back to qemu-rv
The FPU restore issue does not show itself any longer, so FPU support
can be re-enabled.
2023-07-31 07:48:53 -07:00
Ville Juven
d0fbf9883d riscv/lazyfpu: Add option to disable lazy FPU
Adds option to use the old implementation where FPU is stored into
the process stack.
2023-07-31 07:48:53 -07:00
Ville Juven
4a468b8d3b riscv/saveusercontext: Fix FPU state save 2023-07-31 07:48:53 -07:00
Ville Juven
0ea9debfce riscv/riscv_fpu: Clear the full FPU status/control register on boot
Instead of clearing the fields individually, just wipe the whole register.
This can be done because flags and rm are just parts of the fcsr.

31             8        5           0
+--------------+--------+-----------+
|              |        |           |
|   RESERVED   |  FRM   |  FSTATUS  |
|              |        |           |
+--------------+--------+-----------+
                FCSR
2023-07-31 07:48:53 -07:00
Ville Juven
b409d72e9d riscv/fpu: Restore correct lazy-FPU functionality
- Save the FPU registers into the tcb so they don't get lost if the stack
  frame for xcp.regs moves (as it does)
- Handle interger and FPU register save/load separately
- Integer registers are saved/loaded always, like before
- FPU registers are only saved during a context switch:
  - Save ONLY if FPU is dirty
  - Restore always if FPU has been used (not in FSTATE_OFF, FSTATE_INIT)
- Remove all lazy-FPU related logic from the macros, it is not needed
2023-07-31 07:48:53 -07:00
Ville Juven
3b5c0c885f riscv/swint: Give the full tcb to the context switch routine
Why? The tcb can contain info that is needed by the context switch
routine. One example is lazy-FPU handling; the integer registers can
be stored into the stack, because they are always stored & restored.

Lazy-FPU however needs a non-volatile location to store the FPU registers
as the save feature will skip saving a clean FPU, but the restore must
always restore the FPU registers if the thread uses FPU.
2023-07-31 07:48:53 -07:00
Bowen Wang
28cb5e7984 arm64: add kasan support for arm64
Add kasan compiler option in arm64 Toolchain.defs

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-07-31 05:45:46 -07:00
zhangyuan21
f9cab5b9dc arch/arm64: add ARM64_DCACHE_DISABLE and ARM64_ICACHE_DISABLE config
Enable dcache and icache when ARM64_DCACHE_DISABLE and ARM64_ICACHE_DISABLE
disabled at __start.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-07-31 05:33:23 -07:00
Bowen Wang
d24622888f arm64_backtrace: use running_task if arch_get_current_tcb return NULL
In the init phase of the OS, arch_get_current_tcb return NULL. Enable
the memory backatrace default will crash in backtrace function.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-07-31 04:52:49 -07:00
zhangyuan21
c6f32f4363 arm-m: Check the dcache status before enabling dcache
If the cache is already enabled before NuttX starts up,
enabling the cache in NuttX will cause the cache to be
re-invalidated, then resulting in data that is already
in the cache being flushed out.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-07-31 08:49:21 +02:00
Xiang Xiao
fc5e85da1b drivers: Format pointer through "%p" for kthread_create
to remove the unnecessary cast and unify the usage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-30 23:40:59 +03:00
yuexinyi
56be0ab050 drivers/video: add capture arg to support multi instance
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-29 07:42:29 -07:00
hujun5
e3f481d3b1 arm/trustzone: time interrupt setting failed
we should use a secure clock when the CPU is in secure mode

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-07-29 06:58:24 -07:00
dongjiuzhu1
d89e0996f5 sim/usbdev: Add string table as it is needed when USBTRACE is turned on
nuttx/drivers/usbdev/usbdev_trprintf.c:418: undefined reference to `g_usb_trace_strings_intdecode'
/usr/bin/ld: nuttx/drivers/usbdev/usbdev_trprintf.c:496: undefined reference to `g_usb_trace_strings_deverror'

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 20:58:23 -07:00
dongjiuzhu1
ddc2c62aa8 sim/rawgadget: don't push fifo if ioctl failed because it will cause busy read
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 20:58:23 -07:00
dongjiuzhu1
14446677d3 arch/arm64: default select ARCH_HAVE_SETJMP
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 20:57:26 -07:00
dongjiuzhu1
7d281f46de sim/hostfs: fix issue about access file with size more than 2GB
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-28 07:42:12 -07:00
Tiago Medicci Serrano
8673e659b4 espressif: quiet git commands and improve build logging
Add `--quiet` to git commands to avoid unnecessary logging during
the operation and add summarized logs to show progress.
2023-07-27 19:43:48 -07:00
Tiago Medicci Serrano
e38b4b2103 espressif: fix linker to include the reserved area of RTC memory
Basically, it reserves an area of the RTC memory to preserve the
RTC timer.

Please refer to:
fa76c82a5b

This commit also removes the rtc.dummy section because C3, C6 and
H2 don't need to skip it once the region is accessed by the same
address space using the instruction and data bus.
2023-07-27 19:43:48 -07:00
Tiago Medicci Serrano
8e343405a2 espressif: update esp-hal-3rdparty
The esp-hal-3rdparty release include general bugfixes.
2023-07-27 19:43:48 -07:00
hujun5
68187b68af arch: move [enter|leave]_critical_section
move [enter|leave]_critical_section to the same place for easy to understand
and call matching

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-07-27 11:34:09 +02:00
SPRESENSE
b515f9a360 arch: cxd56xx: Fix compile error
Add inttypes.h to fix a compile error in cxd56_emmc.c.
2023-07-26 22:14:31 -07:00
Ville Juven
6bafdd45fd riscv/mpfs: Set hart2 default entrypoint to -1 like the others
No reason to have a different entrypoint
2023-07-26 19:58:05 -03:00
anjiahao
2645e59901 sim/tcbinfo:add ebp to tcbinfo
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-26 06:57:25 -07:00
raiden00pl
ef252fc0fc arch/nrf91/modem: fix returned source address 2023-07-26 04:51:05 -07:00
guoshichao
3524f4b9ce libs/libc/fork: add lib_fork implementation
1. add lib_fork api in libs/libc, we need a fork() api to implement the
fork relative method, such as pthread_atfork
2. rename the assembly fork entry function name to up_fork(), and rename
the up_fork() to arch specific name, such as
sim_fork()/arm_fork()/mips_fork() etc.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-07-26 10:41:52 +02:00
Xiang Xiao
46b25b3849 arch: Compute the array size by nitems
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-26 09:33:38 +02:00
Xiang Xiao
7ca4c916eb arch/sparc: Add g_tcb_info
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-26 09:33:38 +02:00
Xiang Xiao
94f273130e arch/x86_64: Add g_tcb_info
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-26 09:33:38 +02:00
Xiang Xiao
8d46cfd8e5 arch/x86: Add g_tcb_info
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-26 09:33:38 +02:00
Xiang Xiao
f3269a6caa sched: Rename DEBUG_TCBINFO to ARCH_HAVE_TCBINFO
and select if the arch support to define g_tcbinfo variable

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-26 09:33:38 +02:00
anjiahao
d5347d8915 arm64:fix ostest failed to run
The reason for the failure is incorrect sp,
resulting in the failure to restore the register

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-25 16:37:49 -03:00
Tiago Medicci Serrano
dacb4e87b6 espressif: get esp-hal-3rdparty sources based on its version
Clone the esp-hal-3rdparty repository and, then, checkout to a
specific version (usually indicated by the commit SHA) instead of
using a branch as the HEAD.
2023-07-25 09:44:59 -07:00
raiden00pl
60200b6c9b arch/nrf91: make all interrupts non-secure only if CONFIG_NRF91_SPU_NONSECURE=y
this fixes configurations that works only in secure environment (for testing and dev purposes)
2023-07-25 08:49:24 -07:00
raiden00pl
e48d730273 cmake: enable more cmake builds 2023-07-25 06:18:22 -07:00
chao an
49dec5b48c cmake/build: fix build break on cmake
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-25 15:00:10 +02:00
raiden00pl
dffb472ad9 cmake: port stm32f0l0g0 2023-07-24 10:13:26 -07:00
zhangyuan21
9792211b96 sched/tcbinfo: add stack info to tcbinfo
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-07-24 09:47:12 -07:00
anjiahao
8abf803a1d arm64:Need to store native sp pointer to tcb
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-23 21:59:35 -07:00
anjiahao
ceb6bb6650 arm64:support arm64 for tcb info
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-23 21:59:35 -07:00
anjiahao
eadfdab9a7 sim:add sim32 & sim64 tcbinfo
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-23 21:59:35 -07:00
anjiahao
9f644579b3 fix sim register & tcb info typo
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-07-23 21:59:35 -07:00
kcheshmedzhiev
ea87d008a0 Initial support for NUCLEO-U5A5ZJ-Q board
Fix for ci error

Typo changes

Fixed typo in boards/arm/stm32u5/nucleo-u5a5zj-q/src/stm32_bringup.c

Typo changes

Typo fixes

Typo fixes

Typo changes

Typo changes

Typo changes
2023-07-23 18:42:05 -07:00
Victor Benso
0c5145b7d1 New implementation of the ESP32's RMT driver. 2023-07-23 16:17:57 -03:00
raiden00pl
eb965d5fec arch/nrf91: add support for modem sockets 2023-07-23 19:56:38 +08:00
raiden00pl
6bd5452588 arch/nrf91: fixes for modem OS integration 2023-07-23 19:56:38 +08:00
raiden00pl
aa5ac49a21 arch/nrf91: convert modem AT interface to serial device 2023-07-23 19:56:38 +08:00
raiden00pl
b3c5e05add arch/nrf91: fix modem initialization 2023-07-23 19:56:38 +08:00
Lucas Saavedra Vaz
c31681df54 arch/risc-v/espressif: Add PWM (LEDC) support
Add support for the PWM peripheral to ESP32-C3/C6/H2 by using the Espressif HAL
2023-07-23 01:11:38 +08:00
Jukka Laitinen
8766865e09 arch/risc-v/src/mpfs: Add configuration option to enable DDR manual addcmd training
Also switch to automatic one by default, as it saves a lot of flash. The manual training
code is left in for now to be able to use it as an option if there are problems with automatic one

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-07-21 16:36:04 -03:00
yintao
0b01340aec nuttx/sim: use workquene instead rptun_loop
Signed-off-by: yintao <yintao@xiaomi.com>
2023-07-21 20:46:59 +08:00
chao an
ee6e2ce149 arch/perf: add ARCH_HAVE_PERF_EVENTS to support hardware perf events
The implementation of up_perf_*() is in a different static library in nuttx:

Hardware: libarch.a
Software: libdrivers.a (weak function)

Since functions with weak attributes cannot be correctly replaced in multiple static libraries,
this PR will use macros to replace whether the arch supports hardware perf events

Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-21 20:43:30 +08:00
chao an
4b94dc3092 toolchain/gcc: fix linker error if enable STACK_CANARIES/LTO at same time
If -fstack-protector-all is enabled, gcc linker will need GCC
SSP(Stack Smashing Protector) support, Since the implement of SSP
is related to the OS, most of embedded toolchain does not provide
ssp support, so an error will be reported when linking:

enable CONFIG_LTO_FULL && CONFIG_STACK_CANARIES

arm-none-eabi/bin/ld: cannot find -lssp_nonshared: No such file or directory
arm-none-eabi/bin/ld: cannot find -lssp: No such file or directory

https://github.com/gcc-mirror/gcc/blob/master/gcc/gcc.cc#L983-L985

Since nuttx has already implemented SSP related hook functions,
so in this PR, we filter out this option in the link phase to ensure that
the implementation of lssp/lssp_nonshared will not be referenced

Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-21 01:13:34 +08:00
Zhihong Chen
0fab64cd95 hpmicro: hpm6750: keep cpu clock on after "wfi", so that mchtmr can work after "wfi"
- keep cpu clock on after "wfi", so that mchtmr can still work after "wfi"

Signed-off-by: Zhihong Chen <zhihong.chen@hpmicro.com>
2023-07-20 18:15:29 +08:00
Xiang Xiao
a51be33a41 libc/tls: Change the default value of TLS_NELEM to zero
to ensure the default config as small as possible.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-20 08:11:30 +02:00
Jukka Laitinen
c269adbff1 arch/risc-v/src/mpfs/mpfs_ddr.c: Correct erroneous register addresses in DDR training
Writes to MPFS_CFG_DDR_SGMII_PHY_EXPERT_DFI_STATUS_OVERRIDE register were not done properly. Use correct address for writes.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-07-18 10:11:10 -03:00
Eero Nurkkala
b79671a336 risc-v/mpfs: emmcsd: fix csd read
Reading the CSD field misses 3 bytes as the residual bytes
are not carried over properly. Fix this by adding the missing
bytes due to shifting.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-07-17 23:05:37 +08:00
Xiang Xiao
427f8a1624 arch: Fix the mismath in comment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-16 14:39:20 -03:00
Xiang Xiao
abfe082a6f Kconfig: Simplify the conditional default statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-16 14:39:20 -03:00
Xiang Xiao
e031a73aef Kconfig: Change some "default y" to "default !DEFAULT_SMALL"
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-16 14:39:20 -03:00
Xiang Xiao
4d8eedb09a arch/sim: Link to libgcov.a when CONFIG_ARCH_COVERAGE is enabled
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-16 14:39:20 -03:00
chao an
f10b54a081 cmake: fix CMake build break
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-15 23:32:36 +08:00
chenrun1
cafbbb1ded armv7amr/v8m:Modify hardcodes to macro definitions and update commit.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-15 15:11:07 +08:00
chenrun1
9c2bc0edbe armv7m/v8m:Restore the CSSELR state before setting.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-15 15:11:07 +08:00
chenrun1
823c3b32e7 armv8m:fix warning up_get_cache_size defined but not used.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-15 15:11:07 +08:00
chenrun1
665a140b21 armv7/v8:Fix configuration csselr default configuration error.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-15 15:11:07 +08:00
chenrun1
22d1059c97 armv7/8 cache: add up_get_xcache_size() support
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-15 15:11:07 +08:00
chenrun1
09da8fb651 armv7/8 cache:CSSELR should be set before getting cache info
According to the ARMv7a/r/m and ARMv8m architecture manuals
The allowed values are
0 Data or unified cache.
1 Instruction cache.

"One CCSIDR is implemented for each cache that can be accessed by the processor. CSSELR selects which Cache Size ID Register is accessible, see c0, Cache Size Selection Register (CSSELR)."

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-15 15:11:07 +08:00
raiden00pl
97309dd22d cmake: fix nrf91 modem static library build 2023-07-15 00:56:33 +08:00
liaoao
8706d68318 assert: check intstack_sp when print last stack in irq context
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-07-14 21:36:11 +08:00
liaoao
1ed09f804e vfork: modify struct vfork_s
fp is just an alias of r11, it  not really used for
framepointer in t32 mode.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-07-14 20:48:51 +08:00
simbit18
d991ef77e8 Fix nuttx coding style
Remove TABs
Fix indentation
2023-07-14 20:48:24 +08:00
simbit18
a8939f6d4b arch/sparc/src/bm3823/bm3823.h: Fix the name of the constant BM3823_Is_interrupt_pending
Remove TABs and spaces from the name of the constant BM3823_Is_interrupt_pending
2023-07-14 20:48:09 +08:00
raiden00pl
019b7a39d4 cmake: cmse support for armv8-m 2023-07-13 23:49:02 +03:00
zhangyuan21
b7216d54ff arm64: Use the correct cpu id for fpu idle task init
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-07-14 01:17:02 +08:00
simbit18
b0965ab963 Fix nuttx coding style
Remove TABs
Fix indentation
Fix Multi-line comments
Fix Comments to the Right of Statements.
2023-07-14 01:16:06 +08:00
zhangyuan21
d8797bde4e arm_gicv2: accesses the non-secure copy in non-secure state
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-07-14 01:15:13 +08:00
zhangyuan21
601202ee4a arm64: Use the correct aff in up_affinity_irq function
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-07-14 01:13:01 +08:00
simbit18
1b1ac6f3b7 Fix nuttx coding style
Remove TABs
Fix indentation
Fix Multi-line comments
Fix Comments to the Right of Statements.

Fix nuttx coding style

Fix Comments to the Right of Statements.
2023-07-13 19:30:56 +08:00
chenrun1
4d285cb14d xtensa_saveusercontext:Leave the context information empty
In the current implementation of other architectures, it is not really implemented to preserve the context, so it is emulated from other architectures to clear the context.
If this behavior is not implemented, it will cause the xtensa architecture processor to loop assert in the active assert case

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-13 09:48:46 +08:00
raiden00pl
a59f82b8d2 cmake: support pre-processor for linker script 2023-07-13 03:05:39 +08:00
chenrun1
3bdba79851 armv8m/arm_hardfault.c:fix code style.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-13 03:05:28 +08:00
chenrun1
842adf888f armv8m/arm_hardfault:add arm_gen_nonsecurefault information
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-13 03:05:28 +08:00
raiden00pl
f7905512be stm32h7: add LTDC support 2023-07-12 11:30:57 -03:00
raiden00pl
8ceff0dc5a arm/stm32h7: Add STM32H745 family 2023-07-12 11:30:57 -03:00
raiden00pl
ad6361f0cc cmake: fix build after c33d1c9c97 (vfork -> fork) 2023-07-12 09:47:54 -03:00
raiden00pl
6dcfe61b0e cmake: add support for stm32h7 2023-07-11 15:52:56 -03:00
raiden00pl
ab6fd2e6c8 cmake: add support for stm32f7 2023-07-11 15:52:56 -03:00
raiden00pl
ca3d213402 cmake: sync arch/stm32/CMakeLists.txt with Make.defs 2023-07-11 15:52:56 -03:00
guoshichao
c33d1c9c97 sched/task/fork: add fork implementation
1. as we can use fork to implement vfork, so we rename the vfork to
fork, and use the fork method as the base to implement vfork method
2. create the vfork function as a libc function based on fork
function

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-07-12 02:27:37 +08:00
rongyichang
5d7864fbcb drivers/spi: add support for qspi hwfeatures
add QSPI_BITORDER and QSPI_WORD_REVERSE hwfeatures

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-07-12 01:42:25 +08:00
liuzhao
899471c6bd add support for YT8512 phy 2023-07-11 03:40:53 +08:00
simbit18
af247276d5 Fix nuttx coding style
Remove TABs
Fix indentation
2023-07-11 02:33:45 +08:00