From patchwork Thu Aug 18 21:15:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12947978 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17238C00140 for ; Thu, 18 Aug 2022 21:17:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lO2JUKYUbAgTjn4jYUosLTXFtbV8GNIyRB6+ixVdQlk=; b=PbTRxwRuoU7atv UGiP7D1Ngn1Pg5xPVJAzmrKIq1UAe8cjGTB3xAFTya/F4hJo9p2U+MWGqVYDxGXm3Ed9tDZzmeJdx aku2GcYj65MbckAJwx2WqA7BnLlcrN1tMXGY48xAQtnqdtcuqKdNlk6XidGta8EGPzb+G7Xv4wWJ+ vCwdAA8/cdpOL6MSnTC41OXdhUDzH4Bbkw66mTpSM+FCUzk3ZtMOvKa8Xk8twmFl8G+tfSRBiNCtN ca97WkzxBfE7zHQG9j/nhluvIUSkRHepm8vUw336C+mixbd5R6ww2sOjwI+QkCO/y8RZvCICUEgFh s2gTzPHR4CrkhuQFWakQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOmsi-009jKr-To; Thu, 18 Aug 2022 21:16:49 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOms4-009iuM-KZ for linux-arm-kernel@lists.infradead.org; Thu, 18 Aug 2022 21:16:10 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id 26F46B82412; Thu, 18 Aug 2022 21:16:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48FEBC433B5; Thu, 18 Aug 2022 21:16:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660857365; bh=hmm/QFL7jCta2OjdSxcxJaevc86Rcoy8NfIWFne5tvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pt4FE1jy1DSqZkADgkccazLUzSG3HgS/YGZtBsKPNP/IdpU2xY9Jc3nzgK/AulVDR iAr20SAEug+UhXQlxI7QfDDSybiNsuprHxHbxubIAJFIfZInKfm93c3Tx6gJ4njC8C QvflvkrVxgAmydXxcoX3qCRffymhceZqXUGuAi1LtIl3EUyYmaPE9T94bUo4K4Boqe Voa/snGN4t73oIo0h7QEA1nl+4NELvyI0SMuCP8xE60SpGQvEuZu2KzQ0pU5nuvGUL Razn9VPEC1ukZVbZAaXLmE5eJQhIimb87CZ/kXsGeCjjhbCzOQToK3tMoYY8UMAa2y mnDBoK36gCUbA== From: Arnd Bergmann To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Arnd Bergmann , Russell King , Christoph Hellwig , Linus Walleij , Marc Zyngier Subject: [PATCH 3/4] ARM: footbridge: move isa-dma support into footbridge Date: Thu, 18 Aug 2022 23:15:49 +0200 Message-Id: <20220818211550.3272321-4-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220818211550.3272321-1-arnd@kernel.org> References: <20220818211550.3272321-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220818_141609_014849_97B542EF X-CRM114-Status: GOOD ( 22.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann The dma-isa.c was shared between footbridge and shark a long time ago, but as shark was removed, it can be made footbridge specific again. The fb_dma bits in turn are not used at all and can be removed. All the ISA related files are now built into the platform regardless of CONFIG_ISA, as they just refer to on-chip devices rather than actual ISA cards. Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig --- arch/arm/Kconfig | 5 -- arch/arm/kernel/Makefile | 1 - arch/arm/mach-footbridge/Kconfig | 2 +- arch/arm/mach-footbridge/Makefile | 3 +- .../arm/{kernel => mach-footbridge}/dma-isa.c | 7 ++- arch/arm/mach-footbridge/dma.c | 57 ------------------- .../mach-footbridge/include/mach/isa-dma.h | 14 +---- 7 files changed, 9 insertions(+), 80 deletions(-) rename arch/arm/{kernel => mach-footbridge}/dma-isa.c (98%) delete mode 100644 arch/arm/mach-footbridge/dma.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 87badeae3181..ec7e48f6bd91 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -989,11 +989,6 @@ config ISA (MCA) or VESA. ISA is an older system, now being displaced by PCI; newer boards don't support it. If you have ISA, say Y, otherwise N. -# Select ISA DMA controller support -config ISA_DMA - bool - select ISA_DMA_API - # Select ISA DMA interface config ISA_DMA_API bool diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 553866751e1a..95034d32213c 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -45,7 +45,6 @@ obj-$(CONFIG_ISA_DMA_API) += dma.o obj-$(CONFIG_FIQ) += fiq.o fiqasm.o obj-$(CONFIG_MODULES) += armksyms.o module.o obj-$(CONFIG_ARM_MODULE_PLTS) += module-plts.o -obj-$(CONFIG_ISA_DMA) += dma-isa.o obj-$(CONFIG_PCI) += bios32.o isa.o obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o obj-$(CONFIG_HIBERNATION) += hibernate.o diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig index 3497ea8e91e3..1a3676109654 100644 --- a/arch/arm/mach-footbridge/Kconfig +++ b/arch/arm/mach-footbridge/Kconfig @@ -48,7 +48,7 @@ config FOOTBRIDGE def_bool y select ARCH_HAS_PHYS_TO_DMA select ARCH_MIGHT_HAVE_PC_SERIO - select ISA_DMA + select ISA_DMA_API config ARCH_EBSA285 bool diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile index 30bae6684dce..55d570739f19 100644 --- a/arch/arm/mach-footbridge/Makefile +++ b/arch/arm/mach-footbridge/Makefile @@ -5,7 +5,7 @@ # Object file lists. -obj-y := common.o dma.o isa-irq.o +obj-y := common.o isa-irq.o isa.o isa-rtc.o dma-isa.o pci-y += dc21285.o pci-$(CONFIG_ARCH_CATS) += cats-pci.o @@ -18,4 +18,3 @@ obj-$(CONFIG_ARCH_NETWINDER) += netwinder-hw.o isa-timer.o obj-$(CONFIG_PCI) +=$(pci-y) -obj-$(CONFIG_ISA) += isa.o isa-rtc.o diff --git a/arch/arm/kernel/dma-isa.c b/arch/arm/mach-footbridge/dma-isa.c similarity index 98% rename from arch/arm/kernel/dma-isa.c rename to arch/arm/mach-footbridge/dma-isa.c index 2d90ecce5a11..e45bc31b0959 100644 --- a/arch/arm/kernel/dma-isa.c +++ b/arch/arm/mach-footbridge/dma-isa.c @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * linux/arch/arm/kernel/dma-isa.c - * * Copyright (C) 1999-2000 Russell King * * ISA DMA primitives @@ -157,7 +155,7 @@ static dma_t isa_dma[8]; /* * ISA DMA always starts at channel 0 */ -void __init isa_init_dma(void) +static int __init isa_init_dma(void) { /* * Try to autodetect presence of an ISA DMA controller. @@ -222,4 +220,7 @@ void __init isa_init_dma(void) request_dma(DMA_ISA_CASCADE, "cascade"); } + + return 0; } +core_initcall(isa_dma_init); diff --git a/arch/arm/mach-footbridge/dma.c b/arch/arm/mach-footbridge/dma.c deleted file mode 100644 index 228757c8e06f..000000000000 --- a/arch/arm/mach-footbridge/dma.c +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * linux/arch/arm/kernel/dma-ebsa285.c - * - * Copyright (C) 1998 Phil Blundell - * - * DMA functions specific to EBSA-285/CATS architectures - * - * Changelog: - * 09-Nov-1998 RMK Split out ISA DMA functions to dma-isa.c - * 17-Mar-1999 RMK Allow any EBSA285-like architecture to have - * ISA DMA controllers. - */ -#include -#include -#include -#include - -#include - -#include -#include - -#if 0 -static int fb_dma_request(unsigned int chan, dma_t *dma) -{ - return -EINVAL; -} - -static void fb_dma_enable(unsigned int chan, dma_t *dma) -{ -} - -static void fb_dma_disable(unsigned int chan, dma_t *dma) -{ -} - -static struct dma_ops fb_dma_ops = { - .type = "fb", - .request = fb_dma_request, - .enable = fb_dma_enable, - .disable = fb_dma_disable, -}; -#endif - -static int __init fb_dma_init(void) -{ -#if 0 - dma[_DC21285_DMA(0)].d_ops = &fb_dma_ops; - dma[_DC21285_DMA(1)].d_ops = &fb_dma_ops; -#endif -#ifdef CONFIG_ISA_DMA - isa_init_dma(); -#endif - return 0; -} -core_initcall(fb_dma_init); diff --git a/arch/arm/mach-footbridge/include/mach/isa-dma.h b/arch/arm/mach-footbridge/include/mach/isa-dma.h index 8a1b991076e1..b10731a1f66a 100644 --- a/arch/arm/mach-footbridge/include/mach/isa-dma.h +++ b/arch/arm/mach-footbridge/include/mach/isa-dma.h @@ -10,17 +10,9 @@ #ifndef __ASM_ARCH_DMA_H #define __ASM_ARCH_DMA_H -/* - * The 21285 has two internal DMA channels; we call these 8 and 9. - * On CATS hardware we have an additional eight ISA dma channels - * numbered 0..7. - */ -#define _ISA_DMA(x) (0+(x)) -#define _DC21285_DMA(x) (8+(x)) - -#define MAX_DMA_CHANNELS 10 +#define MAX_DMA_CHANNELS 8 -#define DMA_FLOPPY _ISA_DMA(2) -#define DMA_ISA_CASCADE _ISA_DMA(4) +#define DMA_FLOPPY (2) +#define DMA_ISA_CASCADE (4) #endif /* _ASM_ARCH_DMA_H */