3 * (C) Copyright 2000-2003
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
7 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
9 * See file CREDITS for list of people who contributed to this
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
33 #include <asm/immap.h>
35 DECLARE_GLOBAL_DATA_PTR
;
37 int do_reset(cmd_tbl_t
* cmdtp
, bd_t
* bd
, int flag
, int argc
, char *argv
[])
39 volatile gptmr_t
*gptmr
= (gptmr_t
*) (MMAP_GPTMR
);
44 /* enable watchdog, set timeout to 0 and wait */
45 gptmr
->mode
= GPT_TMS_SGPIO
;
46 gptmr
->ctrl
= GPT_CTRL_WDEN
| GPT_CTRL_CE
;
48 /* we don't return! */
54 volatile siu_t
*siu
= (siu_t
*) MMAP_SIU
;
59 switch ((siu
->jtagid
& 0x000FF000) >> 12) {
99 char buf1
[32], buf2
[32];
101 printf("Freescale MCF%d\n", id
);
102 printf(" CPU CLK %s MHz BUS CLK %s MHz\n",
103 strmhz(buf1
, gd
->cpu_clk
),
104 strmhz(buf2
, gd
->bus_clk
));
110 #if defined(CONFIG_HW_WATCHDOG)
111 /* Called by macro WATCHDOG_RESET */
112 void hw_watchdog_reset(void)
114 volatile gptmr_t
*gptmr
= (gptmr_t
*) (MMAP_GPTMR
);
119 int watchdog_disable(void)
121 volatile gptmr_t
*gptmr
= (gptmr_t
*) (MMAP_GPTMR
);
123 /* UserManual, once the wdog is disabled, wdog cannot be re-enabled */
127 puts("WATCHDOG:disabled\n");
132 int watchdog_init(void)
135 volatile gptmr_t
*gptmr
= (gptmr_t
*) (MMAP_GPTMR
);
137 gptmr
->pre
= CONFIG_WATCHDOG_TIMEOUT
;
138 gptmr
->cnt
= CONFIG_SYS_TIMER_PRESCALER
* 1000;
140 gptmr
->mode
= GPT_TMS_SGPIO
;
141 gptmr
->ctrl
= GPT_CTRL_CE
| GPT_CTRL_WDEN
;
142 puts("WATCHDOG:enabled\n");
146 #endif /* CONFIG_HW_WATCHDOG */
148 #if defined(CONFIG_FSLDMAFEC) || defined(CONFIG_MCFFEC)
149 /* Default initializations for MCFFEC controllers. To override,
150 * create a board-specific function called:
151 * int board_eth_init(bd_t *bis)
154 int cpu_eth_init(bd_t
*bis
)
156 #if defined(CONFIG_FSLDMAFEC)
157 mcdmafec_initialize(bis
);
159 #if defined(CONFIG_MCFFEC)
160 mcffec_initialize(bis
);