Commit Graph

55024 Commits

Author SHA1 Message Date
simbit18 715a3d8446 ci/platforms: linux.sh ubuntu.sh switch Wget to cURL tool
Switch wget to cURL tool for:
arm_gcc_toolchain()
arm64_gcc_toolchain()
riscv_gcc_toolchain()
sparc_gcc_toolchain()
xtensa_esp32_gcc_toolchain()
xtensa_esp32s2_gcc_toolchain()
xtensa_esp32s3_gcc_toolchain()
wasi_sdk()

Used git clone --depth 1 a shallow clone with a history truncated to reduce the clone size for:
kconfig_frontends()
2024-09-26 10:53:58 -03:00
Masayuki Ishikawa 44e8772ee9 audio: Fix caps initialization in pcm_enqueuebuffer()
Summary:
- I noticed that caps is not correctly initialized.
- This commit fixes this issue.

Impact:
- None

Testing:
- Tested with spresense:wifi_smp + nxplayer

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2024-09-26 13:57:53 +02:00
Huang Qi d9b95c5ca0 riscv: Remove some unnecessary macro guards
If CONFIG_SMP is not enabled, riscv_cpuindex.c will not be compiled
anyway.

And for CONFIG_ARCH_FPU, if it's not enabled, riscv_fpucmp.c will not
be compiled.

So we can remove the unnecessary macro guard for up_cpu_index() and
up_fpucmp().

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-26 16:23:48 +08:00
lipengfei28 1eb151bef6 add pci_bus_map_region and pci_map_region macro
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-26 16:23:18 +08:00
wangyongrong 3b09de844f pci.h: add pci_map_bar_region support
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-26 16:23:18 +08:00
chenrun1 e86be98d14 fs_rammap:Check last fileseek restore fpos
Summary:
  When restoring rammap fpos, we check the return value to avoid potential problems caused by no error return if the restore fails.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-26 16:15:17 +08:00
chao an a04e44ea75 syslog/channel: move syslog channel map into rodata
add SYSLOG_REGISTER to support disable syslog channel register

Signed-off-by: chao an <anchao@lixiang.com>
2024-09-26 16:10:29 +08:00
chao an 9abe737ef3 syslog/channel: add constant attribute if SYSLOG_IOCTL is not enabled
move all private channel define from data to rodata

Signed-off-by: chao an <anchao@lixiang.com>
2024-09-26 16:10:29 +08:00
Jukka Laitinen 950b63c7f1 arch/risc-v/src/mpfs/mpfs_opensbi.c: Fix conflicting datatypes defined by NuttX vs. opensbi
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-09-26 16:10:09 +08:00
Jukka Laitinen 82ef3813bd arch/risc-v/src/mpfs: Make mpfs_hart_index2id table modifiable by bootloader
This is actually the same table as entrypoints, so just use the same data, which
can be set before booting any of the harts

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-09-26 16:10:09 +08:00
Ville Juven 27648479bc mpfs_mpucfg.h: Add missing MPUCFG registers
Now all registers are defined
2024-09-26 16:09:54 +08:00
chao an 4195851845 drivers/rpmsg: replace metal_list_for_each to safety version
replace metal_list_for_each to safety version to avoid invalid access to deleted node in destory flow

Signed-off-by: chao an <anchao@lixiang.com>
2024-09-26 08:36:14 +08:00
Jukka Laitinen 06b3416384 arch/risc-v/src/common/riscv_initialstate.c: Fix stack pointer in coloration
The logical CPU index should be retrieved with this_cpu(); the
riscv_mhartid() returns the actual hart id of the SoC.

For mpfs target for example, NuttX can run on a single HART, for example on mhartid 2, but there is still just one logical CPU for the NuttX.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-09-26 08:35:42 +08:00
adriendesp 6d72a8d676 [arch/xmc4] added register description for ERU and POSIF peripherals
Register map of ERU and POSIF peripherals, from the Ref. Manuals for both XMC45 and XMC4[7-8]
2024-09-25 19:05:12 -03:00
Bowen Wang 4bfa73f842 include/nuttx/rptun/rptun.h: change offset type to uint32_t
Sync the offset data type with resource table defined in OpenAMP
and Linux.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-26 00:04:05 +08:00
mazhuang 4fa1c460d3 rptun/rptun_ivshmem:add restart cmd to reboot slave
Master can send restart command to slave to reboot the slave core

