diff options
Diffstat (limited to 'firmware')
25 files changed, 98 insertions, 82 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 309a155eb6..f567a4bb8a 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include "power.h" | 32 | #include "power.h" |
33 | #include "string.h" | 33 | #include "string.h" |
34 | #include "ata_idle_notify.h" | 34 | #include "ata_idle_notify.h" |
35 | #include "ata-target.h" | 35 | #include "ata-driver.h" |
36 | #include "ata-defines.h" | 36 | #include "ata-defines.h" |
37 | #include "storage.h" | 37 | #include "storage.h" |
38 | 38 | ||
@@ -240,8 +240,6 @@ STATICIRAM ICODE_ATTR int wait_for_rdy(void) | |||
240 | return 0; /* timeout */ | 240 | return 0; /* timeout */ |
241 | } | 241 | } |
242 | #else | 242 | #else |
243 | extern int ata_wait_for_bsy(void); | ||
244 | extern int ata_wait_for_rdy(void); | ||
245 | #define wait_for_bsy ata_wait_for_bsy | 243 | #define wait_for_bsy ata_wait_for_bsy |
246 | #define wait_for_rdy ata_wait_for_rdy | 244 | #define wait_for_rdy ata_wait_for_rdy |
247 | #endif | 245 | #endif |
@@ -1265,7 +1263,7 @@ static int set_features(void) | |||
1265 | } | 1263 | } |
1266 | } | 1264 | } |
1267 | 1265 | ||
1268 | #ifdef ATA_SET_DEVICE_FEATURES | 1266 | #ifdef ATA_SET_PIO_TIMING |
1269 | ata_set_pio_timings(pio_mode); | 1267 | ata_set_pio_timings(pio_mode); |
1270 | #endif | 1268 | #endif |
1271 | 1269 | ||
diff --git a/firmware/export/ata-driver.h b/firmware/export/ata-driver.h new file mode 100644 index 0000000000..8711b2145f --- /dev/null +++ b/firmware/export/ata-driver.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2011 by Boris Gjenero | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef __ATA_DRIVER_H__ | ||
23 | #define __ATA_DRIVER_H__ | ||
24 | |||
25 | #include "config.h" /* for HAVE_ATA_DMA */ | ||
26 | #include "ata-target.h" /* for other target-specific defines */ | ||
27 | |||
28 | /* Returns true if the interface hasn't been initialised yet */ | ||
29 | bool ata_is_coldstart(void); | ||
30 | /* Initializes the interface */ | ||
31 | void ata_device_init(void); | ||
32 | /* ata_enable(true) is used after ata_device_init() to enable the interface | ||
33 | * ata_enable(false) is used to disable the interface so | ||
34 | * an ATA to USB bridge chip can use it instead.*/ | ||
35 | void ata_enable(bool on); | ||
36 | /* ATA hard reset: pulse the RESET pin */ | ||
37 | void ata_reset(void); | ||
38 | |||
39 | /* Optional optimized target-specific PIO transfer */ | ||
40 | #ifdef ATA_OPTIMIZED_READING | ||
41 | void copy_read_sectors(unsigned char* buf, int wordcount); | ||
42 | #endif | ||
43 | #ifdef ATA_OPTIMIZED_WRITING | ||
44 | void copy_write_sectors(const unsigned char* buf, int wordcount); | ||
45 | #endif | ||
46 | |||
47 | /* Optional target-specific waiting */ | ||
48 | #ifdef ATA_TARGET_POLLING | ||
49 | int ata_wait_for_bsy(void); | ||
50 | int ata_wait_for_rdy(void); | ||
51 | #endif | ||
52 | |||
53 | /* Optional setting of controller timings for PIO mode */ | ||
54 | #ifdef ATA_SET_PIO_TIMING | ||
55 | void ata_set_pio_timings(int mode); | ||
56 | #endif | ||
57 | |||
58 | #ifdef HAVE_ATA_DMA | ||
59 | /* Used to update last disk activity time while waiting for DMA */ | ||
60 | void ata_keep_active(void); | ||
61 | /* Set DMA mode for ATA interface */ | ||
62 | void ata_dma_set_mode(unsigned char mode); | ||
63 | /* Sets up DMA transfer */ | ||
64 | bool ata_dma_setup(void *addr, unsigned long bytes, bool write); | ||
65 | /* Waits for DMA transfer completion */ | ||
66 | bool ata_dma_finish(void); | ||
67 | #endif /* HAVE_ATA_DMA */ | ||
68 | |||
69 | #endif /* __ATA_DRIVER_H__ */ | ||
diff --git a/firmware/export/ata.h b/firmware/export/ata.h index a3537812e5..41a2fd5c9f 100644 --- a/firmware/export/ata.h +++ b/firmware/export/ata.h | |||
@@ -65,16 +65,8 @@ long ata_last_disk_activity(void); | |||
65 | int ata_spinup_time(void); /* ticks */ | 65 | int ata_spinup_time(void); /* ticks */ |
66 | 66 | ||
67 | #ifdef HAVE_ATA_DMA | 67 | #ifdef HAVE_ATA_DMA |
68 | /* Needed to allow updating while waiting for DMA to complete */ | ||
69 | void ata_keep_active(void); | ||
70 | /* Returns current DMA mode */ | 68 | /* Returns current DMA mode */ |
71 | int ata_get_dma_mode(void); | 69 | int ata_get_dma_mode(void); |
72 | /* Set DMA mode for ATA interface */ | ||
73 | void ata_dma_set_mode(unsigned char mode); | ||
74 | /* Sets up DMA transfer */ | ||
75 | bool ata_dma_setup(void *addr, unsigned long bytes, bool write); | ||
76 | /* Waits for DMA transfer completion */ | ||
77 | bool ata_dma_finish(void); | ||
78 | #endif /* HAVE_ATA_DMA */ | 70 | #endif /* HAVE_ATA_DMA */ |
79 | 71 | ||
80 | #endif /* __ATA_H__ */ | 72 | #endif /* __ATA_H__ */ |
diff --git a/firmware/target/arm/archos/av300/ata-av300.c b/firmware/target/arm/archos/av300/ata-av300.c index 08bee15fe6..e8623e5f16 100644 --- a/firmware/target/arm/archos/av300/ata-av300.c +++ b/firmware/target/arm/archos/av300/ata-av300.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | #include <stdbool.h> | 31 | #include <stdbool.h> |
32 | #include "system.h" | 32 | #include "system.h" |
33 | #include "ata-target.h" | 33 | #include "ata-driver.h" |
34 | 34 | ||
35 | void ata_reset() | 35 | void ata_reset() |
36 | { | 36 | { |
diff --git a/firmware/target/arm/archos/av300/ata-target.h b/firmware/target/arm/archos/av300/ata-target.h index bc3a19a6b4..5732f17045 100644 --- a/firmware/target/arm/archos/av300/ata-target.h +++ b/firmware/target/arm/archos/av300/ata-target.h | |||
@@ -19,6 +19,9 @@ | |||
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #ifndef ATA_TARGET_H | ||
23 | #define ATA_TARGET_H | ||
24 | |||
22 | /* Plain C read & write loops */ | 25 | /* Plain C read & write loops */ |
23 | 26 | ||
24 | #define ATA_IOBASE 0x02400000 | 27 | #define ATA_IOBASE 0x02400000 |
@@ -33,7 +36,4 @@ | |||
33 | #define ATA_CONTROL (*((volatile unsigned char*)(ATA_IOBASE + 0x340))) | 36 | #define ATA_CONTROL (*((volatile unsigned char*)(ATA_IOBASE + 0x340))) |
34 | #define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x380))) | 37 | #define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x380))) |
35 | 38 | ||
36 | void ata_reset(void); | 39 | #endif /* ATA_TARGET_H */ |
37 | void ata_enable(bool on); | ||
38 | bool ata_is_coldstart(void); | ||
39 | void ata_device_init(void); | ||
diff --git a/firmware/target/arm/ata-pp5002.c b/firmware/target/arm/ata-pp5002.c index 2c4bb3b3bc..5ab0e9ddc7 100644 --- a/firmware/target/arm/ata-pp5002.c +++ b/firmware/target/arm/ata-pp5002.c | |||
@@ -23,8 +23,7 @@ | |||
23 | 23 | ||
24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
25 | #include "system.h" | 25 | #include "system.h" |
26 | #include "ata.h" | 26 | #include "ata-driver.h" |
27 | #include "ata-target.h" | ||
28 | 27 | ||
29 | void ata_reset() | 28 | void ata_reset() |
30 | { | 29 | { |
diff --git a/firmware/target/arm/ata-pp5020.c b/firmware/target/arm/ata-pp5020.c index 0eb64351f2..50e6e27c98 100644 --- a/firmware/target/arm/ata-pp5020.c +++ b/firmware/target/arm/ata-pp5020.c | |||
@@ -23,8 +23,7 @@ | |||
23 | 23 | ||
24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
25 | #include "system.h" | 25 | #include "system.h" |
26 | #include "ata.h" | 26 | #include "ata-driver.h" |
27 | #include "ata-target.h" | ||
28 | 27 | ||
29 | void ata_reset() | 28 | void ata_reset() |
30 | { | 29 | { |
diff --git a/firmware/target/arm/ata-target.h b/firmware/target/arm/ata-target.h index 779ebed070..616c451579 100644 --- a/firmware/target/arm/ata-target.h +++ b/firmware/target/arm/ata-target.h | |||
@@ -19,6 +19,11 @@ | |||
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #ifndef ATA_TARGET_H | ||
23 | #define ATA_TARGET_H | ||
24 | |||
25 | #include "config.h" | ||
26 | |||
22 | #ifdef CPU_PP | 27 | #ifdef CPU_PP |
23 | 28 | ||
24 | #ifdef HAVE_BOOTLOADER_USB_MODE | 29 | #ifdef HAVE_BOOTLOADER_USB_MODE |
@@ -49,17 +54,11 @@ | |||
49 | /* asm optimized reading and writing */ | 54 | /* asm optimized reading and writing */ |
50 | #define ATA_OPTIMIZED_READING | 55 | #define ATA_OPTIMIZED_READING |
51 | #define ATA_OPTIMIZED_WRITING | 56 | #define ATA_OPTIMIZED_WRITING |
52 | void copy_read_sectors(unsigned char* buf, int wordcount); | ||
53 | void copy_write_sectors(const unsigned char* buf, int wordcount); | ||
54 | 57 | ||
55 | #endif /* CONFIG_CPU */ | 58 | #endif /* CONFIG_CPU */ |
56 | 59 | ||
57 | #endif | 60 | #endif |
58 | 61 | ||
59 | void ata_reset(void); | ||
60 | bool ata_is_coldstart(void); | ||
61 | void ata_device_init(void); | ||
62 | |||
63 | #ifdef HAVE_ATA_DMA | 62 | #ifdef HAVE_ATA_DMA |
64 | 63 | ||
65 | /* IDE DMA controller registers */ | 64 | /* IDE DMA controller registers */ |
@@ -88,8 +87,6 @@ void ata_device_init(void); | |||
88 | #define ATA_MAX_UDMA 1 | 87 | #define ATA_MAX_UDMA 1 |
89 | #endif | 88 | #endif |
90 | 89 | ||
91 | void ata_dma_set_mode(unsigned char mode); | ||
92 | bool ata_dma_setup(void *addr, unsigned long bytes, bool write); | ||
93 | bool ata_dma_finish(void); | ||
94 | |||
95 | #endif /* HAVE_ATA_DMA */ | 90 | #endif /* HAVE_ATA_DMA */ |
91 | |||
92 | #endif /* ATA_TARGET_H */ | ||
diff --git a/firmware/target/arm/imx31/ata-imx31.c b/firmware/target/arm/imx31/ata-imx31.c index 8a40c924ff..80539b9c9d 100644 --- a/firmware/target/arm/imx31/ata-imx31.c +++ b/firmware/target/arm/imx31/ata-imx31.c | |||
@@ -25,9 +25,8 @@ | |||
25 | #include "system.h" | 25 | #include "system.h" |
26 | #include "power.h" | 26 | #include "power.h" |
27 | #include "panic.h" | 27 | #include "panic.h" |
28 | #include "ata.h" | 28 | #include "ata-driver.h" |
29 | #include "ata-defines.h" | 29 | #include "ata-defines.h" |
30 | #include "ata-target.h" | ||
31 | #include "ccm-imx31.h" | 30 | #include "ccm-imx31.h" |
32 | #ifdef HAVE_ATA_DMA | 31 | #ifdef HAVE_ATA_DMA |
33 | #include "sdma-imx31.h" | 32 | #include "sdma-imx31.h" |
diff --git a/firmware/target/arm/imx31/ata-target.h b/firmware/target/arm/imx31/ata-target.h index 24141c6aa7..6893e83198 100644 --- a/firmware/target/arm/imx31/ata-target.h +++ b/firmware/target/arm/imx31/ata-target.h | |||
@@ -21,6 +21,8 @@ | |||
21 | #ifndef ATA_TARGET_H | 21 | #ifndef ATA_TARGET_H |
22 | #define ATA_TARGET_H | 22 | #define ATA_TARGET_H |
23 | 23 | ||
24 | #include "config.h" | ||
25 | |||
24 | #ifdef BOOTLOADER | 26 | #ifdef BOOTLOADER |
25 | #define ATA_DRIVER_CLOSE | 27 | #define ATA_DRIVER_CLOSE |
26 | #endif | 28 | #endif |
@@ -46,12 +48,8 @@ | |||
46 | #define ATA_COMMAND ATA_DRIVE_COMMAND | 48 | #define ATA_COMMAND ATA_DRIVE_COMMAND |
47 | #define ATA_CONTROL ATA_DRIVE_CONTROL | 49 | #define ATA_CONTROL ATA_DRIVE_CONTROL |
48 | 50 | ||
49 | void ata_reset(void); | ||
50 | void ata_device_init(void); | ||
51 | bool ata_is_coldstart(void); | ||
52 | 51 | ||
53 | #define ATA_SET_DEVICE_FEATURES | 52 | #define ATA_SET_PIO_TIMING |
54 | void ata_set_pio_timings(int mode); | ||
55 | 53 | ||
56 | #define ATA_TARGET_POLLING | 54 | #define ATA_TARGET_POLLING |
57 | 55 | ||
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c index 8cd0260fe4..89b00bbd1d 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c | |||
@@ -26,8 +26,7 @@ | |||
26 | #include "power.h" | 26 | #include "power.h" |
27 | #include "panic.h" | 27 | #include "panic.h" |
28 | #include "pcf50606.h" | 28 | #include "pcf50606.h" |
29 | #include "ata.h" | 29 | #include "ata-driver.h" |
30 | #include "ata-target.h" | ||
31 | #include "backlight-target.h" | 30 | #include "backlight-target.h" |
32 | 31 | ||
33 | /* ARESET on C7C68300 and RESET on ATA interface (Active Low) */ | 32 | /* ARESET on C7C68300 and RESET on ATA interface (Active Low) */ |
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/ata-target.h b/firmware/target/arm/s3c2440/gigabeat-fx/ata-target.h index 95cbaa11cf..7ca7d77c4f 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/ata-target.h +++ b/firmware/target/arm/s3c2440/gigabeat-fx/ata-target.h | |||
@@ -30,7 +30,6 @@ | |||
30 | #define PREFER_C_WRITING | 30 | #define PREFER_C_WRITING |
31 | #if !defined(BOOTLOADER) | 31 | #if !defined(BOOTLOADER) |
32 | #define ATA_OPTIMIZED_READING | 32 | #define ATA_OPTIMIZED_READING |
33 | void copy_read_sectors(unsigned char* buf, int wordcount); | ||
34 | #endif | 33 | #endif |
35 | 34 | ||
36 | #define ATA_IOBASE 0x18000000 | 35 | #define ATA_IOBASE 0x18000000 |
@@ -44,8 +43,5 @@ void copy_read_sectors(unsigned char* buf, int wordcount); | |||
44 | #define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x0E))) | 43 | #define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x0E))) |
45 | #define ATA_CONTROL (*((volatile unsigned char*)(0x20000000 + 0x1C))) | 44 | #define ATA_CONTROL (*((volatile unsigned char*)(0x20000000 + 0x1C))) |
46 | 45 | ||
47 | void ata_reset(void); | ||
48 | void ata_device_init(void); | ||
49 | bool ata_is_coldstart(void); | ||
50 | 46 | ||
51 | #endif | 47 | #endif |
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c index ad10502f2d..4ff39e2a9e 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include "system.h" | 26 | #include "system.h" |
27 | #include "power.h" | 27 | #include "power.h" |
28 | #include "panic.h" | 28 | #include "panic.h" |
29 | #include "ata-target.h" | 29 | #include "ata-driver.h" |
30 | #include "dm320.h" | 30 | #include "dm320.h" |
31 | #include "ata.h" | 31 | #include "ata.h" |
32 | #include "string.h" | 32 | #include "string.h" |
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h b/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h index 1a1648983d..5b66d192a5 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h +++ b/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h | |||
@@ -32,8 +32,6 @@ | |||
32 | #define copy_read_sectors dma_ata_read | 32 | #define copy_read_sectors dma_ata_read |
33 | #define copy_write_sectors dma_ata_write | 33 | #define copy_write_sectors dma_ata_write |
34 | */ | 34 | */ |
35 | void copy_read_sectors(const unsigned char* buf, int wordcount); | ||
36 | void copy_write_sectors(const unsigned char* buf, int wordcount); | ||
37 | 35 | ||
38 | /* Nasty hack, but Creative is nasty... */ | 36 | /* Nasty hack, but Creative is nasty... */ |
39 | #define ata_read_sectors _ata_read_sectors | 37 | #define ata_read_sectors _ata_read_sectors |
@@ -53,10 +51,6 @@ extern int _ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, | |||
53 | #define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE+0xE))) | 51 | #define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE+0xE))) |
54 | #define ATA_CONTROL (*((volatile unsigned char*)(ATA_IOBASE+0x800C))) | 52 | #define ATA_CONTROL (*((volatile unsigned char*)(ATA_IOBASE+0x800C))) |
55 | 53 | ||
56 | void ata_reset(void); | ||
57 | void ata_device_init(void); | ||
58 | bool ata_is_coldstart(void); | ||
59 | void ide_power_enable(bool on); | ||
60 | #ifdef BOOTLOADER | 54 | #ifdef BOOTLOADER |
61 | int load_minifs_file(char* filename, unsigned char* location); | 55 | int load_minifs_file(char* filename, unsigned char* location); |
62 | #endif | 56 | #endif |
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c index 6a74ff5e57..418a28ff09 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include "dma-target.h" | 26 | #include "dma-target.h" |
27 | #include "dm320.h" | 27 | #include "dm320.h" |
28 | #include "ata.h" | 28 | #include "ata.h" |
29 | #include "ata-target.h" | 29 | #include "ata-driver.h" |
30 | #include "ata-defines.h" | 30 | #include "ata-defines.h" |
31 | #include <stdbool.h> | 31 | #include <stdbool.h> |
32 | 32 | ||
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/ata-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/ata-mr500.c index 59f8464d76..1abe0843b3 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/ata-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/ata-mr500.c | |||
@@ -27,8 +27,7 @@ | |||
27 | #include "power.h" | 27 | #include "power.h" |
28 | #include "panic.h" | 28 | #include "panic.h" |
29 | #include "pcf50606.h" | 29 | #include "pcf50606.h" |
30 | #include "ata.h" | 30 | #include "ata-driver.h" |
31 | #include "ata-target.h" | ||
32 | #include "backlight-target.h" | 31 | #include "backlight-target.h" |
33 | 32 | ||
34 | /* ARESET on C7C68300 and RESET on ATA interface (Active Low) */ | 33 | /* ARESET on C7C68300 and RESET on ATA interface (Active Low) */ |
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/ata-target.h b/firmware/target/arm/tms320dm320/mrobe-500/ata-target.h index ca75876259..564ff3031f 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/ata-target.h +++ b/firmware/target/arm/tms320dm320/mrobe-500/ata-target.h | |||
@@ -31,8 +31,6 @@ | |||
31 | #define ATA_OPTIMIZED_READING | 31 | #define ATA_OPTIMIZED_READING |
32 | #define ATA_OPTIMIZED_WRITING | 32 | #define ATA_OPTIMIZED_WRITING |
33 | 33 | ||
34 | void copy_read_sectors(const unsigned char* buf, int wordcount); | ||
35 | void copy_write_sectors(const unsigned char* buf, int wordcount); | ||
36 | #endif | 34 | #endif |
37 | 35 | ||
38 | #define ATA_IOBASE 0x50000000 | 36 | #define ATA_IOBASE 0x50000000 |
@@ -49,8 +47,5 @@ void copy_write_sectors(const unsigned char* buf, int wordcount); | |||
49 | #define ATA_COMMAND (*((volatile unsigned char*)(REGISTER_OFFSET + (0x07 << IDE_SHIFT)))) | 47 | #define ATA_COMMAND (*((volatile unsigned char*)(REGISTER_OFFSET + (0x07 << IDE_SHIFT)))) |
50 | #define ATA_CONTROL (*((volatile unsigned char*)(CONTROL_OFFSET + (0x06 << IDE_SHIFT)))) | 48 | #define ATA_CONTROL (*((volatile unsigned char*)(CONTROL_OFFSET + (0x06 << IDE_SHIFT)))) |
51 | 49 | ||
52 | void ata_reset(void); | ||
53 | void ata_device_init(void); | ||
54 | bool ata_is_coldstart(void); | ||
55 | 50 | ||
56 | #endif | 51 | #endif |
diff --git a/firmware/target/coldfire/ata-target.h b/firmware/target/coldfire/ata-target.h index 1a223e1eae..405dbcafe5 100644 --- a/firmware/target/coldfire/ata-target.h +++ b/firmware/target/coldfire/ata-target.h | |||
@@ -42,11 +42,5 @@ | |||
42 | #define ATA_IN8(reg) ((reg) >> 8) | 42 | #define ATA_IN8(reg) ((reg) >> 8) |
43 | #define ATA_IN16(reg) (swap16(reg)) | 43 | #define ATA_IN16(reg) (swap16(reg)) |
44 | 44 | ||
45 | void ata_reset(void); | ||
46 | void ata_enable(bool on); | ||
47 | void ata_device_init(void); | ||
48 | bool ata_is_coldstart(void); | ||
49 | 45 | ||
50 | void copy_read_sectors(unsigned char* buf, int wordcount); | ||
51 | void copy_write_sectors(const unsigned char* buf, int wordcount); | ||
52 | #endif | 46 | #endif |
diff --git a/firmware/target/coldfire/iaudio/ata-iaudio.c b/firmware/target/coldfire/iaudio/ata-iaudio.c index 4a70456ed2..91b6c87093 100644 --- a/firmware/target/coldfire/iaudio/ata-iaudio.c +++ b/firmware/target/coldfire/iaudio/ata-iaudio.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include "system.h" | 25 | #include "system.h" |
26 | #include "power.h" | 26 | #include "power.h" |
27 | #include "pcf50606.h" | 27 | #include "pcf50606.h" |
28 | #include "ata-target.h" | 28 | #include "ata-driver.h" |
29 | 29 | ||
30 | void ata_reset(void) | 30 | void ata_reset(void) |
31 | { | 31 | { |
diff --git a/firmware/target/coldfire/iaudio/m3/ata-m3.c b/firmware/target/coldfire/iaudio/m3/ata-m3.c index d82ca5a857..b3630798cf 100644 --- a/firmware/target/coldfire/iaudio/m3/ata-m3.c +++ b/firmware/target/coldfire/iaudio/m3/ata-m3.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include "kernel.h" | 25 | #include "kernel.h" |
26 | #include "system.h" | 26 | #include "system.h" |
27 | #include "power.h" | 27 | #include "power.h" |
28 | #include "ata-target.h" | 28 | #include "ata-driver.h" |
29 | 29 | ||
30 | void ata_reset(void) | 30 | void ata_reset(void) |
31 | { | 31 | { |
diff --git a/firmware/target/coldfire/iriver/ata-iriver.c b/firmware/target/coldfire/iriver/ata-iriver.c index d16943172c..1b8f475c4c 100644 --- a/firmware/target/coldfire/iriver/ata-iriver.c +++ b/firmware/target/coldfire/iriver/ata-iriver.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include "system.h" | 25 | #include "system.h" |
26 | #include "power.h" | 26 | #include "power.h" |
27 | #include "pcf50606.h" | 27 | #include "pcf50606.h" |
28 | #include "ata-target.h" | 28 | #include "ata-driver.h" |
29 | 29 | ||
30 | void ata_reset(void) | 30 | void ata_reset(void) |
31 | { | 31 | { |
diff --git a/firmware/target/coldfire/mpio/ata-mpio.c b/firmware/target/coldfire/mpio/ata-mpio.c index cf4276b5a0..af082640bf 100644 --- a/firmware/target/coldfire/mpio/ata-mpio.c +++ b/firmware/target/coldfire/mpio/ata-mpio.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include "kernel.h" | 25 | #include "kernel.h" |
26 | #include "system.h" | 26 | #include "system.h" |
27 | #include "power.h" | 27 | #include "power.h" |
28 | #include "ata-target.h" | 28 | #include "ata-driver.h" |
29 | 29 | ||
30 | void ata_reset(void) | 30 | void ata_reset(void) |
31 | { | 31 | { |
diff --git a/firmware/target/coldfire/mpio/ata-target.h b/firmware/target/coldfire/mpio/ata-target.h index b2c8f15417..095a7fc1bd 100644 --- a/firmware/target/coldfire/mpio/ata-target.h +++ b/firmware/target/coldfire/mpio/ata-target.h | |||
@@ -36,11 +36,5 @@ | |||
36 | #define ATA_SELECT (*((volatile unsigned short*)(ATA_IOBASE + 0x2c))) | 36 | #define ATA_SELECT (*((volatile unsigned short*)(ATA_IOBASE + 0x2c))) |
37 | #define ATA_COMMAND (*((volatile unsigned short*)(ATA_IOBASE + 0x2e))) | 37 | #define ATA_COMMAND (*((volatile unsigned short*)(ATA_IOBASE + 0x2e))) |
38 | 38 | ||
39 | void ata_reset(void); | ||
40 | void ata_enable(bool on); | ||
41 | void ata_device_init(void); | ||
42 | bool ata_is_coldstart(void); | ||
43 | 39 | ||
44 | void copy_read_sectors(unsigned char* buf, int wordcount); | ||
45 | void copy_write_sectors(const unsigned char* buf, int wordcount); | ||
46 | #endif | 40 | #endif |
diff --git a/firmware/target/sh/archos/ata-archos.c b/firmware/target/sh/archos/ata-archos.c index 6b58481b8b..2046d3b33f 100644 --- a/firmware/target/sh/archos/ata-archos.c +++ b/firmware/target/sh/archos/ata-archos.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
25 | #include "kernel.h" | 25 | #include "kernel.h" |
26 | #include "system.h" | 26 | #include "system.h" |
27 | #include "ata-target.h" | 27 | #include "ata-driver.h" |
28 | #include "hwcompat.h" | 28 | #include "hwcompat.h" |
29 | 29 | ||
30 | #define ATA_CONTROL1 ((volatile unsigned char*)0x06200206) | 30 | #define ATA_CONTROL1 ((volatile unsigned char*)0x06200206) |
diff --git a/firmware/target/sh/archos/ata-target.h b/firmware/target/sh/archos/ata-target.h index fb343f4df4..dc55cdd5d5 100644 --- a/firmware/target/sh/archos/ata-target.h +++ b/firmware/target/sh/archos/ata-target.h | |||
@@ -41,11 +41,5 @@ | |||
41 | 41 | ||
42 | extern volatile unsigned char* ata_control; | 42 | extern volatile unsigned char* ata_control; |
43 | 43 | ||
44 | void ata_reset(void); | ||
45 | void ata_enable(bool on); | ||
46 | void ata_device_init(void); | ||
47 | bool ata_is_coldstart(void); | ||
48 | 44 | ||
49 | void copy_read_sectors(unsigned char* buf, int wordcount); | ||
50 | void copy_write_sectors(const unsigned char* buf, int wordcount); | ||
51 | #endif | 45 | #endif |