Commit Graph

21352 Commits

Author SHA1 Message Date
Ville Juven
17a7a7bd76 mpfs_opensbi: Remove mpfs_opensbi_pmp_setup
The PMP setup should be done in the board specific code, at a much
earlier stage. Granting all access is a security risk anyway.
2023-10-30 12:26:39 -03:00
dongjiuzhu1
8ad88a3fc5 qemu/arm64: implement up_textheap_align and support sotest
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-10-30 18:20:22 +08:00
dongjiuzhu1
da95b35175 arch/arm64: Add declaration for arm64_mmu_set_memregion
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-10-30 18:20:22 +08:00
dongjiuzhu1
489bd15271 arch/arm64: support relocate for aarch64
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-10-30 18:20:22 +08:00
raiden00pl
5b87fdfb9d Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
TimJTi
bfa14406d6 SAMA5D2 add new mcan ioctls 2023-10-28 15:21:46 +08:00
SPRESENSE
f3fabc5d32 Revert "make/archive: Use the full path name when matching or storing names in the archive"
This reverts commit 563125fde3.
2023-10-27 22:26:18 +08:00
liqinhui
1560db9f9b simwifi: Fix the error of the need length for scanning.
The error of estimating the buffer space may cause an out-of-bounds in filling scan results.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-10-27 22:25:58 +08:00
David Sidrane
881d67272c s32k3xx:Serial overcome race where DMA has not fetched TCD again"
With TCD set to loop, there is a window where the
   DMA has raised Done, but not reloaded the TCD, resetting
   count and clearing Done.

   In this window  imxrt_dmach_getcount could then return 0.
   Resulting in imxrt_dma_nextrx returning RXDMA_BUFFER_SIZE.
   Which is not a valid index in the FIFO.

   Since the count will be set to RXDMA_BUFFER_SIZE. When the DMA
   engine completes the TCD reload. The imxrt_dma_nextrx would
   return 0. Therefore:

    (RXDMA_BUFFER_SIZE - dmaresidual) % RXDMA_BUFFER_SIZE

   accomplishes this.
2023-10-27 22:24:27 +08:00
David Sidrane
8b9d05d0f7 s32k1xx:Serial overcome race where DMA has not fetched TCD again"
With TCD set to loop, there is a window where the
   DMA has raised Done, but not reloaded the TCD, resetting
   count and clearing Done.

   In this window  imxrt_dmach_getcount could then return 0.
   Resulting in imxrt_dma_nextrx returning RXDMA_BUFFER_SIZE.
   Which is not a valid index in the FIFO.

   Since the count will be set to RXDMA_BUFFER_SIZE. When the DMA
   engine completes the TCD reload. The imxrt_dma_nextrx would
   return 0. Therefore:

    (RXDMA_BUFFER_SIZE - dmaresidual) % RXDMA_BUFFER_SIZE

   accomplishes this.
2023-10-27 22:24:27 +08:00
David Sidrane
892fe45900 imxrt:Serial overcome race where DMA has not fetched TCD again"
With TCD set to loop, there is a window where the
   DMA has raised Done, but not reloaded the TCD, resetting
   count and clearing Done.

   In this window  imxrt_dmach_getcount could then return 0.
   Resulting in imxrt_dma_nextrx returning RXDMA_BUFFER_SIZE.
   Which is not a valid index in the FIFO.

   Since the count will be set to RXDMA_BUFFER_SIZE. When the DMA
   engine completes the TCD reload. The imxrt_dma_nextrx would
   return 0. Therefore:

    (RXDMA_BUFFER_SIZE - dmaresidual) % RXDMA_BUFFER_SIZE

   accomplishes this.
2023-10-27 22:24:27 +08:00
Robert Middleton
c50d47136c Fix #11005 2023-10-27 11:44:44 +08:00
xuxin19
9112b9e4c0 cmake:add zifencei extension in compile options
this fixes the error opcode `fence.i` by cmake compilation

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-10-26 21:01:46 +08:00
xuxin19
e3003f691b cmake:init RISC-V cmake qemu-rv build
cmake currently does not support non-FlatBuild,
need disable ELF and LOADABLE when compiling other defconfigs

