Commit Graph

52883 Commits

Author SHA1 Message Date
p-szafonimateusz
d484e85bb9 x86_64_acpi.c: make sure that RSDP is mapped
rsdp memory may be not mapped when provided from multiboot2 header.
For some reason the previous code worked on some machines.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-23 11:29:21 +02:00
dongjiuzhu1
e2f1ccdefc drivers/misc/rwbuffer: fix rwbuffer overflow issue
issue:
in rwb_wrflush():
memmove(rwb->wrbuffer + padblocks * rwb->blocksize,
rwb->wrbuffer, rwb->wrnblocks * rwb->blocksize);

when the offest from rwb->wrblockstart to startblock plus rwb->wrnblocks is greater
than rwb->wralignblocks, it will be causing memory overflow since rwb->wrbuffer is
allocated rwb.wrmaxblock(rwb.wralignblocks) blocks.

fix:
Let us ensure that the wrblockstart in rwbuffer must be aligned according to
wralignblocks after writing, so there is no need to perform memmove when flushing

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 10:28:52 +08:00
dongjiuzhu1
0d609c451b Revert "fix: the bug about rwbuffer causing mem overflow"
This reverts commit e43aa99ae8.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 10:28:52 +08:00
p-szafonimateusz
530f5cd324 arch/intel64: add cache support
Add dcache and icache support for intel64

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-22 23:13:44 +02:00
p-szafonimateusz
30226901c0 arch/x86_64: add simple ACPI parser
add simple ACPI parser for intel64.

For now RSDP signature can be found in BIOS legacy region or can be provided by multiboot2

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-22 23:47:09 +08:00
p-szafonimateusz
0aac7d929d intel64/arch.h: fix ist_t structure, there is no reserved5 field
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-22 23:46:10 +08:00
p-szafonimateusz
8b09118350 intel64/intel64_handlers.c: cosmetic changes
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-22 23:46:10 +08:00
p-szafonimateusz
71987be7ef intel64: add header for intel64_lowsetup
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-22 23:46:10 +08:00
p-szafonimateusz
f8ec274749 intel64/intel64_irq.c: cosmetic change
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-04-22 23:46:10 +08:00
Tiago Medicci Serrano
5ff6362d0f Documentation: improve documentation about ESP32 family
In particular, sections regarding the toolchain setup and usage
were updated, as well as the bootloader options. Also, minor issues
were fixed.
2024-04-22 23:45:22 +08:00
zhanghongyu
92cd1c3742 netdev_upperhalf: add L3 packet handle
To provide support for the received L3 network packets

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-04-22 23:44:37 +08:00
Michał Łyszczek
85b2cbaca6 boards/stm32f411-minimum: add support for /dev/gpio*
This patch allows user to simply select which GPIOs he wants to use
and access them via /dev/gpio_a0 or similar device with standard
gpio driver.

By default gpio names match pin names printed on the board. So when
enabling A3 pin, it will show as /dev/gpio_a3 in runtime. This name
can be changed in kconfig.

User can also select pin function (input, output, interrupt) as well
as standard pin settings like, pull up/down, output type
pushpull/open drain etc.

All pins that are exposed via boards goldpins are listed in Kconfig.
Extra pins that are supported by chiip but are not exposed for easy
usage are not listed.

To have this nice Kconfig configuration and for things to be easily
debugable/understandable it requires code to have big Kconfig and
header file with all possible definitions

Because of file sizes I decided to split gpio related kconfig and
header into separate files. Otherwise it would really make original
files hard to read and find anything.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2024-04-22 10:07:36 -03:00
chao an
4b086f595e arch/risc-v: rename local variable name to avoid shadowed declaration
In file included from common/addrenv.h:33,
                 from common/riscv_initialstate.c:36:
common/riscv_initialstate.c: In function 'up_initial_state':
common/riscv_internal.h:136:16: warning: declaration of 'regval' shadows a previous local [-Wshadow]
  136 |      uintptr_t regval; \
      |                ^~~~~~
common/riscv_initialstate.c:74:12: note: in expansion of macro 'READ_CSR'
   74 |   regval = READ_CSR(CSR_VLENB);
      |            ^~~~~~~~
