ARM: footbridge: cleanups
Subsystems (4)
v3 cover ARM: footbridge: cleanups
From: Arnd Bergmann <[email protected]>
I'm reposting the footbridge cleanup series for reference after Marc has successfully tested it. Russell still had concerns about the CONFIG_ISA patch, and I've tried to capture the result of the earlier email thread but left it in.
Russell, let me know if you still prefer me to drop patch 4/5 instead.
Arnd
Arnd Bergmann (5):
ARM: footbridge: remove addin mode
ARM: footbridge: remove leftover from personal-server
ARM: footbridge: move isa-dma support into footbridge
ARM: footbridge: limit CONFIG_ISA to CATS
ARM: footbridge: remove custom DMA address handling
Changes since v2:
- update changelog text for CONFIG_ISA patch
- add patch to remove custom phys_to_dma()/dma_to_phys
- fix a build failure.
arch/arm/Kconfig | 5 --
arch/arm/include/asm/dma-direct.h | 1 -
arch/arm/include/asm/dma.h | 2 +-
arch/arm/include/asm/hardware/dec21285.h | 20 ++---
arch/arm/include/asm/mach/dma.h | 5 --
arch/arm/include/asm/memory.h | 11 ---
arch/arm/kernel/Makefile | 1 -
arch/arm/mach-footbridge/Kconfig | 31 +------
arch/arm/mach-footbridge/Makefile | 5 +-
arch/arm/mach-footbridge/common.c | 79 +-----------------
arch/arm/mach-footbridge/dc21285.c | 80 +++++++++----------
.../arm/{kernel => mach-footbridge}/dma-isa.c | 11 ++-
arch/arm/mach-footbridge/dma.c | 58 --------------
.../mach-footbridge/include/mach/dma-direct.h | 8 --
.../mach-footbridge/include/mach/isa-dma.h | 14 +---
.../arm/mach-footbridge/include/mach/memory.h | 31 -------
arch/arm/mach-footbridge/isa.c | 14 ++--
drivers/tty/serial/21285.c | 3 -
18 files changed, 71 insertions(+), 308 deletions(-)
delete mode 100644 arch/arm/include/asm/dma-direct.h
rename arch/arm/{kernel => mach-footbridge}/dma-isa.c (95%)
delete mode 100644 arch/arm/mach-footbridge/dma.c
delete mode 100644 arch/arm/mach-footbridge/include/mach/dma-direct.hSignature · 11 lines
2.29.2 Cc: Russell King <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Marc Zyngier <[email protected]> _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v3 1/5 ARM: footbridge: remove addin mode
From: Arnd Bergmann <[email protected]>
This does not appear to have been used in many years, we can kill off some of the uglier code.
Among other things, it avoids a randconfig issue when both modes are disabled:
arch/arm/mach-footbridge/common.c:149:24: error: 'ebsa285_host_io_desc' defined but not used [-Werror=unused-variable]
149 | static struct map_desc ebsa285_host_io_desc[] __initdata = {
| ^~~~~~~~~~~~~~~~~~~~
arch/arm/mach-footbridge/common.c:136:24: error: 'fb_common_io_desc' defined but not used [-Werror=unused-variable]
136 | static struct map_desc fb_common_io_desc[] __initdata = {
| ^~~~~~~~~~~~~~~~~The recently added phys_to_dma() functions are now trivial and could probably be removed again as a follow-up, if anyone knows how.
--- arch/arm/include/asm/hardware/dec21285.h | 13 ---- arch/arm/mach-footbridge/Kconfig | 28 +------ arch/arm/mach-footbridge/Makefile | 2 +- arch/arm/mach-footbridge/common.c | 73 ++----------------- arch/arm/mach-footbridge/dc21285.c | 61 +++++----------- arch/arm/mach-footbridge/dma.c | 3 +- .../arm/mach-footbridge/include/mach/memory.h | 22 ------ arch/arm/mach-footbridge/isa.c | 3 - 8 files changed, 30 insertions(+), 175 deletions(-)
arch/arm/include/asm/hardware/dec21285.h +0 -13
@@ -81,19 +81,6 @@#define SA110_CNTL_XCSDIR (x) ((x)<<28)#define SA110_CNTL_PCICFN (1 << 31) -/* -* footbridge_cfn_mode() is used when we want -* to check whether we are the central function -*/ -#define __footbridge_cfn_mode () (*CSR_SA110_CNTL & SA110_CNTL_PCICFN) -#if defined(CONFIG_FOOTBRIDGE_HOST ) && defined(CONFIG_FOOTBRIDGE_ADDIN ) -#define footbridge_cfn_mode () __footbridge_cfn_mode() -#elif defined(CONFIG_FOOTBRIDGE_HOST ) -#define footbridge_cfn_mode () (1) -#else -#define footbridge_cfn_mode () (0) -#endif -#define CSR_PCIADDR_EXTN DC21285_IO(0x0140)#define CSR_PREFETCHMEMRANGE DC21285_IO(0x0144)#define CSR_XBUS_CYCLE DC21285_IO(0x0148)
arch/arm/mach-footbridge/Kconfig +2 -26
@@ -8,31 +8,17 @@ config ARCH_CATS depends on UNUSED_BOARD_FILES select CLKEVT_I8253 select CLKSRC_I8253 - select FOOTBRIDGE_HOST select ISA - select ISA_DMA select FORCE_PCI help Say Y here if you intend to run this kernel on the CATS. Saying N will reduce the size of the Footbridge kernel. -config ARCH_EBSA285_ADDIN - bool "EBSA285 (addin mode)" - select ARCH_EBSA285 - select FOOTBRIDGE_ADDIN - help - Say Y here if you intend to run this kernel on the EBSA285 card - in addin mode. - - Saying N will reduce the size of the Footbridge kernel. - config ARCH_EBSA285_HOST bool "EBSA285 (host mode)" select ARCH_EBSA285 - select FOOTBRIDGE_HOST select ISA - select ISA_DMA select ARCH_MAY_HAVE_PC_FDC select FORCE_PCI help
@@ -45,9 +31,7 @@ config ARCH_NETWINDER bool "NetWinder" select CLKEVT_I8253 select CLKSRC_I8253 - select FOOTBRIDGE_HOST select ISA - select ISA_DMA select FORCE_PCI help Say Y here if you intend to run this kernel on the Rebel.COM
@@ -61,19 +45,11 @@ endmenu # Footbridge support config FOOTBRIDGE + def_bool y select ARCH_HAS_PHYS_TO_DMA - bool - -# Footbridge in host mode -config FOOTBRIDGE_HOST - bool select ARCH_MIGHT_HAVE_PC_SERIO + select ISA_DMA -# Footbridge in addin mode -config FOOTBRIDGE_ADDIN - bool - -# EBSA285 board in either host or addin mode config ARCH_EBSA285 bool
arch/arm/mach-footbridge/Makefile +1 -1
@@ -9,7 +9,7 @@ obj-y := common.o dma.o isa-irq.o pci-y += dc21285.o pci-$(CONFIG_ARCH_CATS) += cats-pci.o -pci-$(CONFIG_ARCH_EBSA285_HOST) += ebsa285-pci.o +pci-$(CONFIG_ARCH_EBSA285) += ebsa285-pci.o pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o obj-$(CONFIG_ARCH_CATS) += cats-hw.o isa-timer.o
arch/arm/mach-footbridge/common.c +6 -67
110 lines not on this page · raw message
arch/arm/mach-footbridge/dc21285.c +20 -41
86 lines not on this page · raw message
arch/arm/mach-footbridge/dma.c +1 -2
@@ -50,8 +50,7 @@ static int __init fb_dma_init(void) dma[_DC21285_DMA (1 )].d_ops = &fb_dma_ops;#endif #ifdef CONFIG_ISA_DMA -if (footbridge_cfn_mode ()) -isa_init_dma (); +isa_init_dma ();#endif return 0 ; }
arch/arm/mach-footbridge/include/mach/memory.h +0 -22
@@ -16,22 +16,6 @@#ifndef __ASM_ARCH_MEMORY_H#define __ASM_ARCH_MEMORY_H - -#if defined(CONFIG_FOOTBRIDGE_ADDIN ) -/* -* If we may be using add-in footbridge mode, then we must -* use the out-of-line translation that makes use of the -* PCI BAR -*/ -#ifndef __ASSEMBLY__ -extern unsigned long __virt_to_bus (unsigned long ); -extern unsigned long __bus_to_virt (unsigned long ); -#endif -#define __virt_to_bus __virt_to_bus -#define __bus_to_virt __bus_to_virt - -#elif defined(CONFIG_FOOTBRIDGE_HOST ) -/* * The footbridge is programmed to expose the system RAM at 0xe0000000. * The requirement is that the RAM isn't placed at bus address 0, which
@@ -41,12 +25,6 @@ extern unsigned long __bus_to_virt(unsigned long);#define __virt_to_bus (x) ((x) + (BUS_OFFSET - PAGE_OFFSET))#define __bus_to_virt (x) ((x) - (BUS_OFFSET - PAGE_OFFSET)) -#else - -#error "Undefined footbridge mode" - -#endif -/* * Cache flushing area. */
arch/arm/mach-footbridge/isa.c +0 -3
@@ -79,9 +79,6 @@ static int __init footbridge_isa_init(void) {int err =0 ; -if (!footbridge_cfn_mode ()) -return 0 ; -/* Personal server doesn't have RTC */ if (!machine_is_personal_server ()) {isa_rtc_init ();
Signature · 7 lines
2.29.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v3 2/5 ARM: footbridge: remove leftover from personal-server
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The machine was removed a while ago, and the checks are now useless.
--- arch/arm/mach-footbridge/isa.c | 11 +++++------ drivers/tty/serial/21285.c | 3 --- 2 files changed, 5 insertions(+), 9 deletions(-)
arch/arm/mach-footbridge/isa.c +5 -6
@@ -80,12 +80,11 @@ static int __init footbridge_isa_init(void)int err =0 ;/* Personal server doesn't have RTC */ -if (!machine_is_personal_server ()) { -isa_rtc_init (); - err =platform_device_register (&rtc_device); -if (err) -printk (KERN_ERR "Unable to register RTC device: %d\n" , err); - } +isa_rtc_init (); + err =platform_device_register (&rtc_device); +if (err) +printk (KERN_ERR "Unable to register RTC device: %d\n" , err); + err =platform_device_register (&serial_device);if (err)printk (KERN_ERR "Unable to register serial device: %d\n" , err);
drivers/tty/serial/21285.c +0 -3
@@ -461,9 +461,6 @@ static int __init serial21285_console_setup(struct console *co, char *options)int parity ='n' ;int flow ='n' ; -if (machine_is_personal_server ()) - baud =57600 ; -/* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have
Signature · 7 lines
2.29.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v3 3/5 ARM: footbridge: move isa-dma support into footbridge
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
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.
---
arch/arm/Kconfig | 5 --
arch/arm/include/asm/mach/dma.h | 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 +----
8 files changed, 9 insertions(+), 85 deletions(-)
rename arch/arm/{kernel => mach-footbridge}/dma-isa.c (98%)
delete mode 100644 arch/arm/mach-footbridge/dma.carch/arm/Kconfig +0 -5
@@ -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
arch/arm/include/asm/mach/dma.h +0 -5
@@ -44,8 +44,3 @@ struct dma_struct {* isa_dma_add - add an ISA-style DMA channel */ extern int isa_dma_add (unsigned int ,dma_t *dma); - -/* -* Add the ISA DMA controller. Always takes channels 0-7. -*/ -extern void isa_init_dma (void );
arch/arm/kernel/Makefile +0 -1
@@ -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
arch/arm/mach-footbridge/Kconfig +1 -1
@@ -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
arch/arm/mach-footbridge/Makefile +1 -2
@@ -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
arch/arm/mach-footbridge/dma-isa.c renamed from arch/arm/kernel/dma-isa.c +4 -3
@@ -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_dma_init (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);
arch/arm/mach-footbridge/dma.c deleted +0 -57
57 lines not on this page · raw message
arch/arm/mach-footbridge/include/mach/isa-dma.h +3 -11
@@ -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 */
Signature · 7 lines
2.29.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v3 4/5 ARM: footbridge: limit CONFIG_ISA to CATS
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The CONFIG_ISA option is only used for actual add-in cards, not on-board devices. NetWinder has no hardware support for those, and ebsa285 appears to not support them in Linux, as the XBUS is not set up that way and there is no support for a PCI-ISA bridge.
CATS on the other hand has four ISA slots connected to a PCI-ISA bridge device.
Russell mentioned that it is no longer possible to select the sound drivers for Netwinder after this, as the WaveArtist sound chip is connected to the ISA bus. However, the WaveArtist module was removed years ago in linux-4.15 and did not actually depend on CONFIG_ISA. While the SoundBlaster compatibility mode of the SoundChip might work with the ALSA sb16-isa driver with a little help, there is no mixer support without the waveartist driver, and the default settings for sb16 never probe IRQ 3.
--- arch/arm/mach-footbridge/Kconfig | 2 -- 1 file changed, 2 deletions(-)
arch/arm/mach-footbridge/Kconfig +0 -2
@@ -18,7 +18,6 @@ config ARCH_CATS config ARCH_EBSA285_HOST bool "EBSA285 (host mode)" select ARCH_EBSA285 - select ISA select ARCH_MAY_HAVE_PC_FDC select FORCE_PCI help
@@ -31,7 +30,6 @@ config ARCH_NETWINDER bool "NetWinder" select CLKEVT_I8253 select CLKSRC_I8253 - select ISA select FORCE_PCI help Say Y here if you intend to run this kernel on the Rebel.COM
Signature · 7 lines
2.29.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Russell King (Oracle)
maintainerRe: [PATCH v3 4/5] ARM: footbridge: limit CONFIG_ISA to CATS
Quoted 7 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The
CONFIG_ISAoption is only used for actual add-in cards, not on-board devices. NetWinder has no hardware support for those, and ebsa285 appears to not support them in Linux, as the XBUS is not set up that way and there is no support for a PCI-ISA bridge.
That is an incorrect assumption, but is still true as far as ISA DMA is concerned.
The "Team" produced a PCI card with a PCI southbridge chip on, along with ISAPNP devices. ISAPNP depends on CONFIG_ISA... That said, using the "ESS ES1879 Plug and Play AudioDrive" on it requires ISA DMA, and as DMA from the PCI southbridge causes the PCI bus to deadlock, it probably doesn't matter.
However, what I'm pointing out is that the assertion that CONFIG_ISA means ISA cards is not entirely correct with the creation of this PCI southbridge card.
(This card gives me keyboard, mouse, serial etc ports which is its main use in the machine.)
Signature · 7 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v3 4/5] ARM: footbridge: limit CONFIG_ISA to CATS
Quoted 18 lines · Russell King (Oracle)
Quoted 7 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The
CONFIG_ISAoption is only used for actual add-in cards, not on-board devices. NetWinder has no hardware support for those, and ebsa285 appears to not support them in Linux, as the XBUS is not set up that way and there is no support for a PCI-ISA bridge.That is an incorrect assumption, but is still true as far as ISA DMA is concerned.
The "Team" produced a PCI card with a PCI southbridge chip on, along with ISAPNP devices. ISAPNP depends on
CONFIG_ISA... That said, using the "ESS ES1879 Plug and Play AudioDrive" on it requires ISA DMA, and as DMA from the PCI southbridge causes the PCI bus to deadlock, it probably doesn't matter.
Quoted 6 lines
However, what I'm pointing out is that the assertion that
CONFIG_ISAmeans ISA cards is not entirely correct with the creation of this PCI southbridge card.(This card gives me keyboard, mouse, serial etc ports which is its main use in the machine.)
I dropped the patch now, and queued the rest of the series for the 6.1 merge window.
Arnd
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v3 5/5 ARM: footbridge: remove custom DMA address handling
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Footbridge is the last Arm platform that has its own __virt_to_bus()/__bus_to_virt()/phys_to_dma()/dma_to_phys() abstraction, but this is just a simple offset now.
For PCI devices, the offset that is programmed into the PCI bridge must also be set in each device using dma_direct_set_offset(). As Arm does not have a pcibios_bus_add_device() helper yet, just use a bus notifier for this.
For the ISA DMA, drivers now pass a non-translated physical address into set_dma_addr(), so they have to be converted back with the corresponding isa_bus_to_virt() function and then into the correct bus address with the offset using the isa_dma_dev.
--- arch/arm/include/asm/dma-direct.h | 1 - arch/arm/include/asm/dma.h | 2 +- arch/arm/include/asm/hardware/dec21285.h | 7 +++++++ arch/arm/include/asm/memory.h | 11 ---------- arch/arm/mach-footbridge/Kconfig | 1 - arch/arm/mach-footbridge/common.c | 10 --------- arch/arm/mach-footbridge/dc21285.c | 21 ++++++++++++++++++- arch/arm/mach-footbridge/dma-isa.c | 4 ++++ .../mach-footbridge/include/mach/dma-direct.h | 8 ------- .../arm/mach-footbridge/include/mach/memory.h | 9 -------- 10 files changed, 32 insertions(+), 42 deletions(-) delete mode 100644 arch/arm/include/asm/dma-direct.h delete mode 100644 arch/arm/mach-footbridge/include/mach/dma-direct.h
arch/arm/include/asm/dma-direct.h deleted +0 -1
@@ -1 +0,0 @@ -#include <mach/dma-direct.h>
arch/arm/include/asm/dma.h +1 -1
@@ -106,7 +106,7 @@ extern void set_dma_sg(unsigned int chan, struct scatterlist *sg, int nr_sg);*/ extern void __set_dma_addr (unsigned int chan,void *addr);#define set_dma_addr (chan, addr) \ - __set_dma_addr(chan, (void *)__bus_to_virt(addr)) + __set_dma_addr(chan, (void *)isa_bus_to_virt(addr))/* Set the DMA byte count for this channel *
arch/arm/include/asm/hardware/dec21285.h +7 -0
@@ -22,6 +22,13 @@#define DC21285_IO (x) (x)#endif +/* +* The footbridge is programmed to expose the system RAM at 0xe0000000. +* The requirement is that the RAM isn't placed at bus address 0, which +* would clash with VGA cards. +*/ +#define BUS_OFFSET 0xe0000000 +#define CSR_PCICMD DC21285_IO(0x0004)#define CSR_CLASSREV DC21285_IO(0x0008)#define CSR_PCICACHELINESIZE DC21285_IO(0x000c)
arch/arm/include/asm/memory.h +0 -11
@@ -369,17 +369,6 @@ static inline unsigned long __virt_to_idmap(unsigned long x)#define virt_to_idmap (x) __virt_to_idmap((unsigned long)(x)) -/* -* Virtual <-> DMA view memory address translations -* Again, these are *only* valid on the kernel direct mapped RAM -* memory. Use of these is *deprecated* (and that doesn't mean -* use the __ prefixed forms instead.) See dma-mapping.h. -*/ -#ifndef __virt_to_bus -#define __virt_to_bus __virt_to_phys -#define __bus_to_virt __phys_to_virt -#endif -/* * Conversion between a struct page and a physical address. *
arch/arm/mach-footbridge/Kconfig +0 -1
@@ -44,7 +44,6 @@ endmenu # Footbridge support config FOOTBRIDGE def_bool y - select ARCH_HAS_PHYS_TO_DMA select ARCH_MIGHT_HAVE_PC_SERIO select ISA_DMA_API
arch/arm/mach-footbridge/common.c +0 -10
@@ -281,13 +281,3 @@ void footbridge_restart(enum reboot_mode mode, const char *cmd) *CSR_SA110_CNTL |= (1 <<13 ); } } - -dma_addr_t phys_to_dma (struct device *dev,phys_addr_t paddr) -{ -return paddr + (BUS_OFFSET -PHYS_OFFSET ); -} - -phys_addr_t dma_to_phys (struct device *dev,dma_addr_t dev_addr) -{ -return dev_addr - (BUS_OFFSET -PHYS_OFFSET ); -}
arch/arm/mach-footbridge/dc21285.c +20 -1
@@ -5,6 +5,7 @@* Copyright (C) 1998-2001 Russell King * Copyright (C) 1998-2000 Phil Blundell */ +#include <linux/dma-map-ops.h> #include <linux/kernel.h> #include <linux/pci.h> #include <linux/interrupt.h>
@@ -241,6 +242,22 @@ static irqreturn_t dc21285_parity_irq(int irq, void *dev_id)return IRQ_HANDLED ; } +static int dc21285_pci_bus_notifier (struct notifier_block *nb, +unsigned long action, +void *data) +{ +if (action !=BUS_NOTIFY_ADD_DEVICE ) +return NOTIFY_DONE ; + +dma_direct_set_offset (data,PHYS_OFFSET ,BUS_OFFSET ,SZ_256M ); + +return NOTIFY_OK ; +} + +static struct notifier_block dc21285_pci_bus_nb = { + .notifier_call = dc21285_pci_bus_notifier, +}; +int __init dc21285_setup (int nr,struct pci_sys_data *sys) {struct resource *res;
@@ -266,6 +283,8 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys)pci_add_resource_offset (&sys->resources, &res[0 ], sys->mem_offset);pci_add_resource_offset (&sys->resources, &res[1 ], sys->mem_offset); +bus_register_notifier (&pci_bus_type, &dc21285_pci_bus_nb); +return 1 ; }
@@ -329,7 +348,7 @@ void __init dc21285_preinit(void)*/ *CSR_PCICSRBASE =0xf4000000 ; *CSR_PCICSRIOBASE =0 ; - *CSR_PCISDRAMBASE =__virt_to_bus (PAGE_OFFSET ); + *CSR_PCISDRAMBASE =BUS_OFFSET ; *CSR_PCIROMBASE =0 ; *CSR_PCICMD =PCI_COMMAND_MEMORY |PCI_COMMAND_MASTER |PCI_COMMAND_INVALIDATE |PCICMD_ERROR_BITS ;
arch/arm/mach-footbridge/dma-isa.c +4 -0
@@ -11,6 +11,7 @@* arch/arm/kernel/dma-ebsa285.c * Copyright (C) 1998 Phil Blundell */ +#include <linux/dma-map-ops.h> #include <linux/ioport.h> #include <linux/init.h> #include <linux/dma-mapping.h>
@@ -18,6 +19,7 @@#include <asm/dma.h> #include <asm/mach/dma.h> +#include <asm/hardware/dec21285.h> #define ISA_DMA_MASK 0#define ISA_DMA_MODE 1
@@ -221,6 +223,8 @@ static int __init isa_dma_init(void)request_dma (DMA_ISA_CASCADE ,"cascade" ); } +dma_direct_set_offset (&isa_dma_dev,PHYS_OFFSET ,BUS_OFFSET ,SZ_256M ); +return 0 ; }core_initcall (isa_dma_init);
arch/arm/mach-footbridge/include/mach/dma-direct.h deleted +0 -8
@@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef MACH_FOOTBRIDGE_DMA_DIRECT_H -#define MACH_FOOTBRIDGE_DMA_DIRECT_H 1 - -dma_addr_t phys_to_dma (struct device *dev,phys_addr_t paddr); -phys_addr_t dma_to_phys (struct device *dev,dma_addr_t dev_addr); - -#endif /* MACH_FOOTBRIDGE_DMA_DIRECT_H */
arch/arm/mach-footbridge/include/mach/memory.h +0 -9
@@ -16,15 +16,6 @@#ifndef __ASM_ARCH_MEMORY_H#define __ASM_ARCH_MEMORY_H -/* -* The footbridge is programmed to expose the system RAM at 0xe0000000. -* The requirement is that the RAM isn't placed at bus address 0, which -* would clash with VGA cards. -*/ -#define BUS_OFFSET 0xe0000000 -#define __virt_to_bus (x) ((x) + (BUS_OFFSET - PAGE_OFFSET)) -#define __bus_to_virt (x) ((x) - (BUS_OFFSET - PAGE_OFFSET)) -/* * Cache flushing area. */
Signature · 7 lines
2.29.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel