2 * (C) Copyright 2003, Psyent Corporation <www.psyent.com>
3 * Scott McNutt <smcnutt@psyent.com>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
33 short nregs, hi_limit, lo_limit;
35 /* Get cpu version info */
36 val = rdctl (CTL_CPU_ID);
38 printf ("%s", (val & 0x00008000) ? "Nios-16 " : "Nios-32 ");
39 rev_major = (val>>12) & 0x07;
40 rev_minor = (val>>4) & 0x0ff;
41 printf ("Rev. %d.%d (0x%04x)", rev_major, rev_minor,
43 if (rev_major == 0x08)
44 printf (" [OpenCore (R) Plus]");
47 /* Check register file */
48 val = rdctl (CTL_WVALID);
49 lo_limit = val & 0x01f;
50 hi_limit = (val>>5) & 0x1f;
51 nregs = (hi_limit + 2) * 16;
52 printf ("Reg file size: %d LO_LIMIT/HI_LIMIT: %d/%d\n",
53 nregs, lo_limit, hi_limit);
61 /* trap 0 does the trick ... at least with the OCI debug
62 * present -- haven't tested without it yet (stm).
64 disable_interrupts ();
66 asm volatile ("trap 0\n");
74 #if defined(CONFIG_WATCHDOG)
75 void watchdog_reset (void)
78 #endif /* CONFIG_WATCHDOG */