Commit Graph

5953 Commits

Author SHA1 Message Date
ChenChuang
1d19c6abe3 fix: call rwb->rhreload() when nblocks > 0
There is no need to call rwb->rhreloade() when nblocks is 0,
and some platform(eg: BES) has the limit that the parameter
of len in pltatform flash read function cant't be 0.
2024-05-17 19:15:49 +08:00
dulibo1
3762bda5e2 pm: procfs add pm prepare fail stats
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-05-17 19:07:44 +08:00
buxiasen
c9170c3b0a pm: fix when RTC_HIRES enabled pm procfs err
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-05-16 16:23:18 +08:00
buxiasen
6ef6d75840 PM: change domain field state after callback done
Swap the sequence of domain state update and statechanged callback,
Make sure inside statechanged callback can get the old domain state.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-05-15 16:32:41 -03:00
yangsen5
33b5e1414c arch/sim_encoder: g_bufsize initialization error in g_sim_encoder_ops structure
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2024-05-15 22:03:18 +08:00
shizhenghui
ed1ad1be65 Add v4l2m2m & sim decoder
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-05-15 22:03:18 +08:00
Zhe Weng
c234fac910 net/netdev: Check quota when registering lower-half devices
Some drivers may set too big quota by accident and consume all of our
buffers, so we add a check when registering devices.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-05-14 17:43:26 -03:00
meijian
667b9eabdd [driver][tun]: add tx packets dump
Signed-off-by: meijian <meijian@xiaomi.com>
2024-05-14 22:05:08 +08:00
jianglianfang
a7961a3d48 driver/vnc:fix vnc kbd assert cause by wrong data conversion
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-05-13 18:12:48 +08:00
Jani Paalijarvi
975d99c3f6 drivers/mmcsd/mmcsd_sdio.c: Fix SD card 4-bit support
Fix a bug which causes that 1-bit mode is always selected.
This happens even if the driver sets SDIO_CAPS_4BIT capability
in case of the card and the host support 1- and 4-bit wide bus.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2024-05-10 19:43:08 +08:00
simbit18
792b99473c fix nxstyle
corrected comments in C89 style
2024-05-09 23:44:40 +08:00
Michal Lenc
a1f5fd4e72 icjx: use iC-JX interrupt config instead of the general one
There might be multiple expanders, one with interrupt used and other
without. This commit fixes initial incorrect interrupt design by
introducing ICJX_INT_ENABLE config option.

Also fixes naming of ICJX_MULTIPLE option.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-05-09 23:43:56 +08:00
hujun5
5cee996588 up_putc: int up_putc, enter_critical_section may be called
before kernel has been iniitialized,we use spin_lock_irqsave to replace.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-05-09 13:45:02 +08:00
Stuart Ianna
c4dbabb1bb drivers/devicetree: Add a set of commonly used FDT utilities. 2024-05-09 01:37:11 +08:00
Yanfeng Liu
9d6e2b97fb video/fb: add munmap support
This adds support to user-space munmap() requests in kernel build.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-05-05 22:01:26 +08:00
Yanfeng Liu
041ef1d9ea video/fb: kernel build framebuffer support
This supports running fb demo app in kernel build with new
config `rv-virt/kfb64`. The demo shows colored rectangles
in graphic window with the following console logs:

```
nsh> cat /proc/version
NuttX version 12.4.0 1ea10ddacc-dirty May  3 2024 07:03:59 rv-virt/kfb64
nsh> fb
VideoInfo:
      fmt: 13
     xres: 640
     yres: 480
  nplanes: 1
PlaneInfo (plane 0):
    fbmem: 0x80218010
    fblen: 1228800
   stride: 2560
  display: 0
      bpp: 32
Mapped FB: 0xc2000010
 0: (  0,  0) (640,480)
 1: ( 58, 43) (524,394)
 2: (116, 86) (408,308)
 3: (174,129) (292,222)
 4: (232,172) (176,136)
 5: (290,215) ( 60, 50)
Test finished
```

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-05-03 23:58:39 +08:00
Jukka Laitinen
9277be2503 Add configuration option for RTL8211F RGMII PHY
Also extend the "struct phy_desc_s" to support for 1GB PHY's, the speed
detection always needs more than one bit.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-05-02 16:30:41 -03:00
hujun5
e4d0f404f1 driver: There is no need to use sched_[un]lock
purpose:
1 sched_lock is very time-consuming, and reducing its invocations can improve performance.
2 sched_lock is prone to misuse, and narrowing its scope of use is to prevent people from referencing incorrect code and using it

test:
We can use qemu for testing.
compiling
make distclean -j20; ./tools/configure.sh -l qemu-armv8a:nsh_smp ;make -j20
running
qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic -machine virt,virtualization=on,gic-version=3 -net none -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx

We have also tested this patch on other ARM hardware platforms.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-04-30 11:35:13 -03:00
chao an
e4d4c67b78 serial/pl011: configurable clock frequency
move clock frequency into Kconfig

Signed-off-by: chao an <anchao@lixiang.com>
2024-04-30 17:26:39 +08:00
simbit18
7e30d38558 drivers/sensors/Kconfig: Added if SENSORS_BME680 for common dependency
sensor BME680: Added if SENSORS_BME680
2024-04-30 01:48:53 +08:00
raiden00pl
6621748fe8 sensors/bmi270_uorb.c: move init sequence to register function
otherwise default accel and gyro scale configured during registration is cleared
2024-04-28 21:31:39 +08:00
raiden00pl
322551b13b sensors/adxl372_uorb: wait for data ready in thread 2024-04-28 13:21:54 +08:00
raiden00pl
a34007b81f sensors/bmi270_uorb.c: fix condition for sensor stop 2024-04-28 13:21:54 +08:00
raiden00pl
1985dcd192 drivers/adxl362_uorb: various fixes
- fix compilation for fetch interface
- for data ready in thread
- add soft reset
2024-04-28 13:21:54 +08:00
raiden00pl
7a789d0775 sensors/bmm150_uorb.c: fix compilation for poll interface 2024-04-28 13:21:54 +08:00
raiden00pl
0f56d1df16 sensors/bh1749nuc_uorb.c: fix compilation when poll interface is disabled 2024-04-28 13:21:54 +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
dongjiuzhu1
c093514cea drivers/usbdev: Register the device after successful set configuration
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 22:02:02 +08:00
dongjiuzhu1
443306793c drivers/usbdev: support read ZLP packet
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 22:02:02 +08:00
dongjiuzhu1
4bcad6115b driver/usbdev: lock fs_ep resouce when call unbind
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 22:02:02 +08:00
dongjiuzhu1
d6bfa87c8d drivers/usbdev: support send ZLP(zero length packet) data packet in bulkin
status = write(g_usb_ep_in, (void*)0xFEE1DEAD, 0);

