Commit Graph

50533 Commits

Author SHA1 Message Date
Xiang Xiao 7884c18620 Don't call lib_free in the kernel code
since kernel just allocate memory from kmm_malloc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-06 06:51:24 -03:00
cuiziwei 6289205104 sched: Define sched_getcpu return 0 when CONFIG_SMP equals n
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-06 11:28:49 +02:00
cuiziwei c1ddfcfa83 nuttx/arch:support to obtain host cpuinfo in NSH. 2023-08-05 14:57:15 -07:00
Brennan Ashton 46b0f6d6ee fdt: Add initial FDT support and procfs for userspace export
VELAPLATFO-12536

This provides the initial hooks for Flattened Device Tree support
with QEMU RV. It also provides a new procfs file that exposes the
fdt to userspace much like the /sys/firmware/fdt endpoint in Linux.
See https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-firmware-ofw

Nodes in the fdt are not yet usable by the OS.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-05 12:41:06 -07:00
ligd dfdb3aa2f4 armv8m: support busfault forward to TEE
For TEE & REE, securefault & busfault are not banked, so the faults can
only forword to TEE/REE.
But how to crash dump the other core which not handled faults ?

Here we provide a way to resolve this problem:
1. Set the securefault & busfault to TEE
2. busfault happend from TEE, then directly dump TEE
3. busfault happend from REE, then generate nonsecurefault
4. Back to REE, and dump

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-05 12:40:34 -07:00
ligd b445029cf2 armv8m: fix up_secure_irq failed for NVIC_IRQ_BUSFAULT
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-05 12:40:34 -07:00
ligd 7a0ef1d0ca secure: fix compile failed when no CONFIG_ARCH_HAVE_TRUSTZONE
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-05 12:40:34 -07:00
ligd 452211586e xtensa: fix compile miss file
comiple xtensa_mpu.c

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-05 12:40:16 -07:00
anjiahao 79f6efb977 ofloader:add Documentation for ofloader
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-08-05 12:40:02 -07:00
anjiahao 3a808bab19 support stm32f429i-disco run open flash loader
We can use the driver in nuttx to download
files with debugger

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-05 12:40:02 -07:00
cuiziwei 7c8bb8c293 nuttx/tls: Remove the max key limiatation in task_tls_alloc and pthread_key_create
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-05 06:33:49 -07:00
cuiziwei 5334c065b4 nuttx/tls:Setting the candidtate index to null prevents dangling pointers.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-05 06:33:49 -07:00
cuiziwei 8ffde7cf16 nuttx/tls:Setting the candidtate index to null prevents dangling pointers.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-05 06:33:49 -07:00
yinshengkai a6fcb0a5a9 fs: add pipe type support to inode
Both the device and the pipe used the FSNODEFLAG_TYPE_DRIVER type before,
and now add an independent pipe type

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-05 06:32:50 -07:00
cuiziwei 25eb09c3bb nuttx/boards:add KEEP to *(.init_array .init_array.*)
replace *(.init_array .init_array.*) with KEEP(*(.init_array .init_array.*)).

