summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2009-10-17 23:00:49 +0000
committerMichael Sparmann <theseven@rockbox.org>2009-10-17 23:00:49 +0000
commit4562e683a2b39414cf60a7136e2a4cbb1b419373 (patch)
treeefa9c81bcb8a1bc1b7504607b174f60bd8453621 /firmware
parent8f1709f434e88546f556e8971312b8e2162dbca7 (diff)
Implement iPod Nano 2G nand_get_info()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23238 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/s5l8700/ata-nand-s5l8700.c7
-rw-r--r--firmware/target/arm/s5l8700/ipodnano2g/ftl-target.h6
2 files changed, 12 insertions, 1 deletions
diff --git a/firmware/target/arm/s5l8700/ata-nand-s5l8700.c b/firmware/target/arm/s5l8700/ata-nand-s5l8700.c
index ce1fa4df5f..88611fed34 100644
--- a/firmware/target/arm/s5l8700/ata-nand-s5l8700.c
+++ b/firmware/target/arm/s5l8700/ata-nand-s5l8700.c
@@ -90,7 +90,12 @@ void nand_enable(bool on)
void nand_get_info(IF_MD2(int drive,) struct storage_info *info)
{
- (void)info;
+ uint32_t ppb = ftl_banks * (*ftl_nand_type).pagesperblock;
+ (*info).sector_size = SECTOR_SIZE;
+ (*info).num_sectors = (*ftl_nand_type).userblocks * ppb;
+ (*info).vendor = "Apple";
+ (*info).product = "iPod Nano 2G";
+ (*info).revision = "1.0";
}
long nand_last_disk_activity(void)
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/ftl-target.h b/firmware/target/arm/s5l8700/ipodnano2g/ftl-target.h
index cb943e34f2..ad4dc04db1 100644
--- a/firmware/target/arm/s5l8700/ipodnano2g/ftl-target.h
+++ b/firmware/target/arm/s5l8700/ipodnano2g/ftl-target.h
@@ -30,6 +30,12 @@
#define FTL_READONLY
#endif
+/* Pointer to an info structure regarding the flash type used */
+const struct nand_device_info_type* ftl_nand_type;
+
+/* Number of banks we detected a chip on */
+uint32_t ftl_banks;
+
uint32_t ftl_init(void);
uint32_t ftl_read(uint32_t sector, uint32_t count, void* buffer);
uint32_t ftl_write(uint32_t sector, uint32_t count, const void* buffer);