Commit graph

17680 commits

Author SHA1 Message Date
Xiang Xiao
800754a9be Replace mktime with timegm in rtc and fs driver
since kernel component should use UTC instead local time

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Icf939e1ab0af8e577105f539d2553bc67b3b3d10
2021-06-24 20:53:53 +08:00
Xiang Xiao
b3bcc02a04 sched: Identify the stack need to free by TCB_FLAG_FREE_STACK
instead calling kmm_heapmember or umm_heapmember because:
1.The stack supplied by caller may allocate from heap too
2.It's hard to implement these two function in ASan case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I196377822b7c4643ab4f29b7c1dc41dcd7c4dab1
2021-06-18 20:59:03 +08:00
ligd
200a1d51d3 arm: fix enable interrupt too earlier caused system crash
reason:
	msr	cpsr, r2   /* Set the CPSR */

    // interrupt hanppend, context switch

	pop	{r0-r2, pc}

resolve:
    use SPSR instead, and recover with ldmia ^

Change-Id: Id7cee6452997ec19919eeecf6e7616164b3a0ab3
Signed-off-by: ligd <liguiding1@xiaomi.com>
(cherry picked from commit 6fa6c1676932d7babb7ff22ef556a17bb18f1c0d)
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-06-17 14:39:22 +08:00
chao.an
27aad31338 sim: add posix_memalign() to nuttx-names.in
hide the symbol definition from up_hostmemory.c:
147:  error = posix_memalign(&p, alignment, size);

Change-Id: I0bbc509c1ecf43388f6b21997a878a5f5fecf60a
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-15 14:59:01 +08:00
Xiang Xiao
4d66266a8e sched: Don't include nuttx/sched.h inside sched.h
But let nuttx/sched.h include sched.h instead to
avoid expose nuttx kernel API to userspace.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6fe673364be9eb1259381e6575d4c1a9fea58097
2021-06-13 00:25:26 -07:00
Xiang Xiao
8ae0e1759e arch: Colorize the idle thread stack in an unified way
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Idae8da53e5a4799a8edc0e882f17fd515b70cb14
2021-06-11 11:37:32 +08:00
Xiang Xiao
35035f5c89 arch: Rename xxx_getsp to up_getsp
All modern desgin support stack pointer and it's also an
important information, so let's standardize this interface.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-11 11:37:19 +08:00
chao.an
0d960286a6 Revert "arch: adjust idle stack offset to reserve space of stack info"
This reverts commit 91dbb26153.
2021-06-09 23:21:56 +08:00
chao.an
e223790148 serial/uart/h4: add bt h4 uart serial driver
Change-Id: I456622ce097006447cc8b050e4a44ee96865ddfe
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 18:33:20 +08:00
chao.an
8f0cc709d4 wireless/bluetooth: decoupling bt_driver_s and bt_buf_s
Change-Id: I12879c364cf8ca63898da94621e94d8fc23a4f6f
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 18:33:14 +08:00
chao.an
e9954c80dd arch/sim: remove BT uart implement
Change-Id: Ic9ea51116ba46cb667eae0ea151f69079f9f05ab
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 18:32:49 +08:00
chao.an
91dbb26153 arch: adjust idle stack offset to reserve space of stack info
Change-Id: I064b6dfcfa5152e58ad2dba98021b1aa37c98b7e
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-06-03 17:31:05 +08:00
Dong Heng
2af7861b31 riscv/esp32c3: Fix SPI Flash driver internal chip data address error
"g_rom_flashchip" is not in fixed address between all ESP32-C3's different versions.
2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
16dd2260f1 risc-v/esp32c3: Uniformize alignment for assembly instructions 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
6b5fe76506 risc-v/esp32c3: Improve interrupt handler documentation 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
f948f9fa8d risc-v/esp32c3: Reorder register restoration on interrupt handler epiloque 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
401a1bf751 risc-v/esp32c3: Fix wrong references to ESP32 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
5a76c52ae2 arch/risc-v: Fix stack alignment according to calling convention
The RISC-V Integer Calling Convention states that the stack pointer
shall always be aligned to a 128-bit boundary upon procedure entry, both
for RV32* and RV64* ISAs (exception to the RV32E ISA, which must follow a
specific convention)
2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
e0e9f4db1c xtensa/esp32: Change ESP32_RT_TIMER_TASK_PRIORITY comment into help text 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
3782ca8dcc xtensa/esp32: Add missing default value for CONFIG_ESP32_GPIO_IRQ 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
91039bff97 xtensa/esp32: Uniformize Kconfig alignment and styling 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
e06fa3cc7e xtensa/esp32: Remove inconsistent usage of comment command 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
a35c140d0c xtensa/esp32: Remove redundant dependency 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
bfb8eec64a risc-v/esp32c3: Change ESP32C3_RT_TIMER_TASK_PRIORITY comment into help text 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
b85090684d risc-v/esp32c3: Uniformize Kconfig alignment and styling 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
672d879d34 risc-v/esp32c3: Remove inconsistent usage of comment command 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
0d32ff6a5c risc-v/esp32c3: Remove redundant dependency 2021-05-10 19:23:33 +08:00
Byron Ellacott
70ab250c5d Add experimental support for an eZ80 toolchain using llvm and GNU binutils.
An additional fix for the RTC driver to lock the RTC after setting values instead of unlocking it is included.
2021-05-10 19:23:33 +08:00
chenwen
98d97f27fd xtensa/esp32: Fix crash issue caused by null pointer operation 2021-05-10 19:23:33 +08:00
Gustavo Henrique Nihei
0e0c7a9a47 risc-v/esp32c3: Add driver for General Purpose SPI Master 2021-05-10 19:23:33 +08:00
Huang Qi
9e5aa98495 arch/sim: Fix warning of duplicated object
N/A

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: I91cf182a396fc8f8024faf65c1cc7bf45cf34bbc
2021-05-08 22:11:52 +08:00
Jiuzhu Dong
94eecb1702 sim/rptun: support multi(>2) core interactive by share memory
N/A

