Commit Graph

5695 Commits

Author SHA1 Message Date
simbit18 ccc0c54401 Fix Kconfig style
Remove extra TABs
Remove spaces from Kconfig
Add comments
2023-12-04 22:20:50 +08:00
shizhenghui 49398d32aa move userspace interface from video.h to sys/videoio.h
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2023-12-02 19:44:39 -08:00
chao an 09c17fcfa8 segger/rtt: correct macro name to avoid unable to change default mode
SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL should be CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-30 06:16:09 -08:00
Zhe Weng bd19065933 net/loopback: Fix flags of lo device
netdev_register will set IFF_LOOPBACK in d_flags, we should not just
change it into IFF_UP only.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-29 07:57:01 -08:00
yaojingwei a57e3f365a video.c: modify set_buf call seqence in start_capture function.
To avoid losing the first frame, the set_buf needs to excute first. At the same time, imgdata->start_capture should excuted before the imgsensor->start_capture.

Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2023-11-29 02:01:34 -08:00
Takumi Ando 3353bd3ced sensors: mx5611: Add support for MS5607
MS5607 has few differences between MS5611.

Signed-off-by: Takumi Ando <t-ando@advaly.co.jp>
2023-11-28 16:48:50 -03:00
hujun5 5a04354832 driver/tee: add some comments and document files in LICENSE
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-11-23 06:25:48 -08:00
hujun5 0c2cfc767d driver/tee: add optee client driver module
The driver's main purpose is to support the porting of the open source
component optee_client (https://github.com/OP-TEE/optee_client) to nttux.

The basic function of the driver module is to convert the REE application layer data and send it to the TEE through rpmsg.

The main functions include
1 driver registration.
we need to register a device driver(/dev/tee0) through optee_register function.
2 open the driver
3 ioctl the driver
The ioctl command passes different parameters and commands, and interacts with the TEE through rpmsg.
4 close the driver

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-11-23 06:25:48 -08:00
Daniel P. Carvalho ed877fd494 drivers:mtd: Adds support for W25 2Mbit memories.
Tested with W25Q20CL.
2023-11-22 19:39:40 -03:00
liaoao ea0be3b490 rpmsgblk: split mmc_ioc_multi_cmd to mmc_ioc_cmd for less share memory allocation
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-11-22 08:08:12 -08:00
liaoao cf27a8484f rpmsgblk: use a fixed length struct to transfer between two cpus
It may cause out_of_bounds when two side have different configuartion
on NAME_MAX and FS_LARGEFILE(affects size of blkcnt_t)

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-11-22 08:08:12 -08:00
liaoao 4b25a0dfa5 rpmsgblk: check if the block device has been removed before calling its ops
it may cause use after free if server has removed block device before calling
its operations,such as:
server: rm /dev/testrpmsgblk
client: ls /dev/testrpmsgblk

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-11-22 08:08:12 -08:00
liaoao 12d66da892 rpmsgblk: do not actually unlink blockdevice in rpmsgblk client
rpmsgblk client should not affect the server's use of blockdevice.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-11-22 08:08:12 -08:00
liaoao 27f672d55a rpmsgblk: bind block inode to ept when create ept
A segmentfault might happen when read/write/unlink ops called without an open
ops called because it bind ept's ops in rpmsgblk_open_handler.

proxy> rm /dev/ram1
segmentfault

proxy> ls /dev/ram1
segmentfault

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-11-22 08:08:12 -08:00
jianglianfang 817e02c0c8 video/fb: move wdog from fb_chardev_s to fb_paninfo_s
every pan_info should have it own wdog

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-11-22 02:01:20 -08:00
jianglianfang 10991cf5f4 video/fb: wait when the vsync queue is full in FBIO_WAITFORVSYNC
In FBIO_WAITFORVSYNC mode, if vsync queue is full it should wait
until fb_sem_post.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-11-22 02:01:20 -08:00
hujun5 1a65f5ed88 sched_lock refine: remove sched_[un]lock in xxx_waitsample
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-11-21 20:03:43 -08:00
Xiang Xiao eddd90de78 poll: pollsetup should notify only one fd passd by caller
since it's redundant to iterate the whole fds array in setup

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-11-21 09:07:17 +01:00
Xiang Xiao 11b3adf17f drivers/rtc/rpmsg: Move clock_synchronize rpmsg_rtc_server_settime
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-11-20 13:28:09 +01:00
Xiang Xiao 67bff06a24 drivers/rtc: Skip clock_synchronize if settime return positive value
so driver implementer could call clock_synchronize by self

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-11-20 13:28:09 +01:00
Xiang Xiao e6ebcb62b1 drivers/rtc: Return -ENOTTY if lower half doesn't implement the corresponding callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-11-20 13:28:09 +01:00
Xiang Xiao 673cb18a7a drivers/mmcsd: mmcsd_sdinitialize should save csd register into priv->csd
just like what mmcsd_mmcinitialize do

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-11-19 20:24:30 +01:00
raiden00pl 9a51197523 drivers/foc: add support for drv8301 power-stage driver 2023-11-18 17:07:20 -08:00
raiden00pl 4bad6048f0 drivers/foc: add support for FOC power-stage driver
There are ICs available on the market that integrate various power inverter
features. The driver for such a device must be tightly coupled to a FOC device
as using it as a separate device doesn't make sense.
2023-11-18 17:07:20 -08:00
Jonathan Kimmitt f4b77f078b skeleton.c doesn't compile without this patch if ioctls are enabled 2023-11-18 17:05:53 -08:00
weidengke f2ed885e69 fix spi slave driver build break
fix build break when CONFIG_SPI_SLAVE_DRIVER_COLORIZE_TX_BUFFER not
define

Signed-off-by: weidengke <weidengke@xiaomi.com>
2023-11-17 06:38:32 -08:00
Bowen Wang af39ee49d8 virtio-mmio: use nuttx implemented io operation instead libmetal's
Openamp/libmetal's metal io operation used the atomic operation, but
in QEMU 8.1.2, the risc-v IO region is not allow to use atomic instruction
in SMP case.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-11-17 09:42:52 +01:00
raiden00pl 6f0cf35a4e drivers/sensors/Make.defs: cosmetics 2023-11-16 20:32:41 -08:00
Petteri Aimonen 1825f9534c adjtime: Rewrite implementation to work for RTC and tickless kernel
Previous adjtime() implementation was limited to adjusting system
timer tick period. This commit reimplements the internals to use
a kernel watchdog timer. Platform-independent part of the code now
works also for adjusting hires RTC and tickless timer rate.

User code facing API is unchanged. Architecture code API has changed:
up_adj_timer_period() is replaced by up_adjtime().

Other improvements:

- Support query of remaining adjustment by passing NULL to first
  argument of adjtime(). This matches Linux behavior.

- Improve resolution available for architecture driver, previously
  limited to 1 microsecond per tick. Now 1 nanosecond per second.
2023-11-14 19:47:40 -08:00
Michal Lenc 0554b975da s25fl1: fix compile warnings caused by incorrect variable print format
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-11-14 09:08:08 -08:00
rongyichang 52d516ab46 drivers/lcd: change lcd stride from pixel to bytes
In order to achieve better scalability, change the stride
from pixel mode to byte mode.For example, in the case of RGB888
mode with 466 pixels in width and a 4-byte aligned buffer,it is
only necessary to extend the buffer of one line from 1398 bytes
to 1400 bytes, instead of extending it to 1404 bytes.

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-11-14 07:30:29 -08:00
raiden00pl 99513ac23e drivers/foc: return scaling factor for phase currents and BEMF via ioctl
These values are board-specific properties that must be known on the application side.
Until now, these values had to be hardcoded on the application side.
2023-11-14 04:34:49 -08:00
raiden00pl 7d99f01cf7 drivers/foc: get hardware information via lower-half interface 2023-11-14 04:34:49 -08:00
Ville Juven b3f20d4bd6 uart_tcsendbreak: Remove cancel point, as tcsendbreak is not one
Reference:
https://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html
2023-11-13 08:11:24 -08:00
raiden00pl 7996266f6e drivers/segger/Kconfig: cosmetics 2023-11-13 06:08:30 -08:00
yinshengkai c3009d46e9 note: delete sched_note_flatten
When we record data and dump data, they are all executed within the system,
and there is no need to consider the issue of big or small endianness.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-11-12 23:52:10 -08:00
dongjiuzhu1 0b832fd127 driver/usbdev: return -ENOTCONN when usbdev had been unbind
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-11-11 21:09:59 +08:00
dongjiuzhu1 20401c202e driver/usbdev: add unlink flags to better release endpoint resource
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-11-11 21:09:59 +08:00
dongjiuzhu1 f6098244f6 driver/usbdev_fs: fix minor issue about unbind
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-11-11 21:09:59 +08:00
rongyichang bc43c419f2 drivers/lcd: add stride support for LCD driver
support LCD stride for GET_AREA and PUT_AREA operation

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-11-09 09:52:00 +08:00
Janne Rosberg 225062305b mtd/mx25rxx: add support for MX25L25673G chip
Add support for MX25L25673G QSPI flash.
2023-11-09 09:04:38 +08:00
zhanghongyu 3610b25c91 cmake: add include path for special source
fix the cmake build error.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-11-07 17:39:03 +01:00
Zhe Weng 3e4d847f42 net/netdev: Support managing multiple IPv6 addresses by ioctl
1. Supporting `SIOCSIFADDR` and `SIOCDIFADDR` with Linux in6_ifreq struct to manage ipv6 addresses.
   Ref: https://man7.org/linux/man-pages/man7/netdevice.7.html
2. Supporting alias like 'eth0:0' for multiple IPv6 addresses, to keep previous ioctl `SIOCGLIFADDR`, `SIOCSLIFADDR`, `SIOCGLIFNETMASK` and `SIOCSLIFNETMASK` working.
   Ref: https://man7.org/linux/man-pages/man8/ifconfig.8.html

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-07 19:30:36 +08:00
chao an 85a375cd7d drivers/serial: check the remote device before get name
| #0 0x2119bf1 in rpmsg_get_cpuname rptun/rptun.c:1157
| #1 0x24f97bd in uart_rpmsg_device_destroy serial/uart_rpmsg.c:342
| #2 0x2117d56 in rptun_dev_stop rptun/rptun.c:883
| #3 0x21181d7 in rptun_do_ioctl rptun/rptun.c:922
| #4 0x2119721 in rptun_ioctl_foreach rptun/rptun.c:1086

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-07 18:27:05 +08:00
chao an 93ff6f9703 drivers/rptun: check the status before stop remote proc
Race condition if the remote proc is stoped during initialization phase

| #0  0x0249f959 in rpmsg_destroy_ept (ept=0xffffffc0) at open-amp/lib/rpmsg/rpmsg.c:376
| #1  0x024a938c in rpmsg_deinit_vdev (rvdev=0xf2303a48) at open-amp/lib/rpmsg/rpmsg_virtio.c:971
| #2  0x02117e33 in rptun_dev_stop (rproc=0xf2303a04, stop_ns=true) at rptun/rptun.c:891
| #3  0x021181d8 in rptun_do_ioctl (priv=0xf2303a00, cmd=11010, arg=0) at rptun/rptun.c:922
| #4  0x02119722 in rptun_ioctl_foreach (cpuname=0x0, cmd=11010, value=0) at rptun/rptun.c:1086
| #5  0x0211b9df in rptun_poweroff (cpuname=0x0) at rptun/rptun.c:1378
| #6  0x02053aa6 in board_power_off (status=0) at sim/sim_head.c:206
| #7  0x0253d65c in boardctl (cmd=65283, arg=0) at boardctl.c:400
| #8  0x021eb497 in cmd_poweroff (vtbl=0xef606280, argc=1, argv=0xef9b73e0) at nsh_syscmds.c:356
| #9  0x021cdb4d in nsh_command (vtbl=0xef606280, argc=1, argv=0xef9b73e0) at nsh_command.c:1164
| #10 0x021baa72 in nsh_execute (vtbl=0xef606280, argc=1, argv=0xef9b73e0, redirfile=0x0, oflags=0) at nsh_parse.c:845
| #11 0x021c6b0a in nsh_parse_command (vtbl=0xef606280, cmdline=0xef606708 "poweroff") at nsh_parse.c:2744
| #12 0x021c7166 in nsh_parse (vtbl=0xef606280, cmdline=0xef606708 "poweroff") at nsh_parse.c:2828
| #13 0x0221fa2f in nsh_session (pstate=0xef606280, login=1, argc=1, argv=0xef7a7860) at nsh_session.c:245
| #14 0x021f8c04 in nsh_consolemain (argc=1, argv=0xef7a7860) at nsh_consolemain.c:75
| #15 0x021b77eb in nsh_main (argc=1, argv=0xef7a7860) at nsh_main.c:74
| #16 0x02166ddf in nxtask_startup (entrypt=0x21b76ca <nsh_main>, argc=1, argv=0xef7a7860) at sched/task_startup.c:70
| #17 0x020b363c in nxtask_start () at task/task_start.c:134

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-07 18:27:05 +08:00
Zhe Weng 90a8e2e422 usrsock_rpmsg_server: Keep msg order in recursive call
In `drivers/rptun/rptun.c`, we have a `rptun_is_recursive` function,
which lets rptun thread run recursively. Then the `usrsock_rpmsg_ept_cb`
may be called inside `usrsock_rpmsg_ept_cb`, which can cause some
unexpected behavior, so we add a queue to keep the order of incoming
messages to reduce the complexity.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-01 10:14:18 +08:00
Zhe Weng 52fddb1f12 usrsock_rpmsg_server: Save iov and remain per endpoint
Then we may support multiple endpoints with sendto working correctly.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-11-01 10:14:18 +08:00
ligd 978e124d42 pm: use pm_staytimeout() in greedy_governor_activity()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-10-31 09:05:40 +08:00
raiden00pl 5b87fdfb9d Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
raiden00pl b565e28da3 Kconfigs: rename {Rpmsg|rpmsg} to RPMGS 2023-10-28 13:58:56 +08:00