summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/pc386/ide/ide.c
blob: e74a1934b5cc310ec75acad7122aa6b99a5e4cd4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
/*===============================================================*\
| Project: RTEMS PC386 IDE harddisc driver                        |
+-----------------------------------------------------------------+
| File: ide.c                                                     |
+-----------------------------------------------------------------+
|                    Copyright (c) 2003 IMD                       |
|      Ingenieurbuero fuer Microcomputertechnik Th. Doerfler      |
|               <Thomas.Doerfler@imd-systems.de>                  |
|                       all rights reserved                       |
+-----------------------------------------------------------------+
| this file contains the BSP layer for IDE access below the       |
| libchip IDE harddisc driver                                     |
| based on a board specific driver from                           |
| Eugeny S. Mints, Oktet                                          |
|                                                                 |
|  The license and distribution terms for this file may be        |
|  found in the file LICENSE in this distribution or at           |
|  http://www.rtems.org/license/LICENSE.                     |
|                                                                 |
+-----------------------------------------------------------------+
|   date                      history                        ID   |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 01.14.03  creation                                         doe  |
\*===============================================================*/

#include <rtems.h>
#include <bsp.h>
#include <libchip/ide_ctrl.h>
#include <libchip/ide_ctrl_cfg.h>
#include <libchip/ide_ctrl_io.h>

#define ATA_SECTOR_SIZE (512)

/*
 * Use during initialisation.
 */
extern void Wait_X_ms(unsigned int msecs);

bool pc386_ide_show;
uint32_t pc386_ide_timeout;

#define PC386_IDE_DEBUG_OUT 0

#if PC386_IDE_DEBUG_OUT
bool pc386_ide_trace;
#define pc386_ide_printk if (pc386_ide_trace) printk
#endif

#define PC386_IDE_PROBE_TIMEOUT    (500)
#define PC386_IDE_PRESTART_TIMEOUT (1000)
#define PC386_IDE_TASKING_TIMEOUT  (2000)

/*
 * Prestart sleep using a calibrated timing loop.
 */
static void pc386_ide_prestart_sleep (void)
{
  Wait_X_ms (10);
}

/*
 * Once tasking has started we use a task sleep.
 */
static void pc386_ide_tasking_sleep (void)
{
  rtems_task_wake_after (RTEMS_MICROSECONDS_TO_TICKS (10000) ?
                         RTEMS_MICROSECONDS_TO_TICKS (10000) : 1);
}

typedef void (*pc386_ide_sleeper)(void);

static void pc386_ide_sleep (pc386_ide_sleeper sleeper)
{
  sleeper ();
}

static void wait(volatile uint32_t loops)
{
  while (loops)
    loops--;
}

static bool pc386_ide_status_busy (uint32_t          port,
                                   volatile uint32_t timeout,
                                   uint8_t*          status_val,
                                   pc386_ide_sleeper sleeper)
{
  volatile uint8_t status;
  int              polls;

  do
  {
    polls = 500;
    while (polls)
    {
      inport_byte (port + IDE_REGISTER_STATUS, status);
      if ((status & IDE_REGISTER_STATUS_BSY) == 0)
      {
        *status_val = status;
        return true;
      }
      polls--;
    }

    if (timeout)
    {
      timeout--;
      pc386_ide_sleep (sleeper);
    }
  }
  while (timeout);

  *status_val = status;
  return false;
}

static bool pc386_ide_status_data_ready (uint32_t          port,
                                         volatile uint32_t timeout,
                                         uint8_t*          status_val,
                                         pc386_ide_sleeper sleeper)
{
  volatile uint8_t status;
  int              polls;

  do
  {
    polls = 1000;
    while (polls)
    {
      inport_byte (port + IDE_REGISTER_STATUS, status);

      if (((status & IDE_REGISTER_STATUS_BSY) == 0) &&
          (status & IDE_REGISTER_STATUS_DRQ))
      {
        *status_val = status;
        return true;
      }

      polls--;
    }

    if (timeout)
    {
      timeout--;
      pc386_ide_sleep (sleeper);
    }
  }
  while (timeout);

  *status_val = status;
  return false;
}

/*
 * support functions for IDE harddisk IF
 */
/*=========================================================================*\
| Function:                                                                 |
\*-------------------------------------------------------------------------*/
static bool pc386_ide_probe
(
/*-------------------------------------------------------------------------*\
| Purpose:                                                                  |
|  This function should probe, whether a IDE disk is available              |
+---------------------------------------------------------------------------+
| Input Parameters:                                                         |
\*-------------------------------------------------------------------------*/
 int minor
 )
