Commit graph

43031 commits

Author SHA1 Message Date
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
zhangguoliang
888ea2ae84 fix: charger: change the operations of battery ioctl to common
Almost all charger chip need the same oprations, which was not
appropriate only for BQ2429X. Therefore, open the operations to
all charger chips.

Signed-off-by: zhangguoliang <zhangguoliang3@xiaomi.com>
Change-Id: Iac5653eab68e551391537d6b5c2a18004a8023fe
2021-09-22 09:01:41 +00:00
Jiuzhu Dong
0e53d0b6ec exfat: limit EXFAT_UTF8_NAME_BUFFER_MAX and EXFAT_UTF8_ENAME_BUFFER_MAX to EXFAT_NAME_MAX
N/A

Change-Id: I60db1053ed53631de5d590fb188ec0d1cc58109f
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-22 10:26:27 +08:00
weizhifang
d6a798ebf2 feature: charge: modify battery_gauge code
CHAMPION-137

1.add temperature and current ioctl api

Signed-off-by: weizhifang <weizhifang@xiaomi.com>
Change-Id: I958f37aa385d942b24a44c696a7b8d5c45d3b9c5
2021-09-22 09:36:15 +08:00
weizhifang
9391f43482 feature: charge: add battery gauge cw2218 driver
CHAMPION-137

1.add cw2218 driver code

Signed-off-by: weizhifang <weizhifang@xiaomi.com>
Change-Id: I32bdb045fdddf976b0643b064b892b6092109f2a
2021-09-22 09:35:55 +08:00
liangdongdong
af949ba40d feature: bsp: add bq25618 driver
CHAMPION-105

Signed-off-by: liangdongdong<liangdongdong@xiaomi.com>
Change-Id: I061f297e7a65137b610f6fe4edc0305bf86934b9
2021-09-18 18:46:22 +08:00
liuhaitao
905d956ee7 checkpatch.sh: add -m option to enable/disable Change-Id check
Defaultly disable Change-Id check in commit message.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
Change-Id: Ic16f9cc9abc7d27c4e3e6ded27b8e27f2a1e312d
2021-09-18 17:17:48 +08:00
liucheng5
bd6f56907a fix: nxstyle: detect --,->,++ not next to operand
N/A

The nxstyle check tool can't recongnize the style error that --, -> or ++ is not next to the operand. For example, "idx ++;", "p ->member" or "(-- idx)", which is in incorrect style, is not recongnized. This patch add detection for these cases.

Change-Id: Ic6b71ddeca95db9057b4b707a670891a03b8d6a4
Signed-off-by: liucheng5 <liucheng5@xiaomi.com>
2021-09-18 16:16:13 +08:00
yangjiukui
17ce9d6956 fix: sensor: add factory test for lsm6dso.
CHAMPION-124

Add read id and selftest interface in ioctl, it will
be called in the factory test. Fix some bugs in driver.

Change-Id: I4bd63ad68f4fec11d51dd05f27e03d58635cf21f
Signed-off-by: yangjiukui <yangjiukui@xiaomi.com>
2021-09-18 14:25:40 +08:00
Xiang Xiao
d980c0ffa2 arch/riscv: Rename riscv_puts to up_puts
since it's a common API defined in include/nuttx/arch.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-09-18 12:25:28 +08:00
Xiang Xiao
6d888dc8a7 arch/z16: Implement up_puts function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-09-18 12:25:22 +08:00
Xiang Xiao
ae58c07fa7 arch/sim: Implement up_puts function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-09-18 11:21:09 +08:00
zhuyanlin
ac0af22180 build:xtensa: remove build warning
./build.sh: line 67: [: too many arguments

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
Change-Id: I83cab068c73b4f5a0261107625ad94eb28fe20c4
2021-09-18 10:12:07 +08:00
yinshengkai
169966fff9 vfs: modify nuttx file access permission check
N/A

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Change-Id: Iac3541f05fae7cb505701ee07ab351f352ba1583
2021-09-17 17:24:37 +08:00
Huang Qi
c74bb5ccec tools/build.sh: Add WASI_SDK_ROOT env variable
VELAPLATFO-120

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: I312bd9eeaea41c9c2a8fc7573079eec75cf3ed80
2021-09-17 10:59:29 +08:00
zhuyanlin
1464315884 xtensa:backtrace: flush to stack when in interrupt
The registers may be in window when in interrupt.
Flush window stack to stack first.
And fix warning in build.

Change-Id: I45f3a8e6aa4f8baa1d54871a02bd6defc8915144
2021-09-17 10:12:40 +08:00
zhuyanlin
57bafa48b8 arch:xtensa:dumpstate: use sched_dumpstack
Use sched_dumpstack instead. The backtrace infomation like

xtensa_user_panic: User Exception: EXCCAUSE=0009 task: hello
xtensa_registerdump:    PC: 202b32b8    PS: 00060030
xtensa_registerdump:    A0: a02acb87    A1: 20998d10    A2: ffffaaaa    A3: 12345678
xtensa_registerdump:    A4: a02ba26c    A5: 209949c0    A6: 20990994    A7: 00000258
xtensa_registerdump:    A8: a02b32af    A9: 20998cb0   A10: 0000000f   A11: 209949a0
xtensa_registerdump:   A12: a02be95c   A13: 20994980   A14: 00000003   A15: 209949d0
xtensa_registerdump:   SAR: 00000000 CAUSE: 00000009 VADDR: ffffaaaa
xtensa_registerdump:  LBEG: 00000000  LEND: 00000000  LCNT: 00000000
xtensa_registerdump:  TMP0: 202b1512  TMP1: 20998af0
sched_dumpstack: [BackTrace| 3|0]:  0x202acbae 0x202b232e 0x202b1912 0x202b19f5 0x202b24f1 0x202b152f    0x40023 0x202b32b0
sched_dumpstack: [BackTrace| 3|1]:  0x202acb87 0x202a86a4

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-09-16 20:17:37 +08:00
zhuyanlin
40840204f3 arch:xtensa: add up_backtrace support
Up_backtrace can be backtrace from task or interrupt.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-09-16 20:17:34 +08:00
zhuyanlin
0bad15d41e xtensa:arch: force up_getsp to inline
Up_getsp may be not inline in gcc, thus get the sp
is up_getsp function's sp, not the caller function.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-09-16 20:17:31 +08:00
zhuyanlin
b1e6bd158a arch:xtensa: remove WSBITS/WBBITS to core.h
Remove WSBITS/WBBITS macro to core.h as may be used by
arch common code.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-09-16 20:17:26 +08:00
chao.an
358e387d8a net/local: split the waiter node from lc_node
Change-Id: I5b052aa34bf9c37dcfd948d24875454467ed8af5
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-16 17:42:05 +08:00
Jiuzhu Dong
de00e567da syslog: reslove crash because vmov.i32 instruction is not ready when system boot
So avoid to use vmov.i32 instruction before FPU is ready.

Before modification:
3c03b35c <nx_vsyslog>:
3c03b35c:	f2c00010 	vmov.i32	d16, #0	; 0x00000000
3c03b360:	f2c02050 	vmov.i32	q9, #0	; 0x00000000
3c03b364:	e92d40f0 	push	{r4, r5, r6, r7, lr}
3c03b368:	e24dd08c 	sub	sp, sp, #140	; 0x8c
3c03b36c:	e28d301c 	add	r3, sp, #28
3c03b370:	e2505000 	subs	r5, r0, #0
3c03b374:	edcd0b0f 	vstr	d16, [sp, #60]	; 0x3c
3c03b378:	edcd0b01 	vstr	d16, [sp, #4]

After modification:
3c03b35c <nx_vsyslog>:
3c03b35c:       e92d40f0        push    {r4, r5, r6, r7, lr}
3c03b360:       e2505000        subs    r5, r0, #0
3c03b364:       e24dd08c        sub     sp, sp, #140    ; 0x8c
3c03b368:       e1a06001        mov     r6, r1
3c03b36c:       e1a07002        mov     r7, r2
3c03b370:       e28d000c        add     r0, sp, #12
3c03b374:       1a00003a        bne     3c03b464 <nx_vsyslog+0x108>

Change-Id: I643c19f5416c94a529764fdaa81f3088fcf95355
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
(cherry picked from commit 696bf0d368a62493c3d7462735127ed2c6ef7594)
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-16 10:50:31 +08:00
Jiuzhu Dong
e2c717d1fd net: limit NET_NACTIVESOCKETS to 4 when enable DEFAULT_SMALL
Change-Id: Iac28b59227f84c4df0d81d75f34aabad39191f5b
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-16 10:50:24 +08:00
Xiang Xiao
c1c478538f drivers/sdmmc: Remove rwbuffer to avoid panic
since rwbuffer isn't fully initiailized in mmcsd_slotinitialize.
BTW, if the cache is important for performance, it is better to
implement a general block cache and put in a common location.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-09-16 10:45:54 +08:00
chao.an
32ea5aa887 net/local: replace the listener list to global
Change-Id: Id4700fddeea27a2a86cca2e4aa6284424b53ec4d
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-15 23:20:57 +08:00
chao.an
2394394401 net/local: bypass the message field to support SCM further
Change-Id: I51028036db049788d7db4289e26821a3bf1e1dd0
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-15 23:08:30 +08:00
chao.an
09a752e602 net/local: add local_peerconn helper
Change-Id: I2cbceb68f709c581bc0b878844dd16efcd76d4a7
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-15 22:04:12 +08:00
zhuyanlin
0b1f2fcb45 xtensa:dcache_clean: use DCACHE_LINZESIZE instead of DCACHE_SIZE
Clean_dcache use DCACHE_LINZESIZE instead of DCACHE_SIZE in addr loop

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
Change-Id: I7c37ff91b06fff2f29c142a43127acac7fc92941
2021-09-14 19:56:50 +08:00
chao.an
3d22d6b631 vfs/poll: correct the return event if inode has disconnect
Change-Id: I0f312a706ab1be8d8ac91b1d77cd3c1be0671457
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-14 13:04:42 +08:00
chao.an
ad480a31bd net/local_recvmsg: remove unused return
Change-Id: I4c3b9a17a36fbb1aba84ebfb96bbe5920d03ddf5
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-13 18:04:47 +08:00
ligd
590561dd8d openamp: select DEV_SIMPLE_ADDRENV when openamp opened
Change-Id: Id87868a3879165da1e729aca02173ecbcb896454
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-09-13 17:31:29 +08:00
Jiuzhu Dong
a3de95c7d7 exfat: fix comlile break because tzset undefine
Change-Id: Ia2a9b5474d5fd7b66de2353b9c62483af7d35c8a
Signe-off-by: Jiuzhu Dong <dongjiuzhu1@xiaom.com>
2021-09-13 12:01:54 +08:00
Xiang Xiao
dcebb60441 arch/arm: Add ARCH_CORTEXM55 Kconfig for cortex-m55
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-09-13 11:28:41 +08:00
zhouliang3
66e451b8f6 fs/littlefs: revert fstat and use lfs_file_attr function
N/A

Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
Change-Id: Ifaa12b2b7450be5875ae2bb62084801561861e22
2021-09-13 10:04:30 +08:00
zhuyanlin
4d1affa210 uClibc++:remove typeinfo.cpp that confict with libsupc++
Typeinfo.cpp already defined in libsupc++

Change-Id: Ie61b95d8fa9da2034b57498de006dce8551c5ad5
2021-09-10 15:32:17 +08:00
Jiuzhu Dong
aa1c65a364 errno: use staic errno to replace tl_errno before tls initialization
Change-Id: I44a53b2f5cdb3f4e6c755e5663867cd74361bc7c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-09 21:18:32 +08:00
liushuai25
00d49aa9c2 feature: driver: add interface for fb driver
CHAMPION-99

add get and set panel power interface for fb driver.
add get and set framerate interface for fb driver.
add panel information at videoinfo for fb driver.

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
Change-Id: I4121411280027b12e7ab68c56a68d1efbbcc7641
2021-09-09 20:31:28 +08:00
liushuai25
193e898b51 feature: driver: add interface for lcd dev driver
CHAMPION-100

add get and set framerate interface for lcd dev driver.

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
Change-Id: I42584fa2adde9783fac9ac31bfe0b29b426a82e1
2021-09-09 20:28:58 +08:00