Path: blob/master/arch/mn10300/unit-asb2364/include/unit/leds.h
15159 views
/* Unit-specific leds1*2* Copyright (C) 2005 Red Hat, Inc. All Rights Reserved.3* Written by David Howells ([email protected])4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public License7* as published by the Free Software Foundation; either version8* 2 of the License, or (at your option) any later version.9*/1011#ifndef _ASM_UNIT_LEDS_H12#define _ASM_UNIT_LEDS_H1314#include <asm/pio-regs.h>15#include <asm/cpu-regs.h>16#include <asm/exceptions.h>1718#define MN10300_USE_7SEGLEDS 01920#define ASB2364_7SEGLEDS __SYSREG(0xA9001630, u32)2122/*23* use the 7-segment LEDs to indicate states24*/2526#if MN10300_USE_7SEGLEDS27/* flip the 7-segment LEDs between "Gdb-" and "----" */28#define mn10300_set_gdbleds(ONOFF) \29do { \30ASB2364_7SEGLEDS = (ONOFF) ? 0x8543077f : 0x7f7f7f7f; \31} while (0)32#else33#define mn10300_set_gdbleds(ONOFF) do {} while (0)34#endif3536#if MN10300_USE_7SEGLEDS37/* indicate double-fault by displaying "db-f" on the LEDs */38#define mn10300_set_dbfleds \39mov 0x43077f1d,d0 ; \40mov d0,(ASB2364_7SEGLEDS)41#else42#define mn10300_set_dbfleds43#endif4445#ifndef __ASSEMBLY__46extern void peripheral_leds_display_exception(enum exception_code);47extern void peripheral_leds_led_chase(void);48extern void peripheral_leds7x4_display_dec(unsigned int, unsigned int);49extern void peripheral_leds7x4_display_hex(unsigned int, unsigned int);50extern void debug_to_serial(const char *, int);51#endif /* __ASSEMBLY__ */5253#endif /* _ASM_UNIT_LEDS_H */545556