summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2009-06-24 07:36:56 +0000
committerRob Purchase <shotofadds@rockbox.org>2009-06-24 07:36:56 +0000
commit5e24a2c98c9a7eb1b725c9bbb0233f9cf82004fb (patch)
treea7efb44359a67cffe75382a6af1b265ef4d38ffc
parent4e3f39fc45f9efe29826ab4d480b3f3df47cd5ac (diff)
downloadrockbox-5e24a2c98c9a7eb1b725c9bbb0233f9cf82004fb.zip
rockbox-5e24a2c98c9a7eb1b725c9bbb0233f9cf82004fb.tar.gz
rockbox-5e24a2c98c9a7eb1b725c9bbb0233f9cf82004fb.tar.bz2
rockbox-5e24a2c98c9a7eb1b725c9bbb0233f9cf82004fb.tar.xz
Fix an error in the TCC NAND driver which caused a panic on startup for certain users.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21485 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/ata-nand-telechips.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/firmware/target/arm/ata-nand-telechips.c b/firmware/target/arm/ata-nand-telechips.c
index ceabf96..30ca302 100644
--- a/firmware/target/arm/ata-nand-telechips.c
+++ b/firmware/target/arm/ata-nand-telechips.c
@@ -822,21 +822,23 @@ int nand_init(void)
16, spare_buf);
int type = get_sector_type(spare_buf);
-
+
+#ifdef FTL_V2
if (type == SECTYPE_MAIN_INPLACE_CACHE)
{
- /* Check last sector of sequential write cache block */
+ /* Since this type of segment is written to sequentially, its
+ job is complete if the final page has been written. In this
+ case we need to treat it as a normal data segment. */
nand_read_raw(bank, phys_segment_to_page_addr
(phys_segment, pages_per_segment - 1),
- nand_data->page_size + nand_data->spare_size - 16,
- 16, spare_buf);
+ SECTOR_SIZE, 16, spare_buf);
- /* If last sector has been written, treat block as main data */
if (get_sector_type(spare_buf) != 0xff)
{
type = SECTYPE_MAIN_DATA;
}
}
+#endif
switch (type)
{