/*-------------------------------------------------------------------------*\
| Return Value:                                                             |
|    true, when flash disk available                                        |
\*=========================================================================*/
{
  bool ide_card_plugged = true; /* assume: we have a disk here */

  return ide_card_plugged;
}

/*=========================================================================*\
| Function:                                                                 |
\*-------------------------------------------------------------------------*/
static void pc386_ide_initialize
(
/*-------------------------------------------------------------------------*\
  | Purpose:                                                                  |
  |  initialize IDE access                                                    |
  +---------------------------------------------------------------------------+
  | Input Parameters:                                                         |
  \*-------------------------------------------------------------------------*/
  int  minor                              /* controller minor number       */
 )
/*-------------------------------------------------------------------------*\
  | Return Value:                                                             |
  |    <none>                                                                 |
  \*=========================================================================*/
{
  uint32_t port = IDE_Controller_Table[minor].port1;
  uint8_t  dev = 0;

  if (pc386_ide_show)
    printk("IDE%d: port base: %04x\n", minor, port);

  outport_byte(port+IDE_REGISTER_DEVICE_HEAD,
               (dev << IDE_REGISTER_DEVICE_HEAD_DEV_POS) | 0xE0);
  wait(10000);
  outport_byte(port+IDE_REGISTER_DEVICE_CONTROL,
               IDE_REGISTER_DEVICE_CONTROL_SRST | IDE_REGISTER_DEVICE_CONTROL_nIEN);
  wait(10000);
  outport_byte(port+IDE_REGISTER_DEVICE_CONTROL,
               IDE_REGISTER_DEVICE_CONTROL_nIEN);
  wait(10000);

  for (dev = 0; dev < 2; dev++)
  {
    uint16_t    capabilities = 0;
    uint32_t    byte;
    uint8_t     status;
    uint8_t     error;
    uint8_t     cyllsb;
    uint8_t     cylmsb;
    const char* label = dev ? " slave" : "master";
    int         max_multiple_sectors = 0;
    int         cur_multiple_sectors = 0;
    uint32_t    cylinders = 0;
    uint32_t    heads = 0;
    uint32_t    sectors = 0;
    uint32_t    lba_sectors = 0;
    char        model_number[41];
    char*       p = &model_number[0];
    bool        data_ready;

    memset(model_number, 0, sizeof(model_number));

    outport_byte(port+IDE_REGISTER_DEVICE_HEAD,
                 (dev << IDE_REGISTER_DEVICE_HEAD_DEV_POS) | 0xE0);
    /*
      outport_byte(port+IDE_REGISTER_SECTOR_NUMBER,
      (dev << IDE_REGISTER_DEVICE_HEAD_DEV_POS) | IDE_REGISTER_LBA3_L);
    */

    outport_byte(port+IDE_REGISTER_COMMAND, 0x00);

    if (!pc386_ide_status_busy (port, PC386_IDE_PROBE_TIMEOUT,
                                &status, pc386_ide_prestart_sleep))
      continue;

    inport_byte(port+IDE_REGISTER_STATUS,        status);
    inport_byte(port+IDE_REGISTER_ERROR,         error);
    inport_byte(port+IDE_REGISTER_CYLINDER_LOW,  cyllsb);
    inport_byte(port+IDE_REGISTER_CYLINDER_HIGH, cylmsb);

    if (pc386_ide_show)
    {
      printk("IDE%d:%s: status=%02x\n", minor, label, status);
      printk("IDE%d:%s: error=%02x\n", minor, label, error);
      printk("IDE%d:%s: cylinder-low=%02x\n", minor, label, cyllsb);
      printk("IDE%d:%s: cylinder-high=%02x\n", minor, label, cylmsb);
    }

    outport_byte(port+IDE_REGISTER_COMMAND, 0xec);

    if (!pc386_ide_status_busy (port, PC386_IDE_PRESTART_TIMEOUT,
                                &status, pc386_ide_prestart_sleep))
    {
      if (pc386_ide_show)
        printk("IDE%d:%s: device busy: %02x\n", minor, label, status);
      continue;
    }

    data_ready = pc386_ide_status_data_ready (port,
                                              250,
                                              &status,
                                              pc386_ide_prestart_sleep);

    if (status & IDE_REGISTER_STATUS_ERR)
    {
      inport_byte(port+IDE_REGISTER_ERROR, error);
      if (error != 4)
      {
        if (pc386_ide_show)
          printk("IDE%d:%s: error=%04x\n", minor, label, error);
        continue;
      }
      /*
       * The device is an ATAPI device.
       */
      outport_byte(port+IDE_REGISTER_COMMAND, 0xa1);
      data_ready = pc386_ide_status_data_ready (port,
                                                250,
                                                &status,
                                                pc386_ide_prestart_sleep);
    }

    if (!data_ready)
      continue;

    byte = 0;
    while (byte < 512)
    {
      uint16_t word;

      if (pc386_ide_show && ((byte % 16) == 0))
        printk("\n %04x : ", byte);

      inport_word(port+IDE_REGISTER_DATA, word);

      if (pc386_ide_show)
        printk ("%04x ", word);

      if (byte == 2)
        cylinders = word;
      if (byte == 6)
        heads = word;
      if (byte == 12)
        sectors = word;

      if (byte >= 54 && byte < (54 + 40))
      {
        *p = word >> 8;
        p++;
        *p = word;
        p++;
      }

      if (byte == (47 * 2))
        max_multiple_sectors = word & 0xff;

      if (byte == (49 * 2))
        capabilities = word;

      if (byte == (59 * 2))
      {
        if (word & (1 << 8))
          cur_multiple_sectors = word & 0xff;
      }

      if (byte == (60 * 2))
        lba_sectors = word;
      if (byte == (61 * 2))
        lba_sectors |= word << 16;

      byte += 2;
    }

    if (pc386_ide_show)
      printk("\nbytes read = %d\n", byte);

    if (p != &model_number[0])
    {
      uint32_t size;
      uint32_t left;
      uint32_t right;
      char     units;

      if (capabilities & (1 << 9))
        size = lba_sectors;
      else
        size = cylinders * heads * sectors;

      size /= 2;

      if (size > (1024 * 1024))
      {
        size = (size * 10) / (1000 * 1000);
        units = 'G';
      }
      else if (size > 1024)
      {
        size = (size * 10) / 1000;
        units = 'M';
      }
      else
      {
        size = size * 10;
        units = 'K';
      }

      left = size / 10;
      right = size % 10;

      p--;
      while (*p == ' ')
      {
        *p = '\0';
        p--;
      }

      printk("IDE%d:%s:%s, %u.%u%c (%u/%u/%u), max blk size:%d\n",
             minor, label, model_number, left, right, units,
             heads, cylinders, sectors, max_multiple_sectors * 512);
    }

#if IDE_CLEAR_MULTI_SECTOR_COUNT
    if (max_multiple_sectors)
    {
      outport_byte(port+IDE_REGISTER_SECTOR_COUNT, 0);
      outport_byte(port+IDE_REGISTER_COMMAND, 0xc6);

      if (!pc386_ide_status_busy (port, PC386_IDE_PRESTART_TIMEOUT,
                                  &status, pc386_ide_prestart_sleep))
      {
        if (pc386_ide_show)
          printk("IDE%d:%s: device busy: %02x\n", minor, label, status);
        continue;
      }

      inport_byte(port+IDE_REGISTER_STATUS, status);
      if (status & IDE_REGISTER_STATUS_ERR)
      {
        inport_byte(port+IDE_REGISTER_ERROR, error);
        if (error & IDE_REGISTER_ERROR_ABRT)
          printk("IDE%d:%s: disable multiple failed\n", minor, label);
        else
          printk("IDE%d:%s: unknown error on disable multiple: %02x\n",
                 minor, label, error);
      }
    }
#endif

    outport_byte(port+IDE_REGISTER_DEVICE_CONTROL,
                 IDE_REGISTER_DEVICE_CONTROL_nIEN);
    wait(10000);
  }

  pc386_ide_timeout = PC386_IDE_TASKING_TIMEOUT;

  /*
   * FIXME: enable interrupts, if needed
   */
}

