Commit Graph

49276 Commits

Author SHA1 Message Date
raiden00pl
d205c8c0e0 arch/stm32f7: fixes for pinmap 2023-05-12 11:43:08 +08:00
Lwazi Dube
38ba0aefca usbhost_hub: Prevent crash when the last hub port is used.
An off-by-one error caused invalid memory to be accessed when the
last port was used. The first entry, at index 0, was never used.
The USB standard uses 1-based numbering for hub ports. This number
was used to index an array. This change converts the port number to
a zero-based port index when the array is accessed. The zero-based
value in the port field of the usbhost_hubport_s structure is also
converted before printing.

For testing, this bug was exposed on a 4 port hub when port 4 was
used after changing USBHUB_MAX_PORTS to 4 in hub.h. The bug should
also be triggered without changing hub.h if a 7 port hub is
available.
2023-05-12 11:41:26 +08:00
Alan Carvalho de Assis
694e6f550b esp32xx: Workaround to avoid printing serial trash character
During the serial reconfiguration from bootloader to the
NuttX a trash character "?" (Unicode replacement U+FFFD)
was printed in the screen.

This fix was discovered by Sylvio Alves from Espressif!
2023-05-12 06:30:35 +03:00
Alan Carvalho de Assis
54d92d1a0f Fix typo -EACESS -> -EACCES 2023-05-12 06:29:35 +03:00
Fotis Panagiotopoulos
4231938892 rtc: Fix compiler warning in driver initialization. 2023-05-11 22:18:10 +03:00
Tiago Medicci Serrano
e8e50900d0 esp32c3/wifi: use wapis init config to save Wi-Fi data
Instead of using Espressif's emulated NVS to save Wi-Fi data, use
`wapi`s wireless configure initialization mechanism for saving
Wi-Fi data. It 1) avoids creating a specific storage partition
just to save Wi-Fi data (ESP32-C3's storage partition is used
instead); 2) avoids initialization problems of the emulated NVS
when SMP is enabled (the Wi-Fi driver tries to initialize it before
the actual partition is initialized); and 3) enables reconnecting
using `wapi reconnect` command and connect the device automatically
on bringup if `CONFIG_NETUTILS_NETINIT` is selected.
2023-05-12 01:09:09 +08:00
Tiago Medicci Serrano
3e07477c85 esp32/wifi: use wapis init config to save Wi-Fi data
Instead of using Espressif's emulated NVS to save Wi-Fi data, use
`wapi`s wireless configure initialization mechanism for saving
Wi-Fi data. It 1) avoids creating a specific storage partition
just to save Wi-Fi data (ESP32's storage partition is used
instead); 2) avoids initialization problems of the emulated NVS
when SMP is enabled (the Wi-Fi driver tries to initialize it before
the actual partition is initialized); and 3) enables reconnecting
using `wapi reconnect` command and connect the device automatically
on bringup if `CONFIG_NETUTILS_NETINIT` is selected.
2023-05-12 01:09:09 +08:00
Tiago Medicci Serrano
b680abd04b esp32s3/wifi: use wapis init config to save Wi-Fi data
Instead of using Espressif's emulated NVS to save Wi-Fi data, use
`wapi`s wireless configure initialization mechanism for saving
Wi-Fi data. It 1) avoids creating a specific storage partition
just to save Wi-Fi data (ESP32-S3's storage partition is used
instead); 2) avoids initialization problems of the emulated NVS
when SMP is enabled (the Wi-Fi driver tries to initialize it before
the actual partition is initialized); and 3) enables reconnecting
using `wapi reconnect` command and connect the device automatically
on bringup if `CONFIG_NETUTILS_NETINIT` is selected.
2023-05-12 01:09:09 +08:00
pengyiqiang
26e99ed042 drivers/video/fb: adapt to fbmem dynamic update.
Considering that the future fb needs to achieve dynamic resolution, the address and size of fbmem will be redistributed on the bottom driver side, so remove fbmem, fblen, and bpp cached in fb_chardev_s, and change it to call getplaneinfo every time to re-acquire panel info from the bottom driver. Avoid cache coherency problems.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-05-12 01:06:52 +08:00
zhangyuan21
f132edbf35 libc/sched: Return EINVAL when type incorrect at task_setcanceltype
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_setcancelstate.html

