Commit Graph

15025 Commits

Author SHA1 Message Date
TimJTi
4aada75249 Changes to allow board-specific DRP/OTG support
Update sam_udphs.c
2023-02-09 03:42:55 +08:00
Ville Juven
9ac3e841da group_addrenv: Fix call to group_addrenv for targets that don't need it 2023-02-09 00:14:52 +08:00
Nathan Hartman
8b2c8c73e8 arch/tiva: Serial TIOCxBRK BSD-compatible BREAK support
In the lower half UART driver for Tiva architecture (TM4C12x), adding
the TIOCxBRK ioctl calls, which allow an application to transmit a BSD
compatible line BREAK. TIOCSBRK starts the BREAK and TIOCCBRK ends it.

This architecture supports BSD-style BREAK in hardware. We write to
the BRK bit (bit 0) of the UART Line Control register (UARTLCRH) to
start the BREAK, which begins after the UART finishes shifting out the
current character in progress, if any, including its stop bit(s), and
continues indefinitely until we write to the BRK bit again to stop the
BREAK.

* arch/arm/src/tiva/Kconfig
  (config TIVA_UART_BREAKS): New. Appears as CONFIG_TIVA_UART_BREAKS
   in code.

* arch/arm/src/tiva/common/tiva_serial.c
  (struct up_dev_s): Add new field 'brk' to indicate line break in
   progress when built with CONFIG_TIVA_UART_BREAKS.
  (up_ioctl): Add cases for TIOCSBRK to turn BSD-compatible break on
   unconditionally and TIOCCBRK to turn break off unconditionally.
  (up_txint): Block enabling TX interrupt if line break in progress.
   This is similar to the STM32F7 implementation.
2023-02-08 23:55:28 +08:00
Nathan Hartman
5d2e1d40dc arch/tiva: Fix inability to control serial CTS/RTS via termios
* arch/arm/src/tiva/common/tiva_serial.c:
  (up_ioctl): PR #8406 (commit 1edec0aaa1) added support for
   configuring the serial port's CTS/RTS flow control at runtime using
   termios when built with CONFIG_SERIAL_TERMIOS and either or both of
   CONFIG_SERIAL_OFLOWCONTROL and CONFIG_SERIAL_IFLOWCONTROL. However,
   a runtime sanity check left over from before prevented this from
   working: When processing ioctl TCSETS, we would return -EINVAL if
   one or both of CCTS_OFLOW and CRTS_IFLOW were requested, which was
   not deserved if the requested features were in fact supported.
   Fixing the sanity check so it depends on features actually
   configured.
2023-02-08 10:31:11 +08:00
Nathan Hartman
1b3cac19a0 serial: Fix typo in comments (s/besued/because/) 2023-02-08 10:05:27 +08:00
Ville Juven
f4b82b6405 sched/addrenv: Remove up_addrenv_restore
The function is not relevant any longer, remove it. Also remove
save_addrenv_t, the parameter taken by up_addrenv_restore.

Implement addrenv_select() / addrenv_restore() to handle the temporary
instantiation of address environments, e.g. when a process is being
created.
2023-02-08 02:51:23 +08:00
Ville Juven
5713d85df0 group/group_addrenv: Move address environment from group -> tcb
Detach the address environment handling from the group structure to the
tcb. This is preparation to fix rare cases where the system (MMU) is left
without a valid page directory, e.g. when a process exits.
2023-02-08 02:51:23 +08:00
Nathan Hartman
5f9cb6faf4 drivers/serial: Fix docstrings on UART interrupt handlers 2023-02-07 04:41:36 +08:00
chao an
1b245664ad arm/rp2040: fix compile warning on boot2 build
ld: warning: boards/arm/rp2040/raspberrypi-pico-w/scripts/raspberrypi-pico-flash.ld contains output sections; did you forget -T?
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-07 04:40:38 +08:00
chao an
5ac638944b arm/backtrace: fix compile warning
common/arm_backtrace_unwind.c: In function 'up_backtrace':
common/arm_backtrace_unwind.c:626:27:
warning: assignment to 'long unsigned int' from 'uint8_t (*)[]'\
{aka 'unsigned char (*)[]'} makes integer from pointer without a cast [-Wint-conversion]

  626 |           frame.stack_top = &g_intstacktop;
      |
