Path: blob/master/arch/mn10300/unit-asb2303/include/unit/leds.h
10820 views
/* ASB2303-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 ASB2303_GPIO0DEF __SYSREG(0xDB000000, u32)19#define ASB2303_7SEGLEDS __SYSREG(0xDB000008, u32)2021/*22* use the 7-segment LEDs to indicate states23*/2425/* flip the 7-segment LEDs between "G" and "-" */26#define mn10300_set_gdbleds(ONOFF) \27do { \28ASB2303_7SEGLEDS = (ONOFF) ? 0x85 : 0x7f; \29} while (0)3031/* indicate double-fault by displaying "d" on the LEDs */32#define mn10300_set_dbfleds \33mov 0x43,d0 ; \34movbu d0,(ASB2303_7SEGLEDS)3536#ifndef __ASSEMBLY__37extern void peripheral_leds_display_exception(enum exception_code code);38extern void peripheral_leds_led_chase(void);39extern void debug_to_serial(const char *p, int n);40#endif /* __ASSEMBLY__ */4142#endif /* _ASM_UNIT_LEDS_H */434445