summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_jz47xx/ata-jz4740.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/ata-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/ata-jz4740.c104
1 files changed, 104 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/ata-jz4740.c b/firmware/target/mips/ingenic_jz47xx/ata-jz4740.c
new file mode 100644
index 0000000000..dd14a4c651
--- /dev/null
+++ b/firmware/target/mips/ingenic_jz47xx/ata-jz4740.c
@@ -0,0 +1,104 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Maurus Cuelenaere
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#include "config.h"
23#include "ata.h"
24#include "ata-sd-target.h"
25#include "ata-nand-target.h"
26#include "panic.h"
27
28int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf)
29{
30 switch(drive)
31 {
32 case 0:
33 return nand_read_sectors(start, count, buf);
34 case 1:
35 return sd_read_sectors(start, count, buf);
36 default:
37 panicf("ata_read_sectors: Drive %d unhandled!", drive);
38 return -1;
39 }
40}
41
42int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf)
43{
44 switch(drive)
45 {
46 case 0:
47 return nand_write_sectors(start, count, buf);
48 case 1:
49 return sd_write_sectors(start, count, buf);
50 default:
51 panicf("ata_write_sectors: Drive %d unhandled!", drive);
52 return -1;
53 }
54}
55
56int ata_init(void)
57{
58 if(sd_init() != 0)
59 return -1;
60 if(nand_init() != 0)
61 return -2;
62
63 return 0;
64}
65
66void ata_spindown(int seconds)
67{
68 /* null */
69 (void)seconds;
70}
71
72bool ata_disk_is_active(void)
73{
74 /* null */
75 return false;
76}
77
78void ata_sleep(void)
79{
80 /* null */
81}
82
83void ata_spin(void)
84{
85 /* null */
86}
87
88int ata_hard_reset(void)
89{
90 /* null */
91 return 0;
92}
93
94int ata_soft_reset(void)
95{
96 /* null */
97 return 0;
98}
99
100void ata_enable(bool on)
101{
102 /* null - flash controller is enabled/disabled as needed. */
103 (void)on;
104}