diff options
author | Tom Rini <trini@konsulko.com> | 2020-06-25 18:15:50 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-06-25 18:15:50 -0400 |
commit | 04f005d552eb748582678a45119b55a99f75748e (patch) | |
tree | d57377eec42fbfecfc3108d8b64b8061331fed3a /arch | |
parent | f0e236c8d6646f6ef0ebf8f043962a07dda3b3a3 (diff) | |
parent | c68a1ae6ab760d797f4dde2c5c671e18d0e2adb4 (diff) |
Merge branch '2020-06-25-tidy-up-bd-command' into next
- Tidy up the 'bdinfo' command so that it's both consistent for all
architectures and sharing as much code as possible.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/lib/bdinfo.c | 51 | ||||
-rw-r--r-- | arch/m68k/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/m68k/lib/bdinfo.c | 34 | ||||
-rw-r--r-- | arch/nds32/include/asm/u-boot.h | 20 | ||||
-rw-r--r-- | arch/powerpc/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/lib/bdinfo.c | 46 | ||||
-rw-r--r-- | arch/riscv/include/asm/u-boot.h | 19 | ||||
-rw-r--r-- | arch/x86/lib/fsp/fsp_graphics.c | 5 |
9 files changed, 142 insertions, 37 deletions
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index b839aa7a50..27b12e7f2b 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -43,6 +43,7 @@ obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset.o obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMCPY) += memcpy.o obj-$(CONFIG_SEMIHOSTING) += semihosting.o +obj-y += bdinfo.o obj-y += sections.o obj-y += stack.o ifdef CONFIG_CPU_V7M diff --git a/arch/arm/lib/bdinfo.c b/arch/arm/lib/bdinfo.c new file mode 100644 index 0000000000..81c9291584 --- /dev/null +++ b/arch/arm/lib/bdinfo.c @@ -0,0 +1,51 @@ +// 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> + +DECLARE_GLOBAL_DATA_PTR; + +void arch_print_bdinfo(void) +{ + bd_t *bd = gd->bd; + + bdinfo_print_num("arch_number", bd->bi_arch_number); +#ifdef CONFIG_SYS_MEM_RESERVE_SECURE + if (gd->arch.secure_ram & MEM_RESERVE_SECURE_SECURED) { + bdinfo_print_num("Secure ram", + gd->arch.secure_ram & + MEM_RESERVE_SECURE_ADDR_MASK); + } +#endif +#ifdef CONFIG_RESV_RAM + if (gd->arch.resv_ram) + bdinfo_print_num("Reserved ram", gd->arch.resv_ram); +#endif +#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) + bdinfo_print_num("TLB addr", gd->arch.tlb_addr); +#endif + bdinfo_print_num("irq_sp", gd->irq_sp); /* irq stack pointer */ + bdinfo_print_num("sp start ", gd->start_addr_sp); + /* + * 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 +#if CONFIG_VAL(SYS_MALLOC_F_LEN) + printf("Early malloc usage: %lx / %x\n", gd->malloc_ptr, + CONFIG_VAL(SYS_MALLOC_F_LEN)); +#endif +} diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile index a040f40eb8..b66d66afd2 100644 --- a/arch/m68k/lib/Makefile +++ b/arch/m68k/lib/Makefile @@ -7,6 +7,7 @@ ## if the user asked for it lib-$(CONFIG_USE_PRIVATE_LIBGCC) += lshrdi3.o muldi3.o ashldi3.o +obj-y += bdinfo.o obj-$(CONFIG_CMD_BOOTM) += bootm.o obj-y += cache.o obj-y += interrupts.o diff --git a/arch/m68k/lib/bdinfo.c b/arch/m68k/lib/bdinfo.c new file mode 100644 index 0000000000..971c47c306 --- /dev/null +++ b/arch/m68k/lib/bdinfo.c @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * PPC-specific information for the 'bd' command + * + * (C) Copyright 2003 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + */ + +#include <common.h> +#include <init.h> + +DECLARE_GLOBAL_DATA_PTR; + +void arch_print_bdinfo(void) +{ + bd_t *bd = gd->bd; + +#if defined(CONFIG_SYS_INIT_RAM_ADDR) + bdinfo_print_num("sramstart", (ulong)bd->bi_sramstart); + bdinfo_print_num("sramsize", (ulong)bd->bi_sramsize); +#endif + bdinfo_print_mhz("busfreq", bd->bi_busfreq); +#if defined(CONFIG_SYS_MBAR) + bdinfo_print_num("mbar", bd->bi_mbar_base); +#endif + bdinfo_print_mhz("cpufreq", bd->bi_intfreq); + if (IS_ENABLED(CONFIG_PCI)) + bdinfo_print_mhz("pcifreq", bd->bi_pcifreq); +#ifdef CONFIG_EXTRA_CLOCK + bdinfo_print_mhz("flbfreq", bd->bi_flbfreq); + bdinfo_print_mhz("inpfreq", bd->bi_inpfreq); + bdinfo_print_mhz("vcofreq", bd->bi_vcofreq); +#endif +} diff --git a/arch/nds32/include/asm/u-boot.h b/arch/nds32/include/asm/u-boot.h index 8c949e7fb7..7b6e905f2a 100644 --- a/arch/nds32/include/asm/u-boot.h +++ b/arch/nds32/include/asm/u-boot.h @@ -19,26 +19,10 @@ #ifndef _U_BOOT_H_ #define _U_BOOT_H_ 1 +/* Use the generic board which requires a unified bd_info */ +#include <asm-generic/u-boot.h> #include <asm/u-boot-nds32.h> - -typedef struct bd_info { - unsigned long bi_arch_number; /* unique id for this board */ - unsigned long bi_boot_params; /* where this board expects params */ - unsigned long bi_memstart; /* start of DRAM memory */ - unsigned long bi_memsize; /* size of DRAM memory in bytes */ - unsigned long bi_flashstart; /* start of FLASH memory */ - unsigned long bi_flashsize; /* size of FLASH memory */ - unsigned long bi_flashoffset; /* reserved area for startup monitor */ - unsigned char bi_enetaddr[6]; - - struct /* RAM configuration */ - { - unsigned long start; - unsigned long size; - } bi_dram[CONFIG_NR_DRAM_BANKS]; -} bd_t; - /* For image.h:image_check_target_arch() */ #define IH_ARCH_DEFAULT IH_ARCH_NDS32 diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 01c9dd51be..f61809ab05 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile @@ -15,6 +15,8 @@ MINIMAL=y endif endif +obj-y += bdinfo.o + ifdef MINIMAL obj-y += cache.o time.o ifndef CONFIG_TIMER diff --git a/arch/powerpc/lib/bdinfo.c b/arch/powerpc/lib/bdinfo.c new file mode 100644 index 0000000000..d8c64155f0 --- /dev/null +++ b/arch/powerpc/lib/bdinfo.c @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * PPC-specific information for the 'bd' command + * + * (C) Copyright 2003 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + */ + +#include <common.h> +#include <init.h> + +DECLARE_GLOBAL_DATA_PTR; + +void __weak board_detail(void) +{ + /* Please define board_detail() for your PPC platform */ +} + +void arch_print_bdinfo(void) +{ + bd_t *bd = gd->bd; + +#if defined(CONFIG_SYS_INIT_RAM_ADDR) + bdinfo_print_num("sramstart", (ulong)bd->bi_sramstart); + bdinfo_print_num("sramsize", (ulong)bd->bi_sramsize); +#endif + bdinfo_print_mhz("busfreq", bd->bi_busfreq); +#if defined(CONFIG_MPC8xx) || defined(CONFIG_E500) + bdinfo_print_num("immr_base", bd->bi_immr_base); +#endif + bdinfo_print_num("bootflags", bd->bi_bootflags); + bdinfo_print_mhz("intfreq", bd->bi_intfreq); +#ifdef CONFIG_ENABLE_36BIT_PHYS + if (IS_ENABLED(CONFIG_PHYS_64BIT)) + puts("addressing = 36-bit\n"); + else + puts("addressing = 32-bit\n"); +#endif + board_detail(); +#if defined(CONFIG_CPM2) + bdinfo_print_mhz("cpmfreq", bd->bi_cpmfreq); + bdinfo_print_mhz("vco", bd->bi_vco); + bdinfo_print_mhz("sccfreq", bd->bi_sccfreq); + bdinfo_print_mhz("brgfreq", bd->bi_brgfreq); +#endif +} diff --git a/arch/riscv/include/asm/u-boot.h b/arch/riscv/include/asm/u-boot.h index 5ba8e77812..d5e1d5f323 100644 --- a/arch/riscv/include/asm/u-boot.h +++ b/arch/riscv/include/asm/u-boot.h @@ -18,25 +18,10 @@ #ifndef _U_BOOT_H_ #define _U_BOOT_H_ 1 +/* Use the generic board which requires a unified bd_info */ +#include <asm-generic/u-boot.h> #include <asm/u-boot-riscv.h> - -typedef struct bd_info { - unsigned long bi_boot_params; /* where this board expects params */ - unsigned long bi_memstart; /* start of DRAM memory */ - unsigned long bi_memsize; /* size of DRAM memory in bytes */ - unsigned long bi_flashstart; /* start of FLASH memory */ - unsigned long bi_flashsize; /* size of FLASH memory */ - unsigned long bi_flashoffset; /* reserved area for startup monitor */ - unsigned char bi_enetaddr[6]; - - struct /* RAM configuration */ - { - unsigned long start; - unsigned long size; - } bi_dram[CONFIG_NR_DRAM_BANKS]; -} bd_t; - /* For image.h:image_check_target_arch() */ #define IH_ARCH_DEFAULT IH_ARCH_RISCV diff --git a/arch/x86/lib/fsp/fsp_graphics.c b/arch/x86/lib/fsp/fsp_graphics.c index 70224c1a48..6e23f3c95f 100644 --- a/arch/x86/lib/fsp/fsp_graphics.c +++ b/arch/x86/lib/fsp/fsp_graphics.c @@ -98,6 +98,7 @@ static int fsp_video_probe(struct udevice *dev) * For IGD, it seems to be always on BAR2. */ vesa->phys_base_ptr = dm_pci_read_bar32(dev, 2); + gd->fb_base = vesa->phys_base_ptr; ret = vbe_setup_video_priv(vesa, uc_priv, plat); if (ret) @@ -106,8 +107,8 @@ static int fsp_video_probe(struct udevice *dev) mtrr_add_request(MTRR_TYPE_WRCOMB, vesa->phys_base_ptr, 256 << 20); mtrr_commit(true); - printf("%dx%dx%d\n", uc_priv->xsize, uc_priv->ysize, - vesa->bits_per_pixel); + printf("%dx%dx%d @ %x\n", uc_priv->xsize, uc_priv->ysize, + vesa->bits_per_pixel, vesa->phys_base_ptr); return 0; |