Commit Graph

52502 Commits

Author SHA1 Message Date
Yanfeng Liu a4b22fe999 risc-v/k230: initial Asymmetric Multi-Processing support
K230 chip has two T-Head C908 RiscV cores, previously we run NuttX
on either little or big cores. This patch runs NuttX on both cores
with OpenAMP support via the RPTUN driver.

New additions:

- in arch/risc-v/src/k230
  - k230_rptun.c              K230 RPTUN driver
  - k230_rptun.h              K230 RPTUN driver header file

- in baords/risc-v/k230/canmv230
  - configs/master            Build config for master node
  - configs/remote            Build config for remote node
  - scripts/ld-rptun.script   Build script for RPTUN

Major changes:

- arch/risc-v/Kconfig         Select NUTTSBI_LATE_INIT upon NUTTSBI
- in arch/risc-v/include
  - k230/irq.h                Add UART3 IRQ defs
- in arch/risc-v/src/k230
  - Kconfig                   Add RPTUN related config items
  - Make.defs                 Add k230-rptun.c to sources
  - hardware/k230_memorymap.h Add K230 device and CSR defs
  - k230_hart.c               Add hart ctrl for RPTUN
  - k230_hart.h               Add hart ctrl for RPTUN
  - k230_mm_init.c            Add Svpmbt to support RPTUN
  - k230_start.c              Revised to support RPMsg UART
- in boards/risc-v/k230/canmv230
  - scripts/Make.defs         Add RPTUN script selection
  - src/canmv_init.c          Add RPTUN and RPMsg_UART initialization
- in Documentation/platforms/risc-v/k230/boards/canmv230
  - index.rst                 Add AMP usage information.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-02-13 10:34:21 -03:00
Nicolas Lemblé 4a85fbfd09 arch/xmc4: Fix CCU registers 2024-02-13 10:33:04 -03:00
Eren Terzioglu de948babbf xtensa/esp32s2: Fix esp32s2 wdt interrupt bug 2024-02-13 10:31:35 -03:00
Jukka Laitinen 72f9bd142f openamp: Fix void pointer arithmetic in openamp to remove compilation warnings
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-02-12 17:06:33 +01:00
Roberto Bucher 4a04c22147 STM32-H745 files for pysimCoder 2024-02-10 20:01:12 -03:00
Rodrigo Sim f4d500f436 stm32f401rc-rs485: Add rs-485 master mode configuration 2024-02-10 19:52:52 -03:00
trns1997 5c118967bb build xmc4800-relax using CMake 2024-02-10 10:20:59 -03:00
Yanfeng Liu ec7c876f13 fs/mount: add FS_RPMSGFS as cause of NODFS_SUPPORT
It seems that RPMSGFS is missed from the list that doesn't need block or
MTD drivers. This attempts to add it.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-02-10 17:07:05 +08:00
Yanfeng Liu b258680949 rpmsg/rpmsg_ping: tenative fix for build issue
rpmsg_ping.c is blocking CI checks for RPTUN related patches like #11673.
this patch simply fix the compilation issue of rpmsg_ping.c:

- line 191: overflow conversion from "long unsigned int" to "unsigned int"
- line 226: "sendlen" used uninitialized

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-02-08 12:38:21 -03:00
Raman Gopalan 0967eb4c24 avr32dev1: Fix compilation and nsh boot-up
I recently imported NuttX version 6.0 (and nsh) into a Microchip
Studio project [1] on Windows to figure out what was going wrong with
the avr32dev1 build. I also briefly checked NuttX version 10.

I worked with the assumption that the avr32 (avr32dev1) specific
changes to the codebase were minimal across NuttX releases.

