summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-10-31 21:25:04 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-10-31 21:25:04 +0000
commit19d1cacb1a63c306d842f81127d382512c49a062 (patch)
treebac051d18aae2c9f201744890177e0021e5269be
parent3aa58328080ab9a254d9f2329696fa4309a30d50 (diff)
downloadrockbox-19d1cacb1a63c306d842f81127d382512c49a062.tar.gz
rockbox-19d1cacb1a63c306d842f81127d382512c49a062.tar.bz2
rockbox-19d1cacb1a63c306d842f81127d382512c49a062.zip
cleanup storage defines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18950 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/debug_menu.c20
-rw-r--r--apps/main.c6
-rw-r--r--apps/misc.c4
-rw-r--r--apps/mpeg.c6
-rw-r--r--apps/mpeg.h2
-rw-r--r--apps/plugins/SOURCES3
-rw-r--r--apps/plugins/alpine_cdc.c4
-rw-r--r--apps/plugins/splitedit.c4
-rw-r--r--apps/plugins/test_disk.c2
-rw-r--r--apps/plugins/wavplay.c4
-rw-r--r--apps/plugins/wavrecord.c6
-rw-r--r--apps/screens.c8
-rw-r--r--apps/screens.h2
-rw-r--r--apps/talk.c10
-rw-r--r--bootloader/main-pp.c8
-rw-r--r--firmware/SOURCES17
-rw-r--r--firmware/drivers/fat.c2
-rw-r--r--firmware/drivers/serial.c4
-rw-r--r--firmware/export/ata_idle_notify.h3
-rw-r--r--firmware/export/config-c100.h4
-rw-r--r--firmware/export/config-c200.h2
-rw-r--r--firmware/export/config-clip.h2
-rw-r--r--firmware/export/config-cowond2.h4
-rw-r--r--firmware/export/config-creativezv.h2
-rw-r--r--firmware/export/config-creativezvm.h2
-rw-r--r--firmware/export/config-creativezvm60gb.h2
-rw-r--r--firmware/export/config-e200.h2
-rw-r--r--firmware/export/config-e200v2.h2
-rw-r--r--firmware/export/config-fmrecorder.h2
-rw-r--r--firmware/export/config-gigabeat-s.h2
-rw-r--r--firmware/export/config-gigabeat.h2
-rw-r--r--firmware/export/config-h10.h2
-rw-r--r--firmware/export/config-h100.h2
-rw-r--r--firmware/export/config-h10_5gb.h2
-rw-r--r--firmware/export/config-h120.h2
-rw-r--r--firmware/export/config-h300.h2
-rwxr-xr-xfirmware/export/config-hdd1630.h2
-rw-r--r--firmware/export/config-iaudio7.h4
-rw-r--r--firmware/export/config-iaudiom3.h2
-rw-r--r--firmware/export/config-iaudiom5.h2
-rw-r--r--firmware/export/config-iaudiox5.h2
-rw-r--r--firmware/export/config-ifp7xx.h6
-rw-r--r--firmware/export/config-ipod1g2g.h2
-rw-r--r--firmware/export/config-ipod3g.h2
-rw-r--r--firmware/export/config-ipod4g.h2
-rw-r--r--firmware/export/config-ipodcolor.h2
-rw-r--r--firmware/export/config-ipodmini.h2
-rw-r--r--firmware/export/config-ipodmini2g.h2
-rw-r--r--firmware/export/config-ipodnano.h2
-rw-r--r--firmware/export/config-ipodvideo.h2
-rw-r--r--firmware/export/config-logikdax.h4
-rw-r--r--firmware/export/config-m200.h4
-rw-r--r--firmware/export/config-mrobe100.h2
-rw-r--r--firmware/export/config-mrobe500.h2
-rw-r--r--firmware/export/config-ondavx747.h2
-rw-r--r--firmware/export/config-ondavx767.h2
-rw-r--r--firmware/export/config-ondiofm.h2
-rw-r--r--firmware/export/config-ondiosp.h2
-rw-r--r--firmware/export/config-player.h2
-rw-r--r--firmware/export/config-recorder.h2
-rw-r--r--firmware/export/config-recorderv2.h2
-rwxr-xr-xfirmware/export/config-sa9200.h2
-rw-r--r--firmware/export/config-tpj1022.h2
-rw-r--r--firmware/export/config.h11
-rw-r--r--firmware/export/hotswap.h4
-rw-r--r--firmware/export/powermgmt.h4
-rw-r--r--firmware/hotswap.c2
-rw-r--r--firmware/include/dir.h4
-rw-r--r--firmware/powermgmt.c6
-rw-r--r--firmware/usb.c4
-rw-r--r--firmware/usbstack/usb_storage.c4
71 files changed, 142 insertions, 114 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 8c4622828d..26534cc101 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -63,7 +63,7 @@
#include "fat.h"
#include "mas.h"
#include "eeprom_24cxx.h"
-#if defined(HAVE_MMC) || defined(HAVE_ATA_SD)
+#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD)
#include "hotswap.h"
#endif
#if CONFIG_TUNER
@@ -1730,8 +1730,8 @@ static bool view_battery(void)
#endif
#ifndef SIMULATOR
-#if defined(HAVE_MMC) || defined(HAVE_ATA_SD)
-#if defined(HAVE_MMC)
+#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD)
+#if (CONFIG_STORAGE & STORAGE_MMC)
#define CARDTYPE "MMC"
#else
#define CARDTYPE "microSD"
@@ -1812,7 +1812,7 @@ static int disk_callback(int btn, struct gui_synclist *lists)
{
simplelist_addline(SIMPLELIST_ADD_LINE, "Not Found!");
}
-#ifndef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_SD)
else /* card->initialized < 0 */
{
simplelist_addline(SIMPLELIST_ADD_LINE, "Init Error! (%d)", card->initialized);
@@ -1826,7 +1826,7 @@ static int disk_callback(int btn, struct gui_synclist *lists)
}
return btn;
}
-#else /* !defined(HAVE_MMC) && !defined(HAVE_ATA_SD) */
+#else /* !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD) */
static int disk_callback(int btn, struct gui_synclist *lists)
{
(void)lists;
@@ -1960,13 +1960,13 @@ static bool dbg_identify_info(void)
}
return false;
}
-#endif /* !defined(HAVE_MMC) && !defined(HAVE_ATA_SD) */
+#endif /* !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD) */
static bool dbg_disk_info(void)
{
struct simplelist_info info;
simplelist_info_init(&info, "Disk Info", 1, NULL);
-#if defined(HAVE_MMC) || defined(HAVE_ATA_SD)
+#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD)
char title[16];
int card = 0;
info.callback_data = (void*)&card;
@@ -2146,7 +2146,7 @@ static bool dbg_save_roms(void)
return false;
}
-#elif defined(CPU_PP) && !defined(HAVE_ATA_SD)
+#elif defined(CPU_PP) && !(CONFIG_STORAGE & STORAGE_SD)
static bool dbg_save_roms(void)
{
int fd;
@@ -2467,7 +2467,7 @@ struct the_menu_item {
};
static const struct the_menu_item menuitems[] = {
#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || \
- (defined(CPU_PP) && !defined(HAVE_ATA_SD))
+ (defined(CPU_PP) && !(CONFIG_STORAGE & STORAGE_SD))
{ "Dump ROM contents", dbg_save_roms },
#endif
#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) \
@@ -2504,7 +2504,7 @@ static const struct the_menu_item menuitems[] = {
#endif
#ifndef SIMULATOR
{ "View disk info", dbg_disk_info },
-#if !defined(HAVE_MMC) && !defined(HAVE_ATA_SD)
+#if !(CONFIG_STORAGE & STORAGE_MMC) && !(CONFIG_STORAGE & STORAGE_SD)
{ "Dump ATA identify info", dbg_identify_info},
#endif
#endif
diff --git a/apps/main.c b/apps/main.c
index bacaa51e01..50597699c5 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -89,7 +89,7 @@
#if CONFIG_TUNER
#include "radio.h"
#endif
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
#include "ata_mmc.h"
#endif
@@ -377,7 +377,7 @@ static void init(void)
#ifdef DEBUG
debug_init();
#else
-#if !defined(HAVE_FMADC) && !defined(HAVE_MMC)
+#if !defined(HAVE_FMADC) && !(CONFIG_STORAGE & STORAGE_MMC)
serial_setup();
#endif
#endif
@@ -456,7 +456,7 @@ static void init(void)
#endif
/* enter USB mode early, before trying to mount */
if (button_get_w_tmo(HZ/10) == SYS_USB_CONNECTED)
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
if (!mmc_touched() ||
(mmc_remove_request() == SYS_HOTSWAP_EXTRACTED))
#endif
diff --git a/apps/misc.c b/apps/misc.c
index cd59dbc40f..7c8ff0fbd8 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -61,7 +61,7 @@
#include "playlist.h"
#include "yesno.h"
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
#include "ata_mmc.h"
#endif
#include "tree.h"
@@ -910,7 +910,7 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame
case SYS_USB_CONNECTED:
if (callback != NULL)
callback(parameter);
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
if (!mmc_touched() ||
(mmc_remove_request() == SYS_HOTSWAP_EXTRACTED))
#endif
diff --git a/apps/mpeg.c b/apps/mpeg.c
index 713915d5a6..3c37a6b22f 100644
--- a/apps/mpeg.c
+++ b/apps/mpeg.c
@@ -1603,7 +1603,8 @@ static void mpeg_thread(void)
/* Don't read more than until the end of the buffer */
amount_to_read = MIN(audiobuflen - audiobuf_write,
amount_to_read);
-#ifdef HAVE_MMC /* MMC is slow, so don't read too large chunks */
+#if (CONFIG_STORAGE & STORAGE_MMC)
+ /* MMC is slow, so don't read too large chunks */
amount_to_read = MIN(0x40000, amount_to_read);
#elif MEM == 8
amount_to_read = MIN(0x100000, amount_to_read);
@@ -1912,7 +1913,8 @@ static void mpeg_thread(void)
amount_to_save = MIN(amount_to_save,
audiobuflen - audiobuf_read);
-#ifdef HAVE_MMC /* MMC is slow, so don't save too large chunks at once */
+#if (CONFIG_STORAGE & STORAGE_MMC)
+ /* MMC is slow, so don't save too large chunks at once */
amount_to_save = MIN(0x40000, amount_to_save);
#elif MEM == 8
amount_to_save = MIN(0x100000, amount_to_save);
diff --git a/apps/mpeg.h b/apps/mpeg.h
index f5ce613b8d..3aaa990881 100644
--- a/apps/mpeg.h
+++ b/apps/mpeg.h
@@ -32,7 +32,7 @@
#define MPEG_RECORDING_LOW_WATER 0x80000
#define MPEG_LOW_WATER_CHUNKSIZE 0x40000
#define MPEG_LOW_WATER_SWAP_CHUNKSIZE 0x10000
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
#define MPEG_PLAY_PENDING_THRESHOLD 0x20000
#define MPEG_PLAY_PENDING_SWAPSIZE 0x20000
#else
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 0c27a5b1de..a4ddbacfd0 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -120,7 +120,8 @@ nim.c
mp3_encoder.c
wav2wv.c
#else /* hardware codec platforms */
-#ifndef HAVE_MMC /* not for Ondio, has no remote control pin */
+#if !defined(ARCHOS_ONDIOSP) && !defined(ARCHOS_ONDIOFM)
+ /* not for Ondio, has no remote control pin */
alpine_cdc.c
#endif
splitedit.c
diff --git a/apps/plugins/alpine_cdc.c b/apps/plugins/alpine_cdc.c
index f23255aea6..dfffc3b3cd 100644
--- a/apps/plugins/alpine_cdc.c
+++ b/apps/plugins/alpine_cdc.c
@@ -34,7 +34,7 @@
#include "plugin.h"
/* Only build for (correct) target */
-#if CONFIG_CPU==SH7034 && !defined(HAVE_MMC)
+#if CONFIG_CPU==SH7034 && !(CONFIG_STORAGE & STORAGE_MMC)
PLUGIN_HEADER
@@ -1199,4 +1199,4 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
return (main(parameter)==0) ? PLUGIN_OK : PLUGIN_ERROR;
}
-#endif /* CONFIG_CPU==SH7034 && !defined(HAVE_MMC) */
+#endif /* CONFIG_CPU==SH7034 && !(CONFIG_STORAGE & STORAGE_MMC) */
diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c
index 8de6a746ab..dda46a0f29 100644
--- a/apps/plugins/splitedit.c
+++ b/apps/plugins/splitedit.c
@@ -1044,7 +1044,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
case LOOP_MODE_TO:
rb->audio_pause();
rb->audio_ff_rewind(range_start);
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
/* MMC is slow - wait some time to allow track reload to finish */
rb->sleep(HZ/20);
if (mp3->elapsed > play_end) /* reload in progress */
@@ -1056,7 +1056,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
case LOOP_MODE_FROM:
rb->audio_pause();
rb->audio_ff_rewind(xpos_to_time(split_x));
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
/* MMC is slow - wait some time to allow track reload to finish */
rb->sleep(HZ/20);
if (mp3->elapsed > play_end) /* reload in progress */
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c
index 7638fbf831..2e421e151e 100644
--- a/apps/plugins/test_disk.c
+++ b/apps/plugins/test_disk.c
@@ -29,7 +29,7 @@ PLUGIN_HEADER
#define TEST_FILE TESTBASEDIR "/test_disk.tmp"
#define FRND_SEED 0x78C3 /* arbirary */
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
#define TEST_SIZE (20*1024*1024)
#else
#define TEST_SIZE (300*1024*1024)
diff --git a/apps/plugins/wavplay.c b/apps/plugins/wavplay.c
index 333d16135c..c37b656d1c 100644
--- a/apps/plugins/wavplay.c
+++ b/apps/plugins/wavplay.c
@@ -3574,7 +3574,7 @@ int play_file(char* filename)
while (!(SSR0 & SCI_TEND)); /* wait for end of transfer */
BRR0 = 0; /* maximum speed, ~3 MBit/s */
-#ifndef HAVE_MMC
+#if !(CONFIG_STORAGE & STORAGE_MMC)
low_water = 5 /* seconds */
* 2 /* bytes per sample */
* channels
@@ -3603,7 +3603,7 @@ int play_file(char* filename)
else
{
wanted = MIN(free_space, aud_size - aud_write);
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
wanted = MIN(wanted, 256*1024);
#elif MEM == 8
wanted = MIN(wanted, 1024*1024);
diff --git a/apps/plugins/wavrecord.c b/apps/plugins/wavrecord.c
index d57a61a6a2..d4b8bf1fd2 100644
--- a/apps/plugins/wavrecord.c
+++ b/apps/plugins/wavrecord.c
@@ -3587,7 +3587,7 @@ static int record_file(char *filename)
if (to_save > aud_size)
{
rec_tick_enable(false);
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
rb->splash(HZ, "Data overrun (slow MMC)");
#else
rb->splash(HZ, "Data overrun");
@@ -3597,7 +3597,7 @@ static int record_file(char *filename)
break;
}
write_now = MIN(to_save, aud_size - aud_read);
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
write_now = MIN(write_now, 256*1024);
#else
write_now = MIN(write_now, 1024*1024);
@@ -3802,7 +3802,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
return rc;
#if 0
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
return record_file("/<MMC1>/test.wav");
#else
return record_file("/test.wav");
diff --git a/apps/screens.c b/apps/screens.c
index d8ce695a9a..753b666902 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -68,7 +68,7 @@
#include <bitmaps/remote_usblogo.h>
#endif
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
#include "ata_mmc.h"
#endif
#if CONFIG_CODEC == SWCODEC
@@ -145,9 +145,9 @@ void usb_screen(void)
usb_acknowledge(SYS_USB_CONNECTED_ACK);
while(usb_wait_for_disconnect_w_tmo(&button_queue, HZ)) {
if(usb_inserted()) {
-#ifdef HAVE_MMC /* USB-MMC bridge can report activity */
+#if (CONFIG_STORAGE & STORAGE_MMC) /* USB-MMC bridge can report activity */
led(mmc_usb_active(HZ));
-#endif /* HAVE_MMC */
+#endif /* STORAGE_MMC */
gui_syncstatusbar_draw(&statusbars, false);
}
}
@@ -161,7 +161,7 @@ void usb_screen(void)
#endif /* USB_NONE */
}
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
int mmc_remove_request(void)
{
struct queue_event ev;
diff --git a/apps/screens.h b/apps/screens.h
index d024cc5f2e..eb613fc178 100644
--- a/apps/screens.h
+++ b/apps/screens.h
@@ -34,7 +34,7 @@ int charging_screen(void);
void charging_splash(void);
#endif
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
int mmc_remove_request(void);
#endif
diff --git a/apps/talk.c b/apps/talk.c
index 2da4cd5c26..44ba063655 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -187,7 +187,7 @@ static unsigned char* get_clip(long id, long* p_size)
return NULL;
clipbuf = (unsigned char *) p_voicefile + p_voicefile->index[id].offset;
-#ifdef HAVE_MMC /* dynamic loading, on demand */
+#if (CONFIG_STORAGE & STORAGE_MMC) /* dynamic loading, on demand */
if (!(clipsize & LOADED_MASK))
{ /* clip used for the first time, needs loading */
lseek(filehandle, p_voicefile->index[id].offset, SEEK_SET);
@@ -225,7 +225,7 @@ static void load_voicefile(void)
if (file_size > audiobufend - audiobuf) /* won't fit? */
goto load_err;
-#ifdef HAVE_MMC /* load only the header for now */
+#if (CONFIG_STORAGE & STORAGE_MMC) /* load only the header for now */
load_size = offsetof(struct voicefile, index);
#else /* load the full file */
load_size = file_size;
@@ -266,7 +266,7 @@ static void load_voicefile(void)
structec_convert(&p_voicefile->index[i], "ll", 1, true);
#endif
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
/* load the index table, now that we know its size from the header */
load_size = (p_voicefile->id1_max + p_voicefile->id2_max)
* sizeof(struct clip_entry);
@@ -520,7 +520,7 @@ void talk_init(void)
return;
}
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
if (filehandle >= 0) /* MMC: An old voice file might still be open */
{
close(filehandle);
@@ -577,7 +577,7 @@ void talk_buffer_steal(void)
#if CONFIG_CODEC != SWCODEC
mp3_play_stop();
#endif
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
if (filehandle >= 0) /* only relevant for MMC */
{
close(filehandle);
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c
index 5e20142a59..c1aad5ce11 100644
--- a/bootloader/main-pp.c
+++ b/bootloader/main-pp.c
@@ -80,7 +80,7 @@ unsigned char *loadbuffer = (unsigned char *)DRAM_START;
char version[] = APPSVERSION;
/* Locations and sizes in hidden partition on Sansa */
-#if defined(HAVE_ATA_SD)
+#if (CONFIG_STORAGE & STORAGE_SD)
#define PPMI_SECTOR_OFFSET 1024
#define PPMI_SECTORS 1
#define MI4_HEADER_SECTORS 1
@@ -361,7 +361,7 @@ int load_mi4(unsigned char* buf, char* firmware, unsigned int buffer_size)
return EOK;
}
-#if defined(HAVE_ATA_SD)
+#if (CONFIG_STORAGE & STORAGE_SD)
/* Load mi4 firmware from a hidden disk partition */
int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
unsigned int buffer_size, bool disable_rebuild)
@@ -506,7 +506,7 @@ void* main(void)
printf(MODEL_NAME);
i=ata_init();
-#if !defined(HAVE_ATA_SD)
+#if !(CONFIG_STORAGE & STORAGE_SD)
if (i==0) {
identify_info=ata_get_identify();
/* Show model */
@@ -550,7 +550,7 @@ void* main(void)
*/
printf("Loading original firmware...");
-#if defined(HAVE_ATA_SD)
+#if (CONFIG_STORAGE & STORAGE_SD)
/* First try a (hidden) firmware partition */
printf("Trying firmware partition");
pinfo = disk_partinfo(1);
diff --git a/firmware/SOURCES b/firmware/SOURCES
index e73e94b453..b17bb0c115 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -109,15 +109,17 @@ drivers/serial.c
/* Storage */
#ifndef SIMULATOR
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
drivers/ata_mmc.c
-#elif defined(HAVE_FLASH_DISK)
+#elif (CONFIG_STORAGE & STORAGE_NAND) && (CONFIG_NAND & NAND_IFP7XX)
drivers/ata_flash.c
-#elif defined(HAVE_ATA)
+#elif (CONFIG_STORAGE & STORAGE_NAND) && (CONFIG_NAND & NAND_TCC)
+target/arm/ata-nand-telechips.c
+#elif (CONFIG_STORAGE & STORAGE_ATA)
drivers/ata.c
-#endif /* HAVE_MMC */
+#endif /* CONFIG_STORAGE */
drivers/fat.c
-#if defined(HAVE_MMC) || defined(HAVE_ATA_SD)
+#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD)
hotswap.c
#endif
#endif /* SIMULATOR */
@@ -981,7 +983,6 @@ target/arm/pnx0101/pcm-pnx0101.c
#ifdef LOGIK_DAX
#ifndef SIMULATOR
drivers/nand_id.c
-target/arm/ata-nand-telechips.c
target/arm/lcd-ssd1815.c
target/arm/tcc77x/adc-tcc77x.c
target/arm/tcc77x/kernel-tcc77x.c
@@ -1004,7 +1005,6 @@ target/arm/tcc77x/logikdax/audio-logikdax.c
#ifndef SIMULATOR
drivers/nand_id.c
target/arm/lcd-ssd1815.c
-target/arm/ata-nand-telechips.c
target/arm/tcc77x/adc-tcc77x.c
target/arm/tcc77x/kernel-tcc77x.c
target/arm/tcc77x/powermgmt-tcc77x.c
@@ -1025,7 +1025,6 @@ target/arm/tcc77x/m200/audio-m200.c
#ifdef SANSA_C100
#ifndef SIMULATOR
drivers/nand_id.c
-target/arm/ata-nand-telechips.c
target/arm/tcc77x/adc-tcc77x.c
target/arm/tcc77x/kernel-tcc77x.c
target/arm/tcc77x/c100/lcd-S6B33B2.c
@@ -1071,7 +1070,6 @@ target/arm/as3525/as3525-codec.c
#ifndef SIMULATOR
drivers/nand_id.c
drivers/pcf50606.c
-target/arm/ata-nand-telechips.c
target/arm/tcc77x/system-tcc77x.c
target/arm/tcc77x/kernel-tcc77x.c
target/arm/tcc77x/timer-tcc77x.c
@@ -1096,7 +1094,6 @@ target/arm/tcc77x/iaudio7/audio-iaudio7.c
drivers/nand_id.c
drivers/pcf50606.c
target/arm/lcd-as-memframe.S
-target/arm/ata-nand-telechips.c
target/arm/tcc780x/adc-tcc780x.c
target/arm/tcc780x/system-tcc780x.c
target/arm/tcc780x/cowond2/button-cowond2.c
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index 3130a3e2b4..90be93f4f4 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -204,7 +204,7 @@ static char fat_cache_sectors[FAT_CACHE_SIZE][SECTOR_SIZE];
static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE];
static struct mutex cache_mutex SHAREDBSS_ATTR;
-#if defined(HAVE_HOTSWAP) && !defined(HAVE_MMC) /* A better condition ?? */
+#if defined(HAVE_HOTSWAP) && !(CONFIG_STORAGE & STORAGE_MMC) /* A better condition ?? */
void fat_lock(void)
{
mutex_lock(&cache_mutex);
diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c
index 961974e987..47fbf564ff 100644
--- a/firmware/drivers/serial.c
+++ b/firmware/drivers/serial.c
@@ -39,7 +39,7 @@
/* iFP7xx has no remote */
#if !defined(HAVE_FMADC) /* Recorder FM/V2 has no remote control pin */ \
- && !defined(HAVE_MMC) /* MMC takes serial port 1, so don't mess with it */
+ && !(CONFIG_STORAGE & STORAGE_MMC) /* MMC takes serial port 1, so don't mess with it */
/* Received byte identifiers */
#define PLAY 0xC1
@@ -146,7 +146,7 @@ int remote_control_rx(void)
return ret;
}
-#endif /* !HAVE_FMADC && !HAVE_MMC */
+#endif /* !HAVE_FMADC && !STORAGE_MMC */
#elif defined(CPU_COLDFIRE) && defined(HAVE_SERIAL)
void serial_tx(const unsigned char *buf)
diff --git a/firmware/export/ata_idle_notify.h b/firmware/export/ata_idle_notify.h
index cfbba6f13d..aea2c92b06 100644
--- a/firmware/export/ata_idle_notify.h
+++ b/firmware/export/ata_idle_notify.h
@@ -44,7 +44,8 @@ enum {
};
#define USING_ATA_CALLBACK !defined(SIMULATOR) \
- && !defined(HAVE_FLASH_DISK) \
+ && ! ((CONFIG_STORAGE & STORAGE_NAND) \
+ && (CONFIG_NAND & NAND_IFP7XX)) \
&& !defined(BOOTLOADER)
typedef bool (*ata_idle_notify)(void);
diff --git a/firmware/export/config-c100.h b/firmware/export/config-c100.h
index 5bf0fc83a6..9a2664202a 100644
--- a/firmware/export/config-c100.h
+++ b/firmware/export/config-c100.h
@@ -120,4 +120,8 @@
#define BOOTFILE "rockbox." BOOTFILE_EXT
#define BOOTDIR "/"
+#define CONFIG_STORAGE STORAGE_NAND
+
+#define CONFIG_NAND NAND_TCC
+
#endif /* SIMULATOR */
diff --git a/firmware/export/config-c200.h b/firmware/export/config-c200.h
index 9a9198ee05..a96b9c7ef8 100644
--- a/firmware/export/config-c200.h
+++ b/firmware/export/config-c200.h
@@ -115,7 +115,7 @@
#define HAVE_FLASH_STORAGE
/* define this if the flash memory uses the SecureDigital Memory Card protocol */
-#define HAVE_ATA_SD
+#define CONFIG_STORAGE STORAGE_SD
#define BATTERY_CAPACITY_DEFAULT 530 /* default battery capacity */
#define BATTERY_CAPACITY_MIN 530 /* min. capacity selectable */
diff --git a/firmware/export/config-clip.h b/firmware/export/config-clip.h
index 01a08f3886..591ec1012a 100644
--- a/firmware/export/config-clip.h
+++ b/firmware/export/config-clip.h
@@ -95,7 +95,7 @@
#define HAVE_FLASH_STORAGE
/* define this if the flash memory uses the SecureDigital Memory Card protocol */
-#define HAVE_ATA_SD
+#define CONFIG_STORAGE STORAGE_SD
#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */
#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */
diff --git a/firmware/export/config-cowond2.h b/firmware/export/config-cowond2.h
index d136caefb2..749eb0b882 100644
--- a/firmware/export/config-cowond2.h
+++ b/firmware/export/config-cowond2.h
@@ -145,4 +145,8 @@
#define BOOTFILE "rockbox." BOOTFILE_EXT
#define BOOTDIR "/.rockbox"
+#define CONFIG_STORAGE STORAGE_NAND
+
+#define CONFIG_NAND NAND_TCC
+
#endif /* SIMULATOR */
diff --git a/firmware/export/config-creativezv.h b/firmware/export/config-creativezv.h
index e9cc2685b6..5f0336e538 100644
--- a/firmware/export/config-creativezv.h
+++ b/firmware/export/config-creativezv.h
@@ -37,7 +37,7 @@
#define MODEL_NUMBER 28
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-creativezvm.h b/firmware/export/config-creativezvm.h
index ec21500296..ea3cc871a5 100644
--- a/firmware/export/config-creativezvm.h
+++ b/firmware/export/config-creativezvm.h
@@ -37,7 +37,7 @@
#define MODEL_NUMBER 26
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-creativezvm60gb.h b/firmware/export/config-creativezvm60gb.h
index d1e1d80889..a0cf2ba918 100644
--- a/firmware/export/config-creativezvm60gb.h
+++ b/firmware/export/config-creativezvm60gb.h
@@ -37,7 +37,7 @@
#define MODEL_NUMBER 27
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h
index 745aa71735..075f490ee4 100644
--- a/firmware/export/config-e200.h
+++ b/firmware/export/config-e200.h
@@ -112,7 +112,7 @@
#define HAVE_FLASH_STORAGE
/* define this if the flash memory uses the SecureDigital Memory Card protocol */
-#define HAVE_ATA_SD
+#define CONFIG_STORAGE STORAGE_SD
#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */
#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */
diff --git a/firmware/export/config-e200v2.h b/firmware/export/config-e200v2.h
index 0dc87d4123..c51bac0a9f 100644
--- a/firmware/export/config-e200v2.h
+++ b/firmware/export/config-e200v2.h
@@ -115,7 +115,7 @@
#define HAVE_FLASH_STORAGE
/* define this if the flash memory uses the SecureDigital Memory Card protocol */
-#define HAVE_ATA_SD
+#define CONFIG_STORAGE STORAGE_SD
#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */
#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h
index 1908f6a29d..716bc98e09 100644
--- a/firmware/export/config-fmrecorder.h
+++ b/firmware/export/config-fmrecorder.h
@@ -1,5 +1,5 @@
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
#define MODEL_NAME "Archos FM Recorder"
diff --git a/firmware/export/config-gigabeat-s.h b/firmware/export/config-gigabeat-s.h
index 7f36bce7dd..007fd7d2f4 100644
--- a/firmware/export/config-gigabeat-s.h
+++ b/firmware/export/config-gigabeat-s.h
@@ -13,7 +13,7 @@
#define MODEL_NUMBER 21
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h
index f4910bfcb0..0c5462400b 100644
--- a/firmware/export/config-gigabeat.h
+++ b/firmware/export/config-gigabeat.h
@@ -11,7 +11,7 @@
#define MODEL_NUMBER 18
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h
index 8504ffd25a..2056fd4fcf 100644
--- a/firmware/export/config-h10.h
+++ b/firmware/export/config-h10.h
@@ -9,7 +9,7 @@
#define MODEL_NAME "iriver H10 20GB"
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
#define HAVE_RECORDING
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 641709f639..9c327f11fd 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -15,7 +15,7 @@
#define MODEL_NUMBER 1
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-h10_5gb.h b/firmware/export/config-h10_5gb.h
index fa1e37229a..40acdc6efe 100644
--- a/firmware/export/config-h10_5gb.h
+++ b/firmware/export/config-h10_5gb.h
@@ -9,7 +9,7 @@
#define MODEL_NAME "iriver H10 5/6GB"
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
#define HAVE_RECORDING
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h
index 6177347664..d81fa07d93 100644
--- a/firmware/export/config-h120.h
+++ b/firmware/export/config-h120.h
@@ -10,7 +10,7 @@
#define MODEL_NUMBER 0
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h
index 0b305747cf..f45b694fe0 100644
--- a/firmware/export/config-h300.h
+++ b/firmware/export/config-h300.h
@@ -10,7 +10,7 @@
#define MODEL_NUMBER 2
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-hdd1630.h b/firmware/export/config-hdd1630.h
index 810902e487..7ee3f11355 100755
--- a/firmware/export/config-hdd1630.h
+++ b/firmware/export/config-hdd1630.h
@@ -9,7 +9,7 @@
#define MODEL_NAME "Philips GoGear HDD1630"
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
/* #define HAVE_RECORDING */
diff --git a/firmware/export/config-iaudio7.h b/firmware/export/config-iaudio7.h
index cce357ec4b..ca6212d305 100644
--- a/firmware/export/config-iaudio7.h
+++ b/firmware/export/config-iaudio7.h
@@ -155,6 +155,10 @@
#define BOOTFILE "rockbox." BOOTFILE_EXT
#define BOOTDIR "/"
+#define CONFIG_STORAGE STORAGE_NAND
+
+#define CONFIG_NAND NAND_TCC
+
#ifdef BOOTLOADER
#define TCCBOOT
#endif
diff --git a/firmware/export/config-iaudiom3.h b/firmware/export/config-iaudiom3.h
index 8ebd5cb8b6..f4ced651d0 100644
--- a/firmware/export/config-iaudiom3.h
+++ b/firmware/export/config-iaudiom3.h
@@ -9,7 +9,7 @@
#define MODEL_NAME "iAudio M3"
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
#define HAVE_RECORDING
diff --git a/firmware/export/config-iaudiom5.h b/firmware/export/config-iaudiom5.h
index 027ffb61e5..5ec6b77862 100644
--- a/firmware/export/config-iaudiom5.h
+++ b/firmware/export/config-iaudiom5.h
@@ -9,7 +9,7 @@
#define MODEL_NAME "iAudio M5"
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
#define HAVE_RECORDING
diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h
index 5ea3dcd73c..cdae55af4f 100644
--- a/firmware/export/config-iaudiox5.h
+++ b/firmware/export/config-iaudiox5.h
@@ -9,7 +9,7 @@
#define MODEL_NAME "iAudio X5"
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
#define HAVE_RECORDING
diff --git a/firmware/export/config-ifp7xx.h b/firmware/export/config-ifp7xx.h
index 6e6f9f4097..6a26a93da2 100644
--- a/firmware/export/config-ifp7xx.h
+++ b/firmware/export/config-ifp7xx.h
@@ -31,7 +31,9 @@
#define CONFIG_KEYPAD IRIVER_IFP7XX_PAD
-#define CONFIG_FLASH FLASH_IFP7XX
+#define CONFIG_STORAGE STORAGE_NAND
+
+#define CONFIG_NAND NAND_IFP7XX
#define HAVE_FAT16SUPPORT
@@ -50,8 +52,6 @@
/* Define this if you have the WM8975 audio codec */
/* #define HAVE_WM8975 */
-#define HAVE_FLASH_DISK
-
/* Virtual LED (icon) */
#define CONFIG_LED LED_VIRTUAL
diff --git a/firmware/export/config-ipod1g2g.h b/firmware/export/config-ipod1g2g.h
index ae810b14cb..4308d9c66c 100644
--- a/firmware/export/config-ipod1g2g.h
+++ b/firmware/export/config-ipod1g2g.h
@@ -11,7 +11,7 @@
#define MODEL_NUMBER 19
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility
#define HAVE_RECORDING */
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h
index 3ca95c375c..f1550576d2 100644
--- a/firmware/export/config-ipod3g.h
+++ b/firmware/export/config-ipod3g.h
@@ -12,7 +12,7 @@
#define MODEL_NUMBER 7
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
/*#define HAVE_RECORDING*/
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h
index 4f0045fee8..4a2207d1d6 100644
--- a/firmware/export/config-ipod4g.h
+++ b/firmware/export/config-ipod4g.h
@@ -11,7 +11,7 @@
#define MODEL_NUMBER 8
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
#define HAVE_RECORDING
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h
index d23a03a00b..47b7a4eacf 100644
--- a/firmware/export/config-ipodcolor.h
+++ b/firmware/export/config-ipodcolor.h
@@ -11,7 +11,7 @@
#define MODEL_NUMBER 3
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
#define HAVE_RECORDING
diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h
index 8477e497b4..c2d6376706 100644
--- a/firmware/export/config-ipodmini.h
+++ b/firmware/export/config-ipodmini.h
@@ -11,7 +11,7 @@
#define MODEL_NUMBER 9
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
/*#define HAVE_RECORDING*/
diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h
index 5e7bdb0d09..6d6ebf1a9a 100644
--- a/firmware/export/config-ipodmini2g.h
+++ b/firmware/export/config-ipodmini2g.h
@@ -11,7 +11,7 @@
#define MODEL_NUMBER 11
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
/*#define HAVE_RECORDING*/
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h
index 0750d55557..7d6515fc0f 100644
--- a/firmware/export/config-ipodnano.h
+++ b/firmware/export/config-ipodnano.h
@@ -11,7 +11,7 @@
#define MODEL_NUMBER 4
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
#define HAVE_RECORDING
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h
index c7a248e532..fa6ddd304f 100644
--- a/firmware/export/config-ipodvideo.h
+++ b/firmware/export/config-ipodvideo.h
@@ -11,7 +11,7 @@
#define MODEL_NUMBER 5
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
#define HAVE_RECORDING
diff --git a/firmware/export/config-logikdax.h b/firmware/export/config-logikdax.h
index f9ee4b94a0..160058ff7f 100644
--- a/firmware/export/config-logikdax.h
+++ b/firmware/export/config-logikdax.h
@@ -139,4 +139,8 @@
#define ICODE_ATTR_ALAC
#define IBSS_ATTR_SHORTEN_DECODED0
+#define CONFIG_STORAGE STORAGE_NAND
+
+#define CONFIG_NAND NAND_TCC
+
#endif /* SIMULATOR */
diff --git a/firmware/export/config-m200.h b/firmware/export/config-m200.h
index 2733ad577d..b3b71ee778 100644
--- a/firmware/export/config-m200.h
+++ b/firmware/export/config-m200.h
@@ -124,4 +124,8 @@
#define ICODE_ATTR_ALAC
#define IBSS_ATTR_SHORTEN_DECODED0
+#define CONFIG_STORAGE STORAGE_NAND
+
+#define CONFIG_NAND NAND_TCC
+
#endif /* SIMULATOR */
diff --git a/firmware/export/config-mrobe100.h b/firmware/export/config-mrobe100.h
index 99e7757af8..051f15824f 100644
--- a/firmware/export/config-mrobe100.h
+++ b/firmware/export/config-mrobe100.h
@@ -9,7 +9,7 @@
#define MODEL_NAME "Olympus m:robe MR-100"
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-mrobe500.h b/firmware/export/config-mrobe500.h
index 8e20c9478c..572d018328 100644
--- a/firmware/export/config-mrobe500.h
+++ b/firmware/export/config-mrobe500.h
@@ -33,7 +33,7 @@
#define MODEL_NUMBER 22
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-ondavx747.h b/firmware/export/config-ondavx747.h
index 12deb9cf71..38bc5d7b01 100644
--- a/firmware/export/config-ondavx747.h
+++ b/firmware/export/config-ondavx747.h
@@ -34,7 +34,7 @@
#define MODEL_NUMBER 35
/* define this if you use an ATA controller */
-//#define HAVE_ATA
+//#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-ondavx767.h b/firmware/export/config-ondavx767.h
index 9c2d237b01..bbead76137 100644
--- a/firmware/export/config-ondavx767.h
+++ b/firmware/export/config-ondavx767.h
@@ -34,7 +34,7 @@
#define MODEL_NUMBER 36
/* define this if you use an ATA controller */
-//#define HAVE_ATA
+//#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h
index 8d3b040745..634433fcdb 100644
--- a/firmware/export/config-ondiofm.h
+++ b/firmware/export/config-ondiofm.h
@@ -106,7 +106,7 @@
#define HAVE_ONDIO_ADC
/* Define this for MMC support instead of ATA harddisk */
-#define HAVE_MMC
+#define CONFIG_STORAGE STORAGE_MMC
/* Define this to support mounting FAT16 partitions */
#define HAVE_FAT16SUPPORT
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h
index fc99bf459d..3443b839b6 100644
--- a/firmware/export/config-ondiosp.h
+++ b/firmware/export/config-ondiosp.h
@@ -89,7 +89,7 @@
#define HAVE_ONDIO_ADC
/* Define this for MMC support instead of ATA harddisk */
-#define HAVE_MMC
+#define CONFIG_STORAGE STORAGE_MMC
/* Define this to support mounting FAT16 partitions */
#define HAVE_FAT16SUPPORT
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h
index d94ca82735..9008212a17 100644
--- a/firmware/export/config-player.h
+++ b/firmware/export/config-player.h
@@ -1,5 +1,5 @@
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
#define MODEL_NAME "Archos Player/Studio"
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h
index f6ddb88af6..e5fa3361cc 100644
--- a/firmware/export/config-recorder.h
+++ b/firmware/export/config-recorder.h
@@ -1,5 +1,5 @@
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
#define MODEL_NAME "Archos Recorder"
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h
index 5d62ec464c..3244f19f1d 100644
--- a/firmware/export/config-recorderv2.h
+++ b/firmware/export/config-recorderv2.h
@@ -1,5 +1,5 @@
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
#define MODEL_NAME "Archos Recorder v2"
diff --git a/firmware/export/config-sa9200.h b/firmware/export/config-sa9200.h
index 433e28db82..b9fd4575bc 100755
--- a/firmware/export/config-sa9200.h
+++ b/firmware/export/config-sa9200.h
@@ -94,7 +94,7 @@
#define HAVE_FLASH_STORAGE
/* define this if the flash memory uses the SecureDigital Memory Card protocol */
-#define HAVE_ATA_SD
+#define CONFIG_STORAGE STORAGE_SD
#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */
#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */
diff --git a/firmware/export/config-tpj1022.h b/firmware/export/config-tpj1022.h
index 1b49e0ebb9..6cc85fdfc9 100644
--- a/firmware/export/config-tpj1022.h
+++ b/firmware/export/config-tpj1022.h
@@ -10,7 +10,7 @@
#define MODEL_NUMBER 15
/* define this if you use an ATA controller */
-#define HAVE_ATA
+#define CONFIG_STORAGE STORAGE_ATA
/* define this if you have recording possibility */
/*#define HAVE_RECORDING*/ /* TODO: add support for this */
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 01141f3866..c12f6ce4d2 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -28,6 +28,12 @@
/* symbolic names for multiple choice configurations: */
+/* CONFIG_STORAGE (note these are combineable bit-flags) */
+#define STORAGE_ATA 0x01
+#define STORAGE_MMC 0x02
+#define STORAGE_SD 0x04
+#define STORAGE_NAND 0x08
+
/* CONFIG_TUNER (note these are combineable bit-flags) */
#define S1A0903X01 0x01 /* Samsung */
#define TEA5767 0x02 /* Philips */
@@ -180,8 +186,9 @@
#define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
/* else HW controlled LED (iRiver H1x0) */
-/* CONFIG_FLASH */
-#define FLASH_IFP7XX 1
+/* CONFIG_NAND */
+#define NAND_IFP7XX 1
+#define NAND_TCC 2
/* CONFIG_RTC */
#define RTC_M41ST84W 1 /* Archos Recorder */
diff --git a/firmware/export/hotswap.h b/firmware/export/hotswap.h
index d01c467adf..6872ca86db 100644
--- a/firmware/export/hotswap.h
+++ b/firmware/export/hotswap.h
@@ -41,14 +41,14 @@ typedef struct
unsigned int blocksize; /* block size in bytes */
} tCardInfo;
-#ifdef HAVE_ATA_SD
+#if (CONFIG_STORAGE & STORAGE_SD)
#include "ata-sd-target.h"
#define card_detect card_detect_target
#define card_get_info card_get_info_target
#ifdef HAVE_HOTSWAP
#define card_enable_monitoring card_enable_monitoring_target
#endif
-#else /* HAVE_MMC */
+#else /* STORAGE_MMC */
#include "ata_mmc.h"
#define card_detect mmc_detect
#define card_get_info mmc_card_info
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index acdee22a12..70c4b70d7a 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -142,7 +142,7 @@ extern int trickle_sec; /* trickle charge: How many seconds per minute
#define CURRENT_USB 500 /* usual current in mA in USB mode */
#ifdef HAVE_REMOTE_LCD
# define CURRENT_REMOTE 8 /* add. current when H100-remote connected */
-#endif /* HAVE_MMC */
+#endif /* HAVE_REMOTE_LCD */
# define CURRENT_MIN_CHG 70 /* minimum charge current */
# define MIN_CHG_V 8500 /* at 8.5v charger voltage get CURRENT_MIN_CHG */
@@ -152,7 +152,7 @@ extern int trickle_sec; /* trickle charge: How many seconds per minute
# define CURRENT_MAX_CHG 350 /* maximum charging current */
# endif
# define MAX_CHG_V 10250 /* anything over 10.25v gives CURRENT_MAX_CHG */
-#endif /* not HAVE_MMC */
+#endif /* not ONDIO */
extern unsigned short power_history[POWER_HISTORY_LEN];
extern const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT];
diff --git a/firmware/hotswap.c b/firmware/hotswap.c
index cb8a539c01..97c162ce39 100644
--- a/firmware/hotswap.c
+++ b/firmware/hotswap.c
@@ -20,7 +20,7 @@
****************************************************************************/
#include <stdbool.h>
#include "config.h"
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
#include "ata_mmc.h"
#else
#include "hotswap.h"
diff --git a/firmware/include/dir.h b/firmware/include/dir.h
index 69403a7572..5aa6cde35a 100644
--- a/firmware/include/dir.h
+++ b/firmware/include/dir.h
@@ -28,10 +28,10 @@
/* how to name volumes, first char must be outside of legal file names,
a number gets appended to enumerate, if applicable */
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
#define VOL_NAMES "<MMC%d>"
#define VOL_ENUM_POS 4 /* position of %d, to avoid runtime calculation */
-#elif defined(HAVE_HOTSWAP)
+#elif (CONFIG_STORAGE & STORAGE_SD)
#define VOL_NAMES "<microSD%d>"
#define VOL_ENUM_POS 8 /* position of %d, to avoid runtime calculation */
#else
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 86fadff2a2..6e0c03c94a 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -492,7 +492,7 @@ static int runcurrent(void)
{
int current;
-#if MEM == 8 && !defined(HAVE_MMC)
+#if MEM == 8 && !(defined(ARCHOS_ONDIOSP) || defined(ARCHOS_ONDIOFM))
/* assuming 192 kbps, the running time is 22% longer with 8MB */
current = (CURRENT_NORMAL*100/122);
#else
@@ -1059,7 +1059,7 @@ static void power_thread(void)
/* initialize the voltages for the exponential filter */
avgbat = battery_adc_voltage() + 15;
-#ifndef HAVE_MMC /* this adjustment is only needed for HD based */
+#ifdef HAVE_DISK_STORAGE /* this adjustment is only needed for HD based */
/* The battery voltage is usually a little lower directly after
turning on, because the disk was used heavily. Raise it by 5% */
#ifdef HAVE_CHARGING
@@ -1067,7 +1067,7 @@ static void power_thread(void)
#endif
avgbat += (percent_to_volt_discharge[battery_type][6] -
percent_to_volt_discharge[battery_type][5]) / 2;
-#endif /* not HAVE_MMC */
+#endif /* HAVE_DISK_STORAGE */
avgbat = avgbat * BATT_AVE_SAMPLES;
battery_millivolts = avgbat / BATT_AVE_SAMPLES;
diff --git a/firmware/usb.c b/firmware/usb.c
index e5c7565d39..9064987ed1 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -71,7 +71,7 @@ static int countdown;
static int usb_state;
-#if defined(HAVE_MMC) && defined(USB_FULL_INIT)
+#if (CONFIG_STORAGE & STORAGE_MMC) && defined(USB_FULL_INIT)
static int usb_mmc_countdown = 0;
#endif
@@ -435,7 +435,7 @@ static void usb_tick(void)
}
}
}
-#ifdef HAVE_MMC
+#if (CONFIG_STORAGE & STORAGE_MMC)
if(usb_mmc_countdown > 0)
{
usb_mmc_countdown--;
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c
index 8c1b02b183..198ff46a56 100644
--- a/firmware/usbstack/usb_storage.c
+++ b/firmware/usbstack/usb_storage.c
@@ -39,7 +39,7 @@
* by not overlapping ata_write_sector() with USB transfers. This does reduce
* write performance, so we only do it for the affected DAPs
*/
-#ifdef HAVE_ATA_SD
+#if (CONFIG_STORAGE & STORAGE_SD)
#define SERIALIZE_WRITES
#endif
/* Enable the following define to export only the SD card slot. This
@@ -668,7 +668,7 @@ static void handle_scsi(struct command_block_wrapper* cbw)
block_size = SECTOR_SIZE;
block_count = RAMDISK_SIZE;
#else
-#if defined(HAVE_ATA_SD) || defined(HAVE_HOTSWAP)
+#if (CONFIG_STORAGE & STORAGE_SD) || defined(HAVE_HOTSWAP)
tCardInfo* cinfo = card_get_info(lun);
if(cinfo->initialized && cinfo->numblocks > 0) {
block_size = cinfo->blocksize;