summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/ata.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 24abecdb5c..fa51259d99 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -19,6 +19,8 @@
19#include "ata.h" 19#include "ata.h"
20#include "kernel.h" 20#include "kernel.h"
21#include "led.h" 21#include "led.h"
22#include "sh7034.h"
23#include "system.h"
22 24
23#define ATA_DATA (*((volatile unsigned short*)0x06104100)) 25#define ATA_DATA (*((volatile unsigned short*)0x06104100))
24#define ATA_ERROR (*((volatile unsigned char*)0x06100101)) 26#define ATA_ERROR (*((volatile unsigned char*)0x06100101))
@@ -92,7 +94,7 @@ int ata_read_sectors(unsigned long start,
92 if (!wait_for_rdy()) 94 if (!wait_for_rdy())
93 return 0; 95 return 0;
94 96
95 led_turn_on(); 97 led(TRUE);
96 98
97 ATA_NSECTOR = count; 99 ATA_NSECTOR = count;
98 ATA_SECTOR = start & 0xff; 100 ATA_SECTOR = start & 0xff;
@@ -115,11 +117,12 @@ int ata_read_sectors(unsigned long start,
115#endif 117#endif
116 } 118 }
117 119
118 led_turn_off(); 120 led(FALSE);
119 121
120 return wait_for_end_of_transfer(); 122 return wait_for_end_of_transfer();
121} 123}
122 124
125#ifdef DISK_WRITE
123int ata_write_sectors(unsigned long start, 126int ata_write_sectors(unsigned long start,
124 unsigned char count, 127 unsigned char count,
125 void* buf) 128 void* buf)
@@ -129,7 +132,7 @@ int ata_write_sectors(unsigned long start,
129 if (!wait_for_rdy()) 132 if (!wait_for_rdy())
130 return 0; 133 return 0;
131 134
132 led_turn_on (); 135 led(TRUE);
133 136
134 ATA_NSECTOR = count; 137 ATA_NSECTOR = count;
135 ATA_SECTOR = start & 0xff; 138 ATA_SECTOR = start & 0xff;
@@ -152,10 +155,11 @@ int ata_write_sectors(unsigned long start,
152#endif 155#endif
153 } 156 }
154 157
155 led_turn_off (); 158 led(FALSE);
156 159
157 return wait_for_end_of_transfer(); 160 return wait_for_end_of_transfer();
158} 161}
162#endif
159 163
160static int check_registers(void) 164static int check_registers(void)
161{ 165{
@@ -250,7 +254,7 @@ int ata_soft_reset(void)
250 254
251int ata_init(void) 255int ata_init(void)
252{ 256{
253 led_turn_off(); 257 led(FALSE);
254 258
255 /* activate ATA */ 259 /* activate ATA */
256 PADR |= 0x80; 260 PADR |= 0x80;