Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4598827imu; Tue, 29 Jan 2019 04:27:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN7mgaTp4kP20QxFM9rsmEJyA+VZdHMPEqORXIvgDmMr32DRlrwgA+MDglqhB9BUi5VPbERy X-Received: by 2002:a62:42d4:: with SMTP id h81mr25864479pfd.259.1548764869639; Tue, 29 Jan 2019 04:27:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548764869; cv=none; d=google.com; s=arc-20160816; b=gnIDq86A+5GDWmRud1TEHLiv5kVKjlpoAZ9eC/Y6CcGKObAfS5Xx3cVVZNMS1dCzoj 8st5Y8LPTKwFrOy8vTKPPA4JFsxNh2hw3inDAxsOc9pY0gnlG8to56qCF23bWjsO7707 z0SGYB7UeMVA6ivGpQlICqCm+K6jwPmo28kB51TZ4BiamEQ+CJtfTdP2/YRVzf4eatAI km/tHfN08T3/9+b9YebzrI2PiKfCP+oQ+AdsELM+1l2D1jwmPbr7Yb73bIuhnWtiJ4DN Ydn9HrNgACcW8qNMekhDi+6cw4Tir4ESgJgTAXmqWvz7HH8nvc3gp2GHvs/cI/96y5Q2 LzUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=kRR9Ti4zYingUrTy53e9pVIADJzZMZvxt1sToESCEOo=; b=HNYb5ZBPEz+gdysK8IDs/Z+ZpI2hVF4ieDJVLQm1YqCDVQlstdnriXNhWRG1freEI5 GTCiDcNJBwcRtZOr4Lwh2tf0Nn9aR1xJSdvgx0o6qfpyER3YQjj94wRcLdobRAWUnHjo 4qOeMXLVNovvr4159LCY33J9nzfaPVtVl9V3cESSyICmxGdDl7esiMlnzJ9zLuGx3YXN HtIgGbWqxahudyVMXJ9klmHIWsVGCCqxoLnAQUaEj7b8WWyFL8jTuIk8YRMWk5twvK8s ACzrqZCiIFYo2MPuAFswoScxL/93NY1Xddb/OcSLULQ43YrK+oGjXUsKCZW4bxIf9ic/ 6EFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Qcby8E0k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k17si23515472pgl.62.2019.01.29.04.27.34; Tue, 29 Jan 2019 04:27:49 -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=@kernel.org header.s=default header.b=Qcby8E0k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729043AbfA2MZX (ORCPT + 99 others); Tue, 29 Jan 2019 07:25:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:36158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728976AbfA2MZW (ORCPT ); Tue, 29 Jan 2019 07:25:22 -0500 Received: from localhost.localdomain (unknown [60.186.218.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 942122087E; Tue, 29 Jan 2019 12:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548764721; bh=2PgrfES4YUnKgJPx4YNFcpfR+aGLQ2K4WjEZhAwCpZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qcby8E0k0A+jrP3PaQc/9UqaZTTb2wkOqazGabE5qf4fg9gCLq43vJi4wzp4D3co+ wRHc3qRSVsejkyBvzIwx7gtsp4ia8Qp+u4l6133eLnGa5ClvuXm0qtyh1eMH+BP3da CCOOIHCLb/pR3Bumoxl7E+tPVpka1gO19emDjUbo= From: guoren@kernel.org To: arnd@arndb.de, robh+dt@kernel.org, marc.zyngier@arm.com Cc: linux-kernel@vger.kernel.org, guoren@kernel.org, linux-arch@vger.kernel.org, Guo Ren Subject: [PATCH 10/10] irqchip/csky: Add support-vector-irq for apb-intc Date: Tue, 29 Jan 2019 20:24:29 +0800 Message-Id: <1548764669-16656-10-git-send-email-guoren@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548764669-16656-1-git-send-email-guoren@kernel.org> References: <1548764669-16656-1-git-send-email-guoren@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren Some socs don't provide pending registers, so we must make the interrupt controller working at vector mode. Add csky,support-vector-irq to support this mode in dts. Signed-off-by: Guo Ren --- drivers/irqchip/irq-csky-apb-intc.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-csky-apb-intc.c b/drivers/irqchip/irq-csky-apb-intc.c index ae4c59b..14ef206 100644 --- a/drivers/irqchip/irq-csky-apb-intc.c +++ b/drivers/irqchip/irq-csky-apb-intc.c @@ -302,10 +302,17 @@ static void ck_irq_handler(struct pt_regs *regs) pr_err("%s: none irq pending!\n", __func__); } +static void ck_vec_irq_handler(struct pt_regs *regs) +{ + unsigned long vector = (mfcr("psr") >> 16) & 0xff; + + handle_domain_irq(root_domain, vector - 32, regs); +} + static int __init ck_intc_init(struct device_node *node, struct device_node *parent) { - int ret; + int ret, i; ret = ck_intc_init_comm(node, parent); if (ret) @@ -323,7 +330,16 @@ ck_intc_init(struct device_node *node, struct device_node *parent) setup_irq_channel(0x00010203, reg_base + CK_INTC_SOURCE); - set_handle_irq(ck_irq_handler); + if (of_find_property(node, "csky,support-vector-irq", NULL)) { + set_handle_irq(ck_vec_irq_handler); + + for (i = 32; i < 128; i++) + VEC_INIT(i, csky_irq); + + writel(0, reg_base + CK_INTC_ICR); + } else { + set_handle_irq(ck_irq_handler); + } return 0; } -- 2.7.4