From patchwork Mon Oct 27 15:38:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 5161991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7573CC11AC for ; Mon, 27 Oct 2014 15:41:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FB3120172 for ; Mon, 27 Oct 2014 15:41:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D6DE2017D for ; Mon, 27 Oct 2014 15:41:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XimOR-00084h-LG; Mon, 27 Oct 2014 15:39:39 +0000 Received: from mail-pd0-f179.google.com ([209.85.192.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XimON-0007m2-DW for linux-arm-kernel@lists.infradead.org; Mon, 27 Oct 2014 15:39:36 +0000 Received: by mail-pd0-f179.google.com with SMTP id g10so5823715pdj.24 for ; Mon, 27 Oct 2014 08:39:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fBhIIsULSQvDWwfggLsE+5lAonZ7IX5HNc5WgexCrfo=; b=j8TPlOLAGCNgrRUtPVpH8i4hMddC8tMsjKdHQodTYSx5kQxkd3VXZkMVKlzTud/ylN oNnRfnLfFqV6FN07Fquw52Dbu945L/tpSWRA+a6iLS3oxQUjo1EibjY/AWrL5VIotRb7 ig8HXdlxekfjXB7bWi6asuOhCwgO4XWT890N2LsUG1Ugqovdaof9vhcWKBktytQU8BJ7 0dri4YA8cdVx2YFCB8fcvj7M+opnngrZbp21bwkEyuVkglxp5bKusJFHEBHodWT5LW/+ GdA4oPRZ6H1lF5B/bmvcxreuoj7q1dgtF+hCPmVAAJp1Y81WgpZ/hpFoVWyBnhjC+XH0 aEBQ== X-Gm-Message-State: ALoCoQnlservmujy+NVTTJd74/SdxRmKplcv5sejcaYUZTAHjvafEbZ2wO6dJ+J4LMRbgyeUc7FQ X-Received: by 10.66.136.143 with SMTP id qa15mr24981365pab.90.1414424353729; Mon, 27 Oct 2014 08:39:13 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [70.73.24.112]) by mx.google.com with ESMTPSA id uf6sm11297829pac.16.2014.10.27.08.39.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Oct 2014 08:39:13 -0700 (PDT) From: mathieu.poirier@linaro.org To: linux@arm.linux.org.uk Subject: [PATCH v3] ARM: supplementing IO accessors with 64 bit capability Date: Mon, 27 Oct 2014 09:38:59 -0600 Message-Id: <1414424339-23834-1-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141027_083935_475660_C174BE36 X-CRM114-Status: GOOD ( 10.19 ) X-Spam-Score: -0.7 (/) Cc: thomas.petazzoni@free-electrons.com, mathieu.poirier@linaro.org, stefano.stabellini@eu.citrix.com, catalin.marinas@arm.com, Liviu.Dudau@arm.com, linux-kernel@vger.kernel.org, ezequiel.garcia@free-electrons.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mathieu Poirier Some drivers on ARMv7 need 64 bit read and writes. Signed-off-by: Mathieu Poirier Acked-by: Nicolas Pitre --- Change for v3: - Bumped architecture version from 5 to 6 arch/arm/include/asm/io.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 1805674..b755776 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -118,6 +118,24 @@ static inline u32 __raw_readl(const volatile void __iomem *addr) return val; } +#if __LINUX_ARM_ARCH__ >= 6 +static inline void __raw_writeq(u64 val, volatile void __iomem *addr) +{ + asm volatile("strd %1, %0" + : "+Qo" (*(volatile u64 __force *)addr) + : "r" (val)); +} + +static inline u64 __raw_readq(const volatile void __iomem *addr) +{ + u64 val; + asm volatile("ldrd %1, %0" + : "+Qo" (*(volatile u64 __force *)addr), + "=r" (val)); + return val; +} +#endif + /* * Architecture ioremap implementation. */ @@ -306,10 +324,17 @@ extern void _memset_io(volatile void __iomem *, int, size_t); __raw_readw(c)); __r; }) #define readl_relaxed(c) ({ u32 __r = le32_to_cpu((__force __le32) \ __raw_readl(c)); __r; }) +#if __LINUX_ARM_ARCH__ >= 6 +#define readq_relaxed(c) ({ u64 __r = le64_to_cpu((__force __le64) \ + __raw_readq(c)); __r; }) +#endif #define writeb_relaxed(v,c) __raw_writeb(v,c) #define writew_relaxed(v,c) __raw_writew((__force u16) cpu_to_le16(v),c) #define writel_relaxed(v,c) __raw_writel((__force u32) cpu_to_le32(v),c) +#if __LINUX_ARM_ARCH__ >= 6 +#define writeq_relaxed(v,c) __raw_writeq((__force u64) cpu_to_le64(v),c) +#endif #define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v; }) #define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v; })