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 ********************************************************/ 4677efe35fSWolfgang Denk #if defined(CONFIG_TQM8xxL) 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 536d0f6bcfSJean-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 686d0f6bcfSJean-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 846d0f6bcfSJean-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 */ 1006d0f6bcfSJean-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 */ 1036d0f6bcfSJean-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 */ 1066d0f6bcfSJean-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 */ 1096d0f6bcfSJean-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 */ 1246d0f6bcfSJean-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 */ 1276d0f6bcfSJean-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 */ 1316d0f6bcfSJean-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 1386d0f6bcfSJean-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 */ 1536d0f6bcfSJean-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 */ 1566d0f6bcfSJean-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 */ 1606d0f6bcfSJean-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 1676d0f6bcfSJean-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 1866d0f6bcfSJean-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 /***** ICU862 ********************************************************/ 194c609719bSwdenk #elif defined(CONFIG_ICU862) 195c609719bSwdenk 196c609719bSwdenk # define STATUS_LED_PAR im_ioport.iop_papar 197c609719bSwdenk # define STATUS_LED_DIR im_ioport.iop_padir 198c609719bSwdenk # define STATUS_LED_ODR im_ioport.iop_paodr 199c609719bSwdenk # define STATUS_LED_DAT im_ioport.iop_padat 200c609719bSwdenk 201c609719bSwdenk # define STATUS_LED_BIT 0x4000 /* LED 0 is on PA.1 */ 2026d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 203c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 204c609719bSwdenk # define STATUS_LED_BIT1 0x1000 /* LED 1 is on PA.3 */ 2056d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ) 206c609719bSwdenk # define STATUS_LED_STATE1 STATUS_LED_OFF 207c609719bSwdenk 208c609719bSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 209c609719bSwdenk 210c609719bSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 211c609719bSwdenk 212c609719bSwdenk /***** Someone else defines these *************************************/ 213c609719bSwdenk #elif defined(STATUS_LED_PAR) 214c609719bSwdenk 215c609719bSwdenk /* 216c609719bSwdenk * ADVICE: Define in your board configuration file rather than 217c609719bSwdenk * filling this file up with lots of custom board stuff. 218c609719bSwdenk */ 219c609719bSwdenk 220c609719bSwdenk /***** NetVia ********************************************************/ 221c609719bSwdenk #elif defined(CONFIG_NETVIA) 222c609719bSwdenk 223993cad93Swdenk #if !defined(CONFIG_NETVIA_VERSION) || CONFIG_NETVIA_VERSION == 1 224993cad93Swdenk 225c609719bSwdenk #define STATUS_LED_PAR im_ioport.iop_pdpar 226c609719bSwdenk #define STATUS_LED_DIR im_ioport.iop_pddir 227c609719bSwdenk #undef STATUS_LED_ODR 228c609719bSwdenk #define STATUS_LED_DAT im_ioport.iop_pddat 229c609719bSwdenk 230c609719bSwdenk # define STATUS_LED_BIT 0x0080 /* PD.8 */ 2316d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 232c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 233c609719bSwdenk 234c609719bSwdenk # define STATUS_LED_BIT1 0x0040 /* PD.9 */ 2356d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 2) 236c609719bSwdenk # define STATUS_LED_STATE1 STATUS_LED_OFF 237c609719bSwdenk 238c609719bSwdenk # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ 239c609719bSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 240c609719bSwdenk 241993cad93Swdenk #endif 24256f94be3Swdenk 2430db5bca8Swdenk /***** CMI ********************************************************/ 2440db5bca8Swdenk #elif defined(CONFIG_CMI) 2450db5bca8Swdenk # define STATUS_LED_DIR im_mios.mios_mpiosm32ddr 2460db5bca8Swdenk # define STATUS_LED_DAT im_mios.mios_mpiosm32dr 2470db5bca8Swdenk 2480db5bca8Swdenk # define STATUS_LED_BIT 0x2000 /* Select one of the 16 possible*/ 2490db5bca8Swdenk /* MIOS outputs */ 2506d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) /* Blinking periode is 500 ms */ 2510db5bca8Swdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 2520db5bca8Swdenk 2530db5bca8Swdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 0 */ 2540db5bca8Swdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 2550db5bca8Swdenk 2560608e04dSwdenk /***** KUP4K, KUP4X ****************************************************/ 257*dff07e18SWolfgang Denk #elif defined(CONFIG_KUP4K) || defined(CONFIG_KUP4X) 25856f94be3Swdenk 25956f94be3Swdenk # define STATUS_LED_PAR im_ioport.iop_papar 26056f94be3Swdenk # define STATUS_LED_DIR im_ioport.iop_padir 26156f94be3Swdenk # define STATUS_LED_ODR im_ioport.iop_paodr 26256f94be3Swdenk # define STATUS_LED_DAT im_ioport.iop_padat 26356f94be3Swdenk 26456f94be3Swdenk # define STATUS_LED_BIT 0x00000300 /* green + red PA[8]=yellow, PA[7]=red, PA[6]=green */ 2656d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 26656f94be3Swdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 26756f94be3Swdenk 26856f94be3Swdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 26956f94be3Swdenk 27056f94be3Swdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 27156f94be3Swdenk 272dc7c9a1aSwdenk #elif defined(CONFIG_SVM_SC8xx) 273dc7c9a1aSwdenk # define STATUS_LED_PAR im_cpm.cp_pbpar 274dc7c9a1aSwdenk # define STATUS_LED_DIR im_cpm.cp_pbdir 275dc7c9a1aSwdenk # define STATUS_LED_ODR im_cpm.cp_pbodr 276dc7c9a1aSwdenk # define STATUS_LED_DAT im_cpm.cp_pbdat 277dc7c9a1aSwdenk 278dc7c9a1aSwdenk # define STATUS_LED_BIT 0x00000001 2796d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 280dc7c9a1aSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 281dc7c9a1aSwdenk 282dc7c9a1aSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 283dc7c9a1aSwdenk 284dc7c9a1aSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 285dc7c9a1aSwdenk 286682011ffSwdenk /***** RBC823 ********************************************************/ 287682011ffSwdenk #elif defined(CONFIG_RBC823) 288682011ffSwdenk 289682011ffSwdenk # define STATUS_LED_PAR im_ioport.iop_pcpar 290682011ffSwdenk # define STATUS_LED_DIR im_ioport.iop_pcdir 291682011ffSwdenk # undef STATUS_LED_ODR 292682011ffSwdenk # define STATUS_LED_DAT im_ioport.iop_pcdat 293682011ffSwdenk 294682011ffSwdenk # define STATUS_LED_BIT 0x0002 /* LED 0 is on PC.14 */ 2956d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 296682011ffSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 297682011ffSwdenk # define STATUS_LED_BIT1 0x0004 /* LED 1 is on PC.13 */ 2986d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ) 299682011ffSwdenk # define STATUS_LED_STATE1 STATUS_LED_OFF 300682011ffSwdenk 301682011ffSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 302682011ffSwdenk 303682011ffSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 304682011ffSwdenk 30504a85b3bSwdenk /***** NetPhone ********************************************************/ 30679fa88f3Swdenk #elif defined(CONFIG_NETPHONE) || defined(CONFIG_NETTA2) 30704a85b3bSwdenk /* XXX empty just to avoid the error */ 3086bdf4306SWolfgang Denk /***** STx XTc ********************************************************/ 3096bdf4306SWolfgang Denk #elif defined(CONFIG_STXXTC) 3106bdf4306SWolfgang Denk /* XXX empty just to avoid the error */ 311466b7410Swdenk /***** sbc8240 ********************************************************/ 312466b7410Swdenk #elif defined(CONFIG_WRSBC8240) 313466b7410Swdenk /* XXX empty just to avoid the error */ 314c609719bSwdenk /************************************************************************/ 3155c952cf0Swdenk #elif defined(CONFIG_NIOS2) 3165c952cf0Swdenk /* XXX empty just to avoid the error */ 3175c952cf0Swdenk /************************************************************************/ 3184707fb50SBartlomiej Sieka #elif defined(CONFIG_V38B) 3194707fb50SBartlomiej Sieka 3204707fb50SBartlomiej Sieka # define STATUS_LED_BIT 0x0010 /* Timer7 GPIO */ 3216d0f6bcfSJean-Christophe PLAGNIOL-VILLARD # define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) 3224707fb50SBartlomiej Sieka # define STATUS_LED_STATE STATUS_LED_BLINKING 3234707fb50SBartlomiej Sieka 3244707fb50SBartlomiej Sieka # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ 3254707fb50SBartlomiej Sieka # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 3264707fb50SBartlomiej Sieka 327a11c0b85SBartlomiej Sieka #elif defined(CONFIG_MOTIONPRO) 328a11c0b85SBartlomiej Sieka 329a11c0b85SBartlomiej Sieka #define STATUS_LED_BIT ((vu_long *) MPC5XXX_GPT6_ENABLE) 3306d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 10) 331a11c0b85SBartlomiej Sieka #define STATUS_LED_STATE STATUS_LED_BLINKING 332a11c0b85SBartlomiej Sieka 333a11c0b85SBartlomiej Sieka #define STATUS_LED_BIT1 ((vu_long *) MPC5XXX_GPT7_ENABLE) 3346d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 10) 335a11c0b85SBartlomiej Sieka #define STATUS_LED_STATE1 STATUS_LED_OFF 336a11c0b85SBartlomiej Sieka 337a11c0b85SBartlomiej Sieka #define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 338a11c0b85SBartlomiej Sieka 339566a494fSHeiko Schocher #elif defined(CONFIG_BOARD_SPECIFIC_LED) 340566a494fSHeiko Schocher /* led_id_t is unsigned long mask */ 341566a494fSHeiko Schocher typedef unsigned long led_id_t; 342566a494fSHeiko Schocher 343566a494fSHeiko Schocher extern void __led_toggle (led_id_t mask); 344566a494fSHeiko Schocher extern void __led_init (led_id_t mask, int state); 345566a494fSHeiko Schocher extern void __led_set (led_id_t mask, int state); 346c609719bSwdenk #else 347c609719bSwdenk # error Status LED configuration missing 348c609719bSwdenk #endif 349c609719bSwdenk /************************************************************************/ 350c609719bSwdenk 35148b42616Swdenk #ifndef CONFIG_BOARD_SPECIFIC_LED 35248b42616Swdenk # include <asm/status_led.h> 35348b42616Swdenk #endif 35448b42616Swdenk 355bd86220fSPeter Pearse /* 356bd86220fSPeter Pearse * Coloured LEDs API 357bd86220fSPeter Pearse */ 358bd86220fSPeter Pearse #ifndef __ASSEMBLY__ 359bd86220fSPeter Pearse extern void coloured_LED_init (void); 360bd86220fSPeter Pearse extern void red_LED_on(void); 361bd86220fSPeter Pearse extern void red_LED_off(void); 362bd86220fSPeter Pearse extern void green_LED_on(void); 363bd86220fSPeter Pearse extern void green_LED_off(void); 364bd86220fSPeter Pearse extern void yellow_LED_on(void); 365bd86220fSPeter Pearse extern void yellow_LED_off(void); 3667cdf804fSTom Rix extern void blue_LED_on(void); 3677cdf804fSTom Rix extern void blue_LED_off(void); 368bd86220fSPeter Pearse #else 369bd86220fSPeter Pearse .extern LED_init 370bd86220fSPeter Pearse .extern red_LED_on 371bd86220fSPeter Pearse .extern red_LED_off 372bd86220fSPeter Pearse .extern yellow_LED_on 373bd86220fSPeter Pearse .extern yellow_LED_off 374bd86220fSPeter Pearse .extern green_LED_on 375bd86220fSPeter Pearse .extern green_LED_off 3767cdf804fSTom Rix .extern blue_LED_on 3777cdf804fSTom Rix .extern blue_LED_off 378bd86220fSPeter Pearse #endif 379bd86220fSPeter Pearse 380c609719bSwdenk #endif /* CONFIG_STATUS_LED */ 381c609719bSwdenk 382c609719bSwdenk #endif /* _STATUS_LED_H_ */ 383