blob: 5ea6158c80944342b9dc3bd2d175e8515b12ecfe [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 Glass97589732020-05-10 11:40:02 -060012#include <init.h>
Simon Glassf5c208d2019-11-14 12:57:20 -070013#include <vsprintf.h>
TsiChungLiewae831cd2008-01-14 17:46:19 -060014#include <watchdog.h>
15#include <command.h>
Simon Glassdbd79542020-05-10 11:40:11 -060016#include <linux/delay.h>
TsiChungLiewae831cd2008-01-14 17:46:19 -060017
18#include <asm/immap.h>
Alison Wang8bce3ec2012-03-26 21:49:03 +000019#include <asm/io.h>
TsiChungLiewae831cd2008-01-14 17:46:19 -060020
21DECLARE_GLOBAL_DATA_PTR;
22
Simon Glassed38aef2020-05-10 11:40:03 -060023int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
TsiChungLiewae831cd2008-01-14 17:46:19 -060024{
Alison Wang8bce3ec2012-03-26 21:49:03 +000025 rcm_t *rcm = (rcm_t *) (MMAP_RCM);
TsiChungLiewae831cd2008-01-14 17:46:19 -060026 udelay(1000);
Alison Wang8bce3ec2012-03-26 21:49:03 +000027 setbits_8(&rcm->rcr, RCM_RCR_SOFTRST);
TsiChungLiewae831cd2008-01-14 17:46:19 -060028
29 /* we don't return! */
30 return 0;
31};
32
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020033#if defined(CONFIG_DISPLAY_CPUINFO)
34int print_cpuinfo(void)
TsiChungLiewae831cd2008-01-14 17:46:19 -060035{
Alison Wang8bce3ec2012-03-26 21:49:03 +000036 ccm_t *ccm = (ccm_t *) MMAP_CCM;
TsiChungLiewae831cd2008-01-14 17:46:19 -060037 u16 msk;
38 u16 id = 0;
39 u8 ver;
40
41 puts("CPU: ");
Alison Wang8bce3ec2012-03-26 21:49:03 +000042 msk = (in_be16(&ccm->cir) >> 6);
43 ver = (in_be16(&ccm->cir) & 0x003f);
TsiChungLiewae831cd2008-01-14 17:46:19 -060044 switch (msk) {
45 case 0x6c:
46 id = 52277;
47 break;
48 }
49
50 if (id) {
Wolfgang Denk20591042008-10-19 02:35:49 +020051 char buf1[32], buf2[32], buf3[32];
52
TsiChungLiewae831cd2008-01-14 17:46:19 -060053 printf("Freescale MCF%d (Mask:%01x Version:%x)\n", id, msk,
54 ver);
Wolfgang Denk20591042008-10-19 02:35:49 +020055 printf(" CPU CLK %s MHz BUS CLK %s MHz FLB CLK %s MHz\n",
TsiChung Liew10e9a6e2008-10-22 11:55:30 +000056 strmhz(buf1, gd->cpu_clk),
57 strmhz(buf2, gd->bus_clk),
Simon Glass568a7b62012-12-13 20:49:07 +000058 strmhz(buf3, gd->arch.flb_clk));
Wolfgang Denk20591042008-10-19 02:35:49 +020059 printf(" INP CLK %s MHz VCO CLK %s MHz\n",
Simon Glass568a7b62012-12-13 20:49:07 +000060 strmhz(buf1, gd->arch.inp_clk),
61 strmhz(buf2, gd->arch.vco_clk));
TsiChungLiewae831cd2008-01-14 17:46:19 -060062 }
63
64 return 0;
65}
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020066#endif /* CONFIG_DISPLAY_CPUINFO */