The pthread_setcancelstate() function may fail if:

[EINVAL]
The specified state is not PTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE.
The pthread_setcanceltype() function may fail if:

[EINVAL]
The specified type is not PTHREAD_CANCEL_DEFERRED or PTHREAD_CANCEL_ASYNCHRONOUS.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-05-12 01:06:23 +08:00
zhangyuan21
962dfaf651 libc/pthread: Return EINVAL when input parameter incorrect at pthread_once
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_once.html

If an implementation detects that the value specified by the once_control
argument to pthread_once() does not refer to a pthread_once_t object
initialized by PTHREAD_ONCE_INIT, it is recommended that the function
should fail and report an [EINVAL] error.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-05-12 01:06:23 +08:00
zhangyuan21
ff6ba02378 sched/pthread: return ESRCH when thread not found at pthread_detach
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_detach.html

If an implementation detects that the value specified by the thread argument
to pthread_detach() does not refer to a joinable thread, it is recommended
that the function should fail and report an [EINVAL] error.

If an implementation detects use of a thread ID after the end of its lifetime,
it is recommended that the function should fail and report an [ESRCH] error.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-05-12 01:06:23 +08:00
raiden00pl
0623300b49 boards/stm32h7: rework boards to not use CONFIG_STM32H7_USE_LEGACY_PINMAP=y
In reference to PR #8992
2023-05-12 01:04:48 +08:00
Fotis Panagiotopoulos
36ac812114 sim: Fixes the following linker warning:
ld: warning: arch_setjmp_x86_64.o: missing .note.GNU-stack section implies executable stack
ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: warning: nuttx.rel: requires executable stack (because the .note.GNU-stack section is executable)

The linker is instructed to make the stack non-executable with the
switch: `-z noexecstack`.

More information can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ffcf9c5700e49c0aee42dcba9a12ba21338e8136
2023-05-11 14:04:34 -03:00
simbit18
bf9b8dfbfe sched: Fix nxstyle errors
error: Long line found
2023-05-11 11:25:58 -03:00
Lwazi Dube
d66282a893 usbhost: Fix function address generation for multi-port root hubs.
Devices connected to the same USB bus should have unique function addresses.
This was not true for root hubs with multiple ports. After this change,
enumeration is more reliable on the sama5d3-xplained board when both root hub
ports are used.

This change amounts to using one usbhost_devaddr_s object per root hub
instead of one per root hub port. For the majority of boards only one
root hub port is available so no change in behavior should be expected.
2023-05-11 09:44:18 +02:00
Lee Lup Yuen
4ed48c33e9 arm64/a64: Add support for Multiple UART Ports
Currently only Port UART0 is supported for Allwinner A64. This PR adds support for all UART Ports: UART1 to UART4. (Except R-UART, which is a special low-power UART)

