Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 23rd, 2010  |  syntax: Diff  |  size: 3.91 KB  |  hits: 98  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --- lf1000.c.original   2010-07-15 20:33:23.000000000 -0400
  2. +++ lf1000.c    2010-07-15 22:01:10.000000000 -0400
  3. @@ -81,9 +81,28 @@
  4.  const char *part_probes[] = { "cmdlinepart", NULL };
  5.  #endif
  6.  
  7. +//NIRV START
  8. +
  9. +#define CONFIG_NAND_LF1000_P0_SIZE 0x00020000
  10. +#define CONFIG_NAND_LF1000_P1_SIZE 0x000E0000
  11. +#define CONFIG_NAND_LF1000_P2_SIZE 0x00100000
  12. +#define CONFIG_NAND_LF1000_P3_SIZE 0x00200000
  13. +#define CONFIG_NAND_LF1000_P4_SIZE 0x00E00000
  14. +#define CONFIG_NAND_LF1000_P5_SIZE 0x00200000
  15. +#define CONFIG_NAND_LF1000_P6_SIZE 0x00E00000
  16. +#define CONFIG_NAND_LF1000_P7_SIZE 0x0DE00000
  17. +
  18. +
  19. +/*
  20. + * Define partitions for flash devices
  21. + */
  22. +
  23. +#if defined (CONFIG_MACH_ME_MP2530F)
  24. +#define LF_ERASE_BLK 0x4000
  25. +#else
  26.  /* All other boards have big erase blocks */
  27. -/* TODO: FIXME: when MLC NAND is used, this ought to be 0x40000 */
  28. -#define LF_ERASE_BLK 0x40000
  29. +#define LF_ERASE_BLK 0x20000
  30. +#endif
  31.  
  32.  /* Just shortening the names for clearer code */
  33.  #define LF_P0 (CONFIG_NAND_LF1000_P0_SIZE)
  34. @@ -91,6 +110,76 @@
  35.  #define LF_P2 (CONFIG_NAND_LF1000_P2_SIZE)
  36.  #define LF_P3 (CONFIG_NAND_LF1000_P3_SIZE)
  37.  #define LF_P4 (CONFIG_NAND_LF1000_P4_SIZE)
  38. +#define LF_P5 (CONFIG_NAND_LF1000_P5_SIZE)
  39. +#define LF_P6 (CONFIG_NAND_LF1000_P6_SIZE)
  40. +#define LF_P7 (CONFIG_NAND_LF1000_P7_SIZE)
  41. +
  42. +#if ((LF_P0 % LF_ERASE_BLK) || (LF_P1 % LF_ERASE_BLK) || \
  43. +       (LF_P2 % LF_ERASE_BLK) || (LF_P3 % LF_ERASE_BLK) || \
  44. +       (LF_P4 % LF_ERASE_BLK) || (LF_P5 % LF_ERASE_BLK) || \
  45. +       (LF_P6 % LF_ERASE_BLK) || (LF_P7 % LF_ERASE_BLK))
  46. +#error "NAND partitions must be multiple of erase block."
  47. +#endif
  48. +
  49. +static struct mtd_partition partition_info[] = {
  50. +       { .name         = "LF1000_uniboot",
  51. +         .offset       = 0,
  52. +         .size         = LF_P0},
  53. +       { .name         = "Atomic_Boot_Flags",
  54. +         .offset       = LF_P0,
  55. +         .size         = LF_P1 },
  56. +       { .name         = "Manufacturing_Data",
  57. +         .offset       = LF_P0 + LF_P1,
  58. +         .size         = LF_P2},
  59. +       { .name         = "Kernel0",
  60. +         .offset       = LF_P0 + LF_P1 + LF_P2,
  61. +         .size         = LF_P3 },
  62. +       { .name         = "Linux_RFS0",
  63. +         .offset       = LF_P0 + LF_P1 + LF_P2 + LF_P3,
  64. +         .size         = LF_P4 },
  65. +       { .name         = "Kernel1",
  66. +         .offset       = LF_P0 + LF_P1 + LF_P2 + LF_P3 + LF_P4,
  67. +         .size         = LF_P5 },
  68. +       { .name         = "Linux_RFS1",
  69. +         .offset       = LF_P0 + LF_P1 + LF_P2 + LF_P3 + LF_P4 + LF_P5,
  70. +         .size         = LF_P6 },
  71. +       { .name         = "Brio",
  72. +         .offset       = LF_P0 + LF_P1 + LF_P2 + LF_P3 + LF_P4 + LF_P5 + LF_P6,
  73. +         .size         = LF_P7 },
  74. +       { .name         = "EXT",
  75. +         .offset       = LF_P0 + LF_P1 + LF_P2 + LF_P3 + LF_P4 + LF_P5 + LF_P6 + LF_P7,
  76. +         .size         = MTDPART_SIZ_FULL },
  77. +};
  78. +
  79. +static struct mtd_partition partition_info_cart[] = {
  80. +       { .name         = "Cartridge",
  81. +         .offset       = 0,
  82. +         .size         = MTDPART_SIZ_FULL },
  83. +};
  84. +
  85. +#undef LF_P0
  86. +#undef LF_P1
  87. +#undef LF_P2
  88. +#undef LF_P3
  89. +#undef LF_P4
  90. +#undef LF_P5
  91. +#undef LF_P6
  92. +#undef LF_P7
  93. +#undef LF_ERASE_BLK
  94. +
  95. +//NIRV-END
  96. +
  97. +/* All other boards have big erase blocks */
  98. +/* TODO: FIXME: when MLC NAND is used, this ought to be 0x40000 */
  99. +
  100. +//#define LF_ERASE_BLK 0x40000
  101. +
  102. +/* Just shortening the names for clearer code */
  103. +/*#define LF_P0 (CONFIG_NAND_LF1000_P0_SIZE)
  104. +#define LF_P1 (CONFIG_NAND_LF1000_P1_SIZE)
  105. +#define LF_P2 (CONFIG_NAND_LF1000_P2_SIZE)
  106. +#define LF_P3 (CONFIG_NAND_LF1000_P3_SIZE)
  107. +#define LF_P4 (CONFIG_NAND_LF1000_P4_SIZE)
  108.  
  109.  #if ((LF_P0 % LF_ERASE_BLK) || (LF_P1 % LF_ERASE_BLK) || \
  110.       (LF_P2 % LF_ERASE_BLK) || (LF_P3 % LF_ERASE_BLK) || \
  111. @@ -134,6 +223,13 @@
  112.  #undef LF_P3
  113.  #undef LF_P4
  114.  #undef LF_ERASE_BLK
  115. +*/
  116. +
  117. +
  118. +
  119. +
  120. +
  121. +
  122.  
  123.  /* Ask gpio driver, which sampled this at boot time. */
  124.  static u8 get_cart_type(void)
  125. @@ -998,8 +1094,8 @@
  126.         if (base_parts_nb == 0) {
  127.                 if (gpio_get_boot_source_config() == SCRATCH_BOOT_SOURCE_USB)
  128.                 {
  129. -                       base_parts = partition_info_recovery;
  130. -                       base_parts_nb = ARRAY_SIZE(partition_info_recovery);
  131. +               //      base_parts = partition_info_recovery;
  132. +               //      base_parts_nb = ARRAY_SIZE(partition_info_recovery);
  133.                 }
  134.                 else
  135.                 {