Commit Graph

50488 Commits

Author SHA1 Message Date
fangxinyong
903e87a7bd builtin: support uid/gid config for binfs app
Implement I_SUID/I_SGID feature for binfs in the POSIX compliant way.
If set-user-ID bit is set in the file permissions, then the effective
user ID of process shall be set to UID of the new process image file.

test case:
hello example emulates to set uid and file set-user-ID bit, and call
geteuid and getegid API.
UID  = 2000
GID  = 3000
MODE = 06555

nsh> ls -l /bin/hello
 -r-sr-sr-x    2000    3000       0 hello
nsh> hello
geteuid:2000
getegid:3000

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-14 01:37:00 +08:00
jianglianfang
5accd7c146 drivers/video: add Goldfish-FB driver
the register definition is described here:
https://android.googlesource.com/platform/external/qemu/+/master/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT

Goldfish-FB driver is to communicate with Goldfish-FB in QEMU, and push the framebuffer data to the emulator for display on the screen.
test: CONFIG_GOLDFISH_FB =1, and run demo=>lvgldemo widgets

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-08-13 11:51:30 -03:00
rongyichang
72587c6e79 drivers/virtio: add virtio input driver
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-13 11:47:39 -03:00
raiden00pl
5572552024 arch/nrf53: port 6e8f25ba3b change from nrf52
Added config setting for NRF53 I2C timing bug workaround
2023-08-13 11:45:06 -03:00
raiden00pl
eec59015f0 arch/{nrf53|nrf91}: port cc99d94cfd change from nrf52
Fixed NRF52 I2C register naming
2023-08-13 11:45:06 -03:00
raiden00pl
3a61db4c7b arch/nrf53: port d7aea88727 change from nrf52
Changed NRF53 USB initialization to check for power via USBREGSTATUS instead of waiting for interrupt
2023-08-13 11:45:06 -03:00
raiden00pl
fc4ddfb1f4 arch/nrf52/nrf52_twi.h: fix condition
missing prefix CONFIG_* in commit 6e8f25ba3b
2023-08-13 11:45:06 -03:00
raiden00pl
bcef7d32f5 arch/nrf52/nrf52_i2c.c: remove unnecessary include introduced in cc99d94cfd 2023-08-13 11:45:06 -03:00
simbit18
693b034827 arch/arm/src/nrf91/Kconfig: Fix Kconfig style
Add TABs
Add comments
Remove spaces from Kconfig file
2023-08-13 11:44:19 -03:00
wanggang26
92eeaa4277 enable CONFIG_BOARDCTL for ofloader
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-08-13 11:43:43 -03:00
Xiang Xiao
bd30d1a4d5 arch: Move trustzone related setting to common place
to share the security setting between arm32 and arm64

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-13 08:43:01 +02:00
Xiang Xiao
b183114d43 arch/arm: Change the default value to ARCH_TRUSTZONE_NONSECURE
since nuttx normally run inside the non secure execution environment

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-13 08:43:01 +02:00
Brian Doherty
d7aea88727 Changed NRF52 USB initialization to check for power via USBREGSTATUS instead of waiting for interrupt, in case we've been launched from a bootloader. 2023-08-13 06:47:14 +08:00
Brian Doherty
cc99d94cfd Fixed NRF52 I2C register naming. 2023-08-13 06:46:57 +08:00
Brian Doherty
6e8f25ba3b Added config setting for NRF52 I2C timing bug workaround. 2023-08-13 06:46:31 +08:00
hujun5
c712a00620 drivers/input: rm sched_[un]lock
We use enter_critical_section to protect the read and write of priv structures,
sched_lock is mainly used to prevent active context switching caused by nxsem_post.
We do not actively switch contexts when reading and writing priv structures,
so sched_lock can be removed.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-08-12 23:32:38 +08:00
Alexander Lunev
73867b9759 boards/arm/stm32h7/stm32h745i-disco: supported external SDRAM
Supported external SDRAM (MT48LC4M32B2B5-6AIT:L) on STM32H745I-DISCO dev board.
Though MT48LC4M32B2B5-6AIT:L SDRAM itself provides 32-bit data bus, STM32H745I-DISCO board
routes only DQ[15:0] bits. Thus only half of the memory can be accessed: the accessible memory
configuration is only 1 Meg x 16 x 4 banks instead of 1 Meg x 32 x 4 banks.
Thus the accessible memory size is 8 MBytes.