sched_backtrace
nuttx/arch/arm/src/../../../sched/sched/sched_backtrace.c:57
_assert
nuttx/arch/arm/src/../../../sched/misc/assert.c:659
__assert
nuttx/arch/arm/src/../../../libs/libc/assert/lib_assert.c:36
usbdev_fs_write
nuttx/arch/arm/src/../../../drivers/usbdev/usbdev_fs.c:770 (discriminator 1)
file_write
nuttx/arch/arm/src/../../../fs/vfs/fs_write.c:91
nx_write
nuttx/arch/arm/src/../../../fs/vfs/fs_write.c:148
ffs_transport_thread_usb_write
nuttx/arch/arm/src/../../../../external/mtp-responder/mtp-responder/src/mtp_usb_driver_nuttx.c:224
_transport_thread_usb_write
nuttx/arch/arm/src/../../../../external/mtp-responder/mtp-responder/src/mtp_usb_driver.c:80
pthread_startup
nuttx/arch/arm/src/../../../libs/libc/pthread/pthread_create.c:59 (discriminator 2)

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 22:02:02 +08:00
dongjiuzhu1
2b571e1d11 drivers/usbdev: support config usb req buffer alignment bytes
we need to alloc req buffer in cacheline size units, othersize the
data may by incorrect.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 22:02:02 +08:00
dongjiuzhu1
9ebed49d29 drivers/usbdev: update sem ptr before loop run
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 22:02:02 +08:00
dongjiuzhu1
7feb547c6f drivers/usbdev: stop read when container length is less than the maximum length.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 22:02:02 +08:00
dongjiuzhu1
0f269b1c2a driver/usbdev: report POLLPRI event when usb connect
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 22:02:02 +08:00
dongjiuzhu1
1355302036 drivers/usbdev_fs: update ctrlreq buffer len base on longest string descriptor
nuttx/mm/kasan/kasan.c:117
kasan_report
nuttx/mm/kasan/kasan.c:111
composite_mkstrdesc
nuttx/drivers/usbdev/composite.c:404
sunxi_ep0_disptach
nuttx/arch/arm/src/chip/drivers/rtos-hal/hal/source/usb/udc/udc.c:1287
up_common_handler
nuttx/arch/arm/src/chip/drivers/osal/src/hal_interrupt.c:10

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 22:02:02 +08:00
dongjiuzhu1
070ecb480a drivers/usbdev_fs: report POLLHUP when disconnect
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 22:02:02 +08:00
sunkun3
e3a6368c9a drivers/usbdev_fs: when the device is not opened, the received data is retained.
It is up to the app to determine whether the data is valid when opened

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-04-23 22:02:02 +08: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
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
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
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
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
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
simbit18
7677f10d3f fix nxstyle
fix Relative file path does not match actual file.
2024-04-16 19:09:12 +08: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
Simon Filgis
cb0e8454d7 enable support for multible devices of mcp48xx
Instead of one static dev and priv, allocate a dedicated one each time
the init is invoked.
2024-04-14 22:10:58 +08: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
wangjianyu3
f0590eeaf0 drivers/power/pm: Fix warning of type cast
Env: sim (Ubuntu 22.04.3 LTS (x86_64 GNU/Linux)), enable PM
```
power/pm/pm_autoupdate.c: In function ‘pm_auto_updatestate’:
power/pm/pm_autoupdate.c:84:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   84 |                      pm_auto_updatestate_cb, (FAR void *)domain, 0);
      |                                              ^
power/pm/pm_autoupdate.c:89:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   89 |           pm_auto_updatestate_cb((FAR void *)domain);
      |                                  ^
```

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-04-10 22:51:28 +08:00
simbit18
9967989b02 Fix Kconfig style
Remove spaces from Kconfig files
Remove TABs
Add comments
2024-04-09 10:49:23 +08:00
chenrun1
d19486e1f8 driver/filemtd:support isbad & markbad
In this change, we can mount a filesystem on filemtd that works like Yaffs and works on the Nand driver

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-04-07 18:50:00 +08:00
chenrun1
4fc111965d filemtd:fix Fixed the issue of incorrect content returned when using nandflash earse
Nand_erase return result should be the number of blocks that were successfully erased in NuttX

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-04-07 18:50:00 +08: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
chenwen@espressif.com
252e0f8a97 drivers/net/lan9250: Fix crash issue of sending packets by lan9250 driver under SMP and multi-thread
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-04-03 10:06:43 -03:00
Yanfeng Liu
1eb96c3446 virtio/gpu: minor revision on virtio_gpu_send_cmd()
This revises comments and completes reclaiming buf param.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-04-01 00:27:16 +08:00
Yanfeng Liu
715f8de1bb virtio/cmake: sync with makefile system
This adds drivers like virtio-gpu etc to cmake system to be in line
with the makefile system.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-31 08:04:47 -03:00
SPRESENSE
d5c654914e drivers/video/isx019: Fix default_value of 3A status
Fix default_value of ioctl(VIDIOC_QUERYCTRL)(id=V4L2_CID_3A_STATUS)
to AE operating and AWB operating, because both AE and AWB are
automatical adjustment mode by default.
2024-03-29 16:05:37 +08:00
SPRESENSE
33485cfe7c drivers/video/isx019: Fix the default_value of some parameters
Because the exposure time and ISO sensitivity are adjusted automatically
by default, the default value can not be defined.
So, return the value out of range as the default_value of
ioctl(VIDIOC_QUERYCTRL).
2024-03-26 20:52:28 +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
Xiang Xiao
c6821c741d video_framebuff: Replace critical section with spinlock
to avoid th global big lock and improve the performance.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-26 15:21:05 +08:00
Xiang Xiao
0db82210fd video_framebuff: Hold mutex in video_framebuff_realloc_container
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-26 15:21:05 +08:00
Xiang Xiao
efee5f86e8 video_framebuff: Remove the unnecessary vbuf_curr field
since vbuf_curr is always equal to vbuf_next

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-26 15:21:05 +08:00
yaojingwei
25e7d9e43e video: add video buffer overflow warning info.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2024-03-26 15:21:05 +08:00
shizhenghui
fa1b55d297 v4l2-cap: Add FAR to pointer
Signed-off-by: shizhenghui <shizhenghui@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
SPRESENSE
1d2fcc81f4 drivers/video/isx012: Make the I2C access more efficient
Store the i2c configuration in power on
because they are not changed permanently.
2024-03-26 07:41:21 +01:00
SPRESENSE
d9f9c0143c drivers/video/isx019: Make the I2C access more efficient
Store the length of address and the frequency in power on
because they are not changed permanently.
2024-03-26 07:41:21 +01: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
a65cdce281 cdcecm: remove duplicate assignment statements
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-03-21 20:06:13 +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
Michal Lenc
7c7e163e23 icjx: add support for multiple pin read/write
This commit implements functions icjx_multireadpin and icjx_multiwritepin.
These functions can be used for multiple pin access (read/write) if
CONFIG_IOEXPANDER_MULTIPIN is selected. This access is generally
faster than one by one pin and may simplify user application.

