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: 39640 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 805AF24026 for ; Mon, 27 Oct 2014 15:39:38 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf1269644lab.3 for ; Mon, 27 Oct 2014 08:39:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=/krX39h+sld77WE2v7TZTowcG5ZwQ5LfFvnDKFOsH4g=; b=Q3Y/j0MOZCMk6OoPWvwk0e3hR3c8HiUce30tLaaUeP1KggNRIUWEjpqwgmeua93Weg 4/LUicYqjg+JlO//xBDyiyuhpDBD9/23Qbxqh75vNBTeTh72zc3a5Ips7PCWRO7rsUCL FU+oCf05X1R5ua0B14tfqjpS0NvVJB34pBcvNMyeVPpS6c2/xL0Wzn6Uiqp+8xjsMK5C 2ILb/gRkX0nb+aaSBAPUPRcsWvYl1iZhhSjsBVe4CYTHszHID5QeXtKKjW2CeSq3oW/r ZyyxLaobeQgH2qYRPZdc3MoGTInuFDf2KJl8RliEZLeajogOt63wV/hh8TQS6zaQt4Xg Cn/Q== X-Gm-Message-State: ALoCoQlEv1x4h1XyB1FjivMm2lSKhljpY/tgEoRDif4PWJBT/0RnupsjIeid/6vtD9WxBpWQsT96 X-Received: by 10.180.96.101 with SMTP id dr5mr4019267wib.0.1414424377312; Mon, 27 Oct 2014 08:39:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.7 with SMTP id cq7ls737727lad.8.gmail; Mon, 27 Oct 2014 08:39:37 -0700 (PDT) X-Received: by 10.112.198.226 with SMTP id jf2mr10564467lbc.84.1414424377125; Mon, 27 Oct 2014 08:39:37 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id qy3si20592222lbb.3.2014.10.27.08.39.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 08:39:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id mc6so1705220lab.26 for ; Mon, 27 Oct 2014 08:39:36 -0700 (PDT) X-Received: by 10.153.8.164 with SMTP id dl4mr24580614lad.29.1414424376857; Mon, 27 Oct 2014 08:39:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp315530lbz; Mon, 27 Oct 2014 08:39:36 -0700 (PDT) X-Received: by 10.66.148.225 with SMTP id tv1mr4796432pab.17.1414424375073; Mon, 27 Oct 2014 08:39:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yl3si10732699pbb.152.2014.10.27.08.39.30 for ; Mon, 27 Oct 2014 08:39:35 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752226AbaJ0PjS (ORCPT + 26 others); Mon, 27 Oct 2014 11:39:18 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:58227 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751565AbaJ0PjO (ORCPT ); Mon, 27 Oct 2014 11:39:14 -0400 Received: by mail-pd0-f172.google.com with SMTP id r10so5886343pdi.31 for ; Mon, 27 Oct 2014 08:39:13 -0700 (PDT) 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 Cc: catalin.marinas@arm.com, stefano.stabellini@eu.citrix.com, ezequiel.garcia@free-electrons.com, Liviu.Dudau@arm.com, thomas.petazzoni@free-electrons.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mathieu.poirier@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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; })