1c609719bSwdenk /* 204a85b3bSwdenk * (C) Copyright 2000-2004 3c609719bSwdenk * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4c609719bSwdenk * 5c609719bSwdenk * See file CREDITS for list of people who contributed to this 6c609719bSwdenk * project. 7c609719bSwdenk * 8c609719bSwdenk * This program is free software; you can redistribute it and/or 9c609719bSwdenk * modify it under the terms of the GNU General Public License as 10c609719bSwdenk * published by the Free Software Foundation; either version 2 of 11c609719bSwdenk * the License, or (at your option) any later version. 12c609719bSwdenk * 13c609719bSwdenk * This program is distributed in the hope that it will be useful, 14c609719bSwdenk * but WITHOUT ANY WARRANTY; without even the implied warranty of 15c609719bSwdenk * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16c609719bSwdenk * GNU General Public License for more details. 17c609719bSwdenk * 18c609719bSwdenk * You should have received a copy of the GNU General Public License 19c609719bSwdenk * along with this program; if not, write to the Free Software 20c609719bSwdenk * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21c609719bSwdenk * MA 02111-1307 USA 22c609719bSwdenk */ 23c609719bSwdenk 24c609719bSwdenk /* 25c609719bSwdenk * The purpose of this code is to signal the operational status of a 26c609719bSwdenk * target which usually boots over the network; while running in 27c609719bSwdenk * PCBoot, a status LED is blinking. As soon as a valid BOOTP reply 28c609719bSwdenk * message has been received, the LED is turned off. The Linux 29c609719bSwdenk * kernel, once it is running, will start blinking the LED again, 30c609719bSwdenk * with another frequency. 31c609719bSwdenk */ 32c609719bSwdenk 33c609719bSwdenk #ifndef _STATUS_LED_H_ 34c609719bSwdenk #define _STATUS_LED_H_ 35c609719bSwdenk 36c609719bSwdenk #ifdef CONFIG_STATUS_LED 37c609719bSwdenk 38c609719bSwdenk #define STATUS_LED_OFF 0 39c609719bSwdenk #define STATUS_LED_BLINKING 1 40c609719bSwdenk #define STATUS_LED_ON 2 41c609719bSwdenk 42c609719bSwdenk void status_led_tick (unsigned long timestamp); 43c609719bSwdenk void status_led_set (int led, int state); 44c609719bSwdenk 45c609719bSwdenk /***** TQM8xxL ********************************************************/ 46c40b2956Swdenk #if defined(CONFIG_TQM8xxL) && !defined(CONFIG_HMI10) 47c609719bSwdenk # define STATUS_LED_PAR im_cpm.cp_pbpar 48c609719bSwdenk # define STATUS_LED_DIR im_cpm.cp_pbdir 49c609719bSwdenk # define STATUS_LED_ODR im_cpm.cp_pbodr 50c609719bSwdenk # define STATUS_LED_DAT im_cpm.cp_pbdat 51c609719bSwdenk 52c609719bSwdenk # define STATUS_LED_BIT 0x00000001 53*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 54c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 55c609719bSwdenk 56c609719bSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 57c609719bSwdenk 58c609719bSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 59c609719bSwdenk 60c609719bSwdenk /***** MVS v1 **********************************************************/ 61c609719bSwdenk #elif (defined(CONFIG_MVS) && CONFIG_MVS < 2) 62c609719bSwdenk # define STATUS_LED_PAR im_ioport.iop_pdpar 63c609719bSwdenk # define STATUS_LED_DIR im_ioport.iop_pddir 64c609719bSwdenk # undef STATUS_LED_ODR 65c609719bSwdenk # define STATUS_LED_DAT im_ioport.iop_pddat 66c609719bSwdenk 67c609719bSwdenk # define STATUS_LED_BIT 0x00000001 68*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 69c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 70c609719bSwdenk 71c609719bSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 72c609719bSwdenk 73c609719bSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 74c609719bSwdenk 75c609719bSwdenk /***** ETX_094 ********************************************************/ 76c609719bSwdenk #elif defined(CONFIG_ETX094) 77c609719bSwdenk 78c609719bSwdenk # define STATUS_LED_PAR im_ioport.iop_pdpar 79c609719bSwdenk # define STATUS_LED_DIR im_ioport.iop_pddir 80c609719bSwdenk # undef STATUS_LED_ODR 81c609719bSwdenk # define STATUS_LED_DAT im_ioport.iop_pddat 82c609719bSwdenk 83c609719bSwdenk # define STATUS_LED_BIT 0x00000001 84*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 85c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 86c609719bSwdenk 87c609719bSwdenk # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ 88c609719bSwdenk 89c609719bSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 90c609719bSwdenk 91c609719bSwdenk /***** GEN860T *********************************************************/ 92c609719bSwdenk #elif defined(CONFIG_GEN860T) 93c609719bSwdenk 94c609719bSwdenk # define STATUS_LED_PAR im_ioport.iop_papar 95c609719bSwdenk # define STATUS_LED_DIR im_ioport.iop_padir 96c609719bSwdenk # define STATUS_LED_ODR im_ioport.iop_paodr 97c609719bSwdenk # define STATUS_LED_DAT im_ioport.iop_padat 98c609719bSwdenk 99c609719bSwdenk # define STATUS_LED_BIT 0x0800 /* Red LED 0 is on PA.4 */ 100*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 4) 1017aa78614Swdenk # define STATUS_LED_STATE STATUS_LED_OFF 102c609719bSwdenk # define STATUS_LED_BIT1 0x0400 /* Grn LED 1 is on PA.5 */ 103*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 8) 104c609719bSwdenk # define STATUS_LED_STATE1 STATUS_LED_BLINKING 105c609719bSwdenk # define STATUS_LED_BIT2 0x0080 /* Red LED 2 is on PA.8 */ 106*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD2 (CONFIG_SYS_HZ / 4) 1077aa78614Swdenk # define STATUS_LED_STATE2 STATUS_LED_OFF 108c609719bSwdenk # define STATUS_LED_BIT3 0x0040 /* Grn LED 3 is on PA.9 */ 109*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD3 (CONFIG_SYS_HZ / 4) 1107aa78614Swdenk # define STATUS_LED_STATE3 STATUS_LED_OFF 111c609719bSwdenk 112c609719bSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 1137aa78614Swdenk # define STATUS_LED_BOOT 1 /* Boot status on LED 1 */ 114c609719bSwdenk 115c609719bSwdenk /***** IVMS8 **********************************************************/ 116c609719bSwdenk #elif defined(CONFIG_IVMS8) 117c609719bSwdenk 118c609719bSwdenk # define STATUS_LED_PAR im_cpm.cp_pbpar 119c609719bSwdenk # define STATUS_LED_DIR im_cpm.cp_pbdir 120c609719bSwdenk # define STATUS_LED_ODR im_cpm.cp_pbodr 121c609719bSwdenk # define STATUS_LED_DAT im_cpm.cp_pbdat 122c609719bSwdenk 123c609719bSwdenk # define STATUS_LED_BIT 0x00000010 /* LED 0 is on PB.27 */ 124*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (1 * CONFIG_SYS_HZ) 125c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_OFF 126c609719bSwdenk # define STATUS_LED_BIT1 0x00000020 /* LED 1 is on PB.26 */ 127*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD1 (1 * CONFIG_SYS_HZ) 128c609719bSwdenk # define STATUS_LED_STATE1 STATUS_LED_OFF 129c609719bSwdenk /* IDE LED usable for other purposes, too */ 130c609719bSwdenk # define STATUS_LED_BIT2 0x00000008 /* LED 2 is on PB.28 */ 131*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD2 (1 * CONFIG_SYS_HZ) 132c609719bSwdenk # define STATUS_LED_STATE2 STATUS_LED_OFF 133c609719bSwdenk 134c609719bSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 135c609719bSwdenk 136c609719bSwdenk # define STATUS_ILOCK_SWITCH 0x00800000 /* ILOCK switch in IRQ4 */ 137c609719bSwdenk 138*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_ILOCK_PERIOD (CONFIG_SYS_HZ / 10) /* about every 100 ms */ 139c609719bSwdenk 140c609719bSwdenk # define STATUS_LED_YELLOW 0 141c609719bSwdenk # define STATUS_LED_GREEN 1 142c609719bSwdenk # define STATUS_LED_BOOT 2 /* IDE LED used for boot status */ 143c609719bSwdenk 144c609719bSwdenk /***** IVML24 *********************************************************/ 145c609719bSwdenk #elif defined(CONFIG_IVML24) 146c609719bSwdenk 147c609719bSwdenk # define STATUS_LED_PAR im_cpm.cp_pbpar 148c609719bSwdenk # define STATUS_LED_DIR im_cpm.cp_pbdir 149c609719bSwdenk # define STATUS_LED_ODR im_cpm.cp_pbodr 150c609719bSwdenk # define STATUS_LED_DAT im_cpm.cp_pbdat 151c609719bSwdenk 152c609719bSwdenk # define STATUS_LED_BIT 0x00000010 /* LED 0 is on PB.27 */ 153*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (1 * CONFIG_SYS_HZ) 154c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_OFF 155c609719bSwdenk # define STATUS_LED_BIT1 0x00000020 /* LED 1 is on PB.26 */ 156*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD1 (1 * CONFIG_SYS_HZ) 157c609719bSwdenk # define STATUS_LED_STATE1 STATUS_LED_OFF 158c609719bSwdenk /* IDE LED usable for other purposes, too */ 159c609719bSwdenk # define STATUS_LED_BIT2 0x00000008 /* LED 2 is on PB.28 */ 160*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD2 (1 * CONFIG_SYS_HZ) 161c609719bSwdenk # define STATUS_LED_STATE2 STATUS_LED_OFF 162c609719bSwdenk 163c609719bSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 164c609719bSwdenk 165c609719bSwdenk # define STATUS_ILOCK_SWITCH 0x00004000 /* ILOCK is on PB.17 */ 166c609719bSwdenk 167*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_ILOCK_PERIOD (CONFIG_SYS_HZ / 10) /* about every 100 ms */ 168c609719bSwdenk 169c609719bSwdenk # define STATUS_LED_YELLOW 0 170c609719bSwdenk # define STATUS_LED_GREEN 1 171c609719bSwdenk # define STATUS_LED_BOOT 2 /* IDE LED used for boot status */ 172c609719bSwdenk 173c609719bSwdenk /***** LANTEC *********************************************************/ 174c609719bSwdenk #elif defined(CONFIG_LANTEC) 175c609719bSwdenk 176c609719bSwdenk # define STATUS_LED_PAR im_ioport.iop_pdpar 177c609719bSwdenk # define STATUS_LED_DIR im_ioport.iop_pddir 178c609719bSwdenk # undef STATUS_LED_ODR 179c609719bSwdenk # define STATUS_LED_DAT im_ioport.iop_pddat 180c609719bSwdenk 181c609719bSwdenk # if CONFIG_LATEC < 2 182c609719bSwdenk # define STATUS_LED_BIT 0x1000 183c609719bSwdenk # else 184c609719bSwdenk # define STATUS_LED_BIT 0x0800 185c609719bSwdenk # endif 186*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 187c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 188c609719bSwdenk 189c609719bSwdenk # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ 190c609719bSwdenk 191c609719bSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 192c609719bSwdenk 193c609719bSwdenk /***** PCU E and CCM ************************************************/ 194c609719bSwdenk #elif (defined(CONFIG_PCU_E) || defined(CONFIG_CCM)) 195c609719bSwdenk 196c609719bSwdenk # define STATUS_LED_PAR im_cpm.cp_pbpar 197c609719bSwdenk # define STATUS_LED_DIR im_cpm.cp_pbdir 198c609719bSwdenk # define STATUS_LED_ODR im_cpm.cp_pbodr 199c609719bSwdenk # define STATUS_LED_DAT im_cpm.cp_pbdat 200c609719bSwdenk 201c609719bSwdenk # define STATUS_LED_BIT 0x00010000 /* green LED is on PB.15 */ 202*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 203c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 204c609719bSwdenk 205c609719bSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 206c609719bSwdenk 207c609719bSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 208c609719bSwdenk 209c609719bSwdenk /***** ICU862 ********************************************************/ 210c609719bSwdenk #elif defined(CONFIG_ICU862) 211c609719bSwdenk 212c609719bSwdenk # define STATUS_LED_PAR im_ioport.iop_papar 213c609719bSwdenk # define STATUS_LED_DIR im_ioport.iop_padir 214c609719bSwdenk # define STATUS_LED_ODR im_ioport.iop_paodr 215c609719bSwdenk # define STATUS_LED_DAT im_ioport.iop_padat 216c609719bSwdenk 217c609719bSwdenk # define STATUS_LED_BIT 0x4000 /* LED 0 is on PA.1 */ 218*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 219c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 220c609719bSwdenk # define STATUS_LED_BIT1 0x1000 /* LED 1 is on PA.3 */ 221*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ) 222c609719bSwdenk # define STATUS_LED_STATE1 STATUS_LED_OFF 223c609719bSwdenk 224c609719bSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 225c609719bSwdenk 226c609719bSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 227c609719bSwdenk 228c609719bSwdenk /***** Someone else defines these *************************************/ 229c609719bSwdenk #elif defined(STATUS_LED_PAR) 230c609719bSwdenk 231c609719bSwdenk /* 232c609719bSwdenk * ADVICE: Define in your board configuration file rather than 233c609719bSwdenk * filling this file up with lots of custom board stuff. 234c609719bSwdenk */ 235c609719bSwdenk 236c609719bSwdenk /***** NetVia ********************************************************/ 237c609719bSwdenk #elif defined(CONFIG_NETVIA) 238c609719bSwdenk 239993cad93Swdenk #if !defined(CONFIG_NETVIA_VERSION) || CONFIG_NETVIA_VERSION == 1 240993cad93Swdenk 241c609719bSwdenk #define STATUS_LED_PAR im_ioport.iop_pdpar 242c609719bSwdenk #define STATUS_LED_DIR im_ioport.iop_pddir 243c609719bSwdenk #undef STATUS_LED_ODR 244c609719bSwdenk #define STATUS_LED_DAT im_ioport.iop_pddat 245c609719bSwdenk 246c609719bSwdenk # define STATUS_LED_BIT 0x0080 /* PD.8 */ 247*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 248c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 249c609719bSwdenk 250c609719bSwdenk # define STATUS_LED_BIT1 0x0040 /* PD.9 */ 251*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 2) 252c609719bSwdenk # define STATUS_LED_STATE1 STATUS_LED_OFF 253c609719bSwdenk 254c609719bSwdenk # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ 255c609719bSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 256c609719bSwdenk 257993cad93Swdenk #endif 25856f94be3Swdenk 2590db5bca8Swdenk /***** CMI ********************************************************/ 2600db5bca8Swdenk #elif defined(CONFIG_CMI) 2610db5bca8Swdenk # define STATUS_LED_DIR im_mios.mios_mpiosm32ddr 2620db5bca8Swdenk # define STATUS_LED_DAT im_mios.mios_mpiosm32dr 2630db5bca8Swdenk 2640db5bca8Swdenk # define STATUS_LED_BIT 0x2000 /* Select one of the 16 possible*/ 2650db5bca8Swdenk /* MIOS outputs */ 266*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) /* Blinking periode is 500 ms */ 2670db5bca8Swdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 2680db5bca8Swdenk 2690db5bca8Swdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 0 */ 2700db5bca8Swdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 2710db5bca8Swdenk 2720608e04dSwdenk /***** KUP4K, KUP4X ****************************************************/ 2730608e04dSwdenk #elif defined(CONFIG_KUP4K) || defined(CONFIG_KUP4X) || defined(CONFIG_CCM) 27456f94be3Swdenk 27556f94be3Swdenk # define STATUS_LED_PAR im_ioport.iop_papar 27656f94be3Swdenk # define STATUS_LED_DIR im_ioport.iop_padir 27756f94be3Swdenk # define STATUS_LED_ODR im_ioport.iop_paodr 27856f94be3Swdenk # define STATUS_LED_DAT im_ioport.iop_padat 27956f94be3Swdenk 28056f94be3Swdenk # define STATUS_LED_BIT 0x00000300 /* green + red PA[8]=yellow, PA[7]=red, PA[6]=green */ 281*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 28256f94be3Swdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 28356f94be3Swdenk 28456f94be3Swdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 28556f94be3Swdenk 28656f94be3Swdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 28756f94be3Swdenk 288dc7c9a1aSwdenk #elif defined(CONFIG_SVM_SC8xx) 289dc7c9a1aSwdenk # define STATUS_LED_PAR im_cpm.cp_pbpar 290dc7c9a1aSwdenk # define STATUS_LED_DIR im_cpm.cp_pbdir 291dc7c9a1aSwdenk # define STATUS_LED_ODR im_cpm.cp_pbodr 292dc7c9a1aSwdenk # define STATUS_LED_DAT im_cpm.cp_pbdat 293dc7c9a1aSwdenk 294dc7c9a1aSwdenk # define STATUS_LED_BIT 0x00000001 295*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 296dc7c9a1aSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 297dc7c9a1aSwdenk 298dc7c9a1aSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 299dc7c9a1aSwdenk 300dc7c9a1aSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 301dc7c9a1aSwdenk 302682011ffSwdenk /***** RBC823 ********************************************************/ 303682011ffSwdenk #elif defined(CONFIG_RBC823) 304682011ffSwdenk 305682011ffSwdenk # define STATUS_LED_PAR im_ioport.iop_pcpar 306682011ffSwdenk # define STATUS_LED_DIR im_ioport.iop_pcdir 307682011ffSwdenk # undef STATUS_LED_ODR 308682011ffSwdenk # define STATUS_LED_DAT im_ioport.iop_pcdat 309682011ffSwdenk 310682011ffSwdenk # define STATUS_LED_BIT 0x0002 /* LED 0 is on PC.14 */ 311*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 312682011ffSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 313682011ffSwdenk # define STATUS_LED_BIT1 0x0004 /* LED 1 is on PC.13 */ 314*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ) 315682011ffSwdenk # define STATUS_LED_STATE1 STATUS_LED_OFF 316682011ffSwdenk 317682011ffSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 318682011ffSwdenk 319682011ffSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 320682011ffSwdenk 321c40b2956Swdenk /***** HMI10 **********************************************************/ 322c40b2956Swdenk #elif defined(CONFIG_HMI10) 323a522fa0eSwdenk # define STATUS_LED_PAR im_ioport.iop_papar 324a522fa0eSwdenk # define STATUS_LED_DIR im_ioport.iop_padir 325a522fa0eSwdenk # define STATUS_LED_ODR im_ioport.iop_paodr 326a522fa0eSwdenk # define STATUS_LED_DAT im_ioport.iop_padat 327a522fa0eSwdenk 328a522fa0eSwdenk # define STATUS_LED_BIT 0x00000001 /* LED is on PA15 */ 329*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 330a522fa0eSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 331a522fa0eSwdenk 332a522fa0eSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 333a522fa0eSwdenk 334a522fa0eSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 335a522fa0eSwdenk 33604a85b3bSwdenk /***** NetPhone ********************************************************/ 33779fa88f3Swdenk #elif defined(CONFIG_NETPHONE) || defined(CONFIG_NETTA2) 33804a85b3bSwdenk /* XXX empty just to avoid the error */ 3396bdf4306SWolfgang Denk /***** STx XTc ********************************************************/ 3406bdf4306SWolfgang Denk #elif defined(CONFIG_STXXTC) 3416bdf4306SWolfgang Denk /* XXX empty just to avoid the error */ 342466b7410Swdenk /***** sbc8240 ********************************************************/ 343466b7410Swdenk #elif defined(CONFIG_WRSBC8240) 344466b7410Swdenk /* XXX empty just to avoid the error */ 345c609719bSwdenk /************************************************************************/ 3465c952cf0Swdenk #elif defined(CONFIG_NIOS2) 3475c952cf0Swdenk /* XXX empty just to avoid the error */ 3485c952cf0Swdenk /************************************************************************/ 3494707fb50SBartlomiej Sieka #elif defined(CONFIG_V38B) 3504707fb50SBartlomiej Sieka 3514707fb50SBartlomiej Sieka # define STATUS_LED_BIT 0x0010 /* Timer7 GPIO */ 352*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 3534707fb50SBartlomiej Sieka # define STATUS_LED_STATE STATUS_LED_BLINKING 3544707fb50SBartlomiej Sieka 3554707fb50SBartlomiej Sieka # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ 3564707fb50SBartlomiej Sieka # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 3574707fb50SBartlomiej Sieka 358a11c0b85SBartlomiej Sieka #elif defined(CONFIG_MOTIONPRO) 359a11c0b85SBartlomiej Sieka 360a11c0b85SBartlomiej Sieka #define STATUS_LED_BIT ((vu_long *) MPC5XXX_GPT6_ENABLE) 361*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 10) 362a11c0b85SBartlomiej Sieka #define STATUS_LED_STATE STATUS_LED_BLINKING 363a11c0b85SBartlomiej Sieka 364a11c0b85SBartlomiej Sieka #define STATUS_LED_BIT1 ((vu_long *) MPC5XXX_GPT7_ENABLE) 365*6d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 10) 366a11c0b85SBartlomiej Sieka #define STATUS_LED_STATE1 STATUS_LED_OFF 367a11c0b85SBartlomiej Sieka 368a11c0b85SBartlomiej Sieka #define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 369a11c0b85SBartlomiej Sieka 370566a494fSHeiko Schocher #elif defined(CONFIG_BOARD_SPECIFIC_LED) 371566a494fSHeiko Schocher /* led_id_t is unsigned long mask */ 372566a494fSHeiko Schocher typedef unsigned long led_id_t; 373566a494fSHeiko Schocher 374566a494fSHeiko Schocher extern void __led_toggle (led_id_t mask); 375566a494fSHeiko Schocher extern void __led_init (led_id_t mask, int state); 376566a494fSHeiko Schocher extern void __led_set (led_id_t mask, int state); 377c609719bSwdenk #else 378c609719bSwdenk # error Status LED configuration missing 379c609719bSwdenk #endif 380c609719bSwdenk /************************************************************************/ 381c609719bSwdenk 38248b42616Swdenk #ifndef CONFIG_BOARD_SPECIFIC_LED 38348b42616Swdenk # include <asm/status_led.h> 38448b42616Swdenk #endif 38548b42616Swdenk 386bd86220fSPeter Pearse /* 387bd86220fSPeter Pearse * Coloured LEDs API 388bd86220fSPeter Pearse */ 389bd86220fSPeter Pearse #ifndef __ASSEMBLY__ 390bd86220fSPeter Pearse extern void coloured_LED_init (void); 391bd86220fSPeter Pearse extern void red_LED_on(void); 392bd86220fSPeter Pearse extern void red_LED_off(void); 393bd86220fSPeter Pearse extern void green_LED_on(void); 394bd86220fSPeter Pearse extern void green_LED_off(void); 395bd86220fSPeter Pearse extern void yellow_LED_on(void); 396bd86220fSPeter Pearse extern void yellow_LED_off(void); 397bd86220fSPeter Pearse #else 398bd86220fSPeter Pearse .extern LED_init 399bd86220fSPeter Pearse .extern red_LED_on 400bd86220fSPeter Pearse .extern red_LED_off 401bd86220fSPeter Pearse .extern yellow_LED_on 402bd86220fSPeter Pearse .extern yellow_LED_off 403bd86220fSPeter Pearse .extern green_LED_on 404bd86220fSPeter Pearse .extern green_LED_off 405bd86220fSPeter Pearse #endif 406bd86220fSPeter Pearse 407c609719bSwdenk #endif /* CONFIG_STATUS_LED */ 408c609719bSwdenk 409c609719bSwdenk #endif /* _STATUS_LED_H_ */ 410