summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/config.h9
-rw-r--r--firmware/export/ramdisk.h53
-rw-r--r--firmware/export/storage.h31
3 files changed, 89 insertions, 4 deletions
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 1574d40040..914ac1ee9d 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -29,10 +29,11 @@
29/* symbolic names for multiple choice configurations: */ 29/* symbolic names for multiple choice configurations: */
30 30
31/* CONFIG_STORAGE (note these are combineable bit-flags) */ 31/* CONFIG_STORAGE (note these are combineable bit-flags) */
32#define STORAGE_ATA 0x01 32#define STORAGE_ATA 0x01
33#define STORAGE_MMC 0x02 33#define STORAGE_MMC 0x02
34#define STORAGE_SD 0x04 34#define STORAGE_SD 0x04
35#define STORAGE_NAND 0x08 35#define STORAGE_NAND 0x08
36#define STORAGE_RAMDISK 0x10
36 37
37/* CONFIG_TUNER (note these are combineable bit-flags) */ 38/* CONFIG_TUNER (note these are combineable bit-flags) */
38#define S1A0903X01 0x01 /* Samsung */ 39#define S1A0903X01 0x01 /* Samsung */
diff --git a/firmware/export/ramdisk.h b/firmware/export/ramdisk.h
new file mode 100644
index 0000000000..7fb8fb7cbc
--- /dev/null
+++ b/firmware/export/ramdisk.h
@@ -0,0 +1,53 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Alan Korr
11 * Copyright (C) 2008 by Frank Gevaerts
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22#ifndef __RAMDISK_H__
23#define __RAMDISK_H__
24
25#include <stdbool.h>
26#include "mv.h" /* for HAVE_MULTIVOLUME or not */
27
28struct storage_info;
29
30void ramdisk_enable(bool on);
31void ramdisk_spindown(int seconds);
32void ramdisk_sleep(void);
33bool ramdisk_disk_is_active(void);
34int ramdisk_hard_reset(void);
35int ramdisk_soft_reset(void);
36int ramdisk_init(void);
37void ramdisk_close(void);
38int ramdisk_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf);
39int ramdisk_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf);
40void ramdisk_spin(void);
41void ramdisk_sleepnow(void);
42
43#if (CONFIG_LED == LED_REAL)
44void ramdisk_set_led_enabled(bool enabled);
45#endif
46
47#ifdef STORAGE_GET_INFO
48void ramdisk_get_info(IF_MV2(int drive,) struct storage_info *info);
49#endif
50
51long ramdisk_last_disk_activity(void);
52
53#endif
diff --git a/firmware/export/storage.h b/firmware/export/storage.h
index d4e69163b7..4040fe952f 100644
--- a/firmware/export/storage.h
+++ b/firmware/export/storage.h
@@ -38,6 +38,9 @@
38#if (CONFIG_STORAGE & STORAGE_NAND) 38#if (CONFIG_STORAGE & STORAGE_NAND)
39#include "nand.h" 39#include "nand.h"
40#endif 40#endif
41#if (CONFIG_STORAGE & STORAGE_RAMDISK)
42#include "ramdisk.h"
43#endif
41 44
42struct storage_info 45struct storage_info
43{ 46{
@@ -165,6 +168,34 @@ struct storage_info
165 #define storage_removable(drive) nand_removable(IF_MV(drive)) 168 #define storage_removable(drive) nand_removable(IF_MV(drive))
166 #define storage_present(drive) nand_present(IF_MV(drive)) 169 #define storage_present(drive) nand_present(IF_MV(drive))
167 #endif 170 #endif
171 #elif (CONFIG_STORAGE & STORAGE_RAMDISK)
172 #define storage_spindown ramdisk_spindown
173 #define storage_sleep ramdisk_sleep
174 #define storage_spin ramdisk_spin
175
176 #define storage_enable(on) (void)0
177 #define storage_sleepnow() ramdisk_sleepnow()
178 #define storage_disk_is_active() 0
179 #define storage_hard_reset() (void)0
180 #define storage_soft_reset() (void)0
181 #define storage_init() ramdisk_init()
182 #define storage_close() ramdisk_close()
183 #define storage_read_sectors(drive, start, count, buf) ramdisk_read_sectors(IF_MV2(drive,) start, count, buf)
184 #define storage_write_sectors(drive, start, count, buf) ramdisk_write_sectors(IF_MV2(drive,) start, count, buf)
185 #define storage_last_disk_activity() ramdisk_last_disk_activity()
186 #define storage_spinup_time() 0
187 #define storage_get_identify() ramdisk_get_identify()
188
189 #if (CONFIG_LED == LED_REAL)
190 #define storage_set_led_enabled(enabled) ramdisk_set_led_enabled(enabled)
191 #endif
192 #ifdef STORAGE_GET_INFO
193 #define storage_get_info(drive, info) ramdisk_get_info(IF_MV2(drive,) info)
194 #endif
195 #ifdef HAVE_HOTSWAP
196 #define storage_removable(drive) ramdisk_removable(IF_MV(drive))
197 #define storage_present(drive) ramdisk_present(IF_MV(drive))
198 #endif
168 #else 199 #else
169 //#error No storage driver! 200 //#error No storage driver!
170 #endif 201 #endif