Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2480555ybx; Fri, 8 Nov 2019 05:02:47 -0800 (PST) X-Google-Smtp-Source: APXvYqyZUqSSMTPZYfM9z9GpXhrAzWMo+rXxCZf1Lm0DSouWdSVddqU/nlEQj3gFWiuBQ3efrneC X-Received: by 2002:a2e:921a:: with SMTP id k26mr6923729ljg.238.1573218167177; Fri, 08 Nov 2019 05:02:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573218167; cv=none; d=google.com; s=arc-20160816; b=SzmHlgFhuHNCz/Horw0p8L1BGWSPJ9jXMR7HycTXac2OF3J5PwsonuDBMhu9/uQTE6 Fr6gZ77K7SkeZd6ApNF+8WHFYoxDv3JAiBG8esJsnw23dk6lk6vh9+Nc4N1pnkOxGZ6A vFTcP2IoUKZV2zcVLM7MWR6nvwQEkPKNd616a9at2q6COBbkVI5M2VQxpfOkhPZ76hcv 05lUbFyTEqpZn5uOfHhg7G/MORprGS7/nZ7Kl2vWtSgWd25+xO7cpOqevzCEuY/OIkFk b8WgqmwdT0Yp7zsIh5akiLiby9NIUslpXvwwW0kAyh9KQwDEqpolj2pyozPCqDmmofzx XJAA== 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=ZekbabXCPgDix0mV9AcQnO633/TLQ+c6dMS4dOgnB5g=; b=XcoF/BjHyeprGjGwpNZ51eiWCjP/gvmoIauzTEaTJYWJuuOqWUc/kp/rmHSsRgsLWq nKe6MfXxe5WTPbJKjpwQyLByJCfTK+e4yHcRiLHVeWCtqfrf4MiHOW+v4FCvQlA1Jk0C L58ZanJ46FwaX53h2vrnHH1Mriu35y7OLVHEoBtU2fpMD9vKuC/d6Gd0x0bIntWizr/Y GCmattENn5eLbUGqhWY97e37pCYeCszElJznYGjSPRqWqbb3AQV5d2BpY0JkhcVylpTg sGgJyqaR/Dlni13fZewQJbnIfmtBTEOrsnCPbfBBFTrO0/b5L7ZjGRjbMoe51Y2vIX+p FL7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b="B/xZo0Rr"; 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 h26si3748141ejy.355.2019.11.08.05.02.24; Fri, 08 Nov 2019 05:02:47 -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="B/xZo0Rr"; 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 S1727821AbfKHNBh (ORCPT + 99 others); Fri, 8 Nov 2019 08:01:37 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:43688 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727688AbfKHNBf (ORCPT ); Fri, 8 Nov 2019 08:01:35 -0500 Received: by mail-lj1-f193.google.com with SMTP id y23so6099925ljh.10 for ; Fri, 08 Nov 2019 05:01:32 -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=ZekbabXCPgDix0mV9AcQnO633/TLQ+c6dMS4dOgnB5g=; b=B/xZo0RrHCJyuvVZivt2CjwHFp/RR66mRkGQgHnOynN41VAmVQ3pl1D/E66J+ArKGL Gfyb0DEzvNycushflGaz+pEn1sxlOzX7sHsRCL1LiVYG/on1mH3xhc+kbmGVl4LeO5V0 df1bV9WCV4KW8U/dTC+tlVjDuAR5cCH+el02s= 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=ZekbabXCPgDix0mV9AcQnO633/TLQ+c6dMS4dOgnB5g=; b=NdSeBqvq1Kyi8RjgaNoQqzkdn9uWucR9O0liUC3GPer88FxV0TeEArowb+HRj8wwLf dzqRJqiJkqFy90dyauXpKXBDfpVHjWXbbWhlVMsLggmkGlrfhH2hX+AHhuCLFPSrSDVZ vNTNuPZfx6Vq+M03rzwaodCXLYAWvN7URJUjzpouTCAqZ4MjnOk0jvAJTBIyI6x1vk2N w4n8RTZ1nNpfL6g5UxtwOjjvj0GqNo4LFL7/nb3iulCHfLuBWRxRtqmWN0qqqNMFEeHH MOrBWhJt40vjy0uTX24MUnBNsTAdFHJNcNSjRTIn6TT56QP1YQazCV6lihynZE11aHBx Hu7Q== X-Gm-Message-State: APjAAAWkJTTTyjRe8HDPzaJj+ltzrM+l11cEuZKTV6TASO9FRZkinai0 TdEoAnhqwGovht/KqYK+gLYjOQ== X-Received: by 2002:a2e:3805:: with SMTP id f5mr6440382lja.220.1573218091677; Fri, 08 Nov 2019 05:01:31 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id d28sm2454725lfn.33.2019.11.08.05.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 05:01:31 -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 , Rasmus Villemoes , netdev@vger.kernel.org Subject: [PATCH v4 03/47] soc: fsl: qe: rename qe_(clr/set/clrset)bit* helpers Date: Fri, 8 Nov 2019 14:00:39 +0100 Message-Id: <20191108130123.6839-4-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191108130123.6839-1-linux@rasmusvillemoes.dk> References: <20191108130123.6839-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. 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