board.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. /* Add basic devices: system manager, interrupt controller, portmuxes, etc. */
  9. void at32_add_system_devices(void);
  10. #define ATMEL_MAX_UART 4
  11. extern struct platform_device *atmel_default_console_device;
  12. struct atmel_uart_data {
  13. short use_dma_tx; /* use transmit DMA? */
  14. short use_dma_rx; /* use receive DMA? */
  15. void __iomem *regs; /* virtual base address, if any */
  16. };
  17. void at32_map_usart(unsigned int hw_id, unsigned int line);
  18. struct platform_device *at32_add_device_usart(unsigned int id);
  19. struct eth_platform_data {
  20. u32 phy_mask;
  21. u8 is_rmii;
  22. };
  23. struct platform_device *
  24. at32_add_device_eth(unsigned int id, struct eth_platform_data *data);
  25. struct spi_board_info;
  26. struct platform_device *
  27. at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n);
  28. struct atmel_lcdfb_info;
  29. struct platform_device *
  30. at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
  31. unsigned long fbmem_start, unsigned long fbmem_len);
  32. struct usba_platform_data;
  33. struct platform_device *
  34. at32_add_device_usba(unsigned int id, struct usba_platform_data *data);
  35. struct ide_platform_data {
  36. u8 cs;
  37. };
  38. struct platform_device *
  39. at32_add_device_ide(unsigned int id, unsigned int extint,
  40. struct ide_platform_data *data);
  41. /* mask says which PWM channels to mux */
  42. struct platform_device *at32_add_device_pwm(u32 mask);
  43. /* depending on what's hooked up, not all SSC pins will be used */
  44. #define ATMEL_SSC_TK 0x01
  45. #define ATMEL_SSC_TF 0x02
  46. #define ATMEL_SSC_TD 0x04
  47. #define ATMEL_SSC_TX (ATMEL_SSC_TK | ATMEL_SSC_TF | ATMEL_SSC_TD)
  48. #define ATMEL_SSC_RK 0x10
  49. #define ATMEL_SSC_RF 0x20
  50. #define ATMEL_SSC_RD 0x40
  51. #define ATMEL_SSC_RX (ATMEL_SSC_RK | ATMEL_SSC_RF | ATMEL_SSC_RD)
  52. struct platform_device *
  53. at32_add_device_ssc(unsigned int id, unsigned int flags);
  54. struct i2c_board_info;
  55. struct platform_device *at32_add_device_twi(unsigned int id,
  56. struct i2c_board_info *b,
  57. unsigned int n);
  58. struct platform_device *at32_add_device_mci(unsigned int id);
  59. struct platform_device *at32_add_device_ac97c(unsigned int id);
  60. struct platform_device *at32_add_device_abdac(unsigned int id);
  61. struct cf_platform_data {
  62. int detect_pin;
  63. int reset_pin;
  64. int vcc_pin;
  65. int ready_pin;
  66. u8 cs;
  67. };
  68. struct platform_device *
  69. at32_add_device_cf(unsigned int id, unsigned int extint,
  70. struct cf_platform_data *data);
  71. /* NAND / SmartMedia */
  72. struct atmel_nand_data {
  73. int enable_pin; /* chip enable */
  74. int det_pin; /* card detect */
  75. int rdy_pin; /* ready/busy */
  76. u8 ale; /* address line number connected to ALE */
  77. u8 cle; /* address line number connected to CLE */
  78. u8 bus_width_16; /* buswidth is 16 bit */
  79. struct mtd_partition *(*partition_info)(int size, int *num_partitions);
  80. };
  81. struct platform_device *
  82. at32_add_device_nand(unsigned int id, struct atmel_nand_data *data);
  83. #endif /* __ASM_ARCH_BOARD_H */