From patchwork Fri Jan 15 02:50:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmarao Begari X-Patchwork-Id: 1426766 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=85.214.62.61; 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=DuFNuJwn; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4DH5bR2pBtz9sWb for ; Fri, 15 Jan 2021 14:03:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 986AF827FC; Fri, 15 Jan 2021 04:02:59 +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="DuFNuJwn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 576A7827FC; Fri, 15 Jan 2021 04:02:56 +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.154.123]) (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 3C720827F8 for ; Fri, 15 Jan 2021 04:02:50 +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=1610679770; x=1642215770; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=U6SLrtn0Ah7F8OWPGX5AL8wq+j9kqJVB1qp+/NLfX1o=; b=DuFNuJwnNOUCkN33Rmbb0OVZiLH+NNilnRtuStPWZ1QiKPPoqNat1k/M k7gvqyLREYRUFgFGvEHh0PPx5Xy2nShV0WRXOu7YF3WROkw1ZE6aWCac1 4+KULBdUKEoMvjeMnjNn4lrG+7JfbHCQtVGTBK9Rvxl74fMGjcKEC97bY 80RBWQfszqLKj3BbG8DaLNwJr+CNLN5MvR86kVP1B04lj18P+C8e4/LU1 XoX8xmsWQ27PMpxrc6uEUgnH2UWE4bKo7TRwzP18HvgLvXPPB59rgIYba Cvulezu7/afYq2EJyXol6pFn92Tyai5mekINZrQJwxzKp1gkTbO/JqcsD A==; IronPort-SDR: ejwuA+gKmxFq1Hvfh4VM4J7X0DTTNokf3bbsSGGqbGxCzuYPsD7+00rcgmL1Qn9yhX5hk86H2p cxlneGWTFZY7XxXj39t4ipzQRn+Z+ULgGJu34ArNxg6zcgd5itq+L71ahc+/1p68CeI/edvnJK CD9Uf+ZgJiDEWl3KU2S4cGyF1TxXe7KWPlPQ0jK3KEMR/93XehalC2o0uw4AXu2iFiTvWbcRvA QUsZNMruTAQwQSCmeXMz/fC7pgo5JeqYBQjASVZOYn3JqS0q5LtezKZm+01reju/n83eATE5tj ONw= X-IronPort-AV: E=Sophos;i="5.79,348,1602572400"; d="scan'208";a="102950475" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Jan 2021 20:02:47 -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; Thu, 14 Jan 2021 20:02:47 -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; Thu, 14 Jan 2021 20:02:43 -0700 From: Padmarao Begari To: , , , , , , , CC: , , , , , Padmarao Begari Subject: [PATCH v9 1/7] riscv: Add DMA 64-bit address support Date: Fri, 15 Jan 2021 08:20:35 +0530 Message-ID: <20210115025041.3503-2-padmarao.begari@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210115025041.3503-1-padmarao.begari@microchip.com> References: <20210115025041.3503-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 Reviewed-by: Rick Chen --- 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;