1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 Dave Chapman
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include "ata_idle_notify.h"
30 #include "ftl-target.h"
31 #include "nand-target.h"
33 /** static, private data **/
34 static bool initialized
= false;
37 int nand_read_sectors(IF_MD2(int drive
,) unsigned long start
, int incount
,
40 return ftl_read(start
, incount
, inbuf
);
43 int nand_write_sectors(IF_MD2(int drive
,) unsigned long start
, int count
,
46 return ftl_write(start
, count
, outbuf
);
49 void nand_spindown(int seconds
)
59 void nand_sleepnow(void)
69 void nand_enable(bool on
)
74 void nand_get_info(IF_MD2(int drive
,) struct storage_info
*info
)
76 uint32_t ppb
= ftl_banks
* (*ftl_nand_type
).pagesperblock
;
77 (*info
).sector_size
= SECTOR_SIZE
;
78 (*info
).num_sectors
= (*ftl_nand_type
).userblocks
* ppb
;
79 (*info
).vendor
= "Apple";
80 (*info
).product
= "iPod Nano 2G";
81 (*info
).revision
= "1.0";
84 long nand_last_disk_activity(void)
86 return nand_last_activity();
89 #ifdef HAVE_STORAGE_FLUSH
93 if (rc
!= 0) panicf("Failed to unmount flash: %X", rc
);
100 if (ftl_init()) return 1;
106 #ifdef CONFIG_STORAGE_MULTI
107 int nand_num_drives(int first_drive
)
109 /* We don't care which logical drive number(s) we have been assigned */