From patchwork Thu Nov 12 08:35:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?V2VpamllIEdhbyAo6auY5oOf5p2wKQ==?= X-Patchwork-Id: 1398751 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=mediatek.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.a=rsa-sha256 header.s=dk header.b=oF+DnRi/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CWw0q5rxKz9s0b for ; Thu, 12 Nov 2020 19:35:55 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 726938253B; Thu, 12 Nov 2020 09:35:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=mediatek.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.b="oF+DnRi/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3AC958250A; Thu, 12 Nov 2020 09:35:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MIME_BASE64_TEXT,RDNS_NONE,SPF_HELO_NONE, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from mailgw01.mediatek.com (unknown [1.203.163.78]) by phobos.denx.de (Postfix) with ESMTP id C95F980404 for ; Thu, 12 Nov 2020 09:35:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=mediatek.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=weijie.gao@mediatek.com X-UUID: 901c51bf026d407ba75ac7008a5c5dc1-20201112 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=IMtNLDnOZZzHntzZdimvm32UylRQ7/NQ1NGmhBnl/2U=; b=oF+DnRi/aldgvrn87iw1JeVkmwFZu+GT5bjkMw7443XIDIQ6HG0XpZaVcbUdegBKgxnd2NjLiFdSLcWK3umFZD9UR4bHWJFMqTjvATgdY3zSxgp3UFF89Ov+LwTd7cPJyWO8CtRHPBz4IqEKSSZm1SLt9Hl3Rf2Oo0TvlH3ojOE=; X-UUID: 901c51bf026d407ba75ac7008a5c5dc1-20201112 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 89377646; Thu, 12 Nov 2020 16:35:16 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Nov 2020 16:35:13 +0800 Received: from mcddlt001.mediatek.inc (10.19.240.15) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 12 Nov 2020 16:35:13 +0800 From: Weijie Gao To: CC: GSS_MTK_Uboot_upstream , Daniel Schwierzeck , Stefan Roese , Stefan Roese , Weijie Gao Subject: [PATCH v4 00/23] Add support for MediaTek MT7620 SoC - v4 Date: Thu, 12 Nov 2020 16:35:12 +0800 Message-ID: X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-TM-SNTS-SMTP: A4330388772F864DE4ED186D7C3B91DCADE83B46F3E229F754186A8D7B5AB3322000:8 X-MTK: N X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This series will add support for MediaTek MT7620 SoC with two reference boards and related drivers. The MediaTek MT7620 is a 2x2 802.11n WiSoC integrating a MIPS 24KEc processor running at a maximum frequency of 620MHz. This chip can be found in many wireless routers. This series add all basic drivers which are useful in u-boot, like usb, sdhc, ethernet, spi and serial. Booting from NAND is currently unsupported. Thanks, Weijie v4 changes: - Remove unused code in drivers/serial/serial.c - Fix plat->cfg.f_max of mtk-sd driver v3 changes: - Use bool instead of int in for mt7620_spi_set_cs() mt7620_spi.c - Add detail comments for mt7620_wdt_expire_now() in mt7620_wdt.c - Remove duplicated dev field in mt7620-usb-phy.c - Add fixes for mtk-sd (fix sclk cycles shift value, assign plat->cfg.f_max) v2 changes: - Remove non-DM code from mt7620-serial driver, and use of-platdata instead - Fix dev_err related compilation error - Add expire_now for mt7620-wdt - Remove use of common.h Weijie Gao (23): mips: dts: switch to board defines for dtb for mtmips mips: mtmips: move mt7628 related Kconfig into mt7628 subdirectory mips: mtmips: select SYSRESET for mt7628 only mips: mtmips: fix dram size detection in dram_init mips: enable _machine_restart for spl mips: mtmips: add support to initialize SDRAM mips: mtmips: add support for MediaTek MT7620 SoC mips: mtmips: add two reference boards for mt7620 configs: mtmips: refresh for mt7628 based boards serial: add uart driver for MediaTek MT7620 SoC clk: add clock driver for MediaTek MT7620 SoC reset: mtmips: add reset controller support for MediaTek MT7620 SoC pinctrl: mtmips: add support for MediaTek MT7620 SoC watchdog: add watchdog driver for MediaTek MT7620 SoC gpio: add GPIO controller driver for MediaTek MT7620 SoC spi: add spi controller support for MediaTek MT7620 SoC phy: add USB PHY driver for MediaTek MT7620 SoC net: add ethernet driver for MediaTek MT7620 SoC mmc: mtk-sd: fix sclk cycles shift value mmc: mtk-sd: add pad control settings for MediaTek MT7620/MT76x8 SoCs mmc: mtk-sd: assign plat->cfg.f_max with a correct value reset: reset-mtmips: add DM_FLAG_PRE_RELOC flag MAINTAINERS: add maintainer for MediaTek MIPS platform MAINTAINERS | 23 + arch/mips/Kconfig | 1 - arch/mips/cpu/cpu.c | 2 +- arch/mips/dts/Makefile | 7 +- arch/mips/dts/mediatek,mt7620-mt7530-rfb.dts | 100 ++ arch/mips/dts/mediatek,mt7620-rfb.dts | 97 ++ arch/mips/dts/mt7620-u-boot.dtsi | 14 + arch/mips/dts/mt7620.dtsi | 296 ++++ arch/mips/mach-mtmips/Kconfig | 72 +- arch/mips/mach-mtmips/Makefile | 1 + arch/mips/mach-mtmips/cpu.c | 5 +- arch/mips/mach-mtmips/ddr_init.c | 59 + arch/mips/mach-mtmips/include/mach/ddr.h | 4 + .../mach-mtmips/include/mach/mt7620-sysc.h | 54 + arch/mips/mach-mtmips/mt7620/Kconfig | 71 + arch/mips/mach-mtmips/mt7620/Makefile | 10 + arch/mips/mach-mtmips/mt7620/dram.c | 113 ++ arch/mips/mach-mtmips/mt7620/init.c | 193 +++ arch/mips/mach-mtmips/mt7620/lowlevel_init.S | 53 + arch/mips/mach-mtmips/mt7620/mt7620.h | 103 ++ arch/mips/mach-mtmips/mt7620/serial.c | 36 + arch/mips/mach-mtmips/mt7620/sysc.c | 172 +++ arch/mips/mach-mtmips/mt7628/Kconfig | 53 + board/mediatek/mt7620/Kconfig | 12 + board/mediatek/mt7620/MAINTAINERS | 9 + board/mediatek/mt7620/Makefile | 3 + board/mediatek/mt7620/board.c | 6 + .../gardena-smart-gateway-mt7688_defconfig | 1 + configs/linkit-smart-7688_defconfig | 1 + configs/mt7620_mt7530_rfb_defconfig | 58 + configs/mt7620_rfb_defconfig | 76 + configs/mt7628_rfb_defconfig | 1 + configs/vocore2_defconfig | 1 + drivers/clk/mtmips/Makefile | 1 + drivers/clk/mtmips/clk-mt7620.c | 159 +++ drivers/gpio/Kconfig | 8 + drivers/gpio/Makefile | 1 + drivers/gpio/mt7620_gpio.c | 146 ++ drivers/mmc/mtk-sd.c | 136 +- drivers/net/Kconfig | 12 + drivers/net/Makefile | 1 + drivers/net/mt7620-eth.c | 1222 +++++++++++++++++ drivers/phy/Kconfig | 7 + drivers/phy/Makefile | 1 + drivers/phy/mt7620-usb-phy.c | 110 ++ drivers/pinctrl/mtmips/Kconfig | 9 + drivers/pinctrl/mtmips/Makefile | 1 + drivers/pinctrl/mtmips/pinctrl-mt7620.c | 200 +++ drivers/reset/reset-mtmips.c | 1 + drivers/serial/Kconfig | 20 + drivers/serial/Makefile | 1 + drivers/serial/serial_mt7620.c | 246 ++++ drivers/spi/Kconfig | 7 + drivers/spi/Makefile | 1 + drivers/spi/mt7620_spi.c | 281 ++++ drivers/watchdog/Kconfig | 7 + drivers/watchdog/Makefile | 1 + drivers/watchdog/mt7620_wdt.c | 142 ++ include/configs/mt7620.h | 46 + include/dt-bindings/clock/mt7620-clk.h | 40 + include/dt-bindings/reset/mt7620-reset.h | 35 + 61 files changed, 4477 insertions(+), 72 deletions(-) create mode 100644 arch/mips/dts/mediatek,mt7620-mt7530-rfb.dts create mode 100644 arch/mips/dts/mediatek,mt7620-rfb.dts create mode 100644 arch/mips/dts/mt7620-u-boot.dtsi create mode 100644 arch/mips/dts/mt7620.dtsi create mode 100644 arch/mips/mach-mtmips/include/mach/mt7620-sysc.h create mode 100644 arch/mips/mach-mtmips/mt7620/Kconfig create mode 100644 arch/mips/mach-mtmips/mt7620/Makefile create mode 100644 arch/mips/mach-mtmips/mt7620/dram.c create mode 100644 arch/mips/mach-mtmips/mt7620/init.c create mode 100644 arch/mips/mach-mtmips/mt7620/lowlevel_init.S create mode 100644 arch/mips/mach-mtmips/mt7620/mt7620.h create mode 100644 arch/mips/mach-mtmips/mt7620/serial.c create mode 100644 arch/mips/mach-mtmips/mt7620/sysc.c create mode 100644 arch/mips/mach-mtmips/mt7628/Kconfig create mode 100644 board/mediatek/mt7620/Kconfig create mode 100644 board/mediatek/mt7620/MAINTAINERS create mode 100644 board/mediatek/mt7620/Makefile create mode 100644 board/mediatek/mt7620/board.c create mode 100644 configs/mt7620_mt7530_rfb_defconfig create mode 100644 configs/mt7620_rfb_defconfig create mode 100644 drivers/clk/mtmips/clk-mt7620.c create mode 100644 drivers/gpio/mt7620_gpio.c create mode 100644 drivers/net/mt7620-eth.c create mode 100644 drivers/phy/mt7620-usb-phy.c create mode 100644 drivers/pinctrl/mtmips/pinctrl-mt7620.c create mode 100644 drivers/serial/serial_mt7620.c create mode 100644 drivers/spi/mt7620_spi.c create mode 100644 drivers/watchdog/mt7620_wdt.c create mode 100644 include/configs/mt7620.h create mode 100644 include/dt-bindings/clock/mt7620-clk.h create mode 100644 include/dt-bindings/reset/mt7620-reset.h