Testing:
nsh> ramtest -a 0xD0000000 -s 8388608
RAMTest: Marching ones: d0000000 8388608
RAMTest: Marching zeroes: d0000000 8388608
RAMTest: Pattern test: d0000000 8388608 55555555 aaaaaaaa
RAMTest: Pattern test: d0000000 8388608 66666666 99999999
RAMTest: Pattern test: d0000000 8388608 33333333 cccccccc
RAMTest: Address-in-address test: d0000000 8388608
nsh>
2023-08-12 18:18:23 +08:00
Xiang Xiao
4bb30ab0c1 freedom-k28f/nshsdusb: Remove CONFIG_NETDB_BUFSIZE
since it isn't really used by this config

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-12 00:36:52 +03:00
Alan Carvalho de Assis
9d51024434 Revert "Meadow.OS source code migration - Part 1"
It is causing error in the mainline:

boards/arm/stm32f7/.../src/Meadow.OS/espcp/Kconfig: No such file or directory

This reverts commit 24e37ec3e8.
2023-08-12 00:36:31 +03:00
Alexis Christoforides
24e37ec3e8 Meadow.OS source code migration - Part 1 2023-08-11 16:37:10 -03:00
wangming9
c928acc9ff perf: The new configuration supports hardware performance counting
Adding the CONFIG_ARCH_PERF_EVENTS configuration to enable
hardware performance counting,solve the problem that some platform
hardware counting support is not perfect, you can choose to use
software interface.

This is configured using CONFIG_ARCH_PERF_EVENTS, so weak_functions
are removed to prevent confusion

To use hardware performance counting, must:
1. Configure CONFIG_ARCH_PERF_EVENTS, default selection
2. Call up_perf_init for initialization

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-08-12 02:20:44 +08:00
TimJTi
d0613fa165 SAMA5D2 MCAN Error corrections plus changes to improve clarity
Kconfig typo
2023-08-12 02:20:09 +08:00
fangxinyong
2d73e86b47 binfmt: support euid of process set from the file system
From posix spec, if set-user-ID bit is set in the file permissions,
then the effective user ID of the new process shall be set to the
user ID of the new process image file.
Let's ignore whether ST_NOSUID is set on the mounted file system.

https://pubs.opengroup.org/onlinepubs/007904875/functions/exec.html

test step:
hello example build as a module and call geteuid and getegid API.
then set file binary set-user-ID bit on the host.

$ chmod +s apps/bin/hello

nsh> mount -t hostfs -o fs=. /data
nsh> ls -l /data/apps/bin/hello
 -rwsrwsr-x    1000    1000    9264 /data/apps/bin/hello
nsh> /data/apps/bin/hello
geteuid:1000
getegid:1000

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-12 02:18:25 +08:00
huxiandong
cd5ee3fb07 spi/slave: use POLLPRI to notify TX_COMPLETE.
Signed-off-by: huxiandong <huxiandong@xiaomi.com>
2023-08-12 02:02:50 +08:00
Peter van der Perk
d582e4d37e boards: imxrt teensy-4.x/imxrt1064: Enable dma for lpi2c/lpspi 2023-08-11 13:41:49 -03:00
Peter van der Perk
c63cb4c2f3 boards: ucans32k146: Enable lpi2c/lpspi dma in can config 2023-08-11 13:41:49 -03:00
Peter van der Perk
2a6c5ed728 board: mr-canhubk3: enable lpi2c/lpspi edma for net config 2023-08-11 13:41:49 -03:00
David Sidrane
2dc6365e24 s32k3xx:lpi2c fix status handeling & race
s32k3:lpi2c:Simplify DMA and Non DMA usage

s32k3xx: lpi2c dma invalidate cache after exchange