common/riscv_initialstate.c:63:13: note: shadowed declaration is here
   63 |   uintptr_t regval;
      |             ^~~~~~

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-22 16:22:51 +08:00
raiden00pl
41803a0c20 sensors/bh1749nuc: add support for the new sensor framework
bh1749nuc can be used with the new sensor framework
2024-04-21 14:48:28 -03:00
dongjiuzhu1
7c4e3aff14 drivers/usbdev/mtp: fix compile break
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:24:40 +08:00
dongjiuzhu1
e7fd416f9f drivers/usbdev: support config pid/vid by soft interface
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:24:40 +08:00
anjiahao
ff4c6c33e8 usbdev:fix usbdev usbdev_fs_classuninitialize double free
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-04-21 23:21:54 +08:00
dongjiuzhu1
a8d7103a2b drivers/usbdev: push cdcacm rx buffer to serial rx buffer when resetconfig
When usb is re-enumerated due to the reset signal, we need to push
the rx_pending message into the serial port buffer.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:21:54 +08:00
dongjiuzhu1
e5a925543b drivers/usbdev: fix double free when cdcacm uninitialize with not used
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:21:54 +08:00
dongjiuzhu1
ad59ef075f drivers/usbdev: remove first uninitialization and release resouce once.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:21:54 +08:00
dongjiuzhu1
3b39ba72a4 drivers/usbdev: fix used after free when calling close after uninitialize
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:21:54 +08:00
dongjiuzhu1
9c55f21a6f drivers/cdcacm/serial: add release interface to release uart_dev resource
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-21 23:21:54 +08:00
raiden00pl
5af805b2ef sensors/bmi270: add support for the new sensor framework
bmi270 can be used with the new sensor framework
2024-04-21 19:06:18 +08:00
raiden00pl
3d765616ea sensors/adxl372: add support for the new sensor framework
adxl372 can be used with the new sensor framework
2024-04-21 18:57:33 +08:00
hujun5
d0820acbbb sched: misc: Remove sched_lock in _assert()
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-04-21 11:40:01 +02:00
hujun5
72548951d3 drivers: syslog: Replace sched_lock with critical section in syslog_flush_intbuffer()
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-04-21 11:40:01 +02:00
Michael Jung
3739a233b7 rp2040/w5500-evb-pico: Add documentation
Signed-off-by: Michael Jung <michael.jung@secore.ly>
2024-04-21 11:11:09 +08:00
Michael Jung
f55145b43c rp2040: add w5500-evb-pico board configuration
This is copy of raspberrypi-pico with all occurences of raspberrypi replaced by
w5500-evb.  Only the usbnsh defconfig is available, which is based on the
raspberrypi-pico:usbnsh defconfig, but enables the WIZnet W5500 Ethernet chip.
TCP/IP for IPv4 and IPv6 is enabled.

Signed-off-by: Michael Jung <michael.jung@secore.ly>
2024-04-21 11:11:09 +08:00
Michael Jung
9c705828bc rp2040: Add lower layer driver for WIZnet W5500
Courtesy of Adam Comley

Signed-off-by: Michael Jung <michael.jung@secore.ly>
2024-04-21 11:11:09 +08:00
Yanfeng Liu
a70c0a90a7 tools/configure.sh: revise help message
Revising the help message for `-L` option.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-21 11:07:09 +08:00
Yanfeng Liu
c577abe222 docs/os: fix typos
This fixes a few typos in conventions.rst and libc/index.rst.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-21 11:06:46 +08:00
Yanfeng Liu
102a62c7e3 mm/mm_gran: remove allocation size limitation
This patch refactors granule allocator to remove the 32 granules
limitation with the help of a gran_range_s structure and related
functions, see "mm_grantable.h" for details.

Below are the major functions explaining how this works:

- The gran_match() checks if a gran range all in the given state.
  it gives last mismatch position when fails free range matching.
- The gran_search() tries to find the position of a free range.
  It leverages last mismatch position from gran_match() to speed
  up the search.

