@@ -893,52 +892,6 @@ pmac_ide_get_base(int index)returnpmac_ide[index].regbase;}-int-pmac_ide_check_base(unsignedlongbase)-{-intix;--for(ix=0;ix<MAX_HWIFS;++ix)-if(base==pmac_ide[ix].regbase)-returnix;-return-1;-}--int-pmac_ide_get_irq(unsignedlongbase)-{-intix;--for(ix=0;ix<MAX_HWIFS;++ix)-if(base==pmac_ide[ix].regbase)-returnpmac_ide[ix].irq;-return0;-}--staticintide_majors[]={3,22,33,34,56,57};--dev_t__init-pmac_find_ide_boot(char*bootdevice,intn)-{-inti;--/*-*LookthroughthelistofIDEinterfacesforthisone.-*/-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... */-returnMKDEV(ide_majors[i],0);-}-}--return0;-}-/* Suspend call back, should be called after the child devices*haveactuallybeensuspended*/
There 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.
Cc: Josh Boyer <redacted>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
arch/ppc/syslib/ppc4xx_setup.c | 23 -----------------------
1 file changed, 23 deletions(-)
Index: b/arch/ppc/syslib/ppc4xx_setup.c
===================================================================
* 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.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
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(-)
Index: b/arch/powerpc/platforms/powermac/pmac.h
===================================================================
@@ -418,37 +418,6 @@ static void pmac_ide_kauai_selectproc(id#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */-/*-*N.B.thiscan'tbeaninitfunc,becausethemedia-baytaskcan-*callide_[un]registeratanytime.-*/-void-pmac_ide_init_hwif_ports(hw_regs_t*hw,-unsignedlongdata_port,unsignedlongctrl_port,-int*irq)-{-inti,ix;--if(data_port==0)-return;--for(ix=0;ix<MAX_HWIFS;++ix)-if(data_port==pmac_ide[ix].regbase)-break;--if(ix>=MAX_HWIFS)-return;/* not an IDE PMAC interface */--for(i=0;i<8;++i)-hw->io_ports[i]=data_port+i*0x10;-hw->io_ports[8]=data_port+0x160;--if(irq!=NULL)-*irq=pmac_ide[ix].irq;--hw->dev=&pmac_ide[ix].mdev->ofdev.dev;-}-#define PMAC_IDE_REG(x) \((void__iomem*)((drive)->hwif->io_ports[IDE_DATA_OFFSET]+(x)))
@@ -886,12 +855,6 @@ sanitize_timings(pmac_ide_hwif_t *pmif)pmif->timings[2]=pmif->timings[3]=value2;}-unsignedlong-pmac_ide_get_base(intindex)-{-returnpmac_ide[index].regbase;-}-/* Suspend call back, should be called after the child devices*haveactuallybeensuspended*/
* 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.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
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
===================================================================
@@ -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;
@@ -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,*andmakeitedgesensitive
@@ -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|=(0x80000000>>ioport_dsc[data_port].irq);-}/* m8xx_ide_init_hwif_ports() for CONFIG_IDE_8xx_DIRECT */-+}#endif /* CONFIG_IDE_8xx_DIRECT */
* 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=y
CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_IDEPCI_SHARE_IRQ is not set
# CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_BLK_DEV_GENERIC=y
# CONFIG_BLK_DEV_OPTI621 is not set
CONFIG_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.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
arch/ppc/platforms/lopec.c | 85 ---------------------------------------------
drivers/ide/pci/sl82c105.c | 4 ++
2 files changed, 4 insertions(+), 85 deletions(-)
Index: b/arch/ppc/platforms/lopec.c
===================================================================
* 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. ]
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
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(-)
Index: b/arch/ppc/configs/sandpoint_defconfig
===================================================================
@@ -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
* 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.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
arch/ppc/platforms/pplus.c | 23 -----------------------
drivers/ide/ide.c | 2 +-
2 files changed, 1 insertion(+), 24 deletions(-)
Index: b/arch/ppc/platforms/pplus.c
===================================================================
* 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.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
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(-)
Index: b/arch/powerpc/kernel/setup_32.c
===================================================================
@@ -57,7 +56,6 @@ extern void ppc6xx_idle(void);externvoidpower4_idle(void);externboot_infos_t*boot_infos;-structide_machdep_callsppc_ide_md;/* Used with the BI_MEMSIZE bootinfo parameter to store the memorysizevaluereportedbythebootloader.*/
IDE 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.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
arch/powerpc/platforms/powermac/pci.c | 22 ----------------------
1 file changed, 22 deletions(-)
Index: b/arch/powerpc/platforms/powermac/pci.c
===================================================================
@@ -1144,28 +1144,6 @@ void __init pmac_pcibios_after_init(void{structdevice_node*nd;-#ifdef CONFIG_BLK_DEV_IDE-structpci_dev*dev=NULL;--/* OF fails to initialize IDE controllers on macs-*(andmaybeothermachines)-*-*Ideally,thisshouldbemovedtotheIDElayer,butweneed-*tocheckspecificallywithAndreHedrickhowtodoitcleanly-*sincethecommonIDEcodeseemtocareaboutthefactthatthe-*BIOSmayhavedisabledacontroller.-*-*--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")||
On Thu, 14 Feb 2008 01:36:56 +0100
Bartlomiej Zolnierkiewicz wrote:
* 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.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
will be rea /* Make clock cycles and always round up */
#define PCMCIA_MK_CLKS( t, T ) (( (t) * ((T)/1000000) + 999U ) /
1000U )
-
-
-/*
- * 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);
-
- 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;
@@ -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
@@ -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 */
- *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;
/* Enable Harddisk Interrupt,
* and make it edge sensitive
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_t unsigned long base; *p = 0;- if (irq)- *irq = 0; if (!ide_base) {