spear_smi.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright © 2010 ST Microelectronics
  3. * Shiraz Hashim <shiraz.hashim@st.com>
  4. *
  5. * This file is licensed under the terms of the GNU General Public
  6. * License version 2. This program is licensed "as is" without any
  7. * warranty of any kind, whether express or implied.
  8. */
  9. #ifndef __MTD_SPEAR_SMI_H
  10. #define __MTD_SPEAR_SMI_H
  11. #include <linux/types.h>
  12. #include <linux/mtd/mtd.h>
  13. #include <linux/mtd/partitions.h>
  14. #include <linux/platform_device.h>
  15. /* macro to define partitions for flash devices */
  16. #define DEFINE_PARTS(n, of, s) \
  17. { \
  18. .name = n, \
  19. .offset = of, \
  20. .size = s, \
  21. }
  22. /**
  23. * struct spear_smi_flash_info - platform structure for passing flash
  24. * information
  25. *
  26. * name: name of the serial nor flash for identification
  27. * mem_base: the memory base on which the flash is mapped
  28. * size: size of the flash in bytes
  29. * partitions: parition details
  30. * nr_partitions: number of partitions
  31. * fast_mode: whether flash supports fast mode
  32. */
  33. struct spear_smi_flash_info {
  34. char *name;
  35. unsigned long mem_base;
  36. unsigned long size;
  37. struct mtd_partition *partitions;
  38. int nr_partitions;
  39. u8 fast_mode;
  40. };
  41. /**
  42. * struct spear_smi_plat_data - platform structure for configuring smi
  43. *
  44. * clk_rate: clk rate at which SMI must operate
  45. * num_flashes: number of flashes present on board
  46. * board_flash_info: specific details of each flash present on board
  47. */
  48. struct spear_smi_plat_data {
  49. unsigned long clk_rate;
  50. int num_flashes;
  51. struct spear_smi_flash_info *board_flash_info;
  52. };
  53. #endif /* __MTD_SPEAR_SMI_H */