range size handling is mainly in gran_match() and gran_set_().

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-20 16:24:37 -03:00
raiden00pl
db7c8be61f sensors: add support for bmm150 magnetometer
add support for Bosch BMM150 Magnetometer
2024-04-20 16:20:43 -03:00
ChenChuang
e43aa99ae8 fix: the bug about rwbuffer causing mem overflow
when the offest from rwb->wrblockstart to startblock
plus rwb->wrnblocks is greater than rwb->wralignblocks,
it will be causing memory overflow since rwb->wrbuffer is
allocated rwb.wrmaxblock(rwb.wralignblocks) blocks.
2024-04-20 11:58:12 -03:00
raiden00pl
ebcf25b2f6 sensors: add support for adxl362 accelerometer
add support for Analog Devices ADXL362 accelerometer
2024-04-20 11:47:50 -03:00
Jukka Laitinen
33d0276f3e arch/arm64/src/imx9/imx9_lpuart.c: Change ARMV8M_DCACHE_LINESIZE -> ARMV8A_DCACHE_LINESIZE
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-04-20 18:43:41 +08:00
Jukka Laitinen
155c776ba8 arch/arm64/src/imx9/imx9_usbdev.c: Fix the descriptor alignments and cache management
Align all the dtd and dqh on cache line boundaries and clean up the cache management

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-04-20 18:43:41 +08:00
anjiahao
67b7152034 Documentation:update qemugdb usage
Remove nuttx-gdbinit,use tools/gdb/__init__.py instead

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-04-20 18:42:28 +08:00
chao an
d59f9186ca arch/risc-v: add llvm experimental extensions into command line
LLVM supports (to various degrees) a number of experimental extensions.
All experimental extensions have experimental- as a prefix. There is
explicitly no compatibility promised between versions of the toolchain,
and regular users are strongly advised not to make use of experimental
extensions before they reach ratification.

Fix compile error:
riscv64-unknown-elf-clang: error: invalid arch name 'rv64gcv_zfh_zvfh', requires '-menable-experimental-extensions' for experimental extension 'zvfh'

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-19 20:13:54 +08:00
chao an
d11b1ba9cb drivers/serial/16550: remove unused function
drivers/serial/uart_16550.c:690:20: warning: unused function 'u16550_restoreuartint' [-Wunused-function]
static inline void u16550_restoreuartint(FAR struct u16550_s *priv,
                   ^

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-19 20:13:16 +08:00
chao an
3a5abf724e sched/Kconfig: make disable idle loop configurable
disable idle loop in experimental

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-19 20:12:17 +08:00
Ville Juven
252b4a4094 imx93-evk/README.txt: Update instructions
It is advisable to set bootdelay to 0 when using bootcmd to disable
dcache on u-boot. Using bootdelay -1 will definitely work as it disables
bootcmd altogether (and leaves the dcache enabled). This step is added
to remove confusion.
2024-04-19 20:12:03 +08:00
chao an
e863e3dd37 arch/risc-v: add LLVM clang support
Verified on LLVM-Metal:
$ riscv64-unknown-elf-clang --version
(LLVM-Metal 15.9.0-2023.03.0) clang version 15.9.0
Target: riscv64-unknown-unknown-elf
Thread model: posix

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-19 12:27:56 +08:00
Xiang Xiao
55e3cf7e2d sched: Move dump.c to sched_dumponexit.c
The dump.c is a part of sched module, so move it to sched directory.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-04-19 08:39:10 +08:00
xuxin19
859247c224 cmake:enhance set_source_files_properties for NuttX CMake module
Because `set_source_files_properties` in cmake will overwrite the properties instead of appending them.
This module implements addition and deletion by
first `getting_source_file_property` and then `set_source_files_properties`

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-04-18 14:57:58 -03:00
xuxin19
4b11d37cf7 cmake-bugfix:add santity check for target depends and change
inter_library header inheritance level

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-04-18 14:57:58 -03:00
xuxin19
6960f1b967 cmake:change add_dep to nuttx_add_dep for nuttx_add_application
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-04-18 14:57:58 -03:00
xuxin19
8ab4d3c950 cmake:sanity check to avoid custom board not providing Kconfig by
default

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-04-18 14:57:58 -03:00
Huang Qi
93d75129de riscv: Add Vector CSRs to csr.h
The CSR register definitions from RVV 1.0 spec: https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#vector-registers

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-04-19 00:31:07 +08:00
Ville Juven
d73aab9f71 arm64/imx9: Add LPSPI driver
Add driver for LPSPI

Co-authored-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-04-18 10:58:02 -03:00