From patchwork Wed Jun 7 20:16:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 104709 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp493529vqr; Wed, 7 Jun 2023 14:30:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Tk4TKH9BGTaSZs3u2tzZW1JAy3A+WeT8OFXacRlAu4hYKXkaLLi/PzPvPSu4cXU58P5jF X-Received: by 2002:a05:6a00:a06:b0:64f:aea5:7b49 with SMTP id p6-20020a056a000a0600b0064faea57b49mr4415850pfh.17.1686173459544; Wed, 07 Jun 2023 14:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686173459; cv=none; d=google.com; s=arc-20160816; b=gfziqDhlWbSF3/pFm4E2YMy/+4Lanztq0k13OBeA6W/3geImGNaBw3YqqZWfAmgphw aARZvnNlyTJQybjR6qcSKbIwAuCTaj85WoSn0KmbyN0b3O+PLFsIujJIFsz46YbxowWV rDROzMKpTMbHt4Ux3gPoyhhMKfaCiZzsZz90Gd/+9KRa8DRbaLc+FFW6+fXzFfRv4TV5 449lF6oJm+EkpvWVOzD35VKUxWE1onQTUVfIjAtf44r7ESA6QCNf02qNqP1Tr4d3gtMt BFk96Sb3eDDNfxySVDFob06fuwEEWfa7i1BJwb37s4OT70t7teG9SQRxY+o6h4VJuYFm ToEQ== 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=ZYzm10ARzicI/VkalxH9IaqGb8tcNyA0d5VD1WYq+Ig=; b=DMsSnnBFOTFzTSgFN19WLQqX0/BDRtK2btLlD0S4PMKehRMUGnEZqWdOtYx/Zwj4je TtaQpPyYu9UdfYrEV+8q3hsDzfzMLa4cB4vtc138SHSWnlT1MS6cit1lW6Xmi/EmvLyg k8Lp+SSiL1YI3hied6NeRqb8pbOTTeH/9VcdqRyKad6I774XJHIQcHMdzv9OiimQ7q/X nRPrBqmDWfb0QCp4OrnVWwzJYbRz63CcG1UlNv/UMMVOTlGyTM70YvX/qqTG6y4ItTYK ZVpOm867t91ltsmG7EnuaBPznYQ5hJxxKKH/plkwWfL92PnFCZvRhc9dO7aCJSW4oace e/Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=tFuV+yAW; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c194-20020a6335cb000000b0050f9b910fa1si9410837pga.368.2023.06.07.14.30.42; Wed, 07 Jun 2023 14:30:59 -0700 (PDT) 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=@sberdevices.ru header.s=mail header.b=tFuV+yAW; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232582AbjFGURR (ORCPT + 99 others); Wed, 7 Jun 2023 16:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231611AbjFGUQ7 (ORCPT ); Wed, 7 Jun 2023 16:16:59 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D9871BD3; Wed, 7 Jun 2023 13:16:58 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 3BC105FD73; Wed, 7 Jun 2023 23:16:56 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1686169016; bh=ZYzm10ARzicI/VkalxH9IaqGb8tcNyA0d5VD1WYq+Ig=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=tFuV+yAWUo7Q0sYLMKf2M4BuNmvcVlg643acSfnG19o9ztjGz5c14v0md6UFe1hum L5M1cTrJFMmA02ElgVAKzuP1Em/6iGgBbpzRzlWwDeO5UGtddWkkrcQd1DTCLMJpCz zNpERrZdP4tvAosYgpSoCL2LI7p4m3pxq7hfZ5s7YTtKxlRXK5cnTz/6LVLQJ4yyBg 4TamtmB64oysLQ02Qu9uFe9+erDwZCkLMYD//roEmxlIBPUFRW1AOZUA2yqSAengyx vP60/8mI6Haow3vDD9UT5F1RtRXPYNsSxVafXtXjVKGKJfbYfBhvXDFJ7A6SAJxChj CpF4yCInn2Qrg== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 7 Jun 2023 23:16:56 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , CC: , , , , , , , , Jan Dakinevich , Dmitry Rokosov Subject: [PATCH v1 6/6] arm64: dts: meson: a1: add eMMC controller and its pins Date: Wed, 7 Jun 2023 23:16:41 +0300 Message-ID: <20230607201641.20982-7-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230607201641.20982-1-ddrokosov@sberdevices.ru> References: <20230607201641.20982-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/06/07 16:55:00 #21454472 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1768081021686081948?= X-GMAIL-MSGID: =?utf-8?q?1768081021686081948?= From: Jan Dakinevich The definition is inspired by a similar one for AXG SoC family. 'sdio_pins' and 'sdio_clk_gate_pins' pinctrls are supposed to be used as "default" and "clk-gate" in board-specific device trees. 'meson-gx' driver during initialization sets clock to safe low-frequency value (400kHz). However, both source clocks ("clkin0" and "clkin1") are high-frequency by default, and using of eMMC's internal divider is not enough to achieve so low values. To provide low-frequency source, reparent "sd_emmc_sel2" clock using 'assigned-clocks' property. Signed-off-by: Jan Dakinevich Signed-off-by: Dmitry Rokosov --- arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 43 +++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi index 3eb6aa9c00e0..a25170c61462 100644 --- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi @@ -134,6 +134,32 @@ mux { bias-pull-down; }; }; + + sdio_pins: sdio { + mux-0 { + groups = "sdcard_d0_x", + "sdcard_d1_x", + "sdcard_d2_x", + "sdcard_d3_x", + "sdcard_cmd_x"; + function = "sdcard"; + bias-pull-up; + }; + + mux-1 { + groups = "sdcard_clk_x"; + function = "sdcard"; + bias-disable; + }; + }; + + sdio_clk_gate_pins: sdio_clk_gate { + mux { + groups = "sdcard_clk_x"; + function = "sdcard"; + bias-pull-down; + }; + }; }; uart_AO: serial@1c00 { @@ -200,6 +226,23 @@ usb2_phy1: phy@4000 { #phy-cells = <0>; power-domains = <&pwrc PWRC_USB_ID>; }; + + sd_emmc: sd@10000 { + compatible = "amlogic,meson-axg-mmc"; + reg = <0x0 0x10000 0x0 0x800>; + interrupts = ; + clocks = <&clkc_periphs CLKID_SD_EMMC_A>, + <&clkc_periphs CLKID_SD_EMMC>, + <&clkc_pll CLKID_FCLK_DIV2>; + clock-names = "core", + "clkin0", + "clkin1"; + assigned-clocks = <&clkc_periphs CLKID_SD_EMMC_SEL2>; + assigned-clock-parents = <&xtal>; + resets = <&reset RESET_SD_EMMC_A>; + power-domains = <&pwrc PWRC_SD_EMMC_ID>; + status = "disabled"; + }; }; gic: interrupt-controller@ff901000 {