Bob Liu | b40b6ea | 2012-08-16 11:40:30 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 Analog Devices Inc. |
| 3 | * Licensed under the GPL-2 or later. |
| 4 | */ |
| 5 | |
| 6 | #ifndef _MACH_GPIO_H_ |
| 7 | #define _MACH_GPIO_H_ |
| 8 | |
| 9 | #define MAX_BLACKFIN_GPIOS 112 |
| 10 | |
| 11 | #define GPIO_PA0 0 |
| 12 | #define GPIO_PA1 1 |
| 13 | #define GPIO_PA2 2 |
| 14 | #define GPIO_PA3 3 |
| 15 | #define GPIO_PA4 4 |
| 16 | #define GPIO_PA5 5 |
| 17 | #define GPIO_PA6 6 |
| 18 | #define GPIO_PA7 7 |
| 19 | #define GPIO_PA8 8 |
| 20 | #define GPIO_PA9 9 |
| 21 | #define GPIO_PA10 10 |
| 22 | #define GPIO_PA11 11 |
| 23 | #define GPIO_PA12 12 |
| 24 | #define GPIO_PA13 13 |
| 25 | #define GPIO_PA14 14 |
| 26 | #define GPIO_PA15 15 |
| 27 | #define GPIO_PB0 16 |
| 28 | #define GPIO_PB1 17 |
| 29 | #define GPIO_PB2 18 |
| 30 | #define GPIO_PB3 19 |
| 31 | #define GPIO_PB4 20 |
| 32 | #define GPIO_PB5 21 |
| 33 | #define GPIO_PB6 22 |
| 34 | #define GPIO_PB7 23 |
| 35 | #define GPIO_PB8 24 |
| 36 | #define GPIO_PB9 25 |
| 37 | #define GPIO_PB10 26 |
| 38 | #define GPIO_PB11 27 |
| 39 | #define GPIO_PB12 28 |
| 40 | #define GPIO_PB13 29 |
| 41 | #define GPIO_PB14 30 |
| 42 | #define GPIO_PB15 31 |
| 43 | #define GPIO_PC0 32 |
| 44 | #define GPIO_PC1 33 |
| 45 | #define GPIO_PC2 34 |
| 46 | #define GPIO_PC3 35 |
| 47 | #define GPIO_PC4 36 |
| 48 | #define GPIO_PC5 37 |
| 49 | #define GPIO_PC6 38 |
| 50 | #define GPIO_PC7 39 |
| 51 | #define GPIO_PC8 40 |
| 52 | #define GPIO_PC9 41 |
| 53 | #define GPIO_PC10 42 |
| 54 | #define GPIO_PC11 43 |
| 55 | #define GPIO_PC12 44 |
| 56 | #define GPIO_PC13 45 |
| 57 | #define GPIO_PC14 46 |
| 58 | #define GPIO_PC15 47 |
| 59 | #define GPIO_PD0 48 |
| 60 | #define GPIO_PD1 49 |
| 61 | #define GPIO_PD2 50 |
| 62 | #define GPIO_PD3 51 |
| 63 | #define GPIO_PD4 52 |
| 64 | #define GPIO_PD5 53 |
| 65 | #define GPIO_PD6 54 |
| 66 | #define GPIO_PD7 55 |
| 67 | #define GPIO_PD8 56 |
| 68 | #define GPIO_PD9 57 |
| 69 | #define GPIO_PD10 58 |
| 70 | #define GPIO_PD11 59 |
| 71 | #define GPIO_PD12 60 |
| 72 | #define GPIO_PD13 61 |
| 73 | #define GPIO_PD14 62 |
| 74 | #define GPIO_PD15 63 |
| 75 | #define GPIO_PE0 64 |
| 76 | #define GPIO_PE1 65 |
| 77 | #define GPIO_PE2 66 |
| 78 | #define GPIO_PE3 67 |
| 79 | #define GPIO_PE4 68 |
| 80 | #define GPIO_PE5 69 |
| 81 | #define GPIO_PE6 70 |
| 82 | #define GPIO_PE7 71 |
| 83 | #define GPIO_PE8 72 |
| 84 | #define GPIO_PE9 73 |
| 85 | #define GPIO_PE10 74 |
| 86 | #define GPIO_PE11 75 |
| 87 | #define GPIO_PE12 76 |
| 88 | #define GPIO_PE13 77 |
| 89 | #define GPIO_PE14 78 |
| 90 | #define GPIO_PE15 79 |
| 91 | #define GPIO_PF0 80 |
| 92 | #define GPIO_PF1 81 |
| 93 | #define GPIO_PF2 82 |
| 94 | #define GPIO_PF3 83 |
| 95 | #define GPIO_PF4 84 |
| 96 | #define GPIO_PF5 85 |
| 97 | #define GPIO_PF6 86 |
| 98 | #define GPIO_PF7 87 |
| 99 | #define GPIO_PF8 88 |
| 100 | #define GPIO_PF9 89 |
| 101 | #define GPIO_PF10 90 |
| 102 | #define GPIO_PF11 91 |
| 103 | #define GPIO_PF12 92 |
| 104 | #define GPIO_PF13 93 |
| 105 | #define GPIO_PF14 94 |
| 106 | #define GPIO_PF15 95 |
| 107 | #define GPIO_PG0 96 |
| 108 | #define GPIO_PG1 97 |
| 109 | #define GPIO_PG2 98 |
| 110 | #define GPIO_PG3 99 |
| 111 | #define GPIO_PG4 100 |
| 112 | #define GPIO_PG5 101 |
| 113 | #define GPIO_PG6 102 |
| 114 | #define GPIO_PG7 103 |
| 115 | #define GPIO_PG8 104 |
| 116 | #define GPIO_PG9 105 |
| 117 | #define GPIO_PG10 106 |
| 118 | #define GPIO_PG11 107 |
| 119 | #define GPIO_PG12 108 |
| 120 | #define GPIO_PG13 109 |
| 121 | #define GPIO_PG14 110 |
| 122 | #define GPIO_PG15 111 |
| 123 | |
| 124 | #ifndef __ASSEMBLY__ |
| 125 | |
| 126 | struct gpio_port_t { |
| 127 | unsigned long port_fer; |
| 128 | unsigned long port_fer_set; |
| 129 | unsigned long port_fer_clear; |
| 130 | unsigned long data; |
| 131 | unsigned long data_set; |
| 132 | unsigned long data_clear; |
| 133 | unsigned long dir; |
| 134 | unsigned long dir_set; |
| 135 | unsigned long dir_clear; |
| 136 | unsigned long inen; |
| 137 | unsigned long inen_set; |
| 138 | unsigned long inen_clear; |
| 139 | unsigned long port_mux; |
| 140 | unsigned long toggle; |
| 141 | unsigned long polar; |
| 142 | unsigned long polar_set; |
| 143 | unsigned long polar_clear; |
| 144 | unsigned long lock; |
| 145 | unsigned long spare; |
| 146 | unsigned long revid; |
| 147 | }; |
| 148 | |
| 149 | #endif |
| 150 | |
| 151 | #endif /* _MACH_GPIO_H_ */ |