comparison src/cs/drivers/drv_app/ffs/board/dev.c @ 528:63cedcedea87

FFS dev.c flash device table reworked as described in TCS211-fw-arch
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 13 Oct 2018 07:38:13 +0000
parents 43853399dbee
children b48e9892ee65
comparison
equal deleted inserted replaced
527:343104963a7f 528:63cedcedea87
126 { 0x780000, 18 }, 126 { 0x780000, 18 },
127 { 0x7C0000, 18 } 127 { 0x7C0000, 18 }
128 }; 128 };
129 #endif 129 #endif
130 130
131 #ifdef CONFIG_TARGET_LEONARDO
131 // 128x64kb 132 // 128x64kb
132 static const struct block_info_s flash_128x64[] = 133 static const struct block_info_s flash_128x64[] =
133 { 134 {
134 { 0x00000, 16 }, 135 { 0x00000, 16 },
135 { 0x10000, 16 }, 136 { 0x10000, 16 },
258 { 0x7c0000, 16 }, 259 { 0x7c0000, 16 },
259 { 0x7d0000, 16 }, 260 { 0x7d0000, 16 },
260 { 0x7e0000, 16 }, 261 { 0x7e0000, 16 },
261 { 0x7f0000, 16 } 262 { 0x7f0000, 16 }
262 }; 263 };
264 #endif
263 265
264 // 16x64kB 266 // 16x64kB
265 static const struct block_info_s flash_16x64[] = 267 static const struct block_info_s flash_16x64[] =
266 { 268 {
267 { 0x00000, 16 }, 269 { 0x00000, 16 },
342 * 0xYYZZ. 344 * 0xYYZZ.
343 ******************************************************************************/ 345 ******************************************************************************/
344 346
345 const struct flash_info_s flash_info[] = 347 const struct flash_info_s flash_info[] =
346 { 348 {
349 #if 0
347 //BOARD 34. Ram device 4x4kB. Note it is necessary to hardwire the conf 350 //BOARD 34. Ram device 4x4kB. Note it is necessary to hardwire the conf
348 //in cfgffs.c 351 //in cfgffs.c
349 { &flash_4x4[0], 0, MANUFACT_RAM, 0x0404, 352 { &flash_4x4[0], 0, MANUFACT_RAM, 0x0404,
350 FFS_DRIVER_RAM, 4}, 353 FFS_DRIVER_RAM, 4},
351 354
352 // Ram device 8x8kB. Note it is necessary to hardwire the conf in cfgffs.c 355 // Ram device 8x8kB. Note it is necessary to hardwire the conf in cfgffs.c
353 { &flash_8x8[0], 0, MANUFACT_RAM, 0x080D, 356 { &flash_8x8[0], 0, MANUFACT_RAM, 0x080D,
354 FFS_DRIVER_RAM, 8}, 357 FFS_DRIVER_RAM, 8},
355 358 #endif
356 /********** AMD Devices ***********************************************/
357 359
358 #ifdef CONFIG_TARGET_PIRELLI 360 #ifdef CONFIG_TARGET_PIRELLI
361
359 // Spansion S71PL129NC0 used in Pirelli DP-L10 362 // Spansion S71PL129NC0 used in Pirelli DP-L10
360 // ID made up (same as what Pirelli's fw uses), not using autodetect 363 // ID made up (same as what Pirelli's fw uses), not using autodetect
361 // This is an aftermarket FFS config for the Pirelli target 364 // This is an aftermarket FFS config for the Pirelli target
362 { &flash_32x256[0], (char *) 0x02480000, MANUFACT_AMD, 0x2101, 365 { &flash_32x256[0], (char *) 0x02480000, MANUFACT_AMD, 0x2101,
363 FFS_DRIVER_AMD, 6 }, 366 FFS_DRIVER_AMD, 6 },
364 #endif 367
365 368 #elif defined(CONFIG_TARGET_FCFAM)
366 #ifdef CONFIG_TARGET_FCFAM 369
367 // We are using the same flash+pSRAM chip in our own 370 // We are using the same flash+pSRAM chip in our own
368 // FreeCalypso hardware designs, but on a different chip select. 371 // FreeCalypso hardware designs, but on a different chip select.
369 // Let's use the first 2 MiB of the 2nd bank for the FFS. 372 // Let's use the first 2 MiB of the 2nd bank for the FFS.
370 { &flash_32x256[0], (char *) 0x01800000, MANUFACT_AMD, 0x2101, 373 { &flash_32x256[0], (char *) 0x01800000, MANUFACT_AMD, 0x2101,
371 FFS_DRIVER_AMD, 8 }, 374 FFS_DRIVER_AMD, 8 },
372 #endif 375
373 376 #elif defined(CONFIG_TARGET_COMPAL)
374 // AMD Am29DL640F. Ignoring the 8kB sectors 377
375 // Multi-id device: 0x227E, 0x2221, 0x2200. Converted to 0x2100 378 /* aftermarket FFS configurations for FreeCalypso on Mot C1xx phones */
376 { &flash_16x64[0], (char *) 0x01800000, MANUFACT_AMD, 0x2100,
377 FFS_DRIVER_AMD, 15 },
378
379 // AMD Am29DL640G. Ignoring the 8kB sectors
380 // Multi-id device: 0x227E, 0x2202, 0x2201. Converted to 0x0201
381 { &flash_16x64[0], (char *) 0x700000, MANUFACT_AMD, 0x0201,
382 FFS_DRIVER_AMD, 15 },
383
384 // AMD Am29DL321DT does not exist as of 2000-0217
385
386 // AMD Am29DL322DT. Ignoring the 8kB sectors
387 { &flash_16x64[0], (char *) 0x380000, MANUFACT_AMD, 0x2255,
388 FFS_DRIVER_AMD_SB, 7 },
389
390 // AMD Am29DL323DT. Ignoring the 8kB sectors
391 { &flash_16x64[0], (char *) 0x300000, MANUFACT_AMD, 0x2250,
392 FFS_DRIVER_AMD, 15 },
393
394 // AMD Am29DL161DT. Using 8x8kB sectors.
395 { &flash_8x8[0], (char *) 0x1F0000, MANUFACT_AMD, 0x2236,
396 FFS_DRIVER_AMD, 8 },
397
398 // AMD Am29DL162DT. Ignoring the 8kB sectors
399 { &flash_16x64[0], (char *) 0x1C0000, MANUFACT_AMD, 0x222D,
400 FFS_DRIVER_AMD, 3 },
401
402 // AMD Am29DL163DT. Ignoring the 8kB sectors
403 { &flash_16x64[0], (char *) 0x180000, MANUFACT_AMD, 0x2228,
404 FFS_DRIVER_AMD, 7 },
405
406 // AMD Am29DL164DT. Ignoring the 8kB sectors
407 { &flash_16x64[0], (char *) 0x100000, MANUFACT_AMD, 0x2233,
408 FFS_DRIVER_AMD, 15 },
409
410
411 /********** Fujitsu Devices *******************************************/
412
413 // Fujitsu MBM29DL321TD. Using 8x8kB sectors.
414 { &flash_8x8[0], (char *) 0x3f0000, MANUFACT_FUJITSU, 0x2259,
415 FFS_DRIVER_AMD, 8 },
416
417 // Fujitsu MBM29DL322TD. Ignoring all the 8kB sectors
418 { &flash_16x64[0], (char *) 0x380000, MANUFACT_FUJITSU, 0x2255,
419 FFS_DRIVER_AMD, 7 },
420
421 // Fujitsu MBM29DL323TD (BSample). Dual bank device definition.
422 { &flash_16x64[0], (char *) 0x300000, MANUFACT_FUJITSU, 0x2250,
423 FFS_DRIVER_AMD, 15 },
424
425 // Fujitsu MBM29DL161DT (similar to Am29DL161T).
426 { &flash_8x8[0], (char *) 0x1F0000, MANUFACT_FUJITSU, 0x2236,
427 FFS_DRIVER_AMD, 8 },
428
429 // Fujitsu MBM29DL162DT (similar to Am29DL162T).
430 { &flash_16x64[0], (char *) 0x1C0000, MANUFACT_FUJITSU, 0x222D,
431 FFS_DRIVER_AMD, 3 },
432
433 // Fujitsu MBM29DL163DT (similar to Am29DL163T).
434 { &flash_16x64[0], (char *) 0x180000, MANUFACT_FUJITSU, 0x2228,
435 FFS_DRIVER_AMD, 7 },
436
437 // Fujitsu MBM29DL164DT (similar to Am29DL164T).
438 { &flash_16x64[0], (char *) 0x100000, MANUFACT_FUJITSU, 0x2233,
439 FFS_DRIVER_AMD, 15 },
440
441 /* This is the RITA flash configuration */
442 // Fujitsu MBM29DL320FB
443 // Multi-id device: 0x227E, 0x220A, 0x2200. Converted to 0x0A00
444 { &flash_16x64[0], (char *) 0x320000, MANUFACT_FUJITSU, 0x0A00,
445 FFS_DRIVER_AMD_SB, 13 },
446
447 // Fujitsu MBM29DL320FT
448 // Multi-id device: 0x227E, 0x220A, 0x2201. Converted to 0x0A01
449 { &flash_16x64[0], (char *) 0x320000, MANUFACT_FUJITSU, 0x0A01,
450 FFS_DRIVER_AMD_SB, 13 },
451
452 // Fujitsu MBM29DL640F,
453 // Multi-id device: 0x227E, 0x2221, 0x2200. Converted to 0x2100
454 { &flash_16x64[0], (char *) 0x700000, MANUFACT_FUJITSU, 0x2100,
455 FFS_DRIVER_AMD_SB, 15 },
456
457 // Fujitsu 84VF5F5F4J2,
458 // Multi-id device: 0x227E, 0x2202, 0x2201. Converted to 0x0201
459 { &flash_16x64[0], (char *) 0x700000, MANUFACT_FUJITSU, 0x0201,
460 FFS_DRIVER_AMD_SB, 15 },
461
462 // Fujitsu MB84VF5F5F4J2 stacked device. Using the 2nd sub device
463 // The 8x8 are located both in top and bottom, thus only 126
464 // blocks are used.
465 { &flash_128x64[0], (char *) 0x1810000, MANUFACT_FUJITSU, 0xB496,
466 FFS_DRIVER_AMD_SB, 126 },
467
468 /********** Intel Devices *********************************************/
469 379
470 // Intel 28F160C3-T 16Mb. Using top-most 8x8kB (parameter) sectors. 380 // Intel 28F160C3-T 16Mb. Using top-most 8x8kB (parameter) sectors.
471 #if defined(CONFIG_TARGET_C139) || defined(CONFIG_TARGET_C11X)
472 // Changed for C11x aftermarket FFS config: 64x3 at 0x1C0000 381 // Changed for C11x aftermarket FFS config: 64x3 at 0x1C0000
473 { &flash_16x64[0], (char *) 0x1C0000, MANUFACT_INTEL, 0x88C2, 382 { &flash_16x64[0], (char *) 0x1C0000, MANUFACT_INTEL, 0x88C2,
474 FFS_DRIVER_INTEL_SB, 3 }, 383 FFS_DRIVER_INTEL_SB, 3 },
475 #else
476 { &flash_8x8[0], (char *) 0x1F0000, MANUFACT_INTEL, 0x88C2,
477 FFS_DRIVER_INTEL_SB, 8 },
478 #endif
479 384
480 /* 385 /*
481 * A user in the field found that some Mot C11x phones have 2 MiB 386 * A user in the field found that some Mot C11x phones have 2 MiB
482 * of flash, but use some different flash chip, not our familiar 387 * of flash, but use some different flash chip, not our familiar
483 * 28F160C3-T. This chip reports manufacturer ID 0x20 and device 388 * 28F160C3-T. This chip reports manufacturer ID 0x20 and device
486 * as equivalent to our familiar one. 391 * as equivalent to our familiar one.
487 */ 392 */
488 { &flash_16x64[0], (char *) 0x1C0000, 0x20, 0x88CE, 393 { &flash_16x64[0], (char *) 0x1C0000, 0x20, 0x88CE,
489 FFS_DRIVER_INTEL_SB, 3 }, 394 FFS_DRIVER_INTEL_SB, 3 },
490 395
396 // Intel 28F320C3-T, 32Mb. Using top-most 8x8kB (parameter) sectors.
397 // Changed for C139 aftermarket FFS config: 64x3 at 0x3C0000
398 { &flash_16x64[0], (char *) 0x3C0000, MANUFACT_INTEL, 0x88C4,
399 FFS_DRIVER_INTEL_SB, 3 },
400
401 // Intel 28F640C3-B, 64Mb. Using top-most 16x64kB sectors
402 // Changed for C155 aftermarket FFS config: 64x13 at 0x700000
403 { &flash_16x64[0], (char *) 0x700000, MANUFACT_INTEL, 0x88CD,
404 FFS_DRIVER_INTEL_SB, 13 },
405
406 #else
407
408 /* original table from TI/Openmoko, used on TI and Openmoko targets */
409
410 /********** AMD Devices ***********************************************/
411
412 #ifdef CONFIG_TARGET_LEONARDO
413 // AMD Am29DL640F. Ignoring the 8kB sectors
414 // Multi-id device: 0x227E, 0x2221, 0x2200. Converted to 0x2100
415 { &flash_16x64[0], (char *) 0x01800000, MANUFACT_AMD, 0x2100,
416 FFS_DRIVER_AMD, 15 },
417 #endif
418
419 // AMD Am29DL640G. Ignoring the 8kB sectors
420 // Multi-id device: 0x227E, 0x2202, 0x2201. Converted to 0x0201
421 { &flash_16x64[0], (char *) 0x700000, MANUFACT_AMD, 0x0201,
422 FFS_DRIVER_AMD, 15 },
423
424 // AMD Am29DL321DT does not exist as of 2000-0217
425
426 // AMD Am29DL322DT. Ignoring the 8kB sectors
427 { &flash_16x64[0], (char *) 0x380000, MANUFACT_AMD, 0x2255,
428 FFS_DRIVER_AMD_SB, 7 },
429
430 // AMD Am29DL323DT. Ignoring the 8kB sectors
431 { &flash_16x64[0], (char *) 0x300000, MANUFACT_AMD, 0x2250,
432 FFS_DRIVER_AMD, 15 },
433
434 // AMD Am29DL161DT. Using 8x8kB sectors.
435 { &flash_8x8[0], (char *) 0x1F0000, MANUFACT_AMD, 0x2236,
436 FFS_DRIVER_AMD, 8 },
437
438 // AMD Am29DL162DT. Ignoring the 8kB sectors
439 { &flash_16x64[0], (char *) 0x1C0000, MANUFACT_AMD, 0x222D,
440 FFS_DRIVER_AMD, 3 },
441
442 // AMD Am29DL163DT. Ignoring the 8kB sectors
443 { &flash_16x64[0], (char *) 0x180000, MANUFACT_AMD, 0x2228,
444 FFS_DRIVER_AMD, 7 },
445
446 // AMD Am29DL164DT. Ignoring the 8kB sectors
447 { &flash_16x64[0], (char *) 0x100000, MANUFACT_AMD, 0x2233,
448 FFS_DRIVER_AMD, 15 },
449
450
451 /********** Fujitsu Devices *******************************************/
452
453 // Fujitsu MBM29DL321TD. Using 8x8kB sectors.
454 { &flash_8x8[0], (char *) 0x3f0000, MANUFACT_FUJITSU, 0x2259,
455 FFS_DRIVER_AMD, 8 },
456
457 // Fujitsu MBM29DL322TD. Ignoring all the 8kB sectors
458 { &flash_16x64[0], (char *) 0x380000, MANUFACT_FUJITSU, 0x2255,
459 FFS_DRIVER_AMD, 7 },
460
461 // Fujitsu MBM29DL323TD (BSample). Dual bank device definition.
462 { &flash_16x64[0], (char *) 0x300000, MANUFACT_FUJITSU, 0x2250,
463 FFS_DRIVER_AMD, 15 },
464
465 // Fujitsu MBM29DL161DT (similar to Am29DL161T).
466 { &flash_8x8[0], (char *) 0x1F0000, MANUFACT_FUJITSU, 0x2236,
467 FFS_DRIVER_AMD, 8 },
468
469 // Fujitsu MBM29DL162DT (similar to Am29DL162T).
470 { &flash_16x64[0], (char *) 0x1C0000, MANUFACT_FUJITSU, 0x222D,
471 FFS_DRIVER_AMD, 3 },
472
473 // Fujitsu MBM29DL163DT (similar to Am29DL163T).
474 { &flash_16x64[0], (char *) 0x180000, MANUFACT_FUJITSU, 0x2228,
475 FFS_DRIVER_AMD, 7 },
476
477 // Fujitsu MBM29DL164DT (similar to Am29DL164T).
478 { &flash_16x64[0], (char *) 0x100000, MANUFACT_FUJITSU, 0x2233,
479 FFS_DRIVER_AMD, 15 },
480
481 /* This is the RITA flash configuration */
482 // Fujitsu MBM29DL320FB
483 // Multi-id device: 0x227E, 0x220A, 0x2200. Converted to 0x0A00
484 { &flash_16x64[0], (char *) 0x320000, MANUFACT_FUJITSU, 0x0A00,
485 FFS_DRIVER_AMD_SB, 13 },
486
487 // Fujitsu MBM29DL320FT
488 // Multi-id device: 0x227E, 0x220A, 0x2201. Converted to 0x0A01
489 { &flash_16x64[0], (char *) 0x320000, MANUFACT_FUJITSU, 0x0A01,
490 FFS_DRIVER_AMD_SB, 13 },
491
492 // Fujitsu MBM29DL640F,
493 // Multi-id device: 0x227E, 0x2221, 0x2200. Converted to 0x2100
494 { &flash_16x64[0], (char *) 0x700000, MANUFACT_FUJITSU, 0x2100,
495 FFS_DRIVER_AMD_SB, 15 },
496
497 // Fujitsu 84VF5F5F4J2,
498 // Multi-id device: 0x227E, 0x2202, 0x2201. Converted to 0x0201
499 { &flash_16x64[0], (char *) 0x700000, MANUFACT_FUJITSU, 0x0201,
500 FFS_DRIVER_AMD_SB, 15 },
501
502 #ifdef CONFIG_TARGET_LEONARDO
503 // Fujitsu MB84VF5F5F4J2 stacked device. Using the 2nd sub device
504 // The 8x8 are located both in top and bottom, thus only 126
505 // blocks are used.
506 { &flash_128x64[0], (char *) 0x1810000, MANUFACT_FUJITSU, 0xB496,
507 FFS_DRIVER_AMD_SB, 126 },
508 #endif
509
510 /********** Intel Devices *********************************************/
511
512 // Intel 28F160C3-T 16Mb. Using top-most 8x8kB (parameter) sectors.
513 { &flash_8x8[0], (char *) 0x1F0000, MANUFACT_INTEL, 0x88C2,
514 FFS_DRIVER_INTEL_SB, 8 },
515
491 // Intel 28F160C3-B, 16Mb. Using top-most 6x64kB sectors 516 // Intel 28F160C3-B, 16Mb. Using top-most 6x64kB sectors
492 { &flash_16x64[0], (char *) 0x1A0000, MANUFACT_INTEL, 0x88C3, 517 { &flash_16x64[0], (char *) 0x1A0000, MANUFACT_INTEL, 0x88C3,
493 FFS_DRIVER_INTEL_SB, 6 }, 518 FFS_DRIVER_INTEL_SB, 6 },
494 519
495 // Intel 28F320C3-T, 32Mb. Using top-most 8x8kB (parameter) sectors. 520 // Intel 28F320C3-T, 32Mb. Using top-most 8x8kB (parameter) sectors.
496 #if defined(CONFIG_TARGET_C139) || defined(CONFIG_TARGET_C11X)
497 // Changed for C139 aftermarket FFS config: 64x3 at 0x3C0000
498 { &flash_16x64[0], (char *) 0x3C0000, MANUFACT_INTEL, 0x88C4,
499 FFS_DRIVER_INTEL_SB, 3 },
500 #else
501 { &flash_8x8[0], (char *) 0x3F0000, MANUFACT_INTEL, 0x88C4, 521 { &flash_8x8[0], (char *) 0x3F0000, MANUFACT_INTEL, 0x88C4,
502 FFS_DRIVER_INTEL_SB, 8 }, 522 FFS_DRIVER_INTEL_SB, 8 },
503 #endif
504 523
505 // Intel 28F320C3-B, 32Mb. Using top-most 8x64kB sectors 524 // Intel 28F320C3-B, 32Mb. Using top-most 8x64kB sectors
506 { &flash_16x64[0], (char *) 0x380000, MANUFACT_INTEL, 0x88C5, 525 { &flash_16x64[0], (char *) 0x380000, MANUFACT_INTEL, 0x88C5,
507 FFS_DRIVER_INTEL_SB, 8 }, 526 FFS_DRIVER_INTEL_SB, 8 },
508 527
577 596
578 // Toshiba TH50VSF2581AASB Bottom boot combo device 597 // Toshiba TH50VSF2581AASB Bottom boot combo device
579 { &flash_16x64[0], (char *) 0x380000, MANUFACT_TOSHIBA, 0x009C, 598 { &flash_16x64[0], (char *) 0x380000, MANUFACT_TOSHIBA, 0x009C,
580 FFS_DRIVER_AMD, 8 }, 599 FFS_DRIVER_AMD, 8 },
581 600
582 601 #endif
602
603 #if 0
583 /********** Special/Test Devices **************************************/ 604 /********** Special/Test Devices **************************************/
584 605
585 // Intel 28F160C3-B, 16Mb. Single bank driver 606 // Intel 28F160C3-B, 16Mb. Single bank driver
586 // Note that device ID is bogus! 607 // Note that device ID is bogus!
587 { &flash_16x64[0], (char *) 0x1A0000, MANUFACT_INTEL, 0x01C3, 608 { &flash_16x64[0], (char *) 0x1A0000, MANUFACT_INTEL, 0x01C3,
620 FFS_DRIVER_TEST, 8 }, 641 FFS_DRIVER_TEST, 8 },
621 642
622 // PC Test/Simulation flash 4x4kB 643 // PC Test/Simulation flash 4x4kB
623 { &flash_4x4[0], (char *) 0x000000, MANUFACT_TEST, 0x0404, 644 { &flash_4x4[0], (char *) 0x000000, MANUFACT_TEST, 0x0404,
624 FFS_DRIVER_TEST, 4 }, 645 FFS_DRIVER_TEST, 4 },
646 #endif
625 647
626 // terminator 648 // terminator
627 { 0, 0, 0, 0 } 649 { 0, 0, 0, 0 }
628 }; 650 };
629 651