57 Commits

Author SHA1 Message Date
Weijie Gao
3c14cd8388 configs: mt7622: remove empty header file
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 <weijie.gao@mediatek.com>
Link: https://patch.msgid.link/20260428033625.109032-1-weijie.gao@mediatek.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-04-29 09:02:16 -05:00
David Lechner
c09e994585 config: mediatek: add UFS defconfigs for Genio 520/720 EVKs
Add variants of the Genio 520/720 EVK defconfigs for UFS boot. These
have a different devicetree when the boot DIP switches/jumpers on the
EVK are set for UFS instead of eMMC. These also enable UFS and related
drivers that aren't enabled in the eMMC defconfigs since UFS is
disconnected in that case.

Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>
Link: https://patch.msgid.link/20260330-mtk-genio-720-ufs-v1-6-3bad8362ed70@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-04-17 17:05:54 -05:00
David Lechner
58a60707ae arm: dts: mediatek: add UFS variant of Genio 520/720 EVK
Add a devicetree overlay and UFS variants of the Genio 520 and Genio 720
EVK devicetree targets. There are dip switches and jumpers on the EVK
that disconnect the eMMC and connect the UFS instead. The overlay
adjusts the devicetree for this.

Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>
Link: https://patch.msgid.link/20260330-mtk-genio-720-ufs-v1-5-3bad8362ed70@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-04-17 17:05:54 -05:00
Julien Stephan
a69b77da48 configs: add new defconfig for mt8395_genio_1200_evk_ufs
This new defconfig is based on mt8395_genio_1200_evk_defconfig, with
additional configs for UFS.  In order to avoid duplicating defconfig, we
introduce configs/mt8195.config.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260318-mt8195-add-ufs-support-v2-9-f18eeeeb0e72@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com> [moved PMIC enable to mt8195.config]
2026-04-17 17:05:54 -05:00
David Lechner
fbd4bd3a1e arm: dts: add U-Boot overrides for Genio 520 and 720 SD card
Add U-Boot-specific device tree overrides for the Genio 520 and 720 EVK
boards. These are needed to enable SD card support in U-Boot due to
current driver limitations. It is expected that these files will remain
after eventually converting these to CONFIG_OF_UPSTREAM, so we use
separate .u-boot.dtsi files for this.

Reviewed-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260316-mtk-ext-mmc-boot-v1-2-1aae51a44705@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-04-07 11:07:44 -05:00
Chris-QJ Chen
ed53a7b2a6 board: mediatek: Add Genio 520/720 EVK defconfigs
Add basic defconfigs for Genio 520 and 720 EVKs.

Signed-off-by: Chris-QJ Chen <chris-qj.chen@mediatek.com>
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Reviewed-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>
Link: https://patch.msgid.link/20260323-mtk-mt8391-initial-support-v3-6-19dd92f4543f@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-04-07 10:57:00 -05:00
Julien Stephan
6db02cfebf configs: mt8370/mt8390/mt8395 add myself as maintainer
Set myself as maintainer for the following genio boards:
- mt8370-genio-510-evk
- mt8393-genio-700-evk
- mt8395-genio-1200-evk

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260318-rename-genio-defconfigs-v2-6-1f77580d72f3@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-04-06 18:39:11 -05:00
Julien Stephan
f72ecf8edb configs: mt8370/mt8390: introduce mt8188.config to avoid duplication
mt8370_genio_510_evk_defconfig and mt8390_genio_700_evk_defconfig are
both based on MT8188, add a new mt8188.config file to share common
config.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260318-rename-genio-defconfigs-v2-5-1f77580d72f3@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-04-06 18:39:11 -05:00
Julien Stephan
a5d2dd7683 configs: mt8390_evk: rename to mt8390_genio_700_evk_defconfig
Rename mt8390_evk to match the name of the device tree which is
mt8390-genio-700-evk.dts

Also update CONFIG_IDENT_STRING to be consistent.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260318-rename-genio-defconfigs-v2-4-1f77580d72f3@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-04-06 18:39:11 -05:00
Julien Stephan
a1e72c381b configs: mt8370_evk: rename to mt8370_genio_510_evk_defconfig
Rename mt8370_evk to match the name of the device tree which is
mt8370-genio-510-evk.dts

