Commit Graph

340 Commits

Author SHA1 Message Date
Gerson Fernando Budke
4caa8b19e9 boards/risc-v/esp32c3: Fix mcuboot configs
MCUboot apps were moved to examples directory. This fix configs due to
recent changes.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-03-19 16:09:49 +02:00
Janne Rosberg
49abe527ca risc-v/mpfs/icicle: add example config for ethernet 2022-03-18 17:22:27 +02:00
Janne Rosberg
8c755c9414 esp32c3-devkit/ble: add CONFIG_NETDEV_LATEINIT to defconfig 2022-03-18 17:22:27 +02:00
Janne Rosberg
cff7c760a5 bl602evb/wifi: add CONFIG_NETDEV_LATEINIT to defconfig 2022-03-18 17:22:27 +02:00
Ville Juven
15960f25a5 MPFS: Add board_memorymap.h
Move the target specific memory map to a separate file so there is no
need to copy&paste the __xxram_start etc linker symbols to each file
that needs them.

Also add MMU flags for I/O and kernel areas, they will be needed
when the kernel runs with virtual addresses also.
2022-03-18 09:35:00 -03:00
Ville Juven
13fd93ed2a MPFS: Add linker script for CONFIG_BUILD_KERNEL 2022-03-18 18:20:12 +08:00
Xiang Xiao
54e630e14d arch: Merge up_arch.h into up_internal.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-14 09:32:17 +02:00
Petro Karashchenko
dab5bb6bd3 boards/Kconfig: introduce ARCH_BOARD_COMMON option
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-11 16:00:00 +08:00
Jukka Laitinen
81a19c1ce8 arch/riscv/src/mpfs: Make cleaner pinmux configurations for USB
Mux USB IO pins one-by-one using package specific pinmux definitions. This avoids accidentally overwriting IO settings for other pins.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-03-11 00:22:43 +02:00
Xiang Xiao
ee931c137f boards: Remove -fno-builtin
it's more efficent to generate the machine code directly if possible

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-10 19:46:01 +02:00
Eero Nurkkala
8c1ab129ac risc-v/mpfs: add USB device driver
This adds a simple USB device driver for the mpfs. However,
this driver is still at its early phase. Only limited testing
with CDC/ACM has been conducted.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-03-08 16:49:29 +08:00
Eero Nurkkala
18b5048dda risc-v/mpfs: add USB IOMUX definitions
This adds the proper IOMUX definitions for the Icicle and
m100pfsevp boards.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-03-08 16:49:29 +08:00
Xiang Xiao
44bd3212d4 arch: Remove SYS_RESERVED from Kconfg
let's arch define the correct value instead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-27 22:54:13 +08:00
Alan C. Assis
73098e2a55 example/oneshot: Update defconfig to use default 2s 2022-02-25 00:10:45 +08:00
Xiang Xiao
67cda6ce1e board/esp32: Update esp-wireless-drivers-3rdparty
and add -fno-common since the symbol duplication is fixed in the new firmware

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-24 09:05:40 +01:00
Xiang Xiao
54b886ca0d boards: Add -fno-common to ARCHCFLAGS and ARCHCXXFLAGS
since elf loader can't handle SHN_COMMON

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-23 22:00:32 +08:00
Xiang Xiao
9836c6be9b boards: Remove CONFIG_CLOCK_MONOTONIC from all defconfig
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-23 01:21:26 +08:00
Xiang Xiao
163fe4ff0b boards: Replace CONFIG_CYGWIN_WINTOOL with CONVERT_PATH
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-20 21:15:36 +01:00
Xiang Xiao
1d1bdd85a3 Remove the double blank line from source files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-20 20:10:14 +01:00
Huang Qi
0c5aff9be6 risc-v/qemu-rv: Supports SMP up to 8 cores
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-02-18 13:25:01 +08:00
Alan Rosenthal
8defb843aa Remove duplicate linker script definitions
## Summary
A lot of linker scripts were listed twice, once for unix, once for windows.

This PR cleans up the logic so they're only listed once.

 ## Impact
