blob: 34534d876bc7b7880884bdaca62e10c31003057d [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
TsiChungLiewae831cd2008-01-14 17:46:19 -06002/*
3 *
4 * (C) Copyright 2000-2003
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 *
Alison Wang8bce3ec2012-03-26 21:49:03 +00007 * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
TsiChungLiewae831cd2008-01-14 17:46:19 -06008 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
TsiChungLiewae831cd2008-01-14 17:46:19 -06009 */
10
11#include <common.h>
Simon Glassf5c208d2019-11-14 12:57:20 -070012#include <vsprintf.h>
TsiChungLiewae831cd2008-01-14 17:46:19 -060013#include <watchdog.h>
14#include <command.h>
15
16#include <asm/immap.h>
Alison Wang8bce3ec2012-03-26 21:49:03 +000017#include <asm/io.h>
TsiChungLiewae831cd2008-01-14 17:46:19 -060018
19DECLARE_GLOBAL_DATA_PTR;
20
Mike Frysinger6d1f6982010-10-20 03:41:17 -040021int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
TsiChungLiewae831cd2008-01-14 17:46:19 -060022{
Alison Wang8bce3ec2012-03-26 21:49:03 +000023 rcm_t *rcm = (rcm_t *) (MMAP_RCM);
TsiChungLiewae831cd2008-01-14 17:46:19 -060024 udelay(1000);
Alison Wang8bce3ec2012-03-26 21:49:03 +000025 setbits_8(&rcm->rcr, RCM_RCR_SOFTRST);
TsiChungLiewae831cd2008-01-14 17:46:19 -060026
27 /* we don't return! */
28 return 0;
29};
30
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020031#if defined(CONFIG_DISPLAY_CPUINFO)
32int print_cpuinfo(void)
TsiChungLiewae831cd2008-01-14 17:46:19 -060033{
Alison Wang8bce3ec2012-03-26 21:49:03 +000034 ccm_t *ccm = (ccm_t *) MMAP_CCM;
TsiChungLiewae831cd2008-01-14 17:46:19 -060035 u16 msk;
36 u16 id = 0;
37 u8 ver;
38
39 puts("CPU: ");
Alison Wang8bce3ec2012-03-26 21:49:03 +000040 msk = (in_be16(&ccm->cir) >> 6);
41 ver = (in_be16(&ccm->cir) & 0x003f);
TsiChungLiewae831cd2008-01-14 17:46:19 -060042 switch (msk) {
43 case 0x6c:
44 id = 52277;
45 break;
46 }
47
48 if (id) {
Wolfgang Denk20591042008-10-19 02:35:49 +020049 char buf1[32], buf2[32], buf3[32];
50
TsiChungLiewae831cd2008-01-14 17:46:19 -060051 printf("Freescale MCF%d (Mask:%01x Version:%x)\n", id, msk,
52 ver);
Wolfgang Denk20591042008-10-19 02:35:49 +020053 printf(" CPU CLK %s MHz BUS CLK %s MHz FLB CLK %s MHz\n",
TsiChung Liew10e9a6e2008-10-22 11:55:30 +000054 strmhz(buf1, gd->cpu_clk),
55 strmhz(buf2, gd->bus_clk),
Simon Glass568a7b62012-12-13 20:49:07 +000056 strmhz(buf3, gd->arch.flb_clk));
Wolfgang Denk20591042008-10-19 02:35:49 +020057 printf(" INP CLK %s MHz VCO CLK %s MHz\n",
Simon Glass568a7b62012-12-13 20:49:07 +000058 strmhz(buf1, gd->arch.inp_clk),
59 strmhz(buf2, gd->arch.vco_clk));
TsiChungLiewae831cd2008-01-14 17:46:19 -060060 }
61
62 return 0;
63}
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020064#endif /* CONFIG_DISPLAY_CPUINFO */