Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6873967ybc; Thu, 28 Nov 2019 06:59:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxal39ztAwgWlqxpmwmI67DhTFCGYNR08L6T0XmuMp+fSBqsM638kUgPRNT3Q4rtj0OAGlV X-Received: by 2002:aa7:d0c1:: with SMTP id u1mr38980948edo.27.1574953176478; Thu, 28 Nov 2019 06:59:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574953176; cv=none; d=google.com; s=arc-20160816; b=nztDNzdS51/Q/tGUOj+d76FzxnpC3mLdi30AO78AUw6eVb3eShOm/R7rJ4BwK6qZ6S QBRfws0UIehJpNzVio9tkwswD4VV9uw009LYrBL+a5zvBQ2i5BG+tUEFKSdhN83PX7jB khcqqov8KK/D7U/wT765JudNHGus6KbXuyB+ivPqyuiyikhM9vUmXcIASkMJ1VZFhpKa IE3UUD4YloQS6HbwPJI+ze1juA/veMcQqmTQq+vNQ3nNSdPFh3RuKb3EOy/0qh1Tj3z4 f8zzATUmXe8QOoyGriNKSH49zoIDbr7s+chJk95RHZVwA4HuMkdzfb/J0gZ9pBcSTsbd kk/A== 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=r3X14YrVIUClSXLFCcykgpknPW7q8CkrbSuzPJYKIgU=; b=Ovg3qKvRDA886xeUrJjEDwq+pXbTOeFpUmVFdLtqF4GUmYlXNefxZ2GiGljmwSwU5S C8+SOQG8hwBdw1+SmNutRe9fBMMU3tr1LpQKooH4Vz/BE90PiuG82AxMFu7n8XZtEoTy Ug5kicDhkXZAx82gWKaitkSqy3bIky+6lvta/lUBfpwsrEnrEH8mGrhxbdNcvZOGMCO3 xagtqrL0ELGDg5iWxOnlQNvzARVbSxywlmn/tGeYbRU0W7npP+RIC7s2zsTJYo+fO+r2 35CsHByoB73CGs/TK5JdFp91kvuncTJJ761ErEj7o8Bh38kcwNlL3b5o9zmMgdjE6c+g glkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=BqgKvObs; 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 e13si5620745ejc.316.2019.11.28.06.59.12; Thu, 28 Nov 2019 06:59:36 -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=BqgKvObs; 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 S1727419AbfK1O5j (ORCPT + 99 others); Thu, 28 Nov 2019 09:57:39 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:42271 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727351AbfK1O5b (ORCPT ); Thu, 28 Nov 2019 09:57:31 -0500 Received: by mail-lf1-f66.google.com with SMTP id y19so20246235lfl.9 for ; Thu, 28 Nov 2019 06:57:28 -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=r3X14YrVIUClSXLFCcykgpknPW7q8CkrbSuzPJYKIgU=; b=BqgKvObsXIWxVEmBNUn1r6eHP5osq02sC3XtopwwdsqJh2mHsFg2vFe1Grf4Zhy+GH vJZ6CKNbCCoIRxx0chQzVfOFFH7i6PyxiZ7yrLxxkmzx5MQJAXtj8erlwmiR/7AoKrSs 5MlYJ+l3O471MKMNl0wm+kxWUwwPKQs4RLmLE= 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=r3X14YrVIUClSXLFCcykgpknPW7q8CkrbSuzPJYKIgU=; b=EQUGyY/4cemPz4hSmCe2fqxgEs/ttD5k2IqmLA/XUw11DUFuHIjKX9oDckbtLuRbT+ 1y49c+P5x+KiisRbjfWiIxuXp0ij+Wow8tIXwh13q+TDOz18j7RSb7vw0scB4K1rsOJP no7fuyYMYjf3Db/c87fLb1+Z+gbksta8x0o3aO/9piVFrC2S5DwhFlm3WS6QnwK7q2nd BfYZE9/I1J560RMRsCkw/nFMeLyd3kcCLKRdzpBIJ2KfFD1dmoi5dGPUnF63Zik7tHjf Hr+9jUd2yNGag3+WJWjglWjYxtQbMe0afAoS9LNzpJFIjqaIGks2J5tBfUqexLxfd8RB sfKw== X-Gm-Message-State: APjAAAUA5FhqNAFJmqloK1mYInyvQqJnYsDEkLaZjLiFP5HgqKNS6xF5 IdSmQOykefiLC5hjMdRiay9zgA== X-Received: by 2002:a19:e011:: with SMTP id x17mr8563557lfg.59.1574953047246; Thu, 28 Nov 2019 06:57:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 06:57:26 -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 Subject: [PATCH v6 17/49] soc: fsl: qe: remove unused qe_ic_set_* functions Date: Thu, 28 Nov 2019 15:55:22 +0100 Message-Id: <20191128145554.1297-18-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 There are no current callers of these functions, and they use the ppc-specific virq_to_hw(). So removing them gets us one step closer to building QE support for ARM. If the functionality is ever actually needed, the code can be dug out of git and then adapted to work on all architectures, but for future reference please note that I believe qe_ic_set_priority is buggy: The "priority < 4" should be "priority <= 4", and in the else branch 24 should be replaced by 28, at least if I'm reading the data sheet right. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 94 -------------------------------------- include/soc/fsl/qe/qe_ic.h | 4 -- 2 files changed, 98 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/soc/fsl/qe/qe_ic.c index de2ca2e3a648..4839dcd5c5d3 100644 --- a/drivers/soc/fsl/qe/qe_ic.c +++ b/drivers/soc/fsl/qe/qe_ic.c @@ -445,97 +445,3 @@ static int __init qe_ic_of_init(void) return 0; } subsys_initcall(qe_ic_of_init); - -void qe_ic_set_highest_priority(unsigned int virq, int high) -{ - struct qe_ic *qe_ic = qe_ic_from_irq(virq); - unsigned int src = virq_to_hw(virq); - u32 temp = 0; - - temp = qe_ic_read(qe_ic->regs, QEIC_CICR); - - temp &= ~CICR_HP_MASK; - temp |= src << CICR_HP_SHIFT; - - temp &= ~CICR_HPIT_MASK; - temp |= (high ? SIGNAL_HIGH : SIGNAL_LOW) << CICR_HPIT_SHIFT; - - qe_ic_write(qe_ic->regs, QEIC_CICR, temp); -} - -/* Set Priority level within its group, from 1 to 8 */ -int qe_ic_set_priority(unsigned int virq, unsigned int priority) -{ - struct qe_ic *qe_ic = qe_ic_from_irq(virq); - unsigned int src = virq_to_hw(virq); - u32 temp; - - if (priority > 8 || priority == 0) - return -EINVAL; - if (WARN_ONCE(src >= ARRAY_SIZE(qe_ic_info), - "%s: Invalid hw irq number for QEIC\n", __func__)) - return -EINVAL; - if (qe_ic_info[src].pri_reg == 0) - return -EINVAL; - - temp = qe_ic_read(qe_ic->regs, qe_ic_info[src].pri_reg); - - if (priority < 4) { - temp &= ~(0x7 << (32 - priority * 3)); - temp |= qe_ic_info[src].pri_code << (32 - priority * 3); - } else { - temp &= ~(0x7 << (24 - priority * 3)); - temp |= qe_ic_info[src].pri_code << (24 - priority * 3); - } - - qe_ic_write(qe_ic->regs, qe_ic_info[src].pri_reg, temp); - - return 0; -} - -/* Set a QE priority to use high irq, only priority 1~2 can use high irq */ -int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high) -{ - struct qe_ic *qe_ic = qe_ic_from_irq(virq); - unsigned int src = virq_to_hw(virq); - u32 temp, control_reg = QEIC_CICNR, shift = 0; - - if (priority > 2 || priority == 0) - return -EINVAL; - if (WARN_ONCE(src >= ARRAY_SIZE(qe_ic_info), - "%s: Invalid hw irq number for QEIC\n", __func__)) - return -EINVAL; - - switch (qe_ic_info[src].pri_reg) { - case QEIC_CIPZCC: - shift = CICNR_ZCC1T_SHIFT; - break; - case QEIC_CIPWCC: - shift = CICNR_WCC1T_SHIFT; - break; - case QEIC_CIPYCC: - shift = CICNR_YCC1T_SHIFT; - break; - case QEIC_CIPXCC: - shift = CICNR_XCC1T_SHIFT; - break; - case QEIC_CIPRTA: - shift = CRICR_RTA1T_SHIFT; - control_reg = QEIC_CRICR; - break; - case QEIC_CIPRTB: - shift = CRICR_RTB1T_SHIFT; - control_reg = QEIC_CRICR; - break; - default: - return -EINVAL; - } - - shift += (2 - priority) * 2; - temp = qe_ic_read(qe_ic->regs, control_reg); - temp &= ~(SIGNAL_MASK << shift); - temp |= (high ? SIGNAL_HIGH : SIGNAL_LOW) << shift; - qe_ic_write(qe_ic->regs, control_reg, temp); - - return 0; -} diff --git a/include/soc/fsl/qe/qe_ic.h b/include/soc/fsl/qe/qe_ic.h index 43e4ce95c6a0..d47eb231519e 100644 --- a/include/soc/fsl/qe/qe_ic.h +++ b/include/soc/fsl/qe/qe_ic.h @@ -63,8 +63,4 @@ static inline unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic) { return 0; } #endif /* CONFIG_QUICC_ENGINE */ -void qe_ic_set_highest_priority(unsigned int virq, int high); -int qe_ic_set_priority(unsigned int virq, unsigned int priority); -int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high); - #endif /* _ASM_POWERPC_QE_IC_H */ -- 2.23.0