Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6873294ybc; Thu, 28 Nov 2019 06:58:52 -0800 (PST) X-Google-Smtp-Source: APXvYqzaWTZkxvq1RfFOhIwabdWeghA7ELJSATV0DvfbJPb+fX0JyiT+2YzLX3LoBbpBrywBXLxA X-Received: by 2002:aa7:d64e:: with SMTP id v14mr39060758edr.88.1574953132005; Thu, 28 Nov 2019 06:58:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574953131; cv=none; d=google.com; s=arc-20160816; b=iLNpvqVSIo1jmvyA0Rl+xg2qf9fR2+RX1UbEUMR+onjee6iQUitj7+WDTDLJABHosB HEruppWwZek8nU40JUpU+wyHIxnZV6rQ2tGr7MxCIPEQ/Znl607p3zVDgmE3QOGv/lYQ 4kxDzbCVkEMKD4m2prJwKH3anS7sw/Jan+CXOf8yX/gQXhW4lWuPXQ0QUG1ZKInZIZdK URzaN1oPLp/OKWPC3p9VxyaksoOff+JgS3FaqqsYtTlsmCNqeZCSCsrySoc/nu0eDyQg Tw3mBZRnE7OAxKih74vVP5jiz+VQ4V+Vfid/jfiMEXotuwyTijyR7gPhFBS+cNIIxRgh mrmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AiGMJuBYK7a9OjqplEnlhTed0vj3Z2tvo3Sm0/6smWk=; b=rU/8EwEdosdKv+83ILkNs4HJtjIWxBCxTw/K2UwDIyMeInTf770qQbHfaxUoIeCU8y Gl9l0tIgZYt+zyJUjTnGQd86KowUAHhKf4Nq4QZhE1N2wtFIWafrivSh0kqB0JJtRuLp nvOnOVCY5bxIOmLgpWt9WM1mI8rM2EcoqBJsm1/ZnUJiWijaVCDwtMQ949rCjUdJLgL3 hfqLSAQ8u+d+s/OQ8qEgStLBQAh3XV8rwhRsdTLMaaGCII+XrHY+4zmaxslU9SEurZ0E X/BkNjOOd7NS+yVUNFm/kAkKAFhL/Nsm3Yn+Y8+SkVFZWGlVrQUWfwrx90mtI8LLJyKq w5Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=LWSeFBBM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t30si14326489edi.207.2019.11.28.06.58.27; Thu, 28 Nov 2019 06:58:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=LWSeFBBM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727225AbfK1O5M (ORCPT + 99 others); Thu, 28 Nov 2019 09:57:12 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:43496 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbfK1O5K (ORCPT ); Thu, 28 Nov 2019 09:57:10 -0500 Received: by mail-lj1-f196.google.com with SMTP id a13so5669480ljm.10 for ; Thu, 28 Nov 2019 06:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AiGMJuBYK7a9OjqplEnlhTed0vj3Z2tvo3Sm0/6smWk=; b=LWSeFBBM1EDIZG6BRK7BzXkMhomfAGPxWZw5tbDhgh3j0xwb1HqC6ORUdqAUR5hYkz tbFM6GCvupYGGSa1wW3LvEjbWfoc5kdkGYD4XmkX+Hmxi8jZ2xrI5mbIBgUADs+agsCg Sgeh5ezUo/C4MaGgCfg+Rdd5Xt0dYaqfP4JhY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AiGMJuBYK7a9OjqplEnlhTed0vj3Z2tvo3Sm0/6smWk=; b=b+uvPv0SNqYGrqlLbYVMXJKmmXRNFWOa6XBOH94PGRX2LN+DOv4IlbfaqxWKJ8iCfE kHtw4jjU6n2TVpJZ2pOWtP2vY/4/fFb5nl4HXd/B5C9NLiNMNwKlcvbrCjt57GicvVoH VED5b8BxZ/LhuteJk2uQFoLXTFXNXIzXj21k3UPpbzvYXt1QmZWaVm6T/yoHjIPXIitU Ell0LiXYLxujnVzJdCrS1Tf2UDQ6tyUapHkiF8frCPPRf/5cZBVOXLj4ou5iu+nFW0p1 pdfq4biRuBmCiCJuxsyDb/3Q2ORNvHqSwDC2n1cI3q3DVNqnvVhSqZf1pAYDokpbvl2s fKqw== X-Gm-Message-State: APjAAAWy//48NruJ0+MWcIA6jrscPEGM7hfmP8zpphCbFF8vsH9tG3wX /JirOHRBYBBfI9r/eFGWJnk36w== X-Received: by 2002:a2e:8855:: with SMTP id z21mr36008857ljj.212.1574953028055; Thu, 28 Nov 2019 06:57:08 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id u2sm2456803lfl.18.2019.11.28.06.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 06:57:07 -0800 (PST) From: Rasmus Villemoes To: Qiang Zhao , Li Yang , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Scott Wood , Timur Tabi , Rasmus Villemoes , netdev@vger.kernel.org Subject: [PATCH v6 03/49] soc: fsl: qe: rename qe_(clr/set/clrset)bit* helpers Date: Thu, 28 Nov 2019 15:55:08 +0100 Message-Id: <20191128145554.1297-4-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191128145554.1297-1-linux@rasmusvillemoes.dk> References: <20191128145554.1297-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make it clear that these operate on big-endian registers (i.e. use the iowrite*be primitives) before we introduce more uses of them and allow the QE drivers to be built for platforms other than ppc32. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/net/wan/fsl_ucc_hdlc.c | 4 ++-- drivers/soc/fsl/qe/ucc.c | 10 +++++----- include/soc/fsl/qe/qe.h | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c index ca0f3be2b6bf..ce6af7d5380f 100644 --- a/drivers/net/wan/fsl_ucc_hdlc.c +++ b/drivers/net/wan/fsl_ucc_hdlc.c @@ -623,8 +623,8 @@ static int ucc_hdlc_poll(struct napi_struct *napi, int budget) if (howmany < budget) { napi_complete_done(napi, howmany); - qe_setbits32(priv->uccf->p_uccm, - (UCCE_HDLC_RX_EVENTS | UCCE_HDLC_TX_EVENTS) << 16); + qe_setbits_be32(priv->uccf->p_uccm, + (UCCE_HDLC_RX_EVENTS | UCCE_HDLC_TX_EVENTS) << 16); } return howmany; diff --git a/drivers/soc/fsl/qe/ucc.c b/drivers/soc/fsl/qe/ucc.c index 024d239ac1e1..ae9f2cf560cb 100644 --- a/drivers/soc/fsl/qe/ucc.c +++ b/drivers/soc/fsl/qe/ucc.c @@ -540,8 +540,8 @@ int ucc_set_tdm_rxtx_clk(u32 tdm_num, enum qe_clock clock, cmxs1cr = (tdm_num < 4) ? &qe_mux_reg->cmxsi1cr_l : &qe_mux_reg->cmxsi1cr_h; - qe_clrsetbits32(cmxs1cr, QE_CMXUCR_TX_CLK_SRC_MASK << shift, - clock_bits << shift); + qe_clrsetbits_be32(cmxs1cr, QE_CMXUCR_TX_CLK_SRC_MASK << shift, + clock_bits << shift); return 0; } @@ -650,9 +650,9 @@ int ucc_set_tdm_rxtx_sync(u32 tdm_num, enum qe_clock clock, shift = ucc_get_tdm_sync_shift(mode, tdm_num); - qe_clrsetbits32(&qe_mux_reg->cmxsi1syr, - QE_CMXUCR_TX_CLK_SRC_MASK << shift, - source << shift); + qe_clrsetbits_be32(&qe_mux_reg->cmxsi1syr, + QE_CMXUCR_TX_CLK_SRC_MASK << shift, + source << shift); return 0; } diff --git a/include/soc/fsl/qe/qe.h b/include/soc/fsl/qe/qe.h index c1036d16ed03..a1aa4eb28f0c 100644 --- a/include/soc/fsl/qe/qe.h +++ b/include/soc/fsl/qe/qe.h @@ -241,20 +241,20 @@ static inline int qe_alive_during_sleep(void) #define qe_muram_offset cpm_muram_offset #define qe_muram_dma cpm_muram_dma -#define qe_setbits32(_addr, _v) iowrite32be(ioread32be(_addr) | (_v), (_addr)) -#define qe_clrbits32(_addr, _v) iowrite32be(ioread32be(_addr) & ~(_v), (_addr)) +#define qe_setbits_be32(_addr, _v) iowrite32be(ioread32be(_addr) | (_v), (_addr)) +#define qe_clrbits_be32(_addr, _v) iowrite32be(ioread32be(_addr) & ~(_v), (_addr)) -#define qe_setbits16(_addr, _v) iowrite16be(ioread16be(_addr) | (_v), (_addr)) -#define qe_clrbits16(_addr, _v) iowrite16be(ioread16be(_addr) & ~(_v), (_addr)) +#define qe_setbits_be16(_addr, _v) iowrite16be(ioread16be(_addr) | (_v), (_addr)) +#define qe_clrbits_be16(_addr, _v) iowrite16be(ioread16be(_addr) & ~(_v), (_addr)) -#define qe_setbits8(_addr, _v) iowrite8(ioread8(_addr) | (_v), (_addr)) -#define qe_clrbits8(_addr, _v) iowrite8(ioread8(_addr) & ~(_v), (_addr)) +#define qe_setbits_8(_addr, _v) iowrite8(ioread8(_addr) | (_v), (_addr)) +#define qe_clrbits_8(_addr, _v) iowrite8(ioread8(_addr) & ~(_v), (_addr)) -#define qe_clrsetbits32(addr, clear, set) \ +#define qe_clrsetbits_be32(addr, clear, set) \ iowrite32be((ioread32be(addr) & ~(clear)) | (set), (addr)) -#define qe_clrsetbits16(addr, clear, set) \ +#define qe_clrsetbits_be16(addr, clear, set) \ iowrite16be((ioread16be(addr) & ~(clear)) | (set), (addr)) -#define qe_clrsetbits8(addr, clear, set) \ +#define qe_clrsetbits_8(addr, clear, set) \ iowrite8((ioread8(addr) & ~(clear)) | (set), (addr)) /* Structure that defines QE firmware binary files. -- 2.23.0