blob: 36c9c99ee6ff8126c3f9bf2ed6a764b68b78f734 [file] [log] [blame]
Simon Glass5233da52020-05-10 14:16:57 -06001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * PPC-specific information for the 'bd' command
4 *
5 * (C) Copyright 2003
6 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7 */
8
9#include <common.h>
10#include <init.h>
11
12DECLARE_GLOBAL_DATA_PTR;
13
Ovidiu Panait399aeb62020-07-24 14:12:19 +030014int arch_setup_bdinfo(void)
15{
16 struct bd_info *bd = gd->bd;
17
18#if defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
19 bd->bi_immr_base = CONFIG_SYS_IMMR; /* base of IMMR register */
20#endif
21
22#if defined(CONFIG_MPC83xx)
23 bd->bi_immrbar = CONFIG_SYS_IMMR;
24#endif
25
26 bd->bi_intfreq = gd->cpu_clk; /* Internal Freq, in Hz */
27 bd->bi_busfreq = gd->bus_clk; /* Bus Freq, in Hz */
28
29#if defined(CONFIG_CPM2)
30 bd->bi_cpmfreq = gd->arch.cpm_clk;
31 bd->bi_brgfreq = gd->arch.brg_clk;
32 bd->bi_sccfreq = gd->arch.scc_clk;
33 bd->bi_vco = gd->arch.vco_out;
34#endif /* CONFIG_CPM2 */
35
36 return 0;
37}
38
Simon Glass5233da52020-05-10 14:16:57 -060039void __weak board_detail(void)
40{
41 /* Please define board_detail() for your PPC platform */
42}
43
44void arch_print_bdinfo(void)
45{
Masahiro Yamadaf7ed78b2020-06-26 15:13:33 +090046 struct bd_info *bd = gd->bd;
Simon Glass5233da52020-05-10 14:16:57 -060047
Simon Glass227b24b2020-05-10 14:16:59 -060048 bdinfo_print_mhz("busfreq", bd->bi_busfreq);
Simon Glass5233da52020-05-10 14:16:57 -060049#if defined(CONFIG_MPC8xx) || defined(CONFIG_E500)
50 bdinfo_print_num("immr_base", bd->bi_immr_base);
51#endif
52 bdinfo_print_num("bootflags", bd->bi_bootflags);
53 bdinfo_print_mhz("intfreq", bd->bi_intfreq);
54#ifdef CONFIG_ENABLE_36BIT_PHYS
55 if (IS_ENABLED(CONFIG_PHYS_64BIT))
56 puts("addressing = 36-bit\n");
57 else
58 puts("addressing = 32-bit\n");
59#endif
60 board_detail();
61#if defined(CONFIG_CPM2)
62 bdinfo_print_mhz("cpmfreq", bd->bi_cpmfreq);
63 bdinfo_print_mhz("vco", bd->bi_vco);
64 bdinfo_print_mhz("sccfreq", bd->bi_sccfreq);
65 bdinfo_print_mhz("brgfreq", bd->bi_brgfreq);
66#endif
67}