Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp425048ybx; Fri, 1 Nov 2019 05:45:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3+MRTLZCqLIRKwnEaeSGvHttD+XhmMYJ5LDVVYbq1pakTt3bPNFEvCgNMpF52H1eop0tC X-Received: by 2002:a17:906:d939:: with SMTP id rn25mr3525376ejb.147.1572612349529; Fri, 01 Nov 2019 05:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572612349; cv=none; d=google.com; s=arc-20160816; b=URK+GKKVTxAROt1v0OkI5lHZjlnEOLQacis5IIx1PeHvN6ZOwVCqs/5olDUEREWdl5 W2c2PLv61sIJEdh6x16Odi8crrYSHeGDirFWDR/G+//VzwaY8oGL4DhrHDsc20t8yCXo gpnUM+1CZJS9690SOeLqd49PlG+98K2nUHrd8EDfuKqRixAhNEXOy2fDY1hJ1x+eoR/c IQsxbcCA+tsLTzoZ2gczwoobHeyVKbSIA/bmWvOgL7YQdsUCsAObeUBqAtS85cnYDLmi 46tj69PpRgV840weTdgcVzx01DAnhNSlbAwtiVawWFnfBtMBivlOQylost+tyCv0LU3y oqbA== 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=z2c319/rjPUXp8iRV62XAcjKgiOjRbx515GvierWVkM=; b=mlG6YnhlTPNxwdmwkM0CXwt4ofDm8V/ouyRVC+IPkvmzHC4UvOI8EjcTzm3YxUiecT njnoS+EOWzlZWHBMBWP+JBUcrbiW+gkjQvIM0SSkP5gg5RuUlOlH9eIf8qCrVbvM3EVx Hnudq+29sjzSKNcFz48Vw3CKtXTLN9R9qSvoCHjdSciFpRr2SQIq+XaFTT6j+YHgv8Qq V/EInw9YTmFbVZtVjzAIsvh7byFxzIQx+20wfGsIgKVDCMKamobSjSXnHPuDV6haux6L o5CtnUQZyUYRVsQpd8ZBQQolQrE24wSdJ1+wZJ0TExHLDp7D/tpgjtUd2hJc4GUtOEtF miFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=emxjxGI5; 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 j22si5610672ejb.420.2019.11.01.05.45.26; Fri, 01 Nov 2019 05:45:49 -0700 (PDT) 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=emxjxGI5; 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 S1730953AbfKAMn7 (ORCPT + 99 others); Fri, 1 Nov 2019 08:43:59 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:47026 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730709AbfKAMmj (ORCPT ); Fri, 1 Nov 2019 08:42:39 -0400 Received: by mail-lf1-f66.google.com with SMTP id 19so1971093lft.13 for ; Fri, 01 Nov 2019 05:42:37 -0700 (PDT) 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=z2c319/rjPUXp8iRV62XAcjKgiOjRbx515GvierWVkM=; b=emxjxGI5mzMUlIacGEHrL8HHfoh+f+nWa9gO07GOW4QyExZHgcvn5bvZdXqLZSNRzH T6KiKkaCIX+2BDTbqSKNnteERU86ltuF8fgmVWLPrjkyvEDzacT6ouPkXoVf+JByyKB+ avErQjWjwN1a4qGfUl42EYAJpsK/C9Gfr08Z8= 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=z2c319/rjPUXp8iRV62XAcjKgiOjRbx515GvierWVkM=; b=edaz87Wo/uj/yiOUYg6nsFkfPt46uC1Vrp1BDAUKE9CaSHPVXX9wJxKNkpGmzu/MBc qouY955TMQFXvVV1eS8ikt+5rx6RbrwS3OrCI0RJhBgeUFGLLAQXLaLZBddURdWofkaz 2NNscdrnJuYlipo+RNIGCjYT2ehV0ITKLiBWdV62Tg58YTKnAJT8IKyhGo9aqDNkuHmp 86LVc6gSRuzpoDf4+UcaWwvVo08hpMF3k0QgtOrxGDC7e7Y3XnoPNcOJtuIHqMN4mDGR HpEJxbL0KrhdSJYP18iaymsrNkZa2q/aWDEj2JazvSRvOHvESZVGOD4f8YB6oIS3X2g1 VJyg== X-Gm-Message-State: APjAAAWxcAR5cG4mpsbBoYQE9kjTAsbl5h5I7e9gHDZMhfOgjvxII4Ml 508bpFLIToUrOSu3Z4AsPqUWDQ== X-Received: by 2002:a19:4c02:: with SMTP id z2mr6812332lfa.45.1572612157070; Fri, 01 Nov 2019 05:42:37 -0700 (PDT) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id o26sm2458540lfi.57.2019.11.01.05.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 05:42:36 -0700 (PDT) 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 Subject: [PATCH v3 17/36] soc: fsl: qe: remove unused qe_ic_set_* functions Date: Fri, 1 Nov 2019 13:41:51 +0100 Message-Id: <20191101124210.14510-18-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191101124210.14510-1-linux@rasmusvillemoes.dk> References: <20191018125234.21825-1-linux@rasmusvillemoes.dk> <20191101124210.14510-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. 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