[PATCH v2 00/18] Add U-Boot support for MediaTek SoCs - MT7623n & MT7629
This is the new round to add U-Boot support for MediaTek SoCs - MT7623n & MT7629,
and the most of the drivers are based on mainline Linux, such as clock, timer, mmc,
pinctrl, watchdog, power domain and device tree.
The following are the major differences between mainline Linux and U-Boot:
- Modify the drivers to adapt the U-Boot DM framework.
- Remove unneeded DT nodes as they don't have proper drivers in U-Boot yet.
- Just add the basic functions (step-by-step) so that we can monitor the size.
- Reuse UART driver ns16550.c but add a highspeed register for MediaTek chips.
- Add a whole new MT7629 SNOR driver which is based on SPI framework.
Our current progress:
The MT7623n (BananaPi R2) which has already been supported in mainline Linux.
- Boot from eMMC or SD card.
- Boot flow: ROM -> MediaTek's preloder -> U-Boot ...
- An open development board called BananaPi R2 .
The MT7629 is NOT supported yet in mainline Linux, but I will add it soon.
- Boot from SNOR currently.
- Boot flow: ROM -> (boot header parsing sequence) -> SPL -> U-Boot ...
Current implementation was validated via the FIT image.
Changes since v2:
- Squash defconfig parts into other patches.
- Drop unneeded definitions in include/configs/*.
- Add a MT7629 qspi driver in the series.
Changes since v1:
- Fix new blank line at EOF and indentation.
- Revise commit message.
- Add missing sgmiisys device nodes.
- Add Tested-by tags from Matthias.
- Drop MT7629 qspi driver in the series, and we will implement another one
based on the spi-mem framework.
Guochun Mao (1):
spi: mtk_qspi: add qspi driver for MT7629 SoC
Ryder Lee (15):
tools: MediaTek: add MTK boot header generation to mkimage
arm: dts: MediaTek: add device tree for MT7629
arm: dts: MediaTek: add device tree for MT7623
arm: MediaTek: add basic support for MT7629 boards
clk: MediaTek: add clock driver for MT7629 SoC.
clk: MediaTek: add clock driver for MT7623 SoC.
timer: MediaTek: add timer driver for MediaTek SoCs
watchdog: MediaTek: add watchdog driver for MediaTek SoCs
pinctrl: MediaTek: add pinctrl driver for MT7629 SoC
pinctrl: MediaTek: add pinctrl driver for MT7623 SoC
power domain: MediaTek: add power domain driver for MT7629 SoC
power domain: MediaTek: add power domain driver for MT7623 SoC
serial: 16550: allow the driver to support MediaTek serial
ram: MediaTek: add DDR3 driver for MT7629 SoC
MAINTAINERS: add an entry for MediaTek
Weijie Gao (2):
arm: MediaTek: add basic support for MT7623 boards
mmc: mtk-sd: add SD/MMC host controller driver for MT7623 SoC
+# MediaTek's ARM-based u-boot needs a header to contains its load address
+# which is parsed by the BootROM.
+# If the SPL build is enabled, the header will be added to the spl binary,
+# and the spl binary and the u-boot.img will be combined into one file.
+# Otherwise the header will be added to the u-boot.bin directly.
+OBJCOPYFLAGS_u-boot-mtk.bin = -I binary -O binary \
+u-boot-mtk.bin: spl/u-boot-spl-mtk.bin u-boot.img FORCE
+ $(call if_changed,pad_cat)
+MKIMAGEFLAGS_u-boot-mtk.bin = -T mtkimage \
+ -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) \
+ -n "$(patsubst "%",%,$(CONFIG_MTK_BROM_HEADER_INFO))"
+u-boot-mtk.bin: u-boot.bin FORCE
+ $(call if_changed,mkimage)
ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(ARCH)/Makefile.postlink)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ccf2a84..eac03f0 100644
@@ -668,6 +668,18 @@ config ARCH_MESON
targeted at media players and tablet computers. We currently
support the S905 (GXBaby) 64-bit SoC.
+ bool "MediaTek SoCs"
+ select DM
+ select OF_CONTROL
+ select SPL_DM if SPL
+ select SPL_LIBCOMMON_SUPPORT if SPL
+ select SPL_LIBGENERIC_SUPPORT if SPL
+ select SPL_OF_CONTROL if SPL
+ select SUPPORT_SPL
+ Support for the MediaTek SoCs family.
bool "NXP i.MX8M platform"
@@ -1423,6 +1435,8 @@ source "arch/arm/mach-rmobile/Kconfig"
diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig
index a7d600b..6013945 100644
@@ -147,4 +147,11 @@ config MPC83XX_TIMER
Select this to enable support for the timer found on
devices based on the MPC83xx family of SoCs.
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index d545b3e..57a12f5 100644
@@ -103,6 +103,14 @@ config WDT_CDNS
Select this to enable Cadence watchdog timer, which can be found on some
Xilinx Microzed Platform.
This patch adds pinctrl support for MT7629 SoC. The IO core found on
the SoC has the registers for pinctrl, pinconf and gpio mixed up in
the same register range. Hence the driver also implements the gpio
functionality through UCLASS_GPIO.
This also creates a common file as there might be other chips that use
the same binding and driver, then being a little more abstract could
help in the long run.
This adds a power domain driver for the Mediatek SCPSYS unit.
The System Control Processor System (SCPSYS) has several power
management related tasks in the system. The tasks include thermal
measurement, dynamic voltage frequency scaling (DVFS), interrupt
filter and lowlevel sleep control. The System Power Manager (SPM)
inside the SCPSYS is for the MTCMOS power domain control.
For now this driver only adds power domain support.
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 0a0d4aa..ca13341 100644
@@ -598,6 +598,15 @@ config FTSDC010_SDIO
This can enable ftsdc010 sdio function.
+ bool "MediaTek SD/MMC Card Interface support"
+ default n
+ 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 or M here.
+ This is needed if support for any SD/SDIO/MMC devices is required.
+ If unsure, say N.