005-mtd.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. diff -Nurb linux-2.6.17/drivers/mtd/chips/cfi_cmdset_0001.c linux-2.6.17-patched/drivers/mtd/chips/cfi_cmdset_0001.c
  2. --- linux-2.6.17/drivers/mtd/chips/cfi_cmdset_0001.c 2006-06-17 18:49:35.000000000 -0700
  3. +++ linux-2.6.17-patched/drivers/mtd/chips/cfi_cmdset_0001.c 2006-09-25 11:27:06.000000000 -0700
  4. @@ -40,7 +40,7 @@
  5. /* #define CMDSET0001_DISABLE_WRITE_SUSPEND */
  6. // debugging, turns off buffer write mode if set to 1
  7. -#define FORCE_WORD_WRITE 0
  8. +#define FORCE_WORD_WRITE 1
  9. #define MANUFACTURER_INTEL 0x0089
  10. #define I82802AB 0x00ad
  11. diff -Nurb linux-2.6.17/drivers/mtd/maps/lubbock-flash.c linux-2.6.17-patched/drivers/mtd/maps/lubbock-flash.c
  12. --- linux-2.6.17/drivers/mtd/maps/lubbock-flash.c 2006-06-17 18:49:35.000000000 -0700
  13. +++ linux-2.6.17-patched/drivers/mtd/maps/lubbock-flash.c 2006-09-25 10:50:08.000000000 -0700
  14. @@ -26,6 +26,7 @@
  15. #include <asm/hardware.h>
  16. #include <asm/arch/pxa-regs.h>
  17. #include <asm/arch/lubbock.h>
  18. +#include <linux/mtd/concat.h>
  19. #define ROM_ADDR 0x00000000
  20. @@ -48,24 +49,27 @@
  21. .inval_cache = lubbock_map_inval_cache,
  22. } };
  23. -static struct mtd_partition lubbock_partitions[] = {
  24. +static struct mtd_partition lubbock_partitions[] =
  25. +{
  26. {
  27. - .name = "Bootloader",
  28. - .size = 0x00040000,
  29. - .offset = 0,
  30. - .mask_flags = MTD_WRITEABLE /* force read-only */
  31. - },{
  32. - .name = "Kernel",
  33. - .size = 0x00100000,
  34. - .offset = 0x00040000,
  35. - },{
  36. - .name = "Filesystem",
  37. - .size = MTDPART_SIZ_FULL,
  38. - .offset = 0x00140000
  39. - }
  40. + .name = "root",
  41. + .offset = 0x00410000
  42. + },
  43. + {
  44. + .name = "kernel",
  45. + .size = 0x00150000,
  46. + .offset = 0x000B0000
  47. + },
  48. + {
  49. + .name = "bootloader",
  50. + .size = 0x000B0000,
  51. + .offset = 0x00000000
  52. + },
  53. };
  54. +
  55. static struct mtd_info *mymtds[2];
  56. +static struct mtd_info *merged_mtd;
  57. static struct mtd_partition *parsed_parts[2];
  58. static int nr_parsed_parts[2];
  59. @@ -83,8 +87,8 @@
  60. printk(KERN_NOTICE "Lubbock configured to boot from %s (bank %d)\n",
  61. flashboot?"Flash":"ROM", flashboot);
  62. - lubbock_maps[flashboot^1].name = "Lubbock Application Flash";
  63. - lubbock_maps[flashboot].name = "Lubbock Boot ROM";
  64. + lubbock_maps[flashboot^1].name = "Flash-1";
  65. + lubbock_maps[flashboot].name = "Flash-0";
  66. for (i = 0; i < 2; i++) {
  67. lubbock_maps[i].virt = ioremap(lubbock_maps[i].phys, WINDOW_SIZE);
  68. @@ -125,25 +129,23 @@
  69. if (!mymtds[0] && !mymtds[1])
  70. return ret;
  71. - for (i = 0; i < 2; i++) {
  72. - if (!mymtds[i]) {
  73. - printk(KERN_WARNING "%s is absent. Skipping\n", lubbock_maps[i].name);
  74. - } else if (nr_parsed_parts[i]) {
  75. - add_mtd_partitions(mymtds[i], parsed_parts[i], nr_parsed_parts[i]);
  76. - } else if (!i) {
  77. - printk("Using static partitions on %s\n", lubbock_maps[i].name);
  78. - add_mtd_partitions(mymtds[i], lubbock_partitions, ARRAY_SIZE(lubbock_partitions));
  79. - } else {
  80. - printk("Registering %s as whole device\n", lubbock_maps[i].name);
  81. - add_mtd_device(mymtds[i]);
  82. - }
  83. - }
  84. + if (mymtds[0] && mymtds[1]) {
  85. + merged_mtd = mtd_concat_create(mymtds, 2, "Concated Flash #1 and #2");
  86. + if(merged_mtd)
  87. + add_mtd_partitions(merged_mtd, lubbock_partitions, ARRAY_SIZE(lubbock_partitions));
  88. + else
  89. + printk("YoKu: Failed to concate\n");
  90. return 0;
  91. + }
  92. }
  93. static void __exit cleanup_lubbock(void)
  94. {
  95. int i;
  96. +
  97. + del_mtd_partitions(merged_mtd);
  98. + map_destroy(merged_mtd);
  99. +
  100. for (i = 0; i < 2; i++) {