From patchwork Tue Apr 5 09:17:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 556438 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25872C41535 for ; Tue, 5 Apr 2022 09:53:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350135AbiDEJz1 (ORCPT ); Tue, 5 Apr 2022 05:55:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236284AbiDEJbO (ORCPT ); Tue, 5 Apr 2022 05:31:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A48FB24BD3; Tue, 5 Apr 2022 02:18:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3129361654; Tue, 5 Apr 2022 09:18:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E5B3C385A0; Tue, 5 Apr 2022 09:18:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649150329; bh=z96vxEiwP1b5sZF7dgUcgoEbuYgbb8uvtvAVuuKNgPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sy1mCzdMdvm9zHtJ2BcGP4AS2ItnMeWkD82ANJeGFxq8QqF2CvpnF3jUc2+UowXZy ZVr1IT+YXHminOM73W11fVdhzPj3655Mgz83Tv+j/a/UCcTDSzcM/JwgSj6BkBwmkA Z5LlxRi7KKDOYmb00eTDx7kDyKZLAhNKpMwl96bmG7Fn87BNDEGggjN9ipWCBswOta zFbH7vU5ZYxfJ95u3w3CJMn2xAzpDpd8avcouHvDe+UGYbFyqd3ajJm/8vQX1icOLk kker9LNWgRF3NLbv5d3auPRvP9dUG3CaLG49ZQhWswkfNy9QqrKWQzztTSzU/WLCxc TZs3dZzkVuA+g== From: Arnd Bergmann Cc: Arnd Bergmann , Russell King , Hartley Sweeten , Alexander Sverdlin , Hubert Feurstein , Lukasz Majewski , Krzysztof Kozlowski , Alim Akhtar , Linus Walleij , Imre Kaloz , Krzysztof Halasa , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Simtec Linux Team , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi , Ard Biesheuvel , Stephen Boyd , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, patches@opensource.cirrus.com Subject: [PATCH 08/12] ARM: s3c24xx: convert to sparse-irq Date: Tue, 5 Apr 2022 11:17:46 +0200 Message-Id: <20220405091750.3076973-9-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220405091750.3076973-1-arnd@kernel.org> References: <20220405091750.3076973-1-arnd@kernel.org> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Arnd Bergmann As a final bit of preparation for converting to ARCH_MULTIPLATFORM, change the interrupt handling for s3c24xx to use sparse IRQs. Since the number of possible interrupts is already fixed and relatively small per chip, just make it use all legacy interrupts preallocated using the .nr_irqs field in the machine descriptor, rather than actually allocating domains on the fly. Signed-off-by: Arnd Bergmann Acked-by: Krzysztof Kozlowski --- arch/arm/Kconfig | 2 ++ arch/arm/mach-s3c/bast-ide.c | 2 +- arch/arm/mach-s3c/bast-irq.c | 2 +- arch/arm/mach-s3c/dev-audio-s3c64xx.c | 2 +- arch/arm/mach-s3c/dev-uart-s3c64xx.c | 2 +- arch/arm/mach-s3c/devs.c | 2 +- arch/arm/mach-s3c/gpio-samsung.c | 2 +- arch/arm/mach-s3c/irq-s3c24xx.c | 2 +- .../mach-s3c/{include/mach => }/irqs-s3c24xx.h | 18 ++++++++++++------ .../mach-s3c/{include/mach => }/irqs-s3c64xx.h | 0 arch/arm/mach-s3c/{include/mach => }/irqs.h | 0 arch/arm/mach-s3c/mach-amlm5900.c | 2 ++ arch/arm/mach-s3c/mach-anubis.c | 1 + arch/arm/mach-s3c/mach-anw6410.c | 2 +- arch/arm/mach-s3c/mach-at2440evb.c | 1 + arch/arm/mach-s3c/mach-bast.c | 1 + arch/arm/mach-s3c/mach-crag6410-module.c | 2 +- arch/arm/mach-s3c/mach-crag6410.c | 2 +- arch/arm/mach-s3c/mach-gta02.c | 1 + arch/arm/mach-s3c/mach-h1940.c | 1 + arch/arm/mach-s3c/mach-hmt.c | 2 +- arch/arm/mach-s3c/mach-jive.c | 2 +- arch/arm/mach-s3c/mach-mini2440.c | 3 ++- arch/arm/mach-s3c/mach-mini6410.c | 2 +- arch/arm/mach-s3c/mach-n30.c | 2 ++ arch/arm/mach-s3c/mach-ncp.c | 2 +- arch/arm/mach-s3c/mach-nexcoder.c | 1 + arch/arm/mach-s3c/mach-osiris.c | 1 + arch/arm/mach-s3c/mach-otom.c | 1 + arch/arm/mach-s3c/mach-qt2410.c | 1 + arch/arm/mach-s3c/mach-real6410.c | 2 +- arch/arm/mach-s3c/mach-rx1950.c | 1 + arch/arm/mach-s3c/mach-rx3715.c | 1 + arch/arm/mach-s3c/mach-smartq5.c | 2 +- arch/arm/mach-s3c/mach-smartq7.c | 2 +- arch/arm/mach-s3c/mach-smdk2410.c | 1 + arch/arm/mach-s3c/mach-smdk2413.c | 3 +++ arch/arm/mach-s3c/mach-smdk2416.c | 1 + arch/arm/mach-s3c/mach-smdk2440.c | 1 + arch/arm/mach-s3c/mach-smdk2443.c | 2 +- arch/arm/mach-s3c/mach-smdk6400.c | 2 +- arch/arm/mach-s3c/mach-smdk6410.c | 2 +- arch/arm/mach-s3c/mach-tct_hammer.c | 1 + arch/arm/mach-s3c/mach-vr1000.c | 1 + arch/arm/mach-s3c/mach-vstms.c | 1 + arch/arm/mach-s3c/pl080.c | 2 +- arch/arm/mach-s3c/pm-core-s3c24xx.h | 2 +- arch/arm/mach-s3c/pm-s3c2412.c | 2 +- arch/arm/mach-s3c/pm-s3c64xx.c | 2 +- arch/arm/mach-s3c/pm.c | 2 +- arch/arm/mach-s3c/s3c2443.c | 2 +- arch/arm/mach-s3c/s3c24xx.h | 2 +- arch/arm/mach-s3c/s3c64xx.c | 2 +- arch/arm/mach-s3c/simtec-usb.c | 2 +- 54 files changed, 69 insertions(+), 36 deletions(-) rename arch/arm/mach-s3c/{include/mach => }/irqs-s3c24xx.h (95%) rename arch/arm/mach-s3c/{include/mach => }/irqs-s3c64xx.h (100%) rename arch/arm/mach-s3c/{include/mach => }/irqs.h (100%) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 2242d2ae8854..c06e008c90ab 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -444,8 +444,10 @@ config ARCH_S3C24XX select CLKSRC_SAMSUNG_PWM select GPIO_SAMSUNG select GPIOLIB + select IRQ_DOMAIN select S3C2410_WATCHDOG select SAMSUNG_ATAGS + select SPARSE_IRQ select USE_OF select WATCHDOG help diff --git a/arch/arm/mach-s3c/bast-ide.c b/arch/arm/mach-s3c/bast-ide.c index da64db1811d8..67f0adc1fec0 100644 --- a/arch/arm/mach-s3c/bast-ide.c +++ b/arch/arm/mach-s3c/bast-ide.c @@ -20,7 +20,7 @@ #include #include "map.h" -#include +#include "irqs.h" #include "bast.h" diff --git a/arch/arm/mach-s3c/bast-irq.c b/arch/arm/mach-s3c/bast-irq.c index d299f124e6dc..cfc2ddc65513 100644 --- a/arch/arm/mach-s3c/bast-irq.c +++ b/arch/arm/mach-s3c/bast-irq.c @@ -16,7 +16,7 @@ #include #include "regs-irq.h" -#include +#include "irqs.h" #include "bast.h" diff --git a/arch/arm/mach-s3c/dev-audio-s3c64xx.c b/arch/arm/mach-s3c/dev-audio-s3c64xx.c index fc2f077afd24..909e82c148ba 100644 --- a/arch/arm/mach-s3c/dev-audio-s3c64xx.c +++ b/arch/arm/mach-s3c/dev-audio-s3c64xx.c @@ -10,7 +10,7 @@ #include #include -#include +#include "irqs.h" #include "map.h" #include "devs.h" diff --git a/arch/arm/mach-s3c/dev-uart-s3c64xx.c b/arch/arm/mach-s3c/dev-uart-s3c64xx.c index 8288e8d6c092..f9c947b8971b 100644 --- a/arch/arm/mach-s3c/dev-uart-s3c64xx.c +++ b/arch/arm/mach-s3c/dev-uart-s3c64xx.c @@ -16,7 +16,7 @@ #include #include #include "map.h" -#include +#include "irqs.h" #include "devs.h" diff --git a/arch/arm/mach-s3c/devs.c b/arch/arm/mach-s3c/devs.c index 1e266fc24f9b..9ac07c023adf 100644 --- a/arch/arm/mach-s3c/devs.c +++ b/arch/arm/mach-s3c/devs.c @@ -38,7 +38,7 @@ #include #include -#include +#include "irqs.h" #include "map.h" #include "gpio-samsung.h" #include "gpio-cfg.h" diff --git a/arch/arm/mach-s3c/gpio-samsung.c b/arch/arm/mach-s3c/gpio-samsung.c index fda2c01f5a08..b7fc7c41309c 100644 --- a/arch/arm/mach-s3c/gpio-samsung.c +++ b/arch/arm/mach-s3c/gpio-samsung.c @@ -26,7 +26,7 @@ #include -#include +#include "irqs.h" #include "map.h" #include "regs-gpio.h" #include "gpio-samsung.h" diff --git a/arch/arm/mach-s3c/irq-s3c24xx.c b/arch/arm/mach-s3c/irq-s3c24xx.c index 3776d5206f9b..088cc04b7431 100644 --- a/arch/arm/mach-s3c/irq-s3c24xx.c +++ b/arch/arm/mach-s3c/irq-s3c24xx.c @@ -26,7 +26,7 @@ #include #include -#include +#include "irqs.h" #include "regs-irq.h" #include "regs-gpio.h" diff --git a/arch/arm/mach-s3c/include/mach/irqs-s3c24xx.h b/arch/arm/mach-s3c/irqs-s3c24xx.h similarity index 95% rename from arch/arm/mach-s3c/include/mach/irqs-s3c24xx.h rename to arch/arm/mach-s3c/irqs-s3c24xx.h index aaf3bae08b52..fecbf7e440c6 100644 --- a/arch/arm/mach-s3c/include/mach/irqs-s3c24xx.h +++ b/arch/arm/mach-s3c/irqs-s3c24xx.h @@ -108,6 +108,8 @@ #define IRQ_TC S3C2410_IRQSUB(9) #define IRQ_ADC S3C2410_IRQSUB(10) +#define NR_IRQS_S3C2410 (S3C2410_IRQSUB(10) + 1) + /* extra irqs for s3c2412 */ #define IRQ_S3C2412_CFSDI S3C2410_IRQ(21) @@ -115,6 +117,7 @@ #define IRQ_S3C2412_SDI S3C2410_IRQSUB(13) #define IRQ_S3C2412_CF S3C2410_IRQSUB(14) +#define NR_IRQS_S3C2412 (S3C2410_IRQSUB(14) + 1) #define IRQ_S3C2416_EINT8t15 S3C2410_IRQ(5) #define IRQ_S3C2416_DMA S3C2410_IRQ(17) @@ -146,13 +149,20 @@ #define IRQ_S3C2416_I2S0 S3C2416_IRQ(6) #define IRQ_S3C2416_I2S1 S3C2416_IRQ(7) -/* extra irqs for s3c2440 */ +#define NR_IRQS_S3C2416 (S3C2416_IRQ(7) + 1) + +/* extra irqs for s3c2440/s3c2442 */ #define IRQ_S3C2440_CAM_C S3C2410_IRQSUB(11) /* S3C2443 too */ #define IRQ_S3C2440_CAM_P S3C2410_IRQSUB(12) /* S3C2443 too */ + +#define NR_IRQS_S3C2442 (S3C2410_IRQSUB(12) + 1) + #define IRQ_S3C2440_WDT S3C2410_IRQSUB(13) #define IRQ_S3C2440_AC97 S3C2410_IRQSUB(14) +#define NR_IRQS_S3C2440 (S3C2410_IRQSUB(14) + 1) + /* irqs for s3c2443 */ #define IRQ_S3C2443_DMA S3C2410_IRQ(17) /* IRQ_DMA1 */ @@ -186,11 +196,7 @@ #define IRQ_S3C2443_WDT S3C2410_IRQSUB(27) #define IRQ_S3C2443_AC97 S3C2410_IRQSUB(28) -#if defined(CONFIG_CPU_S3C2416) -#define NR_IRQS (IRQ_S3C2416_I2S1 + 1) -#else -#define NR_IRQS (IRQ_S3C2443_AC97 + 1) -#endif +#define NR_IRQS_S3C2443 (S3C2410_IRQSUB(28) + 1) /* compatibility define. */ #define IRQ_UART3 IRQ_S3C2443_UART3 diff --git a/arch/arm/mach-s3c/include/mach/irqs-s3c64xx.h b/arch/arm/mach-s3c/irqs-s3c64xx.h similarity index 100% rename from arch/arm/mach-s3c/include/mach/irqs-s3c64xx.h rename to arch/arm/mach-s3c/irqs-s3c64xx.h diff --git a/arch/arm/mach-s3c/include/mach/irqs.h b/arch/arm/mach-s3c/irqs.h similarity index 100% rename from arch/arm/mach-s3c/include/mach/irqs.h rename to arch/arm/mach-s3c/irqs.h diff --git a/arch/arm/mach-s3c/mach-amlm5900.c b/arch/arm/mach-s3c/mach-amlm5900.c index 94c4512ace17..f85e5885e9b4 100644 --- a/arch/arm/mach-s3c/mach-amlm5900.c +++ b/arch/arm/mach-s3c/mach-amlm5900.c @@ -239,7 +239,9 @@ static void __init amlm5900_init(void) MACHINE_START(AML_M5900, "AML_M5900") .atag_offset = 0x100, + .nr_irqs = NR_IRQS_S3C2410, .map_io = amlm5900_map_io, + .nr_irqs = NR_IRQS_S3C2410, .init_irq = s3c2410_init_irq, .init_machine = amlm5900_init, .init_time = amlm5900_init_time, diff --git a/arch/arm/mach-s3c/mach-anubis.c b/arch/arm/mach-s3c/mach-anubis.c index 60df40052209..4536f3e66e27 100644 --- a/arch/arm/mach-s3c/mach-anubis.c +++ b/arch/arm/mach-s3c/mach-anubis.c @@ -414,6 +414,7 @@ static void __init anubis_init(void) MACHINE_START(ANUBIS, "Simtec-Anubis") /* Maintainer: Ben Dooks */ .atag_offset = 0x100, + .nr_irqs = NR_IRQS_S3C2440, .map_io = anubis_map_io, .init_machine = anubis_init, .init_irq = s3c2440_init_irq, diff --git a/arch/arm/mach-s3c/mach-anw6410.c b/arch/arm/mach-s3c/mach-anw6410.c index 825714e9ac66..b67eae43e04f 100644 --- a/arch/arm/mach-s3c/mach-anw6410.c +++ b/arch/arm/mach-s3c/mach-anw6410.c @@ -40,7 +40,7 @@ #include "devs.h" #include "cpu.h" -#include +#include "irqs.h" #include "regs-gpio.h" #include "gpio-samsung.h" diff --git a/arch/arm/mach-s3c/mach-at2440evb.c b/arch/arm/mach-s3c/mach-at2440evb.c index c6a5a51d84aa..743403d873e0 100644 --- a/arch/arm/mach-s3c/mach-at2440evb.c +++ b/arch/arm/mach-s3c/mach-at2440evb.c @@ -225,6 +225,7 @@ static void __init at2440evb_init(void) MACHINE_START(AT2440EVB, "AT2440EVB") .atag_offset = 0x100, + .nr_irqs = NR_IRQS_S3C2440, .map_io = at2440evb_map_io, .init_machine = at2440evb_init, .init_irq = s3c2440_init_irq, diff --git a/arch/arm/mach-s3c/mach-bast.c b/arch/arm/mach-s3c/mach-bast.c index 5ac24e406157..a33ceab81e09 100644 --- a/arch/arm/mach-s3c/mach-bast.c +++ b/arch/arm/mach-s3c/mach-bast.c @@ -575,6 +575,7 @@ static void __init bast_init(void) MACHINE_START(BAST, "Simtec-BAST") /* Maintainer: Ben Dooks */ .atag_offset = 0x100, + .nr_irqs = NR_IRQS_S3C2410, .map_io = bast_map_io, .init_irq = s3c2410_init_irq, .init_machine = bast_init, diff --git a/arch/arm/mach-s3c/mach-crag6410-module.c b/arch/arm/mach-s3c/mach-crag6410-module.c index 5d1d4b67a4b7..4edde13b89b5 100644 --- a/arch/arm/mach-s3c/mach-crag6410-module.c +++ b/arch/arm/mach-s3c/mach-crag6410-module.c @@ -28,7 +28,7 @@ #include #include "cpu.h" -#include +#include "irqs.h" #include "crag6410.h" diff --git a/arch/arm/mach-s3c/mach-crag6410.c b/arch/arm/mach-s3c/mach-crag6410.c index e3e0fe897bcc..9a45474d1bf7 100644 --- a/arch/arm/mach-s3c/mach-crag6410.c +++ b/arch/arm/mach-s3c/mach-crag6410.c @@ -47,7 +47,7 @@ #include "map.h" #include "regs-gpio.h" #include "gpio-samsung.h" -#include +#include "irqs.h" #include "fb.h" #include "sdhci.h" diff --git a/arch/arm/mach-s3c/mach-gta02.c b/arch/arm/mach-s3c/mach-gta02.c index 418939ce0fc3..abfdce765525 100644 --- a/arch/arm/mach-s3c/mach-gta02.c +++ b/arch/arm/mach-s3c/mach-gta02.c @@ -572,6 +572,7 @@ static void __init gta02_init_time(void) MACHINE_START(NEO1973_GTA02, "GTA02") /* Maintainer: Nelson Castillo */ .atag_offset = 0x100, + .nr_irqs = NR_IRQS_S3C2442, .map_io = gta02_map_io, .init_irq = s3c2442_init_irq, .init_machine = gta02_machine_init, diff --git a/arch/arm/mach-s3c/mach-h1940.c b/arch/arm/mach-s3c/mach-h1940.c index 8a43ed1c4c4d..032b18837855 100644 --- a/arch/arm/mach-s3c/mach-h1940.c +++ b/arch/arm/mach-s3c/mach-h1940.c @@ -793,6 +793,7 @@ static void __init h1940_init(void) MACHINE_START(H1940, "IPAQ-H1940") /* Maintainer: Ben Dooks */ .atag_offset = 0x100, + .nr_irqs = NR_IRQS_S3C2410, .map_io = h1940_map_io, .reserve = h1940_reserve, .init_irq = s3c2410_init_irq, diff --git a/arch/arm/mach-s3c/mach-hmt.c b/arch/arm/mach-s3c/mach-hmt.c index b287e9987311..49ba16c447aa 100644 --- a/arch/arm/mach-s3c/mach-hmt.c +++ b/arch/arm/mach-s3c/mach-hmt.c @@ -26,7 +26,7 @@ #include