This is required for the upcoming LTE Modem Driver (Quectel EG25-G) for PINE64 PinePhone, which uses UART3. [(Details here)](https://lupyuen.github.io/articles/lte2)

The code was adapted from the NuttX UART Driver for Allwinner A1X: [`a1x_serial.c`](https://github.com/apache/nuttx/blob/master/arch/arm/src/a1x/a1x_serial.c)

`arch/arm64/src/a64/a64_serial.c`: Added ports UART1 to UART4, based on [`a1x_serial.c`](https://github.com/apache/nuttx/blob/master/arch/arm/src/a1x/a1x_serial.c)

`arch/arm64/src/a64/a64_serial.h`: Added IRQs for UART1 to UART4. Moved UART Base Addresses to `a64_memorymap.h`

`arch/arm64/src/a64/hardware/a64_memorymap.h`: Added UART Base Addresses for UART0 to UART4

`arch/arm64/src/a64/Kconfig`: Added UART1 to UART4 to Allwinner A64 Peripheral Selection menu

`boards/arm64/a64/pinephone/configs/lcd/defconfig`, `lvgl/defconfig`, `nsh/defconfig`, `sensor/defconfig`: Fixed `UART1_SERIAL_CONSOLE` to `UART0_SERIAL_CONSOLE`
2023-05-11 09:41:18 +02:00
Tiago Medicci Serrano
4f4a00ab1f net/local: fix blocking local sockets
Commit 4d6a8663fa made pipes and
named pipes block when opening for O_WRONLY or O_RDONLY. Local
sockets, however, require `local_open_client_tx` to be non-blocking
to enable the server side to prevent the server side from blocking.
If set otherwise, it would deadly block. This commit sets the FIFO
as non-blocking temporarily, open the TX side and, if originally
blocking - restores it to that state.
2023-05-11 11:39:00 +08:00
zhanghongyu
91e13c47ae net: remove conn-related casts
remove redundant casts associated with psock

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-10 19:32:09 -03:00
Lucas Saavedra Vaz
a895cd4854 arch/xtensa/esp32s2: Define syscall table to enable using ROM functions
This commit aims to enable the use of ROM functions on ESP32-S2.
This is done by creating the required syscall stubs table and adding the missing symbols to the linker script.
2023-05-10 15:39:44 -03:00
Lucas Saavedra Vaz
274a79fd34 arch/xtensa/esp32: Define syscall table to enable using ROM functions
This commit aims to enable the use of ROM functions on ESP32.
This is done by creating the required syscall stubs table and adding the missing symbols to the linker script.
2023-05-10 15:39:44 -03:00
simbit18
53d0d04e8e arch/risc-v/src/esp32c6/Kconfig: Fix help attribute
Replace help => ---help---
2023-05-10 22:51:11 +08:00
simbit18
2909260f91 arch/arm64/Kconfig: Fix help attribute
Replace help => ---help---
2023-05-10 22:51:11 +08:00
simbit18
f12b9c44cb drivers/power/relay/Kconfig: Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2023-05-10 22:51:11 +08:00
simbit18
f5514a1113 arch/xtensa/src/esp32/Kconfig: Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2023-05-10 22:51:11 +08:00
simbit18
e320299ba7 drivers/audio/Kconfig: Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2023-05-10 22:51:11 +08:00
simbit18
0149fa05ad boards/arm/tlsr82/tlsr8278adk80d/Kconfig: Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2023-05-10 22:51:11 +08:00
simbit18
22a5f3968e boards/arm/sama5/jupiter-nano/Kconfig: Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2023-05-10 22:51:11 +08:00
simbit18
ce990081b6 boards/arm/stm32/stm32f411-minimum/Kconfig: Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2023-05-10 22:51:11 +08:00
Dong Heng
9ae2fa2b54 xtensa/esp32s3: Fix code style of esp32s3_psram_octal.c 2023-05-10 10:55:20 -03:00
simbit18
eedca9d7c6 libs/libc/pthread: Fix nxstyle errors
error: Long line found
2023-05-10 13:04:35 +02:00
Takumi Ando
08eef2a700 stm32f0l0g0: Fix GPIO port definitions
These series have the following GPIO ports:
- STM32F03X: A to D, and F
- STM32F05/07/09X: A to F
- STM32G0X: A to F
- STM32L0X: A to E, and H

Signed-off-by: Takumi Ando <t-ando@advaly.co.jp>
2023-05-10 18:01:07 +08:00
Takumi Ando
94eb8a0ee0 stm32f0l0g0: Add GPIOE to STM32G0x
All STM32G0x series have 6 GPIO ports A to F.

Refered: RM0444, RM0454

Signed-off-by: Takumi Ando <t-ando@advaly.co.jp>
2023-05-10 18:01:07 +08:00
zhanghongyu
e0816ff050 in.h: add SOL_IPV6 protocol-level socket option IPV6_RECVHOPLIMIT
added IPV6_RECVHOPLIMIT support so that fd of SOCK_RAW ICMPV6 can obtain ttl
information, some network related tools use this feature.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-10 18:00:15 +08:00
raiden00pl
7ab42f115e nucleo-h743zi/stm32_bringup: cosmetics 2023-05-10 17:59:20 +08:00
raiden00pl
0e334f0ba9 boards/nucleo-h743zi: enable HSI48 for OTG host example, otherwise it won't work 2023-05-10 17:59:20 +08:00
Filipe Cavalcanti
bf6f842aea boards/arm/tiva: bmp280 driver binding to tm4c1294 2023-05-10 17:59:01 +08:00
Ville Juven
1e9560e1e5 net/net_cmsg.c: Fix warning about using void* arithmetics
utils/net_cmsg.c: In function 'cmsg_append':
utils/net_cmsg.c:82:23: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith]
   82 |   msg->msg_control    += cmsgspace;
      |                       ^~
cc1: all warnings being treated as errors

Using void pointers in arithmetic operations is a GCC extension, it is
not supported by the standard. Because what is the size of a void ?
2023-05-10 17:58:25 +08:00
Dong Heng
3161005c40 xtensa/esp32: Fix himem driver crash in SMP mode 2023-05-10 17:56:38 +08:00
hujun5
d0139d1206 arch/arm64: change config order
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-10 09:06:59 +02:00
hujun5
6e71527af2 arch/arm64: 64 bit platform compile error reported
compile error log:
common/arm64_arch_timer.c: In function 'arm64_tick_max_delay':
common/arm64_arch_timer.c:178:12: error: conversion from 'long unsigned int' to 'clock_t' {aka 'unsigned int'} changes value from '18446744073709551615' to '4294967295' [-Werror=overflow]
  178 |   *ticks = UINT64_MAX;
      |            ^~~~~~~~~~

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-10 09:06:59 +02:00
hujun5
7f4cb3057a arch/arm64: merge serial_pl011.c and qemu_serial.c
At present, the serial drivers qemu_serial.c and serial_pl011.c on the fvp-v8r and qemu platforms in arm64 are duplicated
and need to be merged. The plan is to place them under the drivers\serial directory to create a common code module,
so that both fvp-v8r and qemu can use the same code.
In the future, if new platforms use pl011 serial ports, they can also be directly reused

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-10 09:06:59 +02:00
minjian.tang
5ff1e85947 boardctl: add BOARDIOC_SOFTRESETCAUSE_RESTORE_FACTORY_INQUIRY
RESTORE_FACTORY used to reset the device
FACTORY_INQUIRY used to reset the device but need user confirmed.

Signed-off-by: minjian.tang <minjian.tang@aqara.com>
2023-05-10 13:40:19 +08:00
Roberto Bucher
6c42928cd6 Modifications for the EMB control board 2023-05-10 03:36:23 +08:00
simbit18
4720162a97 arch/z80/src: Fix nxstyle errors
error: Long line found
2023-05-10 00:47:41 +08:00
gaojiawei
64b51bbbf7 driver/serial/pty.c fix update local flags for the pty device attribute
Signed-off-by: gaojiawei <gaojiawei@xiaomi.com>
2023-05-10 00:47:33 +08:00
David Sidrane
8068dc0238 stm32h7:sdmmc It is not an error if no wait was needed
If the CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE is enabled and the
   card is found to be ready in the waitenable call. Then
   we do not need a Watchdog nor to configure the pin for
   IRQ to detect ready.

   This was reported as an error, and it is not, it simply means
   we do not have to wait.
2023-05-10 00:46:44 +08:00
simbit18
fcb6c6fccc boards/arm/samv7/common/Kconf Fix indentationig
Remove spaces from Kconfig
Add TABs
2023-05-10 00:45:29 +08:00
simbit18
e01a46c8c3 arch/risc-v/src/qemu-rv/Kconfig: Fix indentation
Remove spaces from Kconfig
Add TABs
2023-05-10 00:45:29 +08:00
simbit18
4452ee0743 arch/risc-v/src/mpfs/Kconfig: Fix indentation
Remove spaces from Kconfig
Add TABs
2023-05-10 00:45:29 +08:00