From patchwork Mon Dec 14 10:55:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmarao Begari X-Patchwork-Id: 1415891 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=EtuNgy7X; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cvdt60sy2z9sTK for ; Mon, 14 Dec 2020 22:08:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C32BC82805; Mon, 14 Dec 2020 12:08:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.b="EtuNgy7X"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9CC86827EF; Mon, 14 Dec 2020 12:08:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C4B51827EF for ; Mon, 14 Dec 2020 12:08:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Padmarao.Begari@microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1607944088; x=1639480088; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=NlIiATX8WKHBtVfeZOUvapU4b7p5AxbB5VdYxtaggPg=; b=EtuNgy7XtUWvvK6anjEJG5+l0u2rTCmE4lXooPDB2NyYTj3jJOa26/Te hx37LrOa+X4gqfCbeZD/3Gx+3XhVXXSuYsGoZKk0PB+XcOVgx0y+gCz1P 94IdzCpO9qmtJ2nHtSpnd8ekYDVMih8ha1vaQP66b2D+h4sl7awIYpp/P xvjCprSvHUJQionNNgXaw+FjwcnbmHtAlEfTAv7Q9kJvCHwzpB83oo5TG aO8mYLDWsx+uSqhv8fXeGvhL5F+S+kKtbWqPgUV9JORMAz5NqrKoYumNn c76fmMP3Z1KNrNzzDSL4upfNpr+XPZmJyALQF3eyS0Rh8UznT8sGnuJmZ A==; IronPort-SDR: co0f9HwsP0b9pnX5J+aKgrif9QI2JJp7DRO+foLjdq2HQPMuSC8dC8lhxcf/z53hr3VIoAAfaC EHNOw3pS2Odd8BV9KCOJjQESwzFn1654WAu8DSsv8E8Vr1e9JOAoQKLl9vJ3+ywIjjoVanNWWD 1L/LJzzxzVJHXkhp6anab5xKBYgAcwbILAzrUk9mGd4vONGn3sRM4RR0w1J7Wva94gAgtvQtxC cxFm1oqKIBmDIv8SxOpvMvX2sM+Pu7LNQL2GPJp7xUU+0ROsipnxkXLNYnfnW7cnhmXJNUvfxb eEw= X-IronPort-AV: E=Sophos;i="5.78,418,1599548400"; d="scan'208";a="102668408" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Dec 2020 04:08:06 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 14 Dec 2020 04:08:06 -0700 Received: from padmarao-VirtualBox.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 14 Dec 2020 04:08:01 -0700 From: Padmarao Begari To: , , , , , , , CC: , , , , , Padmarao Begari Subject: [PATCH v6 1/7] riscv: Add DMA 64-bit address support Date: Mon, 14 Dec 2020 16:25:55 +0530 Message-ID: <20201214105601.2943-2-padmarao.begari@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201214105601.2943-1-padmarao.begari@microchip.com> References: <20201214105601.2943-1-padmarao.begari@microchip.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean dma_addr_t holds any valid DMA address. If the DMA API only uses 32/64-bit addresses, dma_addr_t need only be 32/64 bits wide. Signed-off-by: Padmarao Begari Reviewed-by: Anup Patel Reviewed-by: Bin Meng --- arch/riscv/Kconfig | 4 ++++ arch/riscv/include/asm/types.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 30b05408b1..55eaee2da6 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -152,6 +152,10 @@ config 32BIT config 64BIT bool +config DMA_ADDR_T_64BIT + bool + default y if 64BIT + config SIFIVE_CLINT bool depends on RISCV_MMODE || SPL_RISCV_MMODE diff --git a/arch/riscv/include/asm/types.h b/arch/riscv/include/asm/types.h index 403cf9a48f..b800b2d221 100644 --- a/arch/riscv/include/asm/types.h +++ b/arch/riscv/include/asm/types.h @@ -29,7 +29,11 @@ typedef unsigned short umode_t; #include +#ifdef CONFIG_DMA_ADDR_T_64BIT +typedef u64 dma_addr_t; +#else typedef u32 dma_addr_t; +#endif typedef unsigned long phys_addr_t; typedef unsigned long phys_size_t;