/*=========================================================================*\
| Function:                                                                 |
\*-------------------------------------------------------------------------*/
static void pc386_ide_read_reg
(
/*-------------------------------------------------------------------------*\
| Purpose:                                                                  |
|  read a IDE controller register                                           |
+---------------------------------------------------------------------------+
| Input Parameters:                                                         |
\*-------------------------------------------------------------------------*/
 int                        minor,  /* controller minor number       */
 int                        reg,    /* register index to access      */
 uint16_t                  *value   /* ptr to return value location  */
 )
/*-------------------------------------------------------------------------*\
| Return Value:                                                             |
|    <none>                                                                 |
\*=========================================================================*/
{
  uint32_t    port = IDE_Controller_Table[minor].port1;
  uint8_t   bval1,bval2;

  if (reg == IDE_REGISTER_DATA_WORD) {
    inport_byte(port+reg, bval1);
    inport_byte(port+reg+1, bval2);
    *value = bval1 + (bval2 << 8);
  }
  else {
    inport_byte(port+reg, bval1);
    *value = bval1;
  }
#if PC386_IDE_DEBUG_OUT
  pc386_ide_printk("pc386_ide_read_reg (0x%x)=0x%x\r\n",reg,*value & 0xff);
#endif
}

/*=========================================================================*\
| Function:                                                                 |
\*-------------------------------------------------------------------------*/
static void pc386_ide_write_reg
(
/*-------------------------------------------------------------------------*\
| Purpose:                                                                  |
|  write a IDE controller register                                          |
+---------------------------------------------------------------------------+
| Input Parameters:                                                         |
\*-------------------------------------------------------------------------*/
 int                        minor,  /* controller minor number       */
 int                        reg,    /* register index to access      */
 uint16_t                   value   /* value to write                */
 )
