split mpc8xx hooks from cmd_ide.c
authorPavel Herrmann <morpheus.ibis@gmail.com>
Tue, 9 Oct 2012 07:01:56 +0000 (07:01 +0000)
committerTom Rini <trini@ti.com>
Wed, 17 Oct 2012 14:59:08 +0000 (07:59 -0700)
move most of mpc8xx hooks from cmd_ide.c into ide_preinit() and newly created
ide_init_postreset() (invoked after calling ide_reset after ide_preinit),
some cleanup to make checkpatch happy, enable IDE init hooks in configs of
affected boards.
confusingly, these hooks are used by more than just mpc8xx-based boards, and
therefore are placed in arch/ppc/lib/

note: checkpatch still emits warnings about using volatile

Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
40 files changed:
arch/powerpc/lib/Makefile
arch/powerpc/lib/ide.c [new file with mode: 0644]
arch/powerpc/lib/ide.h [new file with mode: 0644]
common/cmd_ide.c
include/configs/CPC45.h
include/configs/ICU862.h
include/configs/IVML24.h
include/configs/IVMS8.h
include/configs/KUP4K.h
include/configs/KUP4X.h
include/configs/MBX.h
include/configs/NETTA.h
include/configs/NSCU.h
include/configs/R360MPI.h
include/configs/RPXClassic.h
include/configs/RPXlite.h
include/configs/RPXlite_DW.h
include/configs/RRvision.h
include/configs/SPD823TS.h
include/configs/TK885D.h
include/configs/TQM823L.h
include/configs/TQM823M.h
include/configs/TQM850L.h
include/configs/TQM850M.h
include/configs/TQM855L.h
include/configs/TQM855M.h
include/configs/TQM860L.h
include/configs/TQM860M.h
include/configs/TQM862L.h
include/configs/TQM862M.h
include/configs/TQM866M.h
include/configs/TQM885D.h
include/configs/atc.h
include/configs/c2mon.h
include/configs/lwmon.h
include/configs/quantum.h
include/configs/svm_sc8xx.h
include/configs/uc100.h
include/configs/virtlab2.h
include/ide.h

index 965f9ea..808021c 100644 (file)
@@ -50,6 +50,7 @@ COBJS-y       += cache.o
 COBJS-y        += extable.o
 COBJS-y        += interrupts.o
 COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
+COBJS-${CONFIG_CMD_IDE} += ide.o
 COBJS-y        += time.o
 
 # Workaround for local bus unaligned access problems
