Commit Graph

14656 Commits

Author SHA1 Message Date
licheng
25d5cd11a1 mmu: mmu enable should after enable SMP
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-21 09:39:41 +08:00
Michal Lenc
11cf3de776 imxrt: disable PWM synchronization when XBAR connection fails
This commit supplements commit 7d877fbb. External sync mode is now
disabled if XBAR connection fails and config options are used directly
in sync_src variable and passed to XBAR macro only when needed. The first
option could caused an undefined behaviour when sync_src was equal to -1
(external sync not used)

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2022-09-21 04:53:57 +08:00
klmchp
711681a90d add SAMA5D2 support for sam_xdma driver 2022-09-21 00:14:41 +08:00
Xiang Xiao
079a6fa6cc arch/armv7[a|r]: Implement up_affinity_irq
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:20:17 +09:00
Xiang Xiao
17ac85eb0a arch/armv7[a|r]: Support non SGI in up_trigger_irq
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:20:17 +09:00
Xiang Xiao
ef43283c67 arch/arm: Unify arm_cpu_sgi to up_trigger_irq
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:20:17 +09:00
Xiang Xiao
e44ff7d49f arm/rtl8720c: Remove up_trigger_irq since it is implemented in arm_trigger_irq.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:20:17 +09:00
Xiang Xiao
8a265e274d Kconfig: Remove EXPERIMENTAL for features which is been around a long time
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-19 11:39:22 -03:00
wangbowen6
282c4104b9 tlsr82/serial: clear uart tx index when uart_reset called.
Otherwise, after the rx error occur, the tx output will be
out of sequence, for example:
normal log:
[   30.163000] 12345678abcdefgh
[   30.666000] 12345678abcdefgh
[   31.169000] 12345678abcdefgh
[   31.672000] 12345678abcdefgh
[   32.175000] 12345678abcdefgh
[   32.678000] 12345678abcdefgh
[   33.181000] 12345678abcdefgh

error log:
he 7 .20]0003 127456c8abgdefch
gde [6.707002] 16345b78afcde
fcde
fghe10010] 5234a678ebcd
 77 713 00]41238567dabchefgd
che 7 .21]0003 127456c8abgdefch
gde [8.709002] 16345b78afcde
fcde

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-19 17:46:42 +08:00
Lingao Meng
3461990ef4 arch: arm: tlsr: Use flase_read ins of memcpy
Since tlsr arch support A/B bank, the hardware support
relative addr to load or store, but for flash read,
must use absolute addr. also combine with flash_<*>_method.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2022-09-19 12:19:48 +08:00
chao an
3a5ae5681d arch/arm/makefile: linking libraries with GCC should use option -l
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-19 11:02:27 +08:00
raiden00pl
69ecafd352 arch/arm: initial support for NRF5340 2022-09-18 21:49:32 +08:00
chao an
f23a736c80 nxstyle: correct the file path
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-18 01:35:21 +08:00
chao an
0bafb014a1 arch/arm/compiler: correct global symbol name
Fix Compile error from Armclang compiler(AC6):
Error: L6218E: Undefined symbol arm_vectoraddrexcption (referred from arm_vectoraddrexcptn.o).

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-17 22:07:21 +08:00
chao an
e156866a73 arch/arm: declare vector array default type to read-only
Reference:
https://developer.arm.com/documentation/dui0474/m/image-structure-and-generation/section-placement-with-the-linker/section-placement-with-the-first-and-last-attributes

CAUTION:
FIRST and LAST must not violate the basic attribute sorting order. For example, FIRST RW is placed after any read-only code or read-only data.

arm-none-eabi-readelf -aS arm_vectors.o
1. Without const:
  Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 3] .vectors          PROGBITS        00000000 000034 00011c 00   A  0   0  4

2. const symbol:
  [ 3] .vectors          PROGBITS        00000000 000034 00011c 00  WA  0   0  4

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-17 21:40:15 +08:00
ligd
e2df52390a SMP: fix crash when switch to new task which is still running
Situation:

Assume we have 2 cpus, and busy run task0.

CPU0                                CPU1
task0 -> task1                      task2 -> task0
1. remove task0 form runninglist
2. take task1 as new tcb
3. add task0 to blocklist
4. clear spinlock
                                    4.1 remove task2 form runninglist
                                    4.2 take task0 as new tcb
                                    4.3 add task2 to blocklist
                                    4.4 use svc ISR swith to task0
                                    4.5 crash
5. use svc ISR swith to task1

