From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25337C4345F for ; Sat, 27 Apr 2024 11:16:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MkYp4oZ+HCBqosSiPIetqoXNidXpT88JvHWaXEbi8n0=; b=j/K7SVmaOAsOPC Ga4GNt4AM3cgm4mIHX7NQyNRpTAU1d4uJZbH4LyVQsxskriqU8pXIHv7xWwtSXIrI4ipum5UsD3vn bUx4JRxTozJ5eVMJw4g8QgsPGe5H2YVw6MM+PjDaWws+O779h6+3GpHVq62qQjtyFOlU2sEujPa+Q OzWI+iruzh4w5v1WiBqmKbfYRTM0X9kkQZwdgRpN9FXfq0vxp9k7AvzaIf9y9M1KTDURE0VRdVhJG uLY+3YFgI03N6ZrT9vkOLukEbljnLiu5wM90SbAIneUPlwcbLybrf16tkXP4GUH+IhjjDo/Ilmkh4 MSPpOf5tFqaCvFqA2XDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0g2r-0000000FOb0-3S0r; Sat, 27 Apr 2024 11:16:41 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0g2n-0000000FOad-2JTp for linux-arm-kernel@lists.infradead.org; Sat, 27 Apr 2024 11:16:40 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-56e56ee8d5cso3842307a12.2 for ; Sat, 27 Apr 2024 04:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1714216595; x=1714821395; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :date:from:from:to:cc:subject:date:message-id:reply-to; bh=cWZ79BmqrOM43+BCD+VAgtUw9w+BzvSsy0l3aYOkwOM=; b=N/vQEnxXvA6JpF4VCwHO1PVxpJt9ljJFCgZkjWkbhZ97rL/4ufuCn+jiSKLM54fdt2 fdbhHmAyIQtbrLqViBjkI/erA7Btwk0jgquXRac1Eez4uYmatm2wle3iukNxMS4MCPVG cI/m3wipfRH/hT9kgXkNs+L/pEh/9ZtlPRBiL40dwiaqbfn4/3e/iarcEVLC+IcYtZNS 56gT9pB7IlAlrxvOozNS0xnOdlQr/vqvkzS1lpekYaA9c/7Mdkunpc6s4K6FZBJ1jLXu ngH7rH7bvap98dsinEHVSZ4IbWrKhINaUDTPFrORH6SH64Ql6XGBCKNndPIFWRlpm5pi 47Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714216595; x=1714821395; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cWZ79BmqrOM43+BCD+VAgtUw9w+BzvSsy0l3aYOkwOM=; b=xAcYRR+zNzYCtEMfTeOSv+z5x0Enn55w7tUOM7lWeR2YdqpymTL5+QYbvneqfTeCzJ Vr8VDNJnjYnd6HlgW+ScRHE4m1KvIJCTkw8effgZ3pshCCxoLFZVSPnnMJPYS354J0y3 2ufRWd2U4B8ghAcMAuT2vIdGhEcZ7dPg+Bgbk58oRgYYfaQ5tDnSo8aA/H99FaNjoYoO PCBqRRM966UubQfmk1q1M0w9nVpWaG5whhLYbOs59TX8Ra3GA8xQYZHF+4uAS76+NIJ4 MOzvGx9XGPENjIg1r40Dw/hRVfhdn1zGJ74XporUmXYXExLSxEq+1etAGT1Vp92YqLr4 n9OQ== X-Forwarded-Encrypted: i=1; AJvYcCUVHpWhPENehbmFYbCfgrMV5oMGYKD+cplCPqKfrUW3aFDGAlL90yLI5fvNwfSMNqgv/526F3QXlmzUVWnJl7ZKCFmuTt5qWL3ks6LwB9FVcUYfI5I= X-Gm-Message-State: AOJu0Yz5Mzw5q2qC3i/z9VtysfZ6zlEijj4AQuMssRcifrbYet/YbJre gG2lj4IgBGqZK0IMRQtSxtGXtQBBTIS0YyoM1jJQ+ul0ZhN1RTpN0+sUgUpnjO8= X-Google-Smtp-Source: AGHT+IHrGtv7xT9rFyE4L8LkvUgTtsWBslnRasfuA9d5IggWzQk3+JPxHG/Eoxi5ndjr+pKGaak2Wg== X-Received: by 2002:a50:9e87:0:b0:570:1ea6:e9d8 with SMTP id a7-20020a509e87000000b005701ea6e9d8mr3714303edf.9.1714216595365; Sat, 27 Apr 2024 04:16:35 -0700 (PDT) Received: from localhost (host-87-1-234-99.retail.telecomitalia.it. [87.1.234.99]) by smtp.gmail.com with ESMTPSA id cf8-20020a0564020b8800b0056c24df7a78sm11060511edb.5.2024.04.27.04.16.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Apr 2024 04:16:35 -0700 (PDT) From: Andrea della Porta X-Google-Original-From: Andrea della Porta Date: Sat, 27 Apr 2024 13:16:36 +0200 To: Christophe JAILLET Cc: Andrea della Porta , adrian.hunter@intel.com, alcooperx@gmail.com, bcm-kernel-feedback-list@broadcom.com, conor+dt@kernel.org, devicetree@vger.kernel.org, florian.fainelli@broadcom.com, jonathan@raspberrypi.com, kamal.dasu@broadcom.com, krzysztof.kozlowski+dt@linaro.org, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, phil@raspberrypi.com, robh@kernel.org, ulf.hansson@linaro.org Subject: Re: [PATCH 6/6] mmc: sdhci-brcmstb: Add BCM2712 SD Express support Message-ID: Mail-Followup-To: Christophe JAILLET , Andrea della Porta , adrian.hunter@intel.com, alcooperx@gmail.com, bcm-kernel-feedback-list@broadcom.com, conor+dt@kernel.org, devicetree@vger.kernel.org, florian.fainelli@broadcom.com, jonathan@raspberrypi.com, kamal.dasu@broadcom.com, krzysztof.kozlowski+dt@linaro.org, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, phil@raspberrypi.com, robh@kernel.org, ulf.hansson@linaro.org References: <57f240af-7e99-4bc1-a2c5-415441aa5f0b@wanadoo.fr> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <57f240af-7e99-4bc1-a2c5-415441aa5f0b@wanadoo.fr> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240427_041637_627218_11CACCAE X-CRM114-Status: GOOD ( 27.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 09:34 Sun 14 Apr , Christophe JAILLET wrote: > Le 14/04/2024 =E0 00:14, Andrea della Porta a =E9crit=A0: > > Broadcom BCM2712 SDHCI controller is SD Express capable. Add support > > for sde capability where the implementation is based on downstream driv= er, > > diverging from it in the way that init_sd_express callback is invoked: > > in downstream the sdhci_ops structure has been augmented with a new > > function ptr 'init_sd_express' that just propagate the call to the > > driver specific callback so that the callstack from a structure > > standpoint is mmc_host_ops -> sdhci_ops. The drawback here is in the > > added level of indirection (the newly added init_sd_express is > > redundant) and the sdhci_ops structure declaration has to be changed. > > To overcome this the presented approach consist in patching the mmc_hos= t_ops > > init_sd_express callback to point directly to the custom function defin= ed in > > this driver (see struct brcmstb_match_priv). > > = > > Signed-off-by: Andrea della Porta > > --- > > drivers/mmc/host/Kconfig | 1 + > > drivers/mmc/host/sdhci-brcmstb.c | 147 ++++++++++++++++++++++++++++++- > > 2 files changed, 147 insertions(+), 1 deletion(-) > = > ... > = > > + if (brcmstb_priv->sde_pcie) { > > + struct of_changeset changeset; > > + static struct property okay_property =3D { > > + .name =3D "status", > > + .value =3D "okay", > > + .length =3D 5, > > + }; > > + > > + /* Enable the pcie controller */ > > + of_changeset_init(&changeset); > > + ret =3D of_changeset_update_property(&changeset, > > + brcmstb_priv->sde_pcie, > > + &okay_property); > > + if (ret) { > > + dev_err(dev, "%s: failed to update property - %d\n", __func__, > > + ret); > > + return -ENODEV; > > + } > > + ret =3D of_changeset_apply(&changeset); > > + } > > + > > + dev_dbg(dev, "%s -> %d\n", __func__, ret); > = > Is this really useful? Not really. Removed. > = > > + return ret; > > +} > > + > = > ... > = > > @@ -468,6 +581,24 @@ static int sdhci_brcmstb_probe(struct platform_dev= ice *pdev) > > if (res) > > goto err; > > + priv->sde_1v8 =3D devm_regulator_get_optional(&pdev->dev, "sde-1v8"); > > + if (IS_ERR(priv->sde_1v8)) > > + priv->flags &=3D ~BRCMSTB_PRIV_FLAGS_HAS_SD_EXPRESS; > > + > > + iomem =3D platform_get_resource(pdev, IORESOURCE_MEM, 2); > > + if (iomem) { > > + priv->sde_ioaddr =3D devm_ioremap_resource(&pdev->dev, iomem); > > + if (IS_ERR(priv->sde_ioaddr)) > > + priv->sde_ioaddr =3D NULL; > > + } > > + > > + iomem =3D platform_get_resource(pdev, IORESOURCE_MEM, 3); > > + if (iomem) { > > + priv->sde_ioaddr2 =3D devm_ioremap_resource(&pdev->dev, iomem); > > + if (IS_ERR(priv->sde_ioaddr2)) > > + priv->sde_ioaddr =3D NULL; > = > sde_ioaddr2 ? > = > > + } > > + > > priv->pinctrl =3D devm_pinctrl_get(&pdev->dev); > > if (IS_ERR(priv->pinctrl)) { > > no_pinctrl =3D true; > > @@ -478,8 +609,16 @@ static int sdhci_brcmstb_probe(struct platform_dev= ice *pdev) > > no_pinctrl =3D true; > > } > > - if (no_pinctrl ) > > + priv->pins_sdex =3D pinctrl_lookup_state(priv->pinctrl, "sd-express"); > > + if (IS_ERR(priv->pins_sdex)) { > > + dev_dbg(&pdev->dev, "No pinctrl sd-express state\n"); > > + no_pinctrl =3D true; > = > Indentation looks too large. Ack. > = > > + } > > + > > + if (no_pinctrl || !priv->sde_ioaddr || !priv->sde_ioaddr2) { > > priv->pinctrl =3D NULL; > > + priv->flags &=3D ~BRCMSTB_PRIV_FLAGS_HAS_SD_EXPRESS; > > + } > > /* > > * Automatic clock gating does not work for SD cards that may > = > ... > = In general I'll drop SD express patch for now, it will be re-introduced in = a future patch. Best regards, Andrea _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel