aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:35 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:35 -0400
commit486c92e2900d618c650a7099536310651aa6cf1b (patch)
treef78f54a5df2c3f93b73913652b2a7209b2bf11da
parentf01674e459923c6df540e6c983d37e5fc94d43b8 (diff)
ide: move default IDE ports setup to ide_generic host driver
* Make CONFIG_IDE_GENERIC depended on CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS. * Move default IDE ports setup from init_ide_data() to ide_generic. * Use ide_init_port_hw() in ide_generic. * Remove no longer needed CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/Kconfig4
-rw-r--r--drivers/ide/ide-generic.c12
-rw-r--r--drivers/ide/ide.c17
3 files changed, 10 insertions, 23 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index aecc219288d6..87532034d105 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -307,6 +307,7 @@ comment "IDE chipset support/bugfixes"
307 307
308config IDE_GENERIC 308config IDE_GENERIC
309 tristate "generic/default IDE chipset support" 309 tristate "generic/default IDE chipset support"
310 depends on ALPHA || X86 || IA64 || M32R || MIPS || PPC32
310 help 311 help
311 If unsure, say N. 312 If unsure, say N.
312 313
@@ -1089,9 +1090,6 @@ config BLK_DEV_IDEDMA
1089 def_bool BLK_DEV_IDEDMA_SFF || BLK_DEV_IDEDMA_PMAC || \ 1090 def_bool BLK_DEV_IDEDMA_SFF || BLK_DEV_IDEDMA_PMAC || \
1090 BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 1091 BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
1091 1092
1092config IDE_ARCH_OBSOLETE_DEFAULTS
1093 def_bool ALPHA || X86 || IA64 || M32R || MIPS || PPC32
1094
1095endif 1093endif
1096 1094
1097config BLK_DEV_HD_ONLY 1095config BLK_DEV_HD_ONLY
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
index bae41459192d..4f996d01587a 100644
--- a/drivers/ide/ide-generic.c
+++ b/drivers/ide/ide-generic.c
@@ -91,11 +91,17 @@ static int __init ide_generic_init(void)
91 91
92 for (i = 0; i < MAX_HWIFS; i++) { 92 for (i = 0; i < MAX_HWIFS; i++) {
93 ide_hwif_t *hwif = &ide_hwifs[i]; 93 ide_hwif_t *hwif = &ide_hwifs[i];
94 unsigned long io_addr = ide_default_io_base(i);
95 hw_regs_t hw;
96
97 if (hwif->chipset == ide_unknown && io_addr) {
98 memset(&hw, 0, sizeof(hw));
99 ide_std_init_ports(&hw, io_addr, io_addr + 0x206);
100 hw.irq = ide_init_default_irq(io_addr);
101 ide_init_port_hw(hwif, &hw);
94 102
95 if (hwif->io_ports[IDE_DATA_OFFSET] &&
96 hwif->chipset == ide_unknown)
97 idx[i] = i; 103 idx[i] = i;
98 else 104 } else
99 idx[i] = 0xff; 105 idx[i] = 0xff;
100 } 106 }
101 107
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index aa809aded87f..917c72dcd33d 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -165,11 +165,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
165 } 165 }
166} 166}
167 167
168#ifndef CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS
169# define ide_default_io_base(index) (0)
170# define ide_init_default_irq(base) (0)
171#endif
172
173/* 168/*
174 * init_ide_data() sets reasonable default values into all fields 169 * init_ide_data() sets reasonable default values into all fields
175 * of all instances of the hwifs and drives, but only on the first call. 170 * of all instances of the hwifs and drives, but only on the first call.
@@ -192,7 +187,6 @@ static void __init init_ide_data (void)
192{ 187{
193 unsigned int index; 188 unsigned int index;
194 static unsigned long magic_cookie = MAGIC_COOKIE; 189 static unsigned long magic_cookie = MAGIC_COOKIE;
195 hw_regs_t hw;
196 190
197 if (magic_cookie != MAGIC_COOKIE) 191 if (magic_cookie != MAGIC_COOKIE)
198 return; /* already initialized */ 192 return; /* already initialized */
@@ -201,19 +195,8 @@ static void __init init_ide_data (void)
201 /* Initialise all interface structures */ 195 /* Initialise all interface structures */
202 for (index = 0; index < MAX_HWIFS; ++index) { 196 for (index = 0; index < MAX_HWIFS; ++index) {
203 ide_hwif_t *hwif = &ide_hwifs[index]; 197 ide_hwif_t *hwif = &ide_hwifs[index];
204 unsigned long io_addr = ide_default_io_base(index);
205 unsigned long ctl_addr = io_addr + 0x206;
206 198
207 ide_init_port_data(hwif, index); 199 ide_init_port_data(hwif, index);
208
209#ifdef CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS
210 memset(&hw, 0, sizeof(hw));
211 ide_std_init_ports(&hw, io_addr, ctl_addr);
212 memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports));
213 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
214 hwif->irq =
215 ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]);
216#endif
217 } 200 }
218} 201}
219 202