Changes to general functions icjx_read and icjx_write were also required
to provide support for multiple data send/receive.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-03-20 20:06:33 +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
raiden00pl
8bf6b17cc0 sensors/bmi270: fix accel and gyro data position
accel registers are DATA_8 to DATA_13
gyro registers are DATA_14 to DATA_19
2024-03-14 21:16:46 -03:00
dongjiuzhu1
e0c18c05e8 fs/driver: using nx_unlink to call unlink ops to release some resource
if driver complete unlink ops, we need to call it to release some resource,
otherwise, it will only remove inode.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-03-14 11:53:30 +08:00
xucheng5
3b79363041 mtd_config_fs : optimize nvs
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2024-03-14 00:11:41 +08:00
xucheng5
cd80900646 mtd_config_fs : support algin size
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2024-03-14 00:11:41 +08:00
zhanghongyu
e93bdfe089 tun: in tun_write, try to release iob before iob_prepare
io_pktlen will incorrect when two packets are received in a row and the packet length decreases.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-03-13 22:23:52 +08:00
shizhenghui
255090d594 Refactor nuttx v4l2
Adjust the v4l2 framework to support both capture and v4l2m2m,
and can easily add other v4l2 features.

Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2024-03-13 09:51:08 +08:00
yaojingwei
c3a3f79741 video: extend imgsensor_s interface for getting sensor device params.
Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2024-03-13 09:51:08 +08:00
SPRESENSE
bac0228825 drivers/video/isx012: Fix buffer overrun of isx012_putreg()
The maximum size of ISX012 register is 4 bytes.
So, extend temporary buffer size.

Detected by CodeSonar 141893
2024-03-11 15:44:39 +01:00
SPRESENSE
3419f018a4 drivers/video/isx019: Delete unnecessary code
Because of misunderstanding spec, unnecessary codes exist.
Delete them.
2024-03-11 15:44:39 +01:00
SPRESENSE
baa2dc5cad drivers/video/isx019: Store initial gamma value
Set initial gamma value to enable application to get
the correct initial gamma value.
2024-03-11 15:44:39 +01:00
SPRESENSE
2b04210b16 drivers/video/isx019: Fix default ISO sensitivity
ISX019's ISO sensitivity is in auto adjustment mode by default.
Then, default ISO sensitivity value should be auto adjusted value.
2024-03-11 15:44:39 +01:00