Fix:
Move clear spinlock to the end of svc ISR

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-17 17:37:47 +09:00
Petro Karashchenko
4fc76ea661 arch/arm/samv7: fix random corruption of data after SDIO RX DMA transaction
use time based timeout calculation instead of cycle based

minor styling fixes

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-09-17 12:29:58 +08:00
田昕
521f870965 phy62xx:support MTDIOC_ERASESTATE
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-09-16 21:11:06 +08:00
Xiang Xiao
a7b3217c37 boards/arch: Remove FAR from 32bit/64bit arch
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-16 10:22:12 +02:00
chao an
7dbaa4f4c4 arch/arm: add support for armclang compiler(AC6)
Reference:
https://developer.arm.com/Tools%20and%20Software/Arm%20Compiler%20for%20Embedded

Signed-off-by: chao an <anchao@xiaomi.com>
Signed-off-by: sheyunhu <sheyunhu@xiaomi.com>
2022-09-16 14:47:27 +08:00
chao an
54aa91f02b arch/arm: unify compile flags to common/Toolchain.defs
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-16 14:47:27 +08:00
chao an
0f0a94186f arch/arm/toolchain: migrate the toolchain define to arch/arm/Kconfig
migrate the toolchain define to arch/arm/Kconfig to simplify new toolchain registration

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-16 14:47:27 +08:00
zhangyuan21
f10759e377 armv7-a/r: modify regs index to improve exception performance 2022-09-16 15:24:03 +09:00
Andres Sanchez
64687e438a boards/stm32h7: add support for mcuboot
Add support for MCUBoot.
Two new configurations are added:
- mcuboot-loader: mcuboot-loader app used as a bootloader.
main_mcuboot_loader as entrypoint
- mcuboot-app: used as mcuboot agent app. Needs to be
signed manually through "imgtool sign --pad  --align 4 -v 0 -s
auto -H 0x200 --pad-header -S 0xc0000 nuttx.hex nuttx_sign.bin"

Signed-off-by: Andres Sanchez <tito97_sp@hotmail.com>
2022-09-16 02:12:17 +08:00
Michal Lenc
7d877fbbc3 imxrt: add support for PWM synchronization
This commit allows the PWM modules to be synchronized by an external
signal (other PWM module for example). The sync source can be selected
from configuration.

PWM module can also now generate a trigger when its timer reaches the duty
cycle. This trigger is used for the synchronization of other modules. It
can also be used for triggering ADC for example in the future.

Thanks to Rastislav Pavlanin and  Jan Spurek from NXP support for
suggestion which helped to solve the inter-module PWM synchronization
task.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2022-09-15 08:10:26 +09:00
ligd
bedd5d382d armv7-a: icache also need SMP cache coherency configuration
This can fixes the random crash happened sometime during boot.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-13 17:59:41 +08:00
zhangyuan21
3b889d820f armv7-a/r: use SRS and RFE for exception handler 2022-09-11 10:50:37 +09:00
ligd
3a023f4d1a arm: fix backtrace busyloop
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-10 12:48:11 +08:00
ligd
b3ebe66ff5 arch: dump backtrace should after set rtcb regs
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-10 12:48:11 +08:00
ligd
a3f9bd3786 backtrace: fix busy loop backtrace
Situation:
1. user call assert
2. crash in assert
3. crash happend, do backtrace
4. backtrace interrupt stack successful
5. busy loop backtrace user stack with CURRENT_REGS

Fix:
use rtcb->regs instead

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-10 12:48:11 +08:00
ligd
37d37dcae5 armv7-a/r: use generic timer to realize arm_timer
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-09 21:52:35 +02:00
ligd
4c19130d1d cache: fix up_clean_dcache() slowly
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-09 21:51:35 +02:00
GD32-MCU
85c8144afa add chip GD32F450 of GD32MCU
Modify the file according to the checks

update the board config files, and modify the gd32f4xx_progmem.c

Add chip GD32F450 of GD32MCU

delete the micro FAR, modify code style

