Commit Graph

415 Commits

Author SHA1 Message Date
田昕 f6ebbe4429 drivers/mtd:init commit of power-loss resilient cfg
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-09-15 17:46:56 +08:00
Eero Nurkkala ec026c14cb risc-v/mpfs: emmcsd: further enhance the clocking
Simplify the clock mode from the board.h -files. Also make the
SD clock definable as well.

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-15 01:55:33 +08:00
Eero Nurkkala e5305a250a risc-v/mpfs: emmcsd: provide options for selecting clk speed
Some related products, such as Aries m100pfs, don't support eMMC
speeds up to 200MHz. Thus, provide option to select slower clock.
This has only to do with the clocking, no CMD6 is sent to select
high speed modes.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-13 11:23:45 +08:00
Eero Nurkkala 4df8b16060 risc-v/mpfs: usb: provide more endpoints
The underlying hardware supports 9 endpoints:
  - EP0
  - 4x IN EPs
  - 4x OUT EPs

Currently the driver assumes every EP number is unique. This limits
the amount of EPs to 1 + 4 = 5. Utilize the EPs in such a manner
that all may be used.

Also fix a few error handling related bugs. Update the composite
driver to match the current situation as well.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-09-06 23:10:30 +08:00
Alan Carvalho de Assis 4744810bfd esp32c3/boards: Add support APA102/APDS0060 for Shift Game 2022-08-31 09:42:02 +08:00
Masayuki Ishikawa 0ba9d8e9f5 boards: rv-virt: Assign dedicated text/heap area in knsh64/defconfig
Summary:
- This commit assigns dedicated text/heap areas that improve
  stability issues with rv-virt:knsh64

Impact:
- None

