008-verdex_mtd_support.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --- a/arch/arm/mach-pxa/gumstix-verdex.c
  2. +++ b/arch/arm/mach-pxa/gumstix-verdex.c
  3. @@ -51,6 +51,46 @@
  4. #include <linux/delay.h>
  5. +static struct resource flash_resource = {
  6. + .start = 0x00000000,
  7. + .end = SZ_64M - 1,
  8. + .flags = IORESOURCE_MEM,
  9. +};
  10. +
  11. +static struct mtd_partition gumstix_partitions[] = {
  12. + {
  13. + .name = "u-boot",
  14. + .size = 0x00040000,
  15. + .offset = 0,
  16. + .mask_flags = MTD_WRITEABLE /* force read-only */
  17. + } , {
  18. + .name = "rootfs",
  19. + .size = 0x01ec0000,
  20. + .offset = 0x00040000
  21. + } , {
  22. + .name = "kernel",
  23. + .size = 0x00100000,
  24. + .offset = 0x01f00000
  25. + }
  26. +};
  27. +
  28. +static struct flash_platform_data gumstix_flash_data = {
  29. + .map_name = "cfi_probe",
  30. + .parts = gumstix_partitions,
  31. + .nr_parts = ARRAY_SIZE(gumstix_partitions),
  32. + .width = 2,
  33. +};
  34. +
  35. +static struct platform_device gumstix_flash_device = {
  36. + .name = "pxa2xx-flash",
  37. + .id = 0,
  38. + .dev = {
  39. + .platform_data = &gumstix_flash_data,
  40. + },
  41. + .resource = &flash_resource,
  42. + .num_resources = 1,
  43. +};
  44. +
  45. #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) \
  46. || defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE)
  47. @@ -540,6 +580,7 @@ static struct platform_device verdex_aud
  48. };
  49. static struct platform_device *devices[] __initdata = {
  50. + &gumstix_flash_device,
  51. &verdex_audio_device,
  52. };