Commit Graph

43669 Commits

Author SHA1 Message Date
Xiang Xiao
077a28eff6 Fix termios/lib_cfspeed.c:78:5: error: large integer implicitly truncated to unsigned type
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-29 08:11:08 -03:00
Xiang Xiao
86684105f9 serial: Move tcdrain implementation from drivers/serial to libc
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-29 08:11:08 -03:00
Xiang Xiao
a010cb1af1 serial: Make SIGINT and SIGTSTP work even without CONFIG_SERIAL_TERMIOS
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-29 08:11:08 -03:00
Huang Qi
901361be48 arch/risc-v: Move more files to common
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-12-29 01:19:30 -06:00
Huang Qi
22ae2e0121 arch/risc-v: Refine riscv_fpu.S
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-12-29 01:19:30 -06:00
ChenWen
6ce335fa84 xtensa/esp32: Fix some Wi-Fi issues
1. Fix the issue that Wi-Fi can't connect to some special routers occasionally.
    2. Update Wi-Fi driver code to fix issue of failure to send pkt.
    3. Replace software random with hardware random
2021-12-28 23:48:25 -06:00
chao.an
7ed0b97414 make/allsyms: skip the unnecessary link operation
For incremental compilation, skip the stage 1 dummy link
operation if nuttx elf has been generated

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-28 23:47:10 -06:00
Xiang Xiao
186ac17f1f arch: Select ARCH_HAVE_BACKTRACE in Kconfig for supported arch
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-29 13:34:02 +08:00
Xiang Xiao
dd942f0b04 sched/backtrace: Dump the complete stack regardless the depth
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-29 12:09:54 +08:00
Xiang Xiao
9eecd4c5e2 libc: Prefix the address with 0 to the specified width in sched_dumpstack
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-29 12:09:54 +08:00
chao.an
7f2c5be07a libs/dumpstack: add support for print symbol name
ap> mw -1
[ EMERG] arm_usagefault: PANIC!!! Usage Fault:
[ EMERG] arm_usagefault:       IRQ: 6 regs: 0x3c24fa48
[ EMERG] arm_usagefault:       BASEPRI: 000000e0 PRIMASK: 00000000 IPSR: 00000006 CONTROL: 00000004
[ EMERG] arm_usagefault:       CFSR: 01000000 HFSR: 00000000 DFSR: 00000000 BFAR: 40101000 AFSR: 00000000
[ EMERG] arm_usagefault: Usage Fault Reason:
[ EMERG] arm_usagefault:       Unaligned access
[ EMERG] up_assert: Assertion failed at file:armv8-m/arm_usagefault.c line: 113 task: init
[ EMERG] backtrace|10:  0x2c325bde 0x2c319b98 0x2c3261cc 0x2c316b20 0x2c32699c 0x2c303a50 0x2c326072 0x2c3206ea
[ EMERG] backtrace|10:  0x2c3428cc 0x2c33ed14 0x2c342e8e 0x2c34403a 0x2c344ac0 0x2c319b60 0x2c3080ba
[ EMERG]  [10][ 0] [<0x2c325bde>] up_backtrace+0xa/0x13c
[ EMERG]  [10][ 1] [<0x2c319b98>] sched_dumpstack+0x10/0xc0
[ EMERG]  [10][ 2] [<0x2c3261cc>] up_assert+0x48/0x414
[ EMERG]  [10][ 3] [<0x2c316b20>] _assert+0x4/0x10
[ EMERG]  [10][ 4] [<0x2c32699c>] arm_usagefault+0xa8/0x138
[ EMERG]  [10][ 5] [<0x2c303a50>] irq_dispatch+0x1c/0x40
[ EMERG]  [10][ 6] [<0x2c326072>] arm_doirq+0x1a/0x2c
[ EMERG]  [10][ 7] [<0x2c3206ea>] exception_common+0x4a/0xac
[ EMERG]  [10][ 8] [<0x2c3428cc>] cmd_mw+0xec/0x11c
[ EMERG]  [10][ 9] [<0x2c33ed14>] nsh_parse_command+0x684/0xcf0
[ EMERG]  [10][10] [<0x2c342e8e>] nsh_session+0x92/0x168
[ EMERG]  [10][11] [<0x2c34403a>] nsh_consolemain+0x1e/0x38
[ EMERG]  [10][12] [<0x2c344ac0>] nsh_main+0x30/0x50
[ EMERG]  [10][13] [<0x2c319b60>] nxtask_startup+0x40/0x68
[ EMERG]  [10][14] [<0x2c3080ba>] nxtask_start+0x46/0x60

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-29 12:09:54 +08:00
Xiang Xiao
20bbdd0997 libc: Add backtrace_symbols[_fd] functions
specified here:
https://linux.die.net/man/3/backtrace_symbols

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-29 12:09:37 +08:00
Xiang Xiao
f302e8fd40 arch/sim: Implement up_backtrace
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-29 11:03:08 +08:00
Xiang Xiao
f061766801 video/fb: Fix typo error in include/nuttx/video/fb.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-28 17:21:18 -03:00
Xiang Xiao
f768e1268b boards/sim: Remove sim_tsc_setup
since all NX and VNC initialization should be initiated from
user space through BOARDIOC_NX_START and BOARDIOC_VNC_START

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-28 17:14:04 -03:00
Huang Qi
e75321e61c arch/risc-v: Move riscv_blocktask.c to common
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-12-28 11:32:15 -06:00
Alan C. Assis
7b1135500b doc/esp32: Add documentation about BLE for ESP32 2021-12-28 07:31:02 -06:00
Norman Rasmussen
baafd33cbe Fix a typo in description of pwm_expired 2021-12-28 06:27:51 -06:00
Norman Rasmussen
934a79736a Use userspace chosen channel numbers when starting bl602 pwm
commit 2889315c20 added support for pwm
but didn't read the channel numbers provided by user-space. They should
be, otherwise it's not possible to start a sub-set of channels that are
not the first "n" channels.
2021-12-28 06:27:51 -06:00
chao.an
cf2dfa8985 arch/arm/assert: move the arm_assert to common code
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-28 05:09:30 -06:00
Huang Qi
d71cfc178a arch/risc-v: Remove unneeded kconfigs
CONFIG_RV32IM_HW_MULDIV can be safely removed since this behavior is
controlled by M extension.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-12-28 05:02:42 -06:00
Norman Rasmussen
48311cc61f Fix unaligned memory access when creating ICMP Port Unreachable messages
commit 3b69d09c80 corrected the
unreachable handling for net/udp/icmp but introduced an unaligned store.
This splits the uint32_t data field into a two element uint16_t data
field to avoid the unaligned store.
2021-12-28 03:51:53 -06:00
chao.an
579738c8fa arch/arm: move the backtrace implement to common code
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-28 03:02:01 -06:00
Norman Rasmussen
1e2f067181 pwm: add option to break the loops when using multiple PWM channels
commit 7354ab187e added an option to break
the loops when using multiple PWM channels to arm pwm drivers. This adds
the same support to the risc-v pwm drivers.
2021-12-28 03:01:27 -06:00
Huang Qi
c2e8c92b25 arch/risc-v: Refine Toolchain.defs
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-12-28 00:30:10 -06:00
zhuyanlin
1f87ded9c2 driver:clk: clk pending on semaphore waiting on IPC ready
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-27 23:25:28 -06:00
zhuyanlin
a22dae19c1 regulator/rpmsg: pending in wait ept ready for regulator client
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-27 23:25:28 -06:00
chao.an
cbd82f1c1b compile/flags: remove redundant -fomit-frame-pointer from board flags
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-27 22:31:27 -06:00
chao.an
a42aa8415d compile/flags: add FRAME_POINTER into Toolchain.defs
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-27 22:31:27 -06:00
chao.an
8eb999ff03 arch/arm: select ARM_THUMB by default for Cortex-M
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-27 22:30:53 -06:00
Petro Karashchenko
3ccb657dc2 nuttx: remove space befone newline in logs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-27 21:01:19 -06:00
Alexander Lunev
e68ffb9f99 net/tcp(unbuffered): fixed an issue with unackseq calculation.
Wrong unackseq calculation locked conn->tx_unacked at non-zero values
even if all ACKs were received. Thus unbuffered psock_tcp_send() never completed.
2021-12-27 20:59:48 -06:00
Xiang Xiao
8f72c7626c driver/rwbuffer: Fix the compiler warning
rwbuffer.c: In function 'rwb_initialize':
rwbuffer.c:842:16: warning: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
  842 |           ferr("Write buffer kmm_malloc(%d) failed\n", allocsize);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~
      |                                                        |
      |                                                        uint32_t {aka long unsigned int}
