Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2608837pxb; Tue, 13 Apr 2021 06:10:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4DRT0/Hy3fAGLNbyhQOLjJ00QT24sSIaobTS+fDZm7p/p+8nmHlAOwB53u1J4x/kq7Zhx X-Received: by 2002:a17:90b:1904:: with SMTP id mp4mr4789195pjb.193.1618319433335; Tue, 13 Apr 2021 06:10:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618319433; cv=none; d=google.com; s=arc-20160816; b=KOgLsgp1BJnnzENgBgO2tvzeOFaFCipLBnF5Ha+YOOcTYgTCmWcw5sbiyyUyIh7NTr AyiQnJ1lc7WorSVHHn3SwroQVXgDniOlUbEHpBl7D5biU9y6y6woQNDCR74aU7DIQNDF BnIO6iwl+CUxIJju2iOPNSzgyoItCTlpB/Yhqr6Uk5Jl/nPeXo+ngQ4ajE/1phje53wK pvbfbuGEyLUcVdiZr2qymC+ZKthxZwkwROLtUSd/uazrLUpfidv+V/tSxBH6Rdan3b/0 jRv6T8SUF6wgpKN7q1llZ6nXxDLztDwWUC/06wEg59QZDENyGgesvIYcN4rR0i20l4mK DMYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:mime-version:content-transfer-encoding :message-id:references:importance:sensitivity:date:cc:to:from :in-reply-to:dkim-signature; bh=1EegNePvlfRJ5UCnwknjrsGUcTK3dCk5x+70rY0+tQY=; b=oO04pVZqD9UEWqwTlOvra0jBLxDHm3SySMVouf+3PUPPehhsZFThPqxrHXeik4V2H3 rL9fixRJWDwzVIwVXAm3c+hJYutPzxvIkZrlgzbdtwp673+EZBWN06foKwvAyrs0BFeA GY2MO7DvUdyBuSQSE1xy2PwcwyxGTfUNTeOuU/CE13crV7T/7EUIaST9xmupGBXfa2eP xIKlu8mUjkW1pktKaxRMU9GLPhhwwEzck58M3miy0RD54SPuw+vstuCMnZrapyLNy+Nc rwbdLzc4HNM5MI2EwPJqr7mVryWfhh3gzgV3R4KSiDed2ANhsPsd0P1WDygUb8y86fO7 o1NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=LQfIT23J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oc2si2964200pjb.50.2021.04.13.06.10.20; Tue, 13 Apr 2021 06:10:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=LQfIT23J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243672AbhDMCni (ORCPT + 99 others); Mon, 12 Apr 2021 22:43:38 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:21812 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241723AbhDMCnh (ORCPT ); Mon, 12 Apr 2021 22:43:37 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13D2X98r046733 for ; Mon, 12 Apr 2021 22:43:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=in-reply-to : from : to : cc : date : references : content-type : message-id : content-transfer-encoding : mime-version : subject; s=pp1; bh=1EegNePvlfRJ5UCnwknjrsGUcTK3dCk5x+70rY0+tQY=; b=LQfIT23J9dz4tgv/5nlFRGvn+G/K/GG1H2ozfnSP1A4GBuWa1LE9AG2uReyCtS1wqc0x 6dwM//jaWpPWob2VOy074SNcqGNo/RT/fQ+mJ1NwN33D2K6JXDc74EaBgW8fkiyvgSwq IFSG+PB+hJaM/owBVZg8Et+G3b4vWfy2eHdyuQSDs7vhcDlbDicOVtMAVlEjANe7pIEN YUs021NlquF7Cm3n/9Hd+JGYYUf3B8riEyIKSwDLquJM6wjjwJZBOK6TSAAfnBUebpKR +UokSKO+h9pWi+XlvX1esMl3R//MqbRoH7cFc7GrTYf7jHQOthuT9wXCH71jeUa1PFuJ hg== Received: from smtp.notes.na.collabserv.com (smtp.notes.na.collabserv.com [158.85.210.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 37vkpj8w9w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 12 Apr 2021 22:43:17 -0400 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Tue, 13 Apr 2021 02:43:17 -0000 Received: from us1b3-smtp07.a3dr.sjc01.isc4sb.com (10.122.203.198) by smtp.notes.na.collabserv.com (10.122.47.48) with smtp.notes.na.collabserv.com ESMTP; Tue, 13 Apr 2021 02:43:15 -0000 Received: from us1b3-mail228.a3dr.sjc03.isc4sb.com ([10.168.214.55]) by us1b3-smtp07.a3dr.sjc01.isc4sb.com with ESMTP id 2021041302431439-860115 ; Tue, 13 Apr 2021 02:43:14 +0000 In-Reply-To: <20210413013010.GA353@aspeedtech.com> From: "Milton Miller II" To: Steven Lee Cc: Rob Herring , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Ulf Hansson , Ryan Chen , "moderated list:ASPEED SD/MMC DRIVER" , Andrew Jeffery , "open list:ASPEED SD/MMC DRIVER" , "moderated list:ASPEED SD/MMC DRIVER" , Ryan Chen , Adrian Hunter , open list , Chin-Ting Kuo , "moderated list:ARM/ASPEED MACHINE SUPPORT" Date: Tue, 13 Apr 2021 02:43:14 +0000 Sensitivity: Importance: Normal X-Priority: 3 (Normal) References: <20210413013010.GA353@aspeedtech.com>,<20210408015218.20560-1-steven_lee@aspeedtech.com> <20210408015218.20560-2-steven_lee@aspeedtech.com> <20210409184118.GA3934798@robh.at.kernel.org> X-Mailer: IBM iNotes ($HaikuForm 1054.1) | IBM Domino Build SCN1812108_20180501T0841_FP130 January 13, 2021 at 14:04 X-LLNOutbound: False X-Disclaimed: 12715 X-TNEFEvaluated: 1 Content-Type: text/plain; charset=UTF-8 x-cbid: 21041302-1429-0000-0000-000003AD7C50 X-IBM-SpamModules-Scores: BY=0; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0; ST=0; TS=0; UL=0; ISC=; MB=0.008445 X-IBM-SpamModules-Versions: BY=3.00014940; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000296; SDB=6.01526390; UDB=6.00825164; IPR=6.01308223; MB=3.00036522; MTD=3.00000008; XFM=3.00000015; UTC=2021-04-13 02:43:16 X-IBM-AV-DETECTION: SAVI=unsuspicious REMOTE=unsuspicious XFE=unused X-IBM-AV-VERSION: SAVI=2021-03-22 13:55:12 - 6.00012377 x-cbparentid: 21041302-1430-0000-0000-00003A2C7F01 Message-Id: X-Proofpoint-GUID: hytYdYv8JgDl0PYohGjqOJGnQmRMgx15 X-Proofpoint-ORIG-GUID: hytYdYv8JgDl0PYohGjqOJGnQmRMgx15 Content-Transfer-Encoding: quoted-printable X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 Subject: RE: [PATCH v1 1/2] dt-bindings: mmc: sdhci-of-aspeed: Add power-gpio and power-switch-gpio X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-04-12_15:2021-04-12,2021-04-12 signatures=0 X-Proofpoint-Spam-Reason: orgsafe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org -----"openbmc" wrot= e: ----- >To: Rob Herring >From: Steven Lee=20 >Sent by: "openbmc"=20 >Date: 04/12/2021 08:31PM >Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" >, Ulf Hansson , >Ryan Chen , "moderated list:ASPEED SD/MMC >DRIVER" , Andrew Jeffery >, "open list:ASPEED SD/MMC DRIVER" >, "moderated list:ASPEED SD/MMC DRIVER" >, Ryan Chen , >Adrian Hunter , open list >, Chin-Ting Kuo >, "moderated list:ARM/ASPEED MACHINE >SUPPORT" >Subject: [EXTERNAL] Re: [PATCH v1 1/2] dt-bindings: mmc: >sdhci-of-aspeed: Add power-gpio and power-switch-gpio > >The 04/10/2021 02:41, Rob Herring wrote: >> On Thu, Apr 08, 2021 at 09:52:17AM +0800, Steven Lee wrote: >> > AST2600-A2 EVB provides the reference design for enabling SD bus >power >> > and toggling SD bus signal voltage by GPIO pins. >> > Add the definition and example for power-gpio and >power-switch-gpio >> > properties. >> >=20 >> > In the reference design, GPIOV0 of AST2600-A2 EVB is connected to >power >> > load switch that providing 3.3v to SD1 bus vdd. GPIOV1 is >connected to >> > a 1.8v and a 3.3v power load switch that providing signal voltage >to >> > SD1 bus. >> > If GPIOV0 is active high, SD1 bus is enabled. Otherwise, SD1 bus >is >> > disabled. >> > If GPIOV1 is active high, 3.3v power load switch is enabled, SD1 >signal >> > voltage is 3.3v. Otherwise, 1.8v power load switch will be >enabled, SD1 >> > signal voltage becomes 1.8v. >> >=20 >> > AST2600-A2 EVB also support toggling signal voltage for SD2 bus. >> > The design is the same as SD1 bus. It uses GPIOV2 as power-gpio >and GPIOV3 >> > as power-switch-gpio. >> >=20 >> > Signed-off-by: Steven Lee >> > --- >> > .../devicetree/bindings/mmc/aspeed,sdhci.yaml | 25 >+++++++++++++++++++ >> > 1 file changed, 25 insertions(+) >> >=20 >> > diff --git >a/Documentation/devicetree/bindings/mmc/aspeed,sdhci.yaml >b/Documentation/devicetree/bindings/mmc/aspeed,sdhci.yaml >> > index 987b287f3bff..515a74614f3c 100644 >> > --- a/Documentation/devicetree/bindings/mmc/aspeed,sdhci.yaml >> > +++ b/Documentation/devicetree/bindings/mmc/aspeed,sdhci.yaml >> > @@ -37,6 +37,14 @@ properties: >> > clocks: >> > maxItems: 1 >> > description: The SD/SDIO controller clock gate >> > + power-gpio: >>=20 >> '-gpios' is the preferred form even if just 1. >>=20 > >Thanks for reviewing, I will change the name. is this a clock gate or a power on gpio? > >> > + description: >> > + The GPIO for enabling/disabling SD bus power. >> > + maxItems: 1 >>=20 >> blank line >>=20 > >I will remove the blank line. > >> > + power-switch-gpio: >> > + description: >> > + The GPIO for toggling the signal voltage between 3.3v and >1.8v. Which way does it toggle for which voltage? Oh, you said in the change log but not in the binding. But please, use gpio controled regulators as Ulf suggested and is already used by other mmc controllers upstream. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ Documentation/devicetree/bindings/regulator/gpio-regulator.yaml Ulf> Please do not model these as GPIO pins like this. Instead, it's better Ulf> to model them as gpio regulators, since the mmc core manages them as Ulf> regulators. Ulf>=20 Ulf> We have a vmmc regulator (corresponding to vdd) and a vqmmc regulator Ulf> (corresponding the signal-voltage level). These are also described in Ulf> the common mmc DT bindings, see Ulf> Documentation/devicetree/bindings/mmc/mmc-controller.yaml Ulf> . milton >> > + maxItems: 1 >> >=20=20 >> > patternProperties: >> > "^sdhci@[0-9a-f]+$": >> > @@ -61,6 +69,14 @@ patternProperties: >> > sdhci,auto-cmd12: >> > type: boolean >> > description: Specifies that controller should use auto >CMD12 >> > + power-gpio: >> > + description: >> > + The GPIO for enabling/disabling SD bus power. >> > + maxItems: 1 >> > + power-switch-gpio: >> > + description: >> > + The GPIO for toggling the signal voltage between 3.3v >and 1.8v. >> > + maxItems: 1 >> > required: >> > - compatible >> > - reg >> > @@ -80,6 +96,7 @@ required: >> > examples: >> > - | >> > #include >> > + #include >> > sdc@1e740000 { >> > compatible =3D "aspeed,ast2500-sd-controller"; >> > reg =3D <0x1e740000 0x100>; >> > @@ -94,6 +111,10 @@ examples: >> > interrupts =3D <26>; >> > sdhci,auto-cmd12; >> > clocks =3D <&syscon ASPEED_CLK_SDIO>; >> > + power-gpio =3D <&gpio0 ASPEED_GPIO(V, 0) >> > + GPIO_ACTIVE_HIGH>; >> > + power-switch-gpio =3D <&gpio0 ASPEED_GPIO(V, >1) >> > + GPIO_ACTIVE_HIGH>; >> > }; >> >=20=20 >> > sdhci1: sdhci@200 { >> > @@ -102,5 +123,9 @@ examples: >> > interrupts =3D <26>; >> > sdhci,auto-cmd12; >> > clocks =3D <&syscon ASPEED_CLK_SDIO>; >> > + power-gpio =3D <&gpio0 ASPEED_GPIO(V, 2) >> > + GPIO_ACTIVE_HIGH>; >> > + power-switch-gpio =3D <&gpio0 ASPEED_GPIO(V, >3) >> > + GPIO_ACTIVE_HIGH>; >> > }; >> > }; >> > --=20 >> > 2.17.1 >> >=20 > >