blob: 55dcad5df8e9888a2e2602953a6c066a9a7acc39 [file] [log] [blame]
Simon Glass79d074d2020-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>
Simon Glass401d1c42020-10-30 21:38:53 -060011#include <asm/global_data.h>
Simon Glass79d074d2020-05-10 14:16:57 -060012
13DECLARE_GLOBAL_DATA_PTR;
14
Ovidiu Panaitf1e504a2020-07-24 14:12:19 +030015int arch_setup_bdinfo(void)
16{
17 struct bd_info *bd = gd->bd;
18
19#if defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
20 bd->bi_immr_base = CONFIG_SYS_IMMR; /* base of IMMR register */
21#endif
22
23#if defined(CONFIG_MPC83xx)
24 bd->bi_immrbar = CONFIG_SYS_IMMR;
25#endif
26
27 bd->bi_intfreq = gd->cpu_clk; /* Internal Freq, in Hz */
28 bd->bi_busfreq = gd->bus_clk; /* Bus Freq, in Hz */
29
Ovidiu Panaitf1e504a2020-07-24 14:12:19 +030030 return 0;
31}
32
Simon Glass79d074d2020-05-10 14:16:57 -060033void __weak board_detail(void)
34{
35 /* Please define board_detail() for your PPC platform */
36}
37
38void arch_print_bdinfo(void)
39{
Masahiro Yamadab75d8dc2020-06-26 15:13:33 +090040 struct bd_info *bd = gd->bd;
Simon Glass79d074d2020-05-10 14:16:57 -060041
Simon Glass64791982020-05-10 14:16:59 -060042 bdinfo_print_mhz("busfreq", bd->bi_busfreq);
Simon Glass79d074d2020-05-10 14:16:57 -060043#if defined(CONFIG_MPC8xx) || defined(CONFIG_E500)
Bin Meng98592c72021-01-31 20:36:05 +080044 bdinfo_print_num_l("immr_base", bd->bi_immr_base);
Simon Glass79d074d2020-05-10 14:16:57 -060045#endif
Bin Meng98592c72021-01-31 20:36:05 +080046 bdinfo_print_num_l("bootflags", bd->bi_bootflags);
Simon Glass79d074d2020-05-10 14:16:57 -060047 bdinfo_print_mhz("intfreq", bd->bi_intfreq);
48#ifdef CONFIG_ENABLE_36BIT_PHYS
49 if (IS_ENABLED(CONFIG_PHYS_64BIT))
50 puts("addressing = 36-bit\n");
51 else
52 puts("addressing = 32-bit\n");
53#endif
54 board_detail();
Simon Glass79d074d2020-05-10 14:16:57 -060055}