Signed-off-by: mazhuang <mazhuang@xiaomi.com>
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-09-26 00:04:05 +08:00
xuxingliang 75b87a85dd rptun: fix memleak on failure
Leak backtrace:
    1 14 2096 9886 0x4318d768 [0x040320744] <romfs_fileconfigure+184> romfs/fs_romfsutil.c:1039
                                                 [0x04031fd3e] <romfs_open+378> romfs/fs_romfs.c:281
                                                 [0x04027fa9e] <file_open+446> vfs/fs_open.c:244
                                                 [0x0402ab986] <rptun_store_open+26> rptun/rptun.c:955
                                                 [0x04034cc88] <remoteproc_load+120> open-amp/lib/remoteproc/remoteproc.c:452
                                                 [0x0402ac8ac] <rptun_dev_start+176> rptun/rptun.c:748
                                                 [0x0402ad038] <rptun_ioctl+416> rptun/rptun.c:618

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-09-26 00:04:05 +08:00
Bowen Wang dbe43b0ae9 rptun: move rptun cmd definition before the resource table
Because locate the command at the end the resource table is unfriendly
when we want to support multi virtio devices instead only one virtio
rpmsg device.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-26 00:04:05 +08:00
Yongrong Wang 10e8b6c9f6 rptun/rpmsg_virtio: remove chip cmd and reuse the common ones
Add more common command for rptun and rpmsg_virtio frameworks,
also modify the rptun and rpmsg_virtio driver to use the common
commands.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-09-26 00:04:05 +08:00
Yongrong Wang 420af99797 sim_rptun.c: remove sim_rptun_panic
Because we can use the common part implemented in rptun

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-09-26 00:04:05 +08:00
Yongrong Wang 7c7d08d13a rptun.c/rpmsg_virtio.c: move panic logic from chip to rptun/rpmsg_virtio
Move the panic logic in common places, later we can move more logic to
the framework instead of having the drivers implement it repeatedly.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-26 00:04:05 +08:00
Bowen Wang 9cceccb14a sim/sim_rptun: add 64-bit support for sim_rptun
add remote addrenv to make the da is start from 0, so the uint32_t
da in resource table can store the correct address

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-26 00:04:05 +08:00
wangyongrong 42ce76c6bf rptun_ivshmem.c: Replace work queue with wdog
wdog has better performance than work queue

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-26 00:04:05 +08:00
Bowen Wang b5ebb8c06d drivers/rptun/rptun.c: move headrx out of CONFIG_RPTUN_PM
headrx is very convient to check weather current core miss interrupt
by comparing the headrx with the rx vring avail.idx for slave side or
rx vring used.idx for master side.

So move headrx out of the CONFIG_RPTUN_PM range.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-26 00:04:05 +08:00
Bowen Wang 1a97fa73f0 rptun: rptun pm and rptun dump support cacheable memory
Should invalidate the memory when the data is located in shared
memory and write by remote core.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-26 00:04:05 +08:00
Xiang Xiao 3ea02c5992 rptun: Rename rptun_panic_ to rptun_panic
The function name rptun_panic_ is not consistent with other functions

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-09-26 00:04:05 +08:00
ligd 46713eaf16 rptun: add timeout to wait_tx_buffer callback
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-26 00:04:05 +08:00
Bowen Wang 46e5e576e1 rptun/rptun_dump: remove unused rptun_dump.c
rptun_dump related code has been moved to rptun.c from rptun_dump.c,
but file rptun_dump.c is not deleted in PR:
https://github.com/apache/nuttx/pull/11712

So delete this file.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-26 00:04:05 +08:00
Bowen Wang d320dfd20f rptun: BUG fix, should not destory the semaphore twice
This BUG is introduced in PR: https://github.com/apache/nuttx/pull/13172

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-26 00:04:05 +08:00
ligd c76dfde744 rptun: use detail name for pm wakelock
So we can distinguish the pm wakelock

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-26 00:04:05 +08:00
Bowen Wang 7243616402 drivers/rptun: flush the image memory when read from the file system
Flush the image memory to make sure the remote core access the correct
image.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-26 00:04:05 +08:00
ligd 7f3dce5bbb rptun: add RPTUN_PM_AUTORELAX method.
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-26 00:04:05 +08:00
ligd f569c065f6 rptun/pm: use pm_wakelock
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-26 00:04:05 +08:00
ligd 3468f5cec8 rptun/pm: add check to rptun_pm_callback() incase of start early
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-26 00:04:05 +08:00
ligd 0ce6bd546d rptun: use local rx virtqueue idx to resolve remote low power
Store the rx virtqueue idx to the local headrx index, and only
process the data when the rx virtqueue has data to avoid access
the ram in low power mode.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-26 00:04:05 +08:00
yanghuatao 520bb6544e nuttx/dirvers: Add secure rptun file
rptun secure is a rptun driver used for the rpmsg communication
between (Non-Secure) REE and (Secure) TEE environments.

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-26 00:04:05 +08:00
wangyongrong 381e7f225d pci.c: add pci_read/write_io_qword support
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-26 00:00:03 +08:00
wangyongrong 5668a3e283 x86_64_pci.c: x86_64_pci_read/write_io memory support
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-26 00:00:03 +08:00
Eero Nurkkala 737d4bf418 risc-v/mpfs: emmcsd: enforce HS DDR mode
Previously, address 0x03b70000u was written with shift bits
that only changed the bit width, not the mode. HS mode is
changed via 0x03B90100, which is required, according to Jedec
specs, for DDR mode. HS mode was not applied before. Enforce
DDR mode (50 MHz) for now.

