Commit Graph

6878 Commits

Author SHA1 Message Date
Philippe Leduc
3dc6b4c9bd Add basic support for locales in order to C++ streams to build and work for simple cases (POSIX / C locale).
Fix build with C++ GCC toolchain
2024-04-29 17:34:10 +08:00
anjiahao
0040e9a239 drivers/serial:support arm cmsdk drivers
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-04-26 18:42:35 -03:00
Yanfeng Liu
3822d88669 mm/arch: userspace device mapping support
This patch adds definitions to support user space device mappings
that allows devices like frame buffer to be accessible from user
space in kernel mode.

The are mainly two changes:

- in `mm/`:
  added vm_map_region(), vm_unmap_region() for drivers to do
  device mapping easily.
- in `arch/`:
  extended ARCH_SHM_NPAGES as user-space mapping region size.
  decoupled ARCH_SHM_MAXREGIONS from region size calculations and
  limit its usage only for SysV shm purposes.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-26 12:11:35 +08:00
zhanghongyu
b934555fd1 mm/iob: Support alloc IOB via malloc
Support the network interface card driver to receive zero copies of packets and send and receive giant frame packets, allowing drivers to initialize the DMA buffer to the iob structure, and we can apply for IOB with large memory

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-04-26 01:06:21 +08:00
zhanghongyu
00d208baf6 mm/iob: replace CONFIG_IOB_BUFSIZE to IOB_BUFSIZE(iob)
Variable length iob can be supported

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-04-26 01:06:21 +08:00
Zhe Weng
918e38419a netfilter.h: Include <netinet/in.h> for struct in_addr
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-24 08:41:28 +02:00
Zhe Weng
6beb459a43 netfilter: Move IP6T_F to correct file
Ref: https://github.com/torvalds/linux/blob/v6.7/include/uapi/linux/netfilter_ipv6/ip6_tables.h#L91-L95

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-24 08:41:28 +02:00
Juha Niskanen
3348d03f95 libs/libc/inttypes: add support for imaxdiv
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2024-04-23 10:26:48 -03: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
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
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
raiden00pl
db7c8be61f sensors: add support for bmm150 magnetometer
add support for Bosch BMM150 Magnetometer
2024-04-20 16:20:43 -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
Zhe Weng
3a844d8dd7 net/netlink: Add NETLINK_NETFILTER's CONNTRACK support
Now we only supports conntrack info from NAT entries, to let our apps in user space know the mapping status in NAT.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-04-18 13:03:59 +08:00
Michal Lenc
9798674f27 libc: add support for reallocarray
This commit adds support for reallocarray function. The functionality
is the same as for standard realloc, but the function also checks for
multiplication overflow and fails safely in case it occurs.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-04-17 11:36:39 -03:00
Xiang Xiao
81c8f902b6 video: Move video_format_s from video.h to v4l2_cap.c
since it is only used in v4l2_cap.c.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-04-14 12:08:30 -03:00
Jakub Janousek
23c6b5b07d drivers/spi: Add support for FPGA iCE40 bitstream loading.
Tested on ICE-V-Wireless board.

Signed-off-by: Jakub Janousek <janouja9@fel.cvut.cz>
2024-04-12 10:19:58 -03:00
jianglianfang
62a4799409 video/vnc: add vnc_fb_register
To optimize the initialization of vnc, change it to vnc_fb_register.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-04-12 17:42:49 +08:00
hujun5
638716504d fdcheck: update fdcheck impl
1 store fd in the high position
2 removing the pid information , as the tag information is sufficient.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-04-11 10:45:44 +08:00
ligd
3844efb5b8 stack: update up_get_intstackbase API to support cpu id
For crash dump all the CPU intstack

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-04-09 16:59:00 -03:00
chao an
09e5dca965 sched/pthread: detached thread should destroy the join info
In order to ensure the detached thread obtain the correct return
value from pthread_join()/pthread_cancel(), the detached thread
will create joininfo to save the detached status after thread
destroyed.  If there are too many of detached threads in the
process group, the joininfo will consume too much memory.
This is not friendly to embedded MCU devices.
This commit keep the semantics as #11898 was introduced,
will no longer save joininfo for detached threads to avoid wasting memory.

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-09 13:46:51 +08:00
Pressl, Štěpán
21de46a4d1 include/nuttx/timers/pwm.h: add dcpol attribute to pwm_chan_s
This attribute can set the default polarity of a disabled channel.
2024-04-05 17:14:23 -03:00
Michal Lenc
17e1d43f6d ioexpander/icjx: add support for change of input interrupts on NINT
iC-JX expander has NINT (not interrupt) pin that goes to logical zero
if interrupt occurs. This commit adds support for iC-JX options settings
that allows to enable the interrupt for defined input pins.

The interrupt is handled in HP worker thread to avoid waiting for SPI
transfers in interrupt context. Board has to configure interrupt event
for GPIO pin connected to NINT.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-04-05 15:23:10 -03:00
Yanfeng Liu
7523654386 mm/map.h: minor revision on comments and field defs
This patch uses "struct mm_map_entry_s" instead of the non-existing
"struct mm_map_entry" with minor revision on comments.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-03 10:15:48 -03:00
chao an
ad4fb55d1f sched/environ: Improve performance of set/unset environment
reserve dimensional array of environment to avoid frequent scaling

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-03 00:10:56 +08:00
chao an
f732428331 board/control: add irq affinity control
add support for set an IRQ affinity to CPUs by software

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-30 12:21:25 +08:00
Zhe Weng
2a342d2424 net/netdev: Add netdev_iob_clone helper
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-03-29 11:52:24 +08:00
chao an
86bb721d80 nuttx/mqueue: fix build break if disable posix message queue
fix build break if enable CONFIG_DISABLE_MQUEUE:

In file included from sched/mqueue/mqueue.h:38,
                 from group/group_leave.c:45:
include/nuttx/mqueue.h:124:26: error: ‘CONFIG_FS_MQUEUE_NPOLLWAITERS’ undeclared here (not in a function); did you mean ‘CONFIG_SERIAL_NPOLLWAITERS’?
  124 |   FAR struct pollfd *fds[CONFIG_FS_MQUEUE_NPOLLWAITERS];
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          CONFIG_SERIAL_NPOLLWAITERS

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-26 17:32:11 +01:00
chao an
25339b0a17 sched/irq: spinlock should not depends on SMP
spinlock should work independently without CONFIG_SMP

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-26 15:21:52 +08:00
Xiang Xiao
79f834dcbb video: Make v4l2_ops_s to support the mutilple context
which is useful in the m2m usage scenario, by replacing the first
argument of callback from "struct v4l2_ops_s *" to "struct file *"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-26 15:21:05 +08:00
yaojingwei
f03a1a14f3 video: move user define mem_ops into imgdata_ops.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2024-03-26 15:21:05 +08:00
yaojingwei
64aecbcc5c video: add user define memory ops for v4l2 frame buffers.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2024-03-26 15:21:05 +08:00
Yanfeng Liu
f6097cfa67 mm/kmap.h: fix typo in comments
Fix typo in comments for kmm_map() function.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-26 07:41:57 +01:00
chao an
b9a74f30c6 sched/init: refine init state interface
N/A, refine init state interface

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-23 01:04:15 +08:00
ligd
a1836de09a fdt: move fdx_xx extend APIs from boards to drivers
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-22 18:51:33 +08:00
zhanghongyu
430247cc99 include: format alignment
Align the comments in the include directory

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-03-21 19:53:05 +08:00
shizhenghui
5a313d0da3 Update v4l2 ctrls & v4l2_outputparm
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-03-21 19:23:53 +08:00
Xiang Xiao
d680ba47c4 Move video_controls.h from include/nuttx/video to include/sys
The video_controls.h is a public header file, and it is used by
videoio.h. So it should be moved to the include/sys directory.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-21 19:23:53 +08:00
shizhenghui
3afd26bcd1 Add ioctl interface used in v4l2m2m
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-03-21 19:23:53 +08:00
chao an
feb6ede434 sched/cpu: replace up_cpu_index() to this_cpu()
In SMP mode, up_cpu_index()/this_cpu() are the same, both return the index of the physical core.
In AMP mode, up_cpu_index() will return the index of the physical core, and this_cpu() will always return 0

| #ifdef CONFIG_SMP
| #  define this_cpu()             up_cpu_index()
| #elif defined(CONFIG_AMP)
| #  define this_cpu()             (0)
| #else
| #  define this_cpu()             (0)
| #endif

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-21 18:52:35 +08:00
chao an
4e62d0005a sched: replace some global variables to macro
replace to macro will help to extend the scheduling implementation

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-21 18:51:25 +08:00
Radek Pesina
8f9c337c66 drivers/can/sja1000: Add SJA1000 CAN driver support
This driver is based on ESP32 TWAI CAN drivers currently available
in Nuttx, and captures the differences currently present across the
TWAI drivers for easy future adaption to remaining ESP32 platforms
with no loss of support/function. Also provides a generic SJA1000 CAN
driver solution that is CPU-architecture independent.

Changes:
- Low-level driver re-written to allow usage independent of CPU
architecture, and support both SJA1000 and TWAI CAN controllers.
- Platform-specific settings abstracted away to be provided by board
layer.
- Support for multiple instances of SJA1000 driver.
2024-03-19 15:45:53 -03:00
TaiJu Wu
23d65cb97f shced:sem: replace mutex with spinlock
The overhead of spinlok is less than mutext (mutex need to call
enter_critical section.)
After this patch, `down_write_trylock` and `down_read_trylock` can be
use in interrupt context.

The instruction is protected with mutex only one instruction so using
spinlock is better.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
2024-03-19 18:06:12 +08:00
zhangyuan21
9c0d2e1a3c armv7-a/gicv2: move IRQ to group1 and group0 as the FIQ
Purpose: make the the os crash when busyloop with interrupt disable

Follow the arm gicv2 spec, if we want to use the IRQ and FIQ
simultaneously when not using the processor Security Externsions.
We should:
1. IRQ to Group 1 and FIQ to Group 0;
2. Set CICC_CTLR.FIQEn to 1;

Then in NuttX:
1. implement the arm_decodefiq and directly crash in it;
2. provide interface to change the IRQ to FIQ, e.g. change the
   watchdog IRQ to FIQ, so the watchdog can trigger even with the
   interrupt disabled (up_irq_save() called);

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-19 18:24:42 +09:00
chao an
d4d49e9645 stdio/file: unify group file list to common single queue
unify group file list to common single queue

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-18 19:32:49 +08:00