Commit Graph

43068 Commits

Author SHA1 Message Date
liucheng5 9c792338de fix: sensor: add 3 sensor types to sensor.c
CHAMPION-147

Three sensor types (ecg, ppg and impd) had been added in sensor.h(http://git.xiaomi.com/c/miot/mirtos/nuttx/+/813239), while they had not been added to sensor.c, causing that a sensor of these 3 types can't be registered. This fixes it.

Change-Id: I313b9bdc621d91b0ff934ca8322270fd6552948b
Signed-off-by: liucheng5 <liucheng5@xiaomi.com>
2021-10-12 19:22:49 +08:00
Xiang Xiao 0def56d17f power/polaris: Replace ops and batsem with dev
and remove the batsem initialization since it is arleady done in common code

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6561eb53f3211edae8f699fbf9d7625689ee581c
2021-10-11 19:34:08 +08:00
Xiang Xiao 1158068ade libc/vsprintf_internal: Call va_copy just like vsyslog
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I96cf364d9a6d438bcca4bf01f1a56c6cc172d19c
2021-10-11 12:04:38 +08:00
Xiang Xiao 7a017b5be0 lib/vasprintf: Shouldn't call va_end(ap) to avoid the double free
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I20e10803e7923fbbd8b5fdccca1fdb4c9d090434
2021-10-11 12:04:38 +08:00
Xiang Xiao cbb0f3483a audio/comp: Call va_start again instead of va_copy
since va_copy mayn't exist on all arch

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I4860b6c09cd20f93115bc73b4a4845af28a5ed86
2021-10-11 12:04:38 +08:00
genghuihui 7731367027 fix: update aw88266a lib
CHAMPION-140

update aw88266a lib of stable version

Signed-off-by: genghuihui <genghuihui@xiaomi.com>
Change-Id: Ia426c3d895d3bb1b1bdf8a187bdc5a017be0ffe5
2021-10-11 11:08:04 +08:00
Xiang Xiao b8e99cf12f arch/arm: Remove -march and -mtune
since -mcpu is enough https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58869

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-09 15:57:53 +08:00
ligd b6e357eccf socket_rpmsg: support SOCK_SEQPACKET
Change-Id: Ib7d80210285386cb10de35400b3cd6d2854f5503
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-10-09 15:31:36 +08:00
chao.an 43fa44cd2a arch/sim/bluetooth: remove depends if native host stack
Change-Id: Icc4f5e88ac43e0ea14bd0b4ea4b86cb50f773b61
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-10-09 15:26:26 +08:00
anjiahao 1f37c8c3b4 battery_monitor:add poll support
N/A

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Change-Id: Iefe3e632e98963c0e873d6266aacc3f687a77164
2021-10-09 15:25:22 +08:00
Jiuzhu Dong 4a7cdc93c3 net: always compile listen.c and accept.c when enable CONFIG_NET
N/A

Change-Id: Iefb46bac2c7322b44b8b1ae410db66d072703351
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-09 12:15:06 +08:00
anjiahao 924eee1e77 battery_gauge:add poll support
N/A

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Change-Id: Id6363d9573176f4a922a31bcf6f4d770600826b8
2021-10-09 11:27:33 +08:00
zhangguoliang e6d84fccc9 feat: charge: initialize rx charger stwlc38 driver
CHAMPION-25

Signed-off-by: zhangguoliang <zhangguoliang3@xiaomi.com>
Change-Id: Ifa5732ae2160d4bc083f9aaf4e3beb34096b7770
2021-10-09 11:17:18 +08:00
liushuai25 7df6d25fc3 fix: driver: modify some fields and comments
CHAMPION-91

change FBIOPAN_DISPLAY IOCTL command to _FBIOC(0x0016).
change  xoffest to xoffset in fb_planeinfo_s.
modify comments for xoffset and yoffset in fb_planeinfo_s.
add comment for pandisplay interface.

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
Change-Id: Idb7805dd9691b849f19e3d7010bcfabbaa48797b
2021-10-08 16:23:57 +08:00
anjiahao a7f50294a5 battery_charger:add poll support
N/A

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Change-Id: I761c4f6d1cd9e6edbf14f6e026a5c3337bdf8134
2021-10-08 14:58:21 +08:00
liuhuan 4987e17e9a power: Open CONFIG_PM compilation failed
CHAMPION-144

include debug.h

Change-Id: I12b0c5a2d5e41178a4f158ce0de8393bae0ee26d
Signed-off-by: liuhuan <liuhuan16@xiaomi.com>
2021-09-30 16:16:51 +08:00
Xiang Xiao 3394b87f25 fs/partition: Make read_partition_block callable outside ptable
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I42d036116783b7a08af6eb8a8f82905c485b7f91
2021-09-30 13:21:28 +08:00
chenhonglin 1b6104200a sched/sched: Updata out-of-data comment about SMP CPU affinity issue
THOR-208

As before commit 070ad15f14 and 1621fcb09e
Fix issue about CPU affinity, But these two comments don't
update comment. Github version updated that. So sync it.

Signed-off-by: chenhonglin <chenhonglin@xiaomi.com>
Change-Id: Ie5abf10893e66334d3dd9939bd85f2a40741a2c5
2021-09-29 18:26:21 +08:00
Xiang Xiao 8c2a40f864 power/battery: Move the enumurate to the common place
so the userspace program can handle the different battery driver equally

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib00bb6bd6c543c01cb0ed03bc631ec8337720528
2021-09-29 17:33:23 +08:00
yinshengkai c40a7eb930 tool: add code coverage tool
N/A

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Change-Id: I9388a08565508383e53b418696c14ae286b172ce
2021-09-29 16:34:00 +08:00
Jiuzhu Dong 959f5496de driver/sensor: support sensor_ops: selftest
Change-Id: I9aaadd2d6a61aed8212f2a88c507caeeb433c360
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-29 15:28:39 +08:00
Jiuzhu Dong 8ad2be7915 driver/power: using upper-half structure directly in the lower-half structure.
N/A

Change-Id: I29da755e303191788cb79ddb6972045a5c368c83
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-29 14:01:34 +08:00
Jiuzhu Dong cd9f115550 wd_start: use sclock_t type replace int
MIRTOS-1055

when enable SYSTEM_TIME64, tick may exceed the int32 range
example:
pthread_cond_clockwait
        ---->clock_abstime2ticks
                    ---->wd_start

Change-Id: Id6b8f9e92cbcad285c8fa684a73b7d75a8ccfebc
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-29 10:24:28 +08:00
ligd d5e4ed61ea rpmsg_socket: move rpmsg_send out of lock
Change-Id: I19a4d12979016de7bb254c4bd0309c80ce339769
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-09-28 14:17:42 +08:00
ligd c0ffee0728 mm: do kmm_checkcorruption in IRQ when TCB_FLAG_DEBUG_CHECK set
Change-Id: Iad5dc7e0aa07a854f64b79b6e3eae57c4112a998
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-09-28 12:36:05 +08:00
ligd caee5581c2 sem: remove limitation of irq context when do sem_trywait
Change-Id: I818c349d9396743877e99c5b04fc7265750a5ec3
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-09-28 12:36:05 +08:00
Huang Qi b897d4a2d6 sched/signal: Correct kill with cancellation
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: I450041e9ec297ba4a9028cb5b1af8158e09fc90b
2021-09-28 09:27:53 +08:00
chao.an f2e15a47de net/local: set the filep to peer on stream mode
Change-Id: I2e0b8f31bcd3c1c238f1b18456416678d5deae1e
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-27 17:03:46 +08:00
zhuyanlin 758c042b01 sched:tcb_s:rearrange sched_priority/int_priority to word align
As pid_t is uint16_t,this could save space for many archs.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-09-27 15:07:47 +08:00
zhuyanlin 7401411e13 tool: checkstack: add xtensa support
N/A

Change-Id: Ic06fc91f237319709705dc4ee79141ff47801ca4
2021-09-27 15:07:43 +08:00
zhuyanlin 147dc1a58b fs:procfs: add waiting_paging_fill state names
Follow task_state in tcb_s.

Change-Id: I0d3b3335d4f9ad772f3feee75d0138b9b9fb1ce2
2021-09-27 15:07:38 +08:00
anjiahao ee94d58051 littlefs:fix rmdir can remove a file
MIRTOS-889

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Change-Id: I0cf6962f0f5c1fdbe4678918560d45d6c8acc681
2021-09-27 14:22:26 +08:00
songnannan 5766096fe8 feature: sensor: add lps27hhw baro sensor driver.
CHAMPION-96

Add lps27hhw baro sensor driver to sensor drivers.

Change-Id: I0b1c9809eef13b564166621961c1679ed8de415b
Signed-off-by: songnannan <songnannan@xiaomi.com>
2021-09-27 10:51:00 +08:00
chenhonglin 070ad15f14 sched/sched_setpriority.c: Fix CPU affinity issues in SMP
THOR-208

In "nxsched_nexttcb": the task may not running on this_cpu,
and rtrtcb->affinity(the affinity of the task in g_readytorun)
may not include the current cpu which should be the tcb->cpu.

Signed-off-by: chenhonglin <chenhonglin@xiaomi.com>
Change-Id: I2523c9431b480a3afeb29a9260804c5b37e91d4b
2021-09-27 10:13:37 +08:00
chenhonglin 1621fcb09e sched/sched/remove_readytorun.c: Fix CPU affinity issues in SMP
THOR-208

In "nxsched_remove_readytorun":
the logical may choose the head of g_readytorun(the greatest priority)
task as the next while ignoring the cpu affinity of it.

Signed-off-by: chenhonglin <chenhonglin@xiaomi.com>
Change-Id: I819dd6f3fc0feff4e378cfda2a6c581814065cb3
2021-09-27 10:13:24 +08:00
liushuai25 7f3456de09 feat: driver: support double buffer for display
CHAMPION-91

add pan display for fb driver.

reference links:
https://github.com/torvalds/linux/blob/master/drivers/video/fbdev/core/fbmem.c
https://github.com/torvalds/linux/blob/master/drivers/video/fbdev/goldfishfb.c

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
Change-Id: If322cab9be2784e42f84060f8e94f52757c0dd8a
2021-09-27 09:53:35 +08:00
futerigele ea1e5c3d2c feat: touch: add nt38350 selftest
CHAMPION-95

add nt38350 selftest

Change-Id: I15cbaf04f9dc9131b4e661cd29e56d5bece6b4db
Signed-off-by: futerigele <futerigele@xiaomi.com>
2021-09-26 17:09:40 +08:00
zhangguoliang 4fc0e71ba6 fix: charge: initialize pump charger sc8551a driver
CHAMPION-25

fix commit miss to delete the config of battery fuel gauge CW2218

Signed-off-by: zhangguoliang <zhangguoliang3@xiaomi.com>
Change-Id: I2b6fdfcdc8d3ce35a91defe9fa6a5d76681d5f8b
2021-09-24 11:19:29 +08:00
chao.an c03abd35bf arch/sim/naming: add getsockname/getpeername into naming list
Change-Id: I2e9c9dd2295f9f09e3e400729f5c5d06fbeeeb48
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-23 19:49:21 +08:00
chao.an c4fcd68c9b arch/sim/usrsock: correct the address length
Change-Id: I1ed880b0d531b86d2f91fd0b6153a5f641ec6313
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-23 19:47:47 +08:00
chao.an 538ef4f6d5 net/tcp: sanity check for the listen address
Change-Id: Idb6ce5b5cc22aa3b2586bcf1c0abe0268f136b51
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-23 15:57:55 +08:00
liangdongdong 95983c6e48 feature: bsp: optimize bq25618 driver function
CHAMPION-105

Signed-off-by: liangdongdong<liangdongdong@xiaomi.com>
Change-Id: Iafa079c12a9ec385a3cd8c7c53fd31a0960b25da
2021-09-23 15:45:15 +08:00
chao.an 3c67a53f7d net/local: add socket message control support
Change-Id: I95350fdff292dbf1b4132f7a98a6454068ef6173
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-23 11:31:58 +08:00
chao.an b834ed9bd8 net/dup: only start tcp monitor on INET domain
Change-Id: Ic36a26190aa9c2d9f6418787e012ea26261abc8f
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-23 11:31:58 +08:00
chao.an 4f90e3877e arch/sim: add native socket support
Change-Id: If0239d97b6fcc2c10315504448d4f6b705e4d7df
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-23 11:31:34 +08:00
futerigele 5a62cff0e5 feat: touch: bring up novatek nt38350 touch panel
CHAMPION-95

bring up novatek nt38350 touch panel

Change-Id: Ia890518620a00df0bd9e51aface1bb019034ec94
Signed-off-by: futerigele <futerigele@xiaomi.com>
2021-09-23 11:18:47 +08:00
chao.an 69463373a4 Revert "net/local: bypass the message field to support SCM further"
This reverts commit 2394394401.

Change-Id: Ia13bc67c4181e0e7cd06a875c0516a2c2c627315
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-22 22:14:40 +08:00
Alexander Lunev a72c10cb55 net/devif/devif_callback.c: made the connection event list doubly linked.
The resulting time complexities are as follows:
* devif_callback_alloc() time complexity is O(1) (i.e. O(n) to fill the whole list).
* devif_callback_free() time complexity is O(1) (i.e. O(n) to empty the whole list).
* devif_conn_event() time complexity is O(n).

Change-Id: Id43218407bfd67659bbf5daf40b1d096ea201e45
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-22 19:31:02 +08:00
Alexander Lunev eafe6e50ac net/devif/devif_callback.c: corrected the connection event list to work as FIFO instead of LIFO.
In case of enabled packet forwarding mode, packets were forwarded in a reverse order
because of LIFO behavior of the connection event list.
The issue exposed only during high network traffic. Thus the event list started to grow
that resulted in changing the order of packets inside of groups of several packets
like the following: 3, 2, 1, 6, 5, 4, 8, 7 etc.

Remarks concerning the connection event list implementation:
* Now the queue (list) is FIFO as it should be.
* The list is singly linked.
* The list has a head pointer (inside of outer net_driver_s structure),
  and a tail pointer is added into outer net_driver_s structure.
* The list item is devif_callback_s structure.
  It still has two pointers to two different list chains (*nxtconn and *nxtdev).
* As before the first argument (*dev) of the list functions can be NULL,
  while the other argument (*list) is effective (not NULL).
* An extra (*tail) argument is added to devif_callback_alloc()
  and devif_conn_callback_free() functions.
* devif_callback_alloc() time complexity is O(1) (i.e. O(n) to fill the whole list).
* devif_callback_free() time complexity is O(n) (i.e. O(n^2) to empty the whole list).
* devif_conn_event() time complexity is O(n).

Change-Id: I1123657f9a591b29f2a7546691d58dff58896a18
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-22 19:30:52 +08:00
zhangguoliang a87fbef0f1 feat: charge: initialize pump charger sc8551a driver
CHAMPION-25

Change-Id: I32bf77d04fc5c67f52dcc7ec8081a3feb4b08795
Signed-off-by: zhangguoliang <zhangguoliang3@xiaomi.com>
2021-09-22 19:13:02 +08:00