From owner-dev-commits-src-all@freebsd.org Wed Jun 2 08:05:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 337CC63D527; Wed, 2 Jun 2021 08:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fw1m46sn2z4YV5; Wed, 2 Jun 2021 08:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95C20137A2; Wed, 2 Jun 2021 08:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152858eT073022; Wed, 2 Jun 2021 08:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152858E3073021; Wed, 2 Jun 2021 08:05:08 GMT (envelope-from git) Date: Wed, 2 Jun 2021 08:05:08 GMT Message-Id: <202106020805.152858E3073021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: df868762841b - main - sdhci_xenon: allow to properly disable the UHS signaling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df868762841b93d934413651818e510ea443def8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 08:05:09 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=df868762841b93d934413651818e510ea443def8 commit df868762841b93d934413651818e510ea443def8 Author: Marcin Wojtas AuthorDate: 2021-05-27 17:48:17 +0000 Commit: Marcin Wojtas CommitDate: 2021-06-02 07:55:19 +0000 sdhci_xenon: allow to properly disable the UHS signaling Until now the "no-1-8-v" DT flag wrongly disabled the SDHCI_CAN_VDD_180 - slot 1.8V power supply capability, whereas it refers to the signaling voltage. Fix the sdhci_xenon_read_4 and allow to disable the UHS modes depending on the DT property or PHY slow mode. While at it - make sure the unsupported 1.2V signaling is always disabled and not reported in the bootverbose log. Reviewed by: manu Obtained from: Semihalf Sponsored by: Marvell Differential Revision: https://reviews.freebsd.org/D30563 MFC after: 2 weeks --- sys/dev/sdhci/sdhci_xenon.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/dev/sdhci/sdhci_xenon.c b/sys/dev/sdhci/sdhci_xenon.c index c230f0ef9752..f92d02608abb 100644 --- a/sys/dev/sdhci/sdhci_xenon.c +++ b/sys/dev/sdhci/sdhci_xenon.c @@ -141,13 +141,8 @@ sdhci_xenon_read_4(device_t dev, struct sdhci_slot *slot __unused, bus_size_t off) { struct sdhci_xenon_softc *sc = device_get_softc(dev); - uint32_t val32; - val32 = bus_read_4(sc->mem_res, off); - if (off == SDHCI_CAPABILITIES && sc->no_18v) - val32 &= ~SDHCI_CAN_VDD_180; - - return (val32); + return bus_read_4(sc->mem_res, off); } static void @@ -519,6 +514,13 @@ sdhci_xenon_attach(device_t dev) if (sdhci_init_slot(dev, sc->slot, 0)) goto fail; + /* 1.2V signaling is not supported. */ + sc->slot->host.caps &= ~MMC_CAP_SIGNALING_120; + + /* Disable UHS in case of lack of 1.8V VCCQ or the PHY slow mode. */ + if (sc->no_18v || sc->slow_mode) + sc->slot->host.caps &= ~MMC_CAP_SIGNALING_180; + /* Activate the interrupt */ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, sdhci_xenon_intr, sc, &sc->intrhand);