fsl_devices.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * include/linux/fsl_devices.h
  3. *
  4. * Definitions for any platform device related flags or structures for
  5. * Freescale processor devices
  6. *
  7. * Maintainer: Kumar Gala <galak@kernel.crashing.org>
  8. *
  9. * Copyright 2004 Freescale Semiconductor, Inc
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License as published by the
  13. * Free Software Foundation; either version 2 of the License, or (at your
  14. * option) any later version.
  15. */
  16. #ifdef __KERNEL__
  17. #ifndef _FSL_DEVICE_H_
  18. #define _FSL_DEVICE_H_
  19. #include <linux/types.h>
  20. #include <linux/phy.h>
  21. /*
  22. * Some conventions on how we handle peripherals on Freescale chips
  23. *
  24. * unique device: a platform_device entry in fsl_plat_devs[] plus
  25. * associated device information in its platform_data structure.
  26. *
  27. * A chip is described by a set of unique devices.
  28. *
  29. * Each sub-arch has its own master list of unique devices and
  30. * enumerates them by enum fsl_devices in a sub-arch specific header
  31. *
  32. * The platform data structure is broken into two parts. The
  33. * first is device specific information that help identify any
  34. * unique features of a peripheral. The second is any
  35. * information that may be defined by the board or how the device
  36. * is connected externally of the chip.
  37. *
  38. * naming conventions:
  39. * - platform data structures: <driver>_platform_data
  40. * - platform data device flags: FSL_<driver>_DEV_<FLAG>
  41. * - platform data board flags: FSL_<driver>_BRD_<FLAG>
  42. *
  43. */
  44. struct gianfar_platform_data {
  45. /* device specific information */
  46. u32 device_flags;
  47. /* board specific information */
  48. u32 board_flags;
  49. u32 bus_id;
  50. u32 phy_id;
  51. u8 mac_addr[6];
  52. phy_interface_t interface;
  53. };
  54. struct gianfar_mdio_data {
  55. /* board specific information */
  56. int irq[32];
  57. };
  58. /* Flags related to gianfar device features */
  59. #define FSL_GIANFAR_DEV_HAS_GIGABIT 0x00000001
  60. #define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002
  61. #define FSL_GIANFAR_DEV_HAS_RMON 0x00000004
  62. #define FSL_GIANFAR_DEV_HAS_MULTI_INTR 0x00000008
  63. #define FSL_GIANFAR_DEV_HAS_CSUM 0x00000010
  64. #define FSL_GIANFAR_DEV_HAS_VLAN 0x00000020
  65. #define FSL_GIANFAR_DEV_HAS_EXTENDED_HASH 0x00000040
  66. #define FSL_GIANFAR_DEV_HAS_PADDING 0x00000080
  67. /* Flags in gianfar_platform_data */
  68. #define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* set or use a timer */
  69. #define FSL_GIANFAR_BRD_IS_REDUCED 0x00000002 /* Set if RGMII, RMII */
  70. struct fsl_i2c_platform_data {
  71. /* device specific information */
  72. u32 device_flags;
  73. };
  74. /* Flags related to I2C device features */
  75. #define FSL_I2C_DEV_SEPARATE_DFSRR 0x00000001
  76. #define FSL_I2C_DEV_CLOCK_5200 0x00000002
  77. enum fsl_usb2_operating_modes {
  78. FSL_USB2_MPH_HOST,
  79. FSL_USB2_DR_HOST,
  80. FSL_USB2_DR_DEVICE,
  81. FSL_USB2_DR_OTG,
  82. };
  83. enum fsl_usb2_phy_modes {
  84. FSL_USB2_PHY_NONE,
  85. FSL_USB2_PHY_ULPI,
  86. FSL_USB2_PHY_UTMI,
  87. FSL_USB2_PHY_UTMI_WIDE,
  88. FSL_USB2_PHY_SERIAL,
  89. };
  90. struct fsl_usb2_platform_data {
  91. /* board specific information */
  92. enum fsl_usb2_operating_modes operating_mode;
  93. enum fsl_usb2_phy_modes phy_mode;
  94. unsigned int port_enables;
  95. };
  96. /* Flags in fsl_usb2_mph_platform_data */
  97. #define FSL_USB2_PORT0_ENABLED 0x00000001
  98. #define FSL_USB2_PORT1_ENABLED 0x00000002
  99. struct fsl_spi_platform_data {
  100. u32 initial_spmode; /* initial SPMODE value */
  101. u16 bus_num;
  102. bool qe_mode;
  103. /* board specific information */
  104. u16 max_chipselect;
  105. void (*activate_cs)(u8 cs, u8 polarity);
  106. void (*deactivate_cs)(u8 cs, u8 polarity);
  107. u32 sysclk;
  108. };
  109. struct mpc8xx_pcmcia_ops {
  110. void(*hw_ctrl)(int slot, int enable);
  111. int(*voltage_set)(int slot, int vcc, int vpp);
  112. };
  113. #endif /* _FSL_DEVICE_H_ */
  114. #endif /* __KERNEL__ */