Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 2 | /* |
| 3 | * |
| 4 | * (C) Copyright 2000-2003 |
| 5 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 6 | * |
Alison Wang | 849fc42 | 2012-03-26 21:49:03 +0000 | [diff] [blame] | 7 | * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc. |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 8 | * TsiChung Liew (Tsi-Chung.Liew@freescale.com) |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #include <common.h> |
Simon Glass | 2189d5f | 2019-11-14 12:57:20 -0700 | [diff] [blame] | 12 | #include <vsprintf.h> |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 13 | #include <watchdog.h> |
| 14 | #include <command.h> |
| 15 | |
| 16 | #include <asm/immap.h> |
Alison Wang | 849fc42 | 2012-03-26 21:49:03 +0000 | [diff] [blame] | 17 | #include <asm/io.h> |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 18 | |
| 19 | DECLARE_GLOBAL_DATA_PTR; |
| 20 | |
Mike Frysinger | 882b7d7 | 2010-10-20 03:41:17 -0400 | [diff] [blame] | 21 | int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 22 | { |
Alison Wang | 849fc42 | 2012-03-26 21:49:03 +0000 | [diff] [blame] | 23 | rcm_t *rcm = (rcm_t *) (MMAP_RCM); |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 24 | udelay(1000); |
Alison Wang | 849fc42 | 2012-03-26 21:49:03 +0000 | [diff] [blame] | 25 | setbits_8(&rcm->rcr, RCM_RCR_SOFTRST); |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 26 | |
| 27 | /* we don't return! */ |
| 28 | return 0; |
| 29 | }; |
| 30 | |
Angelo Dureghello | b9153fe3 | 2017-08-20 00:01:55 +0200 | [diff] [blame] | 31 | #if defined(CONFIG_DISPLAY_CPUINFO) |
| 32 | int print_cpuinfo(void) |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 33 | { |
Alison Wang | 849fc42 | 2012-03-26 21:49:03 +0000 | [diff] [blame] | 34 | ccm_t *ccm = (ccm_t *) MMAP_CCM; |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 35 | u16 msk; |
| 36 | u16 id = 0; |
| 37 | u8 ver; |
| 38 | |
| 39 | puts("CPU: "); |
Alison Wang | 849fc42 | 2012-03-26 21:49:03 +0000 | [diff] [blame] | 40 | msk = (in_be16(&ccm->cir) >> 6); |
| 41 | ver = (in_be16(&ccm->cir) & 0x003f); |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 42 | switch (msk) { |
| 43 | case 0x6c: |
| 44 | id = 52277; |
| 45 | break; |
| 46 | } |
| 47 | |
| 48 | if (id) { |
Wolfgang Denk | 08ef89e | 2008-10-19 02:35:49 +0200 | [diff] [blame] | 49 | char buf1[32], buf2[32], buf3[32]; |
| 50 | |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 51 | printf("Freescale MCF%d (Mask:%01x Version:%x)\n", id, msk, |
| 52 | ver); |
Wolfgang Denk | 08ef89e | 2008-10-19 02:35:49 +0200 | [diff] [blame] | 53 | printf(" CPU CLK %s MHz BUS CLK %s MHz FLB CLK %s MHz\n", |
TsiChung Liew | 1b27084 | 2008-10-22 11:55:30 +0000 | [diff] [blame] | 54 | strmhz(buf1, gd->cpu_clk), |
| 55 | strmhz(buf2, gd->bus_clk), |
Simon Glass | 7e2592f | 2012-12-13 20:49:07 +0000 | [diff] [blame] | 56 | strmhz(buf3, gd->arch.flb_clk)); |
Wolfgang Denk | 08ef89e | 2008-10-19 02:35:49 +0200 | [diff] [blame] | 57 | printf(" INP CLK %s MHz VCO CLK %s MHz\n", |
Simon Glass | 7e2592f | 2012-12-13 20:49:07 +0000 | [diff] [blame] | 58 | strmhz(buf1, gd->arch.inp_clk), |
| 59 | strmhz(buf2, gd->arch.vco_clk)); |
TsiChungLiew | c875810 | 2008-01-14 17:46:19 -0600 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | return 0; |
| 63 | } |
Angelo Dureghello | b9153fe3 | 2017-08-20 00:01:55 +0200 | [diff] [blame] | 64 | #endif /* CONFIG_DISPLAY_CPUINFO */ |