Add U-Boot support for MediaTek SoCs - MT7623n & MT7629
Subsystems (11)
v5 cover Add U-Boot support for MediaTek SoCs - MT7623n & MT7629
Hello,
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, UART, watchdog, power domain and device tree.
Ryder
Ryder Lee (16):
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: MediaTek: add high-speed uart driver for MediaTek SoCs
ram: MediaTek: add DDR3 driver for MT7629 SoC
doc: README.mediatek: Add a simple README for MediaTek
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
MAINTAINERS | 20 + Makefile | 20 + arch/arm/Kconfig | 16 + arch/arm/Makefile | 1 + arch/arm/dts/Makefile | 4 + arch/arm/dts/mt7623.dtsi | 255 +++++ arch/arm/dts/mt7623n-bananapi-bpi-r2.dts | 207 ++++ arch/arm/dts/mt7629-rfb-u-boot.dtsi | 24 + arch/arm/dts/mt7629-rfb.dts | 70 ++ arch/arm/dts/mt7629.dtsi | 244 +++++ arch/arm/include/asm/arch-mediatek/gpio.h | 9 + arch/arm/include/asm/arch-mediatek/misc.h | 17 + arch/arm/mach-mediatek/Kconfig | 39 + arch/arm/mach-mediatek/Makefile | 7 + arch/arm/mach-mediatek/cpu.c | 34 + arch/arm/mach-mediatek/init.h | 11 + arch/arm/mach-mediatek/mt7623/Makefile | 4 + arch/arm/mach-mediatek/mt7623/init.c | 54 + arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 + arch/arm/mach-mediatek/mt7623/preloader.h | 99 ++ arch/arm/mach-mediatek/mt7629/Makefile | 4 + arch/arm/mach-mediatek/mt7629/init.c | 128 +++ arch/arm/mach-mediatek/mt7629/lowlevel_init.S | 50 + arch/arm/mach-mediatek/spl.c | 43 + board/mediatek/mt7623/Kconfig | 13 + board/mediatek/mt7623/MAINTAINERS | 7 + board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 + board/mediatek/mt7629/Kconfig | 17 + board/mediatek/mt7629/MAINTAINERS | 7 + board/mediatek/mt7629/Makefile | 3 + board/mediatek/mt7629/mt7629_rfb.c | 16 + common/image.c | 1 + configs/mt7623n_bpir2_defconfig | 54 + configs/mt7629_rfb_defconfig | 73 ++ doc/README.mediatek | 221 ++++ drivers/clk/Makefile | 1 + drivers/clk/mediatek/Makefile | 7 + drivers/clk/mediatek/clk-mt7623.c | 870 +++++++++++++++ drivers/clk/mediatek/clk-mt7629.c | 709 +++++++++++++ drivers/clk/mediatek/clk-mtk.c | 493 +++++++++ drivers/clk/mediatek/clk-mtk.h | 194 ++++ drivers/mmc/Kconfig | 11 + drivers/mmc/Makefile | 1 + drivers/mmc/mtk-sd.c | 1394 +++++++++++++++++++++++++ drivers/pinctrl/Kconfig | 1 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/mediatek/Kconfig | 15 + drivers/pinctrl/mediatek/Makefile | 7 + drivers/pinctrl/mediatek/pinctrl-mt7623.c | 1284 +++++++++++++++++++++++ drivers/pinctrl/mediatek/pinctrl-mt7629.c | 409 ++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 553 ++++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 184 ++++ drivers/power/domain/Kconfig | 7 + drivers/power/domain/Makefile | 1 + drivers/power/domain/mtk-power-domain.c | 406 +++++++ drivers/ram/Makefile | 1 + drivers/ram/mediatek/Makefile | 7 + drivers/ram/mediatek/ddr3-mt7629.c | 766 ++++++++++++++ drivers/serial/Kconfig | 20 + drivers/serial/Makefile | 1 + drivers/serial/serial_mtk.c | 268 +++++ drivers/timer/Kconfig | 7 + drivers/timer/Makefile | 1 + drivers/timer/mtk_timer.c | 85 ++ drivers/watchdog/Kconfig | 8 + drivers/watchdog/Makefile | 1 + drivers/watchdog/mtk_wdt.c | 135 +++ include/configs/mt7623.h | 56 + include/configs/mt7629.h | 57 + include/dt-bindings/clock/mt7623-clk.h | 413 ++++++++ include/dt-bindings/clock/mt7629-clk.h | 206 ++++ include/dt-bindings/power/mt7623-power.h | 19 + include/dt-bindings/power/mt7629-power.h | 13 + include/image.h | 1 + scripts/Makefile.spl | 11 + tools/Makefile | 1 + tools/mtk_image.c | 749 +++++++++++++ tools/mtk_image.h | 199 ++++ 79 files changed, 11386 insertions(+) create mode 100644 arch/arm/dts/mt7623.dtsi create mode 100644 arch/arm/dts/mt7623n-bananapi-bpi-r2.dts create mode 100644 arch/arm/dts/mt7629-rfb-u-boot.dtsi create mode 100644 arch/arm/dts/mt7629-rfb.dts create mode 100644 arch/arm/dts/mt7629.dtsi create mode 100644 arch/arm/include/asm/arch-mediatek/gpio.h create mode 100644 arch/arm/include/asm/arch-mediatek/misc.h create mode 100644 arch/arm/mach-mediatek/Kconfig create mode 100644 arch/arm/mach-mediatek/Makefile create mode 100644 arch/arm/mach-mediatek/cpu.c create mode 100644 arch/arm/mach-mediatek/init.h create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.c create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 arch/arm/mach-mediatek/mt7629/Makefile create mode 100644 arch/arm/mach-mediatek/mt7629/init.c create mode 100644 arch/arm/mach-mediatek/mt7629/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/spl.c create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 board/mediatek/mt7629/Kconfig create mode 100644 board/mediatek/mt7629/MAINTAINERS create mode 100644 board/mediatek/mt7629/Makefile create mode 100644 board/mediatek/mt7629/mt7629_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 configs/mt7629_rfb_defconfig create mode 100644 doc/README.mediatek create mode 100644 drivers/clk/mediatek/Makefile create mode 100644 drivers/clk/mediatek/clk-mt7623.c create mode 100644 drivers/clk/mediatek/clk-mt7629.c create mode 100644 drivers/clk/mediatek/clk-mtk.c create mode 100644 drivers/clk/mediatek/clk-mtk.h create mode 100644 drivers/mmc/mtk-sd.c create mode 100644 drivers/pinctrl/mediatek/Kconfig create mode 100644 drivers/pinctrl/mediatek/Makefile create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7623.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7629.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.h create mode 100644 drivers/power/domain/mtk-power-domain.c create mode 100644 drivers/ram/mediatek/Makefile create mode 100644 drivers/ram/mediatek/ddr3-mt7629.c create mode 100644 drivers/serial/serial_mtk.c create mode 100644 drivers/timer/mtk_timer.c create mode 100644 drivers/watchdog/mtk_wdt.c create mode 100644 include/configs/mt7623.h create mode 100644 include/configs/mt7629.h create mode 100644 include/dt-bindings/clock/mt7623-clk.h create mode 100644 include/dt-bindings/clock/mt7629-clk.h create mode 100644 include/dt-bindings/power/mt7623-power.h create mode 100644 include/dt-bindings/power/mt7629-power.h create mode 100644 tools/mtk_image.c create mode 100644 tools/mtk_image.h
Signature · 1 line
1.9.1
PATCH v5 1/18 tools: MediaTek: add MTK boot header generation to mkimage
This patch adds support for MTK boot image generation.
---
Changes since v5: Fix typo
Changes since v4: None
--- Makefile | 20 ++ common/image.c | 1 + include/image.h | 1 + scripts/Makefile.spl | 11 + tools/Makefile | 1 + tools/mtk_image.c | 749 +++++++++++++++++++++++++++++++++++++++++++++++++++ tools/mtk_image.h | 199 ++++++++++++++ 7 files changed, 982 insertions(+) create mode 100644 tools/mtk_image.c create mode 100644 tools/mtk_image.h
Makefile +20 -0
@@ -852,6 +852,8 @@ ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin endif +ALL-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin + # Add optional build target if defined in board/cpu/soc headers ifneq ($(CONFIG_BUILD_TARGET),) ALL-y += $(CONFIG_BUILD_TARGET:"%"=%)
@@ -1359,6 +1361,24 @@ u-boot.elf: u-boot.bin $(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o $(call if_changed,u-boot-elf) +# 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. + +ifeq ($(CONFIG_SPL),y) +u-boot-mtk.bin: u-boot.dtb u-boot.img spl/u-boot-spl-mtk.bin FORCE + $(call if_changed,binman) +else +MKIMAGEFLAGS_u-boot-mtk.bin = -T mtk_image \ + -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) +endif + ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(ARCH)/Makefile.postlink) # Rule to link u-boot
common/image.c +1 -0
@@ -166,6 +166,7 @@ static const table_entry_t uimage_type[] = { { IH_TYPE_FIRMWARE_IVT, "firmware_ivt", "Firmware with HABv4 IVT" }, { IH_TYPE_PMMC, "pmmc", "TI Power Management Micro-Controller Firmware",}, { IH_TYPE_STM32IMAGE, "stm32image", "STMicroelectronics STM32 Image" }, + { IH_TYPE_MTKIMAGE, "mtk_image", "MediaTek BootROM loadable Image" }, { -1, "", "", }, };
include/image.h +1 -0
@@ -278,6 +278,7 @@ enum {IH_TYPE_PMMC ,/* TI Power Management Micro-Controller Firmware */ IH_TYPE_STM32IMAGE ,/* STMicroelectronics STM32 Image */ IH_TYPE_SOCFPGAIMAGE_V1 ,/* Altera SOCFPGA A10 Preloader */ +IH_TYPE_MTKIMAGE ,/* MediaTek BootROM loadable Image */ IH_TYPE_COUNT, /* Number of image types */ };
scripts/Makefile.spl +11 -0
@@ -219,6 +219,8 @@ ALL-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-16bit-spl.bin ALL-$(CONFIG_ARCH_ZYNQ) += $(obj)/boot.bin ALL-$(CONFIG_ARCH_ZYNQMP) += $(obj)/boot.bin +ALL-$(CONFIG_ARCH_MEDIATEK) += $(obj)/u-boot-spl-mtk.bin + all: $(ALL-y) quiet_cmd_cat = CAT $@
@@ -349,6 +351,15 @@ cmd_sunxi_spl_image_builder = $(objtree)/tools/sunxi-spl-image-builder \ $(obj)/sunxi-spl-with-ecc.bin: $(obj)/sunxi-spl.bin $(call if_changed,sunxi_spl_image_builder) + +# MediaTek's specific SPL build +MKIMAGEFLAGS_u-boot-spl-mtk.bin = -T mtk_image \ + -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) \ + -n "$(patsubst "%",%,$(CONFIG_MTK_BROM_HEADER_INFO))" + +$(obj)/u-boot-spl-mtk.bin: $(obj)/u-boot-spl.bin FORCE + $(call if_changed,mkimage) + # Rule to link u-boot-spl # May be overridden by arch/$(ARCH)/config.mk quiet_cmd_u-boot-spl ?= LD $@
tools/Makefile +1 -0
@@ -116,6 +116,7 @@ dumpimage-mkimage-objs := aisimage.o \ $(LIBFDT_OBJS) \ gpimage.o \ gpimage-common.o \ + mtk_image.o \ $(RSA_OBJS-y) dumpimage-objs := $(dumpimage-mkimage-objs) dumpimage.o
tools/mtk_image.c new file +749 -0
749 lines not on this page · raw message
tools/mtk_image.h new file +199 -0
199 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 2/18 arm: dts: MediaTek: add device tree for MT7629
In reply to Ryder LeeThis patch adds MT7629 device tree and the includes it needs.
---
Changes since v5: Use new compatible 'mediatek,hsuart' for MTK UART Changes since v4: None
--- arch/arm/dts/Makefile | 3 + arch/arm/dts/mt7629-rfb-u-boot.dtsi | 24 +++ arch/arm/dts/mt7629-rfb.dts | 70 +++++++++ arch/arm/dts/mt7629.dtsi | 244 +++++++++++++++++++++++++++++++ include/dt-bindings/clock/mt7629-clk.h | 206 ++++++++++++++++++++++++++ include/dt-bindings/power/mt7629-power.h | 13 ++ 6 files changed, 560 insertions(+) create mode 100644 arch/arm/dts/mt7629-rfb-u-boot.dtsi create mode 100644 arch/arm/dts/mt7629-rfb.dts create mode 100644 arch/arm/dts/mt7629.dtsi create mode 100644 include/dt-bindings/clock/mt7629-clk.h create mode 100644 include/dt-bindings/power/mt7629-power.h
arch/arm/dts/Makefile +3 -0
@@ -558,6 +558,9 @@ dtb-$(CONFIG_TARGET_STM32MP1) += \ dtb-$(CONFIG_SOC_K3_AM6) += k3-am654-base-board.dtb +dtb-$(CONFIG_ARCH_MEDIATEK) += \ + mt7629-rfb.dtb + targets += $(dtb-y) # Add any required device tree compiler flags here
arch/arm/dts/mt7629-rfb-u-boot.dtsi new file +24 -0
@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 MediaTek Inc. + * + * Author: Weijie Gao <[email protected]> + */ + +#include <config.h> +/ { + binman { + filename = "u-boot-mtk.bin"; + pad-byte = <0xff>; + +#ifdef CONFIG_SPL + blob { + filename = "spl/u-boot-spl-mtk.bin"; + size = <CONFIG_SPL_PAD_TO>; + }; + + u-boot-img { + }; +#endif + }; +};
arch/arm/dts/mt7629-rfb.dts new file +70 -0
70 lines not on this page · raw message
arch/arm/dts/mt7629.dtsi new file +244 -0
244 lines not on this page · raw message
include/dt-bindings/clock/mt7629-clk.h new file +206 -0
206 lines not on this page · raw message
include/dt-bindings/power/mt7629-power.h new file +13 -0
@@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2018 MediaTek Inc. +*/ + +#ifndef _DT_BINDINGS_MT7629_POWER_H +#define _DT_BINDINGS_MT7629_POWER_H + +#define MT7629_POWER_DOMAIN_ETHSYS 0 +#define MT7629_POWER_DOMAIN_HIF0 1 +#define MT7629_POWER_DOMAIN_HIF1 2 + +#endif /* _DT_BINDINGS_MT7629_POWER_H */
Signature · 1 line
1.9.1
PATCH v5 3/18 arm: dts: MediaTek: add device tree for MT7623
In reply to Ryder LeeThis adds device tree for MT7623 development board - Bananapi R2 Detailed hardware information for BPI-R2 which could be found on
http://wiki.banana-pi.org/Banana_Pi_BPI-R2.
---
Changes since v5: Use new compatible 'mediatek,hsuart' for MTK UART Changes since v4: None
--- arch/arm/dts/Makefile | 1 + arch/arm/dts/mt7623.dtsi | 255 +++++++++++++++++++ arch/arm/dts/mt7623n-bananapi-bpi-r2.dts | 207 ++++++++++++++++ include/dt-bindings/clock/mt7623-clk.h | 413 +++++++++++++++++++++++++++++++ include/dt-bindings/power/mt7623-power.h | 19 ++ 5 files changed, 895 insertions(+) create mode 100644 arch/arm/dts/mt7623.dtsi create mode 100644 arch/arm/dts/mt7623n-bananapi-bpi-r2.dts create mode 100644 include/dt-bindings/clock/mt7623-clk.h create mode 100644 include/dt-bindings/power/mt7623-power.h
arch/arm/dts/Makefile +1 -0
@@ -559,6 +559,7 @@ dtb-$(CONFIG_TARGET_STM32MP1) += \ dtb-$(CONFIG_SOC_K3_AM6) += k3-am654-base-board.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += \ + mt7623n-bananapi-bpi-r2.dtb \ mt7629-rfb.dtb targets += $(dtb-y)
arch/arm/dts/mt7623.dtsi new file +255 -0
255 lines not on this page · raw message
arch/arm/dts/mt7623n-bananapi-bpi-r2.dts new file +207 -0
207 lines not on this page · raw message
include/dt-bindings/clock/mt7623-clk.h new file +413 -0
413 lines not on this page · raw message
include/dt-bindings/power/mt7623-power.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2018 MediaTek Inc. +*/ + +#ifndef _DT_BINDINGS_MT7623_POWER_H +#define _DT_BINDINGS_MT7623_POWER_H + +#define MT7623_POWER_DOMAIN_CONN 0 +#define MT7623_POWER_DOMAIN_DISP 1 +#define MT7623_POWER_DOMAIN_MFG 2 +#define MT7623_POWER_DOMAIN_VDEC 3 +#define MT7623_POWER_DOMAIN_ISP 4 +#define MT7623_POWER_DOMAIN_BDP 5 +#define MT7623_POWER_DOMAIN_ETH 6 +#define MT7623_POWER_DOMAIN_HIF 7 +#define MT7623_POWER_DOMAIN_IFR_MSC 8 + +#endif /* _DT_BINDINGS_MT7623_POWER_H */
Signature · 1 line
1.9.1
PATCH v5 4/18 arm: MediaTek: add basic support for MT7629 boards
In reply to Ryder LeeThis adds a general board file based on MT7629 SoCs from MediaTek.
Apart from the generic parts (cpu) we add some low level init codes and initialize the early clocks.
---
Changes since v5: None
Changes since v4:
-Add gd->bd->bi_boot_params for legacy method - ATAGs.
--- arch/arm/Kconfig | 16 ++++ arch/arm/Makefile | 1 + arch/arm/include/asm/arch-mediatek/misc.h | 17 ++++ arch/arm/mach-mediatek/Kconfig | 26 ++++++ arch/arm/mach-mediatek/Makefile | 6 ++ arch/arm/mach-mediatek/cpu.c | 34 +++++++ arch/arm/mach-mediatek/init.h | 11 +++ arch/arm/mach-mediatek/mt7629/Makefile | 4 + arch/arm/mach-mediatek/mt7629/init.c | 128 ++++++++++++++++++++++++++ arch/arm/mach-mediatek/mt7629/lowlevel_init.S | 50 ++++++++++ arch/arm/mach-mediatek/spl.c | 43 +++++++++ board/mediatek/mt7629/Kconfig | 17 ++++ board/mediatek/mt7629/MAINTAINERS | 7 ++ board/mediatek/mt7629/Makefile | 3 + board/mediatek/mt7629/mt7629_rfb.c | 16 ++++ configs/mt7629_rfb_defconfig | 73 +++++++++++++++ include/configs/mt7629.h | 57 ++++++++++++ 17 files changed, 509 insertions(+) create mode 100644 arch/arm/include/asm/arch-mediatek/misc.h create mode 100644 arch/arm/mach-mediatek/Kconfig create mode 100644 arch/arm/mach-mediatek/Makefile create mode 100644 arch/arm/mach-mediatek/cpu.c create mode 100644 arch/arm/mach-mediatek/init.h create mode 100644 arch/arm/mach-mediatek/mt7629/Makefile create mode 100644 arch/arm/mach-mediatek/mt7629/init.c create mode 100644 arch/arm/mach-mediatek/mt7629/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/spl.c create mode 100644 board/mediatek/mt7629/Kconfig create mode 100644 board/mediatek/mt7629/MAINTAINERS create mode 100644 board/mediatek/mt7629/Makefile create mode 100644 board/mediatek/mt7629/mt7629_rfb.c create mode 100644 configs/mt7629_rfb_defconfig create mode 100644 include/configs/mt7629.h
arch/arm/Kconfig +16 -0
@@ -658,6 +658,20 @@ config ARCH_MESON targeted at media players and tablet computers. We currently support the S905 (GXBaby) 64-bit SoC. +config ARCH_MEDIATEK + bool "MediaTek SoCs" + select BINMAN + 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 + help + Support for the MediaTek SoCs family developed by MediaTek Inc. + Please refer to doc/README.mediatek for more information. + config ARCH_LPC32XX bool "NXP LPC32xx platform" select CPU_ARM926EJS
@@ -1442,6 +1456,8 @@ source "arch/arm/mach-rmobile/Kconfig" source "arch/arm/mach-meson/Kconfig" +source "arch/arm/mach-mediatek/Kconfig" + source "arch/arm/mach-qemu/Kconfig" source "arch/arm/mach-rockchip/Kconfig"
arch/arm/Makefile +1 -0
@@ -62,6 +62,7 @@ machine-$(CONFIG_ARCH_K3) += k3 machine-$(CONFIG_ARCH_KEYSTONE) += keystone # TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD machine-$(CONFIG_KIRKWOOD) += kirkwood +machine-$(CONFIG_ARCH_MEDIATEK) += mediatek machine-$(CONFIG_ARCH_MESON) += meson machine-$(CONFIG_ARCH_MVEBU) += mvebu # TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA
arch/arm/include/asm/arch-mediatek/misc.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2018 MediaTek Inc. +*/ + +#ifndef __MEDIATEK_MISC_H_ +#define __MEDIATEK_MISC_H_ + +#define VER_BASE 0x08000000 +#define VER_SIZE 0x10 + +#define APHW_CODE 0x00 +#define APHW_SUBCODE 0x04 +#define APHW_VER 0x08 +#define APSW_VER 0x0c + +#endif /* __MEDIATEK_MISC_H_ */
arch/arm/mach-mediatek/Kconfig new file +26 -0
@@ -0,0 +1,26 @@ +if ARCH_MEDIATEK + +config SYS_SOC + default "mediatek" + +config SYS_VENDOR + default "mediatek" + +choice + prompt "MediaTek board select" + +config TARGET_MT7629 + bool "MediaTek MT7629 SoC" + select CPU_V7A + select SPL + select ARCH_MISC_INIT + help + The MediaTek MT7629 is a ARM-based SoC with a dual-core Cortex-A7 + including DDR3, crypto engine, 3x3 11n/ac Wi-Fi, Gigabit Ethernet, + switch, USB3.0, PCIe, UART, SPI, I2C and PWM. + +endchoice + +source "board/mediatek/mt7629/Kconfig" + +endif
arch/arm/mach-mediatek/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += cpu.o +obj-$(CONFIG_SPL_BUILD) += spl.o + +obj-$(CONFIG_TARGET_MT7629) += mt7629/
arch/arm/mach-mediatek/cpu.c new file +34 -0
@@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (C) 2018 MediaTek Inc. +*/ + +#include <common.h> +#include <dm.h> +#include <wdt.h> +#include <dm/uclass-internal.h> + +int arch_misc_init (void ) +{ +struct udevice *wdt; +int ret; + + ret =uclass_first_device_err (UCLASS_WDT , &wdt); +if (!ret) +wdt_stop (wdt); + +return 0 ; +} + +int arch_cpu_init (void ) +{ +icache_enable (); + +return 0 ; +} + +void enable_caches (void ) +{ +/* Enable D-cache. I-cache is already enabled in start.S */ +dcache_enable (); +}
arch/arm/mach-mediatek/init.h new file +11 -0
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2018 MediaTek Inc. +*/ + +#ifndef __MEDIATEK_INIT_H_ +#define __MEDIATEK_INIT_H_ + +extern int mtk_soc_early_init (void ); + +#endif /* __MEDIATEK_INIT_H_ */
arch/arm/mach-mediatek/mt7629/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += init.o +obj-y += lowlevel_init.o
arch/arm/mach-mediatek/mt7629/init.c new file +128 -0
128 lines not on this page · raw message
arch/arm/mach-mediatek/mt7629/lowlevel_init.S new file +50 -0
50 lines not on this page · raw message
arch/arm/mach-mediatek/spl.c new file +43 -0
43 lines not on this page · raw message
board/mediatek/mt7629/Kconfig new file +17 -0
@@ -0,0 +1,17 @@ +if TARGET_MT7629 + +config SYS_BOARD + default "mt7629" + +config SYS_CONFIG_NAME + default "mt7629" + +config MTK_SPL_PAD_SIZE + hex + default 0x10000 + +config MTK_BROM_HEADER_INFO + string + default "media=nor" + +endif
board/mediatek/mt7629/MAINTAINERS new file +7 -0
@@ -0,0 +1,7 @@ +MT7629 +M: Ryder Lee <[email protected]> +M: Weijie Gao <[email protected]> +S: Maintained +F: board/mediatek/mt7629 +F: include/configs/mt7629.h +F: configs/mt7629_rfb_defconfig
board/mediatek/mt7629/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += mt7629_rfb.o
board/mediatek/mt7629/mt7629_rfb.c new file +16 -0
@@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (C) 2018 MediaTek Inc. +*/ + +#include <common.h> + +DECLARE_GLOBAL_DATA_PTR ; + +int board_init (void ) +{ +/* address of boot parameters */ + gd->bd->bi_boot_params =CONFIG_SYS_SDRAM_BASE +0x100 ; + +return 0 ; +}
configs/mt7629_rfb_defconfig new file +73 -0
73 lines not on this page · raw message
include/configs/mt7629.h new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 5/18 arm: MediaTek: add basic support for MT7623 boards
In reply to Ryder LeeFrom: Weijie Gao <[email protected]>
This adds a general board file based on MT7623 SoCs from MediaTek.
As this u-boot is loaded by MTK proprietary preloader, there is no low level initializtion codes.
---
Changes since v5: None
Changes since v4:
-Add gd->bd->bi_boot_params for legacy method - ATAGs.
--- arch/arm/mach-mediatek/Kconfig | 13 ++++ arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mt7623/Makefile | 4 ++ arch/arm/mach-mediatek/mt7623/init.c | 54 +++++++++++++++ arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 ++++++ arch/arm/mach-mediatek/mt7623/preloader.h | 99 +++++++++++++++++++++++++++ board/mediatek/mt7623/Kconfig | 13 ++++ board/mediatek/mt7623/MAINTAINERS | 7 ++ board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 +++++ configs/mt7623n_bpir2_defconfig | 54 +++++++++++++++ include/configs/mt7623.h | 56 +++++++++++++++ 12 files changed, 342 insertions(+) create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.c create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 include/configs/mt7623.h
arch/arm/mach-mediatek/Kconfig +13 -0
@@ -9,6 +9,18 @@ config SYS_VENDOR choice prompt "MediaTek board select" +config TARGET_MT7623 + bool "MediaTek MT7623 SoC" + select CPU_V7A + select ARCH_MISC_INIT + help + The MediaTek MT7623 is a ARM-based SoC with a quad-core Cortex-A7 + including NEON and GPU, Mali-450 graphics, several DDR3 options, + crypto engine, built-in Wi-Fi / Bluetooth combo chip, JPEG decoder, + video interfaces supporting HDMI and MIPI, and video codec support. + Peripherals include Gigabit Ethernet, switch, USB3.0 and OTG, PCIe, + I2S, PCM, S/PDIF, UART, SPI, I2C, IR TX/RX, and PWM. + config TARGET_MT7629 bool "MediaTek MT7629 SoC" select CPU_V7A
@@ -21,6 +33,7 @@ config TARGET_MT7629 endchoice +source "board/mediatek/mt7623/Kconfig" source "board/mediatek/mt7629/Kconfig" endif
arch/arm/mach-mediatek/Makefile +1 -0
@@ -3,4 +3,5 @@ obj-y += cpu.o obj-$(CONFIG_SPL_BUILD) += spl.o +obj-$(CONFIG_TARGET_MT7623) += mt7623/ obj-$(CONFIG_TARGET_MT7629) += mt7629/
arch/arm/mach-mediatek/mt7623/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += init.o +obj-y += lowlevel_init.o
arch/arm/mach-mediatek/mt7623/init.c new file +54 -0
54 lines not on this page · raw message
arch/arm/mach-mediatek/mt7623/lowlevel_init.S new file +22 -0
@@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2018 MediaTek Inc. + */ + +#include <linux/linkage.h> + +.extern preloader_param + +ENTRY(save_boot_params) + ldr r6, =preloader_param + str r4, [r6] + b save_boot_params_ret +ENDPROC(save_boot_params) + +ENTRY(lowlevel_init) + /* enable SMP bit */ + mrc p15, 0, r0, c1, c0, 1 + orr r0, r0, #0x40 + mcr p15, 0, r0, c1, c0, 1 + mov pc, lr +ENDPROC(lowlevel_init)
arch/arm/mach-mediatek/mt7623/preloader.h new file +99 -0
99 lines not on this page · raw message
board/mediatek/mt7623/Kconfig new file +13 -0
@@ -0,0 +1,13 @@ +if TARGET_MT7623 + +config SYS_BOARD + default "mt7623" + +config SYS_CONFIG_NAME + default "mt7623" + +config MTK_BROM_HEADER_INFO + string + default "lk=1" + +endif
board/mediatek/mt7623/MAINTAINERS new file +7 -0
@@ -0,0 +1,7 @@ +MT7623 +M: Ryder Lee <[email protected]> +M: Weijie Gao <[email protected]> +S: Maintained +F: board/mediatek/mt7623 +F: include/configs/mt7623.h +F: configs/mt7623n_bpir2_defconfig
board/mediatek/mt7623/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += mt7623_rfb.o
board/mediatek/mt7623/mt7623_rfb.c new file +16 -0
@@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (C) 2018 MediaTek Inc. +*/ + +#include <common.h> + +DECLARE_GLOBAL_DATA_PTR ; + +int board_init (void ) +{ +/* address of boot parameters */ + gd->bd->bi_boot_params =CONFIG_SYS_SDRAM_BASE +0x100 ; + +return 0 ; +}
configs/mt7623n_bpir2_defconfig new file +54 -0
54 lines not on this page · raw message
include/configs/mt7623.h new file +56 -0
56 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 6/18 clk: MediaTek: add clock driver for MT7629 SoC.
In reply to Ryder LeeThis patch adds clock modules for MediaTek SoCs:
- Shared part: a common driver which contains the general operations for plls, muxes, dividers and gates so that we can reuse it in future.
- Specific SoC part: the group of structures used to hold the hardware configuration for each SoC.
We take MT7629 as an example to demonstrate how to implement driver if any other MediaTek chips would like to use it.
---
Changes since v5: None
Changes since v4
-Add a __common_ infix on the shared funcitons to make them clear.
(i.e., mtk_clk_init() -> mtk_common_clk_init())
--- drivers/clk/Makefile | 1 + drivers/clk/mediatek/Makefile | 6 + drivers/clk/mediatek/clk-mt7629.c | 709 ++++++++++++++++++++++++++++++++++++++ drivers/clk/mediatek/clk-mtk.c | 493 ++++++++++++++++++++++++++ drivers/clk/mediatek/clk-mtk.h | 194 +++++++++++ 5 files changed, 1403 insertions(+) create mode 100644 drivers/clk/mediatek/Makefile create mode 100644 drivers/clk/mediatek/clk-mt7629.c create mode 100644 drivers/clk/mediatek/clk-mtk.c create mode 100644 drivers/clk/mediatek/clk-mtk.h
drivers/clk/Makefile +1 -0
@@ -10,6 +10,7 @@ obj-y += imx/ obj-y += tegra/ obj-$(CONFIG_ARCH_ASPEED) += aspeed/ obj-$(CONFIG_ARCH_MESON) += clk_meson.o +obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/ obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ obj-$(CONFIG_ARCH_SOCFPGA) += altera/ obj-$(CONFIG_CLK_AT91) += at91/
drivers/clk/mediatek/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 +# Core +obj-$(CONFIG_ARCH_MEDIATEK) += clk-mtk.o + +# SoC Drivers +obj-$(CONFIG_TARGET_MT7629) += clk-mt7629.o
drivers/clk/mediatek/clk-mt7629.c new file +709 -0
709 lines not on this page · raw message
drivers/clk/mediatek/clk-mtk.c new file +493 -0
493 lines not on this page · raw message
drivers/clk/mediatek/clk-mtk.h new file +194 -0
194 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 7/18 clk: MediaTek: add clock driver for MT7623 SoC.
In reply to Ryder LeeThis patch adds a driver for MT7623 clock blocks.
---
Changes since v5: None
Changes since v4: None
--- drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt7623.c | 870 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 871 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt7623.c
drivers/clk/mediatek/Makefile +1 -0
@@ -3,4 +3,5 @@ obj-$(CONFIG_ARCH_MEDIATEK) += clk-mtk.o # SoC Drivers +obj-$(CONFIG_TARGET_MT7623) += clk-mt7623.o obj-$(CONFIG_TARGET_MT7629) += clk-mt7629.o
drivers/clk/mediatek/clk-mt7623.c new file +870 -0
870 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 8/18 timer: MediaTek: add timer driver for MediaTek SoCs
In reply to Ryder LeeThis patch adds clock source and clock event for the timer found on the Mediatek SoCs.
---
Changes since v5: None
Changes since v4: None
--- drivers/timer/Kconfig | 7 ++++ drivers/timer/Makefile | 1 + drivers/timer/mtk_timer.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 drivers/timer/mtk_timer.c
drivers/timer/Kconfig +7 -0
@@ -160,4 +160,11 @@ config MPC83XX_TIMER Select this to enable support for the timer found on devices based on the MPC83xx family of SoCs. +config MTK_TIMER + bool "MediaTek timer support" + depends on TIMER + help + Select this to enable support for the timer found on + MediaTek devices. + endmenu
drivers/timer/Makefile +1 -0
@@ -18,3 +18,4 @@ obj-$(CONFIG_SANDBOX_TIMER) += sandbox_timer.o obj-$(CONFIG_STI_TIMER) += sti-timer.o obj-$(CONFIG_STM32_TIMER) += stm32_timer.o obj-$(CONFIG_X86_TSC_TIMER) += tsc_timer.o +obj-$(CONFIG_MTK_TIMER) += mtk_timer.o
drivers/timer/mtk_timer.c new file +85 -0
85 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 9/18 watchdog: MediaTek: add watchdog driver for MediaTek SoCs
In reply to Ryder LeeThis patch adds a common driver for the Mediatek SoC integrated watchdog.
---
Changes since v5: None
Changes since v4: None
--- drivers/watchdog/Kconfig | 8 +++ drivers/watchdog/Makefile | 1 + drivers/watchdog/mtk_wdt.c | 135 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 drivers/watchdog/mtk_wdt.c
drivers/watchdog/Kconfig +8 -0
@@ -103,6 +103,14 @@ config WDT_CDNS Select this to enable Cadence watchdog timer, which can be found on some Xilinx Microzed Platform. +config WDT_MTK + bool "MediaTek watchdog timer support" + depends on WDT && ARCH_MEDIATEK + help + Select this to enable watchdog timer for MediaTek SoCs. + The watchdog timer is stopped when initialized. + It performs full SoC reset. + config XILINX_TB_WATCHDOG bool "Xilinx Axi watchdog timer support" depends on WDT
drivers/watchdog/Makefile +1 -0
@@ -23,3 +23,4 @@ obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o obj-$(CONFIG_WDT_ORION) += orion_wdt.o obj-$(CONFIG_WDT_CDNS) += cdns_wdt.o obj-$(CONFIG_MPC8xx_WATCHDOG) += mpc8xx_wdt.o +obj-$(CONFIG_WDT_MTK) += mtk_wdt.o
drivers/watchdog/mtk_wdt.c new file +135 -0
135 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 10/18 pinctrl: MediaTek: add pinctrl driver for MT7629 SoC
In reply to Ryder LeeThis 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.
---
Changes since v5:
- remove unused pin macros
Changes since v4:
-mtk_pinctrl_probe() is a common function called by all probe functions,
so rename it to mtk_pinctrl_common_probe().
--- arch/arm/include/asm/arch-mediatek/gpio.h | 9 + drivers/pinctrl/Kconfig | 1 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/mediatek/Kconfig | 11 + drivers/pinctrl/mediatek/Makefile | 6 + drivers/pinctrl/mediatek/pinctrl-mt7629.c | 409 +++++++++++++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 553 ++++++++++++++++++++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 182 +++++++++ 8 files changed, 1172 insertions(+) create mode 100644 arch/arm/include/asm/arch-mediatek/gpio.h create mode 100644 drivers/pinctrl/mediatek/Kconfig create mode 100644 drivers/pinctrl/mediatek/Makefile create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7629.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.h
arch/arm/include/asm/arch-mediatek/gpio.h new file +9 -0
@@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2018 MediaTek Inc. +*/ + +#ifndef __MEDIATEK_GPIO_H +#define __MEDIATEK_GPIO_H + +#endif /* __MEDIATEK_GPIO_H */
drivers/pinctrl/Kconfig +1 -0
@@ -301,6 +301,7 @@ config ASPEED_AST2500_PINCTRL endif source "drivers/pinctrl/meson/Kconfig" +source "drivers/pinctrl/mediatek/Kconfig" source "drivers/pinctrl/nxp/Kconfig" source "drivers/pinctrl/renesas/Kconfig" source "drivers/pinctrl/uniphier/Kconfig"
drivers/pinctrl/Makefile +1 -0
@@ -16,6 +16,7 @@ obj-$(CONFIG_PINCTRL_UNIPHIER) += uniphier/ obj-$(CONFIG_PINCTRL_PIC32) += pinctrl_pic32.o obj-$(CONFIG_PINCTRL_EXYNOS) += exynos/ obj-$(CONFIG_PINCTRL_MESON) += meson/ +obj-$(CONFIG_PINCTRL_MTK) += mediatek/ obj-$(CONFIG_ARCH_MVEBU) += mvebu/ obj-$(CONFIG_PINCTRL_SINGLE) += pinctrl-single.o obj-$(CONFIG_PINCTRL_STI) += pinctrl-sti.o
drivers/pinctrl/mediatek/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +if ARCH_MEDIATEK + +config PINCTRL_MTK + depends on PINCTRL_GENERIC + bool + +config PINCTRL_MT7629 + bool "MT7629 SoC pinctrl driver" + select PINCTRL_MTK + +endif
drivers/pinctrl/mediatek/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 +# Core +obj-$(CONFIG_PINCTRL_MTK) += pinctrl-mtk-common.o + +# SoC Drivers +obj-$(CONFIG_PINCTRL_MT7629) += pinctrl-mt7629.o
drivers/pinctrl/mediatek/pinctrl-mt7629.c new file +409 -0
409 lines not on this page · raw message
drivers/pinctrl/mediatek/pinctrl-mtk-common.c new file +553 -0
553 lines not on this page · raw message
drivers/pinctrl/mediatek/pinctrl-mtk-common.h new file +182 -0
182 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 11/18 pinctrl: MediaTek: add pinctrl driver for MT7623 SoC
In reply to Ryder LeeThis patch adds pinctrl support for MT7623 SoC. And most of the structures are used to hold the hardware configuration for each pin.
---
Changes since v5: None
Changes since v4:
-Add a comment to the exported function - mtk_rmw()
--- drivers/pinctrl/mediatek/Kconfig | 4 + drivers/pinctrl/mediatek/Makefile | 1 + drivers/pinctrl/mediatek/pinctrl-mt7623.c | 1284 +++++++++++++++++++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 2 + 4 files changed, 1291 insertions(+) create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7623.c
drivers/pinctrl/mediatek/Kconfig +4 -0
@@ -4,6 +4,10 @@ config PINCTRL_MTK depends on PINCTRL_GENERIC bool +config PINCTRL_MT7623 + bool "MT7623 SoC pinctrl driver" + select PINCTRL_MTK + config PINCTRL_MT7629 bool "MT7629 SoC pinctrl driver" select PINCTRL_MTK
drivers/pinctrl/mediatek/Makefile +1 -0
@@ -3,4 +3,5 @@ obj-$(CONFIG_PINCTRL_MTK) += pinctrl-mtk-common.o # SoC Drivers +obj-$(CONFIG_PINCTRL_MT7623) += pinctrl-mt7623.o obj-$(CONFIG_PINCTRL_MT7629) += pinctrl-mt7629.o
drivers/pinctrl/mediatek/pinctrl-mt7623.c new file +1284 -0
1,284 lines not on this page · raw message
drivers/pinctrl/mediatek/pinctrl-mtk-common.h +2 -0
@@ -176,6 +176,8 @@ struct mtk_pinctrl_priv {extern const struct pinctrl_ops mtk_pinctrl_ops; +/* A common read-modify-write helper for MediaTek chips */ +void mtk_rmw (struct udevice *dev,u32 reg,u32 mask,u32 set);int mtk_pinctrl_common_probe (struct udevice *dev,struct mtk_pinctrl_soc *soc);
Signature · 1 line
1.9.1
PATCH v5 12/18 power domain: MediaTek: add power domain driver for MT7629 SoC
In reply to Ryder LeeThis 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.
---
Changes since v5: None
Changes since v4: None
--- drivers/power/domain/Kconfig | 7 + drivers/power/domain/Makefile | 1 + drivers/power/domain/mtk-power-domain.c | 326 ++++++++++++++++++++++++++++++++ 3 files changed, 334 insertions(+) create mode 100644 drivers/power/domain/mtk-power-domain.c
drivers/power/domain/Kconfig +7 -0
@@ -23,6 +23,13 @@ config IMX8_POWER_DOMAIN Enable support for manipulating NXP i.MX8 on-SoC power domains via IPC requests to the SCU. +config MTK_POWER_DOMAIN + bool "Enable the MediaTek power domain driver" + depends on POWER_DOMAIN && ARCH_MEDIATEK + help + Enable support for manipulating MediaTek power domains via MMIO + mapped registers. + config MESON_GX_VPU_POWER_DOMAIN bool "Enable Amlogic Meson GX VPU power domain driver" depends on ARCH_MESON
drivers/power/domain/Makefile +1 -0
@@ -6,6 +6,7 @@ obj-$(CONFIG_$(SPL_)POWER_DOMAIN) += power-domain-uclass.o obj-$(CONFIG_BCM6328_POWER_DOMAIN) += bcm6328-power-domain.o obj-$(CONFIG_IMX8_POWER_DOMAIN) += imx8-power-domain.o +obj-$(CONFIG_MTK_POWER_DOMAIN) += mtk-power-domain.o obj-$(CONFIG_MESON_GX_VPU_POWER_DOMAIN) += meson-gx-pwrc-vpu.o obj-$(CONFIG_SANDBOX_POWER_DOMAIN) += sandbox-power-domain.o obj-$(CONFIG_SANDBOX_POWER_DOMAIN) += sandbox-power-domain-test.o
drivers/power/domain/mtk-power-domain.c new file +326 -0
326 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 13/18 power domain: MediaTek: add power domain driver for MT7623 SoC
In reply to Ryder LeeThis adds power domain (scpsys) support for MT7623 SoC.
---
Changes since v5: None
Changes since v4: None
--- drivers/power/domain/mtk-power-domain.c | 80 +++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+)
drivers/power/domain/mtk-power-domain.c +80 -0
@@ -14,9 +14,19 @@#include <asm/processor.h> #include <linux/iopoll.h> +#include <dt-bindings/power/mt7623-power.h> #include <dt-bindings/power/mt7629-power.h> #define SPM_EN (0xb16 << 16 | 0x1) +#define SPM_VDE_PWR_CON 0x0210 +#define SPM_MFG_PWR_CON 0x0214 +#define SPM_ISP_PWR_CON 0x0238 +#define SPM_DIS_PWR_CON 0x023c +#define SPM_CONN_PWR_CON 0x0280 +#define SPM_BDP_PWR_CON 0x029c +#define SPM_ETH_PWR_CON 0x02a0 +#define SPM_HIF_PWR_CON 0x02a4 +#define SPM_IFR_MSC_PWR_CON 0x02a8#define SPM_ETHSYS_PWR_CON 0x2e0#define SPM_HIF0_PWR_CON 0x2e4#define SPM_HIF1_PWR_CON 0x2e8
@@ -29,6 +39,15 @@#define PWR_ON_2ND_BIT BIT(3)#define PWR_CLK_DIS_BIT BIT(4) +#define PWR_STATUS_CONN BIT(1) +#define PWR_STATUS_DISP BIT(3) +#define PWR_STATUS_MFG BIT(4) +#define PWR_STATUS_ISP BIT(5) +#define PWR_STATUS_VDEC BIT(7) +#define PWR_STATUS_BDP BIT(14) +#define PWR_STATUS_ETH BIT(15) +#define PWR_STATUS_HIF BIT(16) +#define PWR_STATUS_IFR_MSC BIT(17)#define PWR_STATUS_ETHSYS BIT(24)#define PWR_STATUS_HIF0 BIT(25)#define PWR_STATUS_HIF1 BIT(26)
@@ -41,6 +60,7 @@#define DCM_TOP_EN BIT(0)enum scp_domain_type { +SCPSYS_MT7623 ,SCPSYS_MT7629 , };
@@ -62,6 +82,59 @@ struct scp_domain {struct scp_domain_data *data; }; +static struct scp_domain_data scp_domain_mt7623[] = { + [MT7623_POWER_DOMAIN_CONN ] = { + .sta_mask =PWR_STATUS_CONN , + .ctl_offs =SPM_CONN_PWR_CON , + .bus_prot_mask =BIT (8 ) |BIT (2 ), + }, + [MT7623_POWER_DOMAIN_DISP ] = { + .sta_mask =PWR_STATUS_DISP , + .ctl_offs =SPM_DIS_PWR_CON , + .sram_pdn_bits =GENMASK (11 ,8 ), + .bus_prot_mask =BIT (2 ), + }, + [MT7623_POWER_DOMAIN_MFG ] = { + .sta_mask =PWR_STATUS_MFG , + .ctl_offs =SPM_MFG_PWR_CON , + .sram_pdn_bits =GENMASK (11 ,8 ), + .sram_pdn_ack_bits =GENMASK (12 ,12 ), + }, + [MT7623_POWER_DOMAIN_VDEC ] = { + .sta_mask =PWR_STATUS_VDEC , + .ctl_offs =SPM_VDE_PWR_CON , + .sram_pdn_bits =GENMASK (11 ,8 ), + .sram_pdn_ack_bits =GENMASK (12 ,12 ), + }, + [MT7623_POWER_DOMAIN_ISP ] = { + .sta_mask =PWR_STATUS_ISP , + .ctl_offs =SPM_ISP_PWR_CON , + .sram_pdn_bits =GENMASK (11 ,8 ), + .sram_pdn_ack_bits =GENMASK (13 ,12 ), + }, + [MT7623_POWER_DOMAIN_BDP ] = { + .sta_mask =PWR_STATUS_BDP , + .ctl_offs =SPM_BDP_PWR_CON , + .sram_pdn_bits =GENMASK (11 ,8 ), + }, + [MT7623_POWER_DOMAIN_ETH ] = { + .sta_mask =PWR_STATUS_ETH , + .ctl_offs =SPM_ETH_PWR_CON , + .sram_pdn_bits =GENMASK (11 ,8 ), + .sram_pdn_ack_bits =GENMASK (15 ,12 ), + }, + [MT7623_POWER_DOMAIN_HIF ] = { + .sta_mask =PWR_STATUS_HIF , + .ctl_offs =SPM_HIF_PWR_CON , + .sram_pdn_bits =GENMASK (11 ,8 ), + .sram_pdn_ack_bits =GENMASK (15 ,12 ), + }, + [MT7623_POWER_DOMAIN_IFR_MSC ] = { + .sta_mask =PWR_STATUS_IFR_MSC , + .ctl_offs =SPM_IFR_MSC_PWR_CON , + }, +}; +static struct scp_domain_data scp_domain_mt7629[] = { [MT7629_POWER_DOMAIN_ETHSYS ] = { .sta_mask =PWR_STATUS_ETHSYS ,
@@ -252,6 +325,9 @@ static int mtk_power_domain_hook(struct udevice *dev) scpd->type = (enum scp_domain_type )dev_get_driver_data (dev);switch (scpd->type) { +case SCPSYS_MT7623 : + scpd->data = scp_domain_mt7623; +break ;case SCPSYS_MT7629 : scpd->data = scp_domain_mt7629;break ;
@@ -303,6 +379,10 @@ static int mtk_power_domain_probe(struct udevice *dev)static const struct udevice_id mtk_power_domain_ids[] = { { + .compatible ="mediatek,mt7623-scpsys" , + .data =SCPSYS_MT7623 , + }, + { .compatible ="mediatek,mt7629-scpsys" , .data =SCPSYS_MT7629 , },
Signature · 1 line
1.9.1
PATCH v5 14/18 serial: MediaTek: add high-speed uart driver for MediaTek SoCs
In reply to Ryder LeeMany SoCs from MediaTek have a high-speed uart. This UART is compatible with the ns16550 in legacy mode. It has extra registers for high-speed mode which can reach a maximum baudrate at 921600.
However this UART will no longer be compatible if it's in high-speed mode. Some BootROM of MediaTek's SoCs will change the UART into high-speed mode and the U-Boot must use this driver to initialize the UART.
---
Changes since v5: Add a specific driver for MTK UART Changes since v4: None
--- drivers/serial/Kconfig | 20 ++++ drivers/serial/Makefile | 1 + drivers/serial/serial_mtk.c | 268 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 289 insertions(+) create mode 100644 drivers/serial/serial_mtk.c
drivers/serial/Kconfig +20 -0
@@ -368,6 +368,16 @@ config DEBUG_UART_OMAP You will need to provide parameters to make this work. The driver will be available until the real driver model serial is running. +config DEBUG_UART_MTK + bool "MediaTek High-speed UART" + depends on MTK_SERIAL + help + Select this to enable a debug UART using the MediaTek High-speed + UART driver. + You will need to provide parameters to make this work. The + driver will be available until the real driver model serial is + running. + endchoice config DEBUG_UART_BASE
@@ -692,6 +702,16 @@ config ZYNQ_SERIAL This driver supports the Cadence UART. It is found e.g. in Xilinx Zynq/ZynqMP. +config MTK_SERIAL + bool "MediaTek High-speed UART support" + depends on DM_SERIAL + help + Select this to enable UART support for MediaTek High-speed UART + devices. This driver uses driver model and requires a device + tree binding to operate. + The High-speed UART is compatible with the ns16550a UART and have + its own high-speed registers. + config MPC8XX_CONS bool "Console driver for MPC8XX" depends on MPC8xx
drivers/serial/Makefile +1 -0
@@ -66,6 +66,7 @@ obj-$(CONFIG_MPC8XX_CONS) += serial_mpc8xx.o obj-$(CONFIG_NULLDEV_SERIAL) += serial_nulldev.o obj-$(CONFIG_OWL_SERIAL) += serial_owl.o obj-$(CONFIG_OMAP_SERIAL) += serial_omap.o +obj-$(CONFIG_MTK_SERIAL) += serial_mtk.o ifndef CONFIG_SPL_BUILD obj-$(CONFIG_USB_TTY) += usbtty.o
drivers/serial/serial_mtk.c new file +268 -0
269 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 15/18 ram: MediaTek: add DDR3 driver for MT7629 SoC
In reply to Ryder LeeThis patch adds a DDR3 driver for MT7629 SoC.
---
Changes since v5: None
Changes since v4: None
--- drivers/ram/Makefile | 1 + drivers/ram/mediatek/Makefile | 7 + drivers/ram/mediatek/ddr3-mt7629.c | 766 +++++++++++++++++++++++++++++++++++++ 3 files changed, 774 insertions(+) create mode 100644 drivers/ram/mediatek/Makefile create mode 100644 drivers/ram/mediatek/ddr3-mt7629.c
drivers/ram/Makefile +1 -0
@@ -11,3 +11,4 @@ obj-$(CONFIG_STM32_SDRAM) += stm32_sdram.o obj-$(CONFIG_ARCH_BMIPS) += bmips_ram.o obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ +obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/
drivers/ram/mediatek/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Copyright (c) 2018 MediaTek Inc. +# +# SPDX-License-Identifier: GPL-2.0 +# + +obj-$(CONFIG_TARGET_MT7629) = ddr3-mt7629.o
drivers/ram/mediatek/ddr3-mt7629.c new file +766 -0
766 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 16/18 mmc: mtk-sd: add SD/MMC host controller driver for MT7623 SoC
In reply to Ryder LeeFrom: Weijie Gao <[email protected]>
This patch adds MT7623 host controller driver for accessing SD/MMC.
---
Changes since v5: None
Changes since v4: None
--- drivers/mmc/Kconfig | 11 + drivers/mmc/Makefile | 1 + drivers/mmc/mtk-sd.c | 1394 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1406 insertions(+) create mode 100644 drivers/mmc/mtk-sd.c
drivers/mmc/Kconfig +11 -0
@@ -598,6 +598,17 @@ config FTSDC010_SDIO help This can enable ftsdc010 sdio function. +config MMC_MTK + bool "MediaTek SD/MMC Card Interface support" + depends on ARCH_MEDIATEK + depends on BLK && DM_MMC + depends on OF_CONTROL + 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 or M here. + This is needed if support for any SD/SDIO/MMC devices is required. + If unsure, say N. + endif config TEGRA124_MMC_DISABLE_EXT_LOOPBACK
drivers/mmc/Makefile +1 -0
@@ -65,3 +65,4 @@ obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o obj-$(CONFIG_MMC_UNIPHIER) += tmio-common.o uniphier-sd.o obj-$(CONFIG_RENESAS_SDHI) += tmio-common.o renesas-sdhi.o obj-$(CONFIG_MMC_BCM2835) += bcm2835_sdhost.o +obj-$(CONFIG_MMC_MTK) += mtk-sd.o
drivers/mmc/mtk-sd.c new file +1394 -0
1,394 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 17/18 doc: README.mediatek: Add a simple README for MediaTek
In reply to Ryder LeeAdd a few notes on how to try out the MediaTek support so far.
---
Changes since v5:
-Fix Whitespace-Error.
Changes since v4:
-Add instructions on how to prepare SD card and write to SNOR flash. -Fix typo.
--- doc/README.mediatek | 221 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 doc/README.mediatek
doc/README.mediatek new file +221 -0
@@ -0,0 +1,221 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2018 MediaTek Inc. +# Ryder Lee <[email protected]> + + +This document describes how to compile the U-Boot and how to change U-Boot +configuration about the MediaTek SoCs. + + +Build Procedure +=============== + -Set the cross compiler: + + # export CROSS_COMPILE=/path/to/toolchain/arm-linux-gnueabi- + + -Clean-up old residuals: + + # make mrproper + + -Configure the U-Boot: + + # make <defconfig_file> + # make + + - For the MT7623n bananapi R2 board use "mt7623n_bpir2_defconfig" + - For the MT7629 reference board use "mt7629_rfb_defconfig" + + +Boot sequence +============= + -Bootrom -> MTK preloader -> U-Boot + + - MT7623n + + This version of U-Boot doesn't implement SPL. So, MTK preloader binary + is needed to boot up: + + https://github.com/BPI-SINOVOIP/BPI-R2-bsp/tree/master/mt-pack/mtk/bpi-r2/bin + + + -Bootrom -> SPL -> U-Boot + + - MT7629 + + +Configuration update +==================== + To update the U-Boot configuration, please refer to doc/README.kconfig + + +MediaTek image header +===================== +Currently there are two image headers used for MediaTek chips: + + - BootROM image header. This header is used by the first stage bootloader. It records + the desired compatible boot device, integrity information and its load address. + + The on-chip BootROM will firstly verify integrity and compatibility of the bootloader. + + If verification passed, the BootROM will then load the bootloader into on-chip SRAM, + and pass control to it. + + Note that this header is actually a combination of three independent headers: + Device header, BRLYT header and GFH header. + + Used by U-Boot SPL of MT7629 and preloader of MT7623. + + + - MediaTek legacy image header. This header was originally used by the legacy image. It + basically records the load address, image size and image name. + + After all low level initializations passed, the preloader will locate the LK image and + load it into DRAM, and pass control to it. + + Now this header is used by U-Boot of MT7623. + + +To generate these two headers with mkimage: + + # mkimage -T mtk_image -a <load_addr> -n <option_string> -d <input_file> <image_file> + + - mtk_image means using MediaTek's header generation method. + + + - load_addr is the load address of this image. + For first stage bootloader like U-Boot SPL or preloader, it usually points to the + on-chip SRAM. + + For second stage bootloader like U-Boot, it usually points to the DRAM. + + + - option_string contains options to generate the header. + + The option string is using the follow format: + key1=value1;key2=value2;... + + The following key names are valid: + lk: If lk=1, LK image header is used. Otherwise BootROM image header is used. + + lkname: The name of the LK image header. The maximum length is 32. + The default value is "U-Boot". + + media: Desired boot device. The valid values are: + nand : Parallel NAND + snand: Serial NAND + nor : Serial NOR + emmc : eMMC + sdmmc: SD + + nandinfo: Desired NAND device type, a combination of page size, oob size and + optional device capacity. Valid types are: + 2k+64 : for Serial NAND, 2KiB page size + 64B oob size + 2k+120 : for Serial NAND, 2KiB page size + 120B oob size + 2k+128 : for Serial NAND, 2KiB page size + 128B oob size + 4k+256 : for Serial NAND, 4KiB page size + 256B oob size + 1g:2k+64 : for Parallel NAND, 2KiB page size + 64B oob size, total 1Gbit size + 2g:2k+64 : for Parallel NAND, 2KiB page size + 64B oob size, total 2Gbit size + 4g:2k+64 : for Parallel NAND, 2KiB page size + 64B oob size, total 4Gbit size + 2g:2k+128: for Parallel NAND, 2KiB page size + 128B oob size, total 2Gbit size + 4g:2k+128: for Parallel NAND, 2KiB page size + 128B oob size, total 4Gbit size + + +MT7629 partitions on Serial NOR +=============================== + + Start End Size Description + 00000000 - 0000ffff: 64KiB U-Boot SPL + 00010000 - 0005ffff: 320KiB U-Boot + 00060000 - 0006ffff: 64KiB U-Boot env / MediaTek NVRAM + 00070000 - 000affff: 256KiB RF calibration data + 000b0000 - xxxxxxxx: all left Firmware image + + +BPi-R2 (MT7623N) partitions on SD +================================= + Please note that the last two partitions can vary from different Linux distributions + depending on the MBR partition table. + + Start End Size Description + 00000000 - 000001ff: 512B Device header (with MBR partition table) + 00000200 - 000007ff: 1536B BRLYT header + 00000800 - 0004ffff: 318KiB Preloader (with GFH header) + 00050000 - 000fffff: 704KiB U-Boot + 00100000 - 063fffff: 99MiB Reserved + 06400000 - 163fffff: 256MiB Partition 1 (FAT32) + 16400000 - xxxxxxxx: all left Partition 2 (ext4) + + +Upgrading notice on Serial NOR +============================== +Example: MT7629 + + The command sf is used to operate the Serial NOR device: + + - To probe current NOR flash: + + # sf probe + + - To erase a region: + + # sf erase <offset> <len> + + - To write data to an offset: + + # sf write <data_addr> <offset> <len> + + - To boot kernel: + + # bootm 0x300b0000 + + The memory address range 0x30000000 - 0x3fffffff is mapped to the NOR flash. + The DRAM starts at 0x40000000. + + Please note that the output binary u-boot-mtk.bin is a combination of SPL and U-Boot, + and it should be write to beginning of the flash. + + Otherwise you should use standalone files: + + spl/u-boot-spl-mtk.bin for SPL, + u-boot.img for U-Boot. + + +Upgrading notice on SD / eMMC +============================= +Example: MT7623 + + Normally only Preloader and U-Boot can be upgraded within U-Boot, and other partitions + should be written in PC. + + - To probe current SD card / eMMC: + + # mmc dev 0 for eMMC + # mmc dev 1 for SD + + - To erase a region: + + # mmc erase <blk_offset> <blk_num> + + - To write data to a block offset: + + # mmc write <data_addr> <blk_offset> <blk_num> + + - To load kernel image from partition 1: + + # fatload mmc 0:1 <load_address> <path_to_kernel_uImage> for eMMC + # fatload mmc 1:1 <load_address> <path_to_kernel_uImage> for SD + + - To boot kernel: + + # bootm <load_address> + + The DRAM starts at 0x80000000. + + Please note that we use block offset and block count for SD card, not the byte offset. + The block size is always 512 bytes for SD card. + + +Documentation +============= + http://wiki.banana-pi.org/Banana_Pi_BPI-R2
Signature · 1 line
1.9.1
PATCH v5 18/18 MAINTAINERS: add an entry for MediaTek
In reply to Ryder LeeThis patch adds an entry for MediaTek.
---
Changes since v5: None
Changes since v4: None
--- MAINTAINERS | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
MAINTAINERS +20 -0
@@ -158,6 +158,26 @@ T: git git://git.denx.de/u-boot-pxa.git F: arch/arm/cpu/pxa/ F: arch/arm/include/asm/arch-pxa/ +ARM MEDIATEK +M: Ryder Lee <[email protected]> +M: Weijie Gao <[email protected]> +S: Maintained +F: arch/arm/mach-mediatek/ +F: arch/arm/include/asm/arch-mediatek/ +F: board/mediatek/ +F: doc/README.mediatek +F: drivers/clk/mediatek/ +F: drivers/mmc/mtk-sd.c +F: drivers/pinctrl/mediatek/ +F: drivers/power/domain/mtk-power-domain.c +F: drivers/ram/mediatek/ +F: drivers/spi/mtk_qspi.c +F: drivers/timer/mtk_timer.c +F: drivers/watchdog/mtk_wdt.c +F: tools/mtk_image.c +F: tools/mtk_image.h +N: mediatek + ARM OWL M: Manivannan Sadhasivam <[email protected]> S: Maintained
Signature · 1 line
1.9.1
PATCH v5 14/18 serial: MediaTek: add high-speed uart driver for MediaTek SoCs
In reply to Ryder LeeQuoted 14 lines · Ryder Lee
Many SoCs from MediaTek have a high-speed uart. This UART is compatible with the ns16550 in legacy mode. It has extra registers for high-speed mode which can reach a maximum baudrate at 921600.
However this UART will no longer be compatible if it's in high-speed mode. Some BootROM of MediaTek's SoCs will change the UART into high-speed mode and the U-Boot must use this driver to initialize the UART.
Signed-off-by Weijie Gao <[email protected]>Tested-by Ryder Lee <[email protected]>---
Changes since v5: Add a specific driver for MTK UART Changes since v4: None
Quoted 6 lines
--- drivers/serial/Kconfig | 20 ++++ drivers/serial/Makefile | 1 + drivers/serial/serial_mtk.c | 268 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 289 insertions(+) create mode 100644 drivers/serial/serial_mtk.c
PATCH v5 5/18 arm: MediaTek: add basic support for MT7623 boards
In reply to Ryder LeeHi,
Quoted 30 lines · Ryder Lee
From: Weijie Gao <[email protected]>
This adds a general board file based on MT7623 SoCs from MediaTek.
As this u-boot is loaded by MTK proprietary preloader, there is no low level initializtion codes.
Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>---
Changes since v5: None
Changes since v4:
-Addgd->bd->bi_boot_paramsfor legacy method - ATAGs.--- arch/arm/mach-mediatek/Kconfig | 13 ++++ arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mt7623/Makefile | 4 ++ arch/arm/mach-mediatek/mt7623/init.c | 54 +++++++++++++++ arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 ++++++ arch/arm/mach-mediatek/mt7623/preloader.h | 99 +++++++++++++++++++++++++++ board/mediatek/mt7623/Kconfig | 13 ++++ board/mediatek/mt7623/MAINTAINERS | 7 ++ board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 +++++ configs/mt7623n_bpir2_defconfig | 54 +++++++++++++++ include/configs/mt7623.h | 56 +++++++++++++++ 12 files changed, 342 insertions(+) create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.c
Quoted 8 lines
create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 include/configs/mt7623.h
Can this use the bloblist feature which should land soon?
For now, see dm/spl-working.
Regards,
Simon
PATCH v5 17/18 doc: README.mediatek: Add a simple README for MediaTek
In reply to Ryder LeeQuoted 8 lines · Ryder Lee
Add a few notes on how to try out the MediaTek support so far.
Signed-off-by Ryder Lee <[email protected]>Tested-by Frank Wunderlich <[email protected]>---
Changes since v5:
-Fix Whitespace-Error.
Changes since v4:
Review
Quoted 6 lines
(quoted diff) +0
-3-Add instructions on how to prepare SD card and write to SNOR flash. -Fix typo. --- doc/README.mediatek | 221 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 doc/README.mediatek
PATCH v5 5/18 arm: MediaTek: add basic support for MT7623 boards
In reply to Simon GlassQuoted 42 lines · Simon Glass
Hi,
Quoted 30 lines · Ryder Lee
From: Weijie Gao <[email protected]>
This adds a general board file based on MT7623 SoCs from MediaTek.
As this u-boot is loaded by MTK proprietary preloader, there is no low level initializtion codes.
Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>---
Changes since v5: None
Changes since v4:
-Addgd->bd->bi_boot_paramsfor legacy method - ATAGs.--- arch/arm/mach-mediatek/Kconfig | 13 ++++ arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mt7623/Makefile | 4 ++ arch/arm/mach-mediatek/mt7623/init.c | 54 +++++++++++++++ arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 ++++++ arch/arm/mach-mediatek/mt7623/preloader.h | 99 +++++++++++++++++++++++++++ board/mediatek/mt7623/Kconfig | 13 ++++ board/mediatek/mt7623/MAINTAINERS | 7 ++ board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 +++++ configs/mt7623n_bpir2_defconfig | 54 +++++++++++++++ include/configs/mt7623.h | 56 +++++++++++++++ 12 files changed, 342 insertions(+) create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.cQuoted 8 lines
create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 include/configs/mt7623.h
Quoted 6 lines
Can this use the bloblist feature which should land soon?
For now, see dm/spl-working.
Regards,
Simon
Hi Simon,
I've read the code for spl handoff. It's a good way though but unfortunately it cannot be applied to the MT7623 boards.
The reason is that MT7623 uses a MediaTek proprietary preloader which has the same function as the U-Boot SPL. But the preloader is close-sourced (by company policy) and only available in binary release. This means we can't use a real U-Boot SPL to replace the preloader.
At present this chip has already been used in many products. We can't either release a different preloader which introduces compatibility issues.
So the conclusion is that we cannot use the bloblist feature for this SoC.
Best Regards,
Weijie
PATCH v5 5/18 arm: MediaTek: add basic support for MT7623 boards
Hi Weijie,
Quoted 11 lines · Weijie Gao
Quoted 10 lines · Simon Glass
Hi,
Quoted 7 lines · Ryder Lee
From: Weijie Gao <[email protected]>
This adds a general board file based on MT7623 SoCs from MediaTek.
As this u-boot is loaded by MTK proprietary preloader, there is no low level initializtion codes.
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>---
Changes since v5: None
Changes since v4:Quoted 8 lines
Quoted 8 lines
-Add
gd->bd->bi_boot_paramsfor legacy method - ATAGs.--- arch/arm/mach-mediatek/Kconfig | 13 ++++ arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mt7623/Makefile | 4 ++ arch/arm/mach-mediatek/mt7623/init.c | 54 +++++++++++++++ arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 ++++++ arch/arm/mach-mediatek/mt7623/preloader.h | 99
+++++++++++++++++++++++++++
Quoted 27 lines
Quoted 18 lines
Quoted 9 lines
board/mediatek/mt7623/Kconfig | 13 ++++ board/mediatek/mt7623/MAINTAINERS | 7 ++ board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 +++++ configs/mt7623n_bpir2_defconfig | 54 +++++++++++++++ include/configs/mt7623.h | 56 +++++++++++++++ 12 files changed, 342 insertions(+) create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.cQuoted 8 lines
create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 include/configs/mt7623.hQuoted 6 lines
Can this use the bloblist feature which should land soon?
For now, see dm/spl-working.
Regards,
SimonHi Simon,
Quoted 7 lines
I've read the code for spl handoff. It's a good way though but unfortunately it cannot be applied to the MT7623 boards.
The reason is that MT7623 uses a MediaTek proprietary preloader which has the same function as the U-Boot SPL. But the preloader is close-sourced (by company policy) and only available in binary release. This means we can't use a real U-Boot SPL to replace the preloader.
Can you work to get U-Boot SPL running on the chip?
What is the reason for the proprietary SPL?
Quoted 4 lines
At present this chip has already been used in many products. We can't either release a different preloader which introduces compatibility issues.
What sort of compatibility issues? I cannot see any advantage with a proprietary SPL.
Quoted 3 lines
So the conclusion is that we cannot use the bloblist feature for this SoC.
Regards,
Simon
v5 cover Add U-Boot support for MediaTek SoCs - MT7623n & MT7629
In reply to Ryder LeeHi,
tested this patchset on top of 2018-11 final and got an issue.
if i bootup this uboot, enter console and make a printenv, uboot gets stuck with strange chars after printing then env
because my env got load from emmc by default i had reset my env and writing it again (env default -a;printenv;saveenv). after boot again, i have same issue.
after writing my v4 (based on rc3) i see this issue too...any idea how i can sort this out?
you can look into my code at github
https://github.com/frank-w/u-boot/tree/bpi-r2_v5 //based on 2018-11 with v5-patches
https://github.com/frank-w/u-boot/tree/bpi-r2_v4 //based on rc3 with v4-patches
https://github.com/frank-w/u-boot/tree/bpi-r2_v3 //based on rc3 with v3-patches does not have this issue
regards Frank
Quoted 181 lines
Gesendet: Donnerstag, 15. November 2018 um 03:07 Uhr
Von: "Ryder Lee" <[email protected]>
An: "Tom Rini" <[email protected]>, "Simon Glass" <[email protected]>, "Albert Aribaud" <[email protected]>
Cc: "Ryder Lee" <[email protected]>, "Steven Liu" <[email protected]>, "Roy Luo" <[email protected]>, u-boot at lists.denx.de
Betreff: [U-Boot] [PATCH v5 00/18] Add U-Boot support for MediaTek SoCs - MT7623n & MT7629Hello,
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, UART, watchdog, power domain and device tree.
Ryder
Ryder Lee (16):
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: MediaTek: add high-speed uart driver for MediaTek SoCs
ram: MediaTek: add DDR3 driver for MT7629 SoC
doc: README.mediatek: Add a simple README for MediaTek
MAINTAINERS: add an entry for MediaTekWeijie Gao (2):
arm: MediaTek: add basic support for MT7623 boards
mmc: mtk-sd: add SD/MMC host controller driver for MT7623 SoCMAINTAINERS | 20 + Makefile | 20 + arch/arm/Kconfig | 16 + arch/arm/Makefile | 1 + arch/arm/dts/Makefile | 4 + arch/arm/dts/mt7623.dtsi | 255 +++++ arch/arm/dts/mt7623n-bananapi-bpi-r2.dts | 207 ++++ arch/arm/dts/mt7629-rfb-u-boot.dtsi | 24 + arch/arm/dts/mt7629-rfb.dts | 70 ++ arch/arm/dts/mt7629.dtsi | 244 +++++ arch/arm/include/asm/arch-mediatek/gpio.h | 9 + arch/arm/include/asm/arch-mediatek/misc.h | 17 + arch/arm/mach-mediatek/Kconfig | 39 + arch/arm/mach-mediatek/Makefile | 7 + arch/arm/mach-mediatek/cpu.c | 34 + arch/arm/mach-mediatek/init.h | 11 + arch/arm/mach-mediatek/mt7623/Makefile | 4 + arch/arm/mach-mediatek/mt7623/init.c | 54 + arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 + arch/arm/mach-mediatek/mt7623/preloader.h | 99 ++ arch/arm/mach-mediatek/mt7629/Makefile | 4 + arch/arm/mach-mediatek/mt7629/init.c | 128 +++ arch/arm/mach-mediatek/mt7629/lowlevel_init.S | 50 + arch/arm/mach-mediatek/spl.c | 43 + board/mediatek/mt7623/Kconfig | 13 + board/mediatek/mt7623/MAINTAINERS | 7 + board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 + board/mediatek/mt7629/Kconfig | 17 + board/mediatek/mt7629/MAINTAINERS | 7 + board/mediatek/mt7629/Makefile | 3 + board/mediatek/mt7629/mt7629_rfb.c | 16 + common/image.c | 1 + configs/mt7623n_bpir2_defconfig | 54 + configs/mt7629_rfb_defconfig | 73 ++ doc/README.mediatek | 221 ++++ drivers/clk/Makefile | 1 + drivers/clk/mediatek/Makefile | 7 + drivers/clk/mediatek/clk-mt7623.c | 870 +++++++++++++++ drivers/clk/mediatek/clk-mt7629.c | 709 +++++++++++++ drivers/clk/mediatek/clk-mtk.c | 493 +++++++++ drivers/clk/mediatek/clk-mtk.h | 194 ++++ drivers/mmc/Kconfig | 11 + drivers/mmc/Makefile | 1 + drivers/mmc/mtk-sd.c | 1394 +++++++++++++++++++++++++ drivers/pinctrl/Kconfig | 1 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/mediatek/Kconfig | 15 + drivers/pinctrl/mediatek/Makefile | 7 + drivers/pinctrl/mediatek/pinctrl-mt7623.c | 1284 +++++++++++++++++++++++ drivers/pinctrl/mediatek/pinctrl-mt7629.c | 409 ++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 553 ++++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 184 ++++ drivers/power/domain/Kconfig | 7 + drivers/power/domain/Makefile | 1 + drivers/power/domain/mtk-power-domain.c | 406 +++++++ drivers/ram/Makefile | 1 + drivers/ram/mediatek/Makefile | 7 + drivers/ram/mediatek/ddr3-mt7629.c | 766 ++++++++++++++ drivers/serial/Kconfig | 20 + drivers/serial/Makefile | 1 + drivers/serial/serial_mtk.c | 268 +++++ drivers/timer/Kconfig | 7 + drivers/timer/Makefile | 1 + drivers/timer/mtk_timer.c | 85 ++ drivers/watchdog/Kconfig | 8 + drivers/watchdog/Makefile | 1 + drivers/watchdog/mtk_wdt.c | 135 +++ include/configs/mt7623.h | 56 + include/configs/mt7629.h | 57 + include/dt-bindings/clock/mt7623-clk.h | 413 ++++++++ include/dt-bindings/clock/mt7629-clk.h | 206 ++++ include/dt-bindings/power/mt7623-power.h | 19 + include/dt-bindings/power/mt7629-power.h | 13 + include/image.h | 1 + scripts/Makefile.spl | 11 + tools/Makefile | 1 + tools/mtk_image.c | 749 +++++++++++++ tools/mtk_image.h | 199 ++++ 79 files changed, 11386 insertions(+) create mode 100644 arch/arm/dts/mt7623.dtsi create mode 100644 arch/arm/dts/mt7623n-bananapi-bpi-r2.dts create mode 100644 arch/arm/dts/mt7629-rfb-u-boot.dtsi create mode 100644 arch/arm/dts/mt7629-rfb.dts create mode 100644 arch/arm/dts/mt7629.dtsi create mode 100644 arch/arm/include/asm/arch-mediatek/gpio.h create mode 100644 arch/arm/include/asm/arch-mediatek/misc.h create mode 100644 arch/arm/mach-mediatek/Kconfig create mode 100644 arch/arm/mach-mediatek/Makefile create mode 100644 arch/arm/mach-mediatek/cpu.c create mode 100644 arch/arm/mach-mediatek/init.h create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.c create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 arch/arm/mach-mediatek/mt7629/Makefile create mode 100644 arch/arm/mach-mediatek/mt7629/init.c create mode 100644 arch/arm/mach-mediatek/mt7629/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/spl.c create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 board/mediatek/mt7629/Kconfig create mode 100644 board/mediatek/mt7629/MAINTAINERS create mode 100644 board/mediatek/mt7629/Makefile create mode 100644 board/mediatek/mt7629/mt7629_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 configs/mt7629_rfb_defconfig create mode 100644 doc/README.mediatek create mode 100644 drivers/clk/mediatek/Makefile create mode 100644 drivers/clk/mediatek/clk-mt7623.c create mode 100644 drivers/clk/mediatek/clk-mt7629.c create mode 100644 drivers/clk/mediatek/clk-mtk.c create mode 100644 drivers/clk/mediatek/clk-mtk.h create mode 100644 drivers/mmc/mtk-sd.c create mode 100644 drivers/pinctrl/mediatek/Kconfig create mode 100644 drivers/pinctrl/mediatek/Makefile create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7623.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7629.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.h create mode 100644 drivers/power/domain/mtk-power-domain.c create mode 100644 drivers/ram/mediatek/Makefile create mode 100644 drivers/ram/mediatek/ddr3-mt7629.c create mode 100644 drivers/serial/serial_mtk.c create mode 100644 drivers/timer/mtk_timer.c create mode 100644 drivers/watchdog/mtk_wdt.c create mode 100644 include/configs/mt7623.h create mode 100644 include/configs/mt7629.h create mode 100644 include/dt-bindings/clock/mt7623-clk.h create mode 100644 include/dt-bindings/clock/mt7629-clk.h create mode 100644 include/dt-bindings/power/mt7623-power.h create mode 100644 include/dt-bindings/power/mt7629-power.h create mode 100644 tools/mtk_image.c create mode 100644 tools/mtk_image.hSignature · 6 lines
1.9.1 _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de https://lists.denx.de/listinfo/u-boot
v5 cover Add U-Boot support for MediaTek SoCs - MT7623n & MT7629
v3 has the same problem if i use same uEnv.txt and disable bootmenu in include/configs/mt7623.h
#define CONFIG_MENU_SHOW
#define CONFIG_BOOTDELAY 3
without the change in header i come directly to my bootmenu-entry 0 defined here and not to bootmenu (seems it is selected instead of running bootcmd=reloadmenu which loads uenv.txt from sdcard):
https://github.com/frank-w/u-boot/blob/7a31819225b51d41cd6f1202250c2316e274aacf/uEnv.txt#L35
if i cancel this (to get in console) i can do a printenv
i guess its a problem with bootcmd in combination with the load of uEnv.txt from sdcard, show menu and go back to console
any hints how to debug this? menu is shown good and kernel-startup works, but go back to console and do a printenv kills uboot
regards Frank
Quoted 211 lines
Gesendet: Samstag, 17. November 2018 um 10:37 Uhr
Von: "Frank Wunderlich" <[email protected]>
An: "Ryder Lee" <[email protected]>
Cc: "Tom Rini" <[email protected]>, "Ryder Lee" <[email protected]>, "Steven Liu" <[email protected]>, u-boot at lists.denx.de, "Roy Luo" <[email protected]>
Betreff: Re: [U-Boot] [PATCH v5 00/18] Add U-Boot support for MediaTek SoCs - MT7623n & MT7629Hi,
tested this patchset on top of 2018-11 final and got an issue.
if i bootup this uboot, enter console and make a printenv, uboot gets stuck with strange chars after printing then env
because my env got load from emmc by default i had reset my env and writing it again (env default -a;printenv;saveenv). after boot again, i have same issue.
after writing my v4 (based on rc3) i see this issue too...any idea how i can sort this out?
you can look into my code at github
https://github.com/frank-w/u-boot/tree/bpi-r2_v5 //based on 2018-11 with v5-patches
https://github.com/frank-w/u-boot/tree/bpi-r2_v4 //based on rc3 with v4-patches
https://github.com/frank-w/u-boot/tree/bpi-r2_v3 //based on rc3 with v3-patches does not have this issueregards Frank
Quoted 164 lines
Gesendet: Donnerstag, 15. November 2018 um 03:07 Uhr
Von: "Ryder Lee" <[email protected]>
An: "Tom Rini" <[email protected]>, "Simon Glass" <[email protected]>, "Albert Aribaud" <[email protected]>
Cc: "Ryder Lee" <[email protected]>, "Steven Liu" <[email protected]>, "Roy Luo" <[email protected]>, u-boot at lists.denx.de
Betreff: [U-Boot] [PATCH v5 00/18] Add U-Boot support for MediaTek SoCs - MT7623n & MT7629Hello,
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, UART, watchdog, power domain and device tree.
Ryder
Ryder Lee (16):
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: MediaTek: add high-speed uart driver for MediaTek SoCs
ram: MediaTek: add DDR3 driver for MT7629 SoC
doc: README.mediatek: Add a simple README for MediaTek
MAINTAINERS: add an entry for MediaTekWeijie Gao (2):
arm: MediaTek: add basic support for MT7623 boards
mmc: mtk-sd: add SD/MMC host controller driver for MT7623 SoCMAINTAINERS | 20 + Makefile | 20 + arch/arm/Kconfig | 16 + arch/arm/Makefile | 1 + arch/arm/dts/Makefile | 4 + arch/arm/dts/mt7623.dtsi | 255 +++++ arch/arm/dts/mt7623n-bananapi-bpi-r2.dts | 207 ++++ arch/arm/dts/mt7629-rfb-u-boot.dtsi | 24 + arch/arm/dts/mt7629-rfb.dts | 70 ++ arch/arm/dts/mt7629.dtsi | 244 +++++ arch/arm/include/asm/arch-mediatek/gpio.h | 9 + arch/arm/include/asm/arch-mediatek/misc.h | 17 + arch/arm/mach-mediatek/Kconfig | 39 + arch/arm/mach-mediatek/Makefile | 7 + arch/arm/mach-mediatek/cpu.c | 34 + arch/arm/mach-mediatek/init.h | 11 + arch/arm/mach-mediatek/mt7623/Makefile | 4 + arch/arm/mach-mediatek/mt7623/init.c | 54 + arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 + arch/arm/mach-mediatek/mt7623/preloader.h | 99 ++ arch/arm/mach-mediatek/mt7629/Makefile | 4 + arch/arm/mach-mediatek/mt7629/init.c | 128 +++ arch/arm/mach-mediatek/mt7629/lowlevel_init.S | 50 + arch/arm/mach-mediatek/spl.c | 43 + board/mediatek/mt7623/Kconfig | 13 + board/mediatek/mt7623/MAINTAINERS | 7 + board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 + board/mediatek/mt7629/Kconfig | 17 + board/mediatek/mt7629/MAINTAINERS | 7 + board/mediatek/mt7629/Makefile | 3 + board/mediatek/mt7629/mt7629_rfb.c | 16 + common/image.c | 1 + configs/mt7623n_bpir2_defconfig | 54 + configs/mt7629_rfb_defconfig | 73 ++ doc/README.mediatek | 221 ++++ drivers/clk/Makefile | 1 + drivers/clk/mediatek/Makefile | 7 + drivers/clk/mediatek/clk-mt7623.c | 870 +++++++++++++++ drivers/clk/mediatek/clk-mt7629.c | 709 +++++++++++++ drivers/clk/mediatek/clk-mtk.c | 493 +++++++++ drivers/clk/mediatek/clk-mtk.h | 194 ++++ drivers/mmc/Kconfig | 11 + drivers/mmc/Makefile | 1 + drivers/mmc/mtk-sd.c | 1394 +++++++++++++++++++++++++ drivers/pinctrl/Kconfig | 1 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/mediatek/Kconfig | 15 + drivers/pinctrl/mediatek/Makefile | 7 + drivers/pinctrl/mediatek/pinctrl-mt7623.c | 1284 +++++++++++++++++++++++ drivers/pinctrl/mediatek/pinctrl-mt7629.c | 409 ++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 553 ++++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 184 ++++ drivers/power/domain/Kconfig | 7 + drivers/power/domain/Makefile | 1 + drivers/power/domain/mtk-power-domain.c | 406 +++++++ drivers/ram/Makefile | 1 + drivers/ram/mediatek/Makefile | 7 + drivers/ram/mediatek/ddr3-mt7629.c | 766 ++++++++++++++ drivers/serial/Kconfig | 20 + drivers/serial/Makefile | 1 + drivers/serial/serial_mtk.c | 268 +++++ drivers/timer/Kconfig | 7 + drivers/timer/Makefile | 1 + drivers/timer/mtk_timer.c | 85 ++ drivers/watchdog/Kconfig | 8 + drivers/watchdog/Makefile | 1 + drivers/watchdog/mtk_wdt.c | 135 +++ include/configs/mt7623.h | 56 + include/configs/mt7629.h | 57 + include/dt-bindings/clock/mt7623-clk.h | 413 ++++++++ include/dt-bindings/clock/mt7629-clk.h | 206 ++++ include/dt-bindings/power/mt7623-power.h | 19 + include/dt-bindings/power/mt7629-power.h | 13 + include/image.h | 1 + scripts/Makefile.spl | 11 + tools/Makefile | 1 + tools/mtk_image.c | 749 +++++++++++++ tools/mtk_image.h | 199 ++++ 79 files changed, 11386 insertions(+) create mode 100644 arch/arm/dts/mt7623.dtsi create mode 100644 arch/arm/dts/mt7623n-bananapi-bpi-r2.dts create mode 100644 arch/arm/dts/mt7629-rfb-u-boot.dtsi create mode 100644 arch/arm/dts/mt7629-rfb.dts create mode 100644 arch/arm/dts/mt7629.dtsi create mode 100644 arch/arm/include/asm/arch-mediatek/gpio.h create mode 100644 arch/arm/include/asm/arch-mediatek/misc.h create mode 100644 arch/arm/mach-mediatek/Kconfig create mode 100644 arch/arm/mach-mediatek/Makefile create mode 100644 arch/arm/mach-mediatek/cpu.c create mode 100644 arch/arm/mach-mediatek/init.h create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.c create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 arch/arm/mach-mediatek/mt7629/Makefile create mode 100644 arch/arm/mach-mediatek/mt7629/init.c create mode 100644 arch/arm/mach-mediatek/mt7629/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/spl.c create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 board/mediatek/mt7629/Kconfig create mode 100644 board/mediatek/mt7629/MAINTAINERS create mode 100644 board/mediatek/mt7629/Makefile create mode 100644 board/mediatek/mt7629/mt7629_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 configs/mt7629_rfb_defconfig create mode 100644 doc/README.mediatek create mode 100644 drivers/clk/mediatek/Makefile create mode 100644 drivers/clk/mediatek/clk-mt7623.c create mode 100644 drivers/clk/mediatek/clk-mt7629.c create mode 100644 drivers/clk/mediatek/clk-mtk.c create mode 100644 drivers/clk/mediatek/clk-mtk.h create mode 100644 drivers/mmc/mtk-sd.c create mode 100644 drivers/pinctrl/mediatek/Kconfig create mode 100644 drivers/pinctrl/mediatek/Makefile create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7623.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7629.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.h create mode 100644 drivers/power/domain/mtk-power-domain.c create mode 100644 drivers/ram/mediatek/Makefile create mode 100644 drivers/ram/mediatek/ddr3-mt7629.c create mode 100644 drivers/serial/serial_mtk.c create mode 100644 drivers/timer/mtk_timer.c create mode 100644 drivers/watchdog/mtk_wdt.cQuoted 17 lines
create mode 100644 include/configs/mt7623.h create mode 100644 include/configs/mt7629.h create mode 100644 include/dt-bindings/clock/mt7623-clk.h create mode 100644 include/dt-bindings/clock/mt7629-clk.h create mode 100644 include/dt-bindings/power/mt7623-power.h create mode 100644 include/dt-bindings/power/mt7629-power.h create mode 100644 tools/mtk_image.c create mode 100644 tools/mtk_image.hSignature · 6 lines
1.9.1 _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de https://lists.denx.de/listinfo/u-boot_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
v5 cover Add U-Boot support for MediaTek SoCs - MT7623n & MT7629
got it...on this sd-card i had no uEnv.txt and did not check for its existance but tried to load it...
created a uenv.txt and not more problem. i have to change my environment to check for file first before do the other steps
sorry for inconveniences
regards Frank
Quoted 234 lines
Gesendet: Samstag, 17. November 2018 um 11:20 Uhr
Von: "Frank Wunderlich" <[email protected]>
An: "Frank Wunderlich" <[email protected]>
Cc: "Ryder Lee" <[email protected]>, "Tom Rini" <[email protected]>, "Steven Liu" <[email protected]>, u-boot at lists.denx.de
Betreff: Aw: Re: [U-Boot] [PATCH v5 00/18] Add U-Boot support for MediaTek SoCs - MT7623n & MT7629v3 has the same problem if i use same uEnv.txt and disable bootmenu in
include/configs/mt7623.h#define
CONFIG_MENU_SHOW
#defineCONFIG_BOOTDELAY3without the change in header i come directly to my bootmenu-entry 0 defined here and not to bootmenu (seems it is selected instead of running bootcmd=reloadmenu which loads uenv.txt from sdcard):
https://github.com/frank-w/u-boot/blob/7a31819225b51d41cd6f1202250c2316e274aacf/uEnv.txt#L35if i cancel this (to get in console) i can do a printenv
i guess its a problem with bootcmd in combination with the load of uEnv.txt from sdcard, show menu and go back to console
any hints how to debug this? menu is shown good and kernel-startup works, but go back to console and do a printenv kills uboot
regards Frank
Quoted 211 lines
Gesendet: Samstag, 17. November 2018 um 10:37 Uhr
Von: "Frank Wunderlich" <[email protected]>
An: "Ryder Lee" <[email protected]>
Cc: "Tom Rini" <[email protected]>, "Ryder Lee" <[email protected]>, "Steven Liu" <[email protected]>, u-boot at lists.denx.de, "Roy Luo" <[email protected]>
Betreff: Re: [U-Boot] [PATCH v5 00/18] Add U-Boot support for MediaTek SoCs - MT7623n & MT7629Hi,
tested this patchset on top of 2018-11 final and got an issue.
if i bootup this uboot, enter console and make a printenv, uboot gets stuck with strange chars after printing then env
because my env got load from emmc by default i had reset my env and writing it again (env default -a;printenv;saveenv). after boot again, i have same issue.
after writing my v4 (based on rc3) i see this issue too...any idea how i can sort this out?
you can look into my code at github
https://github.com/frank-w/u-boot/tree/bpi-r2_v5 //based on 2018-11 with v5-patches
https://github.com/frank-w/u-boot/tree/bpi-r2_v4 //based on rc3 with v4-patches
https://github.com/frank-w/u-boot/tree/bpi-r2_v3 //based on rc3 with v3-patches does not have this issueregards Frank
Quoted 164 lines
Gesendet: Donnerstag, 15. November 2018 um 03:07 Uhr
Von: "Ryder Lee" <[email protected]>
An: "Tom Rini" <[email protected]>, "Simon Glass" <[email protected]>, "Albert Aribaud" <[email protected]>
Cc: "Ryder Lee" <[email protected]>, "Steven Liu" <[email protected]>, "Roy Luo" <[email protected]>, u-boot at lists.denx.de
Betreff: [U-Boot] [PATCH v5 00/18] Add U-Boot support for MediaTek SoCs - MT7623n & MT7629Hello,
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, UART, watchdog, power domain and device tree.
Ryder
Ryder Lee (16):
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: MediaTek: add high-speed uart driver for MediaTek SoCs
ram: MediaTek: add DDR3 driver for MT7629 SoC
doc: README.mediatek: Add a simple README for MediaTek
MAINTAINERS: add an entry for MediaTekWeijie Gao (2):
arm: MediaTek: add basic support for MT7623 boards
mmc: mtk-sd: add SD/MMC host controller driver for MT7623 SoCMAINTAINERS | 20 + Makefile | 20 + arch/arm/Kconfig | 16 + arch/arm/Makefile | 1 + arch/arm/dts/Makefile | 4 + arch/arm/dts/mt7623.dtsi | 255 +++++ arch/arm/dts/mt7623n-bananapi-bpi-r2.dts | 207 ++++ arch/arm/dts/mt7629-rfb-u-boot.dtsi | 24 + arch/arm/dts/mt7629-rfb.dts | 70 ++ arch/arm/dts/mt7629.dtsi | 244 +++++ arch/arm/include/asm/arch-mediatek/gpio.h | 9 + arch/arm/include/asm/arch-mediatek/misc.h | 17 + arch/arm/mach-mediatek/Kconfig | 39 + arch/arm/mach-mediatek/Makefile | 7 + arch/arm/mach-mediatek/cpu.c | 34 + arch/arm/mach-mediatek/init.h | 11 + arch/arm/mach-mediatek/mt7623/Makefile | 4 + arch/arm/mach-mediatek/mt7623/init.c | 54 + arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 + arch/arm/mach-mediatek/mt7623/preloader.h | 99 ++ arch/arm/mach-mediatek/mt7629/Makefile | 4 + arch/arm/mach-mediatek/mt7629/init.c | 128 +++ arch/arm/mach-mediatek/mt7629/lowlevel_init.S | 50 + arch/arm/mach-mediatek/spl.c | 43 + board/mediatek/mt7623/Kconfig | 13 + board/mediatek/mt7623/MAINTAINERS | 7 + board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 + board/mediatek/mt7629/Kconfig | 17 + board/mediatek/mt7629/MAINTAINERS | 7 + board/mediatek/mt7629/Makefile | 3 + board/mediatek/mt7629/mt7629_rfb.c | 16 + common/image.c | 1 + configs/mt7623n_bpir2_defconfig | 54 + configs/mt7629_rfb_defconfig | 73 ++ doc/README.mediatek | 221 ++++ drivers/clk/Makefile | 1 + drivers/clk/mediatek/Makefile | 7 + drivers/clk/mediatek/clk-mt7623.c | 870 +++++++++++++++ drivers/clk/mediatek/clk-mt7629.c | 709 +++++++++++++ drivers/clk/mediatek/clk-mtk.c | 493 +++++++++ drivers/clk/mediatek/clk-mtk.h | 194 ++++ drivers/mmc/Kconfig | 11 + drivers/mmc/Makefile | 1 + drivers/mmc/mtk-sd.c | 1394 +++++++++++++++++++++++++ drivers/pinctrl/Kconfig | 1 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/mediatek/Kconfig | 15 + drivers/pinctrl/mediatek/Makefile | 7 + drivers/pinctrl/mediatek/pinctrl-mt7623.c | 1284 +++++++++++++++++++++++ drivers/pinctrl/mediatek/pinctrl-mt7629.c | 409 ++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 553 ++++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 184 ++++ drivers/power/domain/Kconfig | 7 + drivers/power/domain/Makefile | 1 + drivers/power/domain/mtk-power-domain.c | 406 +++++++ drivers/ram/Makefile | 1 + drivers/ram/mediatek/Makefile | 7 + drivers/ram/mediatek/ddr3-mt7629.c | 766 ++++++++++++++ drivers/serial/Kconfig | 20 + drivers/serial/Makefile | 1 + drivers/serial/serial_mtk.c | 268 +++++ drivers/timer/Kconfig | 7 + drivers/timer/Makefile | 1 + drivers/timer/mtk_timer.c | 85 ++ drivers/watchdog/Kconfig | 8 + drivers/watchdog/Makefile | 1 + drivers/watchdog/mtk_wdt.c | 135 +++ include/configs/mt7623.h | 56 + include/configs/mt7629.h | 57 + include/dt-bindings/clock/mt7623-clk.h | 413 ++++++++ include/dt-bindings/clock/mt7629-clk.h | 206 ++++ include/dt-bindings/power/mt7623-power.h | 19 + include/dt-bindings/power/mt7629-power.h | 13 + include/image.h | 1 + scripts/Makefile.spl | 11 + tools/Makefile | 1 + tools/mtk_image.c | 749 +++++++++++++ tools/mtk_image.h | 199 ++++ 79 files changed, 11386 insertions(+) create mode 100644 arch/arm/dts/mt7623.dtsi create mode 100644 arch/arm/dts/mt7623n-bananapi-bpi-r2.dts create mode 100644 arch/arm/dts/mt7629-rfb-u-boot.dtsi create mode 100644 arch/arm/dts/mt7629-rfb.dts create mode 100644 arch/arm/dts/mt7629.dtsi create mode 100644 arch/arm/include/asm/arch-mediatek/gpio.h create mode 100644 arch/arm/include/asm/arch-mediatek/misc.h create mode 100644 arch/arm/mach-mediatek/Kconfig create mode 100644 arch/arm/mach-mediatek/Makefile create mode 100644 arch/arm/mach-mediatek/cpu.c create mode 100644 arch/arm/mach-mediatek/init.h create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.c create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 arch/arm/mach-mediatek/mt7629/Makefile create mode 100644 arch/arm/mach-mediatek/mt7629/init.c create mode 100644 arch/arm/mach-mediatek/mt7629/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/spl.c create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 board/mediatek/mt7629/Kconfig create mode 100644 board/mediatek/mt7629/MAINTAINERS create mode 100644 board/mediatek/mt7629/Makefile create mode 100644 board/mediatek/mt7629/mt7629_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 configs/mt7629_rfb_defconfig create mode 100644 doc/README.mediatek create mode 100644 drivers/clk/mediatek/Makefile create mode 100644 drivers/clk/mediatek/clk-mt7623.c create mode 100644 drivers/clk/mediatek/clk-mt7629.c create mode 100644 drivers/clk/mediatek/clk-mtk.c create mode 100644 drivers/clk/mediatek/clk-mtk.h create mode 100644 drivers/mmc/mtk-sd.c create mode 100644 drivers/pinctrl/mediatek/Kconfig create mode 100644 drivers/pinctrl/mediatek/Makefile create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7623.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt7629.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.c create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-common.h create mode 100644 drivers/power/domain/mtk-power-domain.c create mode 100644 drivers/ram/mediatek/Makefile create mode 100644 drivers/ram/mediatek/ddr3-mt7629.c create mode 100644 drivers/serial/serial_mtk.c create mode 100644 drivers/timer/mtk_timer.c create mode 100644 drivers/watchdog/mtk_wdt.cQuoted 17 lines
create mode 100644 include/configs/mt7623.h create mode 100644 include/configs/mt7629.h create mode 100644 include/dt-bindings/clock/mt7623-clk.h create mode 100644 include/dt-bindings/clock/mt7629-clk.h create mode 100644 include/dt-bindings/power/mt7623-power.h create mode 100644 include/dt-bindings/power/mt7629-power.h create mode 100644 tools/mtk_image.c create mode 100644 tools/mtk_image.hSignature · 6 lines
1.9.1 _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de https://lists.denx.de/listinfo/u-boot_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH v5 5/18 arm: MediaTek: add basic support for MT7623 boards
In reply to Simon GlassQuoted 87 lines · Simon Glass
Hi Weijie,
Quoted 4 lines · Weijie Gao
Quoted 3 lines · Simon Glass
Hi,
On 14 November 2018 at 18:07, Ryder Lee <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
From: Weijie Gao <[email protected]>
This adds a general board file based on MT7623 SoCs from
MediaTek.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
As this u-boot is loaded by MTK proprietary preloader, there is
no
Quoted 14 lines
Quoted 14 lines
Quoted 9 lines
low level initializtion codes.
Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>---
Changes since v5: None
Changes since v4:
-Addgd->bd->bi_boot_paramsfor legacy method - ATAGs.Quoted 5 lines
--- arch/arm/mach-mediatek/Kconfig | 13 ++++ arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mt7623/Makefile | 4 ++ arch/arm/mach-mediatek/mt7623/init.c | 54+++++++++++++++
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 ++++++ arch/arm/mach-mediatek/mt7623/preloader.h | 99+++++++++++++++++++++++++++
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
board/mediatek/mt7623/Kconfig | 13 ++++ board/mediatek/mt7623/MAINTAINERS | 7 ++ board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 +++++ configs/mt7623n_bpir2_defconfig | 54+++++++++++++++
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/configs/mt7623.h | 56+++++++++++++++
Quoted 19 lines
Quoted 12 lines
Quoted 11 lines
12 files changed, 342 insertions(+) create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.c create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 include/configs/mt7623.hQuoted 6 lines
Can this use the bloblist feature which should land soon?
For now, see dm/spl-working.
Regards,
SimonQuoted 6 lines
Hi Simon,
I've read the code for spl handoff. It's a good way though but unfortunately it cannot be applied to the MT7623 boards.
The reason is that MT7623 uses a MediaTek proprietary preloader
which
Quoted 2 lines
has the same function as the U-Boot SPL. But the preloader is close-sourced (by company policy) and only available in binary
release.
Quoted 1 line
This means we can't use a real U-Boot SPL to replace the preloader.
Can you work to get U-Boot SPL running on the chip?
What is the reason for the proprietary SPL?
Quoted 2 lines
At present this chip has already been used in many products. We
can't
Quoted 2 lines
either release a different preloader which introduces compatibility issues.
What sort of compatibility issues? I cannot see any advantage with a proprietary SPL.
Quoted 1 line
Quoted 7 lines
Quoted 1 line
So the conclusion is that we cannot use the bloblist feature for
this
Quoted 1 line
SoC.
Regards,
Simon
Hi Simon,
Sorry for that I didn't describe the function of the preloader clearly.
The MT7623 is like a smart phone SoC which has the ability to upgrade bootloader/firmware via a USB cable. This function is always available even if there is no valid preloader/bootloader.
This is done by cooperation of the BootROM and preloader. This is a simple description of the flow:
1. Connect the MT7623 board to the PC using USB cable. Do not power up.
2. Run MediaTek's FlashTool and start downloading.
3. Power up the board.
4. The BootROM will initialize the USB device immediately for few seconds and waiting for commands from PC.
5. The PC will start transmit commands to the board as soon as it detects the board device.
6. Thee BootROM will then download the preloader into SRAM, and run it. Several informations will be passed to the preloader, to let it continue to communicate with the FlashTool.
7. The preloader will initialize the DRAM, download data via USB and write it to flash.
So the preloader is not only a simple SPL. It initializes DRAM and many other components which will only be initialized once or used by preloader. It also performs USB downloading and other things.
The preloader is also used by other MediaTek's smart phone SoCs. The DRAM initialization code is the mainly part that are not allowed to be open-sourced.
The preloader has so many functions which are not easy to port to the U-Boot SPL.
Assume all the codes are allowed to be open sourced.If all the functions are ported to SPL, the DM must be used in SPL, which will make the SPL binary too large to fit in the SRAM.If only the necessary parts are ported (e.g. DRAM initialization), the SPL will be incompatible with the BootROM and the FlashTool and the users will be in trouble recovering a board.
At present the preloader can be downloaded from the Internet. Users can concentrate on the development without managing the low level parts.
BTW, there are also chips use U-Boot as a second/third bootloader while using their proprietary binary as the first stage bootloader. For example the bcm7xxx.
BRs,
Weijie
PATCH v5 5/18 arm: MediaTek: add basic support for MT7623 boards
Hi Weijie,
Quoted 137 lines · Weijie Gao
Quoted 87 lines · Simon Glass
Hi Weijie,
Quoted 4 lines · Weijie Gao
Quoted 3 lines · Simon Glass
Hi,
On 14 November 2018 at 18:07, Ryder Lee <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
From: Weijie Gao <[email protected]>
This adds a general board file based on MT7623 SoCs from
MediaTek.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
As this u-boot is loaded by MTK proprietary preloader, there is
no
Quoted 14 lines
Quoted 14 lines
Quoted 9 lines
low level initializtion codes.
Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>---
Changes since v5: None
Changes since v4:
-Addgd->bd->bi_boot_paramsfor legacy method - ATAGs.Quoted 5 lines
--- arch/arm/mach-mediatek/Kconfig | 13 ++++ arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mt7623/Makefile | 4 ++ arch/arm/mach-mediatek/mt7623/init.c | 54+++++++++++++++
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 ++++++ arch/arm/mach-mediatek/mt7623/preloader.h | 99+++++++++++++++++++++++++++
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
board/mediatek/mt7623/Kconfig | 13 ++++ board/mediatek/mt7623/MAINTAINERS | 7 ++ board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 +++++ configs/mt7623n_bpir2_defconfig | 54+++++++++++++++
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/configs/mt7623.h | 56+++++++++++++++
Quoted 19 lines
Quoted 12 lines
Quoted 11 lines
12 files changed, 342 insertions(+) create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.c create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 include/configs/mt7623.hQuoted 6 lines
Can this use the bloblist feature which should land soon?
For now, see dm/spl-working.
Regards,
SimonQuoted 6 lines
Hi Simon,
I've read the code for spl handoff. It's a good way though but unfortunately it cannot be applied to the MT7623 boards.
The reason is that MT7623 uses a MediaTek proprietary preloader
which
Quoted 2 lines
has the same function as the U-Boot SPL. But the preloader is close-sourced (by company policy) and only available in binary
release.
Quoted 1 line
This means we can't use a real U-Boot SPL to replace the preloader.
Can you work to get U-Boot SPL running on the chip?
What is the reason for the proprietary SPL?
Quoted 2 lines
At present this chip has already been used in many products. We
can't
Quoted 2 lines
either release a different preloader which introduces compatibility issues.
What sort of compatibility issues? I cannot see any advantage with a proprietary SPL.
Quoted 1 line
Quoted 7 lines
Quoted 1 line
So the conclusion is that we cannot use the bloblist feature for
this
Quoted 1 line
SoC.
Regards,
SimonHi Simon,
Sorry for that I didn't describe the function of the preloader clearly.
The MT7623 is like a smart phone SoC which has the ability to upgrade bootloader/firmware via a USB cable. This function is always available even if there is no valid preloader/bootloader.
This is done by cooperation of the BootROM and preloader. This is a simple description of the flow:
1. Connect the MT7623 board to the PC using USB cable. Do not power up.
2. Run MediaTek's FlashTool and start downloading.
3. Power up the board.
4. The BootROM will initialize the USB device immediately for few seconds and waiting for commands from PC.
5. The PC will start transmit commands to the board as soon as it detects the board device.
6. Thee BootROM will then download the preloader into SRAM, and run it. Several informations will be passed to the preloader, to let it continue to communicate with the FlashTool.
7. The preloader will initialize the DRAM, download data via USB and write it to flash.So the preloader is not only a simple SPL. It initializes DRAM and many other components which will only be initialized once or used by preloader. It also performs USB downloading and other things.
The preloader is also used by other MediaTek's smart phone SoCs. The DRAM initialization code is the mainly part that are not allowed to be open-sourced.
The preloader has so many functions which are not easy to port to the U-Boot SPL.
Assume all the codes are allowed to be open sourced.If all the functions are ported to SPL, the DM must be used in SPL, which will make the SPL binary too large to fit in the SRAM.If only the necessary parts are ported (e.g. DRAM initialization), the SPL will be incompatible with the BootROM and the FlashTool and the users will be in trouble recovering a board.
Quoted 6 lines
At present the preloader can be downloaded from the Internet. Users can concentrate on the development without managing the low level parts.
BTW, there are also chips use U-Boot as a second/third bootloader while using their proprietary binary as the first stage bootloader. For example the bcm7xxx.
Thank you for your detailed explanation. I am not so concerned about the short-term solution or older chips.
A few questions:
1. Why can you not open-source the DRAM init code?
2. You don't need to enable DM in SPL if that makes the size too big.
This actually doesn't sound so different from the Rockchip situation, and there it has been possible to have an open-source SPL. In fact it does use DM although on some boards it uses of-platdata to remove device-tree size. From the high quality of your patches it doesn't seem like your team would need any help to do this, but I am happy to help if that is useful.
Anyway, we can go ahead with what you have and hopefully resolve this in the future.
Regards,
Simon
PATCH v5 5/18 arm: MediaTek: add basic support for MT7623 boards
Hi Simon,
Quoted 162 lines · Simon Glass
Hi Weijie,
Quoted 137 lines · Weijie Gao
Quoted 87 lines · Simon Glass
Hi Weijie,
Quoted 4 lines · Weijie Gao
Quoted 3 lines · Simon Glass
Hi,
On 14 November 2018 at 18:07, Ryder Lee <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
From: Weijie Gao <[email protected]>
This adds a general board file based on MT7623 SoCs from
MediaTek.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
As this u-boot is loaded by MTK proprietary preloader, there is
no
Quoted 14 lines
Quoted 14 lines
Quoted 9 lines
low level initializtion codes.
Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>---
Changes since v5: None
Changes since v4:
-Addgd->bd->bi_boot_paramsfor legacy method - ATAGs.Quoted 5 lines
--- arch/arm/mach-mediatek/Kconfig | 13 ++++ arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mt7623/Makefile | 4 ++ arch/arm/mach-mediatek/mt7623/init.c | 54+++++++++++++++
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 ++++++ arch/arm/mach-mediatek/mt7623/preloader.h | 99+++++++++++++++++++++++++++
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
board/mediatek/mt7623/Kconfig | 13 ++++ board/mediatek/mt7623/MAINTAINERS | 7 ++ board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 +++++ configs/mt7623n_bpir2_defconfig | 54+++++++++++++++
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/configs/mt7623.h | 56+++++++++++++++
Quoted 19 lines
Quoted 12 lines
Quoted 11 lines
12 files changed, 342 insertions(+) create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.c create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 include/configs/mt7623.hQuoted 6 lines
Can this use the bloblist feature which should land soon?
For now, see dm/spl-working.
Regards,
SimonQuoted 6 lines
Hi Simon,
I've read the code for spl handoff. It's a good way though but unfortunately it cannot be applied to the MT7623 boards.
The reason is that MT7623 uses a MediaTek proprietary preloader
which
Quoted 2 lines
has the same function as the U-Boot SPL. But the preloader is close-sourced (by company policy) and only available in binary
release.
Quoted 1 line
This means we can't use a real U-Boot SPL to replace the preloader.
Can you work to get U-Boot SPL running on the chip?
What is the reason for the proprietary SPL?
Quoted 2 lines
At present this chip has already been used in many products. We
can't
Quoted 2 lines
either release a different preloader which introduces compatibility issues.
What sort of compatibility issues? I cannot see any advantage with a proprietary SPL.
Quoted 1 line
Quoted 7 lines
Quoted 1 line
So the conclusion is that we cannot use the bloblist feature for
this
Quoted 1 line
SoC.
Regards,
SimonHi Simon,
Sorry for that I didn't describe the function of the preloader clearly.
The MT7623 is like a smart phone SoC which has the ability to upgrade bootloader/firmware via a USB cable. This function is always available even if there is no valid preloader/bootloader.
This is done by cooperation of the BootROM and preloader. This is a simple description of the flow:
1. Connect the MT7623 board to the PC using USB cable. Do not power up.
2. Run MediaTek's FlashTool and start downloading.
3. Power up the board.
4. The BootROM will initialize the USB device immediately for few seconds and waiting for commands from PC.
5. The PC will start transmit commands to the board as soon as it detects the board device.
6. Thee BootROM will then download the preloader into SRAM, and run it. Several informations will be passed to the preloader, to let it continue to communicate with the FlashTool.
7. The preloader will initialize the DRAM, download data via USB and write it to flash.So the preloader is not only a simple SPL. It initializes DRAM and many other components which will only be initialized once or used by preloader. It also performs USB downloading and other things.
The preloader is also used by other MediaTek's smart phone SoCs. The DRAM initialization code is the mainly part that are not allowed to be open-sourced.
The preloader has so many functions which are not easy to port to the U-Boot SPL.
Assume all the codes are allowed to be open sourced.If all the functions are ported to SPL, the DM must be used in SPL, which will make the SPL binary too large to fit in the SRAM.If only the necessary parts are ported (e.g. DRAM initialization), the SPL will be incompatible with the BootROM and the FlashTool and the users will be in trouble recovering a board.Quoted 6 lines
At present the preloader can be downloaded from the Internet. Users can concentrate on the development without managing the low level parts.
BTW, there are also chips use U-Boot as a second/third bootloader while using their proprietary binary as the first stage bootloader. For example the bcm7xxx.
Thank you for your detailed explanation. I am not so concerned about the short-term solution or older chips.
A few questions:
1. Why can you not open-source the DRAM init code?
2. You don't need to enable DM in SPL if that makes the size too big.This actually doesn't sound so different from the Rockchip situation, and there it has been possible to have an open-source SPL. In fact it does use DM although on some boards it uses of-platdata to remove device-tree size. From the high quality of your patches it doesn't seem like your team would need any help to do this, but I am happy to help if that is useful.
Quoted 7 lines
Anyway, we can go ahead with what you have and hopefully resolve this in the future.
Reviewed-by Simon Glass <[email protected]>Regards,
Simon
For the first question, it's not only about the dram init codes. MT7623 used many components from a smart phone chip, which contains many security mechanisms like anti-debug and anti-clone which is protected by the company. The preloader will initialize them thus make it unable to be open-sourced.
For the rest questions, yes we always have ways to implement an source-source SPL to replace the preloader if at least essential source codes can be opened. The MT7623 actually uses technologies from old chips (e.g. the USB download). Current design can let the users upgrade their old u-boot seamlessly. For our newly designed chips, such as the MT7629 in this patch series, the SPL has already been used to replace the preloader. We removed USB download and other unnecessary parts and used full u-boot from the beginning. There is no compatibility issue for this chip.
And again we thank for your kind help.
Sincerely,
Weijie
PATCH v5 5/18 arm: MediaTek: add basic support for MT7623 boards
Hi Weijie,
Quoted 175 lines · Weijie Gao
Hi Simon,
Quoted 162 lines · Simon Glass
Hi Weijie,
Quoted 137 lines · Weijie Gao
Quoted 87 lines · Simon Glass
Hi Weijie,
Quoted 4 lines · Weijie Gao
Quoted 3 lines · Simon Glass
Hi,
On 14 November 2018 at 18:07, Ryder Lee <[email protected]>
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
From: Weijie Gao <[email protected]>
This adds a general board file based on MT7623 SoCs from
MediaTek.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
As this u-boot is loaded by MTK proprietary preloader, there is
no
Quoted 14 lines
Quoted 14 lines
Quoted 9 lines
low level initializtion codes.
Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>---
Changes since v5: None
Changes since v4:
-Addgd->bd->bi_boot_paramsfor legacy method - ATAGs.Quoted 5 lines
--- arch/arm/mach-mediatek/Kconfig | 13 ++++ arch/arm/mach-mediatek/Makefile | 1 + arch/arm/mach-mediatek/mt7623/Makefile | 4 ++ arch/arm/mach-mediatek/mt7623/init.c | 54+++++++++++++++
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
arch/arm/mach-mediatek/mt7623/lowlevel_init.S | 22 ++++++ arch/arm/mach-mediatek/mt7623/preloader.h | 99+++++++++++++++++++++++++++
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
board/mediatek/mt7623/Kconfig | 13 ++++ board/mediatek/mt7623/MAINTAINERS | 7 ++ board/mediatek/mt7623/Makefile | 3 + board/mediatek/mt7623/mt7623_rfb.c | 16 +++++ configs/mt7623n_bpir2_defconfig | 54+++++++++++++++
Quoted 1 line
Quoted 1 line
Quoted 1 line
include/configs/mt7623.h | 56+++++++++++++++
Quoted 19 lines
Quoted 12 lines
Quoted 11 lines
12 files changed, 342 insertions(+) create mode 100644 arch/arm/mach-mediatek/mt7623/Makefile create mode 100644 arch/arm/mach-mediatek/mt7623/init.c create mode 100644 arch/arm/mach-mediatek/mt7623/lowlevel_init.S create mode 100644 arch/arm/mach-mediatek/mt7623/preloader.h create mode 100644 board/mediatek/mt7623/Kconfig create mode 100644 board/mediatek/mt7623/MAINTAINERS create mode 100644 board/mediatek/mt7623/Makefile create mode 100644 board/mediatek/mt7623/mt7623_rfb.c create mode 100644 configs/mt7623n_bpir2_defconfig create mode 100644 include/configs/mt7623.hQuoted 6 lines
Can this use the bloblist feature which should land soon?
For now, see dm/spl-working.
Regards,
SimonQuoted 6 lines
Hi Simon,
I've read the code for spl handoff. It's a good way though but unfortunately it cannot be applied to the MT7623 boards.
The reason is that MT7623 uses a MediaTek proprietary preloader
which
Quoted 2 lines
has the same function as the U-Boot SPL. But the preloader is close-sourced (by company policy) and only available in binary
release.
Quoted 1 line
This means we can't use a real U-Boot SPL to replace the preloader.
Can you work to get U-Boot SPL running on the chip?
What is the reason for the proprietary SPL?
Quoted 2 lines
At present this chip has already been used in many products. We
can't
Quoted 2 lines
either release a different preloader which introduces compatibility issues.
What sort of compatibility issues? I cannot see any advantage with a proprietary SPL.
Quoted 1 line
Quoted 7 lines
Quoted 1 line
So the conclusion is that we cannot use the bloblist feature for
this
Quoted 1 line
SoC.
Regards,
SimonHi Simon,
Sorry for that I didn't describe the function of the preloader clearly.
The MT7623 is like a smart phone SoC which has the ability to upgrade bootloader/firmware via a USB cable. This function is always available even if there is no valid preloader/bootloader.
This is done by cooperation of the BootROM and preloader. This is a simple description of the flow:
1. Connect the MT7623 board to the PC using USB cable. Do not power up.
2. Run MediaTek's FlashTool and start downloading.
3. Power up the board.
4. The BootROM will initialize the USB device immediately for few seconds and waiting for commands from PC.
5. The PC will start transmit commands to the board as soon as it detects the board device.
6. Thee BootROM will then download the preloader into SRAM, and run it. Several informations will be passed to the preloader, to let it continue to communicate with the FlashTool.
7. The preloader will initialize the DRAM, download data via USB and write it to flash.So the preloader is not only a simple SPL. It initializes DRAM and many other components which will only be initialized once or used by preloader. It also performs USB downloading and other things.
The preloader is also used by other MediaTek's smart phone SoCs. The DRAM initialization code is the mainly part that are not allowed to be open-sourced.
The preloader has so many functions which are not easy to port to the U-Boot SPL.
Assume all the codes are allowed to be open sourced.If all the functions are ported to SPL, the DM must be used in SPL, which will make the SPL binary too large to fit in the SRAM.If only the necessary parts are ported (e.g. DRAM initialization), the SPL will be incompatible with the BootROM and the FlashTool and the users will be in trouble recovering a board.Quoted 6 lines
At present the preloader can be downloaded from the Internet. Users can concentrate on the development without managing the low level parts.
BTW, there are also chips use U-Boot as a second/third bootloader while using their proprietary binary as the first stage bootloader. For example the bcm7xxx.
Thank you for your detailed explanation. I am not so concerned about the short-term solution or older chips.
A few questions:
1. Why can you not open-source the DRAM init code?
2. You don't need to enable DM in SPL if that makes the size too big.This actually doesn't sound so different from the Rockchip situation, and there it has been possible to have an open-source SPL. In fact it does use DM although on some boards it uses of-platdata to remove device-tree size. From the high quality of your patches it doesn't seem like your team would need any help to do this, but I am happy to help if that is useful.
Quoted 7 lines
Anyway, we can go ahead with what you have and hopefully resolve this in the future.
Reviewed-by Simon Glass <[email protected]>Regards,
Simon
Quoted 5 lines
For the first question, it's not only about the dram init codes. MT7623 used many components from a smart phone chip, which contains many security mechanisms like anti-debug and anti-clone which is protected by the company. The preloader will initialize them thus make it unable to be open-sourced.
I do feel this is confusing obscurity with security. If the system is secure then it can be open-source. In fact it is probably better that way (more eyes).
Quoted 10 lines
For the rest questions, yes we always have ways to implement an source-source SPL to replace the preloader if at least essential source codes can be opened. The MT7623 actually uses technologies from old chips (e.g. the USB download). Current design can let the users upgrade their old u-boot seamlessly. For our newly designed chips, such as the MT7629 in this patch series, the SPL has already been used to replace the preloader. We removed USB download and other unnecessary parts and used full u-boot from the beginning. There is no compatibility issue for this chip.
I think you can start with a basic U-Boot SPL and add features over time.
Quoted 2 lines
And again we thank for your kind help.
You are welcome. I encourage you to upstream more MediaTek platforms.
Regards,
Simon
PATCH v5 1/18 tools: MediaTek: add MTK boot header generation to mkimage
In reply to Ryder LeeQuoted 5 lines · Ryder Lee
This patch adds support for MTK boot image generation.
Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Reviewed-by Simon Glass <[email protected]>
[snip]
Quoted 24 lines
Makefile +9
-0@@ -852,6 +852,8 @@ ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin endif +ALL-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin + # Add optional build target if defined in board/cpu/soc headers ifneq ($(CONFIG_BUILD_TARGET),) ALL-y += $(CONFIG_BUILD_TARGET:"%"=%)@@ -1359,6 +1361,24 @@ u-boot.elf: u-boot.bin $(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o $(call if_changed,u-boot-elf) +# 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. + +ifeq ($(CONFIG_SPL),y)
Makefile u-boot.elf: u-boot.bin · line 1380
Quoted 10 lines
Makefile +10
-0+u-boot-mtk.bin: u-boot.dtb u-boot.img spl/u-boot-spl-mtk.bin FORCE + $(call if_changed,binman) +else +MKIMAGEFLAGS_u-boot-mtk.bin = -T mtk_image \ + -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) +endif
This doesn't build for me. With the whole series applied:
$ ./tools/buildman/buildman -dvel mediatek
boards.cfg is up to date. Nothing to do.
Building current source for 2 boards (2 threads, 8 jobs per thread)
arm: + mt7629_rfb
+(mt7629_rfb) make[1]: *** No rule to make target 'spl/u-boot-spl-mtk.bin', needed by 'u-boot-mtk.bin'. Stop.
+(mt7629_rfb) make: *** [sub-make] Error 2
1 0 1 /2 mt7623n_bpir2Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181126/6750fc8c/attachment.sig>
PATCH v5 1/18 tools: MediaTek: add MTK boot header generation to mkimage
Hi Tom,
Quoted 49 lines · Tom Rini
Quoted 5 lines · Ryder Lee
This patch adds support for MTK boot image generation.
Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Reviewed-by Simon Glass <[email protected]>[snip]
Quoted 24 lines
Makefile +9
-0@@ -852,6 +852,8 @@ ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin ALL-$(CONFIG_OF_SEPARATE) += u-boot-dtb-tegra.bin endif +ALL-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin + # Add optional build target if defined in board/cpu/soc headers ifneq ($(CONFIG_BUILD_TARGET),) ALL-y += $(CONFIG_BUILD_TARGET:"%"=%)@@ -1359,6 +1361,24 @@ u-boot.elf: u-boot.bin $(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o $(call if_changed,u-boot-elf) +# 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. + +ifeq ($(CONFIG_SPL),y)Makefile u-boot.elf: u-boot.bin · line 1380
Quoted 10 lines
Makefile +10
-0+u-boot-mtk.bin: u-boot.dtb u-boot.img spl/u-boot-spl-mtk.bin FORCE + $(call if_changed,binman) +else +MKIMAGEFLAGS_u-boot-mtk.bin = -T mtk_image \ + -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) +endifThis doesn't build for me. With the whole series applied:
$ ./tools/buildman/buildman -dvel mediatek boards.cfg is up to date. Nothing to do. Building current source for 2 boards (2 threads, 8 jobs per thread) arm: + mt7629_rfb
Review
Quoted 3 lines
(quoted diff) +2
-0+(mt7629_rfb) make[1]: *** No rule to make target 'spl/u-boot-spl-mtk.bin', needed by 'u-boot-mtk.bin'. Stop. +(mt7629_rfb) make: *** [sub-make] Error 2 1 0 1 /2 mt7623n_bpir2
We've sent a fixup:
https://patchwork.ozlabs.org/patch/1003602/
Could you help to fold this patch in?
Ryder
PATCH v5 1/18 tools: MediaTek: add MTK boot header generation to mkimage
In reply to Ryder LeeQuoted 5 lines · Ryder Lee
This patch adds support for MTK boot image generation.
Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/c5a26ec1/attachment.sig>
PATCH v5 2/18 arm: dts: MediaTek: add device tree for MT7629
In reply to Ryder LeeQuoted 4 lines · Ryder Lee
This patch adds MT7629 device tree and the includes it needs.
Signed-off-by Ryder Lee <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/521093a0/attachment.sig>
PATCH v5 3/18 arm: dts: MediaTek: add device tree for MT7623
In reply to Ryder LeeQuoted 7 lines · Ryder Lee
This adds device tree for MT7623 development board - Bananapi R2 Detailed hardware information for BPI-R2 which could be found on
http://wiki.banana-pi.org/Banana_Pi_BPI-R2.Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/2f0ac909/attachment.sig>
PATCH v5 4/18 arm: MediaTek: add basic support for MT7629 boards
In reply to Ryder LeeQuoted 8 lines · Ryder Lee
This adds a general board file based on MT7629 SoCs from MediaTek.
Apart from the generic parts (cpu) we add some low level init codes and initialize the early clocks.
Signed-off-by Ryder Lee <[email protected]>Signed-off-by Weijie Gao <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/e5adba29/attachment.sig>
PATCH v5 5/18 arm: MediaTek: add basic support for MT7623 boards
In reply to Ryder LeeQuoted 11 lines · Ryder Lee
From: Weijie Gao <[email protected]>
This adds a general board file based on MT7623 SoCs from MediaTek.
As this u-boot is loaded by MTK proprietary preloader, there is no low level initializtion codes.
Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/53c17dfb/attachment.sig>
PATCH v5 6/18 clk: MediaTek: add clock driver for MT7629 SoC.
In reply to Ryder LeeQuoted 4 lines · Ryder Lee
This patch adds clock modules for MediaTek SoCs:
- Shared part: a common driver which contains the general operations for plls, muxes, dividers and gates so that we can reuse it in future.
Quoted 8 lines
- Specific SoC part: the group of structures used to hold the hardware configuration for each SoC.
We take MT7629 as an example to demonstrate how to implement driver if any other MediaTek chips would like to use it.
Signed-off-by Ryder Lee <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/49ba17cb/attachment.sig>
PATCH v5 7/18 clk: MediaTek: add clock driver for MT7623 SoC.
In reply to Ryder LeeQuoted 5 lines · Ryder Lee
This patch adds a driver for MT7623 clock blocks.
Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/93bce3a7/attachment.sig>
PATCH v5 8/18 timer: MediaTek: add timer driver for MediaTek SoCs
In reply to Ryder LeeQuoted 6 lines · Ryder Lee
This patch adds clock source and clock event for the timer found on the Mediatek SoCs.
Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/eb3108b0/attachment.sig>
PATCH v5 9/18 watchdog: MediaTek: add watchdog driver for MediaTek SoCs
In reply to Ryder LeeQuoted 6 lines · Ryder Lee
This patch adds a common driver for the Mediatek SoC integrated watchdog.
Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/9a2a66df/attachment.sig>
PATCH v5 10/18 pinctrl: MediaTek: add pinctrl driver for MT7629 SoC
In reply to Ryder LeeQuoted 11 lines · Ryder Lee
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.
Signed-off-by Ryder Lee <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/39fc1913/attachment.sig>
PATCH v5 11/18 pinctrl: MediaTek: add pinctrl driver for MT7623 SoC
In reply to Ryder LeeQuoted 7 lines · Ryder Lee
This patch adds pinctrl support for MT7623 SoC. And most of the structures are used to hold the hardware configuration for each pin.
Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/e592a6de/attachment.sig>
PATCH v5 12/18 power domain: MediaTek: add power domain driver for MT7629 SoC
In reply to Ryder LeeQuoted 8 lines · Ryder Lee
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.
Quoted 4 lines
For now this driver only adds power domain support.
Signed-off-by Ryder Lee <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/3789c42f/attachment.sig>
PATCH v5 13/18 power domain: MediaTek: add power domain driver for MT7623 SoC
In reply to Ryder LeeQuoted 4 lines · Ryder Lee
This adds power domain (scpsys) support for MT7623 SoC.
Signed-off-by Ryder Lee <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/47958927/attachment.sig>
PATCH v5 14/18 serial: MediaTek: add high-speed uart driver for MediaTek SoCs
In reply to Ryder LeeQuoted 11 lines · Ryder Lee
Many SoCs from MediaTek have a high-speed uart. This UART is compatible with the ns16550 in legacy mode. It has extra registers for high-speed mode which can reach a maximum baudrate at 921600.
However this UART will no longer be compatible if it's in high-speed mode. Some BootROM of MediaTek's SoCs will change the UART into high-speed mode and the U-Boot must use this driver to initialize the UART.
Signed-off-by Weijie Gao <[email protected]>Tested-by Ryder Lee <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/be64651d/attachment.sig>
PATCH v5 15/18 ram: MediaTek: add DDR3 driver for MT7629 SoC
In reply to Ryder LeeQuoted 5 lines · Ryder Lee
This patch adds a DDR3 driver for MT7629 SoC.
Signed-off-by Wu Zou <[email protected]>Signed-off-by Ryder Lee <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/dca0bae3/attachment.sig>
PATCH v5 16/18 mmc: mtk-sd: add SD/MMC host controller driver for MT7623 SoC
In reply to Ryder LeeQuoted 9 lines · Ryder Lee
From: Weijie Gao <[email protected]>
This patch adds MT7623 host controller driver for accessing SD/MMC.
Cc Jaehoon Chung <[email protected]>Signed-off-by Weijie Gao <[email protected]>Signed-off-by Ryder Lee <[email protected]>Tested-by Matthias Brugger <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/28f2f4fe/attachment.sig>
PATCH v5 17/18 doc: README.mediatek: Add a simple README for MediaTek
In reply to Ryder LeeQuoted 5 lines · Ryder Lee
Add a few notes on how to try out the MediaTek support so far.
Signed-off-by Ryder Lee <[email protected]>Tested-by Frank Wunderlich <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/506c8130/attachment.sig>
PATCH v5 18/18 MAINTAINERS: add an entry for MediaTek
In reply to Ryder LeeQuoted 4 lines · Ryder Lee
This patch adds an entry for MediaTek.
Signed-off-by Ryder Lee <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181129/de7954b0/attachment.sig>