malta_mtd.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2006 MIPS Technologies, Inc.
  7. * written by Ralf Baechle <ralf@linux-mips.org>
  8. */
  9. #include <linux/init.h>
  10. #include <linux/platform_device.h>
  11. #include <linux/mtd/partitions.h>
  12. #include <linux/mtd/physmap.h>
  13. #include <mtd/mtd-abi.h>
  14. static struct mtd_partition malta_mtd_partitions[] = {
  15. {
  16. .name = "YAMON",
  17. .offset = 0x0,
  18. .size = 0x100000,
  19. .mask_flags = MTD_WRITEABLE
  20. }, {
  21. .name = "User FS",
  22. .offset = 0x100000,
  23. .size = 0x2e0000
  24. }, {
  25. .name = "Board Config",
  26. .offset = 0x3e0000,
  27. .size = 0x020000,
  28. .mask_flags = MTD_WRITEABLE
  29. }
  30. };
  31. static struct physmap_flash_data malta_flash_data = {
  32. .width = 4,
  33. .nr_parts = ARRAY_SIZE(malta_mtd_partitions),
  34. .parts = malta_mtd_partitions
  35. };
  36. static struct resource malta_flash_resource = {
  37. .start = 0x1e000000,
  38. .end = 0x1e3fffff,
  39. .flags = IORESOURCE_MEM
  40. };
  41. static struct platform_device malta_flash = {
  42. .name = "physmap-flash",
  43. .id = 0,
  44. .dev = {
  45. .platform_data = &malta_flash_data,
  46. },
  47. .num_resources = 1,
  48. .resource = &malta_flash_resource,
  49. };
  50. static int __init malta_mtd_init(void)
  51. {
  52. platform_device_register(&malta_flash);
  53. return 0;
  54. }
  55. module_init(malta_mtd_init)