summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mediatek
AgeCommit message (Collapse)Author
2026-04-29configs: mt7622: remove empty header fileWeijie Gao
Remove the empty include/configs/mt7622.h header file as it is not needed. The Kconfig entry that referenced it is also removed. Signed-off-by: Weijie Gao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-07arm: mediatek: mt8189: print specific CPU informationDavid Lechner
Modify the print_cpuinfo() function to print a more specific CPU name when possible. Reviewed-by: Macpaul Lin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-07arm: mediatek: add SIP platform bininfo lookupsDavid Lechner
Add a couple of functions to look up the segment and part name using SIP calls. These will be used to print more accurate CPU information in print_cpuinfo(). Reviewed-by: Macpaul Lin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-07arm: mediatek: add support of MT8189 SoC familyChris-QJ Chen
Add TARGET_MT8189 for MT8189 and similar SoCs. Signed-off-by: Chris-QJ Chen <[email protected]> Signed-off-by: Macpaul Lin <[email protected]> Reviewed-by: Julien Stephan <[email protected]> Reviewed-by: Macpaul Lin <[email protected]> Link: https://patch.msgid.link/20260323-mtk-mt8391-initial-support-v3-2-19dd92f4543f@baylibre.com Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8518: remove call to fdtdec_setup_memory_banksize()David Lechner
Remove an incorrect call to fdtdec_setup_memory_banksize() in dram_init() for mt8518. fdtdec_setup_memory_banksize() populates gd->bd->bi_dram[bank].start and gd->bd->bi_dram[bank].size base on the "memory" node in the device tree. However, calling it from dram_init() is too early because gd->bd has not been allocated yet. gd->bd->bi_dram[0].start and gd->bd->bi_dram[0].size are already correctly initialized later in dram_init_banksize(), so we do not need to replace the removed function call with anything else. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8518: drop dram_init_banksize()David Lechner
Drop override of dram_init_banksize() weak function for mt8518. This is effectively the same as the default implementation, so we do not need to override it. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8516: drop dram_init_banksize()David Lechner
Drop override of dram_init_banksize() weak function for mt8516. This is effectively the same as the default implementation, so we do not need to override it. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8512: drop dram_init_banksize()David Lechner
Drop override of dram_init_banksize() weak function for mt8512. This is exactly the same as the default implementation, so we do not need to override it. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8365: drop dram_init_banksize()David Lechner
Drop override of dram_init_banksize() weak function for mt8365. This is effectively the same as the default implementation, so we do not need to override it. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8195: fix gd->ram_top limitDavid Lechner
Fix the implementation of the gd->ram_top limit for mt8195. The intention of the comment about MMC/DMA is correct, but the implementation was wrong. gd->mon_len is set to the code size of U-Boot, so trying to set it to limit gd->ram_top does not make sense. Instead, there is already a get_effective_memsize() weak function that we can override to implement the required limit on the usable memory size. This is used to set gd->ram_top in setup_dest_addr(). The comment about the extra SZ_1M needing to be reserved is not correct as U-Boot already takes care of this (with the actual size of U-Boot) in the various board_f functions, so it is removed. This fixes DMA not working on MMC on mt8195. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8195: remove call to fdtdec_setup_memory_banksize()David Lechner
Remove an incorrect call to fdtdec_setup_memory_banksize() in dram_init() for mt8195. fdtdec_setup_memory_banksize() populates gd->bd->bi_dram[bank].start and gd->bd->bi_dram[bank].size base on the "memory" node in the device tree. However, calling it from dram_init() is too early because gd->bd has not been allocated yet. gd->bd->bi_dram[0].start and gd->bd->bi_dram[0].size are already correctly initialized later in dram_init_banksize(), so we do not need to replace the removed function call with anything else. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8195: check return value of fdtdec_setup_mem_size_base()David Lechner
Check and propagate the return value of fdtdec_setup_mem_size_base() in dram_init() for mt8195. This function could fail if the device tree is malformed. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8195: drop dram_init_banksize()David Lechner
Drop override of dram_init_banksize() weak function for mt8195. This is effectively the same as the default implementation, so we do not need to override it. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8188: fix gd->ram_top limitDavid Lechner
Fix the implementation of the gd->ram_top limit for mt8188. The intention of the comment about MMC/DMA is correct, but the implementation was wrong. gd->mon_len is set to the code size of U-Boot, so trying to set it to limit gd->ram_top does not make sense. Instead, there is already a get_effective_memsize() weak function that we can override to implement the required limit on the usable memory size. This is used to set gd->ram_top in setup_dest_addr(). The comment about the extra SZ_1M needing to be reserved is not correct as U-Boot already takes care of this (with the actual size of U-Boot) in the various board_f functions, so it is removed. This fixes DMA not working on MMC on mt8188. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8188: remove call to fdtdec_setup_memory_banksize()David Lechner
Remove an incorrect call to fdtdec_setup_memory_banksize() in dram_init() for mt8188. fdtdec_setup_memory_banksize() populates gd->bd->bi_dram[bank].start and gd->bd->bi_dram[bank].size base on the "memory" node in the device tree. However, calling it from dram_init() is too early because gd->bd has not been allocated yet. gd->bd->bi_dram[0].start and gd->bd->bi_dram[0].size are already correctly initialized later in dram_init_banksize(), so we do not need to replace the removed function call with anything else. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8188: check return value of fdtdec_setup_mem_size_base()David Lechner
Check and propagate the return value of fdtdec_setup_mem_size_base() in dram_init() for mt8188. This function could fail if the device tree is malformed. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8188: drop dram_init_banksize()David Lechner
Drop override of dram_init_banksize() weak function for mt8188. This is effectively the same as the default implementation, so we do not need to override it. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8183: remove call to fdtdec_setup_memory_banksize()David Lechner
Remove an incorrect call to fdtdec_setup_memory_banksize() in dram_init() for mt8183. fdtdec_setup_memory_banksize() populates gd->bd->bi_dram[bank].start and gd->bd->bi_dram[bank].size base on the "memory" node in the device tree. However, calling it from dram_init() is too early because gd->bd has not been allocated yet. gd->bd->bi_dram[0].start and gd->bd->bi_dram[0].size are already correctly initialized later in dram_init_banksize(), so we do not need to replace the removed function call with anything else. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt8183: drop dram_init_banksize()David Lechner
Drop override of dram_init_banksize() weak function for mt8183. This is effectively the same as the default implementation, so we do not need to override it. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt7988: drop dram_init_banksize()David Lechner
Drop override of dram_init_banksize() weak function for mt7988. This is effectively the same as the default implementation, so we do not need to override it. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-04-06arm: mediatek: mt7987: drop dram_init_banksize()David Lechner
Drop override of dram_init_banksize() weak function for mt7987. This is effectively the same as the default implementation, so we do not need to override it. Reviewed-by: Julien Stephan <[email protected]> Tested-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-03-06arm: mediatek: MT8195 fix mem_mapJulien Stephan
Commit 2517e2b524e8 ("arm: mediatek: add support for MediaTek MT8195 SoC") was merged after commit 24ffbb2aa17e ("arm: mediatek: consolidate ARMv8 memory maps") but was not rebased on top of it, so mem_map is defined twice. Fix it. Fixes: 2517e2b524e8 ("arm: mediatek: add support for MediaTek MT8195 SoC") Signed-off-by: Julien Stephan <[email protected]> Reviewed-by: Macpaul Lin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
2026-02-18Merge patch series "Add MT8195 support"Tom Rini
Julien Stephan <[email protected]> says: This series adds basic support for Mediatek soc MT8195: - clock driver - watchdog - add a new macro helper to define gate clock. Other driver can be cleaned later to use the new macro Other driver will be added later. It will also serve as basis for board support such as MT8395_EVK based on MT8195. Link: https://lore.kernel.org/r/[email protected]
2026-02-18arm: mediatek: add support for MediaTek MT8195 SoCJulien Stephan
This adds basic support for MediaTek MT8195 SoC. Add watchdog support by adding upstream compatible string. Signed-off-by: Julien Stephan <[email protected]>
2026-02-18arm: mediatek: add CONFIG_MTK_MEM_MAP_DDR_BASE_PHYDavid Lechner
Add a CONFIG_MTK_MEM_MAP_DDR_BASE_PHY variable to specify the DDR base physical address for the Mediatek ARMv8 memory map. This will be used by MT8196 in the future which has a different DDR base address than other Mediatek SoCs. Signed-off-by: David Lechner <[email protected]> Reviewed-by: Macpaul Lin <[email protected]>
2026-02-18arm: mediatek: consolidate ARMv8 memory mapsDavid Lechner
Consolidate all mem_map definitions for MediaTek ARMv8 platforms into a single file. The size of the DDR and MMIO regions can vary, so Kconfig options are added to configure them by target. Signed-off-by: David Lechner <[email protected]>
2026-02-18arm: mediatek: make mtk_pll_early_init() staticDavid Lechner
Make the mtk_pll_early_init() function static in several files. It is only used within those files, so there is no need to have it in the global namespace. Reviewed-by: Macpaul Lin <[email protected]>
2026-02-18arm: mediatek: mt8183: remove unused functionDavid Lechner
Remove the mtk_pll_early_init() function as it is not used anywhere. Signed-off-by: David Lechner <[email protected]> Reviewed-by: Macpaul Lin <[email protected]>
2026-02-18arm: mediatek: use default weak mtk_soc_early_init()David Lechner
Add a weak default implementation of mtk_soc_early_init() in spl.c to avoid having to define it in every SoC init.c file that does not need any additional early initialization. The init.h header file is no longer needed in this case and is removed. Signed-off-by: David Lechner <[email protected]>
2026-01-16configs: mt8365: remove empty header fileDavid Lechner
Remove the empty include/configs/mt8365.h header file as it is not needed. The Kconfig entry that referenced it is also removed. Signed-off-by: David Lechner <[email protected]>
2026-01-06arm: mediatek: add support for MediaTek MT8188 SoCJulien Masson
This adds basic support for MediaTek MT8188 SoC. Add watchdog support by adding upstream compatible string. Add tphy support by adding "mediatek,generic-tphy-v2" compatible string in arch/arm/dts/mt8188-u-boot.dtsi Signed-off-by: Julien Masson <[email protected]> Signed-off-by: Julien Stephan <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Reviewed-by: Macpaul Lin <[email protected]>
2025-06-25lmb: replace lmb_reserve() and lmb_alloc_addr() API'sSughosh Ganu
There currently are multiple allocation API's in the LMB module. There are a couple of API's for allocating memory(lmb_alloc() and lmb_alloc_base()), and then there are two for requesting a reservation for a particular memory region (lmb_reserve() and lmb_alloc_addr()). Introduce a single API lmb_alloc_mem() which will cater to all types of allocation requests and replace lmb_reserve() and lmb_alloc_addr() with the new API. Moreover, the lmb_reserve() API is pretty similar to the lmb_alloc_addr() API, with the one difference being that the lmb_reserve() API allows for reserving any address passed to it -- the address need not be part of the LMB memory map. The lmb_alloc_addr() does check that the address being requested is actually part of the LMB memory map. There is no need to support reserving memory regions which are outside the LMB memory map. Remove the lmb_reserve() API functionality and use the functionality provided by lmb_alloc_addr() instead. The lmb_alloc_addr() will check if the requested address is part of the LMB memory map and return an error if not. Signed-off-by: Sughosh Ganu <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2025-06-03linux/sizes.h: sync from kernelEmanuele Ghidoli
The kernel added new size definitions and substituted the boilerplate/reference to the license with a SPDX identifier. Drop a local SZ_8G definition in MediaTek MT7988 SoC board file. Signed-off-by: Emanuele Ghidoli <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Weijie Gao <[email protected]>
2025-02-21arm: mediatek: remove CONFIG_MT8512Weijie Gao
Defining CONFIG_MT8512 is unnecessary as now board for mediatek target can be changed in config. Use CONFIG_TARGET_MT8512 to replace CONFIG_MT8512. Signed-off-by: Weijie Gao <[email protected]>
2025-02-21arm: mediatek: build u-boot-mtk.bin only if neededWeijie Gao
Not all MediaTek platforms needs u-boot-mtk.bin. This patch will let u-boot generates u-boot-mtk.bin only if CONFIG_MTK_BROM_HEADER_INFO is not empty. Signed-off-by: Weijie Gao <[email protected]>
2025-01-30arm: mediatek: add support for MediaTek MT7987 SoCWeijie Gao
This patch adds basic support for MediaTek MT7987 SoC. This includes files that will initialize the SoC after boot and its device tree. In order to maximize the continuous usable memory space, MT7987 has its ATF BL31 loaded at the top of RAM. Since u-boot will also locate itself to top of RAM, u-boot will read the actual memory region of BL31 and set correct gd->ram_top to avoid u-boot overlapping with BL31. As now support for mt7987 hasn't been submitted to linux kernel, all dts filed will be put to arch/arm/dts. They'll be removed after successfully being merged by linux kernel, and OF_UPSTREAM will also be switched on. Signed-off-by: Weijie Gao <[email protected]>
2024-10-11arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILDSimon Glass
Use the new symbol to refer to any 'SPL' build, including TPL and VPL Signed-off-by: Simon Glass <[email protected]>
2024-07-01Merge branch 'next'Tom Rini
2024-06-27arm: mediatek: fix ram init for mt7622 (decrease to 1G)Frank Wunderlich
RAM init on mt7622 based bananapi R64 is broken since v2023.10. Increasing the mem-map does not help here, so i reduced the maximum available ram in get_ram_size call from 2G to 1G (board has only 1G). Fixes: 5fd6d4c7b3ad ("arm: mediatek: retrieve ram_base from dts node for armv8 platform") Signed-off-by: Frank Wunderlich <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-07mmc: Migrate MMC_SUPPORTS_TUNING to KconfigTom Rini
The constraints on the MMC_SUPPORTS_TUNING symbol can easily be expressed in Kconfig (with the addition of SPL_MMC_SUPPORTS_TUNING). Furthermore, in order to remove <common.h> from the MMC subsystem, the way this symbol is used today needs to be changed in order to continue functioning. Reviewed-by: Jaehoon Chung <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-06global: Make <asm/global_data.h> include <asm/u-boot.h>Tom Rini
This follows the example of RISC-V where <asm/global_data.h> includes <asm/u-boot.h> directly as "gd" includes a reference to bd_info already and so the first must include the second anyhow. We then remove <asm/u-boot.h> from all of the places which include references to "gd" an so have <asm/global_data.h> already. Signed-off-by: Tom Rini <[email protected]>
2024-05-06arm: mediatek: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from all mach-mediatek files and when needed add missing include files directly. Signed-off-by: Tom Rini <[email protected]>
2024-02-27Kconfig: Centralize prompting for SYS_CONFIG_NAMETom Rini
Generally speaking, we do not prompt for this value and define it in the board specific Kconfig file. There are some valid use cases however today where we do prompt for this value, so instead of having this be done in a number of locations, do this at the top-level location only. This removes the question from a number of other locations and makes it consistent that when we do set the value directly, we always do it the same way. We don't need to specify the type, it's always string. Signed-off-by: Tom Rini <[email protected]>
2023-12-19arm: mediatek: add support for MediaTek MT8365 SoCJulien Masson
This patch adds basic support for MediaTek MT8365 SoC. The dtsi has been copied from Linux source code tag v6.7-rc2. (commit 9b5d64654ea8f51fe1e8e29ca1777b620be8fb7c) Signed-off-by: Julien Masson <[email protected]>
2023-08-03arm: mediatek: add support for MediaTek MT7988 SoCWeijie Gao
This patch adds basic support for MediaTek MT7988 SoC. This includes files that will initialize the SoC after boot and its device tree. Signed-off-by: Weijie Gao <[email protected]>
2023-08-03arm: mediatek: retrieve ram_base from dts node for armv8 platformWeijie Gao
Now we use fdtdec_setup_mem_size_base() to get DRAM base from fdt ram node and update gd->ram_base. CFG_SYS_SDRAM_BASE is unused and will be removed. Also, since mt7622 always passes fdt to linux kernel, there's no need to assign value to gd->bd->bi_boot_params. Signed-off-by: Weijie Gao <[email protected]>
2023-03-22arm: Correct cpu_reset function prototype on some platformsTom Rini
Some platforms were not including <cpu_func.h> which sets the prototype for reset_cpu, and in turn had it set wrong. Correct these cases. Signed-off-by: Tom Rini <[email protected]>
2022-12-05global: Move remaining CONFIG_SYS_SDRAM_* to CFG_SYS_SDRAM_*Tom Rini
The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_SDRAM namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Simon Glass <[email protected]>