2023-02-07 04:40:38 +08:00
wangbowen6
a11cb59af6 tc32/Make.defs: fix build break after merge unblock/block_task
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-02-04 18:25:58 -03:00
wangbowen6
f925e17f18 tlsr82/backtrace: tc32 backtrace bug fix
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-02-04 18:25:58 -03:00
chao an
7625126c91 Remove the remain MIN/MAX like macro
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-03 23:22:41 +08:00
chao an
eca4951021 nuttx: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 22:16:04 +08:00
Xiang Xiao
df102d1f06 Remove OK macro from the code base
let's use OK from sys/types.h instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-02 13:58:16 +01:00
chao an
4c8d244fae sched/getpid: replace syscall getpid/tid/ppid() to kernel version
NuttX kernel should not use the syscall functions, especially after
enabling CONFIG_SCHED_INSTRUMENTATION_SYSCALL, all system functions
will be traced to backend, which will impact system performance.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
Nathan Hartman
5651940d02 tiva/serial: Allow changing CTS/RTS with termios
This is a follow-up to PR #6548, which added UART CTS/RTS support for
Tiva (TI TM4C12x) microcontrollers. This follow-up makes it possible,
when termios support is enabled with CONFIG_SERIAL_TERMIOS and CTS/RTS
support is enabled with CONFIG_SERIAL_OFLOWCONTROL and/or
CONFIG_SERIAL_IFLOWCONTROL, to query whether CTS/RTS are on/off at
runtime by utilizing ioctl TCGETS and to turn CTS/RTS on/off at runtime
by utilizing ioctl TCSETS.

* arch/arm/src/tiva/common/tiva_serial.c
  (up_set_format): Because this function is called from ioctl TCSETS to
   modify UART settings, and that IOCTL now respects CCTS_OFLOW and
   CRTS_IFLOW, move setting/clearing of Tiva UART's CTL register's RTSEN
   and CTSEN bits here...
  (up_setup): ...from here.
  (up_ioctl): For TCGETS, populate CCTS_OFLOW and CRTS_IFLOW bits as
   appropriate. For TCSETS, populate priv's oflow and iflow from
   supplied CCTS_OFLOW and CRTS_IFLOW bits.

Thanks to Petro Karashchenko for review and suggested fixes.

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-02-02 09:44:07 +08:00
Nathan Hartman
f2e15b431c Support termios for Tiva
The lower-half serial driver for Tiva (TI TM4C12x) microcontrollers supports
termios, but Kconfig never enabled this support because we were missing the
ARCH_HAVE_SERIAL_TERMIOS configs. This is now enabled, allowing termios support
to be enabled with CONFIG_SERIAL_TERMIOS.

* arch/arm/src/tiva/Kconfig
  (config TIVA_UART0 thru TIVA_UART7): Select ARCH_HAVE_SERIAL_TERMIOS.
2023-02-02 09:43:09 +08:00
Nathan Hartman
78154f12ff Serial: Fix wrong identifier name in comments 2023-02-02 09:42:34 +08:00
Gustavo Henrique Nihei
e6b204f438 nuttx: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-01 23:47:44 +08:00
Huang Qi
8b27d60bcd tools: Make zig available for arm/riscv/sim
Add essential compile flags to make zig available out of box.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-01 11:12:44 +08:00
Nathan Hartman
fdb149ddb0 Kconfig: Improve help text related to *_SERIALBRK_BSDCOMPAT
* arch/arm/src/gd32f4/Kconfig
  (GD32F4_SERIALBRK_BSDCOMPAT): Improve help text.

* arch/arm/src/stm32/Kconfig
  (STM32_SERIALBRK_BSDCOMPAT): Improve help text.