/*-------------------------------------------------------------------------*\
| Return Value:                                                             |
|    <none>                                                                 |
\*=========================================================================*/
{
  uint32_t    port = IDE_Controller_Table[minor].port1;

#if PC386_IDE_DEBUG_OUT
  pc386_ide_printk("pc386_ide_write_reg(0x%x,0x%x)\r\n",reg,value & 0xff);
#endif
  if (reg == IDE_REGISTER_DATA_WORD) {
    outport_word(port+reg,value);
  }
  else {
    outport_byte(port+reg,value);
  }
}

/*=========================================================================*\
| Function:                                                                 |
\*-------------------------------------------------------------------------*/
static void pc386_ide_read_block
(
/*-------------------------------------------------------------------------*\
| Purpose:                                                                  |
|  read a IDE controller data block                                         |
+---------------------------------------------------------------------------+
| Input Parameters:                                                         |
\*-------------------------------------------------------------------------*/
 int                     minor,
 uint32_t                block_size,
 rtems_blkdev_sg_buffer *bufs,
 uint32_t               *cbuf,
 uint32_t               *pos
 )
/*-------------------------------------------------------------------------*\
| Return Value:                                                             |
|    <none>                                                                 |
\*=========================================================================*/
{
  uint32_t port = IDE_Controller_Table[minor].port1;
  uint32_t cnt = 0;
#if PC386_IDE_DEBUG_OUT
  int i32 = 0;
  pc386_ide_printk("pc386_ide_read_block(bs=%u,bn=%u,bl=%u,cb=%d,p=%d)\n",
                   block_size, bufs[(*cbuf)].block, llength, *cbuf, *pos);
#endif

  while (cnt < block_size)
  {
    uint16_t *lbuf;
    uint8_t  status_val;
    int      b;

    if (!pc386_ide_status_data_ready (port, pc386_ide_timeout,
                                      &status_val, pc386_ide_tasking_sleep))
    {
      printk ("pc386_ide_read_block: block=%u cbuf=%u status=%02x, cnt=%d bs=%d\n",
              bufs[*cbuf].block, *cbuf, status_val, cnt, block_size);
      /* FIXME: add an error here. */
      return;
    }

    if (status_val & IDE_REGISTER_STATUS_ERR)
    {
      inport_byte(port+IDE_REGISTER_ERROR, status_val);
      printk("pc386_ide_read_block: error: %02x\n", status_val);
      return;
    }

    lbuf = (uint16_t*)((uint8_t*)(bufs[(*cbuf)].buffer) + (*pos));

    for (b = 0; b < (ATA_SECTOR_SIZE / 2); b++)
    {
      inport_word(port+IDE_REGISTER_DATA,*lbuf);

#if PC386_IDE_DEBUG_OUT
      pc386_ide_printk("%04x ",*lbuf);
      i32++;
      if (i32 >= 16)
      {
        pc386_ide_printk("\n");
        i32 = 0;
      }
#endif
      lbuf++;
    }
    cnt    += ATA_SECTOR_SIZE;
    (*pos) += ATA_SECTOR_SIZE;
    if ((*pos) == bufs[(*cbuf)].length) {
      (*pos) = 0;
      (*cbuf)++;
      lbuf = bufs[(*cbuf)].buffer;
    }
  }
}

