Path: blob/master/arch/mn10300/unit-asb2305/include/unit/leds.h
10820 views
/* ASB2305-specific LEDs1*2* Copyright (C) 2007 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 Licence7* as published by the Free Software Foundation; either version8* 2 of the Licence, 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 ASB2305_7SEGLEDS __SYSREG(0xA6F90000, u32)1920/* perform a hard reset by driving PIO06 low */21#define mn10300_unit_hard_reset() \22do { \23P0OUT &= 0xbf; \24P0MD = (P0MD & P0MD_6) | P0MD_6_OUT; \25} while (0)2627/*28* use the 7-segment LEDs to indicate states29*/30/* indicate double-fault by displaying "db-f" on the LEDs */31#define mn10300_set_dbfleds \32mov 0x43077f1d,d0 ; \33mov d0,(ASB2305_7SEGLEDS)3435/* flip the 7-segment LEDs between "Gdb-" and "----" */36#define mn10300_set_gdbleds(ONOFF) \37do { \38ASB2305_7SEGLEDS = (ONOFF) ? 0x8543077f : 0x7f7f7f7f; \39} while (0)4041#ifndef __ASSEMBLY__42extern void peripheral_leds_display_exception(enum exception_code);43extern void peripheral_leds_led_chase(void);44extern void peripheral_leds7x4_display_dec(unsigned int, unsigned int);45extern void peripheral_leds7x4_display_hex(unsigned int, unsigned int);46extern void peripheral_leds7x4_display_minssecs(unsigned int, unsigned int);47extern void peripheral_leds7x4_display_rtc(void);48#endif /* __ASSEMBLY__ */4950#endif /* _ASM_UNIT_LEDS_H */515253