Commit Graph

19549 Commits

Author SHA1 Message Date
Gustavo Henrique Nihei
e31e69aa30 xtensa: Fix comparison result for up_fpucmp function
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-08-26 11:57:06 +08:00
Eero Nurkkala
71ace555f2 risc-v/mpfs: ihc: fix performance issue
nxsig_usleep() will wait for the next timer tick which is way
too much here. It's not sleeping 100 us, but rather, near 1/60 s.

This causes severe performance problems. Fix this by polling the
register for a while if the remote end is busy.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-08-26 02:12:26 +08:00
chao.an
9cb17841d8 net/sockopt: move BINDTODEVICE to socket level
rename the UDP_BINDTODEVICE to SO_BINDTODEVICE to follow the linux
style to be compatible with non-UDP protocol binding requirements

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-25 17:56:52 +08:00
Masayuki Ishikawa
50177dbae1 arch: common: Fix arm_allocateheap.c for BUILD_KERNEL
Summary:
- I noticed that the kernel heap area overlaps the PGPOOL
- This commit fixes this issue

Impact:
- None

Testing:
- Tested with sabre-6quad:netknsh

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-25 13:38:47 +08:00
Huang Qi
e4e3208180 Replace all strncpy with strlcpy for safety
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-25 13:38:36 +08:00
Gustavo Henrique Nihei
96f77cb6a6 xtensa/esp32s3: Fix alignment of FPU registers in exception context
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-08-25 10:07:25 +08:00
Nathan Hartman
1d622b6f79 arch/tiva: Fix typo and minor code formatting 2022-08-24 21:29:18 +02:00
chao.an
da6d526e9c arch/sim: fix visual studio Linker Tools Error LNK2019
nuttx_all.lib(up_initialstate.obj) : error LNK2019:
  unresolved external symbol '___builtin_frame_addres' referenced in function '_up_getsp'

Return stack pointer from esp

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-24 21:59:07 +08:00
Jukka Laitinen
c7a904fa12 arch/risc-v/src/mpfs: Fixes for MSSIO GPIO configurations
- Clarify the macros MSSIO_EC_DEFAULT and MSSIO_EC_USB_DEFAULT
- Remove PULLDOWN bit from MSSIO_EC_DEFAULT, it was on by accident
- Fix some EC configuration macros; DRVSTR was wrong, clean up the others
- Define GPIO_PULLUP and GPIO_PULLDOWN like on many other platforms

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-08-24 19:25:05 +08:00
chao.an
a93b703994 arch/sim/wchar_t: fix visual studio Compiler Error C2371
type of 'wchar_t' confilt with vcruntime:

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include\vcruntime.h(228,28):
  error C2371: 'wchar_t': redefinition; different basic types
D:\code\incubator-nuttx\include\sys/types.h(174): message : see decaration of 'wchar_t'

typedef wchar_t as unsigned char to compatible with vcrtuntime

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-24 16:52:03 +08:00
Eero Nurkkala
d940d55ee4 risc-v/mpfs: ihc: update vq ids
Since the commit cf22dd8 (related to OpenAMP update), the notifyid
is no longer NOTIFY_ALL, but the vq id.

Utilize the vq id now properly as it's being provided. However,
vq id 0 generates action.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-08-24 02:35:00 +08:00
Xiang Xiao
d22e1e1998 compiler.h: Add nosanitize_address macro
and replace all __attribute__((no_sanitize_address)) with it

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-23 17:50:52 +02:00
Xiang Xiao
c44a7cbf88 arch: Add ARCH_COVERAGE_ALL option
so the user could disable the full image instrumentation,
but enable the instrumentation by files or directories.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-23 17:50:52 +02:00
Xiang Xiao
f1355680ca mm/kasan: Add MM_KASAN_ALL option
so the user could disable the full image instrumentation,
but enable the instrumentation by files or directories.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-23 17:50:52 +02:00
Xiang Xiao
f3f1dde39b arch/sim: Assign virtio vring notifyid to RSC_NOTIFY_ID_ANY
let framework allocate the unique id for us instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-23 17:21:37 +02:00
Xiang Xiao
0334819742 net/usrsock: Change xid from uint64_t to uint32_t
by generating the new xid for each transaction

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-23 12:16:33 -03:00
chao.an
62977ec4e8 arch/sim: add windows host simulate support
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-23 22:04:42 +08:00
chao.an
a10add60ae sim/host: move host implement to posix directory
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-23 22:04:42 +08:00
Xiang Xiao
b60704614e arch/sim: set CMDLINE env to the argument user pass to nuttx
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-22 17:53:29 +03:00
chao.an
eb9cfefc1b sched: fix visual studio compiler error
GCC __attribute__ is not fully compatible with MSVC, In the MSVC
environment the programmer typically explicitly exports function/class
symbols via the MSVC-specific __declspec(dllexport) modifier.