diff --git a/arch/powerpc/lib/ide.c b/arch/powerpc/lib/ide.c
new file mode 100644 (file)
index 0000000..139a94a
--- /dev/null
@@ -0,0 +1,201 @@
+/*
+ * (C) Copyright 2000-2011
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+/* Code taken from cmd_ide.c */
+#include <common.h>
+#include <ata.h>
+#include "ide.h"
+
+#ifdef CONFIG_IDE_8xx_DIRECT
+#include <mpc8xx.h>
+#include <pcmcia.h>
+DECLARE_GLOBAL_DATA_PTR;
+
+/* Timings for IDE Interface
+ *
+ * SETUP / LENGTH / HOLD - cycles valid for 50 MHz clk
+ * 70     165      30     PIO-Mode 0, [ns]
+ *  4       9       2                 [Cycles]
+ * 50     125      20     PIO-Mode 1, [ns]
+ *  3       7       2                 [Cycles]
+ * 30     100      15     PIO-Mode 2, [ns]
+ *  2       6       1                 [Cycles]
+ * 30      80      10     PIO-Mode 3, [ns]
+ *  2       5       1                 [Cycles]
+ * 25      70      10     PIO-Mode 4, [ns]
+ *  2       4       1                 [Cycles]
+ */
+
+static const pio_config_t pio_config_ns[IDE_MAX_PIO_MODE+1] = {
+    /*  Setup  Length  Hold  */
+       { 70,   165,    30 },           /* PIO-Mode 0, [ns]     */
+       { 50,   125,    20 },           /* PIO-Mode 1, [ns]     */
+       { 30,   101,    15 },           /* PIO-Mode 2, [ns]     */
+       { 30,    80,    10 },           /* PIO-Mode 3, [ns]     */
+       { 25,    70,    10 },           /* PIO-Mode 4, [ns]     */
+};
+
+static pio_config_t pio_config_clk[IDE_MAX_PIO_MODE+1];
+
+#ifndef CONFIG_SYS_PIO_MODE
+#define CONFIG_SYS_PIO_MODE    0       /* use a relaxed default */
+#endif
+static int pio_mode = CONFIG_SYS_PIO_MODE;
+
+/* Make clock cycles and always round up */
+
+#define PCMCIA_MK_CLKS(t, T) (((t) * (T) + 999U) / 1000U)
+
+static void set_pcmcia_timing(int pmode)
+{
+       volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
+       volatile pcmconf8xx_t *pcmp = &(immr->im_pcmcia);
+       ulong timings;
+
+       debug("Set timing for PIO Mode %d\n", pmode);
+
+       timings = PCMCIA_SHT(pio_config_clk[pmode].t_hold)
+               | PCMCIA_SST(pio_config_clk[pmode].t_setup)
+               | PCMCIA_SL(pio_config_clk[pmode].t_length);
+
+       /*
+        * IDE 0
+        */
+       pcmp->pcmc_pbr0 = CONFIG_SYS_PCMCIA_PBR0;
+#if (CONFIG_SYS_PCMCIA_POR0 != 0)
+       pcmp->pcmc_por0 = CONFIG_SYS_PCMCIA_POR0 | timings;
+#else
+       pcmp->pcmc_por0 = CONFIG_SYS_PCMCIA_POR0;
+#endif
+       debug("PBR0: %08x  POR0: %08x\n", pcmp->pcmc_pbr0, pcmp->pcmc_por0);
+
+       pcmp->pcmc_pbr1 = CONFIG_SYS_PCMCIA_PBR1;
+#if (CONFIG_SYS_PCMCIA_POR1 != 0)
+       pcmp->pcmc_por1 = CONFIG_SYS_PCMCIA_POR1 | timings;
+#else
+       pcmp->pcmc_por1 = CONFIG_SYS_PCMCIA_POR1;
+#endif
+       debug("PBR1: %08x  POR1: %08x\n", pcmp->pcmc_pbr1, pcmp->pcmc_por1);
+
+       pcmp->pcmc_pbr2 = CONFIG_SYS_PCMCIA_PBR2;
+#if (CONFIG_SYS_PCMCIA_POR2 != 0)
+       pcmp->pcmc_por2 = CONFIG_SYS_PCMCIA_POR2 | timings;
+#else
+       pcmp->pcmc_por2 = CONFIG_SYS_PCMCIA_POR2;
+#endif
+       debug("PBR2: %08x  POR2: %08x\n", pcmp->pcmc_pbr2, pcmp->pcmc_por2);
+
+       pcmp->pcmc_pbr3 = CONFIG_SYS_PCMCIA_PBR3;
+#if (CONFIG_SYS_PCMCIA_POR3 != 0)
+       pcmp->pcmc_por3 = CONFIG_SYS_PCMCIA_POR3 | timings;
+#else
+       pcmp->pcmc_por3 = CONFIG_SYS_PCMCIA_POR3;
+#endif
+       debug("PBR3: %08x  POR3: %08x\n", pcmp->pcmc_pbr3, pcmp->pcmc_por3);
+
+       /*
+        * IDE 1
+        */
+       pcmp->pcmc_pbr4 = CONFIG_SYS_PCMCIA_PBR4;
+#if (CONFIG_SYS_PCMCIA_POR4 != 0)
+       pcmp->pcmc_por4 = CONFIG_SYS_PCMCIA_POR4 | timings;
+#else
+       pcmp->pcmc_por4 = CONFIG_SYS_PCMCIA_POR4;
+#endif
+       debug("PBR4: %08x  POR4: %08x\n", pcmp->pcmc_pbr4, pcmp->pcmc_por4);
+
+       pcmp->pcmc_pbr5 = CONFIG_SYS_PCMCIA_PBR5;
+#if (CONFIG_SYS_PCMCIA_POR5 != 0)
+       pcmp->pcmc_por5 = CONFIG_SYS_PCMCIA_POR5 | timings;
+#else
+       pcmp->pcmc_por5 = CONFIG_SYS_PCMCIA_POR5;
+#endif
+       debug("PBR5: %08x  POR5: %08x\n", pcmp->pcmc_pbr5, pcmp->pcmc_por5);
+
+       pcmp->pcmc_pbr6 = CONFIG_SYS_PCMCIA_PBR6;
+#if (CONFIG_SYS_PCMCIA_POR6 != 0)
+       pcmp->pcmc_por6 = CONFIG_SYS_PCMCIA_POR6 | timings;
+#else
+       pcmp->pcmc_por6 = CONFIG_SYS_PCMCIA_POR6;
+#endif
+       debug("PBR6: %08x  POR6: %08x\n", pcmp->pcmc_pbr6, pcmp->pcmc_por6);
+
+       pcmp->pcmc_pbr7 = CONFIG_SYS_PCMCIA_PBR7;
+#if (CONFIG_SYS_PCMCIA_POR7 != 0)
+       pcmp->pcmc_por7 = CONFIG_SYS_PCMCIA_POR7 | timings;
+#else
+       pcmp->pcmc_por7 = CONFIG_SYS_PCMCIA_POR7;
+#endif
+       debug("PBR7: %08x  POR7: %08x\n", pcmp->pcmc_pbr7, pcmp->pcmc_por7);
+
+}
+
+int ide_preinit(void)
+{
+       int i;
+       /* Initialize PIO timing tables */
+       for (i = 0; i <= IDE_MAX_PIO_MODE; ++i) {
+               pio_config_clk[i].t_setup =
+                       PCMCIA_MK_CLKS(pio_config_ns[i].t_setup, gd->bus_clk);
+               pio_config_clk[i].t_length =
+                       PCMCIA_MK_CLKS(pio_config_ns[i].t_length, gd->bus_clk);
+               pio_config_clk[i].t_hold =
+                       PCMCIA_MK_CLKS(pio_config_ns[i].t_hold, gd->bus_clk);
+               debug("PIO Mode %d: setup=%2d ns/%d clk" "  len=%3d ns/%d clk"
+                       "  hold=%2d ns/%d clk\n", i, pio_config_ns[i].t_setup,
+                       pio_config_clk[i].t_setup, pio_config_ns[i].t_length,
+                       pio_config_clk[i].t_length, pio_config_ns[i].t_hold,
+                       pio_config_clk[i].t_hold);
+       }
+
+       return 0;
+}
+
+int ide_init_postreset(void)
+{
+       volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
+       volatile pcmconf8xx_t *pcmp = &(immr->im_pcmcia);
+
+       /* PCMCIA / IDE initialization for common mem space */
+       pcmp->pcmc_pgcrb = 0;
+
+       /* start in PIO mode 0 - most relaxed timings */
+       pio_mode = 0;
+       set_pcmcia_timing(pio_mode);
+       return 0;
+}
+#endif /* CONFIG_IDE_8xx_DIRECT */
+
+#ifdef CONFIG_IDE_8xx_PCCARD
+int ide_preinit(void)
+{
+       ide_devices_found = 0;
+       /* initialize the PCMCIA IDE adapter card */
+       pcmcia_on();
+       if (!ide_devices_found)
+               return 1;
+       udelay(1000000);/* 1 s */
+       return 0;
+}
+#endif
diff --git a/arch/powerpc/lib/ide.h b/arch/powerpc/lib/ide.h
new file mode 100644 (file)
index 0000000..9e80702
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * (C) Copyright 2012
+ * Pavel Herrmann <morpheus.ibis@gmail.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef _MPC8XX_IDE_H_
+#define _MPC8XX_IDE_H_ 1
+
+#ifdef CONFIG_IDE_8xx_PCCARD
+int pcmcia_on(void);
+extern int ide_devices_found;
+#endif
+#endif
index 11e9eac..9bbdc5d 100644 (file)
 # include <status_led.h>
 #endif
 