s32k3xx:lpi2c fix timeout not stopping dma
2023-08-11 13:41:49 -03:00
David Sidrane
afdce6e8c2 imxrt:lpi2c fix status handeling & race
imxrt:lpi2c:Simplify DMA and Non DMA usage

imxrt: lpi2c dma invalidate cache after exchange

imxrt:lpi2c fix timeout not stopping dma
2023-08-11 13:41:49 -03:00
David Sidrane
eb06843178 s32k1xx:lpi2c fix status handeling & race
s32k1:lpi2c:Simplify DMA and Non DMA usage

s32k1xx: lpi2c dma invalidate cache after exchange

s32k1xx:lpi2c fix timeout not stopping dma
2023-08-11 13:41:49 -03:00
Peter van der Perk
755e3beba9 s32k3xx: lpspi dma invalidate cache after exchange 2023-08-11 13:41:49 -03:00
Peter van der Perk
87a51f4faa imxrt: lpspi dma invalidate cache after exchange 2023-08-11 13:41:49 -03:00
yangyalei
50428979d0 fix wait after vfork return error
Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-08-11 09:30:45 -06:00
zhanghongyu
0216224260 iob_alloc: change sem_post to count++
if there are two throttled wait, when iob_free occurs, one of wait
will be awakened to execute iob_alloc_committed, but it will fail
to execute, sem will be posted at this time, then another wait will
be awakened. after the other wait thread is awakened, This step is
repeated. the two threads are in the critical_section state and
cannot be switched to other threads. then cpu will busy util timeout.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-08-11 08:54:05 -06:00
Alexander Lunev
cfbee60932 arm/stm32h7: stm32h7x5: fixed typo on SPI header inclusion 2023-08-11 22:39:38 +08:00
ligd
e59f161fc2 pthread: remove unused temp change sched_priority
old:
pthread_create:

init_priority = prio;
if (sched_priority < parent_prio)
    sched_priority = parent_prio;    // don't need

pthread_start:

if (sched_priority > init_priority)
    sched_priority = init_priority

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-11 21:45:16 +08:00
chao an
65c30f9dbd drivers/misc/rpmsgblk: fix build break if CONFIG_DISABLE_PSEUDOFS_OPERATIONS
In function ‘rpmsgblk_unlink_handler’:
misc/rpmsgblk_server.c:340:36: error: ‘const struct block_operations’ has no member named ‘unlink’
  340 |   msg->header.result = server->bops->unlink(server->blknode);
      |

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-11 21:20:40 +08:00
yinshengkai
836263b132 drivers: fix devascii_register warning
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-11 21:20:13 +08:00
shipei
3cabf7ced8 audio:add virtio snd driver
playback test:
nxplayer
device /dev/audio/pcm0p
playraw /data/test.wav 2 16 44100
stop

record test:
nxrecorder
device /dev/audio/pcm0c
recordraw /data/rec.pcm 2 16 16000
stop

Signed-off-by: shipei <shipei@xiaomi.com>
2023-08-11 20:40:40 +08:00
yangshuyong
e0dc140d1c added mutex lock before lookup reset controller by name
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
2023-08-11 20:39:16 +08:00
yangshuyong
9c4e608529 Fixed the reset format error
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
2023-08-11 20:39:16 +08:00
yangshuyong
6f6977d002 support nuttx reset driver model
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
2023-08-11 20:39:16 +08:00
xiajizhong
b84fbe87ee math acceleration api support FFT
Signed-off-by: xiajizhong <xiajizhong@xiaomi.com>
2023-08-11 20:38:00 +08:00
xiajizhong
f922f4cc61 expand cordic_register to math_register
Signed-off-by: xiajizhong <xiajizhong@xiaomi.com>
2023-08-11 20:38:00 +08:00
红桃六
d8b045fa6a Update mouse.h 2023-08-11 20:37:11 +08:00
liuhongchao
69b655f4b2 drivers/input:support mouse driver
Implement mouse driver lower upper

Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
2023-08-11 20:37:11 +08:00
Peter Bee
99c2a6ffbe boards: add defconfig for virtio-gpu fb showcase
Usage example:

tools/configure.sh qemu-armv8a:fb
make -j
qemu-system-aarch64 -cpu cortex-a53 \
    -machine virt,virtualization=on,gic-version=3 \
    -chardev stdio,id=con,mux=on -serial chardev:con \
    -global virtio-mmio.force-legacy=false \
    -device virtio-gpu-device,xres=640,yres=480,bus=virtio-mmio-bus.1 \
    -mon chardev=con,mode=readline \
    -kernel ./nuttx

tools/configure.sh rv-virt:fb
make -j
qemu-system-riscv32 -semihosting -M virt -cpu rv32 -smp 8 -bios none -chardev stdio,id=con,mux=on -serial chardev:con -device virtio-gpu-device,xres=640,yres=480,bus=virtio-mmio-bus.1 -mon chardev=con,mode=readline -kernel ./nuttx

tools/configure.sh rv-virt:fb64
make -j
qemu-system-riscv64 -semihosting -M virt -cpu rv64 -smp 8 -bios none -chardev stdio,id=con,mux=on -serial chardev:con -device virtio-gpu-device,xres=640,yres=480,bus=virtio-mmio-bus.1 -mon chardev=con,mode=readline -kernel ./nuttx

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-08-11 20:20:11 +08:00
Peter Bee
78b993c4e8 drivers/virtio: add virtio gpu driver
This patch provides basic framebuffer display support for virtio.
Multiple displays are supported.

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-08-11 20:20:11 +08:00
chao an
fc354a1446 arm/clang: enhance compatibility of clang compiler
The naming of the clang configuration file has changed after version 14
This commit will enable the compatibility with clang-14/15/16/17

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-11 20:17:36 +08:00
anjiahao
fa676f264f gdbstub:fix typo
CC:  umm_heap/umm_zalloc.c gdbstub/lib_gdbstub.c:599:12: error: conflicting types for ‘gdb_hex2bin’; have ‘int(void *, size_t,  const void *, size_t)’ {aka ‘int(void *, long unsigned int,  const void *, long unsigned int)’}
  599 | static int gdb_hex2bin(FAR void *buf, size_t buf_len,
      |            ^~~~~~~~~~~
gdbstub/lib_gdbstub.c:102:16: note: previous declaration of ‘gdb_hex2bin’ with type ‘ssize_t(void *, size_t,  const void *, size_t)’ {aka ‘long int(void *, long unsigned int,  const void *, long unsigned int)’}
  102 | static ssize_t gdb_hex2bin(FAR void *buf, size_t buf_len,
      |                ^~~~~~~~~~~
gdbstub/lib_gdbstub.c: In function ‘gdb_write_memory’:
gdbstub/lib_gdbstub.c:1079:38: warning: passing argument 6 of ‘gdb_put_memory’ from incompatible pointer type [-Wincompatible-pointer-types]
 1079 |                        addr, length, gdb_hex2bin);
      |                                      ^~~~~~~~~~~
      |                                      |
      |                                      int (*)(void *, size_t,  const void *, size_t) {aka int (*)(void *, long unsigned int,  const void *, long unsigned int)}
gdbstub/lib_gdbstub.c:743:49: note: expected ‘gdb_format_func_t’ {aka ‘long int (*)(void *, long unsigned int,  const void *, long unsigned int)’} but argument is of type ‘int (*)(void *, size_t,  const void *, size_t)’ {aka ‘int (*)(void *, long unsigned int,  const void *, long unsigned int)’}
  743 |                               gdb_format_func_t format)
      |                               ~~~~~~~~~~~~~~~~~~^~~~~~
gdbstub/lib_gdbstub.c: In function ‘gdb_query’:
gdbstub/lib_gdbstub.c:1223:60: warning: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
 1223 |                "Name: %s, State: %s, Priority: %d, Stack: %d",
      |                                                           ~^
      |                                                            |
      |                                                            int
      |                                                           %ld
 1224 |                 tcb->name, thread_state, tcb->sched_priority,
 1225 |                 tcb->adj_stack_size);
      |                 ~~~~~~~~~~~~~~~~~~~
      |                    |
      |                    size_t {aka long unsigned int}

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-08-11 20:16:17 +08:00