D:\code\incubator-nuttx\arch\sim\src\sim\up_head.c(107,15):
  error C2143: syntax error : missing ')' before '('
  [D:\code\n3\incubator-nuttx\vs2022\up_head.vcxproj]

Reference:
https://docs.microsoft.com/en-us/cpp/cpp/dllexport-dllimport?view=msvc-170

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-22 20:00:42 +08:00
yangxuan8282
8a8c268e6b arch/arm/src/stm32f7/Kconfig: add STM32F7_SYSCFG 2022-08-22 17:31:49 +08:00
yangxuan8282
78f44e7769 arch/arm/src/stm32f7/stm32_otg.h: fix stm32_otghost_initialize definition 2022-08-22 17:31:38 +08:00
Huang Qi
a06ec54cd0 debug: Introduce portion of UBSan
without UBSan
```
 text    data     bss     dec     hex filename
  85612     208  142258  228078   37aee nuttx
```

with UBSan:
```
   text    data     bss     dec     hex filename
 194290   98164  208634  501088   7a560 nuttx
```

```c
int main(int argc, FAR char *argv[])
{
  uint32_t ptr[32];
  printf("Hello, World!! %lu\n", ptr[64]);
  return 0;
}
```
Try to run this sample:
```
nsh> hello
ubsan_prologue: ================================================================================
ubsan_prologue: UBSAN: array-index-out-of-bounds in hello_main.c:39:37
__ubsan_handle_out_of_bounds: index 64 is out of range for type 'uint32_t [32]'
ubsan_epilogue: ================================================================================
Hello, World!! 1070182368
nsh>
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-22 13:57:29 +08:00
Masanari Iida
49c50d3bf4 arch/ceva: Add missing comma
This patch fixes following error, fond by cppcheck.

up_hardfault.c:103:0: error: failed to expand 'hfdumpreg4',
 Wrong number of parameters for macro 'hfdumpreg4'

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
2022-08-20 16:37:42 +08:00
Masanari Iida
bd584332a4 rp2040: Add missing comma in rp2040_i2c_slave.c
This patch fixes missing comma, found by cppcheck.

rp2040_i2c_slave.c:259:0: error: failed to expand 'modbits_reg32',
 Wrong number of parameters for macro 'modbits_reg32'.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
2022-08-20 16:37:32 +08:00
yangxuan8282
df6e3d1349 arch/arm/src/stm32f7/stm32_otghost.c: fix undeclared ret 2022-08-19 21:02:02 +08:00
Cis van Mierlo
2c42b93962 S32K1xx: Fixed PM bug for clockconfig 2022-08-19 06:01:30 -07:00
Daniel P. Carvalho
7518beee2e STM32L4 ADC: Change the way that hardware trigger configuration word for regular and injected channels are done. 2022-08-18 11:26:25 -03:00
Ville Juven
75ba9001bc risc-v/mpfs: Make entrypoint table run-time configurable
Default values still come from configuration, but this gives the option
to modify the per-hart entrypoints.
2022-08-18 21:50:53 +08:00
Michał Łyszczek
4e967c67b4 stm32wl5: fix unbuffered mode and other possible bugs
This patch fixes unbuffered mode so it actually works.

Also, patch contains fixes for possible bugs that could result in
deadlock or system hang in certain situations.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2022-08-18 11:46:38 +08:00
Michał Łyszczek
cc08ae67cb stm32wl5_pwr: add support to boot second CPU (cortex-m0)
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2022-08-18 11:46:38 +08:00
curuvar
74f1bfbfd7 Added support for Raspberry Pi Pico W 2022-08-17 19:03:19 -03:00
Eero Nurkkala
a1ff841ca4 risc-v/mpfs: ihc: don't use semaphores with OpenSBI vendor calls
OpenSBI vendor extension calls must not cause scheduling, as they're
part of M-mode trap handling. Thus, comment out nxsig_usleep() as
well, which is occasionally taken and crashes the system in that
case. Fix this by commenting out lines that have the potential to
cause scheduling.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-08-17 18:33:32 +08:00
raiden00pl
6d1646625a arch/arm/src/stm32f7: port FOC driver from arch/stm32 2022-08-15 13:39:08 +02:00
Xiang Xiao
a02101efff arch/sim: Remove up_smpsignal.o and up_touchscreen.o from REQUIREDOBJS
since it isn't required anymore

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-15 10:41:46 +03:00
Masayuki Ishikawa
548540eb13 arch: qemu-rv: Fix high CPU usage in SMP mode
Summary:
- I noticed that QEMU shows high CPU usage if the number of
  CPUs does not match the kernel configuration. (e.g. -smp 8
  and CONFIG_SMP_NCPUS=2)
- This commit fixes this issue.

Impact:
- qemu-rv only

Testing:
- Tested with the following configs
  - rv-virt:smp64 (CONFIG_NCPUS=1/2/8)
  - rv-virt:nsh64

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-13 22:41:42 +03:00
Tiago Medicci Serrano
ab60d0d3fb Framebuffer's callback buffer starts from the area being drawn.
The commit 664d45dcba updated the
behavior of the framebuffer's putarea callback enabling it to be
used to draw a particular area of the display. Previously, putarea
was only used to draw the entire area of the display. Any different
area was drawn, row by row, by putrun. Also, before checking for
which callback to call, the framebuffer driver adjusted the buffer
reference that was going to be used for calling the driver's callback
to point to the init of the relevant data. After that commit, the
framebuffer's buffer reference passed to the driver's putarea now
contains the data to draw the entire display. Unlike the previous
version of that implementation, only the putrun's callback buffer
was being referenced from the address that contains the data that
actually is being drawn.

This commit fixes it by adjusting the reference for the run buffer
passed to the putrun/putarea callback. It always starts from the
beginning of the relevant data that is actually being drawn. That is
necessary because lcddev (which uses the same LCD display driver
callbacks) actually don't allocate a buffer containing the data to
draw the whole display, so the same putarea implementation of the
LCD drivers would'n be able to work for both lcddev and framebuffer.
Also it's necessary to pass the stride argument to the LCD drivers
in order to enable them to do partial writes by calculating the
buffer offset while sending row-by-row. The stride is equal the
width multiplied by the bytes per pixel (may add some padding)
for framebuffer and is equal to the lenght of the row being drawn
(multiplied by the same BPP) for lcddev.

Why this approach?
Other possible approaches would be:
1) modify lcddev driver to translate received buffer data to a
buffer similar to the framebuffer. That wouldn't be efficient
considering memory allocation.
2) Create a new callback function. While possible, it'd be confusing
to create a different callback to draw the whole screen and another
to draw only an area of the screen. Also, these callbacks would
differ themselves only from the way the buffer is filled.
3) Simply reverting 664d45dcba would
break the usage of the putarea callback to draw an area of the
display, which would also be inefficient.

This approach is based on the Zephyr's implementation of the ST7789
driver: the buffer starts from the beginiing of the region that would
be drawn. The display device driver's putarea implementation should
check if the operation refers to a full screen/full row and implement
(if possible) a single operation to send the data to be drawn more
efficiently.

Finally, this approach requires that the drivers which implement
the putarea callback and expects the entire framebuffer buffer
to be modified. They don't need to calculate where the data begins
as the new buffer represents the data from the address that is
actually being drawn. This includes adjusting the LCD drivers
GC9A01 and ST7789 and the driver for APA102-based LED matrix display.
2022-08-13 20:36:45 +08:00
Xiang Xiao
2b37909c9e libc: Move crc8.h, crc16.h and crc32.h from include to include/nuttx
to avoid the conflict with the 3rd party library

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-13 13:28:24 +03:00
Masayuki Ishikawa
690c178e4b arch: imx6: Apply the imxrt_enet.c changes to imx_enet.c (4/4)
Summary:
- This commit applies the following imxrt_enet.c changes to imx_enet.c

  commit 0628019c2c
  Author: David Sidrane <David.Sidrane@NscDg.com>
  Date:   Wed Jul 13 11:01:49 2022 -0700

      imxrt:Enet ensure proper dcache for Writeback mode

Impact:
- imx_enet.c

Testing:
- Tested with qemu-6.2

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-12 10:30:48 -04:00
Masayuki Ishikawa
fb8562763a arch: imx6: Apply the imxrt_enet.c changes to imx_enet.c (3/4)
Summary:
- This commit applies the following imxrt_enet.c changes to imx_enet.c

  commit 522a949ed5
  Author: David Sidrane <David.Sidrane@NscDg.com>
  Date:   Wed Jul 13 11:00:11 2022 -0700

      imxrt:enet Better interrupt state handeling

- NOTE: I also fixed typo and compile error in the above commit

Impact:
- imx_enet.c

Testing:
- Tested with qemu-6.2

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-12 10:30:48 -04:00
Masayuki Ishikawa
6dfd01885d arch: imx6: Apply the imxrt_enet.c changes to imx_enet.c (2/4)
Summary:
- This commit applies the following imxrt_enet.c changes to imx_enet.c

  commit 81f03a9151
  Author: David Sidrane <David.Sidrane@NscDg.com>
  Date:   Tue Mar 15 14:27:51 2022 -0700

     imxrt:ETH Add Support for ETH2

Impact:
- imx_enet.c

Testing:
- Tested with qemu-6.2

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-12 10:30:48 -04:00
Masayuki Ishikawa
4e4ebba306 arch: imx6: Apply the imxrt_enet.c changes to imx_enet.c (1/4)
Summary:
- This commit applies the following imxrt_enet.c changes to imx_enet.c

  commit 12a515ebb6
  Author: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>
  Date:   Thu Feb 4 11:27:09 2021 +0900

      arch: imxrt: Introduce CONFIG_NET_GUARDSIZE to imxrt_enet.c

Impact:
- imx_enet.c

Testing:
- Tested with qemu-6.2 (defconfig will be updated later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-12 10:30:48 -04:00
Robert Middleton
5d12e350da pic32mx: add option to disable JTAG at runtime
Add a new option to optionally disable JTAG at runtime.  Defaults to enabling
JTAG at runtime as that is the state the processor comes up in.
2022-08-11 11:24:41 -03:00
Alan Carvalho de Assis
0b4ef1406d xtensa/esp32s2: Add basic support to SPI 2022-08-11 15:49:55 +03:00
Petro Karashchenko
27fe5a50c6 arch/arm/stm32f7: fix cache invalidation issue in Ethernet RX
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-08-11 03:40:25 -04:00
Petro Karashchenko
4cd7e33b8d arch/arm/samv7: fix compilation warnings
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-08-11 10:00:39 +08:00
Petro Karashchenko
49d26e1b50 arch/arm/samv7: get TX DMA running for HSMCI interface
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-08-11 10:00:39 +08:00
Ville Juven
b8b541fbf5 mpfs: Remove the ddrstorage section from the OpenSBI package
It is not really needed; g_hart_stacks is only used during SBI init as
a temporary stack area. We can use the scratch area buffers for this, as
the scratch areas define almost 4K of extra space, which is used for
exception stacks anyway.
2022-08-10 10:01:47 +03:00
David Sidrane
32c4bdb7a6 s32k1xx:LPI2C Add DMA support 2022-08-10 11:22:38 +08:00
raiden00pl
08b8234e9e arch/arm/src/stm32f7: port ADC driver from arch/stm32
This change adds support for the following features:
  - injected channels (default: 0)
  - ADC resolution (default: 12bit)
  - ADC low-level operations
  - ADC external triggers
  - custom ADC interrupts
  - ADC sample time configuration
  - configurable ADC SCAN mode (default on if DMA)
  - configurable ADC DMA mode (default: one shot mode)
  - reset the ADC block only if all ADC instances are closed
2022-08-10 02:03:51 +08:00