board.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * Platform data definitions.
  3. */
  4. #ifndef __ASM_ARCH_BOARD_H
  5. #define __ASM_ARCH_BOARD_H
  6. #include <linux/types.h>
  7. #define GPIO_PIN_NONE (-1)
  8. /*
  9. * Clock rates for various on-board oscillators. The number of entries
  10. * in this array is chip-dependent.
  11. */
  12. extern unsigned long at32_board_osc_rates[];
  13. /* Add basic devices: system manager, interrupt controller, portmuxes, etc. */
  14. void at32_add_system_devices(void);
  15. #define ATMEL_MAX_UART 4
  16. extern struct platform_device *atmel_default_console_device;
  17. struct atmel_uart_data {
  18. short use_dma_tx; /* use transmit DMA? */
  19. short use_dma_rx; /* use receive DMA? */
  20. void __iomem *regs; /* virtual base address, if any */
  21. };
  22. void at32_map_usart(unsigned int hw_id, unsigned int line);
  23. struct platform_device *at32_add_device_usart(unsigned int id);
  24. struct eth_platform_data {
  25. u32 phy_mask;
  26. u8 is_rmii;
  27. };
  28. struct platform_device *
  29. at32_add_device_eth(unsigned int id, struct eth_platform_data *data);
  30. struct spi_board_info;
  31. struct platform_device *
  32. at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n);
  33. struct atmel_lcdfb_info;
  34. struct platform_device *
  35. at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
  36. unsigned long fbmem_start, unsigned long fbmem_len,
  37. u64 pin_mask);
  38. struct usba_platform_data;
  39. struct platform_device *
  40. at32_add_device_usba(unsigned int id, struct usba_platform_data *data);
  41. struct ide_platform_data {
  42. u8 cs;
  43. };
  44. struct platform_device *
  45. at32_add_device_ide(unsigned int id, unsigned int extint,
  46. struct ide_platform_data *data);
  47. /* mask says which PWM channels to mux */
  48. struct platform_device *at32_add_device_pwm(u32 mask);
  49. /* depending on what's hooked up, not all SSC pins will be used */
  50. #define ATMEL_SSC_TK 0x01
  51. #define ATMEL_SSC_TF 0x02
  52. #define ATMEL_SSC_TD 0x04
  53. #define ATMEL_SSC_TX (ATMEL_SSC_TK | ATMEL_SSC_TF | ATMEL_SSC_TD)
  54. #define ATMEL_SSC_RK 0x10
  55. #define ATMEL_SSC_RF 0x20
  56. #define ATMEL_SSC_RD 0x40
  57. #define ATMEL_SSC_RX (ATMEL_SSC_RK | ATMEL_SSC_RF | ATMEL_SSC_RD)
  58. struct platform_device *
  59. at32_add_device_ssc(unsigned int id, unsigned int flags);
  60. struct i2c_board_info;
  61. struct platform_device *at32_add_device_twi(unsigned int id,
  62. struct i2c_board_info *b,
  63. unsigned int n);
  64. struct mci_platform_data;
  65. struct platform_device *
  66. at32_add_device_mci(unsigned int id, struct mci_platform_data *data);
  67. struct ac97c_platform_data {
  68. unsigned short dma_rx_periph_id;
  69. unsigned short dma_tx_periph_id;
  70. unsigned short dma_controller_id;
  71. int reset_pin;
  72. };
  73. struct platform_device *
  74. at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data);
  75. struct platform_device *at32_add_device_abdac(unsigned int id);
  76. struct platform_device *at32_add_device_psif(unsigned int id);
  77. struct cf_platform_data {
  78. int detect_pin;
  79. int reset_pin;
  80. int vcc_pin;
  81. int ready_pin;
  82. u8 cs;
  83. };
  84. struct platform_device *
  85. at32_add_device_cf(unsigned int id, unsigned int extint,
  86. struct cf_platform_data *data);
  87. /* NAND / SmartMedia */
  88. struct atmel_nand_data {
  89. int enable_pin; /* chip enable */
  90. int det_pin; /* card detect */
  91. int rdy_pin; /* ready/busy */
  92. u8 ale; /* address line number connected to ALE */
  93. u8 cle; /* address line number connected to CLE */
  94. u8 bus_width_16; /* buswidth is 16 bit */
  95. struct mtd_partition *(*partition_info)(int size, int *num_partitions);
  96. };
  97. struct platform_device *
  98. at32_add_device_nand(unsigned int id, struct atmel_nand_data *data);
  99. #endif /* __ASM_ARCH_BOARD_H */