The KEEP statement within a linker script will instruct the linker to keep the specified section, even if no symbols inside it are referenced. This statement is used within the SECTIONS section of the linker script. This becomes relevant when garbage collection is performed at link time, enabled by passing the --gc-sections switch to the linker. The KEEP statement instructs the linker to use the specified section as a root node when creating a dependency graph, looking for unused sections. Essentially forcing the section to be marked as used.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-05 05:02:25 -07:00
Xiang Xiao 1dfcdaad84 noteram: Remove the unnessary inclusion and declaration from header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-04 19:24:08 -03:00
yinshengkai b0bbac852e boards: bl602evb:timer remove CONFIG_SCHED_CPULOAD_EXTCLK
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 10:58:54 -07:00
yinshengkai 996be8f2cf sched/cpuload: use perf to implement cpuload without relying on external timers
Need to enable CONFIG_SCHED_CRITMONITOR

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 10:58:54 -07:00
yinshengkai e8bf910c3d sched: rename nxsched_cpu_process_cpuload
put nxsched_process_cpuload_ticks partial implementation into nxsched_task_process_cpuload

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 10:58:54 -07:00
yinshengkai 08c4ac133b sched/cpuload: add SCHED_CPULOAD_OSCLK option
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 10:58:54 -07:00
Lucas Saavedra Vaz d1b5558c8b arch/espressif: Add MCUboot support for ESP32-C3
Add MCUboot support for ESP32-C3 when using the Espressif HAL
2023-08-04 10:30:57 -07:00
Peter van der Perk 0b721ac21c imxrt: flexcan use hpwork for receiving frames
FlexCAN before used interrupts to process incoming frames.
This patch adds a HPWORK workqueue to process incoming frames in the workqueue
context instead. Also renamed mbi to txmb for better readability.
2023-08-04 19:28:52 +02:00
yinshengkai 72de29422a drivers/noteram: noteram support multiple instances
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 06:48:48 -07:00
yinshengkai 3ab4d4a113 drivers/noteram: reduce global variable references
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 06:48:48 -07:00
yinshengkai 2168b744ca drivers/noteram: change ni_buffer to point
ni_buffer is defined in the initialized structure, put it in the data segment, it will increase the flash size

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 06:48:48 -07:00
Michal Lenc a5fb83a5d3 ioexpander: define IOEXPANDER_OPTION_NONGENERIC option
This introduces non-generic option interface for IO expanders.
Some IO expanders have more advance options for pins and communication.
This is used to pass driver dependend structure to expander driver.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-04 05:54:24 -07:00
cuiziwei 5e3df24092 replace nxsched_gettid with nxsched_getpid.
When we find the exit status entry in this task, we need to use pid instead of tid.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-04 04:21:08 -07:00
likun17 50fe301e8f fix SIM sensor rpmsg runtime error by asan report.
Signed-off-by: likun17 <likun17@xiaomi.com>
2023-08-04 04:20:45 -07:00
cuiziwei a0206adcfa nuttx/fs:remove (flags & MAP_PRIVATE) == 0.
NuttX not support MAP_PRIVATE currently.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2023-08-04 04:20:06 -07:00
sunkun3 e872610071 usbdev-composite: In the device descriptor, 0xEF means use of IAD
Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2023-08-04 10:58:50 +02:00
sunkun3 1b0ab4c0f7 usbdev-composite: The maximum number of composite devices supported is changed to 8
Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2023-08-04 10:58:50 +02:00
sunkun3 324402ed30 usbdev-composite: fix enumeration error for 192 bytes desc
when the size of the usb configuration descriptor
is a multiple of 64 integers, only for this size less than wlength,
host do need send ZLP

Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2023-08-04 10:58:50 +02:00
sunkun3 9f19a333d2 usbdev/cdcacm: Logic error handled in USB_REQ_SETINTERFACE.
config value changed after resetconfig was executed
endpoint will stay disable state after setinterface cmd

Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2023-08-04 10:58:50 +02:00
dinglongfei 8520a40866 usb:When the adbd task is running, the usb uninstall process will panic in the adbd task, because the memory of the adb driver has been freed.
unbind will call the adb_char_on_connect interface to wake up the adbd task,
adbd will then access the adb device and fail to return, at this time it will
close the adb device, we can do the final memory release operation in the
second unbind

