Rev 4621 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4621 | Rev 4623 | ||
|---|---|---|---|
| Line 94... | Line 94... | ||
| 94 | 94 | ||
| 95 | if (ata_bd_init() != EOK) |
95 | if (ata_bd_init() != EOK) |
| 96 | return -1; |
96 | return -1; |
| 97 | 97 | ||
| 98 | /* Put drives to reset, disable interrupts. */ |
98 | /* Put drives to reset, disable interrupts. */ |
| 99 | printf("Reset drives...\n"); |
99 | printf("Reset drives... "); |
| - | 100 | fflush(stdout); |
|
| - | 101 | ||
| 100 | pio_write_8(&ctl->device_control, DCR_SRST); |
102 | pio_write_8(&ctl->device_control, DCR_SRST); |
| 101 | /* FIXME: Find out how to do this properly. */ |
103 | /* FIXME: Find out how to do this properly. */ |
| 102 | async_usleep(100); |
104 | async_usleep(100); |
| 103 | pio_write_8(&ctl->device_control, 0); |
105 | pio_write_8(&ctl->device_control, 0); |
| 104 | 106 | ||
| 105 | do { |
107 | do { |
| 106 | status = pio_read_8(&cmd->status); |
108 | status = pio_read_8(&cmd->status); |
| 107 | } while ((status & SR_BSY) != 0); |
109 | } while ((status & SR_BSY) != 0); |
| 108 | printf("Done\n"); |
110 | printf("Done\n"); |
| 109 | 111 | ||
| 110 | printf("Status = 0x%x\n", pio_read_8(&cmd->status)); |
- | |
| 111 | - | ||
| 112 | (void) drive_identify(0, &disk[0]); |
112 | (void) drive_identify(0, &disk[0]); |
| 113 | (void) drive_identify(1, &disk[1]); |
113 | (void) drive_identify(1, &disk[1]); |
| 114 | 114 | ||
| 115 | n_disks = 0; |
115 | n_disks = 0; |
| 116 | 116 | ||
| Line 147... | Line 147... | ||
| 147 | { |
147 | { |
| 148 | uint16_t data; |
148 | uint16_t data; |
| 149 | uint8_t status; |
149 | uint8_t status; |
| 150 | size_t i; |
150 | size_t i; |
| 151 | 151 | ||
| 152 | printf("Identify drive %d\n", disk_id); |
152 | printf("Identify drive %d... ", disk_id); |
| - | 153 | fflush(stdout); |
|
| - | 154 | ||
| 153 | pio_write_8(&cmd->drive_head, ((disk_id != 0) ? DHR_DRV : 0)); |
155 | pio_write_8(&cmd->drive_head, ((disk_id != 0) ? DHR_DRV : 0)); |
| 154 | async_usleep(100); |
156 | async_usleep(100); |
| 155 | pio_write_8(&cmd->command, CMD_IDENTIFY_DRIVE); |
157 | pio_write_8(&cmd->command, CMD_IDENTIFY_DRIVE); |
| 156 | 158 | ||
| 157 | status = pio_read_8(&cmd->status); |
159 | status = pio_read_8(&cmd->status); |
| 158 | printf("Status = 0x%x\n", status); |
- | |
| 159 | 160 | ||
| 160 | d->present = false; |
161 | d->present = false; |
| 161 | 162 | ||
| 162 | /* |
163 | /* |
| 163 | * Detect if drive is present. This is Qemu only! Need to |
164 | * Detect if drive is present. This is Qemu only! Need to |