diff options
-rw-r--r-- | firmware/drivers/ata.c | 1 | ||||
-rw-r--r-- | firmware/export/ata-defines.h | 58 | ||||
-rw-r--r-- | firmware/export/ata.h | 34 | ||||
-rw-r--r-- | firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c | 1 | ||||
-rw-r--r-- | firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c | 1 |
5 files changed, 61 insertions, 34 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 955fb594b2..b0c975efbb 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -33,6 +33,7 @@ | |||
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-target.h" |
36 | #include "ata-defines.h" | ||
36 | #include "storage.h" | 37 | #include "storage.h" |
37 | 38 | ||
38 | #define SECTOR_SIZE 512 | 39 | #define SECTOR_SIZE 512 |
diff --git a/firmware/export/ata-defines.h b/firmware/export/ata-defines.h new file mode 100644 index 0000000000..1650c9fa47 --- /dev/null +++ b/firmware/export/ata-defines.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: ata.h 28951 2011-01-02 23:02:55Z theseven $ | ||
9 | * | ||
10 | * Copyright (C) 2011 by Michael Sparmann | ||
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 | #ifndef __ATA_DEFINES_H__ | ||
22 | #define __ATA_DEFINES_H__ | ||
23 | |||
24 | #ifndef ATA_OUT8 | ||
25 | #define ATA_OUT8(reg, data) (reg) = (data) | ||
26 | #endif | ||
27 | #ifndef ATA_OUT16 | ||
28 | #define ATA_OUT16(reg, data) (reg) = (data) | ||
29 | #endif | ||
30 | #ifndef ATA_IN8 | ||
31 | #define ATA_IN8(reg) (reg) | ||
32 | #endif | ||
33 | #ifndef ATA_IN16 | ||
34 | #define ATA_IN16(reg) (reg) | ||
35 | #endif | ||
36 | #ifndef ATA_SWAP_IDENTIFY | ||
37 | #define ATA_SWAP_IDENTIFY(word) (word) | ||
38 | #endif | ||
39 | |||
40 | #define STATUS_BSY 0x80 | ||
41 | #define STATUS_RDY 0x40 | ||
42 | #define STATUS_DRQ 0x08 | ||
43 | #define STATUS_ERR 0x01 | ||
44 | #define STATUS_DF 0x20 | ||
45 | #define ERROR_IDNF 0x10 | ||
46 | #define ERROR_ABRT 0x04 | ||
47 | |||
48 | #define TEST_PATTERN1 0xa5 | ||
49 | #define TEST_PATTERN2 0x5a | ||
50 | #define TEST_PATTERN3 0xaa | ||
51 | #define TEST_PATTERN4 0x55 | ||
52 | |||
53 | #define ATA_FEATURE ATA_ERROR | ||
54 | |||
55 | #define ATA_STATUS ATA_COMMAND | ||
56 | #define ATA_ALT_STATUS ATA_CONTROL | ||
57 | |||
58 | #endif | ||
diff --git a/firmware/export/ata.h b/firmware/export/ata.h index c7bf85d274..5be32da231 100644 --- a/firmware/export/ata.h +++ b/firmware/export/ata.h | |||
@@ -25,40 +25,6 @@ | |||
25 | #include "config.h" /* for HAVE_MULTIVOLUME or not */ | 25 | #include "config.h" /* for HAVE_MULTIVOLUME or not */ |
26 | #include "mv.h" /* for IF_MV() and friends */ | 26 | #include "mv.h" /* for IF_MV() and friends */ |
27 | 27 | ||
28 | #ifndef ATA_OUT8 | ||
29 | #define ATA_OUT8(reg, data) (reg) = (data) | ||
30 | #endif | ||
31 | #ifndef ATA_OUT16 | ||
32 | #define ATA_OUT16(reg, data) (reg) = (data) | ||
33 | #endif | ||
34 | #ifndef ATA_IN8 | ||
35 | #define ATA_IN8(reg) (reg) | ||
36 | #endif | ||
37 | #ifndef ATA_IN16 | ||
38 | #define ATA_IN16(reg) (reg) | ||
39 | #endif | ||
40 | #ifndef ATA_SWAP_IDENTIFY | ||
41 | #define ATA_SWAP_IDENTIFY(word) (word) | ||
42 | #endif | ||
43 | |||
44 | #define STATUS_BSY 0x80 | ||
45 | #define STATUS_RDY 0x40 | ||
46 | #define STATUS_DRQ 0x08 | ||
47 | #define STATUS_ERR 0x01 | ||
48 | #define STATUS_DF 0x20 | ||
49 | #define ERROR_IDNF 0x10 | ||
50 | #define ERROR_ABRT 0x04 | ||
51 | |||
52 | #define TEST_PATTERN1 0xa5 | ||
53 | #define TEST_PATTERN2 0x5a | ||
54 | #define TEST_PATTERN3 0xaa | ||
55 | #define TEST_PATTERN4 0x55 | ||
56 | |||
57 | #define ATA_FEATURE ATA_ERROR | ||
58 | |||
59 | #define ATA_STATUS ATA_COMMAND | ||
60 | #define ATA_ALT_STATUS ATA_CONTROL | ||
61 | |||
62 | struct storage_info; | 28 | struct storage_info; |
63 | 29 | ||
64 | void ata_enable(bool on); | 30 | void ata_enable(bool on); |
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c index 2885995f8c..afb8d5cf62 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "string.h" | 32 | #include "string.h" |
33 | #include "buffer.h" | 33 | #include "buffer.h" |
34 | #include "logf.h" | 34 | #include "logf.h" |
35 | #include "ata-defines.h" | ||
35 | 36 | ||
36 | #undef ata_read_sectors | 37 | #undef ata_read_sectors |
37 | #undef ata_write_sectors | 38 | #undef ata_write_sectors |
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c index 0e4b74fd77..d1408fee70 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/dma-creativezvm.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "dm320.h" | 27 | #include "dm320.h" |
28 | #include "ata.h" | 28 | #include "ata.h" |
29 | #include "ata-target.h" | 29 | #include "ata-target.h" |
30 | #include "ata-defines.h" | ||
30 | #include <stdbool.h> | 31 | #include <stdbool.h> |
31 | 32 | ||
32 | #define CS1_START 0x50000000 | 33 | #define CS1_START 0x50000000 |