2018-05-07 06:58:06 +09:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2008-01-15 08:46:19 +09:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* (C) Copyright 2000-2003
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*
|
2012-03-27 06:49:03 +09:00
|
|
|
* Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
|
2008-01-15 08:46:19 +09:00
|
|
|
* TsiChung Liew (Tsi-Chung.Liew@freescale.com)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2020-05-11 02:40:02 +09:00
|
|
|
#include <init.h>
|
2019-11-15 04:57:20 +09:00
|
|
|
#include <vsprintf.h>
|
2008-01-15 08:46:19 +09:00
|
|
|
#include <watchdog.h>
|
|
|
|
#include <command.h>
|
2020-10-31 12:38:53 +09:00
|
|
|
#include <asm/global_data.h>
|
2020-05-11 02:40:11 +09:00
|
|
|
#include <linux/delay.h>
|
2008-01-15 08:46:19 +09:00
|
|
|
|
|
|
|
#include <asm/immap.h>
|
2012-03-27 06:49:03 +09:00
|
|
|
#include <asm/io.h>
|
2008-01-15 08:46:19 +09:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2020-05-11 02:40:03 +09:00
|
|
|
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
2008-01-15 08:46:19 +09:00
|
|
|
{
|
2012-03-27 06:49:03 +09:00
|
|
|
rcm_t *rcm = (rcm_t *) (MMAP_RCM);
|
2008-01-15 08:46:19 +09:00
|
|
|
udelay(1000);
|
2012-03-27 06:49:03 +09:00
|
|
|
setbits_8(&rcm->rcr, RCM_RCR_SOFTRST);
|
2008-01-15 08:46:19 +09:00
|
|
|
|
|
|
|
/* we don't return! */
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
|
2017-08-20 07:01:55 +09:00
|
|
|
#if defined(CONFIG_DISPLAY_CPUINFO)
|
|
|
|
int print_cpuinfo(void)
|
2008-01-15 08:46:19 +09:00
|
|
|
{
|
2012-03-27 06:49:03 +09:00
|
|
|
ccm_t *ccm = (ccm_t *) MMAP_CCM;
|
2008-01-15 08:46:19 +09:00
|
|
|
u16 msk;
|
|
|
|
u16 id = 0;
|
|
|
|
u8 ver;
|
|
|
|
|
|
|
|
puts("CPU: ");
|
2012-03-27 06:49:03 +09:00
|
|
|
msk = (in_be16(&ccm->cir) >> 6);
|
|
|
|
ver = (in_be16(&ccm->cir) & 0x003f);
|
2008-01-15 08:46:19 +09:00
|
|
|
switch (msk) {
|
|
|
|
case 0x6c:
|
|
|
|
id = 52277;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (id) {
|
2008-10-19 09:35:49 +09:00
|
|
|
char buf1[32], buf2[32], buf3[32];
|
|
|
|
|
2008-01-15 08:46:19 +09:00
|
|
|
printf("Freescale MCF%d (Mask:%01x Version:%x)\n", id, msk,
|
|
|
|
ver);
|
2008-10-19 09:35:49 +09:00
|
|
|
printf(" CPU CLK %s MHz BUS CLK %s MHz FLB CLK %s MHz\n",
|
2008-10-22 20:55:30 +09:00
|
|
|
strmhz(buf1, gd->cpu_clk),
|
|
|
|
strmhz(buf2, gd->bus_clk),
|
2012-12-14 05:49:07 +09:00
|
|
|
strmhz(buf3, gd->arch.flb_clk));
|
2008-10-19 09:35:49 +09:00
|
|
|
printf(" INP CLK %s MHz VCO CLK %s MHz\n",
|
2012-12-14 05:49:07 +09:00
|
|
|
strmhz(buf1, gd->arch.inp_clk),
|
|
|
|
strmhz(buf2, gd->arch.vco_clk));
|
2008-01-15 08:46:19 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2017-08-20 07:01:55 +09:00
|
|
|
#endif /* CONFIG_DISPLAY_CPUINFO */
|