From owner-dev-commits-src-all@freebsd.org Wed Jun 2 08:05:05 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 7497663D959; Wed, 2 Jun 2021 08:05:05 +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 4Fw1m12W2Vz4Y3M; Wed, 2 Jun 2021 08:05:05 +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 3B9321394D; Wed, 2 Jun 2021 08:05:05 +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 152855dK072952; Wed, 2 Jun 2021 08:05:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152855ha072951; Wed, 2 Jun 2021 08:05:05 GMT (envelope-from git) Date: Wed, 2 Jun 2021 08:05:05 GMT Message-Id: <202106020805.152855ha072951@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: 7d8700bc291b - main - sdhci: extend bus_dma_tag boundary to 64-bit space 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: 7d8700bc291b4b3be1a592cae539f9e682592d9d 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:05 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=7d8700bc291b4b3be1a592cae539f9e682592d9d commit 7d8700bc291b4b3be1a592cae539f9e682592d9d Author: Marcin Wojtas AuthorDate: 2021-04-28 08:55:40 +0000 Commit: Marcin Wojtas CommitDate: 2021-06-02 07:55:19 +0000 sdhci: extend bus_dma_tag boundary to 64-bit space This patch adds support for the SDHCI_CAN_DO_64BIT capability, so that to allow 64-bit DMA operation for the controllers which support this feature. Reviewed by: manu Obtained from: Semihalf Sponsored by: Marvell Differential Revision: https://reviews.freebsd.org/D30560 MFC after: 2 weeks --- sys/dev/sdhci/sdhci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index 0441320d4b35..68a3cf9ab4d3 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -132,7 +132,7 @@ static int sdhci_cam_update_ios(struct sdhci_slot *slot); #endif /* helper routines */ -static int sdhci_dma_alloc(struct sdhci_slot *slot); +static int sdhci_dma_alloc(struct sdhci_slot *slot, uint32_t caps); static void sdhci_dma_free(struct sdhci_slot *slot); static void sdhci_dumpregs(struct sdhci_slot *slot); static void sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, @@ -717,7 +717,7 @@ sdhci_card_poll(void *arg) } static int -sdhci_dma_alloc(struct sdhci_slot *slot) +sdhci_dma_alloc(struct sdhci_slot *slot, uint32_t caps) { int err; @@ -750,7 +750,8 @@ sdhci_dma_alloc(struct sdhci_slot *slot) * be aligned to the SDMA boundary. */ err = bus_dma_tag_create(bus_get_dma_tag(slot->bus), slot->sdma_bbufsz, - 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + 0, (caps & SDHCI_CAN_DO_64BIT) ? BUS_SPACE_MAXADDR : + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, slot->sdma_bbufsz, 1, slot->sdma_bbufsz, BUS_DMA_ALLOCNOW, NULL, NULL, &slot->dmatag); if (err != 0) { @@ -1032,7 +1033,7 @@ no_tuning: slot->opt &= ~SDHCI_HAVE_DMA; if (slot->opt & SDHCI_HAVE_DMA) { - err = sdhci_dma_alloc(slot); + err = sdhci_dma_alloc(slot, caps); if (err != 0) { if (slot->opt & SDHCI_TUNING_SUPPORTED) { free(slot->tune_req, M_DEVBUF);