From 4b3b8ee5db374b76608537e061f2efd90e21179d Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 18 May 2004 17:14:44 -0700 Subject: [PATCH] [PATCH] ARM/ARM26 IDE cleanups - clear hwif->hw in setup-pci.c before using it - fix arch/arm/Kconfig to allow IDE only on platforms supporting it - introduce IDE_ARCH_OBSOLETE_INIT and ide_default_io_ctl() so we can use generic ide_init_hwif_ports() and kill no longer needed (leave broken lh7a40x and sa1100 versions) Cross-compile tested on ARM. --- arch/arm/Kconfig | 2 ++ drivers/ide/ide.c | 7 ---- drivers/ide/setup-pci.c | 7 ++-- include/asm-alpha/ide.h | 3 ++ include/asm-arm/arch-cl7500/ide.h | 36 ------------------- include/asm-arm/arch-ebsa110/ide.h | 1 - include/asm-arm/arch-ebsa285/ide.h | 49 -------------------------- include/asm-arm/arch-iop3xx/ide.h | 49 -------------------------- include/asm-arm/arch-ixp4xx/ide.h | 37 -------------------- include/asm-arm/arch-l7200/ide.h | 27 --------------- include/asm-arm/arch-lh7a40x/ide.h | 7 ---- include/asm-arm/arch-nexuspci/ide.h | 37 -------------------- include/asm-arm/arch-pxa/ide.h | 54 ----------------------------- include/asm-arm/arch-rpc/ide.h | 35 ------------------- include/asm-arm/arch-s3c2410/ide.h | 49 -------------------------- include/asm-arm/arch-shark/ide.h | 32 ----------------- include/asm-arm/arch-tbox/ide.h | 3 -- include/asm-arm/ide.h | 13 ++++++- include/asm-arm26/ide.h | 24 ++----------- include/asm-i386/ide.h | 3 ++ include/asm-ia64/ide.h | 3 ++ include/asm-mips/mach-generic/ide.h | 3 ++ include/asm-parisc/ide.h | 3 ++ include/asm-ppc/ide.h | 3 ++ include/asm-ppc64/ide.h | 3 ++ include/asm-sh/ide.h | 3 ++ include/asm-sparc/ide.h | 3 ++ include/asm-sparc64/ide.h | 3 ++ include/asm-x86_64/ide.h | 3 ++ include/linux/ide.h | 13 ++++--- 30 files changed, 62 insertions(+), 453 deletions(-) delete mode 100644 include/asm-arm/arch-cl7500/ide.h delete mode 100644 include/asm-arm/arch-ebsa110/ide.h delete mode 100644 include/asm-arm/arch-ebsa285/ide.h delete mode 100644 include/asm-arm/arch-iop3xx/ide.h delete mode 100644 include/asm-arm/arch-ixp4xx/ide.h delete mode 100644 include/asm-arm/arch-l7200/ide.h delete mode 100644 include/asm-arm/arch-nexuspci/ide.h delete mode 100644 include/asm-arm/arch-pxa/ide.h delete mode 100644 include/asm-arm/arch-rpc/ide.h delete mode 100644 include/asm-arm/arch-s3c2410/ide.h delete mode 100644 include/asm-arm/arch-shark/ide.h delete mode 100644 include/asm-arm/arch-tbox/ide.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 55694c5351a55..ddc213a96355f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -609,7 +609,9 @@ source "drivers/acorn/block/Kconfig" source "net/Kconfig" +if ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_L7200 || ARCH_LH7A40X || ARCH_FTVPCI || ARCH_PXA || ARCH_RPC || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE source "drivers/ide/Kconfig" +endif source "drivers/scsi/Kconfig" diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index ee2f5b25ec612..13f53f4b3c9b8 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -315,13 +315,6 @@ static void __init init_ide_data (void) #endif } -/* OBSOLETE: still needed on arm26 and arm */ -#ifdef CONFIG_ARM - /* Add default hw interfaces */ - initializing = 1; - ide_init_default_hwifs(); - initializing = 0; -#endif #ifdef CONFIG_IDE_ARM ide_arm_init(); #endif diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 62484715f83ac..993e030c84bc4 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -444,13 +444,12 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d, } if ((hwif = ide_match_hwif(base, d->bootable, d->name)) == NULL) return NULL; /* no room in ide_hwifs[] */ - if (hwif->io_ports[IDE_DATA_OFFSET] != base) { -fixup_address: + if (hwif->io_ports[IDE_DATA_OFFSET] != base || + hwif->io_ports[IDE_CONTROL_OFFSET] != (ctl | 2)) { + memset(&hwif->hw, 0, sizeof(hwif->hw)); ide_init_hwif_ports(&hwif->hw, base, (ctl | 2), NULL); memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; - } else if (hwif->io_ports[IDE_CONTROL_OFFSET] != (ctl | 2)) { - goto fixup_address; } hwif->chipset = ide_pci; hwif->pci_dev = dev; diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h index 9444b3d6dccc6..6624e5422421f 100644 --- a/include/asm-alpha/ide.h +++ b/include/asm-alpha/ide.h @@ -43,6 +43,9 @@ static inline unsigned long ide_default_io_base(int index) } } +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #ifdef CONFIG_PCI #define ide_init_default_irq(base) (0) #else diff --git a/include/asm-arm/arch-cl7500/ide.h b/include/asm-arm/arch-cl7500/ide.h deleted file mode 100644 index db8b68f3ef493..0000000000000 --- a/include/asm-arm/arch-cl7500/ide.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * linux/include/asm-arm/arch-cl7500/ide.h - * - * Copyright (c) 1997 Russell King - * - * Modifications: - * 29-07-1998 RMK Major re-work of IDE architecture specific code - */ - -/* - * Set up a hw structure for a specified data port, control port and IRQ. - * This should follow whatever the default interface uses. - */ -static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, - unsigned long ctrl_port, int *irq) -{ - unsigned long reg = data_port; - int i; - - memset(hw, 0, sizeof(*hw)); - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw->io_ports[i] = reg; - reg += 1; - } - if (ctrl_port) { - hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; - } else { - hw->io_ports[IDE_CONTROL_OFFSET] = data_port + 0x206; - } - if (irq != NULL) - *irq = 0; - hw->io_ports[IDE_IRQ_OFFSET] = 0; -} - -static inline void ide_init_default_hwifs(void) { ; } diff --git a/include/asm-arm/arch-ebsa110/ide.h b/include/asm-arm/arch-ebsa110/ide.h deleted file mode 100644 index 35eff5c28fe52..0000000000000 --- a/include/asm-arm/arch-ebsa110/ide.h +++ /dev/null @@ -1 +0,0 @@ -/* no ide */ diff --git a/include/asm-arm/arch-ebsa285/ide.h b/include/asm-arm/arch-ebsa285/ide.h deleted file mode 100644 index 09c0310b60851..0000000000000 --- a/include/asm-arm/arch-ebsa285/ide.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * linux/include/asm-arm/arch-ebsa285/ide.h - * - * Copyright (C) 1998 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Modifications: - * 29-07-1998 RMK Major re-work of IDE architecture specific code - */ -#include - -/* - * Set up a hw structure for a specified data port, control port and IRQ. - * This should follow whatever the default interface uses. - */ -static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, - unsigned long ctrl_port, int *irq) -{ - unsigned long reg = data_port; - int i; - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw->io_ports[i] = reg; - reg += 1; - } - hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; - if (irq) - *irq = 0; -} - -/* - * This registers the standard ports for this architecture with the IDE - * driver. - */ -static __inline__ void ide_init_default_hwifs(void) -{ -#if 0 - hw_regs_t hw; - - memset(hw, 0, sizeof(*hw)); - - ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, NULL); - hw.irq = IRQ_HARDDISK; - ide_register_hw(&hw); -#endif -} diff --git a/include/asm-arm/arch-iop3xx/ide.h b/include/asm-arm/arch-iop3xx/ide.h deleted file mode 100644 index c2b0265ddfae1..0000000000000 --- a/include/asm-arm/arch-iop3xx/ide.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * include/asm-arm/arch-iop3xx/ide.h - * - * Generic IDE functions for IOP310 systems - * - * Author: Deepak Saxena - * - * Copyright 2001 MontaVista Software Inc. - * - * 09/26/2001 - Sharon Baartmans - * Fixed so it actually works. - */ - -#ifndef _ASM_ARCH_IDE_H_ -#define _ASM_ARCH_IDE_H_ - -/* - * Set up a hw structure for a specified data port, control port and IRQ. - * This should follow whatever the default interface uses. - */ -static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, - unsigned long ctrl_port, int *irq) -{ - unsigned long reg = data_port; - int i; - int regincr = 1; - - memset(hw, 0, sizeof(*hw)); - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw->io_ports[i] = reg; - reg += regincr; - } - - hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; - - if (irq) *irq = 0; -} - -/* - * This registers the standard ports for this architecture with the IDE - * driver. - */ -static __inline__ void ide_init_default_hwifs(void) -{ - /* There are no standard ports */ -} - -#endif diff --git a/include/asm-arm/arch-ixp4xx/ide.h b/include/asm-arm/arch-ixp4xx/ide.h deleted file mode 100644 index c3117137ca988..0000000000000 --- a/include/asm-arm/arch-ixp4xx/ide.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * linux/include/asm-arm/arch-ixp4xx/ide.h - * - * Copyright (C) 2003-2004 MontaVista Software, Inc. - * Based on original code Copyright (c) 1998 Russell King - */ - - -/* - * Set up a hw structure for a specified data port, control port and IRQ. - * This should follow whatever the default interface uses. - */ -static __inline__ void -ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int *irq) -{ - unsigned long reg = (unsigned long) data_port; - int i; - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw->io_ports[i] = reg; - reg += 1; - } - hw->io_ports[IDE_CONTROL_OFFSET] = (unsigned long) ctrl_port; - if (irq) - *irq = 0; -} - -/* - * This registers the standard ports for this architecture with the IDE - * driver. - */ -static __inline__ void ide_init_default_hwifs(void) -{ - /* There are no standard ports */ -} - - diff --git a/include/asm-arm/arch-l7200/ide.h b/include/asm-arm/arch-l7200/ide.h deleted file mode 100644 index 62ee12ada0611..0000000000000 --- a/include/asm-arm/arch-l7200/ide.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * linux/include/asm-arm/arch-l7200/ide.h - * - * Copyright (c) 2000 Steve Hill (sjhill@cotw.com) - * - * Changelog: - * 03-29-2000 SJH Created file placeholder - */ -#include - -/* - * Set up a hw structure for a specified data port, control port and IRQ. - * This should follow whatever the default interface uses. - */ -static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, - unsigned long ctrl_port, int *irq) -{ -} - -/* - * This registers the standard ports for this architecture with the IDE - * driver. - */ -static __inline__ void -ide_init_default_hwifs(void) -{ -} diff --git a/include/asm-arm/arch-lh7a40x/ide.h b/include/asm-arm/arch-lh7a40x/ide.h index 7a461d166052d..fb50c0799f691 100644 --- a/include/asm-arm/arch-lh7a40x/ide.h +++ b/include/asm-arm/arch-lh7a40x/ide.h @@ -64,13 +64,6 @@ static __inline__ void ide_init_default_hwifs (void) ide_register_hw (&hw, &hwif); lpd7a40x_hwif_ioops (hwif); /* Override IO routines */ } - -#else - -static __inline__ void ide_init_hwif_ports (hw_regs_t *hw, int data_port, - int ctrl_port, int *irq) {} -static __inline__ void ide_init_default_hwifs (void) {} - #endif #endif diff --git a/include/asm-arm/arch-nexuspci/ide.h b/include/asm-arm/arch-nexuspci/ide.h deleted file mode 100644 index 5514808d568aa..0000000000000 --- a/include/asm-arm/arch-nexuspci/ide.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * linux/include/asm-arm/arch-nexuspci/ide.h - * - * Copyright (c) 1998 Russell King - * - * Modifications: - * 29-07-1998 RMK Major re-work of IDE architecture specific code - */ -#include - -/* - * Set up a hw structure for a specified data port, control port and IRQ. - * This should follow whatever the default interface uses. - */ -static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, - unsigned long ctrl_port, int *irq) -{ - unsigned long reg = data_port; - int i; - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw->io_ports[i] = reg; - reg += 1; - } - hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; - if (irq) - *irq = 0; -} - -/* - * This registers the standard ports for this architecture with the IDE - * driver. - */ -static __inline__ void ide_init_default_hwifs(void) -{ - /* There are no standard ports */ -} diff --git a/include/asm-arm/arch-pxa/ide.h b/include/asm-arm/arch-pxa/ide.h deleted file mode 100644 index a9efdce2bf965..0000000000000 --- a/include/asm-arm/arch-pxa/ide.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * linux/include/asm-arm/arch-pxa/ide.h - * - * Author: George Davis - * Created: Jan 10, 2002 - * Copyright: MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * - * Originally based upon linux/include/asm-arm/arch-sa1100/ide.h - * - */ - -#include -#include -#include - - -/* - * Set up a hw structure for a specified data port, control port and IRQ. - * This should follow whatever the default interface uses. - */ -static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, - unsigned long ctrl_port, int *irq) -{ - unsigned long reg = data_port; - int i; - int regincr = 1; - - memset(hw, 0, sizeof(*hw)); - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw->io_ports[i] = reg; - reg += regincr; - } - - hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; - - if (irq) - *irq = 0; -} - - -/* - * Register the standard ports for this architecture with the IDE driver. - */ -static __inline__ void -ide_init_default_hwifs(void) -{ - /* Nothing to declare... */ -} diff --git a/include/asm-arm/arch-rpc/ide.h b/include/asm-arm/arch-rpc/ide.h deleted file mode 100644 index b7595a85c0108..0000000000000 --- a/include/asm-arm/arch-rpc/ide.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * linux/include/asm-arm/arch-rpc/ide.h - * - * Copyright (C) 1997 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Modifications: - * 29-07-1998 RMK Major re-work of IDE architecture specific code - */ - -/* - * Set up a hw structure for a specified data port, control port and IRQ. - * This should follow whatever the default interface uses. - */ -static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, - unsigned long ctrl_port, int *irq) -{ - unsigned long reg = data_port; - int i; - - memset(hw, 0, sizeof(*hw)); - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw->io_ports[i] = reg; - reg += 1; - } - hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; - if (irq) - *irq = 0; -} - -static inline void ide_init_default_hwifs(void) { ; } diff --git a/include/asm-arm/arch-s3c2410/ide.h b/include/asm-arm/arch-s3c2410/ide.h deleted file mode 100644 index de651e75d240f..0000000000000 --- a/include/asm-arm/arch-s3c2410/ide.h +++ /dev/null @@ -1,49 +0,0 @@ -/* linux/include/asm-arm/arch-s3c2410/ide.h - * - * Copyright (C) 1997 Russell King - * Copyright (C) 2003 Simtec Electronics - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Modifications: - * 29-07-1998 RMK Major re-work of IDE architecture specific code - * 16-05-2003 BJD Changed to work with BAST IDE ports - * 04-09-2003 BJD Modifications for V2.6 - */ - -#ifndef __ASM_ARCH_IDE_H -#define __ASM_ARCH_IDE_H - -#include - -/* - * Set up a hw structure for a specified data port, control port and IRQ. - * This should follow whatever the default interface uses. - */ - -static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, - unsigned long ctrl_port, int *irq) -{ - unsigned long reg = data_port; - int i; - - memset(hw, 0, sizeof(*hw)); - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw->io_ports[i] = reg; - reg += 1; - } - hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; - if (irq) - *irq = 0; -} - -/* we initialise our ide devices from the main ide core, due to problems - * with doing it in this function -*/ - -#define ide_init_default_hwifs() do { } while(0) - -#endif /* __ASM_ARCH_IDE_H */ diff --git a/include/asm-arm/arch-shark/ide.h b/include/asm-arm/arch-shark/ide.h deleted file mode 100644 index 3aa231a9e7c61..0000000000000 --- a/include/asm-arm/arch-shark/ide.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * linux/include/asm-arm/arch-shark/ide.h - * - * by Alexander Schulz - * - * derived from: - * linux/include/asm-arm/arch-ebsa285/ide.h - * Copyright (c) 1998 Russell King - */ - -/* - * Set up a hw structure for a specified data port, control port and IRQ. - * This should follow whatever the default interface uses. - */ -static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, - unsigned long ctrl_port, int *irq) -{ - unsigned long reg = data_port; - int i; - - memset(hw, 0, sizeof(*hw)); - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw->io_ports[i] = reg; - reg += 1; - } - hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; - if (irq) - *irq = 0; -} - -static inline void ide_init_default_hwifs(void) { ; } diff --git a/include/asm-arm/arch-tbox/ide.h b/include/asm-arm/arch-tbox/ide.h deleted file mode 100644 index d66e67c9402ee..0000000000000 --- a/include/asm-arm/arch-tbox/ide.h +++ /dev/null @@ -1,3 +0,0 @@ -/* - * linux/include/asm-arm/arch-tbox/ide.h - */ diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h index c57af4d65abba..d43dee139c591 100644 --- a/include/asm-arm/ide.h +++ b/include/asm-arm/ide.h @@ -17,7 +17,9 @@ #define MAX_HWIFS 4 #endif -#include +#if defined(CONFIG_ARCH_LH7A40X) || defined(CONFIG_ARCH_SA1100) +# include /* obsolete + broken */ +#endif /* * We always use the new IDE port registering, @@ -26,6 +28,15 @@ #define ide_default_io_base(i) (0) #define ide_default_irq(b) (0) +#if !defined(CONFIG_ARCH_L7200) && !defined(CONFIG_ARCH_LH7A40X) +# define IDE_ARCH_OBSOLETE_INIT +# ifdef CONFIG_ARCH_CLPS7500 +# define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ +# else +# define ide_default_io_ctl(base) (0) +# endif +#endif /* !ARCH_L7200 && !ARCH_LH7A40X */ + #define ide_init_default_irq(base) (0) #define __ide_mm_insw(port,addr,len) readsw(port,addr,len) diff --git a/include/asm-arm26/ide.h b/include/asm-arm26/ide.h index ae0b3b0143a26..7c8e435bdf8a7 100644 --- a/include/asm-arm26/ide.h +++ b/include/asm-arm26/ide.h @@ -26,29 +26,8 @@ #define __ide_mm_outsw(port,addr,len) writesw(port,addr,len) #define __ide_mm_outsl(port,addr,len) writesl(port,addr,len) -/* - * Set up a hw structure for a specified data port, control port and IRQ. - * This should follow whatever the default interface uses. - */ -static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, - unsigned long ctrl_port, int *irq) -{ - unsigned long reg = data_port; - int i; - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw->io_ports[i] = reg; - reg += 1; - } - hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; - if (irq) - *irq = 0; -} - #define ide_init_default_irq(base) (0) -static inline void ide_init_default_hwifs(void) { ; } - /* * We always use the new IDE port registering, * so these are fixed here. @@ -56,6 +35,9 @@ static inline void ide_init_default_hwifs(void) { ; } #define ide_default_io_base(i) (0) #define ide_default_irq(b) (0) +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #endif /* __KERNEL__ */ #endif /* __ASMARM_IDE_H */ diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h index e241be6d6e40c..d13334817b7fb 100644 --- a/include/asm-i386/ide.h +++ b/include/asm-i386/ide.h @@ -85,6 +85,9 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_por } #endif +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #ifdef CONFIG_BLK_DEV_IDEPCI #define ide_init_default_irq(base) (0) #else diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h index 778d69ec67a2b..2adbd91a40c8c 100644 --- a/include/asm-ia64/ide.h +++ b/include/asm-ia64/ide.h @@ -53,6 +53,9 @@ static inline unsigned long ide_default_io_base(int index) } } +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #ifdef CONFIG_PCI #define ide_init_default_irq(base) (0) #else diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index a4618ca9fa81b..b70b1ec05fe6b 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h @@ -48,6 +48,9 @@ static inline unsigned long ide_default_io_base(int index) } } +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #ifdef CONFIG_BLK_DEV_IDEPCI #define ide_init_default_irq(base) (0) #else diff --git a/include/asm-parisc/ide.h b/include/asm-parisc/ide.h index 61c3792177b35..c2df5fce0da2b 100644 --- a/include/asm-parisc/ide.h +++ b/include/asm-parisc/ide.h @@ -22,6 +22,9 @@ #define ide_default_irq(base) (0) #define ide_default_io_base(index) (0) +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #define ide_init_default_irq(base) (0) #define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id)) diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h index 1393d51c3e3ee..fbcddf33cdba4 100644 --- a/include/asm-ppc/ide.h +++ b/include/asm-ppc/ide.h @@ -57,6 +57,9 @@ static __inline__ unsigned long ide_default_io_base(int index) return 0; } +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #ifdef CONFIG_PCI #define ide_init_default_irq(base) (0) #else diff --git a/include/asm-ppc64/ide.h b/include/asm-ppc64/ide.h index 88d3645e5d268..a06fef9f9efb3 100644 --- a/include/asm-ppc64/ide.h +++ b/include/asm-ppc64/ide.h @@ -25,6 +25,9 @@ static inline int ide_default_irq(unsigned long base) { return 0; } static inline unsigned long ide_default_io_base(int index) { return 0; } +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #define ide_init_default_irq(base) (0) #endif /* __KERNEL__ */ diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h index 4aa1568d2fc32..c88ba763cc547 100644 --- a/include/asm-sh/ide.h +++ b/include/asm-sh/ide.h @@ -72,6 +72,9 @@ static inline unsigned long ide_default_io_base(int index) } } +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #ifdef CONFIG_PCI #define ide_init_default_irq(base) (0) #else diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h index 1f4397221b14b..6e8468f967585 100644 --- a/include/asm-sparc/ide.h +++ b/include/asm-sparc/ide.h @@ -29,6 +29,9 @@ static __inline__ unsigned long ide_default_io_base(int index) return 0; } +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #define ide_init_default_irq(base) (0) #define __ide_insl(data_reg, buffer, wcount) \ diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h index 9ce42e1177191..f4e62012cd994 100644 --- a/include/asm-sparc64/ide.h +++ b/include/asm-sparc64/ide.h @@ -34,6 +34,9 @@ static __inline__ unsigned long ide_default_io_base(int index) return 0; } +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #define ide_init_default_irq(base) (0) #define __ide_insl(data_reg, buffer, wcount) \ diff --git a/include/asm-x86_64/ide.h b/include/asm-x86_64/ide.h index 870bf0e782d3d..99e18549c8c69 100644 --- a/include/asm-x86_64/ide.h +++ b/include/asm-x86_64/ide.h @@ -51,6 +51,9 @@ static __inline__ unsigned long ide_default_io_base(int index) } } +#define IDE_ARCH_OBSOLETE_INIT +#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ + #ifdef CONFIG_BLK_DEV_IDEPCI #define ide_init_default_irq(base) (0) #else diff --git a/include/linux/ide.h b/include/linux/ide.h index aa2e86d087cb5..86e4d4d9910c5 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -307,18 +307,20 @@ static inline void ide_std_init_ports(hw_regs_t *hw, /* * ide_init_hwif_ports() is OBSOLETE and will be removed in 2.7 series. + * New ports shouldn't define IDE_ARCH_OBSOLETE_INIT in . * - * arm26, arm, h8300, m68k, m68knommu (broken) and i386-pc9800 (broken) + * h8300, m68k, m68knommu (broken) and i386-pc9800 (broken) * still have their own versions. */ -#if !defined(CONFIG_ARM) && !defined(CONFIG_H8300) && !defined(CONFIG_M68K) +#if !defined(CONFIG_H8300) && !defined(CONFIG_M68K) +#ifdef IDE_ARCH_OBSOLETE_INIT static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long io_addr, unsigned long ctl_addr, int *irq) { if (!ctl_addr) - ide_std_init_ports(hw, io_addr, io_addr + 0x206); + ide_std_init_ports(hw, io_addr, ide_default_io_ctl(io_addr)); else ide_std_init_ports(hw, io_addr, ctl_addr); @@ -332,7 +334,10 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, ppc_ide_md.ide_init_hwif(hw, io_addr, ctl_addr, irq); #endif } -#endif /* !ARM && !H8300 && !M68K */ +#else +# define ide_init_hwif_ports(hw, io, ctl, irq) do {} while (0) +#endif /* IDE_ARCH_OBSOLETE_INIT */ +#endif /* !H8300 && !M68K */ /* Currently only m68k, apus and m8xx need it */ #ifndef IDE_ARCH_ACK_INTR -- 2.53.0