Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4092575ybg; Fri, 25 Oct 2019 13:12:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmnX/OV5ukYTrOxiGVN7GubrYOCroqCybJTPWoiuNoKzU5EforEOaJ9ZbOv7cKMficWQ5Z X-Received: by 2002:aa7:cd48:: with SMTP id v8mr5781377edw.97.1572034361225; Fri, 25 Oct 2019 13:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572034361; cv=none; d=google.com; s=arc-20160816; b=zjQiVh/aR8kwpJmYehKSg7WEQhGp/hscOA1Z2YjKIllsGIZTHu5YDY2FoGMR4MqZUd ndO/MbCMnkv36MAfAIZVCUvbGe7E3+tOT3LGJFUME0iPuY/UDlYLVlSyNGkAYquUWlJr of2xxAIumirL32qZx1I2CA7rH3MwaquSDaFZebbY0x1HfGq2JveCc4qrV9PctyWsPkKe rBXMVV3lgk0DwXrpAtGCRP90Ir7wJ8pKRHREQ99/ZQ+tfkqd8fY6O/prufJq+53jDz/l Q50dQBfrgfuFe+5lkcOb9ycZPeOrTwOOdu0VFO4cbsZxaBhm+Rel3yJLCmFAvHL9msKn 8+pA== 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=T08L7/zwJVIgelBvpXUwsORyDuEDg/vJzRMhZg7QkI8=; b=yIRwMI4c00iIxCyY7bBRaSfgrHSUav3okcBgF+9bJ99Wuo7tq3HvTtlJcxctWP3u4z CNsqnI4Rkgl2ACVYqVo3m0pCQXE0ira6YUO2sgWS+urwJv/FDmPeLnEaU8dLdM0LJPoH 08z5Njy2LX/nfsSV7yi+TbDs/ZHm6K4VNrAKFKmmdYXHTIZX4Hk5/CtYHvZzrq08yPNd +Z5bKpmefaZJpIuu56gO0OrhsW6qqSiQDU4ZqOJ3pH0/Nulkdbed3iXrAs7DIqFxAeHU Ij9iJlum3W9rpZLJK0A6IElfT0xcTpHr0u49BJKxppJQYHR7c732eTpPyyBIwDBwMlw7 08RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=CY6VlnHL; 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 l8si1784967ejr.125.2019.10.25.13.12.17; Fri, 25 Oct 2019 13:12:41 -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=CY6VlnHL; 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 S2504602AbfJYMmY (ORCPT + 99 others); Fri, 25 Oct 2019 08:42:24 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:35032 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504532AbfJYMl3 (ORCPT ); Fri, 25 Oct 2019 08:41:29 -0400 Received: by mail-lj1-f194.google.com with SMTP id m7so2563174lji.2 for ; Fri, 25 Oct 2019 05:41:27 -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=T08L7/zwJVIgelBvpXUwsORyDuEDg/vJzRMhZg7QkI8=; b=CY6VlnHLfcpPOeMsbBjDkz1gSN3rUx8pu2YRLNDbYt/N3P2LuRE6laPCSacEmQcVms wOH97S/1JIGjDTY51soxjSuqkAxUkRt9WSrHD70wGvt2e4s9rQojqXotY/8IuQLMoCen t95dLsyGwB/rtxI8G12wA/MM5eqnTZXbJUur0= 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=T08L7/zwJVIgelBvpXUwsORyDuEDg/vJzRMhZg7QkI8=; b=ISay72Z87W8PPLBbsgvSOzbxzDv6rp+DvTNq4Ybng5MVsXU/Dw/VnHbZtByzqiQpKq s9t0OFKBsLSzjui7kzomZCSLg1KEmvKUZPkh0XbLtOqWmgH2qYAA1XUCwXrPHhisvmv1 zzajXhVuVk23cnNSYUeUKBth5jpmycjSLD5n2+AQRJCjcqmmdt4zf+1m5fKca+NLRlIX PW/jlb+g723/iFN4pdsMZyVvmTGJjni1+gB4T5pY2jeBcng8/pN8m++AQxscRTQ2ugbw SYexQyc4iHfhkmmpLwlvxSEfpImn+j3yDASQURsqCQoMdZLn95MPqndj4byriVVsoxss Lh7Q== X-Gm-Message-State: APjAAAXlCyroh4k4hxAHdVIOadyCCVOIXXHeie4A0UsbvJtTWP2ogKJm Cntp2yY61TfD17Ut5za377kL2w== X-Received: by 2002:a2e:1bd5:: with SMTP id c82mr1444360ljf.207.1572007286210; Fri, 25 Oct 2019 05:41:26 -0700 (PDT) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id 10sm821028lfy.57.2019.10.25.05.41.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 05:41:25 -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 , Valentin Longchamp , Rasmus Villemoes Subject: [PATCH v2 18/23] soc: fsl: qe: remove unused qe_ic_set_* functions Date: Fri, 25 Oct 2019 14:40:53 +0200 Message-Id: <20191025124058.22580-19-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191025124058.22580-1-linux@rasmusvillemoes.dk> References: <20191018125234.21825-1-linux@rasmusvillemoes.dk> <20191025124058.22580-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 e20f1205c0df..58f4b4914f53 100644 --- a/drivers/soc/fsl/qe/qe_ic.c +++ b/drivers/soc/fsl/qe/qe_ic.c @@ -533,97 +533,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