2020-05-10 20:16:56 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
/*
|
|
|
|
* ARM-specific information for the 'bd' command
|
|
|
|
*
|
|
|
|
* (C) Copyright 2003
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <init.h>
|
2020-10-31 03:38:53 +00:00
|
|
|
#include <asm/global_data.h>
|
2022-09-13 18:31:27 +00:00
|
|
|
#include <asm/mach-types.h>
|
2020-05-10 20:16:56 +00:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2022-09-13 18:31:27 +00:00
|
|
|
int arch_setup_bdinfo(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_MACH_TYPE
|
|
|
|
struct bd_info *bd = gd->bd;
|
|
|
|
|
|
|
|
bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-05-10 20:16:56 +00:00
|
|
|
void arch_print_bdinfo(void)
|
|
|
|
{
|
2020-06-26 06:13:33 +00:00
|
|
|
struct bd_info *bd = gd->bd;
|
2020-05-10 20:16:56 +00:00
|
|
|
|
2021-01-31 12:36:05 +00:00
|
|
|
bdinfo_print_num_l("arch_number", bd->bi_arch_number);
|
2022-11-16 18:10:41 +00:00
|
|
|
#ifdef CFG_SYS_MEM_RESERVE_SECURE
|
2020-05-10 20:16:56 +00:00
|
|
|
if (gd->arch.secure_ram & MEM_RESERVE_SECURE_SECURED) {
|
2021-01-31 12:36:06 +00:00
|
|
|
bdinfo_print_num_ll("Secure ram",
|
|
|
|
gd->arch.secure_ram &
|
|
|
|
MEM_RESERVE_SECURE_ADDR_MASK);
|
2020-05-10 20:16:56 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_RESV_RAM
|
|
|
|
if (gd->arch.resv_ram)
|
2021-01-31 12:36:06 +00:00
|
|
|
bdinfo_print_num_ll("Reserved ram", gd->arch.resv_ram);
|
2020-05-10 20:16:56 +00:00
|
|
|
#endif
|
|
|
|
#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
|
2021-01-31 12:36:05 +00:00
|
|
|
bdinfo_print_num_l("TLB addr", gd->arch.tlb_addr);
|
2020-05-10 20:16:56 +00:00
|
|
|
#endif
|
2021-01-31 12:36:05 +00:00
|
|
|
bdinfo_print_num_l("irq_sp", gd->irq_sp); /* irq stack pointer */
|
|
|
|
bdinfo_print_num_l("sp start ", gd->start_addr_sp);
|
2020-05-10 20:16:56 +00:00
|
|
|
/*
|
|
|
|
* TODO: Currently only support for davinci SOC's is added.
|
|
|
|
* Remove this check once all the board implement this.
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_CLOCKS
|
|
|
|
printf("ARM frequency = %ld MHz\n", bd->bi_arm_freq);
|
|
|
|
printf("DSP frequency = %ld MHz\n", bd->bi_dsp_freq);
|
|
|
|
printf("DDR frequency = %ld MHz\n", bd->bi_ddr_freq);
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_BOARD_TYPES
|
|
|
|
printf("Board Type = %ld\n", gd->board_type);
|
|
|
|
#endif
|
2023-09-26 14:14:27 +00:00
|
|
|
#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
|
2020-05-10 20:16:56 +00:00
|
|
|
printf("Early malloc usage: %lx / %x\n", gd->malloc_ptr,
|
|
|
|
CONFIG_VAL(SYS_MALLOC_F_LEN));
|
|
|
|
#endif
|
|
|
|
}
|