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