Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp58090lqe; Wed, 3 Apr 2024 22:18:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVTNwuKWLuvqPhTTyR9hG5uxMO1d5zOC0d5DxhMPiB383qvH1M9Crs+2VI2EAthTfJnoiFpzKfcjXJfZvrw1DbWPkOkUMLjhljPYLia/g== X-Google-Smtp-Source: AGHT+IF/84T/FIwUZDiZSSLFQFiBL7fTTpnqiLlkuNCvbgzm9Nv0CnwmclC27OX0wOH5u4/2HgGK X-Received: by 2002:a05:6402:7c4:b0:56e:df7:a354 with SMTP id u4-20020a05640207c400b0056e0df7a354mr1011218edy.25.1712207933968; Wed, 03 Apr 2024 22:18:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712207933; cv=pass; d=google.com; s=arc-20160816; b=NLiP//VVq+IUUxo5FEvJG+2L+MMg+22GemCRIqTT/dTEa+3cWrurBV2H6yrT6FBpgU UMzWhss8JFbTCGe2RsxWbhCFLQYnB/j9F1b6vPMIh0MkZAyFazJrUyu0L6P9fRPeHK7x 6VuL2ky3AXQbpv78cT0jtdFlmkUkzz/nVC6E6HWNY3JtY3mJuXt1QeEjSKh+UGXtKzm/ EAWWws2Du9Par91QIgP3xvLP9yrlVdWYyko8bSE4Qtv2TkMtDtzpZi+hSKvUY2De1R7q lhCNzBnn7qIHQ6Iz0XwFWsr+M3TBR+oLRNnPhF1xFZCrk7hGv0eS8vTSn3b3F0ME2Gxk ERNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=i3zay3mInVJAQrodcxeO/G6cTUPzsW4JORDyIk8vfEg=; fh=v4XjIS8ZnkfRSzpdvZ0kX2qBiNaW+cViNlbs+XMLZ44=; b=sGiLJ7n0aXHi+EpGpcm9rMBZs5fPmbgHPFbCgTgWuSO9EnrPh0uFPxgtylI8NxuUrT gx6VUqsWi4gHXFVmhlZkAC1sqQrZyrpP5uoR3OyMHDaLrRVgaRDhbbfQ6LSy3tMYJVAE GKKbiL3kSBEJSvWn9P4MtybSn3kMv8yBS5ohcMQMJjDHwRKpPRG3B0Ude0vEt0InhbmZ WrlYu/zGbOGLGX70yqblTl7/rNR8gNOdSNVD6j4jTknmk4gI3sx4hrAFla0KIWJ01fM2 SlXdgyZA9Maz9JbpESfZuOqzpMwrEw/MhC52zYjDZ+7NN3XY4hq3ak+6ykn7xU2N+YeQ jiqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-130916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130916-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q7-20020a50cc87000000b0056c0520541asi7431155edi.466.2024.04.03.22.18.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 22:18:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-130916-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130916-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 20C8B1F23E8D for ; Thu, 4 Apr 2024 05:18:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E83E7172F; Thu, 4 Apr 2024 05:15:06 +0000 (UTC) Received: from sakura.ysato.name (ik1-413-38519.vs.sakura.ne.jp [153.127.30.23]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 299276F079; Thu, 4 Apr 2024 05:15:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=153.127.30.23 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712207705; cv=none; b=JZ5dshlTBKgMqUHPE4TvxH4OxjKK8HGR3yBiOO7n/jyrqATyTrbziuqj8JXnuuI06V3HvJb/zwmDZW0rsWzwmLhl/p5sS2TWKpjgl7v/qfjoLKLvnu10QzUO0e/PAsGFiESDCMqfLvAHpGEp34STjPPqbIHV8S46bcjP1rAnr5s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712207705; c=relaxed/simple; bh=2Ln8/beSX9+5TT32ruO4321U5//ekhXDgwV6jyytobg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kkx+GFBzhXfz4SuxBG18jwObljuIV0Y4MrUtS9ETHzc36afNH1HbSGSOnusPsi9o116Uza+elRpN/346XAmCNkNWqjgcekN2dP1YuHPS/qzRVLql62+4/7VSbmrZQBM9Ov7t6/inwDEhUMfi77QCgmAjMaSQjb3/NNGlbX5QbGg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=users.sourceforge.jp; spf=fail smtp.mailfrom=users.sourceforge.jp; arc=none smtp.client-ip=153.127.30.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=users.sourceforge.jp Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=users.sourceforge.jp Received: from SIOS1075.ysato.name (al128006.dynamic.ppp.asahi-net.or.jp [111.234.128.6]) by sakura.ysato.name (Postfix) with ESMTPSA id 02C401C0EA9; Thu, 4 Apr 2024 14:15:01 +0900 (JST) From: Yoshinori Sato To: linux-sh@vger.kernel.org Cc: Yoshinori Sato , Damien Le Moal , Niklas Cassel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Thomas Gleixner , Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Greg Kroah-Hartman , Jiri Slaby , Magnus Damm , Daniel Lezcano , Rich Felker , John Paul Adrian Glaubitz , Lee Jones , Helge Deller , Heiko Stuebner , Shawn Guo , Sebastian Reichel , Chris Morgan , Linus Walleij , Arnd Bergmann , David Rientjes , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Vlastimil Babka , Baoquan He , Andrew Morton , Guenter Roeck , Kefeng Wang , Stephen Rothwell , Javier Martinez Canillas , Guo Ren , Azeem Shaikh , Max Filippov , Jonathan Corbet , Jacky Huang , Herve Codina , Manikanta Guntupalli , Anup Patel , Biju Das , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Sam Ravnborg , Sergey Shtylyov , Laurent Pinchart , linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org, linux-serial@vger.kernel.org, linux-fbdev@vger.kernel.org Subject: [RESEND v7 05/37] sh: GENERIC_IRQ_CHIP support for CONFIG_OF=y Date: Thu, 4 Apr 2024 14:14:16 +0900 Message-Id: <6e73949abe8d5f4f5bc229716f9a2cfb7db21626.1712207606.git.ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Remove unused function prototype. Add helper update_sr_imask. use for SH7751 irq driver. Add stub intc_finalize. Signed-off-by: Yoshinori Sato --- arch/sh/include/asm/io.h | 2 ++ arch/sh/include/asm/irq.h | 10 ++++++++-- arch/sh/kernel/cpu/Makefile | 5 +---- arch/sh/kernel/cpu/irq/imask.c | 17 +++++++++++++++++ include/linux/sh_intc.h | 7 ++++++- 5 files changed, 34 insertions(+), 7 deletions(-) diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index cf5eab840d57..5c544cf5201b 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -121,7 +121,9 @@ __BUILD_MEMORY_STRING(__raw_, q, u64) #define ioport_map ioport_map #define ioport_unmap ioport_unmap +#ifndef CONFIG_SH_DEVICE_TREE #define pci_iounmap pci_iounmap +#endif #define ioread8 ioread8 #define ioread16 ioread16 diff --git a/arch/sh/include/asm/irq.h b/arch/sh/include/asm/irq.h index 0f384b1f45ca..3d897229dcc4 100644 --- a/arch/sh/include/asm/irq.h +++ b/arch/sh/include/asm/irq.h @@ -16,8 +16,8 @@ /* * Simple Mask Register Support */ -extern void make_maskreg_irq(unsigned int irq); -extern unsigned short *irq_mask_register; + +void update_sr_imask(unsigned int irq, bool enable); /* * PINT IRQs @@ -54,4 +54,10 @@ extern void irq_finish(unsigned int irq); #include +/* SH3/4 INTC stuff */ +/* IRL level 0 - 15 */ +#define NR_IRL 15 +/* IRL0 -> IRQ16 */ +#define IRL_BASE_IRQ 16 + #endif /* __ASM_SH_IRQ_H */ diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile index e00ebf134985..ad12807fae9c 100644 --- a/arch/sh/kernel/cpu/Makefile +++ b/arch/sh/kernel/cpu/Makefile @@ -20,7 +20,4 @@ ifndef CONFIG_COMMON_CLK obj-y += clock.o obj-$(CONFIG_SH_CLK_CPG_LEGACY) += clock-cpg.o endif -ifndef CONFIG_GENERIC_IRQ_CHIP -obj-y += irq/ -endif -obj-y += init.o fpu.o pfc.o proc.o +obj-y += init.o fpu.o pfc.o proc.o irq/ diff --git a/arch/sh/kernel/cpu/irq/imask.c b/arch/sh/kernel/cpu/irq/imask.c index 572585c3f2fd..7589ca7c506c 100644 --- a/arch/sh/kernel/cpu/irq/imask.c +++ b/arch/sh/kernel/cpu/irq/imask.c @@ -51,6 +51,7 @@ static inline void set_interrupt_registers(int ip) : "t"); } +#ifndef CONFIG_GENERIC_IRQ_CHIP static void mask_imask_irq(struct irq_data *data) { unsigned int irq = data->irq; @@ -83,3 +84,19 @@ void make_imask_irq(unsigned int irq) irq_set_chip_and_handler_name(irq, &imask_irq_chip, handle_level_irq, "level"); } +#else +void update_sr_imask(unsigned int irq, bool enable) +{ + if (enable) { + set_bit(irq, imask_mask); + interrupt_priority = IMASK_PRIORITY - + find_first_bit(imask_mask, IMASK_PRIORITY); + } else { + clear_bit(irq, imask_mask); + if (interrupt_priority < IMASK_PRIORITY - irq) + interrupt_priority = IMASK_PRIORITY - irq; + } + set_interrupt_registers(interrupt_priority); +} +EXPORT_SYMBOL(update_sr_imask); +#endif diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index 27ae79191bdc..994b5b05a0d7 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h @@ -139,8 +139,13 @@ struct intc_desc symbol __initdata = { \ int register_intc_controller(struct intc_desc *desc); int intc_set_priority(unsigned int irq, unsigned int prio); int intc_irq_lookup(const char *chipname, intc_enum enum_id); +#ifndef CONFIG_SH_DEVICE_TREE void intc_finalize(void); - +#else +static inline void intc_finalize(void) +{ +} +#endif #ifdef CONFIG_INTC_USERIMASK int register_intc_userimask(unsigned long addr); #else -- 2.39.2