Any opportunity to use a single source of truth and reduce lines of code is a win!

 ## Testing
CI will test all build
2022-02-17 02:55:25 +08:00
Huang Qi
f40a673fdf boards/rv-virt: Supports FPU test and ostest in both rv32/rv64
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-02-17 01:09:51 +08:00
Xiang Xiao
b0fa232918 boards: Remove -D__NuttX__ from the individual Make.defs
since it is defined globally in tools/Config.mk now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-15 15:26:38 +01:00
Masayuki Ishikawa
613cbbf688 boards: risc-v: Move -fno-common option to ARCHCFLAGS/ARCHCXXFLAGS
Summary:
- Apply the same style as sabre-6quad

Impact:
- None
- NOTE: esp32c3-devkit still remains old style because of link errors

Testing:
- Build only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-02-15 16:27:53 +08:00
Huang Qi
ae3fa5cfbf boards/k210: Add -mstrict-align to arch level flags since it don't support unaligned memory access
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-02-14 11:32:34 +08:00
Huang Qi
64130b4775 risc-v: Use _ebss instead of _default_stack_limit as idle stack base
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-02-13 14:37:57 +08:00
Huang Qi
ef3219e83d boards: Refresh all configs
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-02-09 21:21:43 +08:00
Huang Qi
c0a0de97ce Revert "libc: Call pthread_exit in user-space by up_pthread_exit"
This reverts commit f4a0b7aedd.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-02-09 21:21:43 +08:00
Xiang Xiao
0499979908 sched: Disable pthread by default when DEFAULT_SMALL is enabled
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-07 12:04:03 +08:00
Xiang Xiao
a9d7a776c4 sched: Remove SDCLONE_DISABLE option and config
since the related code was removed by:
commit 4d5a964f29
Author: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Date:   Tue Feb 23 18:04:13 2021 +0800

    net: unify socket into file descriptor

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-31 19:03:20 +01:00
Ville Juven
7c116efe05 Add support for a ROMFS image for MPFS
The image must be placed into:
boards/risc-v/mpfs/icicle/include/boot_romfsimg.h

The image is mounted by mpfs_bringup, which is run by the application
itself, or by board_late_initialize() in the case when
CONFIG_BOARD_LATE_INITIALIZE is defined, e.g. with CONFIG_BUILD_KERNEL
2022-01-27 11:06:43 -03:00
Huang Qi
0c28fe9831 boards: Remove unused NXFLAT flags from Make.defs
Since NXFLAT only avaliable on arm.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-01-27 11:08:43 +08:00
Ville Juven
8a4881c4e5 Implement CONFIG_BUILD_PROTECTED with MMU
NOTE: THIS ONLY WORKS WHEN KERNEL RUNS IN M-MODE FOR NOW

This frees the PMP for other use, e.g. HART memory separation.

The page tables are statically allocated, 1 per level.

This feature is now behind CONFIG_MPFS_USE_MMU_AS_MPU, because
only the MPFS target supports this (others are not tested).

If the MMU is used for memory separation within a HART, the PMP must
still be configured to allow user access to the memory mapped for the
HART, because PMP *rekoves* access by default. At this point all of
the user memory as well as the kernel RAM are opened.

A more flexible solution for PMP configuration will follow.
2022-01-25 20:22:34 +08:00
Ville Juven
7eb726d57f Add proper user/kernel space linker scripts for knsh target
The old implementation used the default ld.script for the kernel side
which did not obey the memory.ld limits whatsoever.

Also, provide the user space addresses from the linker script to get rid
of the pre-processor macros that define (incorrect) default values for
the user space composition.
2022-01-25 20:22:34 +08:00
Ville Juven
356ae984ac Add knsh target for icicle
Template for knsh target (e.g. protected build with user space nsh)

Requires MPU and linker script updates to work
2022-01-25 20:22:34 +08:00
Ville Juven
3fa0834e7d Fix PROTECTED_BUILD build errors for mpfs target
Userspace struct definition did not have pthread_startup
The definition for up_pthread_exit was not compiled ever
2022-01-25 20:22:34 +08:00
Eero Nurkkala
e5a9ba5602 risc-v/mpfs: opensbi defconfig: refresh config
Some of the configuration options have changed, so update this
config file accordingly.

