Commit Graph

5677 Commits

Author SHA1 Message Date
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
TimJTi
896727b576 Add new ioctls 2023-10-27 13:52:28 -03:00
raiden00pl
c2863f90f6 bluetooth rpmsg depends on RPTUN 2023-10-27 13:27:05 -03:00
dongjiuzhu1
ed6fb11de6 driver/mtd: get mtd_geometry_s.model for mtd partition and optimize code
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-10-26 20:02:45 +08:00
dongjiuzhu1
68fc3adeff drivers/usbdev: config USBDEV_TRACE_INITIALIDSET when disbale USBDEV_TRACE
usbtrace is valid when enable USBDEV_TRACE or DEBUG_FEATURE && DEBUG_USB,

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-10-26 16:32:18 +08:00
chao an
2b06142232 kernel: replace all sem_* to nxsem_*: in kernel space
syscall cannot be called from kernel space

Signed-off-by: chao an <anchao@xiaomi.com>
2023-10-25 15:46:03 +08:00
chao an
3cadf6642a kernel: replace all usleep to nxsig_usleep in kernel space
syscall cannot be called from kernel space

Signed-off-by: chao an <anchao@xiaomi.com>
2023-10-25 15:46:03 +08:00
zhanghongyu
5374af077b tun: Fix the error of calling tun_close when tun_txavail or tun_txavail_work is executed
When tun_txavail_work is running, switch to tun_close thread and priv->lock will be destroyed, then switch back to tun_txavail_work thread, an error will occur when nxmutex_unlock(&priv->lock)

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-10-25 01:13:21 +08:00
zhanghongyu
3b469271d7 Revert "tun: Fix the error of calling tun_close when tun_txavail or tun_txavail_work is executed"
This reverts commit 0f1a49bba5.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-10-25 01:13:21 +08:00
yinshengkai
605c4e6c1f note: fix notesnap compilation failure
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-10-23 12:50:19 +03:00
zhanghongyu
3ad28c28aa usrsock: Make the field of usrsock_request native alignment
There is a risk that interfaces such as psock_ioctl/psock_setsockopt
will cause paramete to be not four-byte aligned after calculating the
offset, so align the length of the structure with parameters by four
bytes.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-10-21 10:55:30 +08:00
zhanghongyu
0f1a49bba5 tun: Fix the error of calling tun_close when tun_txavail or tun_txavail_work is executed
When tun_txavail_work is running, switch to tun_close thread and priv->lock will be destroyed, then switch back to tun_txavail_work thread, an error will occur when nxmutex_unlock(&priv->lock)

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-10-21 06:29:21 +08:00
makejian
be72a6e26f math/mpi: add mpi driver in math
add interface for MPI(Multiple Precision Integer) registration in /math/mpi
Signed-off-by: makejian <makejian@xiaomi.com>
2023-10-17 13:43:43 +08:00
yinshengkai
58c6b60df5 note: remove remaining event code
Some event-related codes were missed in the previous modification and have not been deleted.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-10-17 09:07:06 +08:00
Philippe Leduc
98b15b1409 Cleanup interface and a4988 implementation
Change step frequency from step/ms to step/s
Add DRV8825 stepper driver
2023-10-16 08:55:53 +08:00
chenrun1
73ca090ab9 filemtd:Fix teardown return error number EINVAL
In previous versions, during the teardown phase, the "open_blockdriver" would call the "mtd proxy" causing the "file mtd" node to be registered in the ftl. " node is registered in ftl.
Therefore, we changed the behavior to find the corresponding inode by node name.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-10-15 01:29:12 +08:00
Philippe Leduc
095c32b0eb Add a stepper generic upperhalf driver
Add a stepper A4988 lowerhalf driver
2023-10-14 12:28:41 -04:00
Xiang Xiao
f196d108bf drivers/note: Change 0/1 to false/true
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-13 14:38:51 -04:00
liqinhui
d27ca03b6c wifi/simdriver: Support the sim wifi.
Add the Sim WiFi function, which can provide the wifi operating on nuttx sim emulator,
  and support two modes that simulate wifi, HWSIM and RNC(real network card).

 - In the HWSIM mode, we simulates two wlan interfaces. The wlan0 is STA and
   the wlan1 is AP. The wlan0 can connect to the wlan1 in the nuttx simulator.
 - In the RNC mode, we can use the same wlan interface name on the nuttx simulator
   to control the connection behavior of the real wireless card.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-10-12 17:08:25 +08:00