wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 1 | /* |
wdenk | 04a85b3 | 2004-04-15 18:22:41 +0000 | [diff] [blame] | 2 | * (C) Copyright 2000-2004 |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | * MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | /* |
| 25 | * The purpose of this code is to signal the operational status of a |
| 26 | * target which usually boots over the network; while running in |
| 27 | * PCBoot, a status LED is blinking. As soon as a valid BOOTP reply |
| 28 | * message has been received, the LED is turned off. The Linux |
| 29 | * kernel, once it is running, will start blinking the LED again, |
| 30 | * with another frequency. |
| 31 | */ |
| 32 | |
| 33 | #ifndef _STATUS_LED_H_ |
| 34 | #define _STATUS_LED_H_ |
| 35 | |
| 36 | #ifdef CONFIG_STATUS_LED |
| 37 | |
| 38 | #define STATUS_LED_OFF 0 |
| 39 | #define STATUS_LED_BLINKING 1 |
| 40 | #define STATUS_LED_ON 2 |
| 41 | |
| 42 | void status_led_tick (unsigned long timestamp); |
| 43 | void status_led_set (int led, int state); |
| 44 | |
| 45 | /***** TQM8xxL ********************************************************/ |
Wolfgang Denk | 77efe35 | 2010-09-19 21:28:25 +0200 | [diff] [blame] | 46 | #if defined(CONFIG_TQM8xxL) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 47 | # define STATUS_LED_PAR im_cpm.cp_pbpar |
| 48 | # define STATUS_LED_DIR im_cpm.cp_pbdir |
| 49 | # define STATUS_LED_ODR im_cpm.cp_pbodr |
| 50 | # define STATUS_LED_DAT im_cpm.cp_pbdat |
| 51 | |
| 52 | # define STATUS_LED_BIT 0x00000001 |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 53 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 54 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 55 | |
| 56 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 57 | |
| 58 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 59 | |
| 60 | /***** MVS v1 **********************************************************/ |
| 61 | #elif (defined(CONFIG_MVS) && CONFIG_MVS < 2) |
| 62 | # define STATUS_LED_PAR im_ioport.iop_pdpar |
| 63 | # define STATUS_LED_DIR im_ioport.iop_pddir |
| 64 | # undef STATUS_LED_ODR |
| 65 | # define STATUS_LED_DAT im_ioport.iop_pddat |
| 66 | |
| 67 | # define STATUS_LED_BIT 0x00000001 |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 68 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 69 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 70 | |
| 71 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 72 | |
| 73 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 74 | |
| 75 | /***** ETX_094 ********************************************************/ |
| 76 | #elif defined(CONFIG_ETX094) |
| 77 | |
| 78 | # define STATUS_LED_PAR im_ioport.iop_pdpar |
| 79 | # define STATUS_LED_DIR im_ioport.iop_pddir |
| 80 | # undef STATUS_LED_ODR |
| 81 | # define STATUS_LED_DAT im_ioport.iop_pddat |
| 82 | |
| 83 | # define STATUS_LED_BIT 0x00000001 |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 84 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 85 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 86 | |
| 87 | # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ |
| 88 | |
| 89 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 90 | |
| 91 | /***** GEN860T *********************************************************/ |
| 92 | #elif defined(CONFIG_GEN860T) |
| 93 | |
| 94 | # define STATUS_LED_PAR im_ioport.iop_papar |
| 95 | # define STATUS_LED_DIR im_ioport.iop_padir |
| 96 | # define STATUS_LED_ODR im_ioport.iop_paodr |
| 97 | # define STATUS_LED_DAT im_ioport.iop_padat |
| 98 | |
| 99 | # define STATUS_LED_BIT 0x0800 /* Red LED 0 is on PA.4 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 100 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 4) |
wdenk | 7aa7861 | 2003-05-03 15:50:43 +0000 | [diff] [blame] | 101 | # define STATUS_LED_STATE STATUS_LED_OFF |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 102 | # define STATUS_LED_BIT1 0x0400 /* Grn LED 1 is on PA.5 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 103 | # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 8) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 104 | # define STATUS_LED_STATE1 STATUS_LED_BLINKING |
| 105 | # define STATUS_LED_BIT2 0x0080 /* Red LED 2 is on PA.8 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 106 | # define STATUS_LED_PERIOD2 (CONFIG_SYS_HZ / 4) |
wdenk | 7aa7861 | 2003-05-03 15:50:43 +0000 | [diff] [blame] | 107 | # define STATUS_LED_STATE2 STATUS_LED_OFF |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 108 | # define STATUS_LED_BIT3 0x0040 /* Grn LED 3 is on PA.9 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 109 | # define STATUS_LED_PERIOD3 (CONFIG_SYS_HZ / 4) |
wdenk | 7aa7861 | 2003-05-03 15:50:43 +0000 | [diff] [blame] | 110 | # define STATUS_LED_STATE3 STATUS_LED_OFF |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 111 | |
| 112 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
wdenk | 7aa7861 | 2003-05-03 15:50:43 +0000 | [diff] [blame] | 113 | # define STATUS_LED_BOOT 1 /* Boot status on LED 1 */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 114 | |
| 115 | /***** IVMS8 **********************************************************/ |
| 116 | #elif defined(CONFIG_IVMS8) |
| 117 | |
| 118 | # define STATUS_LED_PAR im_cpm.cp_pbpar |
| 119 | # define STATUS_LED_DIR im_cpm.cp_pbdir |
| 120 | # define STATUS_LED_ODR im_cpm.cp_pbodr |
| 121 | # define STATUS_LED_DAT im_cpm.cp_pbdat |
| 122 | |
| 123 | # define STATUS_LED_BIT 0x00000010 /* LED 0 is on PB.27 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 124 | # define STATUS_LED_PERIOD (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 125 | # define STATUS_LED_STATE STATUS_LED_OFF |
| 126 | # define STATUS_LED_BIT1 0x00000020 /* LED 1 is on PB.26 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 127 | # define STATUS_LED_PERIOD1 (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 128 | # define STATUS_LED_STATE1 STATUS_LED_OFF |
| 129 | /* IDE LED usable for other purposes, too */ |
| 130 | # define STATUS_LED_BIT2 0x00000008 /* LED 2 is on PB.28 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 131 | # define STATUS_LED_PERIOD2 (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 132 | # define STATUS_LED_STATE2 STATUS_LED_OFF |
| 133 | |
| 134 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 135 | |
| 136 | # define STATUS_ILOCK_SWITCH 0x00800000 /* ILOCK switch in IRQ4 */ |
| 137 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 138 | # define STATUS_ILOCK_PERIOD (CONFIG_SYS_HZ / 10) /* about every 100 ms */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 139 | |
| 140 | # define STATUS_LED_YELLOW 0 |
| 141 | # define STATUS_LED_GREEN 1 |
| 142 | # define STATUS_LED_BOOT 2 /* IDE LED used for boot status */ |
| 143 | |
| 144 | /***** IVML24 *********************************************************/ |
| 145 | #elif defined(CONFIG_IVML24) |
| 146 | |
| 147 | # define STATUS_LED_PAR im_cpm.cp_pbpar |
| 148 | # define STATUS_LED_DIR im_cpm.cp_pbdir |
| 149 | # define STATUS_LED_ODR im_cpm.cp_pbodr |
| 150 | # define STATUS_LED_DAT im_cpm.cp_pbdat |
| 151 | |
| 152 | # define STATUS_LED_BIT 0x00000010 /* LED 0 is on PB.27 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 153 | # define STATUS_LED_PERIOD (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 154 | # define STATUS_LED_STATE STATUS_LED_OFF |
| 155 | # define STATUS_LED_BIT1 0x00000020 /* LED 1 is on PB.26 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 156 | # define STATUS_LED_PERIOD1 (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 157 | # define STATUS_LED_STATE1 STATUS_LED_OFF |
| 158 | /* IDE LED usable for other purposes, too */ |
| 159 | # define STATUS_LED_BIT2 0x00000008 /* LED 2 is on PB.28 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 160 | # define STATUS_LED_PERIOD2 (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 161 | # define STATUS_LED_STATE2 STATUS_LED_OFF |
| 162 | |
| 163 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 164 | |
| 165 | # define STATUS_ILOCK_SWITCH 0x00004000 /* ILOCK is on PB.17 */ |
| 166 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 167 | # define STATUS_ILOCK_PERIOD (CONFIG_SYS_HZ / 10) /* about every 100 ms */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 168 | |
| 169 | # define STATUS_LED_YELLOW 0 |
| 170 | # define STATUS_LED_GREEN 1 |
| 171 | # define STATUS_LED_BOOT 2 /* IDE LED used for boot status */ |
| 172 | |
| 173 | /***** LANTEC *********************************************************/ |
| 174 | #elif defined(CONFIG_LANTEC) |
| 175 | |
| 176 | # define STATUS_LED_PAR im_ioport.iop_pdpar |
| 177 | # define STATUS_LED_DIR im_ioport.iop_pddir |
| 178 | # undef STATUS_LED_ODR |
| 179 | # define STATUS_LED_DAT im_ioport.iop_pddat |
| 180 | |
| 181 | # if CONFIG_LATEC < 2 |
| 182 | # define STATUS_LED_BIT 0x1000 |
| 183 | # else |
| 184 | # define STATUS_LED_BIT 0x0800 |
| 185 | # endif |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 186 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 187 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 188 | |
| 189 | # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ |
| 190 | |
| 191 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 192 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 193 | /***** ICU862 ********************************************************/ |
| 194 | #elif defined(CONFIG_ICU862) |
| 195 | |
| 196 | # define STATUS_LED_PAR im_ioport.iop_papar |
| 197 | # define STATUS_LED_DIR im_ioport.iop_padir |
| 198 | # define STATUS_LED_ODR im_ioport.iop_paodr |
| 199 | # define STATUS_LED_DAT im_ioport.iop_padat |
| 200 | |
| 201 | # define STATUS_LED_BIT 0x4000 /* LED 0 is on PA.1 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 202 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 203 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 204 | # define STATUS_LED_BIT1 0x1000 /* LED 1 is on PA.3 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 205 | # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 206 | # define STATUS_LED_STATE1 STATUS_LED_OFF |
| 207 | |
| 208 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 209 | |
| 210 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 211 | |
| 212 | /***** Someone else defines these *************************************/ |
| 213 | #elif defined(STATUS_LED_PAR) |
| 214 | |
| 215 | /* |
| 216 | * ADVICE: Define in your board configuration file rather than |
| 217 | * filling this file up with lots of custom board stuff. |
| 218 | */ |
| 219 | |
| 220 | /***** NetVia ********************************************************/ |
| 221 | #elif defined(CONFIG_NETVIA) |
| 222 | |
wdenk | 993cad9 | 2003-06-26 22:04:09 +0000 | [diff] [blame] | 223 | #if !defined(CONFIG_NETVIA_VERSION) || CONFIG_NETVIA_VERSION == 1 |
| 224 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 225 | #define STATUS_LED_PAR im_ioport.iop_pdpar |
| 226 | #define STATUS_LED_DIR im_ioport.iop_pddir |
| 227 | #undef STATUS_LED_ODR |
| 228 | #define STATUS_LED_DAT im_ioport.iop_pddat |
| 229 | |
| 230 | # define STATUS_LED_BIT 0x0080 /* PD.8 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 231 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 232 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 233 | |
| 234 | # define STATUS_LED_BIT1 0x0040 /* PD.9 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 235 | # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 2) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 236 | # define STATUS_LED_STATE1 STATUS_LED_OFF |
| 237 | |
| 238 | # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ |
| 239 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 240 | |
wdenk | 993cad9 | 2003-06-26 22:04:09 +0000 | [diff] [blame] | 241 | #endif |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 242 | |
wdenk | 0db5bca | 2003-03-31 17:27:09 +0000 | [diff] [blame] | 243 | /***** CMI ********************************************************/ |
| 244 | #elif defined(CONFIG_CMI) |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 245 | # define STATUS_LED_DIR im_mios.mios_mpiosm32ddr |
| 246 | # define STATUS_LED_DAT im_mios.mios_mpiosm32dr |
wdenk | 0db5bca | 2003-03-31 17:27:09 +0000 | [diff] [blame] | 247 | |
| 248 | # define STATUS_LED_BIT 0x2000 /* Select one of the 16 possible*/ |
| 249 | /* MIOS outputs */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 250 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) /* Blinking periode is 500 ms */ |
wdenk | 0db5bca | 2003-03-31 17:27:09 +0000 | [diff] [blame] | 251 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 252 | |
| 253 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 0 */ |
| 254 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 255 | |
wdenk | 0608e04 | 2004-03-25 19:29:38 +0000 | [diff] [blame] | 256 | /***** KUP4K, KUP4X ****************************************************/ |
Wolfgang Denk | dff07e1 | 2010-10-05 22:54:54 +0200 | [diff] [blame] | 257 | #elif defined(CONFIG_KUP4K) || defined(CONFIG_KUP4X) |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 258 | |
| 259 | # define STATUS_LED_PAR im_ioport.iop_papar |
| 260 | # define STATUS_LED_DIR im_ioport.iop_padir |
| 261 | # define STATUS_LED_ODR im_ioport.iop_paodr |
| 262 | # define STATUS_LED_DAT im_ioport.iop_padat |
| 263 | |
| 264 | # define STATUS_LED_BIT 0x00000300 /* green + red PA[8]=yellow, PA[7]=red, PA[6]=green */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 265 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 266 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 267 | |
| 268 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 269 | |
| 270 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 271 | |
wdenk | dc7c9a1 | 2003-03-26 06:55:25 +0000 | [diff] [blame] | 272 | #elif defined(CONFIG_SVM_SC8xx) |
| 273 | # define STATUS_LED_PAR im_cpm.cp_pbpar |
| 274 | # define STATUS_LED_DIR im_cpm.cp_pbdir |
| 275 | # define STATUS_LED_ODR im_cpm.cp_pbodr |
| 276 | # define STATUS_LED_DAT im_cpm.cp_pbdat |
| 277 | |
| 278 | # define STATUS_LED_BIT 0x00000001 |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 279 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | dc7c9a1 | 2003-03-26 06:55:25 +0000 | [diff] [blame] | 280 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 281 | |
| 282 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 283 | |
| 284 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 285 | |
wdenk | 682011f | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 286 | /***** RBC823 ********************************************************/ |
| 287 | #elif defined(CONFIG_RBC823) |
| 288 | |
| 289 | # define STATUS_LED_PAR im_ioport.iop_pcpar |
| 290 | # define STATUS_LED_DIR im_ioport.iop_pcdir |
| 291 | # undef STATUS_LED_ODR |
| 292 | # define STATUS_LED_DAT im_ioport.iop_pcdat |
| 293 | |
| 294 | # define STATUS_LED_BIT 0x0002 /* LED 0 is on PC.14 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 295 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | 682011f | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 296 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 297 | # define STATUS_LED_BIT1 0x0004 /* LED 1 is on PC.13 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 298 | # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ) |
wdenk | 682011f | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 299 | # define STATUS_LED_STATE1 STATUS_LED_OFF |
| 300 | |
| 301 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 302 | |
| 303 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 304 | |
wdenk | 04a85b3 | 2004-04-15 18:22:41 +0000 | [diff] [blame] | 305 | /***** NetPhone ********************************************************/ |
wdenk | 79fa88f | 2004-06-07 23:46:25 +0000 | [diff] [blame] | 306 | #elif defined(CONFIG_NETPHONE) || defined(CONFIG_NETTA2) |
wdenk | 04a85b3 | 2004-04-15 18:22:41 +0000 | [diff] [blame] | 307 | /* XXX empty just to avoid the error */ |
Wolfgang Denk | 6bdf430 | 2005-08-15 15:55:00 +0200 | [diff] [blame] | 308 | /***** STx XTc ********************************************************/ |
| 309 | #elif defined(CONFIG_STXXTC) |
| 310 | /* XXX empty just to avoid the error */ |
wdenk | 466b741 | 2004-07-10 22:35:59 +0000 | [diff] [blame] | 311 | /***** sbc8240 ********************************************************/ |
| 312 | #elif defined(CONFIG_WRSBC8240) |
| 313 | /* XXX empty just to avoid the error */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 314 | /************************************************************************/ |
wdenk | 5c952cf | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 315 | #elif defined(CONFIG_NIOS2) |
| 316 | /* XXX empty just to avoid the error */ |
| 317 | /************************************************************************/ |
Bartlomiej Sieka | 4707fb5 | 2006-10-13 21:09:09 +0200 | [diff] [blame] | 318 | #elif defined(CONFIG_V38B) |
| 319 | |
| 320 | # define STATUS_LED_BIT 0x0010 /* Timer7 GPIO */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 321 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
Bartlomiej Sieka | 4707fb5 | 2006-10-13 21:09:09 +0200 | [diff] [blame] | 322 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 323 | |
| 324 | # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ |
| 325 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 326 | |
Bartlomiej Sieka | a11c0b8 | 2007-05-27 16:51:48 +0200 | [diff] [blame] | 327 | #elif defined(CONFIG_MOTIONPRO) |
| 328 | |
| 329 | #define STATUS_LED_BIT ((vu_long *) MPC5XXX_GPT6_ENABLE) |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 330 | #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 10) |
Bartlomiej Sieka | a11c0b8 | 2007-05-27 16:51:48 +0200 | [diff] [blame] | 331 | #define STATUS_LED_STATE STATUS_LED_BLINKING |
| 332 | |
| 333 | #define STATUS_LED_BIT1 ((vu_long *) MPC5XXX_GPT7_ENABLE) |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 334 | #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 10) |
Bartlomiej Sieka | a11c0b8 | 2007-05-27 16:51:48 +0200 | [diff] [blame] | 335 | #define STATUS_LED_STATE1 STATUS_LED_OFF |
| 336 | |
| 337 | #define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 338 | |
Heiko Schocher | 566a494 | 2007-06-22 19:11:54 +0200 | [diff] [blame] | 339 | #elif defined(CONFIG_BOARD_SPECIFIC_LED) |
| 340 | /* led_id_t is unsigned long mask */ |
| 341 | typedef unsigned long led_id_t; |
| 342 | |
| 343 | extern void __led_toggle (led_id_t mask); |
| 344 | extern void __led_init (led_id_t mask, int state); |
| 345 | extern void __led_set (led_id_t mask, int state); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 346 | #else |
| 347 | # error Status LED configuration missing |
| 348 | #endif |
| 349 | /************************************************************************/ |
| 350 | |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 351 | #ifndef CONFIG_BOARD_SPECIFIC_LED |
| 352 | # include <asm/status_led.h> |
| 353 | #endif |
| 354 | |
Wolfgang Denk | de74b9e | 2007-10-13 21:15:39 +0200 | [diff] [blame] | 355 | /* |
Peter Pearse | bd86220 | 2007-09-18 13:07:54 +0100 | [diff] [blame] | 356 | * Coloured LEDs API |
Wolfgang Denk | de74b9e | 2007-10-13 21:15:39 +0200 | [diff] [blame] | 357 | */ |
Peter Pearse | bd86220 | 2007-09-18 13:07:54 +0100 | [diff] [blame] | 358 | #ifndef __ASSEMBLY__ |
| 359 | extern void coloured_LED_init (void); |
| 360 | extern void red_LED_on(void); |
| 361 | extern void red_LED_off(void); |
| 362 | extern void green_LED_on(void); |
| 363 | extern void green_LED_off(void); |
| 364 | extern void yellow_LED_on(void); |
| 365 | extern void yellow_LED_off(void); |
Tom Rix | 7cdf804 | 2009-05-15 23:47:12 +0200 | [diff] [blame] | 366 | extern void blue_LED_on(void); |
| 367 | extern void blue_LED_off(void); |
Peter Pearse | bd86220 | 2007-09-18 13:07:54 +0100 | [diff] [blame] | 368 | #else |
| 369 | .extern LED_init |
| 370 | .extern red_LED_on |
| 371 | .extern red_LED_off |
| 372 | .extern yellow_LED_on |
| 373 | .extern yellow_LED_off |
| 374 | .extern green_LED_on |
| 375 | .extern green_LED_off |
Tom Rix | 7cdf804 | 2009-05-15 23:47:12 +0200 | [diff] [blame] | 376 | .extern blue_LED_on |
| 377 | .extern blue_LED_off |
Peter Pearse | bd86220 | 2007-09-18 13:07:54 +0100 | [diff] [blame] | 378 | #endif |
| 379 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 380 | #endif /* CONFIG_STATUS_LED */ |
| 381 | |
| 382 | #endif /* _STATUS_LED_H_ */ |