1c609719bSwdenk /* 2c609719bSwdenk * (C) Copyright 2000 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 ********************************************************/ 46c609719bSwdenk #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 53c609719bSwdenk # define STATUS_LED_PERIOD (CFG_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 68c609719bSwdenk # define STATUS_LED_PERIOD (CFG_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 84c609719bSwdenk # define STATUS_LED_PERIOD (CFG_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 */ 100c609719bSwdenk # define STATUS_LED_PERIOD (CFG_HZ / 2) 101c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 102c609719bSwdenk # define STATUS_LED_BIT1 0x0400 /* Grn LED 1 is on PA.5 */ 103c609719bSwdenk # define STATUS_LED_PERIOD1 (CFG_HZ / 2) 104c609719bSwdenk # define STATUS_LED_STATE1 STATUS_LED_BLINKING 105c609719bSwdenk # define STATUS_LED_BIT2 0x0080 /* Red LED 2 is on PA.8 */ 106c609719bSwdenk # define STATUS_LED_PERIOD2 (CFG_HZ / 2) 107c609719bSwdenk # define STATUS_LED_STATE2 STATUS_LED_BLINKING 108c609719bSwdenk # define STATUS_LED_BIT3 0x0040 /* Grn LED 3 is on PA.9 */ 109c609719bSwdenk # define STATUS_LED_PERIOD3 (CFG_HZ / 2) 110c609719bSwdenk # define STATUS_LED_STATE3 STATUS_LED_BLINKING 111c609719bSwdenk 112c609719bSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 113c609719bSwdenk # define STATUS_LED_BOOT 0 /* 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 */ 124c609719bSwdenk # define STATUS_LED_PERIOD (1 * CFG_HZ) 125c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_OFF 126c609719bSwdenk # define STATUS_LED_BIT1 0x00000020 /* LED 1 is on PB.26 */ 127c609719bSwdenk # define STATUS_LED_PERIOD1 (1 * CFG_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 */ 131c609719bSwdenk # define STATUS_LED_PERIOD2 (1 * CFG_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 138c609719bSwdenk # define STATUS_ILOCK_PERIOD (CFG_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 */ 153c609719bSwdenk # define STATUS_LED_PERIOD (1 * CFG_HZ) 154c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_OFF 155c609719bSwdenk # define STATUS_LED_BIT1 0x00000020 /* LED 1 is on PB.26 */ 156c609719bSwdenk # define STATUS_LED_PERIOD1 (1 * CFG_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 */ 160c609719bSwdenk # define STATUS_LED_PERIOD2 (1 * CFG_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 167c609719bSwdenk # define STATUS_ILOCK_PERIOD (CFG_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 186c609719bSwdenk # define STATUS_LED_PERIOD (CFG_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 */ 202c609719bSwdenk # define STATUS_LED_PERIOD (CFG_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 */ 218c609719bSwdenk # define STATUS_LED_PERIOD (CFG_HZ / 2) 219c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 220c609719bSwdenk # define STATUS_LED_BIT1 0x1000 /* LED 1 is on PA.3 */ 221c609719bSwdenk # define STATUS_LED_PERIOD1 (CFG_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 239c609719bSwdenk #define STATUS_LED_PAR im_ioport.iop_pdpar 240c609719bSwdenk #define STATUS_LED_DIR im_ioport.iop_pddir 241c609719bSwdenk #undef STATUS_LED_ODR 242c609719bSwdenk #define STATUS_LED_DAT im_ioport.iop_pddat 243c609719bSwdenk 244c609719bSwdenk # define STATUS_LED_BIT 0x0080 /* PD.8 */ 245c609719bSwdenk # define STATUS_LED_PERIOD (CFG_HZ / 2) 246c609719bSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 247c609719bSwdenk 248c609719bSwdenk # define STATUS_LED_BIT1 0x0040 /* PD.9 */ 249c609719bSwdenk # define STATUS_LED_PERIOD1 (CFG_HZ / 2) 250c609719bSwdenk # define STATUS_LED_STATE1 STATUS_LED_OFF 251c609719bSwdenk 252c609719bSwdenk # define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ 253c609719bSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 254c609719bSwdenk 25556f94be3Swdenk 25656f94be3Swdenk /***** KUP4K ********************************************************/ 25756f94be3Swdenk #elif defined(CONFIG_KUP4K) 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 */ 26556f94be3Swdenk # define STATUS_LED_PERIOD (CFG_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 272*dc7c9a1aSwdenk #elif defined(CONFIG_SVM_SC8xx) 273*dc7c9a1aSwdenk # define STATUS_LED_PAR im_cpm.cp_pbpar 274*dc7c9a1aSwdenk # define STATUS_LED_DIR im_cpm.cp_pbdir 275*dc7c9a1aSwdenk # define STATUS_LED_ODR im_cpm.cp_pbodr 276*dc7c9a1aSwdenk # define STATUS_LED_DAT im_cpm.cp_pbdat 277*dc7c9a1aSwdenk 278*dc7c9a1aSwdenk # define STATUS_LED_BIT 0x00000001 279*dc7c9a1aSwdenk # define STATUS_LED_PERIOD (CFG_HZ / 2) 280*dc7c9a1aSwdenk # define STATUS_LED_STATE STATUS_LED_BLINKING 281*dc7c9a1aSwdenk 282*dc7c9a1aSwdenk # define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ 283*dc7c9a1aSwdenk 284*dc7c9a1aSwdenk # define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ 285*dc7c9a1aSwdenk 286c609719bSwdenk /************************************************************************/ 287c609719bSwdenk #else 288c609719bSwdenk # error Status LED configuration missing 289c609719bSwdenk #endif 290c609719bSwdenk /************************************************************************/ 291c609719bSwdenk 292c609719bSwdenk #endif /* CONFIG_STATUS_LED */ 293c609719bSwdenk 294c609719bSwdenk #endif /* _STATUS_LED_H_ */ 295