From patchwork Fri May 24 18:27:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13673524 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 D52C6C25B79 for ; Fri, 24 May 2024 18:29:28 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8ykntCZzdTpuk04AS1Bl2wZoN6Szl8NCKY1S3dyoLD0=; b=p2IRr4PEkebidK iesHjpgh0bZq23CVyiqRh6cv/QQYP97uq5iMRJUvCBcmIdOj3KTCLeOJrPRnqu6B/YSsuDhQWqoR6 IBD1WQ8hzJEn1SIJxjsPuvDq4/rF5kILinmgv/MVbEGTc1xDxGq2DmBDVnUlEVq8TkxDFQ/FXZFf7 Hu0BIsTqnrpKih73bJO0HT9wW+hU5bISH17LHXdz5R9CVIyxmgYB4FcXry/ThVmKMMWObtftAnO0i rgJ62U7kgfxH2cJr7epFK4cwIU3vUnh+x5SkHrdDOgles4PGike2Hy+eSpgRVgnxHkKIdAxBdLBeE GVY3oayQg+890zzIYqjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAZfL-00000009a7u-2g5H; Fri, 24 May 2024 18:29:19 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAZeC-00000009ZHO-1FUt for linux-arm-kernel@bombadil.infradead.org; Fri, 24 May 2024 18:28:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=U0fkVyk6q1d4tTjNi28+nVqK2ri87Lnbs7bXh9cTiug=; b=qE4dc/54erSki8ew7K5umhJSVl WLSBUB+e5as6B2EuNw8uiQ3v7tJS1YFvq7GGSsdz/pQFVhXeRySNqf4zxHy/95v9RiLOSz1xX8c08 fnA9ZzLtRY2xExKdGefX6n9qFrY6gcqntekZwhbOSmp7jComlA01ckHrPt+HTER6fNnCT3QBzn1Pb aH5gVc3FF/w+im+PR57AfcquB0A1y7KRjgtW2+CdR74C423RKf+DAPCtDhcfaavZk9yTZBqj9UgPr 1MqiZyPQCR19bcBEDniO2OJKz3cnwVFpEZaCul6gUamA4rD4C00xc2+dgFPPHnUrsq9xOYvx5ww1p RypS3xKg==; Received: from mail-wm1-x362.google.com ([2a00:1450:4864:20::362]) by casper.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAZe8-00000002w4e-0Zz6 for linux-arm-kernel@lists.infradead.org; Fri, 24 May 2024 18:28:06 +0000 Received: by mail-wm1-x362.google.com with SMTP id 5b1f17b1804b1-420298ff5b1so88863115e9.1 for ; Fri, 24 May 2024 11:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1716575280; x=1717180080; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U0fkVyk6q1d4tTjNi28+nVqK2ri87Lnbs7bXh9cTiug=; b=GLACGhbtRx5WnZTfh7i4URcHy2Jnwswmb+EGL3Q6zRy+TgbDJ6HFyzjS52cX1inc+b 6xCEbOK0LJ5d6pHiKL49xqf3mMNr0YqfzPFZRai5eWZl2/wVlXFNTGNkczzjahfiCAd8 tyhJRf0zxQlVK4uOy1eFrqBZOZJ4t4mv4eD2BxgVL8IlosO6rZqw9dDLfOwHwYdg5AuV Tj2X/dcXC61aywNGOpKnHpQUx6G2VfDvo50HvUarmEtTPEgNHEd2bX2P/YNvYHsUC76A kyzSWPtNKNhqw2mX4sxZnagK+4q5WU3ToYAvbBdkXzNoQvYbQxUWm4s3PQxxhZ+zhu3N 2aKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716575280; x=1717180080; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U0fkVyk6q1d4tTjNi28+nVqK2ri87Lnbs7bXh9cTiug=; b=MzmvvW8NDVhT2T7fwlLo3n5VkufvLSc6Xtklg7rf3hcsUEd0p2dTat9WCG4+DJYn/F ZgJg+rajMdJBnPhpkYviCZc6iMIGaG17L0jnF66aI3N4ao4k48oIGnHoRigWyWUyzjoI H17H2dnhd9WnqoR4fJTQl3kfDEme5sy8ZpfKb4tuYbz5qvZLRTEimKBa8w9xCXLIdZrs NchMRYXEfpZyV1ZKL60uRIkbxnPgDa0eKIVmmzJX+IWKD/5+YiONuXkKF3wX0nHpCZSp Y5WUeECWUwOL4RKWYKL+cfdJLSvZLritWxvK6lViw/35iJ7t5ZDkGj5+T4yoMuYnaIpl hHlg== X-Forwarded-Encrypted: i=1; AJvYcCXJdXWrNzNIEuBmFGKNolRy1b9OCXJ/rnlel+oUQ1GGiqLBKyBddtTHA6+WHpo4QPUezTe9P6OIDvd3NTuPKY57zrOAPMCoTOFhEY92lf0HJ5UUDak= X-Gm-Message-State: AOJu0YzYKr2YobwI0KBa6uC3w8Qk34rWuqI2QmQBTw/EGj9dH928ejXp X/b/Q5mAiCZSsVgpGsVe5sZA3comzpItXoFmxYSRXMA9jz/0wSMrhbJ67N+YLs4j2J/gMNWHL8f JFtqp6EjZfgEeyFUgCKmmEWiMPjff5I3o X-Google-Smtp-Source: AGHT+IGBxnWkfl21ZWcAGGbY9pK5CCtvRZEInE2s9wbG2L53cMYgxcodxHXuIlPQ/f02qRVKa1ge9AFPlvFh X-Received: by 2002:a05:600c:3152:b0:421:757:4d3e with SMTP id 5b1f17b1804b1-42108a40f7emr33721035e9.16.1716575280608; Fri, 24 May 2024 11:28:00 -0700 (PDT) Received: from raspberrypi.com ([188.39.149.98]) by smtp-relay.gmail.com with ESMTPS id 5b1f17b1804b1-42100fb1394sm5457725e9.43.2024.05.24.11.28.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 11:28:00 -0700 (PDT) X-Relaying-Domain: raspberrypi.com From: Dave Stevenson To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Vinod Koul , Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Ulf Hansson , Mark Brown , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Vladimir Murzin , Phil Elwell , Stefan Wahren , Serge Semin Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mmc@vger.kernel.org, linux-spi@vger.kernel.org, iommu@lists.linux.dev, linux-sound@vger.kernel.org, Dave Stevenson Subject: [PATCH 16/18] drm/vc4: Use phys addresses for slave DMA config Date: Fri, 24 May 2024 19:27:00 +0100 Message-Id: <20240524182702.1317935-17-dave.stevenson@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240524182702.1317935-1-dave.stevenson@raspberrypi.com> References: <20240524182702.1317935-1-dave.stevenson@raspberrypi.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240524_192804_382630_0963D95D X-CRM114-Status: GOOD ( 13.69 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Phil Elwell Slave addresses for DMA are meant to be supplied as physical addresses (contrary to what struct snd_dmaengine_dai_dma_data does). Signed-off-by: Phil Elwell Signed-off-by: Dave Stevenson --- drivers/gpu/drm/vc4/vc4_hdmi.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index d30f8e8e8967..c2afd72bd96e 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2696,7 +2696,7 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) struct snd_soc_card *card = &vc4_hdmi->audio.card; struct device *dev = &vc4_hdmi->pdev->dev; struct platform_device *codec_pdev; - const __be32 *addr; + struct resource *iomem; int index, len; int ret; @@ -2732,22 +2732,15 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) } /* - * Get the physical address of VC4_HD_MAI_DATA. We need to retrieve - * the bus address specified in the DT, because the physical address - * (the one returned by platform_get_resource()) is not appropriate - * for DMA transfers. - * This VC/MMU should probably be exposed to avoid this kind of hacks. + * Get the physical address of VC4_HD_MAI_DATA. */ index = of_property_match_string(dev->of_node, "reg-names", "hd"); /* Before BCM2711, we don't have a named register range */ if (index < 0) index = 1; + iomem = platform_get_resource(vc4_hdmi->pdev, IORESOURCE_MEM, index); - addr = of_get_address(dev->of_node, index, NULL, NULL); - if (!addr) - return -EINVAL; - - vc4_hdmi->audio.dma_data.addr = be32_to_cpup(addr) + mai_data->offset; + vc4_hdmi->audio.dma_data.addr = iomem->start + mai_data->offset; vc4_hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; vc4_hdmi->audio.dma_data.maxburst = 2;