diff options
Diffstat (limited to 'firmware/target/arm/s5l8702')
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c | 64 | ||||
-rw-r--r-- | firmware/target/arm/s5l8702/system-s5l8702.c | 2 |
3 files changed, 36 insertions, 32 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c index 0ad9da22bb..c9719afa60 100644 --- a/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c +++ b/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c | |||
@@ -140,10 +140,12 @@ void lcd_shutdown(void) | |||
140 | mutex_unlock(&lcd_mutex); | 140 | mutex_unlock(&lcd_mutex); |
141 | } | 141 | } |
142 | 142 | ||
143 | #ifdef HAVE_LCD_SLEEP | ||
143 | void lcd_sleep(void) | 144 | void lcd_sleep(void) |
144 | { | 145 | { |
145 | lcd_shutdown(); | 146 | lcd_shutdown(); |
146 | } | 147 | } |
148 | #endif | ||
147 | 149 | ||
148 | /* LCD init */ | 150 | /* LCD init */ |
149 | void lcd_init_device(void) | 151 | void lcd_init_device(void) |
diff --git a/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c index 3bf81571fe..42fa0c2e75 100644 --- a/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c +++ b/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c | |||
@@ -47,12 +47,12 @@ | |||
47 | 47 | ||
48 | /** static, private data **/ | 48 | /** static, private data **/ |
49 | static uint8_t ceata_taskfile[16] __attribute__((aligned(16))); | 49 | static uint8_t ceata_taskfile[16] __attribute__((aligned(16))); |
50 | uint16_t ata_identify_data[0x100] __attribute__((aligned(16))); | 50 | static uint16_t ata_identify_data[0x100] __attribute__((aligned(16))); |
51 | bool ceata; | 51 | static bool ceata; |
52 | bool ata_lba48; | 52 | static bool ata_lba48; |
53 | bool ata_dma; | 53 | static bool ata_dma; |
54 | uint64_t ata_total_sectors; | 54 | static uint64_t ata_total_sectors; |
55 | struct mutex ata_mutex; | 55 | static struct mutex ata_mutex; |
56 | static struct semaphore ata_wakeup; | 56 | static struct semaphore ata_wakeup; |
57 | static uint32_t ata_dma_flags; | 57 | static uint32_t ata_dma_flags; |
58 | static long ata_last_activity_value = -1; | 58 | static long ata_last_activity_value = -1; |
@@ -151,7 +151,7 @@ static int ata_wait_for_end_of_transfer(long timeout) | |||
151 | RET_ERR(2); | 151 | RET_ERR(2); |
152 | } | 152 | } |
153 | 153 | ||
154 | int mmc_dsta_check_command_success(bool disable_crc) | 154 | static int mmc_dsta_check_command_success(bool disable_crc) |
155 | { | 155 | { |
156 | int rc = 0; | 156 | int rc = 0; |
157 | uint32_t dsta = SDCI_DSTA; | 157 | uint32_t dsta = SDCI_DSTA; |
@@ -165,7 +165,7 @@ int mmc_dsta_check_command_success(bool disable_crc) | |||
165 | return 0; | 165 | return 0; |
166 | } | 166 | } |
167 | 167 | ||
168 | bool mmc_send_command(uint32_t cmd, uint32_t arg, uint32_t* result, int timeout) | 168 | static bool mmc_send_command(uint32_t cmd, uint32_t arg, uint32_t* result, int timeout) |
169 | { | 169 | { |
170 | long starttime = USEC_TIMER; | 170 | long starttime = USEC_TIMER; |
171 | while ((SDCI_STATE & SDCI_STATE_CMD_STATE_MASK) != SDCI_STATE_CMD_STATE_CMD_IDLE) | 171 | while ((SDCI_STATE & SDCI_STATE_CMD_STATE_MASK) != SDCI_STATE_CMD_STATE_CMD_IDLE) |
@@ -214,7 +214,7 @@ bool mmc_send_command(uint32_t cmd, uint32_t arg, uint32_t* result, int timeout) | |||
214 | return 0; | 214 | return 0; |
215 | } | 215 | } |
216 | 216 | ||
217 | int mmc_get_card_status(uint32_t* result) | 217 | static int mmc_get_card_status(uint32_t* result) |
218 | { | 218 | { |
219 | return mmc_send_command(SDCI_CMD_CMD_NUM(MMC_CMD_SEND_STATUS) | 219 | return mmc_send_command(SDCI_CMD_CMD_NUM(MMC_CMD_SEND_STATUS) |
220 | | SDCI_CMD_CMD_TYPE_AC | SDCI_CMD_RES_TYPE_R1 | 220 | | SDCI_CMD_CMD_TYPE_AC | SDCI_CMD_RES_TYPE_R1 |
@@ -222,7 +222,7 @@ int mmc_get_card_status(uint32_t* result) | |||
222 | MMC_CMD_SEND_STATUS_RCA(CEATA_MMC_RCA), result, CEATA_COMMAND_TIMEOUT); | 222 | MMC_CMD_SEND_STATUS_RCA(CEATA_MMC_RCA), result, CEATA_COMMAND_TIMEOUT); |
223 | } | 223 | } |
224 | 224 | ||
225 | int mmc_init(void) | 225 | static int mmc_init(void) |
226 | { | 226 | { |
227 | sleep(HZ / 10); | 227 | sleep(HZ / 10); |
228 | PASS_RC(mmc_send_command(SDCI_CMD_CMD_NUM(MMC_CMD_GO_IDLE_STATE) | 228 | PASS_RC(mmc_send_command(SDCI_CMD_CMD_NUM(MMC_CMD_GO_IDLE_STATE) |
@@ -262,7 +262,7 @@ int mmc_init(void) | |||
262 | return 0; | 262 | return 0; |
263 | } | 263 | } |
264 | 264 | ||
265 | int mmc_fastio_write(uint32_t addr, uint32_t data) | 265 | static int mmc_fastio_write(uint32_t addr, uint32_t data) |
266 | { | 266 | { |
267 | return mmc_send_command(SDCI_CMD_CMD_NUM(MMC_CMD_FAST_IO) | 267 | return mmc_send_command(SDCI_CMD_CMD_NUM(MMC_CMD_FAST_IO) |
268 | | SDCI_CMD_CMD_TYPE_AC | SDCI_CMD_RES_TYPE_R4 | 268 | | SDCI_CMD_CMD_TYPE_AC | SDCI_CMD_RES_TYPE_R4 |
@@ -272,7 +272,7 @@ int mmc_fastio_write(uint32_t addr, uint32_t data) | |||
272 | NULL, CEATA_COMMAND_TIMEOUT); | 272 | NULL, CEATA_COMMAND_TIMEOUT); |
273 | } | 273 | } |
274 | 274 | ||
275 | int mmc_fastio_read(uint32_t addr, uint32_t* data) | 275 | static int mmc_fastio_read(uint32_t addr, uint32_t* data) |
276 | { | 276 | { |
277 | return mmc_send_command(SDCI_CMD_CMD_NUM(MMC_CMD_FAST_IO) | 277 | return mmc_send_command(SDCI_CMD_CMD_NUM(MMC_CMD_FAST_IO) |
278 | | SDCI_CMD_CMD_TYPE_AC | SDCI_CMD_RES_TYPE_R4 | 278 | | SDCI_CMD_CMD_TYPE_AC | SDCI_CMD_RES_TYPE_R4 |
@@ -281,7 +281,7 @@ int mmc_fastio_read(uint32_t addr, uint32_t* data) | |||
281 | | MMC_CMD_FAST_IO_ADDRESS(addr), data, CEATA_COMMAND_TIMEOUT); | 281 | | MMC_CMD_FAST_IO_ADDRESS(addr), data, CEATA_COMMAND_TIMEOUT); |
282 | } | 282 | } |
283 | 283 | ||
284 | int ceata_soft_reset(void) | 284 | static int ceata_soft_reset(void) |
285 | { | 285 | { |
286 | PASS_RC(mmc_fastio_write(6, 4), 2, 0); | 286 | PASS_RC(mmc_fastio_write(6, 4), 2, 0); |
287 | sleep(HZ / 100); | 287 | sleep(HZ / 100); |
@@ -299,7 +299,7 @@ int ceata_soft_reset(void) | |||
299 | return 0; | 299 | return 0; |
300 | } | 300 | } |
301 | 301 | ||
302 | int mmc_dsta_check_data_success(void) | 302 | static int mmc_dsta_check_data_success(void) |
303 | { | 303 | { |
304 | int rc = 0; | 304 | int rc = 0; |
305 | uint32_t dsta = SDCI_DSTA; | 305 | uint32_t dsta = SDCI_DSTA; |
@@ -318,14 +318,14 @@ int mmc_dsta_check_data_success(void) | |||
318 | return 0; | 318 | return 0; |
319 | } | 319 | } |
320 | 320 | ||
321 | void mmc_discard_irq(void) | 321 | static void mmc_discard_irq(void) |
322 | { | 322 | { |
323 | SDCI_IRQ = SDCI_IRQ_DAT_DONE_INT | SDCI_IRQ_MASK_MASK_IOCARD_IRQ_INT | 323 | SDCI_IRQ = SDCI_IRQ_DAT_DONE_INT | SDCI_IRQ_MASK_MASK_IOCARD_IRQ_INT |
324 | | SDCI_IRQ_MASK_MASK_READ_WAIT_INT; | 324 | | SDCI_IRQ_MASK_MASK_READ_WAIT_INT; |
325 | semaphore_wait(&mmc_wakeup, 0); | 325 | semaphore_wait(&mmc_wakeup, 0); |
326 | } | 326 | } |
327 | 327 | ||
328 | int ceata_read_multiple_register(uint32_t addr, void* dest, uint32_t size) | 328 | static int ceata_read_multiple_register(uint32_t addr, void* dest, uint32_t size) |
329 | { | 329 | { |
330 | if (size > 0x10) RET_ERR(0); | 330 | if (size > 0x10) RET_ERR(0); |
331 | mmc_discard_irq(); | 331 | mmc_discard_irq(); |
@@ -347,7 +347,7 @@ int ceata_read_multiple_register(uint32_t addr, void* dest, uint32_t size) | |||
347 | return 0; | 347 | return 0; |
348 | } | 348 | } |
349 | 349 | ||
350 | int ceata_write_multiple_register(uint32_t addr, void* dest, uint32_t size) | 350 | static int ceata_write_multiple_register(uint32_t addr, void* dest, uint32_t size) |
351 | { | 351 | { |
352 | uint32_t i; | 352 | uint32_t i; |
353 | if (size > 0x10) RET_ERR(0); | 353 | if (size > 0x10) RET_ERR(0); |
@@ -377,7 +377,7 @@ int ceata_write_multiple_register(uint32_t addr, void* dest, uint32_t size) | |||
377 | return 0; | 377 | return 0; |
378 | } | 378 | } |
379 | 379 | ||
380 | int ceata_init(int buswidth) | 380 | static int ceata_init(int buswidth) |
381 | { | 381 | { |
382 | uint32_t result; | 382 | uint32_t result; |
383 | PASS_RC(mmc_send_command(SDCI_CMD_CMD_NUM(MMC_CMD_SWITCH) | SDCI_CMD_RES_BUSY | 383 | PASS_RC(mmc_send_command(SDCI_CMD_CMD_NUM(MMC_CMD_SWITCH) | SDCI_CMD_RES_BUSY |
@@ -414,7 +414,7 @@ int ceata_init(int buswidth) | |||
414 | return 0; | 414 | return 0; |
415 | } | 415 | } |
416 | 416 | ||
417 | int ceata_check_error(void) | 417 | static int ceata_check_error(void) |
418 | { | 418 | { |
419 | uint32_t status, error; | 419 | uint32_t status, error; |
420 | PASS_RC(mmc_fastio_read(0xf, &status), 2, 0); | 420 | PASS_RC(mmc_fastio_read(0xf, &status), 2, 0); |
@@ -426,7 +426,7 @@ int ceata_check_error(void) | |||
426 | return 0; | 426 | return 0; |
427 | } | 427 | } |
428 | 428 | ||
429 | int ceata_wait_idle(void) | 429 | static int ceata_wait_idle(void) |
430 | { | 430 | { |
431 | long startusec = USEC_TIMER; | 431 | long startusec = USEC_TIMER; |
432 | while (true) | 432 | while (true) |
@@ -439,7 +439,7 @@ int ceata_wait_idle(void) | |||
439 | } | 439 | } |
440 | } | 440 | } |
441 | 441 | ||
442 | int ceata_cancel_command(void) | 442 | static int ceata_cancel_command(void) |
443 | { | 443 | { |
444 | *((uint32_t volatile*)0x3cf00200) = 0x9000e; | 444 | *((uint32_t volatile*)0x3cf00200) = 0x9000e; |
445 | udelay(1); | 445 | udelay(1); |
@@ -455,7 +455,7 @@ int ceata_cancel_command(void) | |||
455 | return 0; | 455 | return 0; |
456 | } | 456 | } |
457 | 457 | ||
458 | int ceata_rw_multiple_block(bool write, void* buf, uint32_t count, long timeout) | 458 | static int ceata_rw_multiple_block(bool write, void* buf, uint32_t count, long timeout) |
459 | { | 459 | { |
460 | mmc_discard_irq(); | 460 | mmc_discard_irq(); |
461 | uint32_t responsetype; | 461 | uint32_t responsetype; |
@@ -499,7 +499,7 @@ int ceata_rw_multiple_block(bool write, void* buf, uint32_t count, long timeout) | |||
499 | return 0; | 499 | return 0; |
500 | } | 500 | } |
501 | 501 | ||
502 | int ata_identify(uint16_t* buf) | 502 | static int ata_identify(uint16_t* buf) |
503 | { | 503 | { |
504 | int i; | 504 | int i; |
505 | if (ceata) | 505 | if (ceata) |
@@ -525,7 +525,7 @@ int ata_identify(uint16_t* buf) | |||
525 | return 0; | 525 | return 0; |
526 | } | 526 | } |
527 | 527 | ||
528 | void ata_set_active(void) | 528 | static void ata_set_active(void) |
529 | { | 529 | { |
530 | ata_last_activity_value = current_tick; | 530 | ata_last_activity_value = current_tick; |
531 | } | 531 | } |
@@ -535,7 +535,7 @@ bool ata_disk_is_active(void) | |||
535 | return ata_powered; | 535 | return ata_powered; |
536 | } | 536 | } |
537 | 537 | ||
538 | int ata_set_feature(uint32_t feature, uint32_t param) | 538 | static int ata_set_feature(uint32_t feature, uint32_t param) |
539 | { | 539 | { |
540 | PASS_RC(ata_wait_for_rdy(500000), 1, 0); | 540 | PASS_RC(ata_wait_for_rdy(500000), 1, 0); |
541 | ata_write_cbr(&ATA_PIO_DVR, 0); | 541 | ata_write_cbr(&ATA_PIO_DVR, 0); |
@@ -546,7 +546,7 @@ int ata_set_feature(uint32_t feature, uint32_t param) | |||
546 | return 0; | 546 | return 0; |
547 | } | 547 | } |
548 | 548 | ||
549 | int ata_power_up(void) | 549 | static int ata_power_up(void) |
550 | { | 550 | { |
551 | ata_set_active(); | 551 | ata_set_active(); |
552 | if (ata_powered) return 0; | 552 | if (ata_powered) return 0; |
@@ -664,7 +664,7 @@ int ata_power_up(void) | |||
664 | return 0; | 664 | return 0; |
665 | } | 665 | } |
666 | 666 | ||
667 | void ata_power_down(void) | 667 | static void ata_power_down(void) |
668 | { | 668 | { |
669 | if (!ata_powered) return; | 669 | if (!ata_powered) return; |
670 | ata_powered = false; | 670 | ata_powered = false; |
@@ -691,7 +691,7 @@ void ata_power_down(void) | |||
691 | ide_power_enable(false); | 691 | ide_power_enable(false); |
692 | } | 692 | } |
693 | 693 | ||
694 | int ata_rw_chunk_internal(uint64_t sector, uint32_t cnt, void* buffer, bool write) | 694 | static int ata_rw_chunk_internal(uint64_t sector, uint32_t cnt, void* buffer, bool write) |
695 | { | 695 | { |
696 | if (ceata) | 696 | if (ceata) |
697 | { | 697 | { |
@@ -790,7 +790,7 @@ int ata_rw_chunk_internal(uint64_t sector, uint32_t cnt, void* buffer, bool writ | |||
790 | return 0; | 790 | return 0; |
791 | } | 791 | } |
792 | 792 | ||
793 | int ata_rw_chunk(uint64_t sector, uint32_t cnt, void* buffer, bool write) | 793 | static int ata_rw_chunk(uint64_t sector, uint32_t cnt, void* buffer, bool write) |
794 | { | 794 | { |
795 | led(true); | 795 | led(true); |
796 | int rc = ata_rw_chunk_internal(sector, cnt, buffer, write); | 796 | int rc = ata_rw_chunk_internal(sector, cnt, buffer, write); |
@@ -851,7 +851,7 @@ int ata_bbt_translate(uint64_t sector, uint32_t count, uint64_t* phys, uint32_t* | |||
851 | } | 851 | } |
852 | #endif | 852 | #endif |
853 | 853 | ||
854 | int ata_rw_sectors(uint64_t sector, uint32_t count, void* buffer, bool write) | 854 | static int ata_rw_sectors(uint64_t sector, uint32_t count, void* buffer, bool write) |
855 | { | 855 | { |
856 | if (((uint32_t)buffer) & 0xf) | 856 | if (((uint32_t)buffer) & 0xf) |
857 | panicf("ATA: Misaligned data buffer at %08X (sector %lu, count %lu)", | 857 | panicf("ATA: Misaligned data buffer at %08X (sector %lu, count %lu)", |
@@ -1108,13 +1108,15 @@ int ata_init(void) | |||
1108 | return 0; | 1108 | return 0; |
1109 | } | 1109 | } |
1110 | 1110 | ||
1111 | int ata_num_drives(int first_drive) | 1111 | #ifdef CONFIG_STORAGE_MULTI |
1112 | static int ata_num_drives(int first_drive) | ||
1112 | { | 1113 | { |
1113 | /* We don't care which logical drive number(s) we have been assigned */ | 1114 | /* We don't care which logical drive number(s) we have been assigned */ |
1114 | (void)first_drive; | 1115 | (void)first_drive; |
1115 | 1116 | ||
1116 | return 1; | 1117 | return 1; |
1117 | } | 1118 | } |
1119 | #endif | ||
1118 | 1120 | ||
1119 | unsigned short* ata_get_identify(void) | 1121 | unsigned short* ata_get_identify(void) |
1120 | { | 1122 | { |
diff --git a/firmware/target/arm/s5l8702/system-s5l8702.c b/firmware/target/arm/s5l8702/system-s5l8702.c index e264e61e22..124f016118 100644 --- a/firmware/target/arm/s5l8702/system-s5l8702.c +++ b/firmware/target/arm/s5l8702/system-s5l8702.c | |||
@@ -119,7 +119,7 @@ default_interrupt(INT_IRQ62); | |||
119 | default_interrupt(INT_IRQ63); | 119 | default_interrupt(INT_IRQ63); |
120 | 120 | ||
121 | 121 | ||
122 | int current_irq; | 122 | static int current_irq; |
123 | 123 | ||
124 | 124 | ||
125 | void INT_TIMER(void) ICODE_ATTR; | 125 | void INT_TIMER(void) ICODE_ATTR; |