File indexing completed on 2025-05-11 08:23:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef __IDE_CTRL_CFG_H__
0015 #define __IDE_CTRL_CFG_H__
0016
0017 #include <rtems/blkdev.h>
0018
0019 #ifdef __cplusplus
0020 extern "C" {
0021 #endif
0022
0023
0024
0025
0026 typedef enum {
0027 IDE_STD,
0028 IDE_CUSTOM
0029 } ide_ctrl_devs_t;
0030
0031
0032 #define ATA_MODES_PIO3 0x001
0033 #define ATA_MODES_PIO4 0x002
0034
0035 #define ATA_MODES_PIO 0x003
0036
0037 #define ATA_MODES_DMA0 0x004
0038 #define ATA_MODES_DMA1 0x008
0039 #define ATA_MODES_DMA2 0x010
0040
0041 #define ATA_MODES_UDMA0 0x020
0042 #define ATA_MODES_UDMA1 0x040
0043 #define ATA_MODES_UDMA2 0x080
0044 #define ATA_MODES_UDMA3 0x100
0045 #define ATA_MODES_UDMA4 0x200
0046 #define ATA_MODES_UDMA5 0x400
0047
0048 #define ATA_MODES_UDMA 0x7e0
0049 #define ATA_MODES_DMA 0x7fc
0050
0051
0052
0053
0054
0055
0056
0057 typedef struct ide_ctrl_fns_s {
0058 bool (*ctrl_probe)(int minor);
0059 void (*ctrl_initialize)(int minor);
0060 int (*ctrl_control)(int minor, uint32_t command,
0061 void *arg);
0062
0063
0064
0065
0066
0067 void (*ctrl_reg_read)(int minor, int regist, uint16_t *value);
0068 void (*ctrl_reg_write)(int minor, int regist, uint16_t value);
0069
0070
0071
0072
0073
0074 void (*ctrl_read_block)(int minor, uint32_t block_size,
0075 rtems_blkdev_sg_buffer *bufs, uint32_t *cbuf,
0076 uint32_t *pos);
0077 void (*ctrl_write_block)(int minor, uint32_t block_size,
0078 rtems_blkdev_sg_buffer *bufs, uint32_t *cbuf,
0079 uint32_t *pos);
0080
0081 rtems_status_code (*ctrl_config_io_speed)(int minor,
0082 uint16_t modes_available);
0083 } ide_ctrl_fns_t;
0084
0085
0086
0087
0088
0089 typedef struct ide_controller_bsp_table_s {
0090 char *name;
0091 ide_ctrl_devs_t type;
0092 ide_ctrl_fns_t *fns;
0093 bool (*probe)(int minor);
0094 uint8_t status;
0095
0096
0097 uint32_t port1;
0098 bool int_driven;
0099 rtems_vector_number int_vec;
0100 void *params;
0101
0102
0103
0104 } ide_controller_bsp_table_t;
0105
0106
0107 extern ide_controller_bsp_table_t IDE_Controller_Table[];
0108
0109
0110 extern unsigned long IDE_Controller_Count;
0111
0112
0113 #define IDE_CTRL_MAX_MINOR_NUMBER 4
0114
0115 #define IDE_CTRL_NON_INITIALIZED 0
0116 #define IDE_CTRL_INITIALIZED 1
0117
0118 #ifdef __cplusplus
0119 }
0120 #endif
0121
0122
0123 #endif