[U-Boot] [PATCH 12/21] m68k: Generic system restart support
Kyle Moffett
Kyle.D.Moffett at boeing.com
Mon Mar 7 18:37:33 CET 2011
The m68k port individually implements do_reset() for each of several
different CPU types. As the functions are conditionally compiled based
on the board, this patch simply needs to alter each one to use the new
prototype for __arch_restart().
All of the do_reset() funtions which were converted appear to either use
a CPU hardware feature or an onboard watchdog unit to perform the system
reset. As a hardware reset that will probably work even when the CPU is
in a bad state, so no separate __arch_emergency_restart() is required.
Signed-off-by: Kyle Moffett <Kyle.D.Moffett at boeing.com>
Cc: Jason Jin <jason.jin at freescale.com>
---
arch/m68k/cpu/mcf5227x/cpu.c | 2 +-
arch/m68k/cpu/mcf523x/cpu.c | 2 +-
arch/m68k/cpu/mcf52x2/cpu.c | 20 +++++++-------------
arch/m68k/cpu/mcf52x2/cpu.h | 33 ---------------------------------
arch/m68k/cpu/mcf532x/cpu.c | 2 +-
arch/m68k/cpu/mcf5445x/cpu.c | 2 +-
arch/m68k/cpu/mcf547x_8x/cpu.c | 2 +-
7 files changed, 12 insertions(+), 51 deletions(-)
delete mode 100644 arch/m68k/cpu/mcf52x2/cpu.h
diff --git a/arch/m68k/cpu/mcf5227x/cpu.c b/arch/m68k/cpu/mcf5227x/cpu.c
index 09ef1d2..07b4595 100644
--- a/arch/m68k/cpu/mcf5227x/cpu.c
+++ b/arch/m68k/cpu/mcf5227x/cpu.c
@@ -33,7 +33,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
volatile rcm_t *rcm = (rcm_t *) (MMAP_RCM);
udelay(1000);
diff --git a/arch/m68k/cpu/mcf523x/cpu.c b/arch/m68k/cpu/mcf523x/cpu.c
index 2376f97..62a8556 100644
--- a/arch/m68k/cpu/mcf523x/cpu.c
+++ b/arch/m68k/cpu/mcf523x/cpu.c
@@ -34,7 +34,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
volatile ccm_t *ccm = (ccm_t *) MMAP_CCM;
diff --git a/arch/m68k/cpu/mcf52x2/cpu.c b/arch/m68k/cpu/mcf52x2/cpu.c
index 571d078..3427010 100644
--- a/arch/m68k/cpu/mcf52x2/cpu.c
+++ b/arch/m68k/cpu/mcf52x2/cpu.c
@@ -33,12 +33,11 @@
#include <command.h>
#include <asm/immap.h>
#include <netdev.h>
-#include "cpu.h"
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_M5208
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
volatile rcm_t *rcm = (rcm_t *)(MMAP_RCM);
@@ -141,13 +140,8 @@ int checkcpu(void)
return 0;
}
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
- /* Call the board specific reset actions first. */
- if(board_reset) {
- board_reset();
- }
-
mbar_writeByte(MCF_RCM_RCR,
MCF_RCM_RCR_SOFTRST | MCF_RCM_RCR_FRCRSTOUT);
return 0;
@@ -176,7 +170,7 @@ int watchdog_init(void)
#endif
#ifdef CONFIG_M5272
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
volatile wdog_t *wdp = (wdog_t *) (MMAP_WDOG);
@@ -256,7 +250,7 @@ int watchdog_init(void)
#endif /* #ifdef CONFIG_M5272 */
#ifdef CONFIG_M5275
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
volatile rcm_t *rcm = (rcm_t *)(MMAP_RCM);
@@ -336,7 +330,7 @@ int checkcpu(void)
return 0;
}
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
MCFRESET_RCR = MCFRESET_RCR_SOFTRST;
return 0;
@@ -353,7 +347,7 @@ int checkcpu(void)
return 0;
}
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
/* enable watchdog, set timeout to 0 and wait */
mbar_writeByte(MCFSIM_SYPCR, 0xc0);
@@ -383,7 +377,7 @@ int checkcpu(void)
return 0;
}
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
/* enable watchdog, set timeout to 0 and wait */
mbar_writeByte(SIM_SYPCR, 0xc0);
diff --git a/arch/m68k/cpu/mcf52x2/cpu.h b/arch/m68k/cpu/mcf52x2/cpu.h
deleted file mode 100644
index c1227eb..0000000
--- a/arch/m68k/cpu/mcf52x2/cpu.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * cpu.h
- *
- * Copyright (c) 2009 Freescale Semiconductor, Inc.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
- */
-
-#ifndef _CPU_H_
-#define _CPU_H_
-
-#include <command.h>
-
-/* Use this to create board specific reset functions */
-void board_reset(void) __attribute__((__weak__));
-
-#endif /* _CPU_H_ */
diff --git a/arch/m68k/cpu/mcf532x/cpu.c b/arch/m68k/cpu/mcf532x/cpu.c
index 3346784..8dba73e 100644
--- a/arch/m68k/cpu/mcf532x/cpu.c
+++ b/arch/m68k/cpu/mcf532x/cpu.c
@@ -34,7 +34,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
volatile rcm_t *rcm = (rcm_t *) (MMAP_RCM);
diff --git a/arch/m68k/cpu/mcf5445x/cpu.c b/arch/m68k/cpu/mcf5445x/cpu.c
index 323a54e..7c81775 100644
--- a/arch/m68k/cpu/mcf5445x/cpu.c
+++ b/arch/m68k/cpu/mcf5445x/cpu.c
@@ -34,7 +34,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
volatile rcm_t *rcm = (rcm_t *) (MMAP_RCM);
udelay(1000);
diff --git a/arch/m68k/cpu/mcf547x_8x/cpu.c b/arch/m68k/cpu/mcf547x_8x/cpu.c
index 7590f2c..3e94037 100644
--- a/arch/m68k/cpu/mcf547x_8x/cpu.c
+++ b/arch/m68k/cpu/mcf547x_8x/cpu.c
@@ -34,7 +34,7 @@
DECLARE_GLOBAL_DATA_PTR;
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int __arch_reset(void)
{
volatile gptmr_t *gptmr = (gptmr_t *) (MMAP_GPTMR);
--
1.7.2.3
More information about the U-Boot
mailing list