* arch/arm/src/stm32f7/Kconfig
  (STM32F7_SERIALBRK_BSDCOMPAT): Improve help text.

* arch/arm/src/stm32h7/Kconfig
  (STM32H7_SERIALBRK_BSDCOMPAT): Improve help text.

* arch/arm/src/stm32l4/Kconfig
  (STM32L4_SERIALBRK_BSDCOMPAT): Improve help text.

* arch/arm/src/stm32l5/Kconfig
  (STM32L5_SERIALBRK_BSDCOMPAT): Improve help text.

* arch/arm/src/stm32u5/Kconfig
  (STM32U5_SERIALBRK_BSDCOMPAT): Improve help text.

* arch/arm/src/stm32wb/Kconfig
  (STM32WB_SERIALBRK_BSDCOMPAT): Improve help text.
2023-02-01 10:58:34 +08:00
Xiang Xiao
9f027208d4 fs: Add model field to geometry and mtd_geometry_s
the model is very useful to track the device info

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-31 11:50:28 -03:00
Jukka Laitinen
4f957f8031 arch/arm/src/lc823450/lc823450_i2c.c: Remove extra rounding after MSEC2TIC change to round up
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-31 22:42:29 +08:00
Jukka Laitinen
05eb8541d1 Revert "arch/arm/src/stm32f7/stm32_i2c.c: Round up stm32_i2c_toticks return value"
This reverts commit fe6f6870dcc431cecf0fa94187cff05ec040cf47.
2023-01-31 22:42:29 +08:00
Xiang Xiao
55679aec5f drivers/camera: Support the private data for imgsensor and imgdata
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-31 08:04:39 +01:00
David Vosahlik
372fee9412 Added SocketCAN driver implementation to the tiva chip, modified the EK-TC1294XL launchpad board to use the new SocketCAN API 2023-01-31 14:07:23 +08:00
yinshengkai
3f97a87162 tools: add separate flags parameter for COMPILE/COMPILEXX
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-31 13:42:33 +08:00
Nathan Hartman
6b89b6f945 Remove executable permissions from source files
* arch/arm/src/sama5/sam_flexcom_spi.h,
  arch/risc-v/src/mpfs/mpfs_ihc_sbi.c,
  drivers/usbdev/adb.c,
  libs/libc/math/lib_scalbn.c,
  libs/libc/math/lib_scalbnf.c,
  net/ipfrag/Make.defs,
  net/ipfrag/ipfrag.c,
  net/ipfrag/ipfrag.h,
  net/ipfrag/ipv4_frag.c,
  net/ipfrag/ipv6_frag.c: Remove executable permission.
2023-01-30 20:34:51 -03:00
Nathan Hartman
f63754c4c0 arch/tiva: Remove dead store
* arch/arm/src/tiva/common/tiva_can.c:
  (tiva_can_initialize): Remove the local variable 'canmod', which was
   assigned but never used.
2023-01-31 01:36:09 +08:00
chao an
0f35ad29a8 arm/unwinder: set default unwinder type to arm exidx/extab
Signed-off-by: chao an <anchao@xiaomi.com>
2023-01-31 00:38:42 +08:00
rajvinder kaur
2b30f17607 stm32h7: socket CAN error handling. 2023-01-30 11:22:49 +08:00
chao an
82520c0006 arm/itm_syslog: remove invaild select config
1. CONFIG_SYSLOG has been removed by Nutt on below commit:

| commit c5ac473bc0
| Author: Gregory Nutt <gnutt@nuttx.org>
| Date:   Tue Jun 21 07:58:42 2016 -0600
|
|     SYSLOG: Remove an obsolete, unused configuration item from Kconfig file

2. Fix comile warning

