From patchwork Fri Feb 21 13:01:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Shih X-Patchwork-Id: 1242081 X-Patchwork-Delegate: trini@ti.com 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=DBv/nyg4; 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48PBT24zy6z9sSK for ; Sat, 22 Feb 2020 00:02:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 100D181964; Fri, 21 Feb 2020 14:02:22 +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="DBv/nyg4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5FE9281965; Fri, 21 Feb 2020 14:02:17 +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 [210.61.82.183]) by phobos.denx.de (Postfix) with ESMTP id 9D5E18192E for ; Fri, 21 Feb 2020 14:02:10 +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=sam.shih@mediatek.com X-UUID: d25e2f16f0934c149f01b689d56fb968-20200221 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:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=SAwhPnFVSYvuYk8eXHPYOEI/UG6ndQV6TtnPFzfUN58=; b=DBv/nyg4yIahrU8cxKlHr34NQES2RcwoeNdrSkwgX1elyI+S2gzgQPyBRzAGwV4xfp79OB/+O1y4ARj7f6zkycW4v6hpaGjDWPH6zCaMLvohtmkZBb6pvH1ajfgfc2utGIDrP9PCyrZRtQHTWPPo2Zoo5hYpR+47NCTBP7I+be0=; X-UUID: d25e2f16f0934c149f01b689d56fb968-20200221 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 495129673; Fri, 21 Feb 2020 21:02:08 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 21 Feb 2020 21:01:13 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 21 Feb 2020 21:01:23 +0800 From: Sam Shih To: Tom Rini CC: , Ryder Lee , GSS_MTK_Uboot_upstream , Frank Wunderlich , Sam Shih Subject: [PATCH 1/3] mediatek: pwm: add pwm driver for MediaTek SoCs Date: Fri, 21 Feb 2020 21:01:46 +0800 Message-ID: <1582290108-3234-2-git-send-email-sam.shih@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1582290108-3234-1-git-send-email-sam.shih@mediatek.com> References: <1582290108-3234-1-git-send-email-sam.shih@mediatek.com> MIME-Version: 1.0 X-MTK: N X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean This driver support the standard PWM API for MediaTek MT7623, MT7622 and MT7629 SoCs Signed-off-by: Sam Shih --- drivers/pwm/Kconfig | 7 ++ drivers/pwm/Makefile | 1 + drivers/pwm/pwm-mtk.c | 188 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 196 insertions(+) create mode 100644 drivers/pwm/pwm-mtk.c diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 1f36fc78fa..edb3f0f538 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -23,6 +23,13 @@ config PWM_IMX help This PWM is found i.MX27 and later i.MX SoCs. +config PWM_MTK + bool "Enable support for MediaTek PWM" + depends on DM_PWM + help + This PWM is found on MT7622, MT7623, and MT7629. It supports a + programmable period and duty cycle. + config PWM_ROCKCHIP bool "Enable support for the Rockchip PWM" depends on DM_PWM diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index a837c35ed2..2c3a069006 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile @@ -12,6 +12,7 @@ obj-$(CONFIG_DM_PWM) += pwm-uclass.o obj-$(CONFIG_PWM_EXYNOS) += exynos_pwm.o obj-$(CONFIG_PWM_IMX) += pwm-imx.o pwm-imx-util.o +obj-$(CONFIG_PWM_MTK) += pwm-mtk.o obj-$(CONFIG_PWM_ROCKCHIP) += rk_pwm.o obj-$(CONFIG_PWM_SANDBOX) += sandbox_pwm.o obj-$(CONFIG_PWM_TEGRA) += tegra_pwm.o diff --git a/drivers/pwm/pwm-mtk.c b/drivers/pwm/pwm-mtk.c new file mode 100644 index 0000000000..97ed477025 --- /dev/null +++ b/drivers/pwm/pwm-mtk.c @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2020 MediaTek Inc. All Rights Reserved. + * + * Author: Sam Shih + */ + +#include +#include +#include +#include +#include +#include +#include + +/* PWM registers and bits definitions */ +#define PWMCON 0x00 +#define PWMHDUR 0x04 +#define PWMLDUR 0x08 +#define PWMGDUR 0x0c +#define PWMWAVENUM 0x28 +#define PWMDWIDTH 0x2c +#define PWM45DWIDTH_FIXUP 0x30 +#define PWMTHRES 0x30 +#define PWM45THRES_FIXUP 0x34 + +#define PWM_CLK_DIV_MAX 7 +#define MAX_PWM_NUM 8 + +#define NSEC_PER_SEC 1000000000L + +static const unsigned int mtk_pwm_reg_offset[] = { + 0x0010, 0x0050, 0x0090, 0x00d0, 0x0110, 0x0150, 0x0190, 0x0220 +}; + +struct mtk_pwm_soc { + unsigned int num_pwms; + bool pwm45_fixup; +}; + +struct mtk_pwm_priv { + void __iomem *base; + struct clk top_clk; + struct clk main_clk; + struct clk pwm_clks[MAX_PWM_NUM]; + const struct mtk_pwm_soc *soc; +}; + +static void mtk_pwm_w32(struct udevice *dev, uint channel, uint reg, uint val) +{ + struct mtk_pwm_priv *priv = dev_get_priv(dev); + u32 offset = mtk_pwm_reg_offset[channel]; + + writel(val, priv->base + offset + reg); +} + +static int mtk_pwm_set_config(struct udevice *dev, uint channel, + uint period_ns, uint duty_ns) +{ + struct mtk_pwm_priv *priv = dev_get_priv(dev); + u32 clkdiv = 0, clksel = 0, cnt_period, cnt_duty, + reg_width = PWMDWIDTH, reg_thres = PWMTHRES; + u64 resolution; + int ret = 0; + + clk_enable(&priv->top_clk); + clk_enable(&priv->main_clk); + /* Using resolution in picosecond gets accuracy higher */ + resolution = (u64)NSEC_PER_SEC * 1000; + do_div(resolution, clk_get_rate(&priv->pwm_clks[channel])); + cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, resolution); + while (cnt_period > 8191) { + resolution *= 2; + clkdiv++; + cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, + resolution); + if (clkdiv > PWM_CLK_DIV_MAX && clksel == 0) { + clksel = 1; + clkdiv = 0; + resolution = (u64)NSEC_PER_SEC * 1000 * 1625; + do_div(resolution, + clk_get_rate(&priv->pwm_clks[channel])); + cnt_period = DIV_ROUND_CLOSEST_ULL( + (u64)period_ns * 1000, resolution); + clk_enable(&priv->pwm_clks[channel]); + } + } + if (clkdiv > PWM_CLK_DIV_MAX && clksel == 1) { + printf("pwm period %u not supported\n", period_ns); + return -EINVAL; + } + if (priv->soc->pwm45_fixup && channel > 2) { + /* + * PWM[4,5] has distinct offset for PWMDWIDTH and PWMTHRES + * from the other PWMs on MT7623. + */ + reg_width = PWM45DWIDTH_FIXUP; + reg_thres = PWM45THRES_FIXUP; + } + cnt_duty = DIV_ROUND_CLOSEST_ULL((u64)duty_ns * 1000, resolution); + if (clksel == 1) + mtk_pwm_w32(dev, channel, PWMCON, BIT(15) | BIT(3) | clkdiv); + else + mtk_pwm_w32(dev, channel, PWMCON, BIT(15) | clkdiv); + mtk_pwm_w32(dev, channel, reg_width, cnt_period); + mtk_pwm_w32(dev, channel, reg_thres, cnt_duty); + + return ret; +}; + +static int mtk_pwm_set_enable(struct udevice *dev, uint channel, bool enable) +{ + struct mtk_pwm_priv *priv = dev_get_priv(dev); + u32 val = 0; + + val = readl(priv->base); + if (enable) + val |= BIT(channel); + else + val &= ~BIT(channel); + writel(val, priv->base); + + return 0; +}; + +static int mtk_pwm_probe(struct udevice *dev) +{ + struct mtk_pwm_priv *priv = dev_get_priv(dev); + int ret = 0; + int i; + + priv->soc = (struct mtk_pwm_soc *)dev_get_driver_data(dev); + priv->base = (void __iomem *)devfdt_get_addr(dev); + if (!priv->base) + return -EINVAL; + ret = clk_get_by_name(dev, "top", &priv->top_clk); + if (ret < 0) + return ret; + ret = clk_get_by_name(dev, "main", &priv->main_clk); + if (ret < 0) + return ret; + for (i = 0; i < priv->soc->num_pwms; i++) { + char name[8]; + + snprintf(name, sizeof(name), "pwm%d", i + 1); + ret = clk_get_by_name(dev, name, &priv->pwm_clks[i]); + if (ret < 0) + return ret; + } + + return ret; +} + +static const struct pwm_ops mtk_pwm_ops = { + .set_config = mtk_pwm_set_config, + .set_enable = mtk_pwm_set_enable, +}; + +static const struct mtk_pwm_soc mt7622_data = { + .num_pwms = 6, + .pwm45_fixup = false, +}; + +static const struct mtk_pwm_soc mt7623_data = { + .num_pwms = 5, + .pwm45_fixup = true, +}; + +static const struct mtk_pwm_soc mt7629_data = { + .num_pwms = 1, + .pwm45_fixup = false, +}; + +static const struct udevice_id mtk_pwm_ids[] = { + { .compatible = "mediatek,mt7622-pwm", .data = (ulong)&mt7622_data }, + { .compatible = "mediatek,mt7623-pwm", .data = (ulong)&mt7623_data }, + { .compatible = "mediatek,mt7629-pwm", .data = (ulong)&mt7629_data }, + { } +}; + +U_BOOT_DRIVER(mtk_pwm) = { + .name = "mtk_pwm", + .id = UCLASS_PWM, + .of_match = mtk_pwm_ids, + .ops = &mtk_pwm_ops, + .probe = mtk_pwm_probe, + .priv_auto_alloc_size = sizeof(struct mtk_pwm_priv), +}; From patchwork Fri Feb 21 13:01:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Shih X-Patchwork-Id: 1242083 X-Patchwork-Delegate: trini@ti.com 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=lP1JipFz; 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 48PBT65vKBz9sSL for ; Sat, 22 Feb 2020 00:02:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CFD0581965; Fri, 21 Feb 2020 14:02:37 +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="lP1JipFz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D6E1F81965; Fri, 21 Feb 2020 14:02:20 +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 [210.61.82.183]) by phobos.denx.de (Postfix) with ESMTP id 9FCD98195A for ; Fri, 21 Feb 2020 14:02:16 +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=sam.shih@mediatek.com X-UUID: 5c317e7f43bb439cbc3038255376ea0e-20200221 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:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=EzGo3ThGbM7uCtwFThqrevY60cK7hsQW2OO8oMHN/ng=; b=lP1JipFzxSfyt8UiSH5kqLQYV5ScFCNQC1bieF70+Uv40nKY43fycbZoP6Gus4MvdT3EOKChuZJY0xDv/Mn+w3lQURxytwOlbu1bn3hgnw1najzUpR8L+sp6cyqVuhKsT0M76GlkqugfUJZRZK22yzC/o0JJuqQ5HIBC3pvK8d4=; X-UUID: 5c317e7f43bb439cbc3038255376ea0e-20200221 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 993982402; Fri, 21 Feb 2020 21:02:14 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 21 Feb 2020 21:01:14 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 21 Feb 2020 21:01:28 +0800 From: Sam Shih To: Tom Rini CC: , Ryder Lee , GSS_MTK_Uboot_upstream , Frank Wunderlich , Sam Shih Subject: [PATCH 2/3] arm: dts: add pwm support for MediaTek SoCs Date: Fri, 21 Feb 2020 21:01:47 +0800 Message-ID: <1582290108-3234-3-git-send-email-sam.shih@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1582290108-3234-1-git-send-email-sam.shih@mediatek.com> References: <1582290108-3234-1-git-send-email-sam.shih@mediatek.com> MIME-Version: 1.0 X-MTK: N X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean This patch add pwm support for mt7622, mt7623 and mt7629 SoCs Signed-off-by: Sam Shih --- arch/arm/dts/mt7622.dtsi | 19 +++++++++++++++++++ arch/arm/dts/mt7623.dtsi | 17 +++++++++++++++++ arch/arm/dts/mt7629.dtsi | 16 ++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/arch/arm/dts/mt7622.dtsi b/arch/arm/dts/mt7622.dtsi index 1e8ec9b48b..f9ce0c6c3e 100644 --- a/arch/arm/dts/mt7622.dtsi +++ b/arch/arm/dts/mt7622.dtsi @@ -227,4 +227,23 @@ #clock-cells = <1>; }; + pwm: pwm@11006000 { + compatible = "mediatek,mt7622-pwm"; + reg = <0x11006000 0x1000>; + #clock-cells = <1>; + #pwm-cells = <2>; + interrupts = ; + clocks = <&topckgen CLK_TOP_PWM_SEL>, + <&pericfg CLK_PERI_PWM_PD>, + <&pericfg CLK_PERI_PWM1_PD>, + <&pericfg CLK_PERI_PWM2_PD>, + <&pericfg CLK_PERI_PWM3_PD>, + <&pericfg CLK_PERI_PWM4_PD>, + <&pericfg CLK_PERI_PWM5_PD>, + <&pericfg CLK_PERI_PWM6_PD>; + clock-names = "top", "main", "pwm1", "pwm2", "pwm3", "pwm4", + "pwm5", "pwm6"; + status = "disabled"; + }; + }; diff --git a/arch/arm/dts/mt7623.dtsi b/arch/arm/dts/mt7623.dtsi index 1f45dea575..0452889ef8 100644 --- a/arch/arm/dts/mt7623.dtsi +++ b/arch/arm/dts/mt7623.dtsi @@ -400,4 +400,21 @@ mediatek,ethsys = <ðsys>; status = "disabled"; }; + + pwm: pwm@11006000 { + compatible = "mediatek,mt7623-pwm"; + reg = <0x11006000 0x1000>; + #clock-cells = <1>; + #pwm-cells = <2>; + clocks = <&topckgen CLK_TOP_PWM_SEL>, + <&pericfg CLK_PERI_PWM>, + <&pericfg CLK_PERI_PWM1>, + <&pericfg CLK_PERI_PWM2>, + <&pericfg CLK_PERI_PWM3>, + <&pericfg CLK_PERI_PWM4>, + <&pericfg CLK_PERI_PWM5>; + clock-names = "top", "main", "pwm1", "pwm2", "pwm3", "pwm4", + "pwm5"; + status = "disabled"; + }; }; diff --git a/arch/arm/dts/mt7629.dtsi b/arch/arm/dts/mt7629.dtsi index a33a74a556..644d2da4a8 100644 --- a/arch/arm/dts/mt7629.dtsi +++ b/arch/arm/dts/mt7629.dtsi @@ -281,4 +281,20 @@ reg = <0x1b130000 0x1000>; #clock-cells = <1>; }; + + pwm: pwm@11006000 { + compatible = "mediatek,mt7629-pwm"; + reg = <0x11006000 0x1000>; + #clock-cells = <1>; + #pwm-cells = <2>; + interrupts = ; + clocks = <&topckgen CLK_TOP_PWM_SEL>, + <&pericfg CLK_PERI_PWM_PD>, + <&pericfg CLK_PERI_PWM1_PD>; + clock-names = "top", "main", "pwm1"; + assigned-clocks = <&topckgen CLK_TOP_PWM_SEL>; + assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL2_D4>; + status = "disabled"; + }; + }; From patchwork Fri Feb 21 13:01:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Shih X-Patchwork-Id: 1242084 X-Patchwork-Delegate: trini@ti.com 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=P6Wbjquo; 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 48PBTK6TdSz9sRl for ; Sat, 22 Feb 2020 00:03:01 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D57D081980; Fri, 21 Feb 2020 14:02:40 +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="P6Wbjquo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 20D7B81965; Fri, 21 Feb 2020 14:02:24 +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 [210.61.82.183]) by phobos.denx.de (Postfix) with ESMTP id A08EA8195E for ; Fri, 21 Feb 2020 14:02:19 +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=sam.shih@mediatek.com X-UUID: def3cab8dd2a4e2e9db727762c9f9c0f-20200221 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:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=Kg6GoKWnc8wHWjI981ZCJcV3oD4Tx1+ZlAxB8JcgV7s=; b=P6WbjquocWRHmkclqBl3yymhvm6eXB1bIJT9hc9BFhwpGEZpyXPYufZpyOE6mkj+lBj5IRXseAchKmxSeAgkixJ3cncmpw57Sp4du7rhcewn7rudPCzxm1upXoupB/cDY7BJR3cmxdp1a772NbSU73YwFV83/gbJZlWICIYk1ds=; X-UUID: def3cab8dd2a4e2e9db727762c9f9c0f-20200221 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 360764132; Fri, 21 Feb 2020 21:02:17 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 21 Feb 2020 21:01:33 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 21 Feb 2020 21:01:31 +0800 From: Sam Shih To: Tom Rini CC: , Ryder Lee , GSS_MTK_Uboot_upstream , Frank Wunderlich , Sam Shih Subject: [PATCH 3/3] arm: mediatek: remove unuse binman config Date: Fri, 21 Feb 2020 21:01:48 +0800 Message-ID: <1582290108-3234-4-git-send-email-sam.shih@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1582290108-3234-1-git-send-email-sam.shih@mediatek.com> References: <1582290108-3234-1-git-send-email-sam.shih@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: E558274C09B197B1A70FB5E99F98544ECCA078CC8EB47F3E16A9475875D8E4DA2000:8 X-MTK: N X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean The binman-option BINMAN_FDT is introduced by this commit: commit 3c10dc95bdd0 ("binman: Add a library to access binman entries") BINMAN_FDT being selected when BINMAN=y that resulting in mt7623 and mt7622 are unable to boot. The root cause of this issue is commit: commit cbd2fba1eca1 ("arm: MediaTek: add basic support for MT7629 boards") select BINMAN=y in all mediatek SoCs, and others mediatek SoCs not expect to use BINMAN_FDT. This patch remove BINMAN=y option when ARCH_MEDIATEK=y and move this to the specify SoCs part config. Signed-off-by: Sam Shih --- arch/arm/Kconfig | 1 - arch/arm/mach-mediatek/Kconfig | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 8d9f7fcce7..9ca3d90aa2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -778,7 +778,6 @@ config ARCH_MESON config ARCH_MEDIATEK bool "MediaTek SoCs" - select BINMAN select DM select OF_CONTROL select SPL_DM if SPL diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig index 17b84db5a8..0042e57017 100644 --- a/arch/arm/mach-mediatek/Kconfig +++ b/arch/arm/mach-mediatek/Kconfig @@ -36,6 +36,7 @@ config TARGET_MT7629 bool "MediaTek MT7629 SoC" select CPU_V7A select SPL + select BINMAN 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,