Simon Glass | 5233da5 | 2020-05-10 14:16:57 -0600 | [diff] [blame] | 1 | // 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 | |
Simon Glass | 5233da5 | 2020-05-10 14:16:57 -0600 | [diff] [blame] | 9 | #include <init.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 10 | #include <asm/global_data.h> |
Simon Glass | 5233da5 | 2020-05-10 14:16:57 -0600 | [diff] [blame] | 11 | |
| 12 | DECLARE_GLOBAL_DATA_PTR; |
| 13 | |
Ovidiu Panait | 399aeb6 | 2020-07-24 14:12:19 +0300 | [diff] [blame] | 14 | int 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 | |
Ovidiu Panait | 399aeb6 | 2020-07-24 14:12:19 +0300 | [diff] [blame] | 29 | return 0; |
| 30 | } |
| 31 | |
Simon Glass | 5233da5 | 2020-05-10 14:16:57 -0600 | [diff] [blame] | 32 | void __weak board_detail(void) |
| 33 | { |
| 34 | /* Please define board_detail() for your PPC platform */ |
| 35 | } |
| 36 | |
| 37 | void arch_print_bdinfo(void) |
| 38 | { |
Masahiro Yamada | f7ed78b | 2020-06-26 15:13:33 +0900 | [diff] [blame] | 39 | struct bd_info *bd = gd->bd; |
Simon Glass | 5233da5 | 2020-05-10 14:16:57 -0600 | [diff] [blame] | 40 | |
Simon Glass | 227b24b | 2020-05-10 14:16:59 -0600 | [diff] [blame] | 41 | bdinfo_print_mhz("busfreq", bd->bi_busfreq); |
Simon Glass | 5233da5 | 2020-05-10 14:16:57 -0600 | [diff] [blame] | 42 | #if defined(CONFIG_MPC8xx) || defined(CONFIG_E500) |
Bin Meng | 1ae7a0c | 2021-01-31 20:36:05 +0800 | [diff] [blame] | 43 | bdinfo_print_num_l("immr_base", bd->bi_immr_base); |
Simon Glass | 5233da5 | 2020-05-10 14:16:57 -0600 | [diff] [blame] | 44 | #endif |
Bin Meng | 1ae7a0c | 2021-01-31 20:36:05 +0800 | [diff] [blame] | 45 | bdinfo_print_num_l("bootflags", bd->bi_bootflags); |
Simon Glass | 5233da5 | 2020-05-10 14:16:57 -0600 | [diff] [blame] | 46 | bdinfo_print_mhz("intfreq", bd->bi_intfreq); |
| 47 | #ifdef CONFIG_ENABLE_36BIT_PHYS |
| 48 | if (IS_ENABLED(CONFIG_PHYS_64BIT)) |
| 49 | puts("addressing = 36-bit\n"); |
| 50 | else |
| 51 | puts("addressing = 32-bit\n"); |
| 52 | #endif |
| 53 | board_detail(); |
Simon Glass | 5233da5 | 2020-05-10 14:16:57 -0600 | [diff] [blame] | 54 | } |