003-wbd111-static-flash-map.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. --- a/arch/arm/mach-gemini/board-wbd111.c
  2. +++ b/arch/arm/mach-gemini/board-wbd111.c
  3. @@ -16,6 +16,8 @@
  4. #include <linux/skbuff.h>
  5. #include <linux/gpio_keys.h>
  6. #include <linux/mdio-gpio.h>
  7. +#include <linux/mtd/mtd.h>
  8. +#include <linux/mtd/partitions.h>
  9. #include <asm/mach-types.h>
  10. #include <asm/mach/arch.h>
  11. #include <asm/mach/time.h>
  12. @@ -102,12 +104,51 @@ static struct sys_timer wbd111_timer = {
  13. .init = gemini_timer_init,
  14. };
  15. +#ifdef CONFIG_MTD_PARTITIONS
  16. +static struct mtd_partition wbd111_partitions[] = {
  17. + {
  18. + .name = "RedBoot",
  19. + .offset = 0,
  20. + .size = 0x020000,
  21. + .mask_flags = MTD_WRITEABLE,
  22. + } , {
  23. + .name = "kernel",
  24. + .offset = 0x020000,
  25. + .size = 0x100000,
  26. + } , {
  27. + .name = "rootfs",
  28. + .offset = 0x120000,
  29. + .size = 0x6a0000,
  30. + } , {
  31. + .name = "VCTL",
  32. + .offset = 0x7c0000,
  33. + .size = 0x010000,
  34. + .mask_flags = MTD_WRITEABLE,
  35. + } , {
  36. + .name = "cfg",
  37. + .offset = 0x7d0000,
  38. + .size = 0x010000,
  39. + .mask_flags = MTD_WRITEABLE,
  40. + } , {
  41. + .name = "FIS",
  42. + .offset = 0x7e0000,
  43. + .size = 0x010000,
  44. + .mask_flags = MTD_WRITEABLE,
  45. + }
  46. +};
  47. +#define wbd111_num_partitions ARRAY_SIZE(wbd111_partitions)
  48. +#else
  49. +#define wbd111_partitions NULL
  50. +#define wbd111_num_partitions 0
  51. +#endif /* CONFIG_MTD_PARTITIONS */
  52. +
  53. static void __init wbd111_init(void)
  54. {
  55. gemini_gpio_init();
  56. platform_register_uart();
  57. platform_register_watchdog();
  58. - platform_register_pflash(SZ_8M, NULL, 0);
  59. + platform_register_pflash(SZ_8M, wbd111_partitions,
  60. + wbd111_num_partitions);
  61. platform_device_register(&wbd111_leds_device);
  62. platform_device_register(&wbd111_keys_device);
  63. platform_device_register(&wbd111_phy_device);