-#ifdef CONFIG_IDE_8xx_DIRECT
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
 #ifdef __PPC__
 # define EIEIO         __asm__ volatile ("eieio")
 # define SYNC          __asm__ volatile ("sync")
@@ -65,45 +61,6 @@ DECLARE_GLOBAL_DATA_PTR;
 # define SYNC          /* nothing */
 #endif
 
-#ifdef CONFIG_IDE_8xx_DIRECT
-/* Timings for IDE Interface
- *
- * SETUP / LENGTH / HOLD - cycles valid for 50 MHz clk
- * 70     165      30     PIO-Mode 0, [ns]
- *  4       9       2                 [Cycles]
- * 50     125      20     PIO-Mode 1, [ns]
- *  3       7       2                 [Cycles]
- * 30     100      15     PIO-Mode 2, [ns]
- *  2       6       1                 [Cycles]
- * 30      80      10     PIO-Mode 3, [ns]
- *  2       5       1                 [Cycles]
- * 25      70      10     PIO-Mode 4, [ns]
- *  2       4       1                 [Cycles]
- */
-
-const static pio_config_t pio_config_ns [IDE_MAX_PIO_MODE+1] =
-{
-    /* Setup  Length  Hold  */
-       { 70,   165,    30 },           /* PIO-Mode 0, [ns]     */
-       { 50,   125,    20 },           /* PIO-Mode 1, [ns]     */
-       { 30,   101,    15 },           /* PIO-Mode 2, [ns]     */
-       { 30,    80,    10 },           /* PIO-Mode 3, [ns]     */
-       { 25,    70,    10 },           /* PIO-Mode 4, [ns]     */
-};
-
-static pio_config_t pio_config_clk [IDE_MAX_PIO_MODE+1];
-
-#ifndef        CONFIG_SYS_PIO_MODE
-#define        CONFIG_SYS_PIO_MODE     0               /* use a relaxed default */
-#endif
-static int pio_mode = CONFIG_SYS_PIO_MODE;
-
-/* Make clock cycles and always round up */
-
-#define PCMCIA_MK_CLKS( t, T ) (( (t) * (T) + 999U ) / 1000U )
-
-#endif /* CONFIG_IDE_8xx_DIRECT */
-
 /* ------------------------------------------------------------------------- */
 
 /* Current I/O Device  */