rwbuffer.c:842:42: note: format string is defined here
  842 |           ferr("Write buffer kmm_malloc(%d) failed\n", allocsize);
      |                                         ~^
      |                                          |
      |                                          int
      |                                         %ld
In file included from rwbuffer.c:36:
rwbuffer.c:846:13: warning: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
  846 |       finfo("Write buffer size: %d bytes\n", allocsize);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~
      |                                              |
      |                                              uint32_t {aka long unsigned int}
rwbuffer.c:846:34: note: format string is defined here
  846 |       finfo("Write buffer size: %d bytes\n", allocsize);
      |                                 ~^
      |                                  |
      |                                  int
      |                                 %ld

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-27 11:05:47 -06:00
Alexander Lunev
19dc121a4f net/tcp(unbuffered): fixed an issue with tx_unacked overflow that occurred if NET_TCP_WINDOW_SCALE option was enabled.
If the remote TCP receiver advertised TCP window size greater than 64 KB
and TCP ACK packets returned to the NuttX TCP sender with a significant delay,
tx_unacked variable overflowed and further TCP send stalled forever
(until TCP re-connection).
2021-12-27 11:05:01 -06:00
Xiang Xiao
ab0f5f607d Fix ioexpander/gpio_lower_half.c:302:23: warning: too many arguments for format
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-27 11:04:11 -06:00
zhuyanlin
c5aca37f8f regulator: fix warning in RPIu32
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-27 06:56:38 -06:00
Xiang Xiao
540c6f8c39 esp32-devkitc: Change CONFIG_USER_ENTRYPOINT to CONFIG_INIT_ENTRYPOINT
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-25 18:05:59 +08:00
Huang Qi
0751bcd4ca arch/sim: Support vncserver as display device
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-12-24 11:59:43 -06:00
ligd
412d030149 boards: move USERMAIN_XX out of INIT_ENTRYPOINT
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-24 08:23:30 -06:00
ligd
0bb32f27c0 init: use exec_spawn instead of exec
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-24 08:23:30 -06:00
ligd
10ccba6671 init: move USERMAIN_XX out of INIT_ENTRYPOINT
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-24 08:23:30 -06:00
Alan C. Assis
36389dab76 Add board support to SHT3X sensor 2021-12-24 08:11:51 -06:00
Alan C. Assis
01e4e249cc Add WiFi/BLE Coexistence support
Co-authored-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
Co-authored-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-12-23 20:42:23 -06:00
Eero Nurkkala
509350a614 risc-v/mpfs: update m100pfsevp board info
Update the cache settings for the Aries m100pfsevp board. This
assigns scratchpad ways for this board as well, as seen in the
commit 491ae6c.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2021-12-23 06:55:18 -06:00
chao.an
6069433d2d arch/arm/cortex-a/r: dump all registers with alias
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-12-23 06:54:32 -06:00
Eero Nurkkala
3394dca826 risc-v/opensbi: Make.defs: use a wildcard for file listing
The source directory contents of the OpenSBI directory lib/sbi may be
listed with a one-line wildcard. This makes the Make.defs file look
simpler. The rest of the files need to be picked one at a time.

