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 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 75 | /***** GEN860T *********************************************************/ |
| 76 | #elif defined(CONFIG_GEN860T) |
| 77 | |
| 78 | # define STATUS_LED_PAR im_ioport.iop_papar |
| 79 | # define STATUS_LED_DIR im_ioport.iop_padir |
| 80 | # define STATUS_LED_ODR im_ioport.iop_paodr |
| 81 | # define STATUS_LED_DAT im_ioport.iop_padat |
| 82 | |
| 83 | # 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] | 84 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 4) |
wdenk | 7aa7861 | 2003-05-03 15:50:43 +0000 | [diff] [blame] | 85 | # define STATUS_LED_STATE STATUS_LED_OFF |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 86 | # 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] | 87 | # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 8) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 88 | # define STATUS_LED_STATE1 STATUS_LED_BLINKING |
| 89 | # 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] | 90 | # define STATUS_LED_PERIOD2 (CONFIG_SYS_HZ / 4) |
wdenk | 7aa7861 | 2003-05-03 15:50:43 +0000 | [diff] [blame] | 91 | # define STATUS_LED_STATE2 STATUS_LED_OFF |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 92 | # 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] | 93 | # define STATUS_LED_PERIOD3 (CONFIG_SYS_HZ / 4) |
wdenk | 7aa7861 | 2003-05-03 15:50:43 +0000 | [diff] [blame] | 94 | # define STATUS_LED_STATE3 STATUS_LED_OFF |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 95 | |
| 96 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
wdenk | 7aa7861 | 2003-05-03 15:50:43 +0000 | [diff] [blame] | 97 | # define STATUS_LED_BOOT 1 /* Boot status on LED 1 */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 98 | |
| 99 | /***** IVMS8 **********************************************************/ |
| 100 | #elif defined(CONFIG_IVMS8) |
| 101 | |
| 102 | # define STATUS_LED_PAR im_cpm.cp_pbpar |
| 103 | # define STATUS_LED_DIR im_cpm.cp_pbdir |
| 104 | # define STATUS_LED_ODR im_cpm.cp_pbodr |
| 105 | # define STATUS_LED_DAT im_cpm.cp_pbdat |
| 106 | |
| 107 | # 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] | 108 | # define STATUS_LED_PERIOD (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 109 | # define STATUS_LED_STATE STATUS_LED_OFF |
| 110 | # 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] | 111 | # define STATUS_LED_PERIOD1 (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 112 | # define STATUS_LED_STATE1 STATUS_LED_OFF |
| 113 | /* IDE LED usable for other purposes, too */ |
| 114 | # 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] | 115 | # define STATUS_LED_PERIOD2 (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 116 | # define STATUS_LED_STATE2 STATUS_LED_OFF |
| 117 | |
| 118 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 119 | |
| 120 | # define STATUS_ILOCK_SWITCH 0x00800000 /* ILOCK switch in IRQ4 */ |
| 121 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 122 | # define STATUS_ILOCK_PERIOD (CONFIG_SYS_HZ / 10) /* about every 100 ms */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 123 | |
| 124 | # define STATUS_LED_YELLOW 0 |
| 125 | # define STATUS_LED_GREEN 1 |
| 126 | # define STATUS_LED_BOOT 2 /* IDE LED used for boot status */ |
| 127 | |
| 128 | /***** IVML24 *********************************************************/ |
| 129 | #elif defined(CONFIG_IVML24) |
| 130 | |
| 131 | # define STATUS_LED_PAR im_cpm.cp_pbpar |
| 132 | # define STATUS_LED_DIR im_cpm.cp_pbdir |
| 133 | # define STATUS_LED_ODR im_cpm.cp_pbodr |
| 134 | # define STATUS_LED_DAT im_cpm.cp_pbdat |
| 135 | |
| 136 | # 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] | 137 | # define STATUS_LED_PERIOD (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 138 | # define STATUS_LED_STATE STATUS_LED_OFF |
| 139 | # 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] | 140 | # define STATUS_LED_PERIOD1 (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 141 | # define STATUS_LED_STATE1 STATUS_LED_OFF |
| 142 | /* IDE LED usable for other purposes, too */ |
| 143 | # 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] | 144 | # define STATUS_LED_PERIOD2 (1 * CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 145 | # define STATUS_LED_STATE2 STATUS_LED_OFF |
| 146 | |
| 147 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 148 | |
| 149 | # define STATUS_ILOCK_SWITCH 0x00004000 /* ILOCK is on PB.17 */ |
| 150 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 151 | # define STATUS_ILOCK_PERIOD (CONFIG_SYS_HZ / 10) /* about every 100 ms */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 152 | |
| 153 | # define STATUS_LED_YELLOW 0 |
| 154 | # define STATUS_LED_GREEN 1 |
| 155 | # define STATUS_LED_BOOT 2 /* IDE LED used for boot status */ |
| 156 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 157 | /***** ICU862 ********************************************************/ |
| 158 | #elif defined(CONFIG_ICU862) |
| 159 | |
| 160 | # define STATUS_LED_PAR im_ioport.iop_papar |
| 161 | # define STATUS_LED_DIR im_ioport.iop_padir |
| 162 | # define STATUS_LED_ODR im_ioport.iop_paodr |
| 163 | # define STATUS_LED_DAT im_ioport.iop_padat |
| 164 | |
| 165 | # 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] | 166 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 167 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 168 | # 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] | 169 | # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 170 | # define STATUS_LED_STATE1 STATUS_LED_OFF |
| 171 | |
| 172 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 173 | |
| 174 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 175 | |
| 176 | /***** Someone else defines these *************************************/ |
| 177 | #elif defined(STATUS_LED_PAR) |
| 178 | |
| 179 | /* |
| 180 | * ADVICE: Define in your board configuration file rather than |
| 181 | * filling this file up with lots of custom board stuff. |
| 182 | */ |
| 183 | |
| 184 | /***** NetVia ********************************************************/ |
| 185 | #elif defined(CONFIG_NETVIA) |
| 186 | |
wdenk | 993cad9 | 2003-06-26 22:04:09 +0000 | [diff] [blame] | 187 | #if !defined(CONFIG_NETVIA_VERSION) || CONFIG_NETVIA_VERSION == 1 |
| 188 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 189 | #define STATUS_LED_PAR im_ioport.iop_pdpar |
| 190 | #define STATUS_LED_DIR im_ioport.iop_pddir |
| 191 | #undef STATUS_LED_ODR |
| 192 | #define STATUS_LED_DAT im_ioport.iop_pddat |
| 193 | |
| 194 | # define STATUS_LED_BIT 0x0080 /* PD.8 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 195 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 196 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 197 | |
| 198 | # define STATUS_LED_BIT1 0x0040 /* PD.9 */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 199 | # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 2) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 200 | # define STATUS_LED_STATE1 STATUS_LED_OFF |
| 201 | |
| 202 | # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ |
| 203 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 204 | |
wdenk | 993cad9 | 2003-06-26 22:04:09 +0000 | [diff] [blame] | 205 | #endif |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 206 | |
wdenk | 0db5bca | 2003-03-31 17:27:09 +0000 | [diff] [blame] | 207 | /***** CMI ********************************************************/ |
| 208 | #elif defined(CONFIG_CMI) |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 209 | # define STATUS_LED_DIR im_mios.mios_mpiosm32ddr |
| 210 | # define STATUS_LED_DAT im_mios.mios_mpiosm32dr |
wdenk | 0db5bca | 2003-03-31 17:27:09 +0000 | [diff] [blame] | 211 | |
| 212 | # define STATUS_LED_BIT 0x2000 /* Select one of the 16 possible*/ |
| 213 | /* MIOS outputs */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 214 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) /* Blinking periode is 500 ms */ |
wdenk | 0db5bca | 2003-03-31 17:27:09 +0000 | [diff] [blame] | 215 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 216 | |
| 217 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 0 */ |
| 218 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 219 | |
wdenk | 0608e04 | 2004-03-25 19:29:38 +0000 | [diff] [blame] | 220 | /***** KUP4K, KUP4X ****************************************************/ |
Wolfgang Denk | dff07e1 | 2010-10-05 22:54:54 +0200 | [diff] [blame] | 221 | #elif defined(CONFIG_KUP4K) || defined(CONFIG_KUP4X) |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 222 | |
| 223 | # define STATUS_LED_PAR im_ioport.iop_papar |
| 224 | # define STATUS_LED_DIR im_ioport.iop_padir |
| 225 | # define STATUS_LED_ODR im_ioport.iop_paodr |
| 226 | # define STATUS_LED_DAT im_ioport.iop_padat |
| 227 | |
| 228 | # 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] | 229 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | 56f94be | 2002-11-05 16:35:14 +0000 | [diff] [blame] | 230 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 231 | |
| 232 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 233 | |
| 234 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 235 | |
wdenk | dc7c9a1 | 2003-03-26 06:55:25 +0000 | [diff] [blame] | 236 | #elif defined(CONFIG_SVM_SC8xx) |
| 237 | # define STATUS_LED_PAR im_cpm.cp_pbpar |
| 238 | # define STATUS_LED_DIR im_cpm.cp_pbdir |
| 239 | # define STATUS_LED_ODR im_cpm.cp_pbodr |
| 240 | # define STATUS_LED_DAT im_cpm.cp_pbdat |
| 241 | |
| 242 | # define STATUS_LED_BIT 0x00000001 |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 243 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | dc7c9a1 | 2003-03-26 06:55:25 +0000 | [diff] [blame] | 244 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 245 | |
| 246 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 247 | |
| 248 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 249 | |
wdenk | 682011f | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 250 | /***** RBC823 ********************************************************/ |
| 251 | #elif defined(CONFIG_RBC823) |
| 252 | |
| 253 | # define STATUS_LED_PAR im_ioport.iop_pcpar |
| 254 | # define STATUS_LED_DIR im_ioport.iop_pcdir |
| 255 | # undef STATUS_LED_ODR |
| 256 | # define STATUS_LED_DAT im_ioport.iop_pcdat |
| 257 | |
| 258 | # 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] | 259 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
wdenk | 682011f | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 260 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 261 | # 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] | 262 | # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ) |
wdenk | 682011f | 2003-06-03 23:54:09 +0000 | [diff] [blame] | 263 | # define STATUS_LED_STATE1 STATUS_LED_OFF |
| 264 | |
| 265 | # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ |
| 266 | |
| 267 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 268 | |
wdenk | 04a85b3 | 2004-04-15 18:22:41 +0000 | [diff] [blame] | 269 | /***** NetPhone ********************************************************/ |
wdenk | 79fa88f | 2004-06-07 23:46:25 +0000 | [diff] [blame] | 270 | #elif defined(CONFIG_NETPHONE) || defined(CONFIG_NETTA2) |
wdenk | 04a85b3 | 2004-04-15 18:22:41 +0000 | [diff] [blame] | 271 | /* XXX empty just to avoid the error */ |
Wolfgang Denk | 6bdf430 | 2005-08-15 15:55:00 +0200 | [diff] [blame] | 272 | /***** STx XTc ********************************************************/ |
| 273 | #elif defined(CONFIG_STXXTC) |
| 274 | /* XXX empty just to avoid the error */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 275 | /************************************************************************/ |
Bartlomiej Sieka | 4707fb5 | 2006-10-13 21:09:09 +0200 | [diff] [blame] | 276 | #elif defined(CONFIG_V38B) |
| 277 | |
| 278 | # define STATUS_LED_BIT 0x0010 /* Timer7 GPIO */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 279 | # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
Bartlomiej Sieka | 4707fb5 | 2006-10-13 21:09:09 +0200 | [diff] [blame] | 280 | # define STATUS_LED_STATE STATUS_LED_BLINKING |
| 281 | |
| 282 | # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ |
| 283 | # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 284 | |
Bartlomiej Sieka | a11c0b8 | 2007-05-27 16:51:48 +0200 | [diff] [blame] | 285 | #elif defined(CONFIG_MOTIONPRO) |
| 286 | |
| 287 | #define STATUS_LED_BIT ((vu_long *) MPC5XXX_GPT6_ENABLE) |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 288 | #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 10) |
Bartlomiej Sieka | a11c0b8 | 2007-05-27 16:51:48 +0200 | [diff] [blame] | 289 | #define STATUS_LED_STATE STATUS_LED_BLINKING |
| 290 | |
| 291 | #define STATUS_LED_BIT1 ((vu_long *) MPC5XXX_GPT7_ENABLE) |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 292 | #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 10) |
Bartlomiej Sieka | a11c0b8 | 2007-05-27 16:51:48 +0200 | [diff] [blame] | 293 | #define STATUS_LED_STATE1 STATUS_LED_OFF |
| 294 | |
| 295 | #define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ |
| 296 | |
Heiko Schocher | 566a494 | 2007-06-22 19:11:54 +0200 | [diff] [blame] | 297 | #elif defined(CONFIG_BOARD_SPECIFIC_LED) |
| 298 | /* led_id_t is unsigned long mask */ |
| 299 | typedef unsigned long led_id_t; |
| 300 | |
| 301 | extern void __led_toggle (led_id_t mask); |
| 302 | extern void __led_init (led_id_t mask, int state); |
| 303 | extern void __led_set (led_id_t mask, int state); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 304 | #else |
| 305 | # error Status LED configuration missing |
| 306 | #endif |
| 307 | /************************************************************************/ |
| 308 | |
wdenk | 48b4261 | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 309 | #ifndef CONFIG_BOARD_SPECIFIC_LED |
| 310 | # include <asm/status_led.h> |
| 311 | #endif |
| 312 | |
Wolfgang Denk | de74b9e | 2007-10-13 21:15:39 +0200 | [diff] [blame] | 313 | /* |
Peter Pearse | bd86220 | 2007-09-18 13:07:54 +0100 | [diff] [blame] | 314 | * Coloured LEDs API |
Wolfgang Denk | de74b9e | 2007-10-13 21:15:39 +0200 | [diff] [blame] | 315 | */ |
Peter Pearse | bd86220 | 2007-09-18 13:07:54 +0100 | [diff] [blame] | 316 | #ifndef __ASSEMBLY__ |
| 317 | extern void coloured_LED_init (void); |
Jason Kridner | 2d3be7c | 2011-09-04 14:40:16 -0400 | [diff] [blame] | 318 | extern void red_led_on(void); |
| 319 | extern void red_led_off(void); |
| 320 | extern void green_led_on(void); |
| 321 | extern void green_led_off(void); |
| 322 | extern void yellow_led_on(void); |
| 323 | extern void yellow_led_off(void); |
| 324 | extern void blue_led_on(void); |
| 325 | extern void blue_led_off(void); |
Peter Pearse | bd86220 | 2007-09-18 13:07:54 +0100 | [diff] [blame] | 326 | #else |
| 327 | .extern LED_init |
Jason Kridner | 2d3be7c | 2011-09-04 14:40:16 -0400 | [diff] [blame] | 328 | .extern red_led_on |
| 329 | .extern red_led_off |
| 330 | .extern yellow_led_on |
| 331 | .extern yellow_led_off |
| 332 | .extern green_led_on |
| 333 | .extern green_led_off |
| 334 | .extern blue_led_on |
| 335 | .extern blue_led_off |
Peter Pearse | bd86220 | 2007-09-18 13:07:54 +0100 | [diff] [blame] | 336 | #endif |
| 337 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 338 | #endif /* CONFIG_STATUS_LED */ |
| 339 | |
| 340 | #endif /* _STATUS_LED_H_ */ |