@@ -166,10 +123,6 @@ ulong atapi_read (int device, lbaint_t blknr, ulong blkcnt, void *buffer);
 #endif
 
 
-#ifdef CONFIG_IDE_8xx_DIRECT
-static void set_pcmcia_timing (int pmode);
-#endif
-
 /* ------------------------------------------------------------------------- */
 
 int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
@@ -392,22 +345,14 @@ inline int ide_set_piomode(int pio_mode)
 
 void ide_init(void)
 {
-
-#ifdef CONFIG_IDE_8xx_DIRECT
-       volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-       volatile pcmconf8xx_t *pcmp = &(immr->im_pcmcia);
-#endif
        unsigned char c;
        int i, bus;
 
 #ifdef CONFIG_IDE_8xx_PCCARD
-       extern int pcmcia_on(void);
        extern int ide_devices_found;   /* Initialized in check_ide_device() */
 #endif /* CONFIG_IDE_8xx_PCCARD */
 
 #ifdef CONFIG_IDE_PREINIT
-       extern int ide_preinit(void);
-
        WATCHDOG_RESET();
 
        if (ide_preinit()) {
@@ -416,40 +361,8 @@ void ide_init(void)
        }
 #endif /* CONFIG_IDE_PREINIT */
 
-#ifdef CONFIG_IDE_8xx_PCCARD
-       extern int pcmcia_on(void);
-       extern int ide_devices_found;   /* Initialized in check_ide_device() */
-
        WATCHDOG_RESET();
 
-       ide_devices_found = 0;
-       /* initialize the PCMCIA IDE adapter card */
-       pcmcia_on();
-       if (!ide_devices_found)
-               return;
-       udelay(1000000);        /* 1 s */
-#endif /* CONFIG_IDE_8xx_PCCARD */
-
-       WATCHDOG_RESET();
-
-#ifdef CONFIG_IDE_8xx_DIRECT
-       /* Initialize PIO timing tables */
-       for (i = 0; i <= IDE_MAX_PIO_MODE; ++i) {
-               pio_config_clk[i].t_setup =
-                       PCMCIA_MK_CLKS(pio_config_ns[i].t_setup, gd->bus_clk);
-               pio_config_clk[i].t_length =
-                       PCMCIA_MK_CLKS(pio_config_ns[i].t_length,
-                                      gd->bus_clk);
-               pio_config_clk[i].t_hold =
-                       PCMCIA_MK_CLKS(pio_config_ns[i].t_hold, gd->bus_clk);
-               debug("PIO Mode %d: setup=%2d ns/%d clk" "  len=%3d ns/%d clk"
-                     "  hold=%2d ns/%d clk\n", i, pio_config_ns[i].t_setup,
-                     pio_config_clk[i].t_setup, pio_config_ns[i].t_length,
-                     pio_config_clk[i].t_length, pio_config_ns[i].t_hold,
-                     pio_config_clk[i].t_hold);
-       }
-#endif /* CONFIG_IDE_8xx_DIRECT */
-
        /*
         * Reset the IDE just to be sure.
         * Light LED's to show
@@ -459,14 +372,14 @@ void ide_init(void)
        /* ATAPI Drives seems to need a proper IDE Reset */
        ide_reset();
 
-#ifdef CONFIG_IDE_8xx_DIRECT
-       /* PCMCIA / IDE initialization for common mem space */
-       pcmp->pcmc_pgcrb = 0;
+#ifdef CONFIG_IDE_INIT_POSTRESET
+       WATCHDOG_RESET();
 
-       /* start in PIO mode 0 - most relaxed timings */
-       pio_mode = 0;
-       set_pcmcia_timing(pio_mode);
-#endif /* CONFIG_IDE_8xx_DIRECT */
+       if (ide_init_postreset()) {
+               puts("ide_preinit_postreset failed\n");
+               return;
+       }
+#endif /* CONFIG_IDE_INIT_POSTRESET */
 
        /*
         * Wait for IDE to get ready.
@@ -568,95 +481,6 @@ block_dev_desc_t *ide_get_dev(int dev)
 }
 #endif
 
-
-#ifdef CONFIG_IDE_8xx_DIRECT
-
-static void set_pcmcia_timing(int pmode)
-{
-       volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
-       volatile pcmconf8xx_t *pcmp = &(immr->im_pcmcia);
-       ulong timings;
-
-       debug("Set timing for PIO Mode %d\n", pmode);
-
-       timings = PCMCIA_SHT(pio_config_clk[pmode].t_hold)
-               | PCMCIA_SST(pio_config_clk[pmode].t_setup)
-               | PCMCIA_SL(pio_config_clk[pmode].t_length);
-
-       /*
-        * IDE 0
-        */
-       pcmp->pcmc_pbr0 = CONFIG_SYS_PCMCIA_PBR0;
-       pcmp->pcmc_por0 = CONFIG_SYS_PCMCIA_POR0
-#if (CONFIG_SYS_PCMCIA_POR0 != 0)
-               | timings
-#endif
-               ;
-       debug("PBR0: %08x  POR0: %08x\n", pcmp->pcmc_pbr0, pcmp->pcmc_por0);
-
-       pcmp->pcmc_pbr1 = CONFIG_SYS_PCMCIA_PBR1;
-       pcmp->pcmc_por1 = CONFIG_SYS_PCMCIA_POR1
-#if (CONFIG_SYS_PCMCIA_POR1 != 0)
-               | timings
-#endif
-               ;
-       debug("PBR1: %08x  POR1: %08x\n", pcmp->pcmc_pbr1, pcmp->pcmc_por1);
-
-       pcmp->pcmc_pbr2 = CONFIG_SYS_PCMCIA_PBR2;
-       pcmp->pcmc_por2 = CONFIG_SYS_PCMCIA_POR2
-#if (CONFIG_SYS_PCMCIA_POR2 != 0)
-               | timings
-#endif
-               ;
-       debug("PBR2: %08x  POR2: %08x\n", pcmp->pcmc_pbr2, pcmp->pcmc_por2);
-
-       pcmp->pcmc_pbr3 = CONFIG_SYS_PCMCIA_PBR3;
-       pcmp->pcmc_por3 = CONFIG_SYS_PCMCIA_POR3
-#if (CONFIG_SYS_PCMCIA_POR3 != 0)
-               | timings
-#endif
-               ;
-       debug("PBR3: %08x  POR3: %08x\n", pcmp->pcmc_pbr3, pcmp->pcmc_por3);
-
-       /*
-        * IDE 1
-        */
-       pcmp->pcmc_pbr4 = CONFIG_SYS_PCMCIA_PBR4;
-       pcmp->pcmc_por4 = CONFIG_SYS_PCMCIA_POR4
-#if (CONFIG_SYS_PCMCIA_POR4 != 0)
-               | timings
-#endif
-               ;
-       debug("PBR4: %08x  POR4: %08x\n", pcmp->pcmc_pbr4, pcmp->pcmc_por4);
-
-       pcmp->pcmc_pbr5 = CONFIG_SYS_PCMCIA_PBR5;
-       pcmp->pcmc_por5 = CONFIG_SYS_PCMCIA_POR5
-#if (CONFIG_SYS_PCMCIA_POR5 != 0)
-               | timings
-#endif
-               ;
-       debug("PBR5: %08x  POR5: %08x\n", pcmp->pcmc_pbr5, pcmp->pcmc_por5);
-
-       pcmp->pcmc_pbr6 = CONFIG_SYS_PCMCIA_PBR6;
-       pcmp->pcmc_por6 = CONFIG_SYS_PCMCIA_POR6
-#if (CONFIG_SYS_PCMCIA_POR6 != 0)
-               | timings
-#endif
-               ;
-       debug("PBR6: %08x  POR6: %08x\n", pcmp->pcmc_pbr6, pcmp->pcmc_por6);
-
-       pcmp->pcmc_pbr7 = CONFIG_SYS_PCMCIA_PBR7;
-       pcmp->pcmc_por7 = CONFIG_SYS_PCMCIA_POR7
-#if (CONFIG_SYS_PCMCIA_POR7 != 0)
-               | timings
-#endif
-               ;
-       debug("PBR7: %08x  POR7: %08x\n", pcmp->pcmc_pbr7, pcmp->pcmc_por7);
-
-}
-
-#endif /* CONFIG_IDE_8xx_DIRECT */
-
 /* ------------------------------------------------------------------------- */
 
 /* We only need to swap data if we are running on a big endian cpu. */