| armv7-m/arm_itm_syslog.c: In function 'itm_syslog_initialize':
| armv7-m/arm_itm_syslog.c:183:18: warning: passing argument 1 of 'syslog_channel' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
|   183 |   syslog_channel(&g_itm_channel);
|       |                  ^~~~~~~~~~~~~~
| In file included from armv7-m/arm_itm_syslog.c:29:
| nuttx/syslog/syslog.h:155:49: note: expected 'struct syslog_channel_s *' but argument is of type 'const struct syslog_channel_s *'
|   155 | int syslog_channel(FAR struct syslog_channel_s *channel);
|       |

Signed-off-by: chao an <anchao@xiaomi.com>
2023-01-29 19:54:55 +08:00
zhangyuan21
e6d2f0623a backtrace: use CURRENT_REGS when in interrupt context
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-01-29 02:48:00 -08:00
Jukka Laitinen
7d54d04613 arch/arm/src/stm32f7/stm32_i2c.c: Round up stm32_i2c_toticks return value
When sending small number of bytes with larger CONFIG_USEC_PER_TICK
this function should return at least 1. Solve this by rounding
up the result.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-28 12:11:33 -03:00
Xiang Xiao
964a41283c arm/tlsr82: Fix warning: "IC_TAG_CACHE_ADDR_EQU_EN" is not defined
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-28 11:30:33 -03:00
Ville Juven
42d0e356c2 arch/addrenv: Change group_addrenv_t to arch_addrenv_t
This is preparation for moving address environments out of the group
structure into the tcb.

Why move ? Because the group is destroyed very early in the exit phase,
but the MMU mappings are needed until the context switch to the next
process is complete. Otherwise the MMU will lose its mappings and the
system will crash.
2023-01-27 23:17:01 +08:00
Max Kriegleder
8c465a64b9 stm32h7: add lower half timer driver 2023-01-27 13:29:10 +08:00
chao an
931a4f6969 arch/EXTRA_LIBS: link all staging library
Signed-off-by: chao an <anchao@xiaomi.com>
2023-01-27 01:08:26 +02:00
chao an
d031989e0e arch/arm: make DSP arch extension configurable
Signed-off-by: chao an <anchao@xiaomi.com>
2023-01-26 22:39:30 +02:00
Ville Juven
686b990a85 arch/ARCH_KERNEL_STACK: Fix signal handling with kernel stack
There were two issues with signal handling:
- With a kernel stack the "info" parameter was passed from kernel memory.
  This is fixed by making a stack frame to the user stack and copying it
  there.
- If the signal handler uses a system call, the kernel stack was completely
  and unconditionally destroyed, resulting in a crash in the user application

There is also no need to check ustkptr, it is always NULL. Why ? Because
signal delivery is deferred when a system call is being executed.
2023-01-26 20:41:42 +08:00
Petro Karashchenko
a58e73add8 arch/arm/tiva: simplify TIVA_CAN option usage
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-26 10:26:09 +08:00
Petro Karashchenko
bd7cb522a1 nuttx: use TABs instead of spaces in Kconfig files
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-26 10:26:09 +08:00
Petro Karashchenko
f952b8456c assert: switch from ASSERT(0/false) to PANIC
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-26 10:15:34 +08:00
Michael Jung
eaea60a575 armv8-m: Fix pthread_start syscall
The 'arg' parameter is in R3, not in R2.

Signed-off-by: Michael Jung <michael.jung@secore.ly>
2023-01-26 04:02:19 +08:00
Petro Karashchenko
be10056702 arch/arm/samv7: fix issue when AFEC1 driver failed to open second time
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-26 01:26:41 +08:00
Xiang Xiao
43e7b13697 assert: Log the assertion expression in case of fail
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-24 15:00:19 -03:00
David Sidrane
15462f3e7a s32k1xx:serial Do not use TC use TDRE & TIE 2023-01-24 06:47:21 +08:00
raiden00pl
aa7d4b40c1 stm32/foc: move the warning in the right place - should be in stm32f7 2023-01-24 00:44:41 +08:00
raiden00pl
bfdb7f8909 stm32f7,stm32/foc: support for BEMF sensing
stm32 version tested with b-g431b-esc1
stm32f7 version not tested on HW
2023-01-22 12:58:04 -03:00