Also update CONFIG_IDENT_STRING to be consistent.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260318-rename-genio-defconfigs-v2-3-1f77580d72f3@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-04-06 18:39:11 -05:00
Julien Stephan
5288f1f0bf configs: mt8395_evk: rename to mt8395_genio_1200_evk_defconfig
Rename mt8395_evk to match the name of the device tree which is
mt8395-genio-1200-evk.dts

Also update CONFIG_IDENT_STRING to be consistent.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260318-rename-genio-defconfigs-v2-2-1f77580d72f3@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-04-06 18:39:11 -05:00
Julien Stephan
b2a1db57eb board: mediatek: add MT8395 EVK board support
This adds support for the MT8395_EVK board with the following
features enabled/tested: Boot, UART, Watchdog and MMC.

MT8395_EVK is based on MT8195.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>
Link: https://patch.msgid.link/20260219-add-mt8395-evk-v2-2-18b190d91cb6@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-03-06 17:07:22 -06:00
Julien Stephan
b5db4f322a board: mediatek: add MT8370 EVK board support
This adds support for the MT8370 EVK board with the following
features enabled/tested: Boot, UART, Watchdog and MMC.

MT8370 is based on MT8188.

Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
2026-02-18 11:58:17 -06:00
Tom Rini
339a55865a Merge patch series "arm: mediatek: clean up some redundant board init"
David Lechner <dlechner@baylibre.com> says:

Before adding more targets, we take a moment to clean up some some
redundant code in existing Mediatek SoC support.

The first three patches are removing no-op functions. The last patch
generalizes the mem_map code so that it can be shared between all
Mediatek ARMv8 SoCs.

Link: https://lore.kernel.org/r/20260209-mtk-mach-clean-up-duplicates-v2-0-e3b22282c74d@baylibre.com
2026-02-18 11:57:24 -06:00
David Lechner
24ffbb2aa1 arm: mediatek: consolidate ARMv8 memory maps
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 <dlechner@baylibre.com>
2026-02-18 11:57:14 -06:00
David Lechner
8b62140738 board/mediatek: move EVK MAINTAINERS to common file
Move the mt8365_evk and mt8390_evk MAINTAINERS files to a common
MAINTAINERS file. We will be deleting the board-specific directories
soon but we need to keep the MAINTAINERS for the defconfig entries.

Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-02-18 11:57:14 -06:00
David Lechner
d8c550fb7a board: mediatek: mt8390_evk: remove empty board_init()
Remove empty board_init() function and adjust defconfig to not require
it.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>
2026-02-18 11:57:13 -06:00
Peng Fan
87b9ccf6e4 mediatek: mt7622: Drop useless board files
No functions except reserving gd in the board files. The files are
useless, remove them.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-02-17 13:50:22 -06:00
Julien Masson
ede7198a37 board: mediatek: add MT8390 EVK board support
This adds support for the MT8390 EVK board with the following
features enabled/tested: Boot, UART, Watchdog and MMC.

MT8390 is based on MT8188.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2026-02-03 18:13:54 -06:00
David Lechner
fd104bea0c arm: dts: mediatek: switch mt8365 to OF_UPSTREAM
Change mt8365_evk_defconfig to use CONFIG_OF_UPSTREAM=y and delete the
U-Boot copy of the devicetree source files for mt8365.

The upstream devicetree is identical to the U-Boot one being removed
(other than having more nodes for devices not used by U-Boot and
upstream fixed a compatible string in &scpsys, also not affecting
U-Boot).

There was one minor glitch with upstream missing a few topckgen macro
definitions, so those are added to the clock driver directly as a
workaround.

Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
2025-12-31 11:50:56 -06:00
Sam Protsenko
70a4d1fa1d treewide: Remove empty board_init() function from all boards
Commit 86acdce2ba88 ("common: add config for board_init() call")
introduced CONFIG_BOARD_INIT option. This option can be disabled for the
boards where board_init() function is not needed. Remove empty
board_init() calls for all boards where it's possible, and disable
CONFIG_BOARD_INIT in all related defconfigs.

This cleanup was made semi-automatically using these scripts: [1].

No functional change, but the binary size for the modified boards is
reduced a bit.

[1] https://github.com/joe-skb7/uboot-convert-scripts/tree/master/remove-board-init

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Tested-by: Adam Ford <aford173@gmail.com> #imx8mm_beacon
Tested-by: Bryan Brattlof <bb@ti.com>
Acked-by: Peng Fan <peng.fan@nxp.com>  #NXP boards
2025-07-24 13:30:19 -06:00
Weijie Gao
c80a3fb961 board: mediatek: add MT7987 reference boards
This patch adds general board files based on MT7987 SoC.