index fc226f1..e102c36 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 81f219c..b58b6f6 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index f98a66b..092fcf0 100644 (file)
  * IDE/ATA stuff
  *-----------------------------------------------------------------------
  */
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
+#define CONFIG_IDE_INIT_POSTRESET      1       /* Use postreset IDE hook */
 #define CONFIG_IDE_8xx_DIRECT  1       /* PCMCIA interface required    */
 #define CONFIG_IDE_RESET       1       /* reset for ide supported      */
 
index d6e9b23..38837ca 100644 (file)
  * IDE/ATA stuff
  *-----------------------------------------------------------------------
  */
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
+#define CONFIG_IDE_INIT_POSTRESET      1       /* Use postreset IDE hook */
 #define CONFIG_IDE_8xx_DIRECT  1       /* PCMCIA interface required    */
 #define CONFIG_IDE_RESET       1       /* reset for ide supported      */
 
index c0035e6..dae9b8c 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define CONFIG_IDE_8xx_PCCARD  1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 5084ccc..cceee96 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define CONFIG_IDE_8xx_PCCARD  1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index e8d0cd7..7145cc4 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define CONFIG_IDE_8xx_PCCARD  1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 604938d..074e01f 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 9f462f4..f4184fc 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 9befacb..868a0b8 100644 (file)
  */
 
 #if 1
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index b215c2d..3595200 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 8ffb014..563abea 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index f8bcf0f..67ab1e9 100644 (file)
  * IDE/ATA stuff (Supports IDE harddisk on PCMCIA Adapter)
  *-----------------------------------------------------------------------
  */
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define CONFIG_IDE_8xx_PCCARD  1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 671d521..e2b22f0 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index cffeb11..72ea217 100644 (file)
  * IDE/ATA stuff
  *-----------------------------------------------------------------------
  */
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
+#define CONFIG_IDE_INIT_POSTRESET      1       /* Use postreset IDE hook */
 #define CONFIG_IDE_8xx_DIRECT  1       /* PCMCIA interface required    */
 #define CONFIG_IDE_LED         1       /* LED   for ide supported      */
 #define CONFIG_IDE_RESET       1       /* reset for ide supported      */