Change-Id: Ia8254bfe369e40a04ed54adfa64afa38974b165c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-08 20:45:26 +08:00
Jiuzhu Dong
788e409cb7 driver/syslog: add config SYSLOG_RPMSG_SERVER_NAME to
N/A

specified the name of remote proc(rpmsg server)

Change-Id: Ie270d651071e87a40a80ab489597ae18db9814f0
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-08 20:22:28 +08:00
Jiuzhu Dong
a099f22123 driver/rtc: add config CONFIG_RTC_RPMSG_SERVER to
N/A
select rtc rpmsg role.

Change-Id: I7f9053b070593573caa5d988c6a2e13593da6bc5
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-08 20:19:07 +08:00
chao.an
dcc2db8d40 make/archive: replace the dependency to preprequisite list
Change-Id: Id63f3cd32906461a54cb016ef8078d4d922845e2
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-07 21:34:45 +08:00
chao.an
48beda08e2 Revert "armv8-m: Fix EXC_RETURN for non-secure usage"
This reverts commit 2ecfddb430.

Change-Id: I9c01dc9b6eada54642787c8a3395cb32c8c4f7d4
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-05-07 20:54:03 +08:00
liuhaitao
dc639b2b59 Merge remote-tracking branch 'mirtos/master' into dev-upmerge-nuttx-10.1-0507
Change-Id: I4bb3a61356be2b4a77ccfe45390b15e68a376dd6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2021-05-07 20:46:07 +08:00
liuhaitao
e3166ecac0 Revert "make/archive: replace the dependency to preprequisite list"
This reverts commit 9c946e2af6.

Change-Id: Ia8b7726d036c861d5eda51765d330e894e0d214a
2021-05-07 16:38:39 +08:00
Jiuzhu Dong
241dcfacd1 cmd/free: add nused field in command free
N/A

Change-Id: I74aa4b1e7394a17c3b117322a4cc24aa52aac3b8
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-04-28 11:34:26 +08:00
Masayuki Ishikawa
8e161bc992 arch: rp2040: Add stack coloration for the idle task
Summary:
- This commit adds stack coloration for the idle task

Impact:
- rp2040 with CONFIG_STACK_COLORATION=y

Testing:
- Tested with nsh, nshsram and smp configurations
- NOTE: CONFIG_STACK_COLORATION=y needs to be added
2021-04-25 03:19:24 -05:00
Masayuki Ishikawa
dc9223f4cf arch: rp2040: Fix the initial stack pointer
Summary:
- The NuttX for raspberrypi-pico boots via the boot_stage2 provided
  by the pico-sdk which sets the MSP at the end of the SRAM.
- However, the NuttX expects the MSP is set to the top of the idle stack.
- This commit fixes this issue.

Impact:
- None

Testing:
- Tested with nsh, nshsram and smp configrations
2021-04-25 03:19:24 -05:00
chao.an
75dae70a6e arm/v7-a/fpu: add VFP-v3 D32 support
Change-Id: I1e59a191c8cb4ab2bf5527acf38bb65124275016
Signed-off-by: chao.an <anchao@xiaomi.com>
(cherry picked from commit 39351bc597e74088a27d9e0ab9df6fc8f2ad4347)
2021-04-23 17:18:26 +08:00
Sara Souza
5c562c1068 risc-v/esp32-c3: Reorganize the timer logic for wireless use 2021-04-22 21:38:16 -05:00
Sara Souza
0c440cfdfe xtensa/esp32: Reorganize the timer logic for wireless use 2021-04-22 21:38:16 -05:00
Dong Heng
fecdd27df3 esp32 & esp32c3: Update Wi-Fi BT and Wi-Fi libraries to fix some issues 2021-04-22 07:34:06 -03:00
Sara Souza
7a80cbf93f risc-v/esp32-c3: Adds oneshot timer driver. 2021-04-22 09:13:58 +01:00
Sara Souza
f696364b6a xtensa/esp32: Adds freerun wrapper 2021-04-21 16:37:39 -03:00
Masayuki Ishikawa
1b00e5d518 spinlock: Remove SP_SECTION
Summary:
- SP_SECTION was introduced to allocate spinlock in non-cachable
  region mainly for Cortex-A to stabilize the NuttX SMP kernel
- However, all spinlocks are now allocated in cachable area and
  works without any problems
- So SP_SECTION should be removed to simplify the kernel code

Impact:
- None

Testing:
- Build test only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-04-20 22:41:44 -05:00
Masayuki Ishikawa
1a9e7efde5 smp: Remove CONFIG_SMP_IDLETHREAD_STACKSIZE
Summary:
- The CONFIG_SMP_IDLETHREAD_STACKSIZE was introduced to optimize
  the idle stack size for other than CPU0
- However, there are no big differences between the idle stacks.
- This commit removes the config to simplify the kernel code

Impact:
- All SMP configurations

Testing:
- Tested with ostest with the following configs
- spresense:smp, spresense:rndis_smp
- esp32-devkitc:smp (QEMU), maix-bit:smp (QEMU)
- sabre-6quad:smp (QEMU), sabre-6quad:netnsh_smp (QEMU)
- raspberrypi-pico:smp, sim:smp (x86_64)

Signed-off-by: Masayuki Ishikawa <asayuki.Ishikawa@jp.sony.com>
2021-04-19 21:46:39 -05:00
Anthony Merlino
14db894caf stm32h7: Allow selection of SDMMC clock source. 2021-04-19 08:57:49 -07:00