[PATCH 1/7] lmb: default LMB_LIMIT_DMA_BELOW_RAM_TOP for 64-bit Mediatek SoCs

David Lechner dlechner at baylibre.com
Sat Jun 13 00:13:47 CEST 2026


On 6/12/26 4:30 PM, David Lechner wrote:
> On 6/12/26 12:52 PM, Sam Edwards wrote:
>> On Fri, Jun 12, 2026 at 10:32 AM David Lechner <dlechner at baylibre.com> wrote:
>>>
>>> Add 64-bit Mediatek ARM SoCs to the default y setting of
>>> LMB_LIMIT_DMA_BELOW_RAM_TOP. These platforms have a 4GiB DMA limit, e.g.
>>> for the SD/MMC controller.
>>
>> Hi David,
>>
>> Is the 4GiB DMA limit due to the interconnect itself or are there
>> merely a few blocks that can't speak 64-bit? If the latter, I think
>> it'd be clearer to associate the setting with the culprit driver(s)
>> rather than the whole platform, so that it can be removed if/when
>> those drivers begin to use bounce buffers.
>>
> For MediaTek, I think it is mostly specific IP blocks (e.g. MMC in the
> mt8xxx targets in and NETSYS in mt79xx targets covered by this series are
> the ones I am aware of).
> 
> Weijie Gao, maybe you have more information about this?
> 
> 

Sam,

Just to make sure I understood you correctly, your suggestion is to
do this instead?

---
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 24bd16ad5f3..e2c5a54f925 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -858,6 +858,7 @@ config MMC_MTK
 	bool "MediaTek SD/MMC Card Interface support"
 	depends on ARCH_MEDIATEK || ARCH_MTMIPS || ARCH_AIROHA
 	depends on OF_CONTROL
+	select LMB_LIMIT_DMA_BELOW_RAM_TOP
 	help
 	  This selects the MediaTek(R) Secure digital and Multimedia card Interface.
 	  If you have a machine with a integrated SD/MMC card reader, say Y here.
diff --git a/drivers/net/mtk_eth/Kconfig b/drivers/net/mtk_eth/Kconfig
index 5d4e54ab90e..7d58f542bde 100644
--- a/drivers/net/mtk_eth/Kconfig
+++ b/drivers/net/mtk_eth/Kconfig
@@ -5,6 +5,7 @@ config MEDIATEK_ETH
 	select PHYLIB
 	select DM_GPIO
 	select DM_RESET
+	select LMB_LIMIT_DMA_BELOW_RAM_TOP
 	help
 	  This Driver support MediaTek Ethernet GMAC
 	  Say Y to enable support for the MediaTek Ethernet GMAC.
diff --git a/lib/Kconfig b/lib/Kconfig
index 27ad43125e4..cf13ac1bdad 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -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 || (ARCH_MEDIATEK && ARM64)
+	default y if ARCH_BCM283X
 	help
 	  Some architectures can not DMA above ram_top boundary,
 	  which is after 4 GiB or 32-bit boundary too. Limit the



More information about the U-Boot mailing list