In this example config, the following hart configuration takes
place:
  hart1: 0xafb00000 (Another NuttX)
  hart2: unused
  hart3: 0x80200000 (u-boot and Linux kernel)
  hart4: 0x80200000 (u-boot and Linux kernel)

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-01-24 23:25:53 +08:00
Xiang Xiao
04297c3ca3 board: Remove -fno-omit-frame-pointer from Make.defs
except sim arch, since this flag is set inside Toolschain.defs now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-20 16:00:48 +01:00
Xiang Xiao
c5c50acb93 board: Remove -fstrict-volatile-bitfields
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-20 16:00:48 +01:00
Xiang Xiao
3e28192b2f board/bl602: Remove -fshort-enums
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-20 16:00:48 +01:00
Jukka Laitinen
fc3167b584 boards/riscv/mpfs: Remove reference to .vectors in linker scripts
There is no such section. Instead, place the object mpfs_head.o at the start of
the text.

Put mpfs_head.o directly into the arch library; there is no need to define
it separately in HEAD_ASRC.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-01-20 01:37:34 +08:00
Xiang Xiao
8bcdefafc9 board: Remove -fno-strength-reduce
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-19 00:14:03 +01:00
Petro Karashchenko
8d3bf05fd2 include: fix double include pre-processor guards
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-16 11:11:14 -03:00
Huang Qi
5792d851e5 arch/risc-v/qemu-rv: Support both rv32/rv64 core
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-01-15 11:42:01 +08:00
Eero Nurkkala
c67a1a4de1 risc-v/mpfs: ld-envm-opensbi.script: add all opensbi code to .text.sbi
Add the rest of the OpenSBI code to .text.sbi -section. They belong
to there. This frees up some space in the very limited eNVM.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-01-14 10:10:24 +01:00
Eero Nurkkala
76c6ccc732 risc-v/mpfs: opensbi/defconfig fix RAM start address
RAM is expected to start from 0x08000000, not from
0x80000000 in this case. DDR starts from 0x80000000.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-01-14 10:10:24 +01:00
Huang Qi
10bb48b9b4 arch/risc-v: Merge rv32im and rv64gc into common
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-01-11 23:24:33 +08:00
Eero Nurkkala
b4d2944df7 tools/mpfs: prepare OpenSBI image
Polarfire Icicle board has only (128K - 256) bytes for the bootloader
in the non-volatile eNVM. This space is barely enough for running NuttX.
If OpenSBI is selected, it will be placed in DDR. This all means the
nuttx.bin file grows into gigabyte size, filling the unused space (ddr -
envm) with zeroes.

The memory layout is as follows:

MEMORY
{
    ddr  (rx)          : ORIGIN = 0x80000000, LENGTH = 4M
    envm (rx)          : ORIGIN = 0x20220100, LENGTH = 128K - 256
    l2lim  (rwx)       : ORIGIN = 0x08000000, LENGTH = 1024k
    l2zerodevice (rwx) : ORIGIN = 0x0A000000, LENGTH = 512k
}

OpenSBI library is used as a separate binary, which is stored into
eMMC or SD-card. It is then loaded into its precise location in DDR.

Thus, we separate OpenSBI from NuttX and end up with two images
by utilizing the objcopy options:

  --only-section=sectionpattern (-j in short)
  --remove-section=sectionpattern (-R in short)

This is only valid when CONFIG_MPFS_OPENSBI is set.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-01-04 19:45:14 +08:00
Gustavo Henrique Nihei
cff2bc05e0 esp32c3-devkit: Restrict FS options when Flash Encryption is enabled
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-01-01 20:37:44 +08:00
Gustavo Henrique Nihei
25f2dc2077 risc-v/esp32c3: Enable the creation of encrypted Flash partitions
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-01-01 20:37:44 +08:00