2 * Copyright (C) 2004-2006 Freescale Semiconductor, Inc.
3 * (C) Copyright 2007 DENX Software Engineering
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,
25 * CPU specific code for the MPC512x family.
27 * Derived from the MPC83xx code.
33 #include <asm/processor.h>
35 DECLARE_GLOBAL_DATA_PTR;
39 volatile immap_t *immr = (immap_t *) CFG_IMMR;
40 ulong clock = gd->cpu_clk;
42 u32 spridr = immr->sysconf.spridr;
47 switch (spridr & 0xffff0000) {
52 printf ("Unknown part ID %08x ", spridr & 0xffff0000);
54 printf ("rev. %d.%d, Core ", SVR_MJREV (spridr), SVR_MNREV (spridr));
56 switch (pvr & 0xffff0000) {
63 printf ("at %s MHz, CSB at %3d MHz\n", strmhz(buf, clock),
64 gd->csb_clk / 1000000);
70 do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
73 volatile immap_t *immap = (immap_t *) CFG_IMMR;
75 /* Interrupts and MMU off */
76 __asm__ __volatile__ ("mfmsr %0":"=r" (msr):);
78 msr &= ~( MSR_EE | MSR_IR | MSR_DR);
79 __asm__ __volatile__ ("mtmsr %0"::"r" (msr));
82 * Enable Reset Control Reg - "RSTE" is the magic word that let us go
84 immap->reset.rpr = 0x52535445;
86 /* Verify Reset Control Reg is enabled */
87 while (!((immap->reset.rcer) & RCER_CRE))
90 printf ("Resetting the board.\n");
94 immap->reset.rcr = RCR_SWHR;
102 * Get timebase clock frequency (like cpu_clk in Hz)
104 unsigned long get_tbclk (void)
108 tbclk = (gd->bus_clk + 3L) / 4L;
114 #if defined(CONFIG_WATCHDOG)
115 void watchdog_reset (void)
117 int re_enable = disable_interrupts ();
120 volatile immap_t *immr = (immap_t *) CFG_IMMR;
121 immr->wdt.swsrr = 0x556c;
122 immr->wdt.swsrr = 0xaa39;
125 enable_interrupts ();