This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new a0901ec142 mpfs_usb.c: Remove PMPCFG configuration from the driver
a0901ec142 is described below
commit a0901ec142d108cff1eddb3d614392ab9ba9d3e1
Author: Ville Juven <[email protected]>
AuthorDate: Thu Jan 11 12:18:24 2024 +0200
mpfs_usb.c: Remove PMPCFG configuration from the driver
This is not the right place to modify DMA memory protection values.
Why not? These are designed to protect other AMP mode instances. Opening
the entire SoC's memory for the USB DMA kind of defeats this purpose.
Also, the driver cannot know how to configure these registers correctly,
only opening up the whole SoC "works".
---
arch/risc-v/src/mpfs/mpfs_usb.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/risc-v/src/mpfs/mpfs_usb.c b/arch/risc-v/src/mpfs/mpfs_usb.c
index fec9deb8fd..f30d5fc457 100644
--- a/arch/risc-v/src/mpfs/mpfs_usb.c
+++ b/arch/risc-v/src/mpfs/mpfs_usb.c
@@ -3613,7 +3613,7 @@ static void mpfs_usb_iomux(void)
#ifdef CONFIG_USBDEV_DMA
/* DMA operations need to open the USB PMP registers for proper
- * operation. If not configured, apply default settings.
+ * operation.
*/
uint64_t pmpcfg_usb_x;
@@ -3622,28 +3622,24 @@ static void mpfs_usb_iomux(void)
if ((pmpcfg_usb_x & 0x1ffffff000000000llu) != 0x1f00000000000000llu)
{
uerr("Please check the MPFS_PMPCFG_USB_0 register.\n");
- putreg64(0x1f00000fffffffffllu, MPFS_PMPCFG_USB_0);
}
pmpcfg_usb_x = getreg64(MPFS_PMPCFG_USB_1);
if ((pmpcfg_usb_x & 0x1ffffff000000000llu) != 0x1f00000000000000llu)
{
uerr("Please check the MPFS_PMPCFG_USB_1 register.\n");
- putreg64(0x1f00000fffffffffllu, MPFS_PMPCFG_USB_1);
}
pmpcfg_usb_x = getreg64(MPFS_PMPCFG_USB_2);
if ((pmpcfg_usb_x & 0x1ffffff000000000llu) != 0x1f00000000000000llu)
{
uerr("Please check the MPFS_PMPCFG_USB_2 register.\n");
- putreg64(0x1f00000fffffffffllu, MPFS_PMPCFG_USB_2);
}
pmpcfg_usb_x = getreg64(MPFS_PMPCFG_USB_3);
if ((pmpcfg_usb_x & 0x1ffffff000000000llu) != 0x1f00000000000000llu)
{
uerr("Please check the MPFS_PMPCFG_USB_3 register.\n");
- putreg64(0x1f00000fffffffffllu, MPFS_PMPCFG_USB_3);
}
#endif
}