Co-authored-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2021-12-23 02:42:09 -06:00
ligd
e5420c8eee wqueue: fix NO leave_critical_section() when only CONFIG_SCHED_HPWORK
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-12-23 02:27:34 -06:00
Eero Nurkkala
b128ce334f mpfs: introduce OpenSBI
OpenSBI may be compiled as an external library. OpenSBI commit d249d65
(Dec. 11, 2021) needs to be reverted as it causes memcpy / memcmp to
end up in the wrong section. That issue has yet no known workaround.

OpenSBI may be lauched from the hart0 (e51). It will start the U-Boot
and eventually the Linux kernel on harts 1-4.

OpenSBI, once initialized properly, will trap and handle illegal
instructions (for example, CSR time) and unaligned address accesses
among other things.

Due to size size limitations for the mpfs eNVM area where the NuttX
is located, we actually set up the OpenSBI on its own section which
is in the bottom of the DDR memory. Special care must be taken so that
the kernel doesn't override the OpenSBI. For example, the Linux device
tree may reserve some space from the beginning:

  opensbi_reserved: opensbi@80000000 {
      reg = <0x80000000 0x200000>;
      label = "opensbi-reserved";
  };

The resulting nuttx.bin file is very large, but objcopy is used to
create the final binary images for the regions (eNVM and DDR) using
the nuttx elf file.

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2021-12-22 20:48:12 -06:00
Eero Nurkkala
491ae6cc53 mpfs: cache: assign ways to L2 zero device
Assign ways to L2 zerodevice. L2 zero device is used for
the scratchpad functionality. The area may be used for the
harts communicating to each other.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2021-12-22 20:48:12 -06:00
Diego Herranz
e6bd444fd3 drivers/sensors/isl29023.c: fix compilation error and warnings
- "op_mode" instead of "mode" (compilation error)
- CONFIG_ISL29023_I2C_FREQUENCY instead of CONFIG_LM75_I2C_FREQUENCY
(probably a leftover)
- Fix a couple of format warnings: now using PRIu32
- Also minor comment changes
2021-12-22 20:44:52 -06:00