MT7987 uses one mmc controller for booting from both SD and eMMC, and the
pins of mmc controller are also shared with one spi controller.
So three configs are need for these boot types:

1. mt7987_rfb_defconfig - SPI-NOR (spi2) and SPI-NAND (spi0)
2. mt7987_emmc_rfb_defconfig - eMMC + SPI-NOR (spi2)
3. mt7987_sd_rfb_defconfig - SD + SPI-NOR (spi2)

Note: spi2 also supports booting from SPI-NAND, but not the default option.

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2025-01-30 14:35:14 -06:00
Weijie Gao
92090b92fa board: mediatek: mt7622: remove board_late_init
The function board_late_init defined for mt7622 is useless now. Just
remove it.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2025-01-23 12:11:49 -06:00
Tom Rini
03de305ec4 Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"
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 <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-20 13:35:03 -06:00
Tom Rini
d678a59d2d Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
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 <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19 08:16:36 -06:00
Tom Rini
1e9179fd7b board: mediatek: Remove <common.h> and add needed includes
Remove <common.h> from this board vendor directory and when needed
add missing include files directly.

Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-07 08:00:25 -06:00
Julien Masson
1c2c0c6359 board: mediatek: add MT8365 EVK board support
This adds support for the MT8365 EVK board with the following
features enabled/tested: Boot, UART, Watchdog and MMC.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
2023-12-19 10:09:06 -05:00
Tom Rini
db7516b635 board: Remove essentially empty board files and Makefiles
As part of reviewing a new platform, Daniel Schwierzeck noted that we
can have an empty Makefile in the board directory and don't need an
empty board.c file as well.  Further with further cleanup in the
Makefile we can now omit the Makefile entirely. Remove a number of now
unnecessary board.c and Makefiles.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-09 15:24:31 -04:00
Simon Glass
1e94b46f73 common: Drop linux/printk.h from common header
This old patch was marked as deferred. Bring it back to life, to continue
towards the removal of common.h

Move this out of the common header and include it only where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-09-24 09:54:57 -04:00
Weijie Gao
bc4adc97cf board: mediatek: add MT7988 reference boards
This patch adds general board files based on MT7988 SoCs.

MT7988 uses one mmc controller for booting from both SD and eMMC,
and the pins of mmc controller booting from SD are also shared with
one of spi controllers.
So two configs are need for these boot types:

1. mt7988_rfb_defconfig - SPI-NOR, SPI-NAND and eMMC
2. mt7988_sd_rfb_defconfig - SPI-NAND and SD

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03 09:40:50 -04:00
Weijie Gao
5fd6d4c7b3 arm: mediatek: retrieve ram_base from dts node for armv8 platform
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 <weijie.gao@mediatek.com>
2023-08-03 09:40:48 -04:00
Tom Rini
aa6e94deab global: Move remaining CONFIG_SYS_SDRAM_* to CFG_SYS_SDRAM_*
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 <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-05 16:06:07 -05:00
Weijie Gao
e053ccf6ef board: mediatek: add MT7981 reference boards
This patch adds general board files based on MT7981 SoCs.

MT7981 uses one mmc controller for booting from both SD and eMMC, and the
pins of mmc controller are also shared with spi controller.
So three configs are need for these boot types:

1. mt7981_rfb_defconfig - SPI-NOR and SPI-NAND
2. mt7981_emmc_rfb_defconfig - eMMC only
3. mt7981_sd_rfb_defconfig - SD only

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2022-09-23 15:09:15 -04:00
Weijie Gao
389ba6986b board: mediatek: add MT7986 reference boards
Add general board files based on MT7986 SoCs.

MT7986 uses one mmc controller for booting from both SD and eMMC.
Both MT7986A and MT7986B use the same pins for spi controller.

Configs for various boot types:
1. mt7986_rfb_defconfig - SPI-NOR and SPI-NAND for MT7986A/B
2. mt7986a_bpir3_emmc_defconfig - eMMC for MT7986A only
3. mt7986a_bpir3_sd_defconfig - SD for MT7986A only

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2022-09-23 15:09:15 -04:00
Weijie Gao
0eaee027f7 mips: mtmips: add two reference boards for mt7621
The mt7621_rfb board supports integrated giga PHYs plus one external
giga PHYs. It also has up to 512MiB DDR3, 16MB SPI-NOR, 3 mini PCI-e x1
slots, SDXC and USB.

