diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/ata-driver.h | 69 | ||||
-rw-r--r-- | firmware/export/ata.h | 8 |
2 files changed, 69 insertions, 8 deletions
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__ */ |