From patchwork Fri Nov 18 19:01:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 22477 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp360655wrr; Fri, 18 Nov 2022 11:03:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf4VLtLGm+4dt+BJ5VTpN4Yw51Na9dXZGbBU8q6Ha9f/khtOtSnF2sTWoqF/9QEce/MZl00i X-Received: by 2002:a17:906:b17:b0:7ad:821f:a3e6 with SMTP id u23-20020a1709060b1700b007ad821fa3e6mr6859893ejg.688.1668798236956; Fri, 18 Nov 2022 11:03:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668798236; cv=none; d=google.com; s=arc-20160816; b=F1IynGSMzS79NcT1JCgudJqcVHlGzC01pdriSExcgETqzOQkQjdxFZFkt1olcmscvQ hxe5/1q90iVq5WXfHGRW0tsj1BMspsjg9B2zqx/o0w+uC3kf6v0iHbP8zH+F28xTM6Nq sldq3hDBxXW4+PL4B7s7CQoQRkn/UHe8pRkP2allfqRTQ+5u8ldu9r4m2a0POVyZ8+MP LFjdbS30zulz8unBzm2fKUZQt2H7v5AMs1EbCBVy0Zrde3tI+hgpaH0ReP4SyY2KyODI Ikt5CSXr3g3proyZgDxFFmfM2bAkEueicwb5YWUmVf/2O9rGr8Jgoi3uGatA7mQE8VSf PRnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HErHfykO7IYXVp4U9iKhL1dv6JpdE4zIk+xeou1yDI8=; b=XvHWCZ5ajUvFedWfr5LRL+Y+AydScCKJgXQhhV4C5EZYP7BHVadiUm/Tuab13QlJSy vYmBxMNmtPUl6CNd/Bj5/k13BDrLDcW5MD/J+lsBb/IIzAACzWJ/jSu035BCr24qXAYH X3eDoOHrZXaOGAmF+GUFF1Pf/aEuOf9V8wGJDe91NMLTJqKhBTClDHyIw+y3yeuiyP6H eV6gJpbwetUOjiburkBw7m8k0iknzdCgmep+ZLRiCi8TFvBxS/abMJ5S3PYNB4O/n+Q5 ic5A0Ci4gQBiEqVH1MnSkIv/+3nAgm3Nemh/jTLmfovsla7vb6QchwL6SsG3lZEKc/bH rCxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=OVH4VMaH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb20-20020a1709077e9400b0078d1e610b3esi4058347ejc.26.2022.11.18.11.03.31; Fri, 18 Nov 2022 11:03:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=OVH4VMaH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243020AbiKRTCs (ORCPT + 99 others); Fri, 18 Nov 2022 14:02:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242976AbiKRTCA (ORCPT ); Fri, 18 Nov 2022 14:02:00 -0500 Received: from mxout2.routing.net (mxout2.routing.net [IPv6:2a03:2900:1:a::b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB06E3055F; Fri, 18 Nov 2022 11:01:41 -0800 (PST) Received: from mxbulk.masterlogin.de (unknown [192.168.10.85]) by mxout2.routing.net (Postfix) with ESMTP id 00F516050E; Fri, 18 Nov 2022 19:01:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1668798099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HErHfykO7IYXVp4U9iKhL1dv6JpdE4zIk+xeou1yDI8=; b=OVH4VMaHj8qdFZZChl/q7vFQ1/PfQMV/JYtJQK154Uilc21qz5omAv0WD4BcihgmkSPijS dknPhmigVsayS96rEpleUSkJ+L2qHiMVZM0vYUsH5pqfWQD+mEHID+K8OQ9rz8HwBCMko9 OJGyuMmfyuehvbfhzWf7MUMSd/+rWGo= Received: from frank-G5.. (fttx-pool-80.245.77.125.bambit.de [80.245.77.125]) by mxbulk.masterlogin.de (Postfix) with ESMTPSA id 9B2D41226BC; Fri, 18 Nov 2022 19:01:38 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Ryder Lee , Jianjun Wang , Bjorn Helgaas , Rob Herring , Krzysztof Kozlowski , Chunfeng Yun , Kishon Vijay Abraham I , Vinod Koul , Greg Kroah-Hartman , Matthias Brugger , Paolo Abeni , Lorenzo Bianconi , Bo Jiao , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-usb@vger.kernel.org, Sam Shih Subject: [PATCH v6 08/11] arm64: dts: mt7986: add mmc related device nodes Date: Fri, 18 Nov 2022 20:01:23 +0100 Message-Id: <20221118190126.100895-9-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221118190126.100895-1-linux@fw-web.de> References: <20221118190126.100895-1-linux@fw-web.de> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749861779952923956?= X-GMAIL-MSGID: =?utf-8?q?1749861779952923956?= From: Sam Shih This patch adds mmc support for MT7986. Signed-off-by: Sam Shih Signed-off-by: Frank Wunderlich --- v2: - update mmc-node because clocks changed v3: - fix pullups/pulldowns for mt7986a-rfb to have generic bias-pull-* v6: - add 3v3 regulator in mt7986a-rfb (was in usb patch before) - dropped AngeloGioacchino RB because of this change --- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 96 ++++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 15 +++ 2 files changed, 111 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts index 828d504a4e48..4c0b879d6703 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts @@ -5,6 +5,8 @@ */ /dts-v1/; +#include + #include "mt7986a.dtsi" / { @@ -23,6 +25,24 @@ memory@40000000 { device_type = "memory"; reg = <0 0x40000000 0 0x40000000>; }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "fixed-1.8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; }; &crypto { @@ -58,7 +78,83 @@ switch: switch@0 { }; }; +&mmc0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + bus-width = <8>; + max-frequency = <200000000>; + cap-mmc-highspeed; + mmc-hs200-1_8v; + mmc-hs400-1_8v; + hs400-ds-delay = <0x14014>; + vmmc-supply = <®_3p3v>; + vqmmc-supply = <®_1p8v>; + non-removable; + no-sd; + no-sdio; + status = "okay"; +}; + &pio { + mmc0_pins_default: mmc0-pins { + mux { + function = "emmc"; + groups = "emmc_51"; + }; + conf-cmd-dat { + pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength = <4>; + bias-pull-up = ; /* pull-up 10K */ + }; + conf-clk { + pins = "EMMC_CK"; + drive-strength = <6>; + bias-pull-down = ; /* pull-down 50K */ + }; + conf-ds { + pins = "EMMC_DSL"; + bias-pull-down = ; /* pull-down 50K */ + }; + conf-rst { + pins = "EMMC_RSTB"; + drive-strength = <4>; + bias-pull-up = ; /* pull-up 10K */ + }; + }; + + mmc0_pins_uhs: mmc0-uhs-pins { + mux { + function = "emmc"; + groups = "emmc_51"; + }; + conf-cmd-dat { + pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; + input-enable; + drive-strength = <4>; + bias-pull-up = ; /* pull-up 10K */ + }; + conf-clk { + pins = "EMMC_CK"; + drive-strength = <6>; + bias-pull-down = ; /* pull-down 50K */ + }; + conf-ds { + pins = "EMMC_DSL"; + bias-pull-down = ; /* pull-down 50K */ + }; + conf-rst { + pins = "EMMC_RSTB"; + drive-strength = <4>; + bias-pull-up = ; /* pull-up 10K */ + }; + }; + spi_flash_pins: spi-flash-pins { mux { function = "spi"; diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi index c69b8bff7f4a..b3ad8978b563 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -304,6 +304,21 @@ ssusb: usb@11200000 { status = "disabled"; }; + mmc0: mmc@11230000 { + compatible = "mediatek,mt7986-mmc"; + reg = <0 0x11230000 0 0x1000>, + <0 0x11c20000 0 0x1000>; + interrupts = ; + clocks = <&topckgen CLK_TOP_EMMC_416M_SEL>, + <&infracfg CLK_INFRA_MSDC_HCK_CK>, + <&infracfg CLK_INFRA_MSDC_CK>, + <&infracfg CLK_INFRA_MSDC_133M_CK>, + <&infracfg CLK_INFRA_MSDC_66M_CK>; + clock-names = "source", "hclk", "source_cg", "bus_clk", + "sys_cg"; + status = "disabled"; + }; + usb_phy: t-phy@11e10000 { compatible = "mediatek,mt7986-tphy", "mediatek,generic-tphy-v2";