1*cf10107dSdyoung /* $NetBSD: comlogout.c,v 1.5 2011/07/01 19:22:35 dyoung Exp $ */
209ffed2bSthorpej
39c326571Smjacob /*
49c326571Smjacob * Copyright (c) 1998 by Matthew Jacob
59c326571Smjacob * NASA AMES Research Center.
69c326571Smjacob * All rights reserved.
79c326571Smjacob *
89c326571Smjacob * Redistribution and use in source and binary forms, with or without
99c326571Smjacob * modification, are permitted provided that the following conditions
109c326571Smjacob * are met:
119c326571Smjacob * 1. Redistributions of source code must retain the above copyright
129c326571Smjacob * notice immediately at the beginning of the file, without modification,
139c326571Smjacob * this list of conditions, and the following disclaimer.
149c326571Smjacob * 2. Redistributions in binary form must reproduce the above copyright
159c326571Smjacob * notice, this list of conditions and the following disclaimer in the
169c326571Smjacob * documentation and/or other materials provided with the distribution.
179c326571Smjacob * 3. The name of the author may not be used to endorse or promote products
189c326571Smjacob * derived from this software without specific prior written permission.
199c326571Smjacob *
209c326571Smjacob * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
219c326571Smjacob * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
229c326571Smjacob * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
239c326571Smjacob * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
249c326571Smjacob * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
259c326571Smjacob * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
269c326571Smjacob * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
279c326571Smjacob * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
289c326571Smjacob * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
299c326571Smjacob * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
309c326571Smjacob * SUCH DAMAGE.
319c326571Smjacob */
329c326571Smjacob
339c326571Smjacob #include <sys/cdefs.h>
34*cf10107dSdyoung __KERNEL_RCSID(0, "$NetBSD: comlogout.c,v 1.5 2011/07/01 19:22:35 dyoung Exp $");
359c326571Smjacob
369c326571Smjacob #include <sys/param.h>
379c326571Smjacob #include <sys/systm.h>
389c326571Smjacob #include <sys/device.h>
399c326571Smjacob
409c326571Smjacob #include <machine/rpb.h>
419c326571Smjacob #include <machine/autoconf.h>
42*cf10107dSdyoung #include <sys/bus.h>
439c326571Smjacob #include <machine/frame.h>
449c326571Smjacob #include <machine/cpuconf.h>
459c326571Smjacob #include <machine/logout.h>
469c326571Smjacob
479c326571Smjacob /*
489c326571Smjacob * Common PAL Logout Handling Code
499c326571Smjacob */
509c326571Smjacob
519c326571Smjacob /* (pretty much just structured console printout right now) */
529c326571Smjacob
539c326571Smjacob void
ev5_logout_print(mc_hdr_ev5 * ev5lohdrp,mc_uc_ev5 * mcucev5p)5409ffed2bSthorpej ev5_logout_print(mc_hdr_ev5 *ev5lohdrp, mc_uc_ev5 *mcucev5p)
559c326571Smjacob {
569c326571Smjacob int i;
579c326571Smjacob static const char *fmt1 = " %-30s = 0x%l016x\n";
589c326571Smjacob
599c326571Smjacob printf(" Processor Machine Check (%x), Code 0x%lx\n",
609c326571Smjacob ALPHA_PROC_MCHECK, ev5lohdrp->mcheck_code);
619c326571Smjacob /* Print PAL fields */
629c326571Smjacob for (i = 0; i < 24; i += 2) {
6302d221f9Sthorpej printf("\tPAL temp[%d-%d]\t\t= 0x%16lx 0x%16lx\n", i, i+1,
649c326571Smjacob mcucev5p->paltemp[i], mcucev5p->paltemp[i+1]);
659c326571Smjacob }
669c326571Smjacob for (i = 0; i < 8; i += 2) {
6702d221f9Sthorpej printf("\tshadow[%d-%d]\t\t\t= 0x%16lx 0x%16lx\n", i, i+1,
689c326571Smjacob mcucev5p->shadow[i], mcucev5p->shadow[i+1]);
699c326571Smjacob }
709c326571Smjacob printf("\n");
719c326571Smjacob printf(fmt1, "Excepting Instruction Addr", mcucev5p->exc_addr);
729c326571Smjacob printf(fmt1, "Summary of arithmetic traps", mcucev5p->exc_sum);
739c326571Smjacob printf(fmt1, "Exception mask", mcucev5p->exc_mask);
749c326571Smjacob printf(fmt1, "Base address for PALcode", mcucev5p->pal_base);
759c326571Smjacob printf(fmt1, "Interrupt Status Reg", mcucev5p->isr);
769c326571Smjacob printf(fmt1, "Current setup of EV5 IBOX", mcucev5p->icsr);
779c326571Smjacob printf(fmt1, (mcucev5p->ic_perr_stat & 0x800)?
789c326571Smjacob "I-CACHE Reg Data parity error" :
799c326571Smjacob "I-CACHE Reg Tag parity error", mcucev5p->ic_perr_stat);
809c326571Smjacob printf(fmt1, "D-CACHE error Reg", mcucev5p->dc_perr_stat);
819c326571Smjacob
829c326571Smjacob if (mcucev5p->dc_perr_stat & 0x2) {
839c326571Smjacob switch (mcucev5p->dc_perr_stat & 0x3c) {
849c326571Smjacob case 8:
859c326571Smjacob printf(" %-40s\n", "Data error in bank 1");
869c326571Smjacob break;
879c326571Smjacob case 4:
889c326571Smjacob printf(" %-40s\n", "Data error in bank 0");
899c326571Smjacob break;
909c326571Smjacob case 20:
919c326571Smjacob printf(" %-40s\n", "Tag error in bank 1");
929c326571Smjacob break;
939c326571Smjacob case 10:
949c326571Smjacob printf(" %-40s\n", "Tag error in bank 0");
959c326571Smjacob break;
969c326571Smjacob }
979c326571Smjacob }
989c326571Smjacob printf(fmt1, "Effective VA", mcucev5p->va);
999c326571Smjacob printf(fmt1, "Reason for D-stream", mcucev5p->mm_stat);
1009c326571Smjacob printf(fmt1, "EV5 SCache address", mcucev5p->sc_addr);
1019c326571Smjacob printf(fmt1, "EV5 SCache TAG/Data parity", mcucev5p->sc_stat);
1029c326571Smjacob printf(fmt1, "EV5 BC_TAG_ADDR", mcucev5p->bc_tag_addr);
1039c326571Smjacob printf(fmt1, "EV5 EI_ADDR Phys addr of Xfer", mcucev5p->ei_addr);
1049c326571Smjacob printf(fmt1, "Fill Syndrome", mcucev5p->fill_syndrome);
1059c326571Smjacob printf(fmt1, "ei_stat reg", mcucev5p->ei_stat);
1069c326571Smjacob printf(fmt1, "ld_lock", mcucev5p->ld_lock);
1079c326571Smjacob }
108