Commit Graph

19999 Commits

Author SHA1 Message Date
Eero Nurkkala
e50db35dc4 Revert "mpfs/mpfs_ddr.c: Stop the DDR training once it is completed"
This reverts commit ea9144bda8.

The commit made Icicle MPFS DDR useless. Revert the change for now.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-11-02 21:44:52 +08:00
Gustavo Henrique Nihei
f5c77933cb arch: Fix linking of multiple preprocessed linker script files
Only the last item from the ARCHSCRIPT list was being suffixed with
".tmp".

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-11-02 09:15:27 +08:00
Xiang Xiao
12926ee864 arch/arm: Document the clever trick of PRI?32 macros
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 23:11:16 +01:00
Xiang Xiao
93895c42a7 arch/arm: Typedef _[u]int32_t to __[U]INT32_TYPE__
if __INT32_TYPE__ is defined

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 19:58:20 +01:00
Xiang Xiao
4578df5cbb Fix lpc17_40_serial.c:705:24: error: unused function 'lpc17_40_uartcclkdiv'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
Xiang Xiao
7daacec1fa Fix lpc17_40_serial.c:510:20: error: unused function 'up_restoreuartint'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
Xiang Xiao
5948dc8c8f Fix lpc17_40_sdcard.c:614:24: error: unused function 'lpc17_40_getpwrctrl'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
Xiang Xiao
09997c6546 Fix lpc17_40_serial.c:814:20: error: unused function 'lpc17_40_uart0config'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
Xiang Xiao
ae9ff3bc67 Fix lpc176x_clockconfig.c:213:16: error: variable 'regval' set but not used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 17:12:42 +01:00
zhangyuan21
b118083c35 arch_timer: adjust timer/arch_timer to support tick
Enable CONFIG_SCHED_TICKLESS_TICK_ARGUMENT in tickless mode
to improve the performance.
2022-11-01 21:53:08 +08:00
Fotis Panagiotopoulos
189aa0292f arm: Added breakpoint in stack overflow trap. 2022-11-01 21:42:25 +08:00
SPRESENSE
3379fc96fc arm/backtrace_sp: fix build warning
common/arm_backtrace_sp.c: In function 'up_backtrace':
common/arm_backtrace_sp.c:253:15: warning: assignment to 'long unsigned int' from 'uint8_t *' {aka 'unsigned char *'} makes integer from pointer without a cast [-Wint-conversion]
  253 |           top = g_intstacktop;
      |
2022-11-01 13:49:56 +01:00
Fotis Panagiotopoulos
e89432b563 Added DHCSR definitions for ARMv7 & ARMv8. 2022-11-01 09:22:07 +08:00
Xiang Xiao
3e3364d1a9 Fix the format string mismatch warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 11:20:56 +01:00
zhangyuan21
18266c1012 nuttx/sched: use pid to check idle task
Pid is more appropriate than the flink pointer to determine idle task,
when we want to use other data structure to optimize the task list.
2022-10-31 17:53:08 +09:00
Julian Oes
227218659b stm32h7: Add missing time.h include
This is required for me when building within CLion.

Without it, I get the error:

error: field 'lastwrite' has incomplete type
2022-10-31 10:22:27 +08:00
Xiang Xiao
5d7f1d5020 Fix chip/stm32_sdio.c:749:24: error: unused function 'stm32_getpwrctrl' [-Werror,-Wunused-function]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
Xiang Xiao
940ee2c8b1 Fix Error: chip/efm32_clockconfig.c:109:20: error: unused function 'efm32_synchronize' [-Werror,-Wunused-function]
static inline void efm32_synchronize(uint32_t bitset)
                   ^
