summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2008-07-15 21:32:20 +0000
committerRob Purchase <shotofadds@rockbox.org>2008-07-15 21:32:20 +0000
commit3352b265e68bf6f7e1e75325f6034c3301380004 (patch)
treea3cd1f484aee7fc6ac03d00935fe735cc9eee2b2 /firmware/target/arm
parent8189246cbc0b4a435015dcf49826fedc5e48382f (diff)
downloadrockbox-3352b265e68bf6f7e1e75325f6034c3301380004.tar.gz
rockbox-3352b265e68bf6f7e1e75325f6034c3301380004.zip
Update the Telechips NAND driver to use the nand_identify() function introduced in r18052.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18063 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/ata-nand-telechips.c56
1 files changed, 11 insertions, 45 deletions
diff --git a/firmware/target/arm/ata-nand-telechips.c b/firmware/target/arm/ata-nand-telechips.c
index fc4418cc44..b6ecab6091 100644
--- a/firmware/target/arm/ata-nand-telechips.c
+++ b/firmware/target/arm/ata-nand-telechips.c
@@ -24,6 +24,7 @@
24#include <string.h> 24#include <string.h>
25#include "led.h" 25#include "led.h"
26#include "panic.h" 26#include "panic.h"
27#include "nand_id.h"
27 28
28/* The NAND driver is currently work-in-progress and as such contains 29/* The NAND driver is currently work-in-progress and as such contains
29 some dead code and debug stuff, such as the next few lines. */ 30 some dead code and debug stuff, such as the next few lines. */
@@ -378,57 +379,22 @@ static void nand_get_chip_info(void)
378 379
379 manuf_id = id_buf[0]; 380 manuf_id = id_buf[0];
380 381
381 switch (manuf_id) 382 /* Identify the chip geometry */
382 { 383 struct nand_info* nand_data = nand_identify(id_buf);
383 case 0xEC: /* SAMSUNG */
384
385 switch(id_buf[1]) /* Chip Id */
386 {
387 case 0xD3: /* K9K8G08UOM */
388 384
389 page_size = 2048; 385 if (nand_data == NULL)
390 spare_size = 64;
391 pages_per_block = 64;
392 blocks_per_bank = 8192;
393 col_cycles = 2;
394 row_cycles = 3;
395
396 found = true;
397 break;
398
399 case 0xD5: /* K9LAG08UOM */
400
401 page_size = 2048;
402 spare_size = 64;
403 pages_per_block = 128;
404 blocks_per_bank = 8192;
405 col_cycles = 2;
406 row_cycles = 3;
407
408 found = true;
409 break;
410
411 case 0xD7: /* K9LBG08UOM */
412
413 page_size = 4096;
414 spare_size = 128;
415 pages_per_block = 128;
416 blocks_per_bank = 8192;
417 col_cycles = 2;
418 row_cycles = 3;
419
420 found = true;
421 break;
422 }
423 break;
424 }
425
426 if (!found)
427 { 386 {
428 panicf("Unknown NAND: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x", 387 panicf("Unknown NAND: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x",
429 id_buf[0],id_buf[1],id_buf[2],id_buf[3],id_buf[4]); 388 id_buf[0],id_buf[1],id_buf[2],id_buf[3],id_buf[4]);
430 } 389 }
431 390
391 page_size = nand_data->page_size;
392 spare_size = nand_data->spare_size;
393 pages_per_block = nand_data->pages_per_block;
394 blocks_per_bank = nand_data->blocks_per_bank;
395 col_cycles = nand_data->col_cycles;
396 row_cycles = nand_data->row_cycles;
397
432 pages_per_bank = blocks_per_bank * pages_per_block; 398 pages_per_bank = blocks_per_bank * pages_per_block;
433 segments_per_bank = blocks_per_bank / BLOCKS_PER_SEGMENT; 399 segments_per_bank = blocks_per_bank / BLOCKS_PER_SEGMENT;
434 bytes_per_segment = page_size * pages_per_block * BLOCKS_PER_SEGMENT; 400 bytes_per_segment = page_size * pages_per_block * BLOCKS_PER_SEGMENT;