2 * Copyright 2004 Freescale Semiconductor, Inc.
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 * 20050101: Eran Liberty (liberty@freescale.com)
25 * Initial file creating (porting from 85XX & 8260)
29 * CPU specific code for the MPC83xx family.
31 * Derived from the MPC8260 and MPC85xx.
38 #include <asm/processor.h>
43 DECLARE_GLOBAL_DATA_PTR;
44 ulong clock = gd->cpu_clk;
48 if ((pvr & 0xFFFF0000) != PVR_83xx) {
49 puts("Not MPC83xx Family!!!\n");
53 puts("CPU: MPC83xx, ");
60 puts("Rev: Unknown\n");
61 return -1; /* Not sure what this is */
63 printf("Rev: %02x at %s MHz\n",pvr & 0x0000FFFF, strmhz(buf, clock));
68 void upmconfig (uint upm, uint *table, uint size)
70 hang(); /* FIXME: upconfig() needed? */
75 do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
79 volatile immap_t *immap = (immap_t *) CFG_IMMRBAR;
82 /* Interrupts and MMU off */
83 __asm__ __volatile__ ("mfmsr %0":"=r" (msr):);
85 msr &= ~( MSR_EE | MSR_IR | MSR_DR);
86 __asm__ __volatile__ ("mtmsr %0"::"r" (msr));
88 /* enable Reset Control Reg */
89 immap->reset.rpr = 0x52535445;
91 /* confirm Reset Control Reg is enabled */
92 while(!((immap->reset.rcer) & RCER_CRE));
94 printf("Resetting the board.");
99 /* perform reset, only one bit */
100 immap->reset.rcr = RCR_SWHR;
102 immap->reset.rmr = RMR_CSRE; /* Checkstop Reset enable */
104 /* Interrupts and MMU off */
105 __asm__ __volatile__ ("mfmsr %0":"=r" (msr):);
107 msr &= ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR);
108 __asm__ __volatile__ ("mtmsr %0"::"r" (msr));
111 * Trying to execute the next instruction at a non-existing address
112 * should cause a machine check, resulting in reset
114 addr = CFG_RESET_ADDRESS;
116 printf("resetting the board.");
118 ((void (*)(void)) addr) ();
125 * Get timebase clock frequency (like cpu_clk in Hz)
128 unsigned long get_tbclk(void)
130 DECLARE_GLOBAL_DATA_PTR;
134 tbclk = (gd->bus_clk + 3L) / 4L;
140 #if defined(CONFIG_WATCHDOG)
141 void watchdog_reset (void)
143 hang(); /* FIXME: implement watchdog_reset()? */
145 #endif /* CONFIG_WATCHDOG */