```
 cmake -B build -DBOARD_CONFIG=rv-virt/smp64 -GNinja # for rv32:rv-virt/smp
 cmake --build build -t menuconfig
 cmake --build build
 qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -smp 8 -bios none -kernel nuttx -nographic
```

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-10-26 21:01:46 +08:00
Tiago Medicci Serrano
a2be27ef7d espressif: Update esp-hal-3rdparty version
This version includes a bugfix for the NULL definition.
2023-10-26 20:02:13 +08:00
liqinhui
5228d773d3 simwifi: Support that simwifi connects to the hiden ssid.
Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-10-26 08:27:45 -03:00
Dong Heng
d4cebae155 xtensa/esp32s3: Support to read data from flash to PSRAM 2023-10-26 08:23:34 -03:00
liqinhui
66b11d8940 sim/wifidriver: Fix the scan error.
Using the uninitialized buffer causes the out of bounds.
Add a terminator for the rbuf.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-10-26 16:22:28 +08:00
Stuart Ianna
5fa1819492 arch/risc-v/litex/litex-emac: Add support for phy interrupts.
Add support for PHY interrupts in the architecture layer of the Litex emac driver. Boards need to add handling for interrupt lines, if supported.
2023-10-26 09:02:23 +08:00
simbit18
37729540c0 Fix Kconfig style
Remove spaces from Kconfig
Add comments
2023-10-26 01:53:58 +08:00
simbit18
fa7d0bbd45 Fix nuttx coding style
Remove TABs
2023-10-26 01:53:48 +08:00
dongjiuzhu1
e88a36fa92 libs/modlib: Adding architecture-specific memory allocator for dynamic data loading
Arch can specific the memory allocator for data to optimize access speed.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-10-26 01:53:38 +08:00
dongjiuzhu1
6efdd50d5a arch/sim: Remove executable bit from the normal heap
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-26 01:53:38 +08:00
dongjiuzhu1
861220f649 arch/sim: Simplify the implementation of textheap by reuse the heap manager
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-26 01:53:38 +08:00
David Sidrane
def7a34733 s32k1xx:lpi2c DMA transaction only need the status conditioned
With DMA enabled on some I2C channels but not all
   the Non DMA channels were failing.

   The cause was condition the status with only the enabled
   interrupts on non DMA chennels. This conditioning needs
   to only happen in DMA enabled channels
2023-10-25 17:22:47 +03:00
David Sidrane
506f725a19 s32k3xx:lpi2c DMA transaction only need the status conditioned
With DMA enabled on some I2C channels but not all
   the Non DMA channels were failing.

   The cause was condition the status with only the enabled
   interrupts on non DMA chennels. This conditioning needs
   to only happen in DMA enabled channels
2023-10-25 17:22:47 +03:00
David Sidrane
1b5aeb1a08 imxrt:lpi2c DMA transaction only need the status conditioned
With DMA enabled on some I2C channels but not all
   the Non DMA channels were failing.

   The cause was condition the status with only the enabled
   interrupts on non DMA chennels. This conditioning needs
   to only happen in DMA enabled channels
2023-10-25 17:22:47 +03:00
David Sidrane
611309b956 imxrt:serial Ensure the cache is updated if the DMA has updated again
The DMA can bring in more rx data, than the number of
   DMA completions call backs. The call back happen on
   idle, 1/2 and full events. But in between these events
   the DMA can write more data to the buffers memory that
   need to be brought in to the cache. (invalidate)

   We do the invalidate on the reads from the fifo memory
   if the the DMA as commited since the last read.
2023-10-25 16:14:45 +03:00
chao an
2b06142232 kernel: replace all sem_* to nxsem_*: in kernel space
syscall cannot be called from kernel space

Signed-off-by: chao an <anchao@xiaomi.com>
2023-10-25 15:46:03 +08:00
chao an
3cadf6642a kernel: replace all usleep to nxsig_usleep in kernel space
syscall cannot be called from kernel space

Signed-off-by: chao an <anchao@xiaomi.com>
2023-10-25 15:46:03 +08:00
Stuart Ianna
ee84ea3875 arch/risc-v/litex/litex_gpio: Fix ISR dispatch when using higher GPIO indexes.
Previously, GPIO interrupts were not correctly mapped to the peripheral base register responsible for the interrupt.