/*=========================================================================*\
| Function:                                                                 |
\*-------------------------------------------------------------------------*/
static void pc386_ide_write_block
(
/*-------------------------------------------------------------------------*\
| Purpose:                                                                  |
|  write a IDE controller data block                                        |
+---------------------------------------------------------------------------+
| Input Parameters:                                                         |
\*-------------------------------------------------------------------------*/
 int minor,
 uint32_t                block_size,
 rtems_blkdev_sg_buffer *bufs,
 uint32_t               *cbuf,
 uint32_t               *pos
 )
/*-------------------------------------------------------------------------*\
| Return Value:                                                             |
|    <none>                                                                 |
\*=========================================================================*/
{
  uint32_t port = IDE_Controller_Table[minor].port1;
  uint32_t cnt = 0;
#if PC386_IDE_DEBUG_OUT
  int i32 = 0;
  pc386_ide_printk("pc386_ide_write_block(bs=%u,bn=%u,bl=%u,cb=%d,p=%d)\n",
                   block_size, bufs[(*cbuf)].block, llength, *cbuf, *pos);
#endif

  while (cnt < block_size)
  {
    uint16_t *lbuf;
    uint8_t  status_val;
    int      b;

    if (!pc386_ide_status_data_ready (port, pc386_ide_timeout,
                                      &status_val, pc386_ide_tasking_sleep))
    {
      printk ("pc386_ide_write_block: block=%u status=%02x, cnt=%d bs=%d\n",
              bufs[*cbuf].block, status_val, cnt, block_size);
      /* FIXME: add an error here. */
      return;
    }

    if (status_val & IDE_REGISTER_STATUS_ERR)
    {
      inport_byte(port+IDE_REGISTER_ERROR, status_val);
      printk ("pc386_ide_write_block: error: %02x\n", status_val);
      return;
    }

    lbuf = (uint16_t*)(((uint8_t*)bufs[*cbuf].buffer) + (*pos));

    for (b = 0; b < (ATA_SECTOR_SIZE / 2); b++)
    {
#if PC386_IDE_DEBUG_OUT
      pc386_ide_printk("%04x ",*lbuf);
      i32++;
      if (i32 >= 16)
      {
        pc386_ide_printk("\n");
        i32 = 0;
      }
#endif
      outport_word(port+IDE_REGISTER_DATA,*lbuf);
      lbuf++;
    }
    cnt    += ATA_SECTOR_SIZE;
    (*pos) += ATA_SECTOR_SIZE;
    if ((*pos) == bufs[(*cbuf)].length) {
      (*pos) = 0;
      (*cbuf)++;
      lbuf = bufs[(*cbuf)].buffer;
    }
  }
}

/*=========================================================================*\
| Function:                                                                 |
\*-------------------------------------------------------------------------*/
static int pc386_ide_control
(
/*-------------------------------------------------------------------------*\
| Purpose:                                                                  |
|  control interface for controller                                         |
+---------------------------------------------------------------------------+
| Input Parameters:                                                         |
\*-------------------------------------------------------------------------*/
 int  minor,                        /* controller minor number       */
 uint32_t   cmd,                    /* command to send               */
 void * arg                         /* optional argument             */
 )
/*-------------------------------------------------------------------------*\
| Return Value:                                                             |
|    <none>                                                                 |
\*=========================================================================*/
{
  return 0;
}

/*=========================================================================*\
| Function:                                                                 |
\*-------------------------------------------------------------------------*/
static rtems_status_code pc386_ide_config_io_speed
(
/*-------------------------------------------------------------------------*\
| Purpose:                                                                  |
|  set up transfer speed, if possible                                       |
+---------------------------------------------------------------------------+
| Input Parameters:                                                         |
\*-------------------------------------------------------------------------*/
 int        minor,                   /* controller minor number       */
 uint16_t   modes_avail              /* optional argument             */
 )
/*-------------------------------------------------------------------------*\
| Return Value:                                                             |
|    rtems_status_code                                                      |
\*=========================================================================*/
{
  return RTEMS_SUCCESSFUL;
}

/*
 * The following table configures the functions used for IDE drivers
 * in this BSP.
 */

ide_ctrl_fns_t pc386_ide_ctrl_fns = {
  pc386_ide_probe,
  pc386_ide_initialize,
  pc386_ide_control,
  pc386_ide_read_reg,
  pc386_ide_write_reg,
  pc386_ide_read_block,
  pc386_ide_write_block,
  pc386_ide_config_io_speed
};