The real boost, however, comes from removing the DMA limitation
at 0x08xxxxxx address space, which now seems unnecessary.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2024-09-25 23:58:08 +08:00
Eero Nurkkala 6db0f7f009 risc-v/mpfs: emmcsd: deny unaligned access
Don't allow unaligned access with the DMA requests.
Return -EFAULT in case the provided address is unaligned.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2024-09-25 23:58:08 +08:00
Jari Nippula 9b60f8d9d0 emmc interrupt blackout issue fix
sendfifo() function need enable BWR_IE before checking if BWE is enabled
to avoid BWE to be activated between the BWE check and BWR interrupt
enabling, which causes the interrupt to be missed and Data Timeout error.
2024-09-25 23:58:08 +08:00
Ville Juven c23babbcc7 mpfs/emmcsd: Set 8-bit data width and DDR HS mode for eMMC
This is not the correct way to do this, but it gives a nice perf. boost
2024-09-25 23:58:08 +08:00
Ville Juven c36bdba3cb mpfs/emmcsd: Set same base clock for SDR/DDR modes 2024-09-25 23:58:08 +08:00
Huang Qi c1b41fefeb riscv_cpuinfo: Add support for RVV extension in CPU info
Add missing info for RVV ISA extention, which is already supported
by NuttX.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-25 23:54:19 +08:00
simbit18 45a8d99755 ci/platforms/msys2.sh: update esptool version and switch Wget to cURL tool
Bumps esptool from 4.7.0 to 4.8.0.

Switch wget to cURL tool
arm_gcc_toolchain()
arm64_gcc_toolchain()
riscv_gcc_toolchain()
sparc_gcc_toolchain()
xtensa_esp32_gcc_toolchain()
xtensa_esp32s2_gcc_toolchain()
xtensa_esp32s3_gcc_toolchain()

Create a shallow clone with a history truncated of
gen_romfs()
kconfig_frontends()
2024-09-25 23:52:45 +08:00
Jani Paalijarvi 3613eb209a arch/risc-v/src/mpfs/mpfs_corepwm.c: Disable PWM channels in setup
Set frequency to zero and disable channels in pwm_setup()
to avoid unexpected behaviour when starting PWM.

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2024-09-25 21:47:15 +08:00
Jukka Laitinen 7e6e18697c arch/risc-v/src/mpfs: Remove CONFIG_MPFS_COREPWMx_PWMCLK configs
These are always the same as FPGA peripheral clock, so use that directly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-09-25 21:47:15 +08:00
Jukka Laitinen 5238c3bb25 drivers/mmcsd/mmcsd_sdio.c: Fix setting SDIO_WIDEBUS for SD cards
This corrects the setting widebus for SD cards, which was recently broken in 4f7f751d2a.

The if checking the priv->caps, priv->buswidth and IS_MMC has been wrong for
some time. The proper logic is that for MMC only the priv->caps is checked.
For SD card, both priv->caps and priv->buswidth need to be checked.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-09-25 21:10:26 +08:00
zhangshuai39 5e74ed8d34 net/tcp: Fix TCP keepalive time unit misuse problem
Summary:
  The conn->keeptimer units is decisecond,but its unit is treated as
half-second in the tcp_timer & tcp_get_timeout function.
  Therefore conn>keeptimer needs to be divided by 5(DSEC_PER_HSEC)
to match half-second units.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2024-09-25 10:04:41 -03:00
hujun5 efdb4322fc arm: we should use tcb->xcp.regs instead of up_current_regs() as the basis for judging whether to call restore_critical_section.
This commit fixes the regression from https://github.com/apache/nuttx/pull/13444

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-25 17:10:14 +09:00