Error: chip/efm32_clockconfig.c:185:20: error: unused function 'efm32_enable_auxhfrco' [-Werror,-Wunused-function]
static inline void efm32_enable_auxhfrco(void)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
Xiang Xiao
c6ae5e42c0 Fix chip/cxd56_farapi.c:285:14: error: format specifies type 'int' but the argument has type 'unsigned long' [-Werror,-Wformat]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
Xiang Xiao
7ad74c413a Fix chip/cxd56_icc.c:498:18: error: overlapping comparisons always evaluate to false [-Werror,-Wtautological-overlap-compare]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
Xiang Xiao
eeefc4a516 Fix chip/cxd56_usbdev.c:675:20: error: unused function 'cxd56_iscableconnected' [-Werror,-Wunused-function]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
Xiang Xiao
c701d1c6ec Fix error: variable 'lfbclk' is used uninitialized whenever switch case is taken [-Werror,-Wsometimes-uninitialized]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
Xiang Xiao
d1a3f5e47f arch/arm: Replace xxx_[bus|usage]fault with arm_[bus|usage]fault
to fix the following clang warning:
Error: chip/eoss3_irq.c:138:47: error: format specifies type 'unsigned int' but the argument has type 'uint32_t' (aka 'unsigned long') [-Werror,-Wformat]
  _err("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS));
                                     ~~~~     ^~~~~~~~~~~~~~~~~~~~~~
                                     %08lx
/github/workspace/sources/nuttx/include/debug.h:126:57: note: expanded from macro '_err'
   __arch_syslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
                                    ~~~~~~              ^~~~~~~~~~~
/github/workspace/sources/nuttx/arch/arm/src/common/arm_internal.h:134:24: note: expanded from macro 'getreg32'
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: chip/eoss3_irq.c:146:49: error: format specifies type 'unsigned int' but the argument has type 'uint32_t' (aka 'unsigned long') [-Werror,-Wformat]
  _err("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS));
                                       ~~~~     ^~~~~~~~~~~~~~~~~~~~~~
                                       %08lx

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
Xiang Xiao
ad35572751 Fix Error: chip/gd32f4xx_spi.c:924:20: error: unused function 'spi_putreg16' [-Werror,-Wunused-function]
static inline void spi_putreg16(struct gd32_spidev_s *priv,
                   ^
Error: chip/gd32f4xx_spi.c:945:23: error: unused function 'spi_getreg8' [-Werror,-Wunused-function]
static inline uint8_t spi_getreg8(struct gd32_spidev_s *priv,
                      ^
Error: chip/gd32f4xx_spi.c:967:20: error: unused function 'spi_putreg8' [-Werror,-Wunused-function]
static inline void spi_putreg8(struct gd32_spidev_s *priv,

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
Xiang Xiao
202408c6e7 Fix gd32f4xx_syscfg.c:137:5: error: variable 'regaddr' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
Xiang Xiao
513904d1df Fix gd32f4xx_dma.c:223:26: error: unused function 'gd32_dma_channel_get' [-Werror,-Wunused-function]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
anjiahao
d7b4e91dda Call nxsem_destroy or nxmutex_destry in the error path
1.Don't check the return value of nxsem_init or nxmutex_init
2.Fix some style issue

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 13:56:52 +01:00
Roberto Bucher
944bb6164d Files for pysimCoder on nucleo-h743zi2 2022-10-29 18:03:37 -03:00
Roberto Bucher
793f37c007 Files for pysimCoder on nucleo-h743zi2 2022-10-29 18:03:37 -03:00
Xiang Xiao
b607f80cf3 arch: Remove the unnecessary nosanitize_address from backtrace source code
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-29 08:26:04 +02:00
Jukka Laitinen
b2e239784f arch/risc-v/src/mpfs/hardware/mpfs250t_484_pinmap.h: Lower the default drive strength for MSSIO GPIOS
The default drive strength was way too high for normal GPIO usage, causing overshoots & clitches

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-10-28 22:42:17 +08:00
Jukka Laitinen
67a60d77dd arch/risc-v/src/mpfs: Add a configuration flag for SD-card card detect line
Make existence of the card detect line configurable

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-10-28 22:42:05 +08:00
zouboan
868de3ca4b arch/sparc add initial support for S698PM 2022-10-28 17:26:24 +09:00
zouboan
b3ff4ce301 arch/sparc change common file to support SMP 2022-10-28 17:26:24 +09:00
chao an
a8d3286258 net: move device buffer define to common header
Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-28 00:32:16 -04:00
Gustavo Henrique Nihei
2a20db7697 xtensa: Define COMMON_CTX_REGS for chips without FPU (e.g. ESP32-S2)
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-10-27 23:28:47 +08:00
anjiahao
2156a102cf fix bl602 i2c sem init mistake
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-27 21:21:01 +08:00
Gustavo Henrique Nihei
facdd4f2b9 esp32[-s2/-s3/-c3]: Re-sort SPI Flash configs
- Reduce "SPI Flash configuration" menu dependency on SPI Flash driver
  just to MTD-related configs.
- Move SPI Flash Mode and Frequency configs to SPI Flash configuration
  menu.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-10-27 10:07:40 +08:00
Tiago Medicci Serrano
0bf7afad25 xtensa/esp32: add i2s_mclkfrequency to set master clock on I2S 2022-10-27 00:09:01 +08:00
Xiang Xiao
739210708a arch: Replace __builtin_bswapxx with bswapxx
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-25 20:24:19 -03:00
David Sidrane
f3256e5668 stm32fh7:Allow the use of the Network Monitor via polling
Not all boards have an interrupt line from the phy to
   the Soc. This commit allows the phy to be polled for
   link status.

   This may not work on all MAC/PHY combination that
   have mutually exclusive link management and operating
   modes. The STM32H7 and LAN8742AI do not have such a
   limitation.

Fix typos
2022-10-25 21:52:14 +08:00
Petro Karashchenko
4c71075ea5 arch/arm/stm32h7: multiple fixes for stm32h7 flash interface
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-25 05:37:08 -04:00
chao an
86e3bd9d75 arm/toolchain: update toolchain comment to avoid confusion
1. add 'ARM' prefix to choice menu
2. rename 'Generic Clang toolchain' to 'LLVM Clang toolchain'
   to avoid confuse with CONFIG_ARM_TOOLCHAIN_ARMCLANG

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-25 12:33:46 +08:00
chao an
9804320cae arm/armv6-m: fix build break if enable syntax unified
armv6-m/arm_exception.S: Assembler messages:
armv6-m/arm_exception.S:171: Error: cannot honor width suffix -- `lsl r7,r7,#2'

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-25 12:32:06 +08:00
chao an
09cc29af4d arch/armv6-m: fix compile error on LLVM clang
armv6-m/arm_exception.S:139:2: error: invalid instruction, any one of the following would fix this:
 sub r1, #(4 * (10))
 ^
armv6-m/arm_exception.S:139:2: note: instruction requires: thumb2
 sub r1, #(4 * (10))
 ^
armv6-m/arm_exception.S:139:10: note: invalid operand for instruction
 sub r1, #(4 * (10))
         ^
armv6-m/arm_exception.S:139:2: note: no flag-preserving variant of this instruction available
 sub r1, #(4 * (10))
 ^
armv6-m/arm_exception.S:139:10: note: operand must be a register in range [r0, r7]
 sub r1, #(4 * (10))
         ^
-----------------------------------------

bringup.c:125:18: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
          return ret;
                 ^~~
bringup.c:73:10: note: initialize the variable 'ret' to silence this warning
  int ret;
         ^
          = 0

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-25 00:52:00 +08:00
chao an
539f9a862e arm/cache: fix build warning on LLVM clang
armv7-m/arm_cache.c:93:24: warning: unused function 'arm_clz' [-Wunused-function]
static inline uint32_t arm_clz(unsigned int value)
                       ^

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-24 23:37:30 +08:00
chao an
c629fd1b00 arm/phy62xx: fix compile warning ('while' clause does not guard)
chip/flash.c: In function '_spif_read_status_reg_x':
chip/flash.c:46:9: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
   46 |         while ((AP_SPIF->fcmd &0x02)==0x02);         \
      |         ^~~~~
chip/flash.c:128:3: note: in expansion of macro 'SPIF_STATUS_WAIT_IDLE'
  128 |   SPIF_STATUS_WAIT_IDLE(SPIF_WAIT_IDLE_CYC);
      |   ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-24 20:23:59 +08:00
SPRESENSE
a4df3c0330 arch: cxd56xx: Fix deadlock by using GNSS CEP file on SPI-Flash
If you specify a file path on SPI-Flash in CONFIG_CXD56_GNSS_CEP_FILENAME,
it causes a deadlock issue in the inter-CPU communication. To resolve it,
introduce a new CONFIG_CXD56_GNSS_CEP_ON_SPIFLASH and then use pre-read
buffers during checking CEP file. So this needs the large of free memory.
2022-10-24 19:19:44 +08:00
SPRESENSE
22a29fdc97 arch: cxd56xx: Fix stall bulk xfer when sending 512 byte data
Remove hardware zero length packet enhancement because of driver
logic already processed the ZLP correctly. It is unnecessary and cause
of IN interrupt lost.
2022-10-24 09:02:39 +02:00
Petro Karashchenko
a74dddd2ff arch/risc-v/src/mpfs/hardware: fix alignment in comment
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-24 12:59:24 +08:00
Xiang Xiao
4aad964d48 Fix sam4s_nand.c:152:3: error: this 'while' clause does not guard... [-Werror=misleading-indentation]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-23 22:44:35 +02:00
raiden00pl
f1277a2233 stm32/socketcan: fix the EFF flag for received frames 2022-10-22 17:28:55 +08:00
Tiago Medicci Serrano
16b99ee013 xtensa/esp32s2: add initial support for I2S
Add initial support for the I2S peripheral on ESP32S2.
Add I2S character driver and generic I2S audio driver.
Include i2schar defconfig for ESP32-S2-Saola-1 board.
2022-10-22 15:18:35 +08:00
anjiahao
e1ca516488 use SEM_INITIALIZER inside of NXSEM_INITIALIZER
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-22 14:50:48 +08:00
anjiahao
5724c6b2e4 sem:remove sem default protocl
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-22 14:50:48 +08:00
Michael Jung
ec3805721c armv8-m: Fix MPU Region Limit Address config
On armv8-m the MPU region limits are inclusive.  Thus, we must substract
one byte of size from (base + limit).

Signed-off-by: Michael Jung <michael.jung@secore.ly>
2022-10-21 16:23:49 -03:00
Michael Jung
d4cbb4f5b8 armv8-m: Fix MPU Attribute Indirection reg offsets
Both MPU_MAIR0 and MPU_MAIR1 were off by 0x10.

Signed-off-by: Michael Jung <michael.jung@secore.ly>
2022-10-21 16:23:49 -03:00
raiden00pl
36ae5316b7 include/nuttx/can.h: make error definitions compatible with Linux 2022-10-21 18:47:29 +08:00
Zhe Weng
4ac44bc8b5 arch/sim: fix MTU mismatch on TAP device in host route mode
In host route mode (bridge mode disabled), the d_pktsize of TAP device is not initialized and will be set to CONFIG_NET_ETH_PKTSIZE in netdev_register, while the MTU on host side keeps at 1500. Input packets larger than CONFIG_NET_ETH_PKTSIZE will be dropped because 'IP packet shorter than length in IP header'.
This patch fix this issue by reading MTU from host side and set as d_pktsize, just the same as what is done in bridge mode.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-10-21 16:57:36 +08:00
xiangdong6
924c3d8b5f arch/armv7-r: Fix armclang build warning: L6306W
When a function is known to preserve eight-byte alignment of the stack, armclang assigns the build
attribute Tag_ABI_align_preserved to that function. However, the armclang integrated assembler does
not automatically assign this attribute to assembly code.

Signed-off-by: xiangdong6 <xiangdong6@xiaomi.com>
2022-10-21 13:58:23 +08:00
Gustavo Henrique Nihei
ae8ea29379 xtensa: Save SCOMPARE1 on context switches
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-10-21 11:10:51 +08:00
Xiang Xiao
942513cd37 time: Typedef time_t to int64_t if CONFIG_SYSTEM_TIME64 is defined
to handle 2038 problem correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-20 22:17:52 +02:00
SPRESENSE
0d87694024 arch: cxd56xx: Fix duplicate definitions in battery_ioctl.h
Fix duplicate definitions of arch/arm/include/cxd56xx/battery_ioctl.h
with include/nuttx/power/battery_ioctl.h.
2022-10-20 21:49:07 +02:00
SPRESENSE
2060f7be60 arch: cxd56xx: hostif: Remove -Wformat-truncation warnings
Remove -Wformat-truncation warnings in cxd56_hostif.c.
2022-10-20 21:49:07 +02:00
SPRESENSE
52cbfcf3bd arch: cxd56xx: Remove -Wmissing-braces warning
Remove -Wmissing-braces warning in cxd56_cpu1signal.c.
2022-10-20 21:49:07 +02:00
SPRESENSE
d3ed469f00 arch: cxd56xx: Fix compile warning in cxd56_pwm.c 2022-10-20 21:49:07 +02:00
Javier Casas
663bf4d968 Add support for stm32h7b3xx MCU's flash 2022-10-21 01:37:23 +08:00
Alan Carvalho de Assis
0e4c2fed93 esp32s2: Add DMA support to SPI 2022-10-20 10:11:26 +08:00
Alan Carvalho de Assis
a0a7375911 Fix esp32s2_spi.h offset 2022-10-20 10:11:26 +08:00
Lucas Saavedra Vaz
b0f96fc204 esp32/i2c: Add macros to conform with other peripherals and fix typos
Fix coding style

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-19 20:31:29 -03:00
Hidenori Matsubayashi
544552c305 arch/arm64/arm64_arch_timer: delete unused includes
Delete unnecessary includes.

Signed-off-by: Hidenori Matsubayashi <hidenori.matsubayashi@gmail.com>
2022-10-19 23:15:00 +02:00
Lucas Saavedra Vaz
cc04e2137a esp32/i2s: Reduce MCLK multiple to support existing boards 2022-10-20 00:40:24 +08:00
raiden00pl
a3db5fe24b stm32f7: add SocketCAN support 2022-10-20 00:08:36 +08:00
SPRESENSE
c48feac0e9 arch: cxd56xx: gnss: Fix compile error
Fix a compile error caused by
d1d4633 Replace nxsem API when used as a lock with nxmutex API
2022-10-19 14:10:51 +02:00
Fotis Panagiotopoulos
f9fd53cda1 gmtimer: Fixed range of tm_yday. 2022-10-19 12:39:04 +08:00
Xiang Xiao
774648de0f risc0v/bl602: Call kthread_create instead of nxtask_create in bl_os_task_create
since the kernel component should use the kernel thread instead the normal task

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-19 08:22:56 +09:00
raiden00pl
27db9558de stm32/socketcan: fixes for arm_netinitialize 2022-10-18 15:35:21 -03:00
Xiang Xiao
d200cacc49 arch/armv7-r: Fix typo error in commit 4fab2b9501
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 10:31:07 -03:00
Xiang Xiao
6b31918b42 Remove the unnecessary cast for main_t, NULL and argv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 08:51:45 +02:00
Zhe Weng
d8f35cf1b6 arch/sim: calling txdone callback after devif_loopback in netdriver
When devif_loopback handles a packet (like a ping targeting at this dev), it does not call the txdone callback, breaking the tx pipeline and may left some packets unhandled, delayed until next transmit on the network interface.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-10-18 11:16:33 +08:00
Zhe Weng
cb25a9dee3 arch/sim: change g_avail_work and g_recv_work to array in netdriver
Share one worker between multiple simulated network devices may work most of the time, but sometimes breaks the tx pipeline when sending packets on more than one interface at the same time, and leaves some packets unprocessed in network stack, delayed until next transmit on the network interface. The rx process is likely delayed in packet processing under similar situation, so keep g_avail_work and g_recv_work the same number as interfaces.

dev0 tx1 avail              tx1 done
        v                      v
work dev0 tx1 -> dev0 tx1 -> empty -> dev1 tx2 -> dev1 tx3 -> empty
                    ^                    ^           ^          ^
dev1     tx2 avail (failed to queue)  tx3 avail   tx2 done   tx3 done

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-10-18 11:16:33 +08:00
Xiang Xiao
4fab2b9501 arch/armv7-[a|r]: Don't define fiq stack if CONFIG_ARMV7A_DECODEFIQ=n
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 08:01:52 +09:00
Alan Carvalho de Assis
0e091b2486 esp32_qencoder: Fix small issues and typos reported by Tiago Medicci 2022-10-18 03:03:28 +08:00
zouboan
ba2b37e23f Update arch/sparc/include/spinlock.h
Co-authored-by: Alan Carvalho de Assis <alan.carvalho@espressif.com>
2022-10-18 00:55:30 +08:00
zouboan
d51d109d0a arch/sparc build CMN_SRC in common dir to keep up with other arch 2022-10-18 00:55:30 +08:00
zouboan
9b55b0af63 arch/sparc add support of spinlock for LEON3 and LEON4 2022-10-18 00:55:30 +08:00
anjiahao
dee38ce3e8 arch: Replace critical section with nxmutex in i2c/spi/1wire initialization
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
anjiahao
d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Alan Carvalho de Assis
655faa33d4 ESP32: Add support to Quadrature Encoder
Reviewed-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-17 00:30:53 +02:00
Bernd Walter
947e771c41 fix typo big letter 'o' in hex value for zero. 2022-10-17 02:55:21 +08:00
Hidenori Matsubayashi
ffe8dd39c6 arch/arm64: update for coding style
Replace "unsigned char" with "bool".

Signed-off-by: Hidenori Matsubayashi <hidenori.matsubayashi@gmail.com>
2022-10-16 17:20:14 +08:00
Bernd Walter
432c438c76 Use the correct marcro name for RP2040_UART0_BASE 2022-10-16 11:26:27 +08:00
chao an
4e3aa83706 arm/backtrace_fp: fix build warning
common/arm_backtrace_fp.c: In function 'up_backtrace':
common/arm_backtrace_fp.c:126:23: warning: assignment to 'void *' from 'uintptr_t' {aka 'unsigned int'} makes pointer from integer without a cast [-Wint-conversion]
  126 |           istacklimit = arm_intstack_top();
      |                       ^

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-15 03:09:55 +08:00
Hidenori Matsubayashi
28180b49d1 arm64: add Cortex-A57 and Cortex-A72 configurations
This change adds the following:
- Rename the board configuration name from qemu-a53 to qemu-v8a.
- Add the configurations for Cortex-A57 and Cortex-A72.

Signed-off-by: Hidenori Matsubayashi <hidenori.matsubayashi@gmail.com>
2022-10-14 09:27:35 +08:00
Hidenori Matsubayashi
06cf41901f arch/arm64: cleanup defconfigs
Use CONFIG_ARCH_CHIP_QEMU instead of CONFIG_ARCH_CHIP_QEMU_A53. This is because these configurations depend on the hardware configuration of qemu (memory map, irq numbers, etc.).

Signed-off-by: Hidenori Matsubayashi <hidenori.matsubayashi@gmail.com>
2022-10-13 19:26:26 +08:00
Alan Carvalho de Assis
c297ecaa5d esp32s2: Add missing ESP32S2 SPIRAM config 2022-10-13 01:41:47 +08:00
zouboan
d3f84ba724 arch/sparc dismiss non-Unicode characters issue 2022-10-12 11:36:14 -03:00
zhangyuan21
7d34ebdd4e armv7-a: add l2 page mapping interface 2022-10-12 22:00:06 +08:00
zhangyuan21
466635a5e0 armv7-a: set normal memory shareable in smp mode 2022-10-12 19:54:09 +08:00
zhangyuan21
750007ded9 sched: use tick count for sched timer expiration 2022-10-12 11:55:46 +08:00
Zhe Weng
7225e44725 arch/sim: support multiple tapdev for sim
Support more than one TAP device for debugging (future) NAT and FORWARD, left WPCAP and VPNKit unchanged (force number to 1).
Although we can support at most 31 interfaces, limit to 8 like CONFIG_TUN_NINTERFACES.

Signed-off-by: wengzhe <wengzhe@xiaomi.com>
2022-10-12 01:57:21 +08:00
chao an
bcdd03cdf3 arm/backtrace: rename arm_backtrace_thumb.c to arm_backtrace_sp.c
1. rename arm_backtrace_thumb.c to arm_backtrace_sp.c
2. use EHABI stack unwinder instead of instruction unwind

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-12 01:55:48 +08:00
Brennan Ashton
4ce8cf7bdc bl602/dma: Fix possible call of null pointer to function 2022-10-11 14:34:52 +08:00
Xiang Xiao
1cd9fa25cd arm/tlsr82xx: Don't select ARCH_HAVE_BACKTRACE
since it's already selected by ARCH_ARM

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-11 00:01:35 +02:00
chao an
24129e4ba7 arm/backtrace: add support for EHABI(Exception Handling ABI) stack unwinder
Reference:
https://github.com/ARM-software/abi-aa/blob/main/ehabi32/ehabi32.rst
https://github.com/ARM-software/abi-aa/releases/download/2022Q1/ehabi32.pdf

Signed-off-by: chao an <anchao@xiaomi.com>
2022-10-11 03:11:37 +08:00
Jukka Laitinen
e793207bb6 arch/risc-v/src/mpfs: Add a config option for enabling L2 cache
Make a separate config flag for enabling L2 cache. This is on by
default when compiling a standalone/bootloader configuration, but
can also be disabled for special cases, such as memory testing

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-10-11 00:59:48 +08:00
liangchaozhong
cc426f8539 usrsock:add done flag in usrsock_iovec_do
set done to true if all data in iovec array is copied

Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-10-11 00:57:49 +08:00
Andrés Sánchez Pascual
c28b05efd3 arch: stm32h7: Add support for dual bank flash
memory

Signed-off-by: Andrés Sánchez Pascual <tito97_sp@hotmail.com>
2022-10-10 01:07:45 +08:00
Brennan Ashton
8b7d2d3da4 bl602: Fix bug in lli functionality for dma. 2022-10-09 12:06:15 +02:00
Hidenori Matsubayashi
b0f9241ec1 arch/arm64: update to follow NuttX C Coding Standard
This change moves the static vars to the appropriate place to follow the coding standard. It also adds comments as sections and `static` where necessary.

Signed-off-by: Hidenori Matsubayashi <hidenori.matsubayashi@gmail.com>
2022-10-09 17:38:31 +08:00
Hidenori Matsubayashi
0b03a2316f arch/arm64/qemu/qemu_boot: fix wrong memory size
The default size in QEMU system is 128MB, and the size specified in chip.h is also 128MB. However, the region size for MMU was 512MB, so fixed it.

Signed-off-by: Hidenori Matsubayashi <hidenori.matsubayashi@gmail.com>
2022-10-09 17:18:26 +08:00
Masayuki Ishikawa
cb73e9a67d arch: qemu-rv: Refactor the entry point name for BUILD_KERNEL
Summary:
- This commit refactors the entry point name for BUILD_KERNEL
  to avoid misunderstanding the name

Impact:
- None

Testing:
- Tested with rv-virt:ksmp64

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-09 14:08:47 +08:00
Hidenori Matsubayashi
1297c23e7d arch/arm64/arm64_mmu: add mmu_nxrt_config
This change is a refactoring to match the userspace mmu_regions implementation.

Signed-off-by: Hidenori Matsubayashi <hidenori.matsubayashi@gmail.com>
2022-10-09 12:52:40 +09:00
Masayuki Ishikawa
4b6c9915fe arch: qemu-rv: Fix timer and IPI handling for BUILD_KERNEL+SMP
Summary:
- I noticed that the OS timer sometimes proceeds fast when
  a task is scheduled to run on CPUO via IPI.
- Actually, qemu-rv implementation shares supervisor software
  interrupt for both timer and IPI on CPU0.
- This commit fixes this issue.

Impact:
- qemu-rv only

Testing:
- Tested with qemu-6.2

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-08 17:19:51 +08:00
Masayuki Ishikawa
4e095d2e90 arch: risc-v: Add SMP support for BUILD_KERNEL
Summary:
- This commit adds SMP support for BUILD_KERNEL

Impact:
- RISC-V: BUILD_KERNEL + SMP only

Testing:
- Tested with rv-virt:ksmp64 (will be added later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-08 09:25:41 +08:00
Ville Juven
0d52b5be56 mpfs_mm_init: Mark the L2 kernel page table as a global mapping
Kernel mappings are global, i.e. they exist in every address environment
2022-10-07 17:26:21 +08:00
Ville Juven
373568f63a mpfs_mm_init.c: Ensure the L3 page table size is large enough
Run-time check for L3 page table size, to ensure it is large enough
to map all of the kernel memory.

NOTE: The check has to be run-time, as KFLASH_SIZE/KSRAM_SIZE are really
linker relocation symbols, and thus cannot be utilized compile-time.
2022-10-07 17:26:21 +08:00
Ville Juven
dbc9a5ffa2 riscv_mmu: Add some basic sanity checks for section boundaries
L3 table maps 2MB of memory, this brings an implicit requirement for
any L3 region to be aligned to 2MB. This commit adds build time sanity
checks to ensure this requirement is met.

For other SvXX architectures the boundary requirement (might be) is
different.
2022-10-07 17:26:21 +08:00
Masayuki Ishikawa
df6bf3e614 arch: risc-v: Introduce RISCV_IPI macro for SMP
Summary:
- This commit introduces RISCV_IPI macro for SMP
- Also, replace RISCV_IRQ_MSOFT with RISCV_IRQ_SOFT
- Remove duplicate irq_attach() from qemu_rv_irq.c

Impact:
- None

Testing:
- Tested with rv-virt:smp64 and maix-bit:smp on QEMU

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-07 14:49:29 +08:00
Masayuki Ishikawa
a7bca63b3b arch: qemu-rv: Fix build errors in chip.h for BUILD_KERNEL + SMP
Summary:
- This commit fixes build errors for BUILD_KERNEL + SMP

Impact:
- None

Testing:
- Tested with rv-virt:ksmp64 (will be added later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-05 17:19:13 +08:00
Masayuki Ishikawa
c4901d6f4b arch: risc-v: Introduce g_percpu_spin in riscv_percpu.c
Summary:
- This commit introduces g_percpu_spin to avoid deadlock
  in riscv_percpu.c instead of using the global spinlock.

Impact:
- None

Testing:
- Tested with rv-virt:knsh64 and rv-virt:ksmp64 (will be added later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-05 05:15:38 +02:00
Gustavo Henrique Nihei
73678c4839 xtensa/esp32: Allow allocation of user data in SPI RAM
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-10-04 21:32:42 +02:00
Xiang Xiao
f813fea555 Fix chip/cxd56_gnss.c:2858:7: error: label 'err' used but not defined
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-04 20:59:30 +02:00
Brennan Ashton
102c63be9e bl602: Add initial DMA support, including SPI over DMA. 2022-10-03 16:01:30 -03:00
Jukka Laitinen
03bce705d5 arch/risc-v/src/mpfs/mpfs_ethernet.c: Set PHY speed advert after PHY reset
This allows properly using 10/100Mbps also with 1G phy. Some gigabit PHYs
come out of reset with 1G advertisement enabled, causing other devices to
set up link with 1G. If, after this, the link is set to 10/100 on the mpfs,
the link won't work.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-10-03 19:35:30 +02:00
Masayuki Ishikawa
2fa872e304 arch: qemu-rv: Add M-timer handling for BUILD_KERNEL
Summary:
- In RISC-V, BUILD_KERNEL uses S-mode and to use M-mode timer
  we need to handle it by using OpenSBI or self-implementation.
- This commit adds M-timer self-implementation for BUILD_KERNEL.

Impact:
- qemu-rv only

Testing:
- Tested with rv-virt:knsh64 on qemu-6.2

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-03 23:26:11 +08:00
Masayuki Ishikawa
b3e300f8e6 arch: qemu-rv: Fix qemu_rv_start_s() for S-mode
Summary:
- I found inappropriate SET_CSR() usage in the function.
- This PR fixes this issue.

Impact:
- None

Testing:
- tested with rv-virt:knsh64

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-10-02 22:32:07 +08:00
Tiago Medicci Serrano
18c715ba92 xtensa/esp32: add initial support for I2S
Add initial support for the I2S peripheral on ESP32.
Add I2S character driver and generic I2S audio driver.
Include i2schar defconfig for ESP32-DevKitC board.
2022-09-30 17:23:17 -03:00
Xiang Xiao
e38248ee08 Return -EINVAL for the internal API
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-30 17:54:56 +02:00
Xiang Xiao
bdeaea3742 Remove the unnessary empty line after label
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-30 17:54:56 +02:00
Carlos Sanchez
6e490759d6 s32k1xx: Fix FlexIO timer register access macros 2022-09-30 23:38:59 +08:00
Carlos Sanchez
68db81ab4f s32k1xx: Allow building with debug features and no console. 2022-09-30 15:15:55 +02:00
Xiang Xiao
53dcddc9e3 arch/armv[7|8]-m: Implement up_invalidate_icache
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-30 08:07:45 +02:00
Gustavo Henrique Nihei
c0cd56a758 risc-v/esp32c3: Fix retrieval for linker-defined symbol
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-09-29 23:31:48 +02:00
chao an
6bc4baa4ca arch/makefile: preprocess link script to make configure more flexibly
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-29 17:06:47 +08:00
yinshengkai
5c9b094d65 tools: Replace mkallsyms.sh with mkallsyms.py
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-09-29 08:33:04 +08:00
Fotis Panagiotopoulos
bbf3f2866d Fixed non-UTF8 characters. 2022-09-28 09:38:55 +08:00
ligd
078a0486f5 armv7-a: SMP hande all cores start at same time
In SMP mode, if all cores start at same time, all from __start(),
then only primary need do initialize, so others core should wait
primary, use 'sev' let the non-primary continue to __cpuN_start().

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-28 10:33:13 +09:00
wangbowen6
589647308c arm/tlsr82: move peripherals pin config to board.h
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-28 09:30:06 +08:00
Xiang Xiao
764540267e sched/clock: Rename g_system_timer to g_system_ticks
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-27 17:45:44 -03:00
Jukka Laitinen
24ea8ee3e9 arch/risc-v/src/mpfs/mpfs_ddr.c: Use DDR type selection macros to flag out code
The DDR type can be determined at compile time, remove code which is not used

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-09-28 02:09:02 +08:00
Jukka Laitinen
0ba3bc66be arch/risc-v/src/mpfs/Kconfig: Add configuration flags for DDR type selection
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-09-28 02:09:02 +08:00
Masayuki Ishikawa
0cd896b1d5 arch: risc-v: Fix license information to use the OpenSBI
Summary:
- I noticed that the OpenSBI library depends on the BSD license
- This commit fixes this issue

Impact:
- CONFIG_OPENSBI=y only

Testing:
- Build with icicle:opensbi (will be updated later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-09-27 18:29:09 +02:00
ligd
059497d1d1 armv7-a/r: NON-primary core should invalidate dacache level1
NON-primary cpu will invalidate cpu0's cache L2, that will caused cpu0's data mismatch, and then system crash

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-27 14:41:39 +08:00
David Sidrane
a1ebd499ea stm32h7:SDMMC fix unaligned access for buffers not on 32 bit boundaries
The IDMA needs to have 32 bit word alignment, in fact it will
   AND off the lower 2 bits of the value stored in IDMABASE0R.
   This bug was masked by CONFIG_ARMV7M_DCACHE causing proper word alignment
   and also FAT_DMAMEMORY being aligned.

   This commit extends the unaligned logic (used for dcache) to take into account
   the need for a buffer copy when the buffer is ot 32 bit word.

    It leverages the fact that when CONFIG_ARMV7M_DCACHE is not defined the up_xxxxx_dcache are nops.
2022-09-27 09:43:29 +08:00
Rajvinder Kaur
2e1c522a79 stm32h7\stm32_fdcan_sock: reserve space for timeval struct in the intermediate storage of tx and rx CAN frames when timestamp is enabled 2022-09-26 20:05:44 -03:00
chao an
aa51629bd2 arm/armv7-r: redefine the linker symbols as armlink style
Fix build break:

Error: L6218E: Undefined symbol _sbss (referred from arm_head.o).
Error: L6218E: Undefined symbol _ebss (referred from arm_head.o).
Error: L6218E: Undefined symbol _eronly (referred from arm_head.o).
Error: L6218E: Undefined symbol _sdata (referred from arm_head.o).
Error: L6218E: Undefined symbol _edata (referred from arm_head.o).

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-26 19:04:25 +02:00
chao an
a2cd1b0db3 arm/armlink: add support of link time optimization(lto)
Optimization goal(Code size)

Smaller                           GCC(-Os) GCC(-flto -Os) CLANG(-flto -Oz) ARMCLANG(-flto -Oz/-Omin)
lm3s6965-ek/qemu-flat(Cortex-M3)   208662      193893           199525             195464
                                               -7.07%           -4.37%             -6.32%
sabre-6quad/smp(Cortex-A9)         131360      122500            N/A               123988
                                               -6.74%            N/A               -5.61%

Faster performance                GCC(-O3) GCC(-flto -O3) CLANG(-flto -Ofast) ARMCLANG(-flto -Ofast) ARMCLANG(-flto -Omax)
lm3s6965-ek/qemu-flat(Cortex-M3)   257502      296364           369465             346696                  384204
                                              +15.00%          +43.40%            +34.60%                 +49.20%
sabre-6quad/smp(Cortex-A9)         166520      196004             N/A              207908                  224140
                                              +17.70%             N/A             +24.85%                 +34.60%

Reference:
https://developer.arm.com/documentation/101754/0618/armclang-Reference/armclang-Command-line-Options/-O--armclang-

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-26 18:23:27 +08:00
Xiang Xiao
40ef5bc6db libc: Move queue.h from include to include/nuttx
to avoid the conflict with libuv's queue.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-26 08:04:58 +02:00
wangbowen6
344c8be049 poll: add poll_notify() api and call it in all drivers
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2022-09-26 12:06:32 +08:00
Xiang Xiao
70290b6e38 arch: Change the linker generated symbols from uint32_t to uint8_t *
and remove the duplicated declaration

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-24 21:26:56 +02:00
Masayuki Ishikawa
95fe8426ed arch: lc823450: Fix to boot
Summary:
- I noticed that lc823450-xgevk does not boot due to the recent
  changes on g_current_regs
- This PR fixes this issue

Impact:
- None

Testing:
- Tested with lc823450-xgevk:rndis

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-09-24 21:59:32 +08:00
chao an
b134995d92 arm/tlsr82: replace incompatible instruction sets to internal implement
1. some arm instructions are not compatible with arch tlsr:

{standard input}: Assembler messages:
{standard input}:53: Error: bad instruction `svc #0'

2. remove unsupport compile option

cc1: error: unrecognized command line option "-mlittle-endian"
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-23 23:54:25 +08:00
chao an
47b350a4c3 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  WA  0   0  4

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

Regression by:

| commit 229b57d6cb
|
|     arch/armv[6|7|8]-m: Move _vectors to arm_internal.h to avoid the duplication
|
|     and change the type of _vectors from uint32_t to const void *
|
|     Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-23 22:28:51 +08:00
chao an
c07d076bf5 arch/arm: redefine the linker symbols as armlink style
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-23 22:28:07 +08:00
chao an
bb63e1b23d arm/cortex-r: correct include path of chip.h
In file included from ./armv7-r/arm_l2cc_pl310.c:41:
./armv7-r/l2cc_pl310.h:38:10: fatal error: chip/chip.h: No such file or directory
   38 | #include "chip/chip.h"
      |          ^~~~~~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-23 13:54:03 +08:00
gaojiawei
571151aeb3 arch/sim: remove stderr in the function renaming list
stderr is a file stream pointer not a function name. Having
it in the renaming list may introduce linking error.

Signed-off-by: gaojiawei <gaojiawei@xiaomi.com>
2022-09-23 13:53:56 +08:00
simbit18
4d7c15af5c arch/arm: fix conditional compilation term (#else)
Code fixing for the conditional compilation term (#else)
2022-09-23 01:36:08 +08:00
simbit18
d35307dacd stm32wl5/stm32wl5_rcc.h
fix conditional compilation term (#else)
2022-09-22 17:17:18 +02:00
chao an
59499c0bb2 arch/arm: fallback to common toolchain if armeb(endian big) is unavailable
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-22 22:19:05 +08:00
Michal Lenc
9ebd7e525c imxrt: add support for ADC triggering by an external signal
Config option IMXRT_ADCx_ETC can now be used to select an external HW
trigger to be used instead of continous trigger. Continous trigger is
used if IMXRT_ADCx_ETC = -1 (default option). Otherwise the source signal
is routed through XBAR and used as a trigger.

Hardware triggering is currently limited to maximum of 8 channels.
HW trigger is automatically disabled if there are more than 8 channels.

The external triggering was tested with PWM signal as a source.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2022-09-22 22:13:56 +08:00
simbit18
5a085176fe stm32u5/stm32_rcc.h
fix conditional compilation term (#else)
2022-09-22 21:27:09 +08:00
Xiang Xiao
3c1c29f2c4 arch: move non arm g_current_regs defintion to common place
to avoid the code duplicaiton

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-21 22:23:11 +02:00
Xiang Xiao
229b57d6cb arch/armv[6|7|8]-m: Move _vectors to arm_internal.h to avoid the duplication
and change the type of _vectors from uint32_t to const void *

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-21 22:23:11 +02:00
Xiang Xiao
47bd07034c arch/misoc: Implement up_initialize in the common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-21 22:23:11 +02:00
Amir Melzer
6274e19257 fix conditional compilation term (#else) 2022-09-21 15:57:05 -03:00
chao an
fb4c593e89 armv7-r/tms570: fix build break
1.
make[1]: *** No rule to make target 'tms570_spi.c', needed by '.depend'.  Stop.

2.
In file included from armv7-r/arm_gicv2.c:36:
armv7-r/gic.h: In function 'arm_gic_nlines':
armv7-r/mpcore.h:63:29: error: 'CHIP_MPCORE_VBASE' undeclared (first use in this function)
   63 | #define MPCORE_ICD_VBASE   (CHIP_MPCORE_VBASE+MPCORE_ICD_OFFSET)
      |                             ^~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-22 02:22:18 +08:00
Nathan Hartman
ac20a5c0d6 Remove executable permissions from source files 2022-09-22 01:59:48 +08:00
chao an
de1ad746d8 arm/armv7-r: remove incorrect include header "addrenv.h"
since armv7-r does not support kernel mode

./armv7-r/arm_syscall.c:36:10: fatal error: addrenv.h: No such file or directory
   36 | #include "addrenv.h"
      |          ^~~~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-22 01:35:03 +08:00
Masayuki Ishikawa
ae378872c2 arch: armv7-a: Remove the code for CONFIG_ARCH_PGPOOL_MAPPING=n
Summary:
- Currently, CONFIG_ARCH_PGPOOL_MAPPING=y is necessary for
  CONFIG_BUILD_KERNEL=y.
- This commit removes the code for CONFIG_ARCH_PGPOOL_MAPPING=n

Impact:
- None

Testing:
- Tested with sabre-6quad:netknsh_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-09-21 19:57:27 +08:00
ligd
6903f02d41 armv7-r: add VBAR cp15 opearation
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-21 18:07:03 +08:00
ligd
3477c347e8 armv7a/r: add isb to cp15_invalidate_icache()
Incase invalidate_icache hasn't done

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-21 18:07:03 +08:00
ligd
6d92810d5a armv7a/r: refact cp15_cache functions
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-21 18:07:03 +08:00
ligd
c866b6be9a armv7a/r: add common operation CP15_SET/GET()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-21 18:07:03 +08:00
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
Masayuki Ishikawa
a2deaa73c3 arch: risc-v: Remove FPU support from qemu-rv
Summary:
- Because a context switch issue still exists with FPU
  the configs should be removed until it works.

Impact:
- None

Testing:
- Tested with ostest

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-09-20 11:40:40 +08: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
teknokita
1adef79c24 add include <nuttx/fs/ioctl.h> to esp32c3_usbserial.c
undeclare TCGETS on esp32c3 when enable usbserial and termios
error:
chip/esp32c3_usbserial.c: In function 'esp32c3_ioctl':
chip/esp32c3_usbserial.c:411:10: error: 'TCGETS' undeclared (first use in this function)
2022-09-17 17:06:58 +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
Eero Nurkkala
ec026c14cb risc-v/mpfs: emmcsd: further enhance the clocking
Simplify the clock mode from the board.h -files. Also make the
SD clock definable as well.

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-15 01:55:33 +08:00
Ville Juven
ea9144bda8 mpfs/mpfs_ddr.c: Stop the DDR training once it is completed
The DDR training IP stays active otherwise, so stop it when the training
is complete.

This fixes a potential interrupt storm via MPFS_IRQ_DDRC_TRAIN.
2022-09-14 22:31:36 +08: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
Eero Nurkkala
e5305a250a risc-v/mpfs: emmcsd: provide options for selecting clk speed
Some related products, such as Aries m100pfs, don't support eMMC
speeds up to 200MHz. Thus, provide option to select slower clock.
This has only to do with the clocking, no CMD6 is sent to select
high speed modes.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-13 11:23:45 +08:00
Ville Juven
ff05cc593f risc-v/mmu: Fix L3 mappings for kernel, and mpfs protected mode userspace
The L3 mapping function was just way too simplistic. Depending on memory
configuration it either works or not.

Noticed that with icicle:pnsh the software crashes due to instruction
page fault, reason is the map_region() implementation that does not
work for regions that are not aligned to 2MB (the L2 page size).

Implemented an extremely simplistic page table allocator for the L3
references, that should once and for all get rid of the L3 mapping issue.

NOTE: gran_alloc() cannot be used at this point, it is too early for it.
2022-09-12 18:01:08 +09:00
zhangyuan21
3b889d820f armv7-a/r: use SRS and RFE for exception handler 2022-09-11 10:50:37 +09:00
liangchaozhong
62cbd72149 remove access on /dev/usrsock in up_usrsock.c
Signed-off-by: liangchaozhong <liangchaozhong@xiaomi.com>
2022-09-10 13:08:22 +08: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
Eero Nurkkala
945e531eaf risc-v/mpfs: emmcsd: allow switching from SD to eMMC
If the system starts up using the SD-card, and later wants
to switch to use the eMMC, it's not going to happen. SD-card
will be kept selected within the FPGA making the transition
fail.

It's been possible to switch from eMMC to SD, but now the
transition is possible for both directions.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-09 21:40:35 +08:00
Victor Benso
2892f18f15 Fix some register's values, enable TWAI extended registers and add a missing prototype.
Also, replaced critical_sections with spinlocks.
2022-09-09 15:30:35 +08: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
Eero Nurkkala
5cedf1ef2a risc-v/mpfs: usb: fix usb restart
Issuing the following commands doesn't succeed:
  - conn
  - disconn
  - conn
This USB driver doesn't even disconnect without this patch.

If the USB driver has been started from another hart, closing it
will not disable the PLIC interrupt. This means it's possible many
harts get the USB interrupt and thus make the USB look very unstable.

Fix these problems by disconnecting the USB via the USB_POWER
register at shutdown and disabling the interrupt at shutdown. Also
clear the software internals via the mpfs_sw_setup() for the conn /
disconect loop to succeed.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-08 22:08:17 +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
ligd
94cf99f310 sim: fix signal crash in SMP mode
reproduce:
sim:smp
ostest

reason:
shouldn't do sim_sigdeliver() in irq handler

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-07 09:33:36 +09: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
Eero Nurkkala
4df8b16060 risc-v/mpfs: usb: provide more endpoints
The underlying hardware supports 9 endpoints:
  - EP0
  - 4x IN EPs
  - 4x OUT EPs

Currently the driver assumes every EP number is unique. This limits
the amount of EPs to 1 + 4 = 5. Utilize the EPs in such a manner
that all may be used.

Also fix a few error handling related bugs. Update the composite
driver to match the current situation as well.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-06 23:10:30 +08: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
Gustavo Henrique Nihei
c5785ee9d5 risc-v/esp32c3: Fix some UBSAN shift-out-of-bounds warnings
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-09-03 00:29:02 +08:00
Gustavo Henrique Nihei
a5b006a891 xtensa: Avoid including handlers when no coprocessor is available
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-09-02 23:43:16 +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
Masayuki Ishikawa
b7063427c8 arch: risc-v: Fix up_check_tcbstack() for CONFIG_ARCH_ADDRENV=y
Summary:
- I noticed that ps shows incorrect stack usage when running
  getprime in the background.
- With CONFIG_ARCH_ADDRENV=y, a user task including pthread
  allocates its stack in the user space that needs to be
  accessed with a correct address environment.
- This commit fixes this issue.

Impact:
- CONFIG_ARCH_ADDRENV=y only

Testing:
- Tested with rv-virt:knsh64 on qemu-6.2

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-31 09:20:36 +08:00
Masayuki Ishikawa
e2f0f431d9 arch: risc-v: Assign dedicated virtual addresses for text and heap
Summary:
- Current RISC-V/NuttX implementation assumes that text/data/heap
  areas are continuous. In fact, CONFIG_ARCH_TEXT_VBASE and
  CONFIG_ARCH_HEAP_VBASE are not used for memory allocation.
- This commit assigns dedicated virtual addresses for text and heap
  which are the same approach to ARM-v7A/NuttX implementation.

Impact:
- None

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

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-30 22:52:01 +08:00
Huang Qi
f93964ad3c riscv: Dump trap val in exception handler
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-30 14:55:33 +08:00
Eero Nurkkala
3665180795 risc-v/mpfs: usb: fix cppcheck findings
Fix the following cppcheck findings. Privreq may be NULL,
thus perform checks before using its member variables.

Checking mpfs_usb.c ...
mpfs_usb.c:1093:12: warning: Possible null pointer dereference: privreq [nullPointer]
      if ((privreq->inflight > 0) && (count != 0) &&
           ^
mpfs_usb.c:1090:21: note: Assignment 'privreq=NULL', assigned value is 0
          privreq = NULL;
                    ^
mpfs_usb.c:1093:12: note: Null pointer dereference
      if ((privreq->inflight > 0) && (count != 0) &&
           ^
mpfs_usb.c:1138:3: warning: Possible null pointer dereference: privreq [nullPointer]
  privreq->req.xfrd = 0;
  ^
mpfs_usb.c:1130:21: note: Assignment 'privreq=NULL', assigned value is 0
          privreq = NULL;
                    ^
mpfs_usb.c:1138:3: note: Null pointer dereference
  privreq->req.xfrd = 0;
  ^
mpfs_usb.c:1139:3: warning: Possible null pointer dereference: privreq [nullPointer]
  privreq->inflight = privreq->req.len;
  ^
mpfs_usb.c:1130:21: note: Assignment 'privreq=NULL', assigned value is 0
          privreq = NULL;
                    ^
mpfs_usb.c:1139:3: note: Null pointer dereference
  privreq->inflight = privreq->req.len;
  ^
mpfs_usb.c:1140:50: warning: Possible null pointer dereference: privreq [nullPointer]
  priv->eplist[epno].descb[0]->addr = (uintptr_t)privreq->req.buf;
                                                 ^
mpfs_usb.c:1130:21: note: Assignment 'privreq=NULL', assigned value is 0
          privreq = NULL;
                    ^
mpfs_usb.c:1140:50: note: Null pointer dereference
  priv->eplist[epno].descb[0]->addr = (uintptr_t)privreq->req.buf;

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-08-30 01:41:28 +08:00
Eero Nurkkala
90d9b6b8ac risc-v/mpfs: usb: fix infinite loop issue
mpfs_write_tx_fifo() gets stuck in the following case:
  - CDCACM is used
  - ttyACM0 is opened and then closed from the remote end,
    such as Linux or Windows
  - data is written into ttyACM0 from NuttX
  - tx fifo will never get empty and the system is stuck

Fix this by issuing an error code if the transmit fifo doesn't
proceed as expected. The error code is then propagated into
higher level keeping the system functional.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-08-29 21:35:54 +08:00
chengkai
b352a625bf arch/sim: add bth4 bridge codes
Signed-off-by: chengkai <chengkai@xiaomi.com>
2022-08-27 22:38:43 +08: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
Gustavo Henrique Nihei
a5fd1140cb arch/xtensa: Remove non-existent ARCH_HAVE_TESTSET support for ESP32-S2
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-08-27 06:14:57 +02:00
Fotis Panagiotopoulos
4b6d4de972 sim: Added gcov dump on application exit. 2022-08-26 23:58:30 +08:00
yangxuan8282
2d32ebe952 arch/arm/src/stm32f7/stm32_otghost.c: fix syslog formats 2022-08-26 20:46:50 +08:00
Gustavo Henrique Nihei
2fb8af0c20 xtensa: Refactor up_fpucmp to only consider enabled coprocessors
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-08-26 11:57:06 +08:00
Gustavo Henrique Nihei
fe2d37aa33 xtensa: Fix allocation of FPU registers in exception context
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-08-26 11:57:06 +08:00
Gustavo Henrique Nihei
5ed2ee85c9 arch: Improve documentation for up_fpucmp function
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-08-26 11:57:06 +08:00