diff options
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r-- | firmware/drivers/ata.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 349f76c0ec..91aae158c6 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -98,8 +98,8 @@ static int perform_soft_reset(void); | |||
98 | static int set_multiple_mode(int sectors); | 98 | static int set_multiple_mode(int sectors); |
99 | static int set_features(void); | 99 | static int set_features(void); |
100 | 100 | ||
101 | static int wait_for_bsy(void) ICODE_ATTR; | 101 | STATICIRAM int wait_for_bsy(void) ICODE_ATTR; |
102 | static int wait_for_bsy(void) | 102 | STATICIRAM int wait_for_bsy(void) |
103 | { | 103 | { |
104 | long timeout = current_tick + HZ*30; | 104 | long timeout = current_tick + HZ*30; |
105 | while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) { | 105 | while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) { |
@@ -113,8 +113,8 @@ static int wait_for_bsy(void) | |||
113 | return 0; /* timeout */ | 113 | return 0; /* timeout */ |
114 | } | 114 | } |
115 | 115 | ||
116 | static int wait_for_rdy(void) ICODE_ATTR; | 116 | STATICIRAM int wait_for_rdy(void) ICODE_ATTR; |
117 | static int wait_for_rdy(void) | 117 | STATICIRAM int wait_for_rdy(void) |
118 | { | 118 | { |
119 | long timeout; | 119 | long timeout; |
120 | 120 | ||
@@ -135,8 +135,8 @@ static int wait_for_rdy(void) | |||
135 | return 0; /* timeout */ | 135 | return 0; /* timeout */ |
136 | } | 136 | } |
137 | 137 | ||
138 | static int wait_for_start_of_transfer(void) ICODE_ATTR; | 138 | STATICIRAM int wait_for_start_of_transfer(void) ICODE_ATTR; |
139 | static int wait_for_start_of_transfer(void) | 139 | STATICIRAM int wait_for_start_of_transfer(void) |
140 | { | 140 | { |
141 | if (!wait_for_bsy()) | 141 | if (!wait_for_bsy()) |
142 | return 0; | 142 | return 0; |
@@ -144,8 +144,8 @@ static int wait_for_start_of_transfer(void) | |||
144 | return (ATA_ALT_STATUS & (STATUS_BSY|STATUS_DRQ)) == STATUS_DRQ; | 144 | return (ATA_ALT_STATUS & (STATUS_BSY|STATUS_DRQ)) == STATUS_DRQ; |
145 | } | 145 | } |
146 | 146 | ||
147 | static int wait_for_end_of_transfer(void) ICODE_ATTR; | 147 | STATICIRAM int wait_for_end_of_transfer(void) ICODE_ATTR; |
148 | static int wait_for_end_of_transfer(void) | 148 | STATICIRAM int wait_for_end_of_transfer(void) |
149 | { | 149 | { |
150 | if (!wait_for_bsy()) | 150 | if (!wait_for_bsy()) |
151 | return 0; | 151 | return 0; |
@@ -166,8 +166,8 @@ static void ata_led(bool on) | |||
166 | #endif | 166 | #endif |
167 | 167 | ||
168 | #ifndef ATA_OPTIMIZED_READING | 168 | #ifndef ATA_OPTIMIZED_READING |
169 | static void copy_read_sectors(unsigned char* buf, int wordcount) ICODE_ATTR; | 169 | STATICIRAM void copy_read_sectors(unsigned char* buf, int wordcount) ICODE_ATTR; |
170 | static void copy_read_sectors(unsigned char* buf, int wordcount) | 170 | STATICIRAM void copy_read_sectors(unsigned char* buf, int wordcount) |
171 | { | 171 | { |
172 | unsigned short tmp = 0; | 172 | unsigned short tmp = 0; |
173 | 173 | ||
@@ -365,8 +365,9 @@ int ata_read_sectors(IF_MV2(int drive,) | |||
365 | } | 365 | } |
366 | 366 | ||
367 | #ifndef ATA_OPTIMIZED_WRITING | 367 | #ifndef ATA_OPTIMIZED_WRITING |
368 | static void copy_write_sectors(const unsigned char* buf, int wordcount) ICODE_ATTR; | 368 | STATICIRAM void copy_write_sectors(const unsigned char* buf, int wordcount) |
369 | static void copy_write_sectors(const unsigned char* buf, int wordcount) | 369 | ICODE_ATTR; |
370 | STATICIRAM void copy_write_sectors(const unsigned char* buf, int wordcount) | ||
370 | { | 371 | { |
371 | if ( (unsigned long)buf & 1) | 372 | if ( (unsigned long)buf & 1) |
372 | { /* not 16-bit aligned, copy byte by byte */ | 373 | { /* not 16-bit aligned, copy byte by byte */ |