1 /* $NetBSD: ka610.c,v 1.8 2010/12/14 23:44:49 matt Exp $ */ 2 /* 3 * Copyright (c) 2001 Ludd, University of Lule}, Sweden. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. All advertising materials mentioning features or use of this software 15 * must display the following acknowledgement: 16 * This product includes software developed at Ludd, University of 17 * Lule}, Sweden and its contributors. 18 * 4. The name of the author may not be used to endorse or promote products 19 * derived from this software without specific prior written permission 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33 #include <sys/cdefs.h> 34 __KERNEL_RCSID(0, "$NetBSD: ka610.c,v 1.8 2010/12/14 23:44:49 matt Exp $"); 35 36 #include <sys/param.h> 37 #include <sys/systm.h> 38 #include <sys/cpu.h> 39 #include <sys/device.h> 40 #include <sys/kernel.h> 41 42 #include <machine/nexus.h> 43 #include <machine/clock.h> 44 #include <machine/sid.h> 45 46 static void ka610_attach_cpu(device_t); 47 static void ka610_memerr(void); 48 static int ka610_mchk(void *); 49 static void ka610_halt(void); 50 static void ka610_reboot(int); 51 52 static const char * const ka610_devs[] = { "cpu", "uba", NULL }; 53 54 /* 55 * Declaration of KA610-specific calls. 56 */ 57 const struct cpu_dep ka610_calls = { 58 .cpu_mchk = ka610_mchk, 59 .cpu_memerr = ka610_memerr, 60 .cpu_gettime = generic_gettime, 61 .cpu_settime = generic_settime, 62 .cpu_vups = 1, /* ~VUPS */ 63 .cpu_scbsz = 2, /* SCB pages */ 64 .cpu_halt = ka610_halt, 65 .cpu_reboot = ka610_reboot, 66 .cpu_devs = ka610_devs, 67 .cpu_attach_cpu = ka610_attach_cpu, 68 .cpu_flags = CPU_RAISEIPL, 69 }; 70 71 72 void 73 ka610_attach_cpu(device_t self) 74 { 75 aprint_normal(": KA610, HW rev %d, ucode rev %d\n", 76 vax_cpudata & 0xff, (vax_cpudata >> 8) & 0xff); 77 } 78 79 void 80 ka610_memerr(void) 81 { 82 printf("Memory err!\n"); 83 } 84 85 int 86 ka610_mchk(void *addr) 87 { 88 panic("Machine check"); 89 return 0; 90 } 91 92 void 93 ka610_halt(void) 94 { 95 __asm("halt"); 96 } 97 98 void 99 ka610_reboot(int arg) 100 { 101 __asm("halt"); 102 } 103 104