index 4176c7f..623cb66 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define CONFIG_IDE_8xx_PCCARD  1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index a01b4a6..9fac5d1 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 1da4acd..932f158 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 1c054f0..eb08de2 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 46066df..bf3a76c 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index dd2da94..43dd643 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 95bc4d9..e7fd2db 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 487666c..81e1b91 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index e8b77ea..ed496a1 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 334b7ec..1559336 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 1e2ad40..61dcf62 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index a13c16a..7d0ae99 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define CONFIG_IDE_8xx_PCCARD  1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 7df76fb..7941631 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define CONFIG_IDE_8xx_PCCARD  1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 75f950b..538a167 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define CONFIG_IDE_8xx_PCCARD  1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 566c42b..41ff008 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index ab86053..df49781 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define CONFIG_IDE_8xx_PCCARD  1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 4f24651..072bd9c 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define CONFIG_IDE_8xx_PCCARD  1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 91686d6..2b24997 100644 (file)
 
 #undef CONFIG_IDE_8xx_PCCARD           /* Use IDE with PC Card Adapter */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
+#define CONFIG_IDE_INIT_POSTRESET      1       /* Use postreset IDE hook */
 #define        CONFIG_IDE_8xx_DIRECT   1       /* Direct IDE    not supported  */
 #undef CONFIG_IDE_LED                  /* LED   for ide not supported  */
 #undef CONFIG_IDE_RESET                /* reset for ide not supported  */
index 8c8fb5a..450c98b 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 4bb96cc..c2c0d1d 100644 (file)
  *-----------------------------------------------------------------------
  */
 
+#define CONFIG_IDE_PREINIT     1       /* Use preinit IDE hook */
 #define        CONFIG_IDE_8xx_PCCARD   1       /* Use IDE with PC Card Adapter */
 
 #undef CONFIG_IDE_8xx_DIRECT           /* Direct IDE    not supported  */
index 95dcbdd..3a08425 100644 (file)
@@ -54,6 +54,14 @@ void ide_init(void);
 ulong ide_read(int device, ulong blknr, lbaint_t blkcnt, void *buffer);
 ulong ide_write(int device, ulong blknr, lbaint_t blkcnt, const void *buffer);
 
+#ifdef CONFIG_IDE_PREINIT
+int ide_preinit(void);
+#endif
+
+#ifdef CONFIG_IDE_INIT_POSTRESET
+int ide_init_postreset(void);
+#endif
+
 #if defined(CONFIG_OF_IDE_FIXUP)
 int ide_device_present(int dev);
 #endif