| Index: emcore/trunk/storage.c |
| — | — | @@ -21,7 +21,6 @@ |
| 22 | 22 | #include "global.h" |
| 23 | 23 | #include "storage.h" |
| 24 | 24 | |
| 25 | | -#ifdef CONFIG_STORAGE_MULTI |
| 26 | 25 | |
| 27 | 26 | #define DRIVER_MASK 0xff000000 |
| 28 | 27 | #define DRIVER_OFFSET 24 |
| — | — | @@ -31,7 +30,6 @@ |
| 32 | 31 | |
| 33 | 32 | static unsigned int storage_drivers[NUM_DRIVES]; |
| 34 | 33 | static unsigned int num_drives; |
| 35 | | -#endif |
| 36 | 34 | |
| 37 | 35 | |
| 38 | 36 | int storage_read_sectors(IF_MD2(int drive,) unsigned long start, int count, |
| — | — | @@ -167,8 +165,6 @@ |
| 168 | 166 | } |
| 169 | 167 | #endif /* STORAGE_GET_INFO */ |
| 170 | 168 | |
| 171 | | -#ifdef CONFIG_STORAGE_MULTI |
| 172 | | - |
| 173 | 169 | int storage_num_drives(void) |
| 174 | 170 | { |
| 175 | 171 | return num_drives; |
| — | — | @@ -568,5 +564,3 @@ |
| 569 | 565 | } |
| 570 | 566 | } |
| 571 | 567 | #endif |
| 572 | | - |
| 573 | | -#endif /*CONFIG_STORAGE_MULTI*/ |
| Index: emcore/trunk/target/ipodnano2g/storage_nand.c |
| — | — | @@ -67,6 +67,11 @@ |
| 68 | 68 | (void)on;
|
| 69 | 69 | }
|
| 70 | 70 |
|
| | 71 | +int nand_num_drives(void)
|
| | 72 | +{
|
| | 73 | + return 1;
|
| | 74 | +}
|
| | 75 | +
|
| 71 | 76 | void nand_get_info(IF_MD2(int drive,) struct storage_info *info)
|
| 72 | 77 | {
|
| 73 | 78 | uint32_t ppb = ftl_banks * (*ftl_nand_type).pagesperblock;
|
| Index: emcore/trunk/storage.h |
| — | — | @@ -57,120 +57,21 @@ |
| 58 | 58 | /* storage_spindown, storage_sleep and storage_spin are passed as |
| 59 | 59 | * pointers, which doesn't work with argument-macros. |
| 60 | 60 | */ |
| 61 | | - #define storage_num_drives() NUM_DRIVES |
| 62 | 61 | #if (CONFIG_STORAGE & STORAGE_ATA) |
| 63 | 62 | #define STORAGE_FUNCTION(NAME) (ata_## NAME) |
| 64 | | - #define storage_spindown ata_spindown |
| 65 | | - #define storage_sleep ata_sleep |
| 66 | | - #define storage_spin ata_spin |
| 67 | | - |
| 68 | | - #define storage_enable(on) ata_enable(on) |
| 69 | | - #define storage_sleepnow() ata_sleepnow() |
| 70 | | - #define storage_disk_is_active() ata_disk_is_active() |
| 71 | | - #define storage_soft_reset() ata_soft_reset() |
| 72 | | - #define storage_init() ata_init() |
| 73 | | - #define storage_close() ata_close() |
| 74 | | - #ifdef HAVE_STORAGE_FLUSH |
| 75 | | - #define storage_flush() (void)0 |
| 76 | | - #endif |
| 77 | | - #define storage_last_disk_activity() ata_last_disk_activity() |
| 78 | | - #define storage_get_identify() ata_get_identify() |
| 79 | | - |
| 80 | | - #ifdef HAVE_HOTSWAP |
| 81 | | - #define storage_removable(drive) ata_removable(IF_MD(drive)) |
| 82 | | - #define storage_present(drive) ata_present(IF_MD(drive)) |
| 83 | | - #endif |
| 84 | 63 | #elif (CONFIG_STORAGE & STORAGE_SD) |
| 85 | 64 | #define STORAGE_FUNCTION(NAME) (sd_## NAME) |
| 86 | | - #define storage_spindown sd_spindown |
| 87 | | - #define storage_sleep sd_sleep |
| 88 | | - #define storage_spin sd_spin |
| 89 | | - |
| 90 | | - #define storage_enable(on) sd_enable(on) |
| 91 | | - #define storage_sleepnow() sd_sleepnow() |
| 92 | | - #define storage_disk_is_active() 0 |
| 93 | | - #define storage_soft_reset() (void)0 |
| 94 | | - #define storage_init() sd_init() |
| 95 | | - #ifdef HAVE_STORAGE_FLUSH |
| 96 | | - #define storage_flush() (void)0 |
| 97 | | - #endif |
| 98 | | - #define storage_last_disk_activity() sd_last_disk_activity() |
| 99 | | - #define storage_get_identify() sd_get_identify() |
| 100 | | - |
| 101 | | - #ifdef HAVE_HOTSWAP |
| 102 | | - #define storage_removable(drive) sd_removable(IF_MD(drive)) |
| 103 | | - #define storage_present(drive) sd_present(IF_MD(drive)) |
| 104 | | - #endif |
| 105 | 65 | #elif (CONFIG_STORAGE & STORAGE_MMC) |
| 106 | 66 | #define STORAGE_FUNCTION(NAME) (mmc_## NAME) |
| 107 | | - #define storage_spindown mmc_spindown |
| 108 | | - #define storage_sleep mmc_sleep |
| 109 | | - #define storage_spin mmc_spin |
| 110 | | - |
| 111 | | - #define storage_enable(on) mmc_enable(on) |
| 112 | | - #define storage_sleepnow() mmc_sleepnow() |
| 113 | | - #define storage_disk_is_active() mmc_disk_is_active() |
| 114 | | - #define storage_soft_reset() (void)0 |
| 115 | | - #define storage_init() mmc_init() |
| 116 | | - #ifdef HAVE_STORAGE_FLUSH |
| 117 | | - #define storage_flush() (void)0 |
| 118 | | - #endif |
| 119 | | - #define storage_last_disk_activity() mmc_last_disk_activity() |
| 120 | | - #define storage_get_identify() mmc_get_identify() |
| 121 | | - |
| 122 | | - #ifdef HAVE_HOTSWAP |
| 123 | | - #define storage_removable(drive) mmc_removable(IF_MD(drive)) |
| 124 | | - #define storage_present(drive) mmc_present(IF_MD(drive)) |
| 125 | | - #endif |
| 126 | 67 | #elif (CONFIG_STORAGE & STORAGE_NAND) |
| 127 | 68 | #define STORAGE_FUNCTION(NAME) (nand_## NAME) |
| 128 | | - #define storage_spindown nand_spindown |
| 129 | | - #define storage_sleep nand_sleep |
| 130 | | - #define storage_spin nand_spin |
| 131 | | - |
| 132 | | - #define storage_enable(on) (void)0 |
| 133 | | - #define storage_sleepnow() nand_sleepnow() |
| 134 | | - #define storage_disk_is_active() 0 |
| 135 | | - #define storage_soft_reset() (void)0 |
| 136 | | - #define storage_init() nand_init() |
| 137 | | - #ifdef HAVE_STORAGE_FLUSH |
| 138 | | - #define storage_flush() nand_flush() |
| 139 | | - #endif |
| 140 | | - #define storage_last_disk_activity() nand_last_disk_activity() |
| 141 | | - #define storage_get_identify() nand_get_identify() |
| 142 | | - |
| 143 | | - #ifdef HAVE_HOTSWAP |
| 144 | | - #define storage_removable(drive) nand_removable(IF_MD(drive)) |
| 145 | | - #define storage_present(drive) nand_present(IF_MD(drive)) |
| 146 | | - #endif |
| 147 | 69 | #elif (CONFIG_STORAGE & STORAGE_RAMDISK) |
| 148 | 70 | #define STORAGE_FUNCTION(NAME) (ramdisk_## NAME) |
| 149 | | - #define storage_spindown ramdisk_spindown |
| 150 | | - #define storage_sleep ramdisk_sleep |
| 151 | | - #define storage_spin ramdisk_spin |
| 152 | | - |
| 153 | | - #define storage_enable(on) (void)0 |
| 154 | | - #define storage_sleepnow() ramdisk_sleepnow() |
| 155 | | - #define storage_disk_is_active() 0 |
| 156 | | - #define storage_soft_reset() (void)0 |
| 157 | | - #define storage_init() ramdisk_init() |
| 158 | | - #ifdef HAVE_STORAGE_FLUSH |
| 159 | | - #define storage_flush() (void)0 |
| 160 | | - #endif |
| 161 | | - #define storage_last_disk_activity() ramdisk_last_disk_activity() |
| 162 | | - #define storage_get_identify() ramdisk_get_identify() |
| 163 | | - |
| 164 | | - #ifdef HAVE_HOTSWAP |
| 165 | | - #define storage_removable(drive) ramdisk_removable(IF_MD(drive)) |
| 166 | | - #define storage_present(drive) ramdisk_present(IF_MD(drive)) |
| 167 | | - #endif |
| 168 | 71 | #else |
| 169 | 72 | //#error No storage driver! |
| 170 | 73 | #endif |
| 171 | | -#else /* NOT CONFIG_STORAGE_MULTI */ |
| | 74 | +#endif |
| 172 | 75 | |
| 173 | | -/* Simulator and multi-driver use normal functions */ |
| 174 | | - |
| 175 | 76 | void storage_enable(bool on); |
| 176 | 77 | void storage_sleep(void); |
| 177 | 78 | void storage_sleepnow(void); |
| — | — | @@ -187,8 +88,6 @@ |
| 188 | 89 | bool storage_present(int drive); |
| 189 | 90 | #endif |
| 190 | 91 | |
| 191 | | -#endif /* NOT CONFIG_STORAGE_MULTI */ |
| 192 | | - |
| 193 | 92 | int storage_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); |
| 194 | 93 | int storage_read_sectors_md(int drive, unsigned long start, int count, void* buf); |
| 195 | 94 | int storage_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); |