Testing:
- Tested with qemu-6.2

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-30 22:52:01 +08:00
Huang Qi a1afd66d19 boards/k210/maix-bit: Fix a typo in README
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-26 20:46:34 +08:00
chao.an 9cb17841d8 net/sockopt: move BINDTODEVICE to socket level
rename the UDP_BINDTODEVICE to SO_BINDTODEVICE to follow the linux
style to be compatible with non-UDP protocol binding requirements

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-08-25 17:56:52 +08:00
Alan Carvalho de Assis 456aaa8c1c esp32c3-devkit-rust-1: Add ARCH LED support 2022-08-24 00:52:19 +08:00
Alan Carvalho de Assis 23a7d8a693 esp32c3: Add initial support to esp32c3-devkit-rust-1 board 2022-08-24 00:52:19 +08:00
Ville Juven 23a2e27ffc mpfs/opensbi: Add the ddr memory region back to opensbi ld script
fixes ld-envm-opensbi.script:41: warning: memory region `ddr' not declared
2022-08-18 22:14:21 +08:00
Alan Carvalho de Assis 9ee18d70aa esp32c3-devkit: Fix /etc/passwd too 2022-08-13 03:02:55 +08:00
Ville Juven b8b541fbf5 mpfs: Remove the ddrstorage section from the OpenSBI package
It is not really needed; g_hart_stacks is only used during SBI init as
a temporary stack area. We can use the scratch area buffers for this, as
the scratch areas define almost 4K of extra space, which is used for
exception stacks anyway.
2022-08-10 10:01:47 +03:00
Nathan Hartman dd718e78f7 Fix typos 2022-08-07 23:33:19 +08:00
Xiang Xiao 35fe1cd7d7 boards: Enable thread local storage for some config
to improve the ci coverage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-05 08:45:11 +03:00
Nathan Hartman 20bdd44e7b Remove executable permission from source and build files. 2022-08-04 12:48:18 -03:00
Masayuki Ishikawa 5902b7f6d6 boads: icicle: Fix build errors in cxxtest_main.cxx
Summary:
- This commit fixes build errors in cxxtest_main.cxx

Impact:
- None

Testing:
- build only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-07-27 23:22:23 +08:00
ligd b34925e6eb power: move EXPLICIT_RELAX opreation to common place
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
Xiang Xiao 1d43b4a4eb libc/stdio: Enable LIBC_FLOATINGPOINT by default if ARCH_FPU is enabled
and DEFAULT_SMALL is false

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-21 09:53:09 -04:00
Gustavo Henrique Nihei 9695659620 boards: Fix typo in "register" word
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-07-13 22:57:19 +03:00
Gustavo Henrique Nihei cc0ea2689c esp32c3-devkit: Change output section identifiers to satisfy GDB
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-07-12 10:56:59 +08:00
Gustavo Henrique Nihei c462ea6088 esp32c3-devkit: Improve documentation related to Protected Mode
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-07-12 10:56:59 +08:00
Gustavo Henrique Nihei 686c9f0ad7 esp32c3-devkit: Use prebuilt bootloader binaries on knsh defconfig
After #6400 the prebuilt bootloader may be used for loading the NuttX
images when BUILD_PROTECTED is enabled.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-07-12 10:56:59 +08:00
Huang Qi 9481456fde risc-v/esp32c3: Implement up_perf_xxx API
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-06-21 21:35:22 +08:00
Richard Tucker f68a5f0913 boards/risc-v/litex/arty_a7: add netnsh defconfig 2022-06-21 12:06:37 +03:00
Jukka Laitinen 1c8a661c9f boards/risc-v/mpfs/m100pfsevp/include/board_liberodefs.h: Update memory initialization parameters
Sync some of the AXI configuration and DDR training parameters with the manufacturer's
defaults.

The TIP_CFG parameter correction helps with DDR training failures on some individual boards
The AXI end address values fix early random crash in power-on boot on some individual boards

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-06-17 15:40:21 +08:00
Eero Nurkkala 5683e020e8 risc-v/mpfs: update clock configuration parameters
Update PLL configuration parameters to match the values provided
by the vendor.

Also remove extra call to mpfs_pll_config() as it's already called
at mpfs_clockconfig().

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-06-15 21:29:45 +08:00
Gustavo Henrique Nihei 5805ad3954 risc-v/esp32c3: Disable access to invalid memory regions using MPU
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-06-11 01:55:46 +08:00
Ville Juven 16286081e1 risc-v/mpfs: Move the entry point to .start section
Remove the object linkage and use an explicit .start section
2022-06-10 20:18:23 +08:00
Eero Nurkkala 39d389545e risc-v/mpfs: usb: add composite support
This provides USB composite (CDC/ACM and Mass Storage) support
for mpfs board. In addition, a number of USB fixes are included:

 - Support for Setup Out packets
 - Proper support for larger than packet size writes
 - Finishing setup packets properly

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-06-09 20:44:40 +08:00
Abdelatif Guettouche c23699be60 esp32c3-devkit/knsh: Enable CONFIG_RAW_BINARY to convert the ELF file.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-06-08 20:16:00 +08:00
Hidenori Matsubayashi cbcc748985 Fix wrong path in README for RISC-V
Signed-off-by: Hidenori Matsubayashi <hidenori.matsubayashi@gmail.com>
2022-06-05 16:05:40 +08:00
Ville Juven 5782fc46f5 mpfs/knsh: Add C++ support
Increase the kernel stack size to 2K because it overflows when executing
dtors.
2022-05-27 09:14:49 -03:00
YAMAMOTO Takashi 864f43b562 esp32*: Disable CONFIG_RAW_BINARY
Because it uses the same filename as esp32 Config.mk. (nuttx.bin)
2022-05-27 13:41:51 +03:00
Ville Juven 5800dd2af5 boards/xxx: Remove CONFIG_SCHED_ATEXIT/ONEXIT from all defconfigs 2022-05-25 15:28:43 +08:00
Gustavo Henrique Nihei 18d74dbea0 risc-v/esp32c3: Fix leak of semaphores created by Wi-Fi kernel thread
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-25 09:46:30 +09:00
Gustavo Henrique Nihei b2d77c0e9c Revert "risc-v/esp32c3: Use onexit to free thread private semaphore"
This reverts commit f5eaf82c93.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-25 09:46:30 +09:00
Eero Nurkkala 3ea7d4bab4 risc-v/mpfs: amend OpenSBI to utilize IHC
Linux kernel uses M-mode trap for handling Inter-Hart Communication (IHC).
This patch provides all the required functionalities for this purpose.
Previously, HSS bootloader was required. Now, NuttX is run as the
bootloader providing OpenSBI vendor extensions instead. This setup has
been tested on the following configuration:

 - Hart 0 has NuttX in bootloader mode with OpenSBI
 - Hart 1 unused
 - Hart 2 has NuttX configured at 0xa2000000
 - Hart 3 has U-boot / Linux kernel (at 0x80200000)
 - Hart 4 has U-boot / Linux kernel (at 0x80200000)

Upon startup, NuttX on hart 0 will initialize SD-card driver, loads
the hart 2 NuttX from the SD-card and loads the U-boot to 0x80200000.
Also the nuttx.sbi -binary is loaded from SD-card into address 0x80000000,
which is also marked as reserved area in the Linux kernel device tree (for
the chuck 0x80000000 - 0x80200000).

Hart 2 NuttX waits until Linux kernel (IHC master) is started. After the
initial handshake, RPMsg / virtIO bus along with the IHC may be used for
proper AMP mode.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-05-24 03:25:37 +08:00
Gustavo Henrique Nihei 4f31c89963 esp32c3-devkit: Rename linker script to indicate use for Flat mode
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-18 11:43:52 +08:00
Gustavo Henrique Nihei c778f35f08 risc-v/esp32c3: Add support for Protected Mode
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-18 11:43:52 +08:00
Xiang Xiao 5958d3ac62 risc-v: Move "LDFLAGS += -melf32lriscv" from Make.defs to Toolchain.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-16 11:17:08 +03:00
Xiang Xiao 1f920e55d3 Move warning option from Make.defs to Toolchain.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-15 15:40:35 +03:00
Masayuki Ishikawa dc2a01e75a boards: rv-virt: Add knsh64 related files
Summary:
- This commit adds knsh64 related files

Impact:
- None

Testing:
- Tested with qemu-6.2

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-05-13 04:14:01 +08:00
Eero Nurkkala 77e36d1acc risc-v/mpfs: introduce IHC driver
This provides an example of Asymmetric Multiprocessing (AMP). The
master from Linux sends pings that this NuttX echoes back. The system
uses RPMsg from OpenAMP.

The Inter-Hart Communication module is present in the vendor's software
stack with the tag "2021.11". The software is present on github at the
polarfire-soc project. The following conditions must be met:

 1. FPGA programmed with 2021.11 software
 2. HSS (Vendor bootloader) with 2021.11 software
 3. U-boot and Linux kernel from 2011.11 software

Currently the IHC works as a slave only on the hart number 4.

On the NuttX side, this patch uses rptun that incorporates rpmsg and
virtio. If it used only rpmsg and virtio, the future maintenance would
likely be much heavier. Using rptun also simplifies many things.

Upon success, the master side from Linux may issue an example test:

root@icicle-kit-es-amp:/opt/microchip/amp/rpmsg-pingpong# ./rpmsg-pingpong

However, the rpmsg-pingpong.c (compiled on target with gcc), may need to
be modified as seen below to match the device id:
 - char *rpmsg_dev="virtio0.rpmsg-amp-demo-channel.-1.0";
 + char *rpmsg_dev="virtio0.rpmsg-amp-demo-channel.-1.1024";

This work uses a separate linker script. Due to a bug yet unknown to date,
a small NuttX, when loaded by the vendor HSS bootloader, will cause the
Linux kernel to hang at boot. Thus, the binary size is increased with
a section 'filler_area' whose only purpose is to increase the image size
so that the Linux kernel will boot up.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2022-05-12 22:56:12 +08:00
Xiang Xiao bbdbca00c1 libc/assert: let CONFIG_NDEBUG default to !CONFIG_DEBUG_ASSERTIONS
so the user could just change CONFIG_DEBUG_ASSERTIONS in most case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-04 10:07:34 +03:00
Masayuki Ishikawa 0908c67d73 boards: rv-virt: Add support ELF to nsh and nsh64 defconfigs
Summary:
- This commit adds support ELF to nsh and nsh64 defconfigs

Impact:
- None

Testing:
  nsh> mount -t hostfs -o fs=../apps/bin /system/bin
  nsh> hello
  Hello, World!!

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-05-03 13:57:24 +08:00
Masayuki Ishikawa 9b20f97064 boards: rv-virt: Add hostfs support to nsh and nsh64 defconfigs
Summary:
- This commit adds hostfs support to nsh and nsh64 defconfigs

Impact:
- None

Testing:
- Tested with qemu-6.2

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-05-02 19:46:58 +08:00
Ville Juven a5d49140ea MPFS: Add dummy rofms image
To allow building with ROMFS enabled
2022-05-02 16:13:15 +08:00
Ville Juven 31b916c485 MPFS: Add kernel space mappings
Mappings are done with vaddr=paddr.
- I/O space mapped with two gigapages
- Kernel space mapped to statically allocated page tables. 2MB of kernel
  memory is supported.
- Page pool is mapped to the kernel space, to allow virtual memory access
  for the kernel e.g. to initialize the page memory when it is allocated.
2022-05-02 16:13:15 +08:00
Ville Juven 2287ebcbcf MPFS: Add knsh (CONFIG_BUILD_KERNEL=y)
Re-name the old knsh (CONFIG_BUILD_PROTECTED=y) to pnsh
2022-05-02 16:13:15 +08:00