Signed-off-by: dinglongfei <dinglongfei@xiaomi.com>
2023-08-04 10:58:50 +02:00
makejian cee9f25dde crypto: add curve25519 license
add curve25519 implementation, and the implementation are ported from open-bsd

Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-04 08:35:58 +02:00
Lee Lup Yuen 856526adee arch/risc-v: Add support for StarFive JH7110 SoC
This PR adds support for the StarFive JH7110 RISC-V SoC. This will be used by the upcoming port of NuttX for PINE64 Star64 SBC. [The source files are explained in the articles here](https://github.com/lupyuen/nuttx-star64)

Modified Files in arch/risc-v:

Kconfig: Added ARCH_CHIP_JH7110 for JH7110 SoC

New Files in arch/risc-v:

include/jh7110/chip.h: JH7110 Definitions

include/jh7110/irq.h: Support 127 External Interrupts

src/jh7110/chip.h: Interrupt Stack Macro

src/jh7110/jh7110_allocateheap.c: Kernel Heap

src/jh7110/jh7110_head.S: Linux Header and Boot Code

src/jh7110/jh7110_irq.c: Configure Interrupts

src/jh7110/jh7110_irq_dispatch.c: Dispatch Interrupts

src/jh7110/jh7110_memorymap.h: Memory Map

src/jh7110/jh7110_mm_init.c, jh7110_mm_init.h: Memory Mgmt

src/jh7110/jh7110_pgalloc.c: Page Allocator

src/jh7110/jh7110_start.c: Startup Code

src/jh7110/jh7110_timerisr.c: Timer Interrupt

src/jh7110/hardware/jh7110_memorymap.h: PLIC Base Address

src/jh7110/hardware/jh7110_plic.h: PLIC Register Addresses

src/jh7110/Kconfig: JH7110 Config

src/jh7110/Make.defs: Makefile
2023-08-03 22:55:55 -07:00
zhangyuan21 602d5974c8 usbdev: move usbdev_req function to common code
Move usbdev_req function to common code, Reduce duplicated code.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-03 22:46:25 -07:00
yangsen5 d8ca744052 drivers/video: video driver supports NV12
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-08-03 22:37:53 -07:00
makejian 775d9de30a crypto: export MD5/SHA1/SHA256/SHA512 via /dev/crypto
refer to commit 649dc2d985
(1) import hash method
(2) separate the update and finish processes

Signed-off-by: makejian <makejian@xiaomi.com>
2023-08-03 22:37:30 -07:00
zhangyuan21 699c401889 libc: update arm-m memset function
Use the memset function in bionic for better performance.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-03 21:15:50 -07:00
yintao 5d1536c5e3 nuttx/sim: use workquene instead of sim_bthcisock_loop
Signed-off-by: yintao <yintao@xiaomi.com>
2023-08-03 21:15:36 -07:00
yinshengkai 26fc59bc35 libc/stdio: changed LIBC_NL_ARGMAX default value to 9
If LIBC_NL_ARGMAX is too large, the stack usage of printf family functions will increase

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-03 19:07:22 -07:00
Fotis Panagiotopoulos f3945560c0 stm32f4/f7/h7_eth: Improvements in Ethernet DMA error handling.
* Error handling for abnormal interrupts and DMA errors is now
enabled for all builds, regardless of any DEBUG configuration.

* Error handling resets the MAC for the specific errors that
may halt the Ethernet operation, instead of everything as it
was before.
2023-08-03 18:11:23 -03:00
rongyichang 9e4a9fe32b drivers/fb: add fboverlay pandisplay & display area ioctl
1. support doublebuffer swtich for overlay layer
2. Add display area ioctl to scale the active area of the overlay layer
   to a specific region on the LCD through hardware.

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-03 10:57:14 -07:00
ligd 83a3b969a3 rptun: fix use after free caused by API wrong order
remove list delete from rptun_dev_stop

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:53:49 -07:00
ligd 2fae0af914 rptun: metal_init only call once
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:53:49 -07:00
ligd af3600436e perf: avoid div zero if up_perf_init() hasn't init
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:42:00 -07:00
ligd 2cfea55f95 armv7-r: idle stack should align with 8
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:42:00 -07:00
ligd f3063ce12b armv7-a: align stack_top code with armv7-r
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:42:00 -07:00
ligd ea03d06ab3 tmpfs: fix tmpfs_read overwrite after seek over tfo_size
reproduce:
fs = open("tmpfs", xx);
lseek(fd, 256, SEEK_END);  // filep->f_pos = size + 256
read(fd, buf, len);        // overwrite

resolve:
directly return 0 when seek over tfo_size

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:40:28 -07:00