aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/buddha.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy/buddha.c')
-rw-r--r--drivers/ide/legacy/buddha.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c
index 4a0be251a05f..74d28e058f55 100644
--- a/drivers/ide/legacy/buddha.c
+++ b/drivers/ide/legacy/buddha.c
@@ -112,6 +112,7 @@ typedef enum BuddhaType_Enum {
112 BOARD_BUDDHA, BOARD_CATWEASEL, BOARD_XSURF 112 BOARD_BUDDHA, BOARD_CATWEASEL, BOARD_XSURF
113} BuddhaType; 113} BuddhaType;
114 114
115static const char *buddha_board_name[] = { "Buddha", "Catweasel", "X-Surf" };
115 116
116 /* 117 /*
117 * Check and acknowledge the interrupt status 118 * Check and acknowledge the interrupt status
@@ -143,11 +144,11 @@ static int xsurf_ack_intr(ide_hwif_t *hwif)
143 * Probe for a Buddha or Catweasel IDE interface 144 * Probe for a Buddha or Catweasel IDE interface
144 */ 145 */
145 146
146void __init buddha_init(void) 147static int __init buddha_init(void)
147{ 148{
148 hw_regs_t hw; 149 hw_regs_t hw;
149 ide_hwif_t *hwif; 150 ide_hwif_t *hwif;
150 int i, index; 151 int i;
151 152
152 struct zorro_dev *z = NULL; 153 struct zorro_dev *z = NULL;
153 u_long buddha_board = 0; 154 u_long buddha_board = 0;
@@ -156,6 +157,8 @@ void __init buddha_init(void)
156 157
157 while ((z = zorro_find_device(ZORRO_WILDCARD, z))) { 158 while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
158 unsigned long board; 159 unsigned long board;
160 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
161
159 if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) { 162 if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) {
160 buddha_num_hwifs = BUDDHA_NUM_HWIFS; 163 buddha_num_hwifs = BUDDHA_NUM_HWIFS;
161 type=BOARD_BUDDHA; 164 type=BOARD_BUDDHA;
@@ -195,7 +198,10 @@ fail_base2:
195 /* X-Surf doesn't have this. IRQs are always on */ 198 /* X-Surf doesn't have this. IRQs are always on */
196 if (type != BOARD_XSURF) 199 if (type != BOARD_XSURF)
197 z_writeb(0, buddha_board+BUDDHA_IRQ_MR); 200 z_writeb(0, buddha_board+BUDDHA_IRQ_MR);
198 201
202 printk(KERN_INFO "ide: %s IDE controller\n",
203 buddha_board_name[type]);
204
199 for(i=0;i<buddha_num_hwifs;i++) { 205 for(i=0;i<buddha_num_hwifs;i++) {
200 if(type != BOARD_XSURF) { 206 if(type != BOARD_XSURF) {
201 ide_setup_ports(&hw, (buddha_board+buddha_bases[i]), 207 ide_setup_ports(&hw, (buddha_board+buddha_bases[i]),
@@ -213,23 +219,23 @@ fail_base2:
213 IRQ_AMIGA_PORTS); 219 IRQ_AMIGA_PORTS);
214 } 220 }
215 221
216 index = ide_register_hw(&hw, NULL, 1, &hwif); 222 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
217 if (index != -1) { 223 if (hwif) {
224 u8 index = hwif->index;
225
226 ide_init_port_data(hwif, index);
227 ide_init_port_hw(hwif, &hw);
228
218 hwif->mmio = 1; 229 hwif->mmio = 1;
219 printk("ide%d: ", index); 230
220 switch(type) { 231 idx[i] = index;
221 case BOARD_BUDDHA: 232 }
222 printk("Buddha");
223 break;
224 case BOARD_CATWEASEL:
225 printk("Catweasel");
226 break;
227 case BOARD_XSURF:
228 printk("X-Surf");
229 break;
230 }
231 printk(" IDE interface\n");
232 }
233 } 233 }
234
235 ide_device_add(idx);
234 } 236 }
237
238 return 0;
235} 239}
240
241module_init(buddha_init);