Skip to contentSkip to conversation

lmb: Add the Rockchip architecture as requiring DMA below 4G

PATCH In review Heiko Stuebner 4 participants 4 messages Jun 13 – Jun 16 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lmb: Add the Rockchip architecture as requiring DMA below 4G

Loading EFI parts like a Debian-Installer on Rockchip SoCs creates interesting results, in that on some boards the Grub bootloader can't find any partitions on a USB-Stick, or loading a kernel from Grub spews
EHCI fail timeout STS_IAA set
messages before failing and on others the loading something like efivars from an eMMC creates read errors and making the MMC vanish from U-Boot.

This only affected boards with at least 4GB of RAM.

These boards have at least 256MB of memory placed above the actual 4GB address space (due to the iomem being in between) and while kernel, initramfs, dt are generally loaded to predefined addresses, additional EFI parts (efivars, etc) are likely just loaded "somewhere" and it seems this always landed in that higher up memory part.

Also in the Linux-kernel peripherals like EMMC, USB, etc already run with a 32bit dma-mask set.

So far, I've seen this on RK3568 and RK3588, but as the same peripherals are used on most Rockchip SoCs, it makes sense to limit this on all.

So add ARCH_ROCKCHIP to the default-y list of LMB_LIMIT_DMA_BELOW_RAM_TOP.

---
 lib/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig +1 -1
index cf13ac1bdad..9e0f0ad7d06 100644
@@ -1298,7 +1298,7 @@ config SPL_LMB_ARCH_MEM_MAP
 config LMB_LIMIT_DMA_BELOW_RAM_TOP
 	bool
 	depends on LMB
-	default y if ARCH_BCM283X
+	default y if ARCH_BCM283X || ARCH_ROCKCHIP
 	help
 	  Some architectures can not DMA above ram_top boundary,
 	  which is after 4 GiB or 32-bit boundary too. Limit the
Signature · 1 line
2.47.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Heiko Stuebner

Loading EFI parts like a Debian-Installer on Rockchip SoCs creates interesting results, in that on some boards the Grub bootloader can't find any partitions on a USB-Stick, or loading a kernel from Grub spews
EHCI fail timeout STS_IAA set
messages before failing and on others the loading something like efivars from an eMMC creates read errors and making the MMC vanish from U-Boot.

This only affected boards with at least 4GB of RAM.

These boards have at least 256MB of memory placed above the actual 4GB address space (due to the iomem being in between) and while kernel, initramfs, dt are generally loaded to predefined addresses, additional EFI parts (efivars, etc) are likely just loaded "somewhere" and it seems this always landed in that higher up memory part.

Also in the Linux-kernel peripherals like EMMC, USB, etc already run with a 32bit dma-mask set.

Quoted 6 lines

So far, I've seen this on RK3568 and RK3588, but as the same peripherals are used on most Rockchip SoCs, it makes sense to limit this on all.

So add ARCH_ROCKCHIP to the default-y list of LMB_LIMIT_DMA_BELOW_RAM_TOP.

I have also faced above 4GB of RAM issue on Rockchip boards, so this is:

Regards,
Jonas

Quoted 17 lines
---
 lib/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig +1 -1
index cf13ac1bdad..9e0f0ad7d06 100644
@@ -1298,7 +1298,7 @@ config SPL_LMB_ARCH_MEM_MAP
 config LMB_LIMIT_DMA_BELOW_RAM_TOP
 	bool
 	depends on LMB
-	default y if ARCH_BCM283X
+	default y if ARCH_BCM283X || ARCH_ROCKCHIP
 	help
 	  Some architectures can not DMA above ram_top boundary,
 	  which is after 4 GiB or 32-bit boundary too. Limit the
Reviewed-by on v1 1/1
#2 lore raw
In reply to Heiko Stuebner
Quoted 19 lines · Heiko Stuebner

Loading EFI parts like a Debian-Installer on Rockchip SoCs creates interesting results, in that on some boards the Grub bootloader can't find any partitions on a USB-Stick, or loading a kernel from Grub spews
EHCI fail timeout STS_IAA set
messages before failing and on others the loading something like efivars from an eMMC creates read errors and making the MMC vanish from U-Boot.

This only affected boards with at least 4GB of RAM.

These boards have at least 256MB of memory placed above the actual 4GB address space (due to the iomem being in between) and while kernel, initramfs, dt are generally loaded to predefined addresses, additional EFI parts (efivars, etc) are likely just loaded "somewhere" and it seems this always landed in that higher up memory part.

Also in the Linux-kernel peripherals like EMMC, USB, etc already run with a 32bit dma-mask set.

Quoted 6 lines

So far, I've seen this on RK3568 and RK3588, but as the same peripherals are used on most Rockchip SoCs, it makes sense to limit this on all.

So add ARCH_ROCKCHIP to the default-y list of LMB_LIMIT_DMA_BELOW_RAM_TOP.

Quoted 20 lines
---
 lib/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig +1 -2
index cf13ac1bdad..9e0f0ad7d06 100644
@@ -1298,7 +1298,7 @@ config SPL_LMB_ARCH_MEM_MAP
 config LMB_LIMIT_DMA_BELOW_RAM_TOP
        bool
        depends on LMB
-       default y if ARCH_BCM283X
+       default y if ARCH_BCM283X || ARCH_ROCKCHIP
        help
          Some architectures can not DMA above ram_top boundary,
          which is after 4 GiB or 32-bit boundary too. Limit the
--

2.47.3

#3 lore raw
In reply to Heiko Stuebner
Quoted 8 lines · Heiko Stuebner

Loading EFI parts like a Debian-Installer on Rockchip SoCs creates interesting results, in that on some boards the Grub bootloader can't find any partitions on a USB-Stick, or loading a kernel from Grub spews
EHCI fail timeout STS_IAA set
messages before failing and on others the loading something like efivars from an eMMC creates read errors and making the MMC vanish from U-Boot.

[...]

Applied to u-boot/master, thanks!

[1/1] lmb: Add the Rockchip architecture as requiring DMA below 4G

      commit: 8b154abd31e499d7e90d125d36d997c75daa6b05
Signature · 1 line
Tom