Change the IRQ number calculation so the interrupts work correctly on all GPIO peripheral bases.
2023-10-25 15:42:25 +08:00
Stuart Ianna
ac5800386c arch/risc-v/litex/litex_emac: Add support for KSZ8061 ethernet PHY.
Adds support for using the microchip KSZ8061 ethernet PHY instead of the default DP83848C.
2023-10-25 13:33:03 +08:00
David Sidrane
8cb65d9b3b s32k1xx:lpi2c end only on stop with end of packet 2023-10-24 19:27:03 +03:00
David Sidrane
b2b5826b80 s32k3xx:lpi2c end only on stop with end of packet 2023-10-24 19:27:03 +03:00
David Sidrane
119bf660a4 imxrt:lpi2c end only on stop with end of packet 2023-10-24 19:27:03 +03:00
Tiago Medicci Serrano
41c1b153e3 esp32/bluetooth: Select option to pin the HCI TX thread to CPU core
When ESP32's BLE is enabled, select the option to pin the HCI TX
thread to a specific core. This is necessary to avoid problems
with the BLE task that runs pinned to the PRO CPU (core 0) while
running with SMP enabled.
2023-10-24 22:41:44 +08:00
Ville Juven
9c725c4903 arch/risc-v: Simplify pmp_check_region_attrs sanity-checks
For TOR: Any size and 4-byte aligned address is required
For NA4: Only size 4 and 4-byte aligned address is good
For NAPOT: Minimum size is 8 bytes, minimum base alignment is 8 bytes,
           and size must be power-of-two aligned with base

This commit simplifies these checks and removes all the nonsense added
by a misunderstanding of how the MPFS / Polarfire SoC's PMP works.
2023-10-23 13:10:59 -03:00
Ville Juven
8e6b448f47 arch/risc-v: Remove unnecessary PMP kconfig options
These options are just wrong and a result of misunderstanding of the
Polarfire SoC spec. There are no feature limitations in the CPU PMP
implementation -> remove any configuration options added.
2023-10-23 13:10:59 -03:00
David Sidrane
6101ebd565 imxrt:lpi2c Timeouts can not be 0 2023-10-23 22:44:55 +08:00
David Sidrane
91034ff4d6 s32k3xx:lpi2c Timeouts can not be 0 2023-10-23 22:44:55 +08:00
David Sidrane
7b8ea03ea3 s32k1xx:lpi2c Timeouts can not be 0 2023-10-23 22:44:55 +08:00
GD32-MCU
6e94f7432f add gd32f470i board support 2023-10-21 11:45:03 -03:00
Masayuki Ishikawa
a98650f609 arch: arm64: Remove unnecessary code in arm64_cpu_idle.S
Summary:
- I noticed that irq is enabled explicitly in arm64_cpu_idle.S
- The code is unnecessary since tasks, including the idle task,
  are created with irq enabled in up_initial_state()

Impact:
- Should be none

Testing:
- qemu-armv8a:netnsh_smp_hv with qemu-7.2.4

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-10-18 17:06:29 +08:00
zhangyuan21
48ca996ad7 arch: arm64 support smp function call
Add up_send_smp_call function to support smp function call.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-10-18 09:57:50 +08:00
Ville Juven
0e75e53cc8 mpfs_head.S: Simplify clearing PMP
Initially clear PMP for all harts, this fixes random warm reset issues.

Signed-off-by: Ville Juven <ville.juven@unikie.com>
2023-10-17 20:13:09 +08:00
Simon Filgis
882afc885e channel gain switching in aefc by ioctl
Update arch/arm/include/samv7/sam_afec.h

remove "offset may be uninitialized" warning

Update arch/arm/include/samv7/sam_afec.h

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update arch/arm/include/samv7/sam_afec.h

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update arch/arm/src/samv7/sam_afec.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update arch/arm/src/samv7/sam_afec.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update arch/arm/include/samv7/sam_afec.h

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update arch/arm/include/samv7/sam_afec.h

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

remove blank line
2023-10-16 21:55:40 +08:00
Ville Juven
3f878d8100 mpfs_ethernet.c: Release tx descriptor and rx buffer properly
Instead of releasing rx descriptor twice and tx buffer twice.
2023-10-16 21:54:31 +08:00
Ville Juven
ee9e41f2dd mpfs_ethernet.c: Fix possible NULL de-reference
Fix case where NULL is de-referenced via tx/rx buffer or descriptor. Only
1 queue is currently set up for each, so the indices 1,2,3 are not valid
and should not be handled.
2023-10-16 21:54:31 +08:00
Ville Juven
64b6ac3d87 mpfs/mpfs_entrypoints.c: Fix potential R_RISCV_JAL linker error
Change bgtz t0, mpfs_opensbi_prepare_hart to tail-call to ensure there
will be no link time error due to the jump offset being too large.
2023-10-16 21:52:01 +08:00
zhangyuan21
21d9066c95 arm64: support up_coherent_dcache function
Before code is executed after being loaded into memory,
it is necessary to ensure the consistency of I and D cache.
The up_coherent_dcache function will flush the dache and
invalidate the icache to ensure cache consistency.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-10-16 16:08:23 +08:00