Path: blob/master/arch/sh/boards/mach-cayman/panic.c
15125 views
/*1* Copyright (C) 2003 Richard Curnow, SuperH UK Limited2*3* This file is subject to the terms and conditions of the GNU General Public4* License. See the file "COPYING" in the main directory of this archive5* for more details.6*/78#include <linux/kernel.h>9#include <linux/io.h>10#include <cpu/registers.h>1112/* THIS IS A PHYSICAL ADDRESS */13#define HDSP2534_ADDR (0x04002100)1415static void poor_mans_delay(void)16{17int i;1819for (i = 0; i < 2500000; i++)20cpu_relax();21}2223static void show_value(unsigned long x)24{25int i;26unsigned nibble;27for (i = 0; i < 8; i++) {28nibble = ((x >> (i * 4)) & 0xf);2930__raw_writeb(nibble + ((nibble > 9) ? 55 : 48),31HDSP2534_ADDR + 0xe0 + ((7 - i) << 2));32}33}3435void36panic_handler(unsigned long panicPC, unsigned long panicSSR,37unsigned long panicEXPEVT)38{39while (1) {40/* This piece of code displays the PC on the LED display */41show_value(panicPC);42poor_mans_delay();43show_value(panicSSR);44poor_mans_delay();45show_value(panicEXPEVT);46poor_mans_delay();47}48}495051