Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2661375imm; Mon, 24 Sep 2018 08:01:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZFmRMkf3GJiU/+l0wfT5P5S5LEGqCaoxdjEp6X0wyGdimCcv5ZS0CbRZkxL5yO5ENf1Z8D X-Received: by 2002:aa7:8751:: with SMTP id g17-v6mr7046361pfo.250.1537801268964; Mon, 24 Sep 2018 08:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537801268; cv=none; d=google.com; s=arc-20160816; b=nivYrhRl7Wxf+4LYudPrez6iLCcwihOpkvsSMcT8/0UgNcQka5RN8YwJZPLi/DD5wC ZoQuCy1q0d+BZhXNqqQWMVGsHUtn4m1B5Wj/T+pAzNg5TybAguh4T6g76e6ZrpL2OO/d IBaoP+LRzfkuE8DQ8pqm5IXKpzuhBtfiTNzA8saa3tluT3fu+trRzdVHwa0IgiL6U+Gt L7dLgCHDIwktCsQGZN1KR65/vkKqgoeC86EFwaWPAwkOoggxLuwgwKDRcLggIM95KEiS ckxsxYaDx8ni0oI7jGUfH2ISgjw5kv30c1L4hRL8namxBKbrB064LMb0wArVe10dRImU 62/A== 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:references :in-reply-to:message-id:date:subject:cc:to:from; bh=QWVbM8at27wr1RL+gpsbD/xS8qpV2tgM6NmWHDLQQnQ=; b=yfiRsb9c4TITLIfnCBLzNgXoaPMNQFNz2sarVO+Y4PIe4b8NtKmrc1z6YgO6IkT7S0 nn4bodTcDDURCxlRmCdSbxucHCANM0vu9MewXKj9oLe8zocJREhEhu8O9RUpskNkJUjx B2CiwmYdsdMuLA4xKv1iTMgv9Xz931k8wbOwlQ6LLGRku6QvU6Bcl7buZ2ilrkoZc1yw 9c7BFIeGNOloFHXmEnFQQ0HLJZktwGf9GTZ6X5YncJQrTCsbwAVyWxnIFInTe9jvukCW h9AIje8QX8M8FLooEr1SGht0SfWzFlNOOt8EPCj9CBgcF0idqpcwRLNG78Rl6FU/Hsop F/RQ== ARC-Authentication-Results: i=1; mx.google.com; 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 f62-v6si38752233pfb.218.2018.09.24.08.00.53; Mon, 24 Sep 2018 08:01:08 -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; 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 S1732697AbeIXUlA (ORCPT + 99 others); Mon, 24 Sep 2018 16:41:00 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:49595 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732640AbeIXUk7 (ORCPT ); Mon, 24 Sep 2018 16:40:59 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.0743774|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03312;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=21;RT=21;SR=0;TI=SMTPD_---.CvC3Qzc_1537799863; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CvC3Qzc_1537799863) by smtp.aliyun-inc.com(10.147.40.2); Mon, 24 Sep 2018 22:37:43 +0800 From: Guo Ren To: akpm@linux-foundation.org, arnd@arndb.de, daniel.lezcano@linaro.org, davem@davemloft.net, gregkh@linuxfoundation.org, jason@lakedaemon.net, marc.zyngier@arm.com, mark.rutland@arm.com, mchehab+samsung@kernel.org, peterz@infradead.org, robh@kernel.org, robh+dt@kernel.org, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, devicetree@vger.kernel.org, c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, green.hu@gmail.com, palmer@sifive.com, Guo Ren Subject: [PATCH V5 10/30] csky: IRQ handling Date: Mon, 24 Sep 2018 22:36:26 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds IRQ handling files. Signed-off-by: Guo Ren --- arch/csky/include/asm/irq.h | 9 ++++++++ arch/csky/include/asm/irqflags.h | 50 ++++++++++++++++++++++++++++++++++++++++ arch/csky/kernel/irq.c | 22 ++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 arch/csky/include/asm/irq.h create mode 100644 arch/csky/include/asm/irqflags.h create mode 100644 arch/csky/kernel/irq.c diff --git a/arch/csky/include/asm/irq.h b/arch/csky/include/asm/irq.h new file mode 100644 index 0000000..970ef4f --- /dev/null +++ b/arch/csky/include/asm/irq.h @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. + +#ifndef __ASM_CSKY_IRQ_H +#define __ASM_CSKY_IRQ_H + +#include + +#endif /* __ASM_CSKY_IRQ_H */ diff --git a/arch/csky/include/asm/irqflags.h b/arch/csky/include/asm/irqflags.h new file mode 100644 index 0000000..a4fd2dd --- /dev/null +++ b/arch/csky/include/asm/irqflags.h @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. + +#ifndef __ASM_CSKY_IRQFLAGS_H +#define __ASM_CSKY_IRQFLAGS_H +#include + +static inline unsigned long arch_local_irq_save(void) +{ + unsigned long flags; + + flags = mfcr("psr"); + asm volatile("psrclr ie\n":::"memory"); + return flags; +} +#define arch_local_irq_save arch_local_irq_save + +static inline void arch_local_irq_enable(void) +{ + asm volatile("psrset ee, ie\n":::"memory"); +} +#define arch_local_irq_enable arch_local_irq_enable + +static inline void arch_local_irq_disable(void) +{ + asm volatile("psrclr ie\n":::"memory"); +} +#define arch_local_irq_disable arch_local_irq_disable + +static inline unsigned long arch_local_save_flags(void) +{ + return mfcr("psr"); +} +#define arch_local_save_flags arch_local_save_flags + +static inline void arch_local_irq_restore(unsigned long flags) +{ + mtcr("psr", flags); +} +#define arch_local_irq_restore arch_local_irq_restore + +static inline int arch_irqs_disabled_flags(unsigned long flags) +{ + return !(flags & (1<<6)); +} +#define arch_irqs_disabled_flags arch_irqs_disabled_flags + +#include + +#endif /* __ASM_CSKY_IRQFLAGS_H */ diff --git a/arch/csky/kernel/irq.c b/arch/csky/kernel/irq.c new file mode 100644 index 0000000..03a1930 --- /dev/null +++ b/arch/csky/kernel/irq.c @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. + +#include +#include +#include +#include +#include +#include + +void __init init_IRQ(void) +{ + irqchip_init(); +#ifdef CONFIG_SMP + setup_smp_ipi(); +#endif +} + +asmlinkage void __irq_entry csky_do_IRQ(struct pt_regs *regs) +{ + handle_arch_irq(regs); +} -- 2.7.4