Add chip GD32F450 of GD32MCU
2022-09-09 15:29:35 +08:00
curuvar
e8f4d74ad0 RP2040 Code Cleanup 2022-09-09 12:43:40 +08:00
curuvar
0322a61510 Add watchdog driver support to RP2040 2022-09-08 21:41:13 +08:00
curuvar
05b19e02d9 Eliminate un-needed wait in rp2040 SMART filesystem 2022-09-08 09:00:52 +08:00
curuvar
d3b226aea1 Fix race condition in RaspberryPi Pico W WiFi 2022-09-08 09:00:33 +08:00
Xiang Xiao
e17b678a16 compiler.h: Rename inline_function to always_inline_function
reserve inline_function macro for inline keyword

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-07 10:24:04 +02:00
Sebastien Lorquet
179d64d999 stm32h7: SPI is no more experimental 2022-09-06 19:34:40 -04:00
Sebastien Lorquet
3e16b6c9f1 update conditionals to select stm32h7 spi peripherals 2022-09-06 19:34:40 -04:00
curuvar
9ad75fd95d Added SMART flash filesystem to RP2040 2022-09-05 10:38:56 -03:00
Michal Lenc
23b27419e2 imxrt/encoder: add support for index position capture
This commit enhances imxrt encoder driver with index capture support.
The index is captured when the index interrupt occurs and can be passed
to application layer with QEIOC_GETINDEX ioctl call.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2022-09-04 11:08:45 +08:00
Huang Qi
32a21a1b67 UBSan: Allow custom the sanitizer in Kconfig
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-09-02 19:07:09 +08:00
Rajvinder Kaur
27fbca771f stm32h7\stm32_fdcan_sock: fix the FDCAN_LOOPBACK config macros 2022-09-02 10:42:08 +08:00
wangbowen6
b15d38246c up_nputs: fix AddressSanitizer: global-buffer-overflow problem
==2117790==ERROR: AddressSanitizer: global-buffer-overflow on address 0x64d9e3c0 at pc 0x59ac4e16 bp 0xcefe8058 sp 0xcefe8048
READ of size 1 at 0x64d9e3c0 thread T0
    #0 0x59ac4e15 in up_nputs sim/up_nputs.c:54
    #1 0x59a67e4c in syslog_default_write syslog/syslog_channel.c:220
    #2 0x59a67823 in syslog_default_write syslog/syslog_write.c:101
    #3 0x59a67f10 in syslog_write syslog/syslog_write.c:153
    #4 0x59a651c3 in syslogstream_flush syslog/syslog_stream.c:60
    #5 0x59a6564e in syslogstream_addchar syslog/syslog_stream.c:104
    #6 0x59a6576f in syslogstream_putc syslog/syslog_stream.c:140
    #7 0x5989fc4d in vsprintf_internal stdio/lib_libvsprintf.c:952
    #8 0x598a1298 in lib_vsprintf stdio/lib_libvsprintf.c:1379
    #9 0x59a64ea4 in nx_vsyslog syslog/vsyslog.c:223
    #10 0x598a601a in vsyslog syslog/lib_syslog.c:68
    #11 0x59b0e3dc in AIOTJS::logPrintf(int, char const*, ...) src/ajs_log.cpp:45
    #12 0x59b03d56 in jse_dump_obj src/jse/quickjs/jse_quickjs.cpp:569
    #13 0x59b03ea1 in jse_dump_error1(JSContext*, unsigned long long) src/jse/quickjs/jse_quickjs.cpp:602
    #14 0x59b03dd9 in jse_dump_error(JSContext*) src/jse/quickjs/jse_quickjs.cpp:591
    #15 0x59bed615 in ferry::DomComponent::callHook(char const*) src/framework/dom/component.cpp:65
    #16 0x59bfe0ff in ferry::DomComponent::initialize() src/framework/dom/component.cpp:645
    #17 0x59bb141d in dom_create_component(JSContext*, unsigned long long, unsigned long long, unsigned long long) (/home/wangbowen/project/central/vela_miot_bes_m0/bin/audio+0x365c41d)
    #18 0x59b4c0d3 in AIOTJS::__createComponent(JSContext*, unsigned long long, int, unsigned long long*) (/home/wangbowen/project/central/vela_miot_bes_m0/bin/audio+0x35f70d3)
    #19 0x5a56ec17 in js_call_c_function quickjs/quickjs.c:16108

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-01 11:51:48 +08:00
zhangyuan21
c82798c66a arch/arm: change context switch to macro 2022-08-31 10:57:38 -04:00
raiden00pl
d7e2704dff arch/stm32/stm32_adc.c: cosmetics 2022-08-27 20:40:06 +08:00
raiden00pl
b01ea50e44 arch/stm32/stm32_foc.c: cosmetics 2022-08-27 20:40:06 +08:00
raiden00pl
c563d8a993 arch/stm32/stm32_pwm.c: cosmetics 2022-08-27 20:40:06 +08:00
raiden00pl
9a85a0959a stm32/Kconfig: remove the unnecessary option 2022-08-27 20:40:06 +08:00