2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2004-02-12 00:47:09 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2003
|
|
|
|
* Josef Baumgartner <josef.baumgartner@telex.de>
|
|
|
|
*
|
2006-04-20 06:42:42 +00:00
|
|
|
* MCF5282 additionals
|
|
|
|
* (C) Copyright 2005
|
|
|
|
* BuS Elektronik GmbH & Co. KG <esw@bus-elektronik.de>
|
|
|
|
*
|
2008-02-04 21:38:20 +00:00
|
|
|
* MCF5275 additions
|
|
|
|
* Copyright (C) 2008 Arthur Shipkowski (art@videon-central.com)
|
|
|
|
*
|
2012-03-26 21:49:04 +00:00
|
|
|
* Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
|
2004-02-12 00:47:09 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2020-05-10 17:40:02 +00:00
|
|
|
#include <init.h>
|
2020-05-10 17:39:56 +00:00
|
|
|
#include <net.h>
|
2019-11-14 19:57:20 +00:00
|
|
|
#include <vsprintf.h>
|
2004-02-12 00:47:09 +00:00
|
|
|
#include <watchdog.h>
|
|
|
|
#include <command.h>
|
2020-10-31 03:38:53 +00:00
|
|
|
#include <asm/global_data.h>
|
2007-08-16 00:21:21 +00:00
|
|
|
#include <asm/immap.h>
|
2012-03-26 21:49:04 +00:00
|
|
|
#include <asm/io.h>
|
2008-09-01 05:22:04 +00:00
|
|
|
#include <netdev.h>
|
2020-05-10 17:40:11 +00:00
|
|
|
#include <linux/delay.h>
|
2009-10-26 18:19:17 +00:00
|
|
|
#include "cpu.h"
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2009-06-12 11:29:00 +00:00
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
|
|
|
#ifdef CONFIG_M5208
|
2020-05-10 17:40:03 +00:00
|
|
|
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
2009-06-12 11:29:00 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
rcm_t *rcm = (rcm_t *)(MMAP_RCM);
|
2009-06-12 11:29:00 +00:00
|
|
|
|
|
|
|
udelay(1000);
|
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
out_8(&rcm->rcr, RCM_RCR_SOFTRST);
|
2009-06-12 11:29:00 +00:00
|
|
|
|
|
|
|
/* we don't return! */
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
|
2017-08-19 22:01:55 +00:00
|
|
|
#if defined(CONFIG_DISPLAY_CPUINFO)
|
|
|
|
int print_cpuinfo(void)
|
2009-06-12 11:29:00 +00:00
|
|
|
{
|
|
|
|
char buf1[32], buf2[32];
|
|
|
|
|
|
|
|
printf("CPU: Freescale Coldfire MCF5208\n"
|
|
|
|
" CPU CLK %s MHz BUS CLK %s MHz\n",
|
|
|
|
strmhz(buf1, gd->cpu_clk),
|
|
|
|
strmhz(buf2, gd->bus_clk));
|
|
|
|
return 0;
|
|
|
|
};
|
2017-08-19 22:01:55 +00:00
|
|
|
#endif /* CONFIG_DISPLAY_CPUINFO */
|
2009-06-12 11:29:00 +00:00
|
|
|
|
|
|
|
#if defined(CONFIG_WATCHDOG)
|
|
|
|
/* Called by macro WATCHDOG_RESET */
|
|
|
|
void watchdog_reset(void)
|
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
|
|
|
|
|
|
|
|
out_be16(&wdt->sr, 0x5555);
|
|
|
|
out_be16(&wdt->sr, 0xaaaa);
|
2009-06-12 11:29:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int watchdog_disable(void)
|
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
|
2009-06-12 11:29:00 +00:00
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
/* reset watchdog counter */
|
|
|
|
out_be16(&wdt->sr, 0x5555);
|
|
|
|
out_be16(&wdt->sr, 0xaaaa);
|
|
|
|
/* disable watchdog timer */
|
|
|
|
out_be16(&wdt->cr, 0);
|
2009-06-12 11:29:00 +00:00
|
|
|
|
|
|
|
puts("WATCHDOG:disabled\n");
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int watchdog_init(void)
|
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
|
2009-06-12 11:29:00 +00:00
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
/* disable watchdog */
|
|
|
|
out_be16(&wdt->cr, 0);
|
2009-06-12 11:29:00 +00:00
|
|
|
|
|
|
|
/* set timeout and enable watchdog */
|
2012-03-26 21:49:04 +00:00
|
|
|
out_be16(&wdt->mr,
|
2022-11-19 23:45:45 +00:00
|
|
|
(CONFIG_WATCHDOG_TIMEOUT_MSECS * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
|
2012-03-26 21:49:04 +00:00
|
|
|
|
|
|
|
/* reset watchdog counter */
|
|
|
|
out_be16(&wdt->sr, 0x5555);
|
|
|
|
out_be16(&wdt->sr, 0xaaaa);
|
2009-06-12 11:29:00 +00:00
|
|
|
|
|
|
|
puts("WATCHDOG:enabled\n");
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
#endif /* #ifdef CONFIG_WATCHDOG */
|
|
|
|
#endif /* #ifdef CONFIG_M5208 */
|
|
|
|
|
2006-01-26 22:35:56 +00:00
|
|
|
#ifdef CONFIG_M5271
|
2017-08-19 22:01:55 +00:00
|
|
|
#if defined(CONFIG_DISPLAY_CPUINFO)
|
2007-01-23 12:25:22 +00:00
|
|
|
/*
|
|
|
|
* Both MCF5270 and MCF5271 are members of the MPC5271 family. Try to
|
|
|
|
* determine which one we are running on, based on the Chip Identification
|
|
|
|
* Register (CIR).
|
|
|
|
*/
|
2017-08-19 22:01:55 +00:00
|
|
|
int print_cpuinfo(void)
|
2006-01-26 22:35:56 +00:00
|
|
|
{
|
2006-05-09 09:45:31 +00:00
|
|
|
char buf[32];
|
2007-01-23 12:25:22 +00:00
|
|
|
unsigned short cir; /* Chip Identification Register */
|
|
|
|
unsigned short pin; /* Part identification number */
|
|
|
|
unsigned char prn; /* Part revision number */
|
|
|
|
char *cpu_model;
|
|
|
|
|
|
|
|
cir = mbar_readShort(MCF_CCM_CIR);
|
|
|
|
pin = cir >> MCF_CCM_CIR_PIN_LEN;
|
|
|
|
prn = cir & MCF_CCM_CIR_PRN_MASK;
|
|
|
|
|
|
|
|
switch (pin) {
|
|
|
|
case MCF_CCM_CIR_PIN_MCF5270:
|
|
|
|
cpu_model = "5270";
|
|
|
|
break;
|
|
|
|
case MCF_CCM_CIR_PIN_MCF5271:
|
|
|
|
cpu_model = "5271";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
cpu_model = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cpu_model)
|
|
|
|
printf("CPU: Freescale ColdFire MCF%s rev. %hu, at %s MHz\n",
|
2022-11-16 18:10:41 +00:00
|
|
|
cpu_model, prn, strmhz(buf, CFG_SYS_CLK));
|
2007-01-23 12:25:22 +00:00
|
|
|
else
|
|
|
|
printf("CPU: Unknown - Freescale ColdFire MCF5271 family"
|
2007-08-16 00:21:21 +00:00
|
|
|
" (PIN: 0x%x) rev. %hu, at %s MHz\n",
|
2022-11-16 18:10:41 +00:00
|
|
|
pin, prn, strmhz(buf, CFG_SYS_CLK));
|
2006-05-09 09:45:31 +00:00
|
|
|
|
2006-01-26 22:35:56 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2017-08-19 22:01:55 +00:00
|
|
|
#endif /* CONFIG_DISPLAY_CPUINFO */
|
2006-01-26 22:35:56 +00:00
|
|
|
|
2020-05-10 17:40:03 +00:00
|
|
|
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
2007-08-16 00:21:21 +00:00
|
|
|
{
|
2009-10-26 18:19:17 +00:00
|
|
|
/* Call the board specific reset actions first. */
|
|
|
|
if(board_reset) {
|
|
|
|
board_reset();
|
|
|
|
}
|
|
|
|
|
2006-01-26 22:35:56 +00:00
|
|
|
mbar_writeByte(MCF_RCM_RCR,
|
2007-08-16 00:21:21 +00:00
|
|
|
MCF_RCM_RCR_SOFTRST | MCF_RCM_RCR_FRCRSTOUT);
|
2006-01-26 22:35:56 +00:00
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#if defined(CONFIG_WATCHDOG)
|
2007-08-16 00:21:21 +00:00
|
|
|
void watchdog_reset(void)
|
2006-01-26 22:35:56 +00:00
|
|
|
{
|
|
|
|
mbar_writeShort(MCF_WTM_WSR, 0x5555);
|
|
|
|
mbar_writeShort(MCF_WTM_WSR, 0xAAAA);
|
|
|
|
}
|
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
int watchdog_disable(void)
|
2006-01-26 22:35:56 +00:00
|
|
|
{
|
|
|
|
mbar_writeShort(MCF_WTM_WCR, 0);
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
int watchdog_init(void)
|
2006-01-26 22:35:56 +00:00
|
|
|
{
|
|
|
|
mbar_writeShort(MCF_WTM_WCR, MCF_WTM_WCR_EN);
|
|
|
|
return (0);
|
|
|
|
}
|
2007-08-16 00:21:21 +00:00
|
|
|
#endif /* #ifdef CONFIG_WATCHDOG */
|
2006-01-26 22:35:56 +00:00
|
|
|
|
|
|
|
#endif
|
2004-02-12 00:47:09 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_M5272
|
2020-05-10 17:40:03 +00:00
|
|
|
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
2007-08-16 00:21:21 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
wdog_t *wdp = (wdog_t *) (MMAP_WDOG);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
out_be16(&wdp->wdog_wrrr, 0);
|
2007-08-16 00:21:21 +00:00
|
|
|
udelay(1000);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
|
|
|
/* enable watchdog, set timeout to 0 and wait */
|
2012-03-26 21:49:04 +00:00
|
|
|
out_be16(&wdp->wdog_wrrr, 1);
|
2007-08-16 00:21:21 +00:00
|
|
|
while (1) ;
|
2004-02-12 00:47:09 +00:00
|
|
|
|
|
|
|
/* we don't return! */
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
|
2017-08-19 22:01:55 +00:00
|
|
|
#if defined(CONFIG_DISPLAY_CPUINFO)
|
|
|
|
int print_cpuinfo(void)
|
2007-08-16 00:21:21 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
sysctrl_t *sysctrl = (sysctrl_t *) (MMAP_CFG);
|
2004-02-12 00:47:09 +00:00
|
|
|
uchar msk;
|
2007-08-16 00:21:21 +00:00
|
|
|
char *suf;
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
puts("CPU: ");
|
2012-03-26 21:49:04 +00:00
|
|
|
msk = (in_be32(&sysctrl->sc_dir) > 28) & 0xf;
|
2004-02-12 00:47:09 +00:00
|
|
|
switch (msk) {
|
2007-08-16 00:21:21 +00:00
|
|
|
case 0x2:
|
|
|
|
suf = "1K75N";
|
|
|
|
break;
|
|
|
|
case 0x4:
|
|
|
|
suf = "3K75N";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
suf = NULL;
|
|
|
|
printf("Freescale MCF5272 (Mask:%01x)\n", msk);
|
|
|
|
break;
|
|
|
|
}
|
2004-02-12 00:47:09 +00:00
|
|
|
|
|
|
|
if (suf)
|
2007-08-16 00:21:21 +00:00
|
|
|
printf("Freescale MCF5272 %s\n", suf);
|
2004-02-12 00:47:09 +00:00
|
|
|
return 0;
|
|
|
|
};
|
2017-08-19 22:01:55 +00:00
|
|
|
#endif /* CONFIG_DISPLAY_CPUINFO */
|
2004-02-12 00:47:09 +00:00
|
|
|
|
|
|
|
#if defined(CONFIG_WATCHDOG)
|
|
|
|
/* Called by macro WATCHDOG_RESET */
|
2007-08-16 00:21:21 +00:00
|
|
|
void watchdog_reset(void)
|
2004-02-12 00:47:09 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
|
|
|
|
|
|
|
|
out_be16(&wdt->wdog_wcr, 0);
|
2004-02-12 00:47:09 +00:00
|
|
|
}
|
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
int watchdog_disable(void)
|
2004-02-12 00:47:09 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
/* reset watchdog counter */
|
|
|
|
out_be16(&wdt->wdog_wcr, 0);
|
|
|
|
/* disable watchdog interrupt */
|
|
|
|
out_be16(&wdt->wdog_wirr, 0);
|
|
|
|
/* disable watchdog timer */
|
|
|
|
out_be16(&wdt->wdog_wrrr, 0);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
puts("WATCHDOG:disabled\n");
|
2004-02-12 00:47:09 +00:00
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
int watchdog_init(void)
|
2004-02-12 00:47:09 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
/* disable watchdog interrupt */
|
|
|
|
out_be16(&wdt->wdog_wirr, 0);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
|
|
|
/* set timeout and enable watchdog */
|
2012-03-26 21:49:04 +00:00
|
|
|
out_be16(&wdt->wdog_wrrr,
|
2022-11-19 23:45:45 +00:00
|
|
|
(CONFIG_WATCHDOG_TIMEOUT_MSECS * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
|
2012-03-26 21:49:04 +00:00
|
|
|
|
|
|
|
/* reset watchdog counter */
|
|
|
|
out_be16(&wdt->wdog_wcr, 0);
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
puts("WATCHDOG:enabled\n");
|
2004-02-12 00:47:09 +00:00
|
|
|
return (0);
|
|
|
|
}
|
2007-08-16 00:21:21 +00:00
|
|
|
#endif /* #ifdef CONFIG_WATCHDOG */
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
#endif /* #ifdef CONFIG_M5272 */
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2008-02-04 21:38:20 +00:00
|
|
|
#ifdef CONFIG_M5275
|
2020-05-10 17:40:03 +00:00
|
|
|
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
2008-02-04 21:38:20 +00:00
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
rcm_t *rcm = (rcm_t *)(MMAP_RCM);
|
2008-02-04 21:38:20 +00:00
|
|
|
|
|
|
|
udelay(1000);
|
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
out_8(&rcm->rcr, RCM_RCR_SOFTRST);
|
2008-02-04 21:38:20 +00:00
|
|
|
|
|
|
|
/* we don't return! */
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
|
2017-08-19 22:01:55 +00:00
|
|
|
#if defined(CONFIG_DISPLAY_CPUINFO)
|
|
|
|
int print_cpuinfo(void)
|
2008-02-04 21:38:20 +00:00
|
|
|
{
|
|
|
|
char buf[32];
|
|
|
|
|
|
|
|
printf("CPU: Freescale Coldfire MCF5275 at %s MHz\n",
|
2022-11-16 18:10:41 +00:00
|
|
|
strmhz(buf, CFG_SYS_CLK));
|
2008-02-04 21:38:20 +00:00
|
|
|
return 0;
|
|
|
|
};
|
2017-08-19 22:01:55 +00:00
|
|
|
#endif /* CONFIG_DISPLAY_CPUINFO */
|
2008-02-04 21:38:20 +00:00
|
|
|
|
|
|
|
#if defined(CONFIG_WATCHDOG)
|
|
|
|
/* Called by macro WATCHDOG_RESET */
|
|
|
|
void watchdog_reset(void)
|
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
|
|
|
|
|
|
|
|
out_be16(&wdt->wsr, 0x5555);
|
|
|
|
out_be16(&wdt->wsr, 0xaaaa);
|
2008-02-04 21:38:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int watchdog_disable(void)
|
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
|
2008-02-04 21:38:20 +00:00
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
/* reset watchdog counter */
|
|
|
|
out_be16(&wdt->wsr, 0x5555);
|
|
|
|
out_be16(&wdt->wsr, 0xaaaa);
|
|
|
|
|
|
|
|
/* disable watchdog timer */
|
|
|
|
out_be16(&wdt->wcr, 0);
|
2008-02-04 21:38:20 +00:00
|
|
|
|
|
|
|
puts("WATCHDOG:disabled\n");
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int watchdog_init(void)
|
|
|
|
{
|
2012-03-26 21:49:04 +00:00
|
|
|
wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
|
2008-02-04 21:38:20 +00:00
|
|
|
|
2012-03-26 21:49:04 +00:00
|
|
|
/* disable watchdog */
|
|
|
|
out_be16(&wdt->wcr, 0);
|
2008-02-04 21:38:20 +00:00
|
|
|
|
|
|
|
/* set timeout and enable watchdog */
|
2012-03-26 21:49:04 +00:00
|
|
|
out_be16(&wdt->wmr,
|
2022-11-19 23:45:45 +00:00
|
|
|
(CONFIG_WATCHDOG_TIMEOUT_MSECS * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
|
2012-03-26 21:49:04 +00:00
|
|
|
|
|
|
|
/* reset watchdog counter */
|
|
|
|
out_be16(&wdt->wsr, 0x5555);
|
|
|
|
out_be16(&wdt->wsr, 0xaaaa);
|
2008-02-04 21:38:20 +00:00
|
|
|
|
|
|
|
puts("WATCHDOG:enabled\n");
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
#endif /* #ifdef CONFIG_WATCHDOG */
|
|
|
|
|
|
|
|
#endif /* #ifdef CONFIG_M5275 */
|
|
|
|
|
2004-02-12 00:47:09 +00:00
|
|
|
#ifdef CONFIG_M5282
|
2017-08-19 22:01:55 +00:00
|
|
|
#if defined(CONFIG_DISPLAY_CPUINFO)
|
|
|
|
int print_cpuinfo(void)
|
2004-02-12 00:47:09 +00:00
|
|
|
{
|
2006-06-10 17:27:47 +00:00
|
|
|
unsigned char resetsource = MCFRESET_RSR;
|
2006-04-20 06:42:42 +00:00
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
printf("CPU: Freescale Coldfire MCF5282 (PIN: %2.2x REV: %2.2x)\n",
|
|
|
|
MCFCCM_CIR >> 8, MCFCCM_CIR & MCFCCM_CIR_PRN_MASK);
|
|
|
|
printf("Reset:%s%s%s%s%s%s%s\n",
|
|
|
|
(resetsource & MCFRESET_RSR_LOL) ? " Loss of Lock" : "",
|
|
|
|
(resetsource & MCFRESET_RSR_LOC) ? " Loss of Clock" : "",
|
|
|
|
(resetsource & MCFRESET_RSR_EXT) ? " External" : "",
|
|
|
|
(resetsource & MCFRESET_RSR_POR) ? " Power On" : "",
|
|
|
|
(resetsource & MCFRESET_RSR_WDR) ? " Watchdog" : "",
|
|
|
|
(resetsource & MCFRESET_RSR_SOFT) ? " Software" : "",
|
|
|
|
(resetsource & MCFRESET_RSR_LVD) ? " Low Voltage" : "");
|
2004-02-12 00:47:09 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2017-08-19 22:01:55 +00:00
|
|
|
#endif /* CONFIG_DISPLAY_CPUINFO */
|
2004-02-12 00:47:09 +00:00
|
|
|
|
2020-05-10 17:40:03 +00:00
|
|
|
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
2006-04-20 06:42:42 +00:00
|
|
|
{
|
|
|
|
MCFRESET_RCR = MCFRESET_RCR_SOFTRST;
|
2004-02-12 00:47:09 +00:00
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
#endif
|
2004-12-16 18:09:49 +00:00
|
|
|
|
2007-08-16 18:20:50 +00:00
|
|
|
#ifdef CONFIG_M5249
|
2017-08-19 22:01:55 +00:00
|
|
|
#if defined(CONFIG_DISPLAY_CPUINFO)
|
|
|
|
int print_cpuinfo(void)
|
2004-12-16 18:09:49 +00:00
|
|
|
{
|
|
|
|
char buf[32];
|
|
|
|
|
2007-08-16 00:21:21 +00:00
|
|
|
printf("CPU: Freescale Coldfire MCF5249 at %s MHz\n",
|
2022-11-16 18:10:41 +00:00
|
|
|
strmhz(buf, CFG_SYS_CLK));
|
2004-12-16 18:09:49 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2017-08-19 22:01:55 +00:00
|
|
|
#endif /* CONFIG_DISPLAY_CPUINFO */
|
2004-12-16 18:09:49 +00:00
|
|
|
|
2020-05-10 17:40:03 +00:00
|
|
|
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
2007-08-16 00:21:21 +00:00
|
|
|
{
|
2004-12-16 18:09:49 +00:00
|
|
|
/* enable watchdog, set timeout to 0 and wait */
|
|
|
|
mbar_writeByte(MCFSIM_SYPCR, 0xc0);
|
2007-08-16 00:21:21 +00:00
|
|
|
while (1) ;
|
2004-12-16 18:09:49 +00:00
|
|
|
|
|
|
|
/* we don't return! */
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
#endif
|
2007-08-16 18:20:50 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_M5253
|
2017-08-19 22:01:55 +00:00
|
|
|
#if defined(CONFIG_DISPLAY_CPUINFO)
|
|
|
|
int print_cpuinfo(void)
|
2007-08-16 18:20:50 +00:00
|
|
|
{
|
|
|
|
char buf[32];
|
|
|
|
|
|
|
|
unsigned char resetsource = mbar_readLong(SIM_RSR);
|
|
|
|
printf("CPU: Freescale Coldfire MCF5253 at %s MHz\n",
|
2022-11-16 18:10:41 +00:00
|
|
|
strmhz(buf, CFG_SYS_CLK));
|
2007-08-16 18:20:50 +00:00
|
|
|
|
|
|
|
if ((resetsource & SIM_RSR_HRST) || (resetsource & SIM_RSR_SWTR)) {
|
|
|
|
printf("Reset:%s%s\n",
|
|
|
|
(resetsource & SIM_RSR_HRST) ? " Hardware/ System Reset"
|
|
|
|
: "",
|
|
|
|
(resetsource & SIM_RSR_SWTR) ? " Software Watchdog" :
|
|
|
|
"");
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2017-08-19 22:01:55 +00:00
|
|
|
#endif /* CONFIG_DISPLAY_CPUINFO */
|
2007-08-16 18:20:50 +00:00
|
|
|
|
2020-05-10 17:40:03 +00:00
|
|
|
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
2007-08-16 18:20:50 +00:00
|
|
|
{
|
|
|
|
/* enable watchdog, set timeout to 0 and wait */
|
|
|
|
mbar_writeByte(SIM_SYPCR, 0xc0);
|
|
|
|
while (1) ;
|
|
|
|
|
|
|
|
/* we don't return! */
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
#endif
|
2008-08-27 05:16:25 +00:00
|
|
|
|
|
|
|
#if defined(CONFIG_MCFFEC)
|
|
|
|
/* Default initializations for MCFFEC controllers. To override,
|
|
|
|
* create a board-specific function called:
|
2021-09-27 15:42:39 +00:00
|
|
|
* int board_eth_init(struct bd_info *bis)
|
2008-08-27 05:16:25 +00:00
|
|
|
*/
|
|
|
|
|
2020-06-26 06:13:33 +00:00
|
|
|
int cpu_eth_init(struct bd_info *bis)
|
2008-08-27 05:16:25 +00:00
|
|
|
{
|
|
|
|
return mcffec_initialize(bis);
|
|
|
|
}
|
|
|
|
#endif
|