For the initial proof of concept I used Microchip Studio version 7.0
(with the recent Microchip's ASF updates). I use avr32-gcc (4.4.7)
hosted here [2] for building NuttX for avr32dev1 on GNU/Linux.

Even with the Microchip Studio project, I had initial debug problems
with just stepping through the code a line at a time. I had to bring
in crt0, a trampoline stub and the linker file from one of my older
projects to really build on the suspicion I had with the linker file.

Perhaps an older version of avr32-gcc did something differently. I am
not sure about this. I used avr32-objdump to see the output sections
of the generated elf file. I just had to tweak the linker script to
ensure correct linking of the sections.

With those changes, I was able to inspect the UART sections within
NuttX Microchip Studio project.

Second important change: the transmit pin: I had to reassign the pin
to see the nsh console.

These are the currently assigned UART pins:

RX: PA_24 -> Physical IC pin 59
TX: PB_02 -> Physical IC pin 24

For the avr32dev1 board, they are pins: J1 (berg pin 28) and J2 (berg
pin 10).

In addition, the PR fixes silly compilation problems with avr32dev1.

I have tested the nsh build with my avr32dev1 boards. I used Atmel ICE
to program one of them (flash at 0x80000000) and dfu-programmer to
test my other board (flash at 0x80002000). The other RS-232 parameters
are the same as they were.

References:
[1]: https://github.com/ramangopalan/nuttx_avr32dev1
[2]: https://github.com/ramangopalan/avr32-gnu-toolchain-linux_x86_64
2024-02-08 11:12:13 -03:00
SPRESENSE eaba1bef1e drivers/modem/alt1250: Add LTE_CMDID_RESTARTAPI command
ALT1250 driver sends an event named LTE_CMDID_RESTARTAPI
to ALT1250 daemon when state is PM_NOARMAL in the function
of prepare registered by pm_register.
2024-02-07 22:19:03 -08:00
Tiago Medicci Serrano cb32e6d50a risc-v/qemu-rv/rv-virt: Add support to loader ROMFS image in kernel
Use ROMFS to load user applications in kernel mode instead of using
hostfs.
2024-02-07 19:46:42 -08:00
Tiago Medicci Serrano c86cb9e7ef Documentation/rv-virt: Add section on how to debugging with GDB
Add a section on how to debug RISC-V emulator using QEMU and GDB.
2024-02-07 19:46:42 -08:00
Tiago Medicci Serrano 28470f7aed Documentation/rv-virt: Update the description of the configurations
Remove `README.txt` and create a specific documentation for it,
updating the description of the available configurations.
2024-02-07 19:46:42 -08:00
Michal Lenc 2f74233565 board/samv7: add support for BOARDCTL_RESET_CAUSE command
This commit adds support for board control command that retrieves the
cause of last reset from HW.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-02-07 13:26:37 -03:00
Michal Lenc 2849cd7c6d arch/samv7: add function to retrieve reset cause from HW
SAMv7 reset controller stores the cause of last reset (SW reset, power up,
pin reset etc.) in status register. This commit adds function that allows
the board to retrieve this information. This function should be called
from board support layer either during initialization or based on
incoming ioctl call.

Adding the sam_get_reset_cause() to sam_systemreset.c also resulted in
always compiling this file by default and only putting up_systemreset()
under CONFIG_SAMV7_SYSTEMRESET option.

Also header file sam_systemreset.h was created as it defines reset types
in comfortable manner for future processing in board layer. This is done
to avoid passing boardctl dependent structure to architecture layer.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-02-07 13:26:37 -03:00
Roberto Bucher 31817335e4 Modified CONFIG_INIT_STACKSIZE to 2048 2024-02-07 10:17:33 -05:00
Aaron Matlock 470ad35508 cmake: Fixed nucleo-u5a5zj-q 2024-02-07 03:20:43 -08:00
Jukka Laitinen 888dc229fa arch/risc-v/src/mpfs/mpfs_serial.c: Allow switching uart output to console off
By setting "isconsole" to false, mpfs_serial stops outputting to console.

This can be used to disable output to debug console in low level.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-02-06 08:53:05 -08:00
Jukka Laitinen a28f6716d5 arch/risc-v/src/mpfs/mpfs_irq.c: Fix up_irqinitialize for warm reboot
It is possible that a PLIC IRQ is claimed but not completed at warm
reset. This occurs at least if there is a fault in the middle of irq
handler execution.

To recover from such situation, we can complete all IRQ:s in PLIC;
this completes any already claimed IRQ, but has no effect on IRQs
which are not claimed or not enabled.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-02-06 08:52:46 -08:00
Jukka Laitinen df01c83c25 arch/risc-v/src/mpfs/mpfs_i2c.c: Recover i2c from pending transactions in warm boot
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-02-06 08:52:31 -08:00
Jukka Laitinen 2b10b38c1d arch/risc-v/src/mpfs/mpfs_i2c.c: Add more i2cerr traces
Add sanity checks for debugging possible errors in the driver.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-02-06 08:52:31 -08:00
Jukka Laitinen 120dfbd45f arch/risc-v/src/mpfs/mpfs_i2c.c: Correct i2c reset / error recovery
- Use mpfs_i2c_deinit+mpfs_i2c_init sequence to re-initialize i2c block
- Use the i2c mutex to protect the reset; in case there are several devices
  on the same bus, and one of them resets the bus, reset must not occur in
  the middle of another device's transfer.
- Move irq attach to the i2c_init as the irq detach is in i2c_deinit

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-02-06 08:52:31 -08:00
Jukka Laitinen fc4b39b1dd arch/risc-v/src/mpfs/mpfs_i2c.c: Add more error status codes
Add more error status codes to help debugging in the future.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-02-06 08:52:31 -08:00
Jukka Laitinen dae31dc866 arch/risc-v/src/mpfs/mpfs_i2c.c: Clear I2C_CTRL bits when initializing/deinitializing bus
Ensure that there are no pending state or interrupts in the i2c controller. This removes
errors caused by deinitialize/initialize sequences in error cases.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-02-06 08:52:31 -08:00
Eero Nurkkala bcf7aa4b63 risc-v/mpfs: i2c: perform sanity checks
Replace risky DEBUGASSERT()s with real sanity checks. Also,
do a few more checks as the system might occasionally fire an
interrupt if the system has been restarted while in middle of
an i2c transaction.

Yet, modify i2c_transfer() function so that up_disable_irq()
is always called at the end to better prevent ill-timed irqs.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2024-02-06 08:52:31 -08:00
Eero Nurkkala b0cef9e008 risc-v/mpfs: i2c: prevent out of bounds read access
priv->msgid may grow past its boundaries, causing
struct i2c_msg_s *msg = &priv->msgv[priv->msgid]
to read data out of boundaris.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2024-02-06 08:52:31 -08:00
Masayuki Ishikawa 38f8aae3be boards: rv-virt: Add nxrecorder to defconfigs
Summary:
- This commit adds nxrecorder to netnsh/netnsh_smp/netnsh64/
  netnsh64_smp defconfigs.

Impact:
- None

Testing:
- Tested with qemu-8.2.0 on Raspi4B with USB Audio

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2024-02-06 00:41:44 -08:00
Rdk-T 7f01db30dc Add EtherCAT support on xmc4800-relax. 2024-02-05 22:23:30 -08:00
Masayuki Ishikawa 7c31be27e3 boards: qemu-armv8a: Add nxrecorder to defconfigs
Summary:
- This commit adds nxrecorder to netnsh/netnsh_hv/netnsh_smp/
  netnsh_smp_hv defconfigs.

Impact:
- None

Testing:
- Tested with qemu-8.2.0 on Raspi4B with USB Audio

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2024-02-05 05:54:04 -08:00
SPRESENSE a303ec8653 arch: cxd56xx: Add new feature to use GNSS RAM
As long as the GNSS feature is not used, GNSS RAM can be used as general memory.
This memory is 640KByte total, which is lower performance than the application RAM.
It is possible to locate text, data and bss into GNSS RAM and to use as heap area.
2024-02-05 05:53:51 -08:00
SPRESENSE fc5ae43dda arch: cxd56xx: Add function to control GNSS RAM clock
Add function to enable and disable GNSS RAM clock.
2024-02-05 05:53:51 -08:00
SPRESENSE 3ff9432975 tools/cxd56: Update to output bss-only section to spk file
In creating spk image, the section which filesz is 0 is ignored,
so change to check memsz instead of filesz.
2024-02-05 05:53:51 -08:00
SPRESENSE 1b3b12ed00 arch: cxd56xx: update loader and gnssfw version
Update loader and gnssfw to version 2.2.20591
2024-02-05 05:53:51 -08:00
Saurav Pal 36ea2929f0 docs/fs/vfat: Improve VFAT documentation
Improved documentation of File Allocation Table (FAT) or VFAT.

Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2024-02-05 03:43:41 -08:00
Zhe Weng 5a10367312 net/nat: Fix ICMP Error MSG Processing
1. Don't assert on IGMP inside ICMP, just ignore it.
2. Check we have full IP header inside ICMP payload before accessing it.
3. `inner_l4hdrbak` need to be `L4_MAXHDRLEN`, not `L4_MAXHDRLEN/2`.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-02-05 19:36:59 +08:00
SPRESENSE 980102c536 boards/arm/cxd56xx: Fix the modem reset sequence
Since there were some cases in which the current modem reset
sequence did not reset the modem, the reset was ensured by
executing power off and power on of the modem.
2024-02-04 22:05:31 -08:00
Adam Comley 399cd88e7f Support RP2040 Clock Outputs 2024-02-04 16:51:53 -08:00
Xiang Xiao 3594e3e541 net/rpmsgsock: Rename rpmsg_socket_getconnname to rpmsg_socket_getpeername
to align with the naming convention of getpeername.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-02-04 22:06:45 +08:00
Xiang Xiao ebc6924b26 risc-v/mpfs: Remove thee unused seq[s|m] fields
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-02-04 09:54:05 +01:00
Xiang Xiao 1e3914ec9d rptun: Remove the unused shmemname field and argument
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-02-04 09:54:05 +01:00
Xiang Xiao 6a6bd30500 rptun: Remove the empty implementation of get_firmware and get_addrenv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-02-04 09:54:05 +01:00
Xiang Xiao 43d51cd4fc arch: Remove the identity mapping of up_addrenv_va_to_pa and up_addrenv_pa_to_va
and reuse the reuse the implementation from:
drivers/misc/addrenv.c

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-02-04 09:54:05 +01:00
Yanfeng Liu 73ecd741e7 risc-v/common: add param to mmu_flush_cache interface
Current mmu_flush_cache() hook lacks the reg param which needed by
some targets. So this PR adds the param and update existing targets
using that hook.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-02-03 22:05:42 -08:00
Saurav Pal d79e5a4932 fs/vfat: Fix typo in the macro DIRSEC_BYTENDX
The DIRSEC_BYTENDX(f, i) is supposed to have DIRSEC_NDXMASK(f) in its expansion instead of DIRSEC_NDXMASK(fs). It went unnoticed in the codebase as DIRSEC_BYTENDX(fs, idx) is the way it is used, and it leads to a similar expansion as desired, and thus it has worked till now without any issues from this.

Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2024-02-03 12:46:08 -03:00
Tomáš Pilný 3e85c1886e esp32/dac-one-shot: lower-half driver for ESP32 internal DAC
Enable with ./tools/configure.sh -l esp32-devkitc:dac
DAC channel 0 = GPIO 25
DAC channel 1 = GPIO 26
default path: /dev/dac0

Resolution 8 bits = values 0~255
Voltage: 0~Vref

The reference voltage 'Vref' here is input from the pin VDD3P3_RTC
which ideally equals to the power supply VDD (3.3V).
2024-02-02 09:23:28 -08:00
Ville Juven f0846e1d2d fs/shmfs: Fix stat() system call for shmfs object
Set i_size for shmfs objects
2024-02-02 09:12:18 -08:00
Ville Juven 07ce2f717a shmfs/shmfs_alloc. Fix POSIX violation for shmfs_truncate
When shmfs_truncate is called, it uses shmfs_alloc_object to create the
physical backing for the shm file. However, the allocated physical
memory returned by mm_pgalloc is not cleared when CONFIG_BUILD_KERNEL is
set, which is a clear POSIX violation:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html

"If the file was previously shorter than length, its size is increased,
and the extended area appears as if it were zero-filled."

For FLAT and PROTECTED modes zalloc is used, so the violation affects
KERNEL mode only.
2024-02-02 09:09:55 -08:00
Ville Juven 8e4b2e8a2a arch/arm_addrenv_pgmap.c: Add minimal page map implementation for ARM 2024-02-02 09:09:55 -08:00
Ville Juven 15f19c32ac arch/addrenv: Add utility function to wipe one page
up_addrenv_page_wipe can be used to wipe a single page of memory.
2024-02-02 09:09:55 -08:00