ide/ppc: remove PPC specific IDE hacks
Subsystems (3)
cover ide/ppc: remove PPC specific IDE hacks
Previous patchset adding warm-plug support allows the removal of PPC specific IDE hacks (500 LOC gone)...
[ Ben, please take a look when you have some time, thanks! ]
diffstat:
arch/powerpc/kernel/setup_32.c | 8 -- arch/powerpc/platforms/powermac/pci.c | 22 ------- arch/powerpc/platforms/powermac/pmac.h | 5 - arch/powerpc/platforms/powermac/setup.c | 8 -- arch/ppc/configs/sandpoint_defconfig | 2 arch/ppc/kernel/ppc_ksyms.c | 5 - arch/ppc/kernel/setup.c | 2 arch/ppc/platforms/4xx/bamboo.c | 1 arch/ppc/platforms/4xx/ebony.c | 1 arch/ppc/platforms/4xx/luan.c | 1 arch/ppc/platforms/4xx/ocotea.c | 1 arch/ppc/platforms/4xx/taishan.c | 1 arch/ppc/platforms/4xx/yucca.c | 1 arch/ppc/platforms/chestnut.c | 1 arch/ppc/platforms/cpci690.c | 1 arch/ppc/platforms/ev64260.c | 1 arch/ppc/platforms/hdpu.c | 36 ----------- arch/ppc/platforms/lopec.c | 85 ---------------------------- arch/ppc/platforms/mvme5100.c | 1 arch/ppc/platforms/powerpmc250.c | 1 arch/ppc/platforms/pplus.c | 58 ------------------- arch/ppc/platforms/prep_setup.c | 38 ------------ arch/ppc/platforms/prpmc750.c | 1 arch/ppc/platforms/prpmc800.c | 1 arch/ppc/platforms/radstone_ppc7d.c | 1 arch/ppc/platforms/residual.c | 1 arch/ppc/platforms/sandpoint.c | 94 ------------------------------- arch/ppc/platforms/sandpoint.h | 3 arch/ppc/platforms/spruce.c | 1 arch/ppc/syslib/m8xx_setup.c | 6 - arch/ppc/syslib/ppc4xx_setup.c | 23 ------- drivers/ide/ide.c | 6 - drivers/ide/pci/sl82c105.c | 6 + drivers/ide/ppc/mpc8xx.c | 86 +++++++--------------------- drivers/ide/ppc/pmac.c | 97 +++----------------------------- include/asm-powerpc/ide.h | 47 ++++++++++----- 36 files changed, 72 insertions(+), 581 deletions(-)
PATCH 1/11 ide-pmac: remove dead code
Remove unused pmac_ide_{check_base,get_irq}() and pmac_find_ide_boot(), then remove no longer needed ide_majors[] and pmac_ide_count.
--- drivers/ide/ppc/pmac.c | 47 ----------------------------------------------- 1 file changed, 47 deletions(-)
drivers/ide/ppc/pmac.c +0 -47
@@ -80,7 +80,6 @@ typedef struct pmac_ide_hwif { } pmac_ide_hwif_t;static pmac_ide_hwif_t pmac_ide[MAX_HWIFS ]; -static int pmac_ide_count;enum { controller_ohare,/* OHare based */
@@ -893,52 +892,6 @@ pmac_ide_get_base(int index)return pmac_ide[index].regbase; } -int -pmac_ide_check_base (unsigned long base) -{ -int ix; - -for (ix =0 ; ix <MAX_HWIFS ; ++ix) -if (base == pmac_ide[ix].regbase) -return ix; -return -1 ; -} - -int -pmac_ide_get_irq (unsigned long base) -{ -int ix; - -for (ix =0 ; ix <MAX_HWIFS ; ++ix) -if (base == pmac_ide[ix].regbase) -return pmac_ide[ix].irq; -return 0 ; -} - -static int ide_majors[] = {3 ,22 ,33 ,34 ,56 ,57 }; - -dev_t __init -pmac_find_ide_boot (char *bootdevice,int n) -{ -int i; - -/* -* Look through the list of IDE interfaces for this one. -*/ -for (i =0 ; i < pmac_ide_count; ++i) { -char *name; -if (!pmac_ide[i].node || !pmac_ide[i].node->full_name) -continue ; - name = pmac_ide[i].node->full_name; -if (memcmp (name, bootdevice, n) ==0 && name[n] ==0 ) { -/* XXX should cope with the 2nd drive as well... */ -return MKDEV (ide_majors[i],0 ); - } - } - -return 0 ; -} -/* Suspend call back, should be called after the child devices * have actually been suspended */
PATCH 2/11 ppc/hdpu: remove dead IDE code
In reply to Bartlomiej ZolnierkiewiczAlso remove now not needed <linux/ide.h> include.
--- arch/ppc/platforms/hdpu.c | 36 ------------------------------------ 1 file changed, 36 deletions(-)
arch/ppc/platforms/hdpu.c +0 -36
@@ -16,7 +16,6 @@#include <linux/pci.h> #include <linux/delay.h> #include <linux/irq.h> -#include <linux/ide.h> #include <linux/seq_file.h> #include <linux/platform_device.h>
@@ -604,41 +603,6 @@ static void parse_bootinfo(unsigned long } } -#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) -static void -hdpu_ide_request_region (ide_ioreg_t from,unsigned int extent,const char *name) -{ -request_region (from, extent, name); -return ; -} - -static void hdpu_ide_release_region (ide_ioreg_t from,unsigned int extent) -{ -release_region (from, extent); -return ; -} - -static void __init -hdpu_ide_pci_init_hwif_ports (hw_regs_t * hw,ide_ioreg_t data_port, -ide_ioreg_t ctrl_port,int *irq) -{ -struct pci_dev *dev; - -pci_for_each_dev (dev) { -if (((dev->class >>8 ) ==PCI_CLASS_STORAGE_IDE ) || - ((dev->class >>8 ) ==PCI_CLASS_STORAGE_RAID )) { - hw->irq = dev->irq; - -if (irq !=NULL ) { - *irq = dev->irq; - } - } - } - -return ; -} -#endif -void hdpu_heartbeat (void ) {if (mv64x60_read (&bh, MV64x60_GPP_VALUE) & (1 <<5 ))
PATCH 3/11 ppc/ppc4xx: remove ppc_ide_md hooks
In reply to Bartlomiej ZolnierkiewiczThere are no "default" IDE ports on PPC4xx so ppc4xx_ide_init_hwif_ports() is unnecessary, remove it. Also remove no longer needed <linux/ide.h> include.
There should be no functional changes caused by this patch.
--- arch/ppc/syslib/ppc4xx_setup.c | 23 ----------------------- 1 file changed, 23 deletions(-)
arch/ppc/syslib/ppc4xx_setup.c +0 -23
@@ -24,7 +24,6 @@#include <linux/pci.h> #include <linux/rtc.h> #include <linux/console.h> -#include <linux/ide.h> #include <linux/serial_reg.h> #include <linux/seq_file.h>
@@ -189,24 +188,6 @@ ppc4xx_calibrate_decr(void)mtspr (SPRN_PIT , tb_ticks_per_jiffy); } -/* -* IDE stuff. -* should be generic for every IDE PCI chipset -*/ -#if defined(CONFIG_PCI ) && defined(CONFIG_IDE ) -static void -ppc4xx_ide_init_hwif_ports (hw_regs_t * hw,unsigned long data_port, -unsigned long ctrl_port,int *irq) -{ -int i; - -for (i =IDE_DATA_OFFSET ; i <=IDE_STATUS_OFFSET ; ++i) - hw->io_ports[i] = data_port + i -IDE_DATA_OFFSET ; - - hw->io_ports[IDE_CONTROL_OFFSET ] = ctrl_port; -} -#endif /* defined(CONFIG_PCI) && defined(CONFIG_IDE) */ -TODC_ALLOC ();/*
@@ -271,10 +252,6 @@ ppc4xx_init(unsigned long r3, unsigned l#ifdef CONFIG_SERIAL_TEXT_DEBUG ppc_md.progress = gen550_progress;#endif - -#if defined(CONFIG_PCI ) && defined(CONFIG_IDE ) - ppc_ide_md.ide_init_hwif = ppc4xx_ide_init_hwif_ports; -#endif /* defined(CONFIG_PCI) && defined(CONFIG_IDE) */ }/* Called from machine_check_exception */
PATCH 4/11 ppc/pmac: remove ppc_ide_md hooks
In reply to Bartlomiej Zolnierkiewicz* Add pmac_ide_init_ports() helper and use it instead of pmac_ide_init_hwif_ports().
* Remove ppc_ide_md hooks - no need for them (IDE pmac host driver takes care of all this setup).
* Then remove no longer needed <linux/ide.h> include from arch/powerpc/platforms/powermac/pmac.h.
--- arch/powerpc/platforms/powermac/pmac.h | 5 --- arch/powerpc/platforms/powermac/setup.c | 8 ----- drivers/ide/ppc/pmac.c | 50 +++++++------------------------- 3 files changed, 11 insertions(+), 52 deletions(-)
arch/powerpc/platforms/powermac/pmac.h +0 -5
@@ -2,7 +2,6 @@#define __PMAC_H__#include <linux/pci.h> -#include <linux/ide.h> #include <linux/irq.h> /*
@@ -35,10 +34,6 @@ extern void pmac_check_ht_link(void);extern void pmac_setup_smp (void ); -extern unsigned long pmac_ide_get_base (int index); -extern void pmac_ide_init_hwif_ports (hw_regs_t *hw, -unsigned long data_port,unsigned long ctrl_port,int *irq); -extern int pmac_nvram_init (void );extern void pmac_pic_init (void );
arch/powerpc/platforms/powermac/setup.c +0 -8
@@ -574,14 +574,6 @@ static int __init pmac_probe(void)ISA_DMA_THRESHOLD = ~0L ;DMA_MODE_READ =1 ;DMA_MODE_WRITE =2 ; - -#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) -#ifdef CONFIG_BLK_DEV_IDE_PMAC - ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports; - ppc_ide_md.default_io_base = pmac_ide_get_base; -#endif /* CONFIG_BLK_DEV_IDE_PMAC */ -#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */ -#endif /* CONFIG_PPC32 */ #ifdef CONFIG_PMAC_SMU
drivers/ide/ppc/pmac.c +11 -39
80 lines not on this page · raw message
PATCH 5/11 ppc/mpc8xx: remove ppc_ide_md hooks
In reply to Bartlomiej Zolnierkiewicz* Initialize IDE ports in mpc8xx_ide_probe().
* Remove m8xx_ide_init() and ppc_ide_md hooks - no need for them (IDE mpc8xx host driver takes care of all this setup).
* Remove needless 'if (irq)' and 'if (data_port >= MAX_HWIFS)' checks from m8xx_ide_init_hwif_ports().
* Remove 'ctrl_port' and 'irq' arguments from m8xx_ide_init_hwif_ports().
* Rename m8xx_ide_init_hwif_ports() to m8xx_ide_init_ports().
* Add __init tag to m8xx_ide_init_ports().
This patch fixes hwif->irq always being overriden to 0 (== auto-probe, is this even working on PPC?) because of ide_init_default_irq() call in ide.c.
There should be no other functional changes.
--- arch/ppc/syslib/m8xx_setup.c | 6 --- drivers/ide/ppc/mpc8xx.c | 86 +++++++++++-------------------------------- 2 files changed, 22 insertions(+), 70 deletions(-)
arch/ppc/syslib/m8xx_setup.c +0 -6
@@ -87,8 +87,6 @@ void m8xx_calibrate_decr(void);unsigned char __res[sizeof (bd_t)]; -extern void m8xx_ide_init (void ); -extern unsigned long find_available_memory (void );extern void m8xx_cpm_reset (void );extern void m8xx_wdt_handler_install (bd_t *bp);
@@ -474,8 +472,4 @@ platform_init(unsigned long r3, unsigned ppc_md.find_end_of_memory = m8xx_find_end_of_memory; ppc_md.setup_io_mappings = m8xx_map_io; - -#if defined(CONFIG_BLK_DEV_MPC8xx_IDE) -m8xx_ide_init (); -#endif }
drivers/ide/ppc/mpc8xx.c +22 -64
183 lines not on this page · raw message
Re: [PATCH 05/11] ppc/mpc8xx: remove ppc_ide_md hooks
Quoted 15 lines · On Thu, 14 Feb 2008 01:36:56 +0100 Bartlomiej Zolnierkiewicz wrote:
* Initialize IDE ports in
mpc8xx_ide_probe().* Remove
m8xx_ide_init()andppc_ide_mdhooks - no need for them (IDE mpc8xx host driver takes care of all this setup).* Remove needless 'if (irq)' and 'if (
data_port>=MAX_HWIFS)' checks fromm8xx_ide_init_hwif_ports().* Remove '
ctrl_port' and 'irq' arguments fromm8xx_ide_init_hwif_ports().* Rename
m8xx_ide_init_hwif_ports()tom8xx_ide_init_ports().* Add
__inittag tom8xx_ide_init_ports().
Quoted 8 lines
This patch fixes
hwif->irqalways being overriden to 0 (== auto-probe, is this even working on PPC?) because ofide_init_default_irq()call inide.c.There should be no other functional changes.
Cc Benjamin Herrenschmidt <[email protected]>Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>
Quoted 233 lines
--- arch/ppc/syslib/m8xx_setup.c | 6 --- drivers/ide/ppc/mpc8xx.c | 86+++++++++++-------------------------------- 2 files changed, 22 insertions(+), 70 deletions(-)
Index:
b/arch/ppc/syslib/m8xx_setup.c
===================================================================arch/ppc/syslib/m8xx_setup.c +0
-6@@ -87,8 +87,6 @@ void m8xx_calibrate_decr(void);unsigned char __res[sizeof (bd_t)]; -extern void m8xx_ide_init (void ); -extern unsigned long find_available_memory (void );extern void m8xx_cpm_reset (void );extern void m8xx_wdt_handler_install (bd_t *bp);@@ -474,8 +472,4 @@ platform_init(unsigned long r3, unsigned ppc_md.find_end_of_memory = m8xx_find_end_of_memory; ppc_md.setup_io_mappings = m8xx_map_io; - -#if defined(CONFIG_BLK_DEV_MPC8xx_IDE) -m8xx_ide_init (); -#endif }Index:
b/drivers/ide/ppc/mpc8xx.c
===================================================================drivers/ide/ppc/mpc8xx.c +0
-0@@ -99,32 +99,6 @@ static int _slot_ = -1; /*will be rea /* Make clock cycles and always round up */
#definePCMCIA_MK_CLKS( t, T )(( (t) * ((T)/1000000) + 999U ) /
1000U )drivers/ide/ppc/mpc8xx.c +0
-13- - -/* -* IDE stuff. -*/ -static int -m8xx_ide_default_irq (unsigned long base) -{ -#ifdef CONFIG_BLK_DEV_MPC8xx_IDE -if (base >=MAX_HWIFS ) -return 0 ; - - printk("[%d] m8xx_ide_default_irq%d\n",__LINE__,ioport_dsc[base].irq);
drivers/ide/ppc/mpc8xx.c +7
-24- -return (ioport_dsc[base].irq); -#else -return 9 ; -#endif -} - -static unsigned long -m8xx_ide_default_io_base (int index) -{ -return index; -} -#define M8XX_PCMCIA_CD2 (slot) (0x10000000 >> (slot << 4))#define M8XX_PCMCIA_CD1 (slot) (0x08000000 >> (slot << 4))@@ -149,12 +123,11 @@ static int pcmcia_schlvl = PCMCIA_SCHLVL*/ /* -* m8xx_ide_init_hwif_ports for a direct IDE interface _using_ +* m8xx_ide_init_ports() for a direct IDE interface _using_ +* MPC8xx's internal PCMCIA interface */ #if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) -static void -m8xx_ide_init_hwif_ports (hw_regs_t *hw,unsigned long data_port, -unsigned long ctrl_port,int *irq) +static void __init m8xx_ide_init_ports (hw_regs_t *hw,unsigned long data_port) {unsigned long *p = hw->io_ports;int i;@@ -173,8 +146,6 @@ m8xx_ide_init_hwif_ports(hw_regs_t *hw,unsigned long base; *p =0 ; -if (irq) - *irq =0 ; pcmp = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR )->im_pcmcia));@@ -248,9 +219,6 @@ m8xx_ide_init_hwif_ports(hw_regs_t *hw, } } -if (data_port >=MAX_HWIFS ) -return ; - if (_slot_ == -1) { printk ("PCMCIA slot has not been defined! Using A as default\n"); _slot_ = 0;@@ -292,11 +260,13 @@ m8xx_ide_init_hwif_ports(hw_regs_t *hw, *p++ = base + ioport_dsc[data_port].reg_off[i]; } -if (irq) { + hw->irq = ioport_dsc[data_port].irq; + hw->ack_intr = (ide_ack_intr_t *)ide_interrupt_ack; +#ifdef CONFIG_IDE_8xx_PCCARD + {unsigned int reg; - *irq = ioport_dsc[data_port].irq;if (_slot_) pgcrx = &((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pgcrb; else
drivers/ide/ppc/mpc8xx.c +0
-1@@ -306,14 +276,11 @@ m8xx_ide_init_hwif_ports(hw_regs_t *hw, reg |=mk_int_int_mask (pcmcia_schlvl) <<24 ; reg |=mk_int_int_mask (pcmcia_schlvl) <<16 ; *pgcrx = reg; -#else /* direct connected IDE drive, i.e. external IRQ, not the PCMCIA irq */
drivers/ide/ppc/mpc8xx.c +1
-3- *irq = ioport_dsc[data_port].irq; -#endif /* CONFIG_IDE_8xx_PCCARD */ } +#endif /* CONFIG_IDE_8xx_PCCARD */ ide_hwifs[data_port].pio_mask =ATA_PIO4 ; ide_hwifs[data_port].set_pio_mode = m8xx_ide_set_pio_mode; - ide_hwifs[data_port].ack_intr = (ide_ack_intr_t*)ide_interrupt_ack;
drivers/ide/ppc/mpc8xx.c +5
-14/* Enable Harddisk Interrupt, * and make it edge sensitive @@ -329,16 +296,15 @@ m8xx_ide_init_hwif_ports(hw_regs_t *hw,/* Enable falling edge irq */ pcmp->pcmc_per =0x100000 >> (16 * _slot_);#endif /* CONFIG_IDE_8xx_PCCARD */ -}/* m8xx_ide_init_hwif_ports() using 8xx internal PCMCIA interface */ +}#endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */ /* -* m8xx_ide_init_hwif_ports for a direct IDE interface _not_ using +* m8xx_ide_init_ports() for a direct IDE interface _not_ using * MPC8xx's internal PCMCIA interface */ #if defined(CONFIG_IDE_EXT_DIRECT ) -void m8xx_ide_init_hwif_ports (hw_regs_t *hw, -unsigned long data_port,unsigned long ctrl_port,int *irq) +static void __init m8xx_ide_init_ports (hw_regs_t *hw,unsigned long data_port) {unsigned long *p = hw->io_ports;int i;@@ -349,8 +315,6 @@ void m8xx_ide_init_hwif_ports (hw_regs_tunsigned long base; *p =0 ; -if (irq) - *irq =0 ;if (!ide_base) {@@ -372,9 +336,6 @@ void m8xx_ide_init_hwif_ports (hw_regs_t#endif } -if (data_port >=MAX_HWIFS ) -return ; - base = ide_base + ioport_dsc[data_port].base_off;#ifdef DEBUG printk ("base: %08x + %08x = %08x\n",@@ -392,14 +353,12 @@ void m8xx_ide_init_hwif_ports (hw_regs_t *p++ = base + ioport_dsc[data_port].reg_off[i]; } -if (irq) { -/* direct connected IDE drive, i.e. external IRQ */ - *irq = ioport_dsc[data_port].irq; - } +/* direct connected IDE drive, i.e. external IRQ */ + hw->irq = ioport_dsc[data_port].irq; + hw->ack_intr = (ide_ack_intr_t *)ide_interrupt_ack; ide_hwifs[data_port].pio_mask =ATA_PIO4 ; ide_hwifs[data_port].set_pio_mode = m8xx_ide_set_pio_mode; - ide_hwifs[data_port].ack_intr = (ide_ack_intr_t *)ide_interrupt_ack;/* Enable Harddisk Interrupt, * and make it edge sensitive @@ -407,8 +366,7 @@ void m8xx_ide_init_hwif_ports (hw_regs_t/* (11-18) Set edge detect for irq, no wakeup from low power mode */ ((
immap_t*) IMAP_ADDR)->im_siu_conf.sc_siel |=drivers/ide/ppc/mpc8xx.c +8
-9(0x80000000 >> ioport_dsc[data_port].irq); -}/* m8xx_ide_init_hwif_ports() for CONFIG_IDE_8xx_DIRECT */ - +}#endif /* CONFIG_IDE_8xx_DIRECT */ @@ -829,20 +787,20 @@ static int identify (volatile u8 *p)return (0 );/* don't know */ } -void m8xx_ide_init (void ) -{ - ppc_ide_md.default_irq = m8xx_ide_default_irq; - ppc_ide_md.default_io_base = m8xx_ide_default_io_base; - ppc_ide_md.ide_init_hwif = m8xx_ide_init_hwif_ports; -} -static int __init mpc8xx_ide_probe (void ) { +hw_regs_t hw;u8 idx[4 ] = {0xff ,0xff ,0xff ,0xff };#ifdef IDE0_BASE_OFFSET +memset (&hw,0 ,sizeof (hw)); +m8xx_ide_init_ports (&hw,0 ); +ide_init_port_hw (&ide_hwifs[0 ], &hw); idx[0 ] =0 ;#ifdef IDE1_BASE_OFFSET +memset (&hw,0 ,sizeof (hw)); +m8xx_ide_init_ports (&hw,1 ); +ide_init_port_hw (&ide_hwifs[1 ], &hw); idx[1 ] =1 ;#endif #endif _______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
Signature · 1 line
Sincerely, Vitaly
PATCH 6/11 ppc/lopec: remove ppc_ide_md hooks
In reply to Bartlomiej Zolnierkiewicz* Add IDE_HFLAG_FORCE_LEGACY_IRQS host flag for Motorola-LoPEC platform to sl82c105 host driver.
* Remove ppc_ide_md hooks from arch/ppc/platforms/lopec.c - no need for them (sl82c105 host driver takes care of all this setup).
* Then remove no longer needed <linux/ide.h> include.
Looking at arch/ppc/configs/lopec_defconfig:
...CONFIG_IDE_GENERIC=yCONFIG_BLK_DEV_IDEPCI=y
# CONFIG_IDEPCI_SHARE_IRQ is not set
# CONFIG_BLK_DEV_OFFBOARD is not setCONFIG_BLK_DEV_GENERIC=y
# CONFIG_BLK_DEV_OPTI621 is not setCONFIG_BLK_DEV_SL82C105=y
...
there should be no functional changes unless somebody preferred to disable sl82c105 host driver and use only ide_generic one (but why would anybody want to do such thing :-).
PS It seems that lopec_defconfig hasn't been updated for ages but if somebody is going to do it please look into disabling IDE_GENERIC and BLK_DEV_GENERIC config options. Thanks.
--- arch/ppc/platforms/lopec.c | 85 --------------------------------------------- drivers/ide/pci/sl82c105.c | 4 ++ 2 files changed, 4 insertions(+), 85 deletions(-)
arch/ppc/platforms/lopec.c +0 -85
@@ -15,7 +15,6 @@#include <linux/pci_ids.h> #include <linux/ioport.h> #include <linux/init.h> -#include <linux/ide.h> #include <linux/seq_file.h> #include <linux/initrd.h> #include <linux/console.h>
@@ -168,85 +167,6 @@ lopec_power_off(void)lopec_halt (); } -#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) -int lopec_ide_ports_known =0 ; -static unsigned long lopec_ide_regbase[MAX_HWIFS ]; -static unsigned long lopec_ide_ctl_regbase[MAX_HWIFS ]; -static unsigned long lopec_idedma_regbase; - -static void -lopec_ide_probe (void ) -{ -struct pci_dev *dev =pci_get_device (PCI_VENDOR_ID_WINBOND , -PCI_DEVICE_ID_WINBOND_82C105 , -NULL ); - lopec_ide_ports_known =1 ; - -if (dev) { - lopec_ide_regbase[0 ] = dev->resource[0 ].start; - lopec_ide_regbase[1 ] = dev->resource[2 ].start; - lopec_ide_ctl_regbase[0 ] = dev->resource[1 ].start; - lopec_ide_ctl_regbase[1 ] = dev->resource[3 ].start; - lopec_idedma_regbase = dev->resource[4 ].start; -pci_dev_put (dev); - } -} - -static int -lopec_ide_default_irq (unsigned long base) -{ -if (lopec_ide_ports_known ==0 ) -lopec_ide_probe (); - -if (base == lopec_ide_regbase[0 ]) -return 14 ; -else if (base == lopec_ide_regbase[1 ]) -return 15 ; -else -return 0 ; -} - -static unsigned long -lopec_ide_default_io_base (int index) -{ -if (lopec_ide_ports_known ==0 ) -lopec_ide_probe (); -return lopec_ide_regbase[index]; -} - -static void __init -lopec_ide_init_hwif_ports (hw_regs_t *hw,unsigned long data, -unsigned long ctl,int *irq) -{ -unsigned long reg = data; -uint alt_status_base; -int i; - -for (i =IDE_DATA_OFFSET ; i <=IDE_STATUS_OFFSET ; i++) - hw->io_ports[i] = reg++; - -if (data == lopec_ide_regbase[0 ]) { - alt_status_base = lopec_ide_ctl_regbase[0 ] +2 ; - hw->irq =14 ; - }else if (data == lopec_ide_regbase[1 ]) { - alt_status_base = lopec_ide_ctl_regbase[1 ] +2 ; - hw->irq =15 ; - }else { - alt_status_base =0 ; - hw->irq =0 ; - } - -if (ctl) - hw->io_ports[IDE_CONTROL_OFFSET ] = ctl; -else - hw->io_ports[IDE_CONTROL_OFFSET ] = alt_status_base; - -if (irq !=NULL ) - *irq = hw->irq; - -} -#endif /* BLK_DEV_IDE */ -static void __init lopec_init_IRQ (void ) {
@@ -384,11 +304,6 @@ platform_init(unsigned long r3, unsigned ppc_md.nvram_read_val = todc_direct_read_val; ppc_md.nvram_write_val = todc_direct_write_val; -#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) - ppc_ide_md.default_irq = lopec_ide_default_irq; - ppc_ide_md.default_io_base = lopec_ide_default_io_base; - ppc_ide_md.ide_init_hwif = lopec_ide_init_hwif_ports; -#endif #ifdef CONFIG_SERIAL_TEXT_DEBUG ppc_md.progress = gen550_progress;#endif
drivers/ide/pci/sl82c105.c +4 -0
@@ -328,6 +328,10 @@ static const struct ide_port_info sl82c1 .enablebits = {{0x40,0x01,0x01}, {0x40,0x10,0x10}}, .host_flags = IDE_HFLAG_IO_32BIT | IDE_HFLAG_UNMASK_IRQS | +/* FIXME: check for Compatibility mode in generic IDE PCI code */ +#ifdef CONFIG_LOPEC +IDE_HFLAG_FORCE_LEGACY_IRQS | +#endifIDE_HFLAG_NO_AUTODMA | IDE_HFLAG_BOOTABLE, .pio_mask = ATA_PIO5,
PATCH 7/11 ppc/sandpoint: remove ppc_ide_md hooks
In reply to Bartlomiej Zolnierkiewicz* Add IDE_HFLAG_FORCE_LEGACY_IRQS host flag for Motorola-Sandpoint platform to sl82c105 host driver.
* Disable ide_generic host driver in arch/ppc/configs/sandpoint_defconfig and enable sl82c105 one.
* Remove ppc_ide_md hooks from arch/ppc/platforms/sandpoint.c - no need for them (sl82c105 host driver takes care of all this setup).
* Then remove no longer needed <linux/ide.h> include.
* Also update arch/ppc/platforms/sandpoint.h.
Unfortunately (unlike lopec's case) sl82c105 host driver was not enabled in defconfing so there is a funcionality change.
[ Not a big deal since sl82c105 is superior over ide_generic. ]
--- arch/ppc/configs/sandpoint_defconfig | 2 arch/ppc/platforms/sandpoint.c | 94 ----------------------------------- arch/ppc/platforms/sandpoint.h | 3 - drivers/ide/pci/sl82c105.c | 2 4 files changed, 2 insertions(+), 99 deletions(-)
arch/ppc/configs/sandpoint_defconfig +1 -1
@@ -189,7 +189,7 @@ CONFIG_IDE_TASKFILE_IO=y # # IDE chipset support/bugfixes # -CONFIG_IDE_GENERIC=y +CONFIG_BLK_DEV_SL82C105=y # CONFIG_BLK_DEV_IDEPCI is not set # CONFIG_BLK_DEV_IDEDMA is not set # CONFIG_IDEDMA_AUTO is not set
arch/ppc/platforms/sandpoint.c +0 -94
110 lines not on this page · raw message
arch/ppc/platforms/sandpoint.h +0 -3
@@ -28,9 +28,6 @@*/ #define SANDPOINT_IDE_INT0 23/* EPIC 7 */ #define SANDPOINT_IDE_INT1 24/* EPIC 8 */ -#else -#define SANDPOINT_IDE_INT0 14/* 8259 Test */ -#define SANDPOINT_IDE_INT1 15/* 8259 Test */ #endif /*
drivers/ide/pci/sl82c105.c +1 -1
@@ -329,7 +329,7 @@ static const struct ide_port_info sl82c1 .host_flags = IDE_HFLAG_IO_32BIT | IDE_HFLAG_UNMASK_IRQS |/* FIXME: check for Compatibility mode in generic IDE PCI code */ -#ifdef CONFIG_LOPEC +#if defined(CONFIG_LOPEC ) || defined(CONFIG_SANDPOINT )IDE_HFLAG_FORCE_LEGACY_IRQS | #endif IDE_HFLAG_NO_AUTODMA |
PATCH 8/11 ppc/pplus: remove ppc_ide_md.ide_init_hwif hook
In reply to Bartlomiej Zolnierkiewicz* Call ide_init_default_irq() for pplus in init_ide_data().
* Remove no longer needed pplus_ide_init_hwif_ports().
There should be no functional changes caused by this patch.
--- arch/ppc/platforms/pplus.c | 23 ----------------------- drivers/ide/ide.c | 2 +- 2 files changed, 1 insertion(+), 24 deletions(-)
arch/ppc/platforms/pplus.c +0 -23
@@ -695,28 +695,6 @@ static unsigned long pplus_ide_default_i return 0; } } - -static void __init -pplus_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 ; - } - -if (ctrl_port) - hw->io_ports[IDE_CONTROL_OFFSET ] = ctrl_port; -else - hw->io_ports[IDE_CONTROL_OFFSET ] = - hw->io_ports[IDE_DATA_OFFSET ] +0x206 ; - -if (irq !=NULL ) - *irq =pplus_ide_default_irq (data_port); -}#endif #ifdef CONFIG_SMP
@@ -887,7 +865,6 @@ platform_init(unsigned long r3, unsigned#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) ppc_ide_md.default_irq = pplus_ide_default_irq; ppc_ide_md.default_io_base = pplus_ide_default_io_base; - ppc_ide_md.ide_init_hwif = pplus_ide_init_hwif_ports;#endif #ifdef CONFIG_SERIAL_TEXT_DEBUG
drivers/ide/ide.c +1 -1
@@ -214,7 +214,7 @@ static void __init init_ide_data (void)memcpy (hwif->io_ports, hw.io_ports,sizeof (hw.io_ports));#endif hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET ]; -#if !defined(CONFIG_PPC32 ) || !defined(CONFIG_PCI ) +#if !defined(CONFIG_PPC32 ) || defined(CONFIG_PPLUS ) || !defined(CONFIG_PCI ) hwif->irq =ide_init_default_irq (hwif->io_ports[IDE_DATA_OFFSET ]);#endif
PATCH 9/11 ppc: remove ppc_ide_md
In reply to Bartlomiej Zolnierkiewicz* Add special cases for pplus and prep to ide_default_{irq,io_base}() (+ FIXMEs about the need to use IDE platform host driver instead).
* Remove no longer needed ppc_ide_md and struct ide_machdep_calls.
* Then remove <linux/ide.h> include from:
- arch/powerpc/kernel/setup_32.c
- arch/ppc/kernel/ppc_ksyms.c
- arch/ppc/kernel/setup.c
- arch/ppc/platforms/pplus.c
- arch/ppc/platforms/prep_setup.c
There should be no functional changes caused by this patch.
--- arch/powerpc/kernel/setup_32.c | 8 ------ arch/ppc/kernel/ppc_ksyms.c | 5 ---- arch/ppc/kernel/setup.c | 2 - arch/ppc/platforms/pplus.c | 35 ----------------------------- arch/ppc/platforms/prep_setup.c | 38 -------------------------------- drivers/ide/ide.c | 4 --- include/asm-powerpc/ide.h | 47 +++++++++++++++++++++++++++------------- 7 files changed, 32 insertions(+), 107 deletions(-)
arch/powerpc/kernel/setup_32.c +0 -8
@@ -10,9 +10,6 @@#include <linux/reboot.h> #include <linux/delay.h> #include <linux/initrd.h> -#if defined(CONFIG_IDE ) || defined(CONFIG_IDE_MODULE ) -#include <linux/ide.h> -#endif #include <linux/tty.h> #include <linux/bootmem.h> #include <linux/seq_file.h>
@@ -51,11 +48,6 @@extern void bootx_init (unsigned long r4,unsigned long phys); -#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) -struct ide_machdep_calls ppc_ide_md; -EXPORT_SYMBOL (ppc_ide_md); -#endif -int boot_cpuid;EXPORT_SYMBOL_GPL (boot_cpuid);int boot_cpuid_phys;
arch/ppc/kernel/ppc_ksyms.c +0 -5
@@ -12,7 +12,6 @@#include <linux/irq.h> #include <linux/pci.h> #include <linux/delay.h> -#include <linux/ide.h> #include <linux/pm.h> #include <linux/bitops.h>
@@ -124,10 +123,6 @@ EXPORT_SYMBOL(__ioremap);EXPORT_SYMBOL (iounmap);EXPORT_SYMBOL (ioremap_bot);/* aka VMALLOC_END */ -#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) -EXPORT_SYMBOL (ppc_ide_md); -#endif -#ifdef CONFIG_PCI EXPORT_SYMBOL (isa_io_base);EXPORT_SYMBOL (isa_mem_base);
arch/ppc/kernel/setup.c +0 -2
@@ -10,7 +10,6 @@#include <linux/reboot.h> #include <linux/delay.h> #include <linux/initrd.h> -#include <linux/ide.h> #include <linux/screen_info.h> #include <linux/bootmem.h> #include <linux/seq_file.h>
@@ -57,7 +56,6 @@ extern void ppc6xx_idle(void);extern void power4_idle (void );extern boot_infos_t *boot_infos; -struct ide_machdep_calls ppc_ide_md;/* Used with the BI_MEMSIZE bootinfo parameter to store the memory size value reported by the boot loader. */
arch/ppc/platforms/pplus.c +0 -35
@@ -19,7 +19,6 @@#include <linux/ioport.h> #include <linux/console.h> #include <linux/pci.h> -#include <linux/ide.h> #include <linux/seq_file.h> #include <linux/root_dev.h>
@@ -668,35 +667,6 @@ static void __init pplus_init_IRQ(void) ppc_md.progress ("init_irq: exit" ,0 ); } -#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) -/* -* IDE stuff. -*/ -static int pplus_ide_default_irq (unsigned long base) -{ -switch (base) { -case 0x1f0 : -return 14 ; -case 0x170 : -return 15 ; -default : -return 0 ; - } -} - -static unsigned long pplus_ide_default_io_base (int index) -{ -switch (index) { -case 0 : -return 0x1f0 ; -case 1 : -return 0x170 ; -default : -return 0 ; - } -} -#endif -#ifdef CONFIG_SMP /* PowerPlus (MTX) support */ static int __init smp_pplus_probe (void )
@@ -862,11 +832,6 @@ platform_init(unsigned long r3, unsigned ppc_md.find_end_of_memory = pplus_find_end_of_memory; ppc_md.setup_io_mappings = pplus_map_io; -#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) - ppc_ide_md.default_irq = pplus_ide_default_irq; - ppc_ide_md.default_io_base = pplus_ide_default_io_base; -#endif -#ifdef CONFIG_SERIAL_TEXT_DEBUG ppc_md.progress = gen550_progress;#endif /* CONFIG_SERIAL_TEXT_DEBUG */
arch/ppc/platforms/prep_setup.c +0 -38
@@ -33,7 +33,6 @@#include <linux/console.h> #include <linux/timex.h> #include <linux/pci.h> -#include <linux/ide.h> #include <linux/seq_file.h> #include <linux/root_dev.h>
@@ -894,38 +893,6 @@ prep_init_IRQ(void)i8259_init (MPC10X_MAPA_PCI_INTACK_ADDR ,0 ); } -#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) -/* -* IDE stuff. -*/ -static int -prep_ide_default_irq (unsigned long base) -{ -switch (base) { -case 0x1f0 :return 13 ; -case 0x170 :return 13 ; -case 0x1e8 :return 11 ; -case 0x168 :return 10 ; -case 0xfff0 :return 14 ;/* MCP(N)750 ide0 */ -case 0xffe0 :return 15 ;/* MCP(N)750 ide1 */ -default :return 0 ; - } -} - -static unsigned long -prep_ide_default_io_base (int index) -{ -switch (index) { -case 0 :return 0x1f0 ; -case 1 :return 0x170 ; -case 2 :return 0x1e8 ; -case 3 :return 0x168 ; -default : -return 0 ; - } -} -#endif -#ifdef CONFIG_SMP /* PReP (MTX) support */ static int __init
@@ -1070,11 +1037,6 @@ prep_init(unsigned long r3, unsigned lon ppc_md.setup_io_mappings = prep_map_io; -#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) - ppc_ide_md.default_irq = prep_ide_default_irq; - ppc_ide_md.default_io_base = prep_ide_default_io_base; -#endif -#ifdef CONFIG_SMP smp_ops = &prep_smp_ops;#endif /* CONFIG_SMP */
drivers/ide/ide.c +0 -4
@@ -207,10 +207,6 @@ static void __init init_ide_data (void)#ifdef CONFIG_IDE_ARCH_OBSOLETE_INIT memset (&hw,0 ,sizeof (hw));ide_std_init_ports (&hw, io_addr, ctl_addr); -# ifdef CONFIG_PPC32 -if (ppc_ide_md.ide_init_hwif) - ppc_ide_md.ide_init_hwif (&hw, io_addr,0 , &hwif->irq); -# endif memcpy (hwif->io_ports, hw.io_ports,sizeof (hw.io_ports));#endif hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET ];
include/asm-powerpc/ide.h +32 -15
62 lines not on this page · raw message
PATCH 10/11 ppc: don't include <linux/ide.h>
In reply to Bartlomiej Zolnierkiewicz--- arch/ppc/platforms/4xx/bamboo.c | 1 - arch/ppc/platforms/4xx/ebony.c | 1 - arch/ppc/platforms/4xx/luan.c | 1 - arch/ppc/platforms/4xx/ocotea.c | 1 - arch/ppc/platforms/4xx/taishan.c | 1 - arch/ppc/platforms/4xx/yucca.c | 1 - arch/ppc/platforms/chestnut.c | 1 - arch/ppc/platforms/cpci690.c | 1 - arch/ppc/platforms/ev64260.c | 1 - arch/ppc/platforms/mvme5100.c | 1 - arch/ppc/platforms/powerpmc250.c | 1 - arch/ppc/platforms/prpmc750.c | 1 - arch/ppc/platforms/prpmc800.c | 1 - arch/ppc/platforms/radstone_ppc7d.c | 1 - arch/ppc/platforms/residual.c | 1 - arch/ppc/platforms/spruce.c | 1 - 16 files changed, 16 deletions(-)
arch/ppc/platforms/4xx/bamboo.c +0 -1
@@ -22,7 +22,6 @@#include <linux/blkdev.h> #include <linux/console.h> #include <linux/delay.h> -#include <linux/ide.h> #include <linux/initrd.h> #include <linux/seq_file.h> #include <linux/root_dev.h>
arch/ppc/platforms/4xx/ebony.c +0 -1
@@ -25,7 +25,6 @@#include <linux/blkdev.h> #include <linux/console.h> #include <linux/delay.h> -#include <linux/ide.h> #include <linux/initrd.h> #include <linux/seq_file.h> #include <linux/root_dev.h>
arch/ppc/platforms/4xx/luan.c +0 -1
@@ -23,7 +23,6 @@#include <linux/blkdev.h> #include <linux/console.h> #include <linux/delay.h> -#include <linux/ide.h> #include <linux/initrd.h> #include <linux/seq_file.h> #include <linux/root_dev.h>
arch/ppc/platforms/4xx/ocotea.c +0 -1
@@ -23,7 +23,6 @@#include <linux/blkdev.h> #include <linux/console.h> #include <linux/delay.h> -#include <linux/ide.h> #include <linux/initrd.h> #include <linux/seq_file.h> #include <linux/root_dev.h>
arch/ppc/platforms/4xx/taishan.c +0 -1
@@ -23,7 +23,6 @@#include <linux/blkdev.h> #include <linux/console.h> #include <linux/delay.h> -#include <linux/ide.h> #include <linux/initrd.h> #include <linux/seq_file.h> #include <linux/root_dev.h>
arch/ppc/platforms/4xx/yucca.c +0 -1
@@ -24,7 +24,6 @@#include <linux/blkdev.h> #include <linux/console.h> #include <linux/delay.h> -#include <linux/ide.h> #include <linux/initrd.h> #include <linux/seq_file.h> #include <linux/root_dev.h>
arch/ppc/platforms/chestnut.c +0 -1
@@ -22,7 +22,6 @@#include <linux/initrd.h> #include <linux/delay.h> #include <linux/seq_file.h> -#include <linux/ide.h> #include <linux/serial.h> #include <linux/serial_core.h> #include <linux/serial_8250.h>
arch/ppc/platforms/cpci690.c +0 -1
@@ -10,7 +10,6 @@*/ #include <linux/delay.h> #include <linux/pci.h> -#include <linux/ide.h> #include <linux/irq.h> #include <linux/fs.h> #include <linux/seq_file.h>
arch/ppc/platforms/ev64260.c +0 -1
@@ -23,7 +23,6 @@#include <linux/delay.h> #include <linux/pci.h> -#include <linux/ide.h> #include <linux/irq.h> #include <linux/fs.h> #include <linux/seq_file.h>
arch/ppc/platforms/mvme5100.c +0 -1
@@ -17,7 +17,6 @@#include <linux/initrd.h> #include <linux/console.h> #include <linux/delay.h> -#include <linux/ide.h> #include <linux/seq_file.h> #include <linux/kdev_t.h> #include <linux/root_dev.h>
arch/ppc/platforms/powerpmc250.c +0 -1
@@ -25,7 +25,6 @@#include <linux/delay.h> #include <linux/slab.h> #include <linux/seq_file.h> -#include <linux/ide.h> #include <linux/root_dev.h> #include <asm/byteorder.h>
arch/ppc/platforms/prpmc750.c +0 -1
@@ -22,7 +22,6 @@#include <linux/console.h> #include <linux/delay.h> #include <linux/seq_file.h> -#include <linux/ide.h> #include <linux/root_dev.h> #include <linux/slab.h> #include <linux/serial_reg.h>
arch/ppc/platforms/prpmc800.c +0 -1
@@ -20,7 +20,6 @@#include <linux/console.h> #include <linux/delay.h> #include <linux/seq_file.h> -#include <linux/ide.h> #include <linux/root_dev.h> #include <linux/harrier_defs.h>
arch/ppc/platforms/radstone_ppc7d.c +0 -1
@@ -29,7 +29,6 @@#include <linux/initrd.h> #include <linux/console.h> #include <linux/delay.h> -#include <linux/ide.h> #include <linux/seq_file.h> #include <linux/root_dev.h> #include <linux/serial.h>
arch/ppc/platforms/residual.c +0 -1
@@ -38,7 +38,6 @@#include <linux/init.h> #include <linux/ioport.h> #include <linux/pci.h> -#include <linux/ide.h> #include <asm/sections.h> #include <asm/mmu.h>
arch/ppc/platforms/spruce.c +0 -1
@@ -22,7 +22,6 @@#include <linux/console.h> #include <linux/delay.h> #include <linux/seq_file.h> -#include <linux/ide.h> #include <linux/root_dev.h> #include <linux/serial.h> #include <linux/tty.h>
PATCH 11/11 ppc/pmac: remove no longer needed IDE quirk
In reply to Bartlomiej ZolnierkiewiczIDE PMAC host driver and all IDE PCI host drivers use pci_enable_device() nowadays so the following quirk in pmac_pcibios_after_init() can be removed.
--- arch/powerpc/platforms/powermac/pci.c | 22 ---------------------- 1 file changed, 22 deletions(-)
arch/powerpc/platforms/powermac/pci.c +0 -22
@@ -1144,28 +1144,6 @@ void __init pmac_pcibios_after_init(void {struct device_node * nd; -#ifdef CONFIG_BLK_DEV_IDE -struct pci_dev *dev =NULL ; - -/* OF fails to initialize IDE controllers on macs -* (and maybe other machines) -* -* Ideally, this should be moved to the IDE layer, but we need -* to check specifically with Andre Hedrick how to do it cleanly -* since the common IDE code seem to care about the fact that the -* BIOS may have disabled a controller. -* -* -- BenH -*/ -for_each_pci_dev (dev) { -if ((dev->class >>16 ) !=PCI_BASE_CLASS_STORAGE ) -continue ; -if (pci_enable_device (dev)) -printk (KERN_WARNING -"pci: Failed to enable %s\n" ,pci_name (dev)); - } -#endif /* CONFIG_BLK_DEV_IDE */ -for_each_node_by_name (nd,"firewire" ) { if (nd->parent && (of_device_is_compatible(nd, "pci106b,18") || of_device_is_compatible(nd, "pci106b,30") ||