The mt7621_nand_rfb board is almost the same as mt7621_rfb board, but it
uses NAND flash and SDXC is not available.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2022-07-13 23:03:37 +02:00
Wolfgang Denk
66356b4c06 WS cleanup: remove trailing empty lines
Signed-off-by: Wolfgang Denk <wd@denx.de>
2021-09-30 08:08:56 -04:00
Guillaume La Roque
df3ab898f6 arm: mediatek: merge board Kconfigs into mach-mediatek
On MediaTek boards we cannot override the SYS_BOARD / SYS_CONFIG_NAME
variables from defconfig.
This is because in board/mediatek/mtXXXX/Kconfig this value was override
by default due to the if CONFIG_TARGET_MTXXXX condition.

Merge all the Kconfigs to the mach-medatek/Kconfig.

This way:
- we only define SYS_{SOC,VENDOR} once
- all board definitions are in a single place, simplifying the build logic.

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
2021-09-23 14:15:32 -04:00
Fabien Parent
e96bedf146 board: Add MT8183 pumpkin board support
Add the MT8183 pumpkin board support.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
2021-03-20 16:24:27 -04:00
Fabien Parent
4e828d9c75 board: mediatek: mt8516: init USB Ether for pumpkin board
Init USB Ether if CONFIG_USB_ETHER is enabled.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
2021-03-20 16:24:27 -04:00
Fabien Parent
86e07d59ee board: mediatek: rename pumpkin board into mt8516
More than one pumpkin board has been made with different MediaTek SoCs.
Rename the pumpkin board to follow the naming convention of all
other MediaTek boards and also to not be confusing when other pumpkin
boards will be added in follow-up commits.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
2021-03-20 16:24:26 -04:00
Simon Glass
401d1c4f5d common: Drop asm/global_data.h from common header
Move this out of the common header and include it only where needed.  In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly.   Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2021-02-02 15:33:42 -05:00
Weijie Gao
76880b08c4 mips: mtmips: add two reference boards for mt7620
The mt7620_rfb board supports integrated 10/100M PHYs plus two external
giga PHYs. It also has 8MB SPI-NOR, mini PCI-e x1 slot, SDHC and USB.

The mt7620_mt7530_rfb boards supports an external MT7530 giga switch and a
16MB SPI-NOR flash.

Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2021-01-24 21:39:26 +01:00
Fabien Parent
c2984eb38e board: mediatek: pumpkin: initialize usb device
Initialize USB device on pumpkin if it is enabled in the config.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
2021-01-18 14:59:19 -05:00
David Woodhouse
3fad1ca28d board: mediatek: Add support for UniElec U7623 board
This is an MT7623A-based board, very similar to the Banana Pi R2.

http://www.unielecinc.com/q/news/cn/p/product/detail.html?qd_guid=OjXwKCaRlN

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2020-07-29 08:43:40 -04:00
David Woodhouse
e3cc511eef board: mediatek: fix mmc_get_boot_dev() for platforms without external SD
On the UniElec U7623 board there is no external SD slot and the preloader
doesn't fill in the magic field at 0x81dffff0 to indicate that it was
booted from eMMC.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2020-07-29 08:43:40 -04:00
Simon Glass
f7ae49fc4f common: Drop log.h from common header
Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18 21:19:18 -04:00
Simon Glass
0914011310 command: Remove the cmd_tbl_t typedef
We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.

Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.

This requires quite a few header-file additions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18 18:36:55 -04:00
Simon Glass
691d719db7 common: Drop init.h from common header
Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18 17:33:33 -04:00
Weijie Gao
6bd888b63b mips: mtmips: add support for mt7628-rfb
This patch adds support for mt7628 reference board. SPL_DM and DT are not
enabled for SPL to save about 17KiB for u-boot-spl.bin.

Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2020-04-27 20:30:13 +02:00
mingming lee
e65016150e ARM: Mediatek: Add board_late_init to init usb gadget driver
Add board_late_init function to init usb gadget driver for mt8518

Signed-off-by: mingming lee <mingming.lee@mediatek.com>
2020-01-25 12:04:36 -05:00