Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Platform data definitions. |
| 3 | */ |
| 4 | #ifndef __ASM_ARCH_BOARD_H |
| 5 | #define __ASM_ARCH_BOARD_H |
| 6 | |
| 7 | #include <linux/types.h> |
| 8 | |
Haavard Skinnemoen | 6fcf061 | 2007-06-14 17:37:31 +0200 | [diff] [blame] | 9 | #define GPIO_PIN_NONE (-1) |
| 10 | |
Alex | 60ed795 | 2008-03-17 14:55:06 +0100 | [diff] [blame] | 11 | /* |
| 12 | * Clock rates for various on-board oscillators. The number of entries |
| 13 | * in this array is chip-dependent. |
| 14 | */ |
| 15 | extern unsigned long at32_board_osc_rates[]; |
| 16 | |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 17 | /* Add basic devices: system manager, interrupt controller, portmuxes, etc. */ |
| 18 | void at32_add_system_devices(void); |
| 19 | |
Haavard Skinnemoen | 73e2798 | 2006-10-04 16:02:04 +0200 | [diff] [blame] | 20 | #define ATMEL_MAX_UART 4 |
| 21 | extern struct platform_device *atmel_default_console_device; |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 22 | |
Haavard Skinnemoen | 75d3521 | 2006-10-04 16:02:08 +0200 | [diff] [blame] | 23 | struct atmel_uart_data { |
| 24 | short use_dma_tx; /* use transmit DMA? */ |
| 25 | short use_dma_rx; /* use receive DMA? */ |
| 26 | void __iomem *regs; /* virtual base address, if any */ |
| 27 | }; |
Haavard Skinnemoen | c194588 | 2006-10-04 16:02:10 +0200 | [diff] [blame] | 28 | void at32_map_usart(unsigned int hw_id, unsigned int line); |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 29 | struct platform_device *at32_add_device_usart(unsigned int id); |
| 30 | |
| 31 | struct eth_platform_data { |
frederic RODO | 6c36a70 | 2007-07-12 19:07:24 +0200 | [diff] [blame] | 32 | u32 phy_mask; |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 33 | u8 is_rmii; |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 34 | }; |
| 35 | struct platform_device * |
| 36 | at32_add_device_eth(unsigned int id, struct eth_platform_data *data); |
| 37 | |
Haavard Skinnemoen | 41d8ca4 | 2007-02-16 13:56:11 +0100 | [diff] [blame] | 38 | struct spi_board_info; |
| 39 | struct platform_device * |
| 40 | at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n); |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 41 | |
Haavard Skinnemoen | d0a2b7a | 2007-03-21 18:08:49 +0100 | [diff] [blame] | 42 | struct atmel_lcdfb_info; |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 43 | struct platform_device * |
Haavard Skinnemoen | d0a2b7a | 2007-03-21 18:08:49 +0100 | [diff] [blame] | 44 | at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, |
Hans-Christian Egtvedt | 47882cf | 2008-02-05 15:27:16 +0100 | [diff] [blame] | 45 | unsigned long fbmem_start, unsigned long fbmem_len, |
| 46 | unsigned int pin_config); |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 47 | |
Stelian Pop | 8d85531 | 2008-03-05 00:00:00 +0100 | [diff] [blame] | 48 | struct usba_platform_data; |
Haavard Skinnemoen | 6fcf061 | 2007-06-14 17:37:31 +0200 | [diff] [blame] | 49 | struct platform_device * |
| 50 | at32_add_device_usba(unsigned int id, struct usba_platform_data *data); |
| 51 | |
Kristoffer Nyborg Gregertsen | 48021bd | 2007-08-16 13:45:00 +0200 | [diff] [blame] | 52 | struct ide_platform_data { |
| 53 | u8 cs; |
| 54 | }; |
| 55 | struct platform_device * |
| 56 | at32_add_device_ide(unsigned int id, unsigned int extint, |
| 57 | struct ide_platform_data *data); |
| 58 | |
David Brownell | 9a1e8eb | 2008-02-08 04:21:21 -0800 | [diff] [blame] | 59 | /* mask says which PWM channels to mux */ |
| 60 | struct platform_device *at32_add_device_pwm(u32 mask); |
| 61 | |
Hans-Christian Egtvedt | 9cf6cf5 | 2007-07-06 14:31:55 +0200 | [diff] [blame] | 62 | /* depending on what's hooked up, not all SSC pins will be used */ |
| 63 | #define ATMEL_SSC_TK 0x01 |
| 64 | #define ATMEL_SSC_TF 0x02 |
| 65 | #define ATMEL_SSC_TD 0x04 |
| 66 | #define ATMEL_SSC_TX (ATMEL_SSC_TK | ATMEL_SSC_TF | ATMEL_SSC_TD) |
| 67 | |
| 68 | #define ATMEL_SSC_RK 0x10 |
| 69 | #define ATMEL_SSC_RF 0x20 |
| 70 | #define ATMEL_SSC_RD 0x40 |
| 71 | #define ATMEL_SSC_RX (ATMEL_SSC_RK | ATMEL_SSC_RF | ATMEL_SSC_RD) |
| 72 | |
| 73 | struct platform_device * |
| 74 | at32_add_device_ssc(unsigned int id, unsigned int flags); |
| 75 | |
Ben Nizette | 040b28f | 2008-02-07 15:28:57 +1100 | [diff] [blame] | 76 | struct i2c_board_info; |
| 77 | struct platform_device *at32_add_device_twi(unsigned int id, |
| 78 | struct i2c_board_info *b, |
| 79 | unsigned int n); |
Haavard Skinnemoen | 7d2be07 | 2008-06-30 18:35:03 +0200 | [diff] [blame] | 80 | |
| 81 | struct mci_platform_data; |
| 82 | struct platform_device * |
| 83 | at32_add_device_mci(unsigned int id, struct mci_platform_data *data); |
| 84 | |
Hans-Christian Egtvedt | 218df4a | 2008-07-01 14:26:45 +0200 | [diff] [blame] | 85 | struct ac97c_platform_data { |
| 86 | unsigned short dma_rx_periph_id; |
| 87 | unsigned short dma_tx_periph_id; |
| 88 | unsigned short dma_controller_id; |
| 89 | int reset_pin; |
| 90 | }; |
| 91 | struct platform_device * |
| 92 | at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data); |
| 93 | |
Haavard Skinnemoen | 2042c1c | 2007-10-22 17:42:35 +0200 | [diff] [blame] | 94 | struct platform_device *at32_add_device_abdac(unsigned int id); |
Hans-Christian Egtvedt | d86d314 | 2008-02-25 11:24:30 +0100 | [diff] [blame] | 95 | struct platform_device *at32_add_device_psif(unsigned int id); |
Haavard Skinnemoen | 2042c1c | 2007-10-22 17:42:35 +0200 | [diff] [blame] | 96 | |
Haavard Skinnemoen | eaf5f92 | 2007-10-22 18:32:14 +0200 | [diff] [blame] | 97 | struct cf_platform_data { |
| 98 | int detect_pin; |
| 99 | int reset_pin; |
| 100 | int vcc_pin; |
| 101 | int ready_pin; |
| 102 | u8 cs; |
| 103 | }; |
| 104 | struct platform_device * |
| 105 | at32_add_device_cf(unsigned int id, unsigned int extint, |
| 106 | struct cf_platform_data *data); |
| 107 | |
HÃ¥vard Skinnemoen | 62090a0 | 2008-06-06 18:04:56 +0200 | [diff] [blame] | 108 | /* NAND / SmartMedia */ |
| 109 | struct atmel_nand_data { |
| 110 | int enable_pin; /* chip enable */ |
| 111 | int det_pin; /* card detect */ |
| 112 | int rdy_pin; /* ready/busy */ |
| 113 | u8 ale; /* address line number connected to ALE */ |
| 114 | u8 cle; /* address line number connected to CLE */ |
| 115 | u8 bus_width_16; /* buswidth is 16 bit */ |
| 116 | struct mtd_partition *(*partition_info)(int size, int *num_partitions); |
| 117 | }; |
| 118 | struct platform_device * |
| 119 | at32_add_device_nand(unsigned int id, struct atmel_nand_data *data); |
| 120 | |
Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 121 | #endif /* __ASM_ARCH_BOARD_H */ |