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 | |
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.
-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 | ||||
-rw-r--r-- | cmd/bdinfo.c | 446 | ||||
-rw-r--r-- | common/board_r.c | 16 | ||||
-rw-r--r-- | configs/tbs2910_defconfig | 1 | ||||
-rw-r--r-- | drivers/video/video-uclass.c | 1 | ||||
-rw-r--r-- | include/asm-generic/u-boot.h | 18 | ||||
-rw-r--r-- | include/init.h | 9 |
15 files changed, 184 insertions, 486 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; diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index dba552b03f..b7f5f710b4 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -1,34 +1,25 @@ // SPDX-License-Identifier: GPL-2.0+ /* + * Implements the 'bd' command to show board information + * * (C) Copyright 2003 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. */ -/* - * Boot support - */ #include <common.h> #include <command.h> #include <env.h> #include <net.h> #include <vsprintf.h> #include <asm/cache.h> -#include <linux/compiler.h> DECLARE_GLOBAL_DATA_PTR; -__maybe_unused void print_cpu_word_size(void) -{ - printf("%-12s= %u-bit\n", "Build", (uint)sizeof(void *) * 8); -} - -__maybe_unused -static void print_num(const char *name, ulong value) +void bdinfo_print_num(const char *name, ulong value) { printf("%-12s= 0x%0*lx\n", name, 2 * (int)sizeof(value), value); } -__maybe_unused static void print_eth(int idx) { char name[10], *val; @@ -42,139 +33,35 @@ static void print_eth(int idx) printf("%-12s= %s\n", name, val); } -#ifndef CONFIG_DM_ETH -__maybe_unused -static void print_eths(void) -{ - struct eth_device *dev; - int i = 0; - - do { - dev = eth_get_dev_by_index(i); - if (dev) { - printf("eth%dname = %s\n", i, dev->name); - print_eth(i); - i++; - } - } while (dev); - - printf("current eth = %s\n", eth_get_name()); - printf("ip_addr = %s\n", env_get("ipaddr")); -} -#endif - -__maybe_unused static void print_lnum(const char *name, unsigned long long value) { printf("%-12s= 0x%.8llX\n", name, value); } -__maybe_unused -static void print_mhz(const char *name, unsigned long hz) +void bdinfo_print_mhz(const char *name, unsigned long hz) { char buf[32]; printf("%-12s= %6s MHz\n", name, strmhz(buf, hz)); } - -static inline void print_bi_boot_params(const bd_t *bd) -{ - print_num("boot_params", (ulong)bd->bi_boot_params); -} - -static inline void print_bi_mem(const bd_t *bd) -{ -#if defined(CONFIG_SH) - print_num("mem start ", (ulong)bd->bi_memstart); - print_lnum("mem size ", (u64)bd->bi_memsize); -#elif defined(CONFIG_ARC) - print_num("mem start", (ulong)bd->bi_memstart); - print_lnum("mem size", (u64)bd->bi_memsize); -#else - print_num("memstart", (ulong)bd->bi_memstart); - print_lnum("memsize", (u64)bd->bi_memsize); -#endif -} - -static inline void print_bi_dram(const bd_t *bd) +static void print_bi_dram(const bd_t *bd) { #ifdef CONFIG_NR_DRAM_BANKS int i; for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) { if (bd->bi_dram[i].size) { - print_num("DRAM bank", i); - print_num("-> start", bd->bi_dram[i].start); - print_num("-> size", bd->bi_dram[i].size); + bdinfo_print_num("DRAM bank", i); + bdinfo_print_num("-> start", bd->bi_dram[i].start); + bdinfo_print_num("-> size", bd->bi_dram[i].size); } } #endif } -static inline void print_bi_flash(const bd_t *bd) -{ -#if defined(CONFIG_MICROBLAZE) || defined(CONFIG_SH) - print_num("flash start ", (ulong)bd->bi_flashstart); - print_num("flash size ", (ulong)bd->bi_flashsize); - print_num("flash offset ", (ulong)bd->bi_flashoffset); - -#elif defined(CONFIG_NIOS2) - print_num("flash start", (ulong)bd->bi_flashstart); - print_num("flash size", (ulong)bd->bi_flashsize); - print_num("flash offset", (ulong)bd->bi_flashoffset); -#else - print_num("flashstart", (ulong)bd->bi_flashstart); - print_num("flashsize", (ulong)bd->bi_flashsize); - print_num("flashoffset", (ulong)bd->bi_flashoffset); -#endif -} - -static inline void print_eth_ip_addr(void) +__weak void arch_print_bdinfo(void) { -#if defined(CONFIG_CMD_NET) - print_eth(0); -#if defined(CONFIG_HAS_ETH1) - print_eth(1); -#endif -#if defined(CONFIG_HAS_ETH2) - print_eth(2); -#endif -#if defined(CONFIG_HAS_ETH3) - print_eth(3); -#endif -#if defined(CONFIG_HAS_ETH4) - print_eth(4); -#endif -#if defined(CONFIG_HAS_ETH5) - print_eth(5); -#endif - printf("IP addr = %s\n", env_get("ipaddr")); -#endif -} - -static inline void print_baudrate(void) -{ -#if defined(CONFIG_PPC) - printf("baudrate = %6u bps\n", gd->baudrate); -#else - printf("baudrate = %u bps\n", gd->baudrate); -#endif -} - -static inline void __maybe_unused print_std_bdinfo(const bd_t *bd) -{ - print_bi_boot_params(bd); - print_bi_mem(bd); - print_bi_flash(bd); - print_eth_ip_addr(); - print_baudrate(); -} - -#if defined(CONFIG_PPC) -void __weak board_detail(void) -{ - /* Please define board_detail() for your platform */ } int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) @@ -182,312 +69,39 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) bd_t *bd = gd->bd; #ifdef DEBUG - print_num("bd address", (ulong)bd); -#endif - print_bi_mem(bd); - print_bi_flash(bd); - print_num("sramstart", bd->bi_sramstart); - print_num("sramsize", bd->bi_sramsize); -#if defined(CONFIG_MPC8xx) || defined(CONFIG_E500) - print_num("immr_base", bd->bi_immr_base); -#endif - print_num("bootflags", bd->bi_bootflags); -#if defined(CONFIG_CPM2) - print_mhz("vco", bd->bi_vco); - print_mhz("sccfreq", bd->bi_sccfreq); - print_mhz("brgfreq", bd->bi_brgfreq); -#endif - print_mhz("intfreq", bd->bi_intfreq); -#if defined(CONFIG_CPM2) - print_mhz("cpmfreq", bd->bi_cpmfreq); + bdinfo_print_num("bd address", (ulong)bd); #endif - print_mhz("busfreq", bd->bi_busfreq); - -#ifdef CONFIG_ENABLE_36BIT_PHYS -#ifdef CONFIG_PHYS_64BIT - puts("addressing = 36-bit\n"); -#else - puts("addressing = 32-bit\n"); -#endif -#endif - - print_eth_ip_addr(); - print_baudrate(); - print_num("relocaddr", gd->relocaddr); - board_detail(); - print_cpu_word_size(); - - return 0; -} - -#elif defined(CONFIG_NIOS2) - -int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - bd_t *bd = gd->bd; - - print_bi_dram(bd); - print_bi_flash(bd); - -#if defined(CONFIG_SYS_SRAM_BASE) - print_num ("sram start", (ulong)bd->bi_sramstart); - print_num ("sram size", (ulong)bd->bi_sramsize); -#endif - - print_eth_ip_addr(); - print_baudrate(); - print_cpu_word_size(); - - return 0; -} - -#elif defined(CONFIG_MICROBLAZE) - -int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - bd_t *bd = gd->bd; - - print_bi_dram(bd); - print_bi_flash(bd); -#if defined(CONFIG_SYS_SRAM_BASE) - print_num("sram start ", (ulong)bd->bi_sramstart); - print_num("sram size ", (ulong)bd->bi_sramsize); -#endif -#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH) - print_eths(); -#endif - print_baudrate(); - print_num("relocaddr", gd->relocaddr); - print_num("reloc off", gd->reloc_off); - print_num("fdt_blob", (ulong)gd->fdt_blob); - print_num("new_fdt", (ulong)gd->new_fdt); - print_num("fdt_size", (ulong)gd->fdt_size); - print_cpu_word_size(); - - return 0; -} - -#elif defined(CONFIG_M68K) - -int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - bd_t *bd = gd->bd; - - print_bi_mem(bd); - print_bi_flash(bd); -#if defined(CONFIG_SYS_INIT_RAM_ADDR) - print_num("sramstart", (ulong)bd->bi_sramstart); - print_num("sramsize", (ulong)bd->bi_sramsize); -#endif -#if defined(CONFIG_SYS_MBAR) - print_num("mbar", bd->bi_mbar_base); -#endif - print_mhz("cpufreq", bd->bi_intfreq); - print_mhz("busfreq", bd->bi_busfreq); -#ifdef CONFIG_PCI - print_mhz("pcifreq", bd->bi_pcifreq); -#endif -#ifdef CONFIG_EXTRA_CLOCK - print_mhz("flbfreq", bd->bi_flbfreq); - print_mhz("inpfreq", bd->bi_inpfreq); - print_mhz("vcofreq", bd->bi_vcofreq); -#endif - print_eth_ip_addr(); - print_baudrate(); - print_cpu_word_size(); - - return 0; -} - -#elif defined(CONFIG_MIPS) - -int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - print_std_bdinfo(gd->bd); - print_num("relocaddr", gd->relocaddr); - print_num("reloc off", gd->reloc_off); - print_cpu_word_size(); - - return 0; -} - -#elif defined(CONFIG_ARM) - -static int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - bd_t *bd = gd->bd; - - print_num("arch_number", bd->bi_arch_number); - print_bi_boot_params(bd); + bdinfo_print_num("boot_params", (ulong)bd->bi_boot_params); print_bi_dram(bd); - -#ifdef CONFIG_SYS_MEM_RESERVE_SECURE - if (gd->arch.secure_ram & MEM_RESERVE_SECURE_SECURED) { - print_num("Secure ram", - gd->arch.secure_ram & MEM_RESERVE_SECURE_ADDR_MASK); + bdinfo_print_num("memstart", (ulong)bd->bi_memstart); + print_lnum("memsize", (u64)bd->bi_memsize); + bdinfo_print_num("flashstart", (ulong)bd->bi_flashstart); + bdinfo_print_num("flashsize", (ulong)bd->bi_flashsize); + bdinfo_print_num("flashoffset", (ulong)bd->bi_flashoffset); + printf("baudrate = %u bps\n", gd->baudrate); + bdinfo_print_num("relocaddr", gd->relocaddr); + bdinfo_print_num("reloc off", gd->reloc_off); + printf("%-12s= %u-bit\n", "Build", (uint)sizeof(void *) * 8); + if (IS_ENABLED(CONFIG_CMD_NET)) { + printf("current eth = %s\n", eth_get_name()); + print_eth(0); + printf("IP addr = %s\n", env_get("ipaddr")); } -#endif -#ifdef CONFIG_RESV_RAM - if (gd->arch.resv_ram) - print_num("Reserved ram", gd->arch.resv_ram); -#endif -#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH) - print_eths(); -#endif - print_baudrate(); -#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF)) - print_num("TLB addr", gd->arch.tlb_addr); -#endif - print_num("relocaddr", gd->relocaddr); - print_num("reloc off", gd->reloc_off); - print_num("irq_sp", gd->irq_sp); /* irq stack pointer */ - print_num("sp start ", gd->start_addr_sp); + bdinfo_print_num("fdt_blob", (ulong)gd->fdt_blob); + bdinfo_print_num("new_fdt", (ulong)gd->new_fdt); + bdinfo_print_num("fdt_size", (ulong)gd->fdt_size); #if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO) - print_num("FB base ", gd->fb_base); -#endif - /* - * 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", gd->bd->bi_arm_freq); - printf("DSP frequency = %ld MHz\n", gd->bd->bi_dsp_freq); - printf("DDR frequency = %ld MHz\n", gd->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)); + bdinfo_print_num("FB base ", gd->fb_base); #endif #if CONFIG_IS_ENABLED(MULTI_DTB_FIT) - print_num("multi_dtb_fit", (ulong)gd->multi_dtb_fit); -#endif - if (gd->fdt_blob) - print_num("fdt_blob", (ulong)gd->fdt_blob); - print_cpu_word_size(); - - return 0; -} - -#elif defined(CONFIG_SH) - -int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - bd_t *bd = gd->bd; - - print_bi_mem(bd); - print_bi_flash(bd); - print_eth_ip_addr(); - print_baudrate(); - print_cpu_word_size(); - - return 0; -} - -#elif defined(CONFIG_X86) - -int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - bd_t *bd = gd->bd; - - print_bi_boot_params(bd); - - print_bi_dram(bd); - - print_num("relocaddr", gd->relocaddr); - print_num("reloc off", gd->reloc_off); -#if defined(CONFIG_CMD_NET) - print_eth_ip_addr(); - print_mhz("ethspeed", bd->bi_ethspeed); -#endif - print_baudrate(); - print_cpu_word_size(); - - return 0; -} - -#elif defined(CONFIG_SANDBOX) - -int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - bd_t *bd = gd->bd; - - print_bi_boot_params(bd); - print_bi_dram(bd); - print_eth_ip_addr(); - -#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) - print_num("FB base ", gd->fb_base); + bdinfo_print_num("multi_dtb_fit", (ulong)gd->multi_dtb_fit); #endif - print_cpu_word_size(); - - return 0; -} - -#elif defined(CONFIG_NDS32) - -int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - bd_t *bd = gd->bd; - - print_num("arch_number", bd->bi_arch_number); - print_bi_boot_params(bd); - print_bi_dram(bd); - print_eth_ip_addr(); - print_baudrate(); - print_cpu_word_size(); - - return 0; -} - -#elif defined(CONFIG_RISCV) -int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - bd_t *bd = gd->bd; - - print_bi_boot_params(bd); - print_bi_dram(bd); - print_num("relocaddr", gd->relocaddr); - print_num("reloc off", gd->reloc_off); - print_eth_ip_addr(); - print_baudrate(); - print_cpu_word_size(); + arch_print_bdinfo(); return 0; } -#elif defined(CONFIG_ARC) - -int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - bd_t *bd = gd->bd; - - print_bi_mem(bd); - print_eth_ip_addr(); - print_baudrate(); - print_cpu_word_size(); - - return 0; -} - -#elif defined(CONFIG_XTENSA) - -int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -{ - print_std_bdinfo(gd->bd); - return 0; -} - -#else - #error "a case for this architecture does not exist!" -#endif - -/* -------------------------------------------------------------------- */ - U_BOOT_CMD( bdinfo, 1, 1, do_bdinfo, "print Board Info structure", diff --git a/common/board_r.c b/common/board_r.c index fa57fa9b69..5e924322b2 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -537,21 +537,7 @@ static int initr_ethaddr(void) /* kept around for legacy kernels only ... ignore the next section */ eth_env_get_enetaddr("ethaddr", bd->bi_enetaddr); -#ifdef CONFIG_HAS_ETH1 - eth_env_get_enetaddr("eth1addr", bd->bi_enet1addr); -#endif -#ifdef CONFIG_HAS_ETH2 - eth_env_get_enetaddr("eth2addr", bd->bi_enet2addr); -#endif -#ifdef CONFIG_HAS_ETH3 - eth_env_get_enetaddr("eth3addr", bd->bi_enet3addr); -#endif -#ifdef CONFIG_HAS_ETH4 - eth_env_get_enetaddr("eth4addr", bd->bi_enet4addr); -#endif -#ifdef CONFIG_HAS_ETH5 - eth_env_get_enetaddr("eth5addr", bd->bi_enet5addr); -#endif + return 0; } #endif /* CONFIG_CMD_NET */ diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig index 27080c75ef..62d606bb03 100644 --- a/configs/tbs2910_defconfig +++ b/configs/tbs2910_defconfig @@ -22,6 +22,7 @@ CONFIG_BOUNCE_BUFFER=y CONFIG_BOARD_EARLY_INIT_F=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="Matrix U-Boot> " +# CONFIG_CMD_BDI is not set CONFIG_CMD_BOOTZ=y # CONFIG_BOOTM_PLAN9 is not set # CONFIG_BOOTM_RTEMS is not set diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index bf396d1091..1f2874554a 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -84,6 +84,7 @@ int video_reserve(ulong *addrp) __func__, size, *addrp, dev->name); } gd->video_bottom = *addrp; + gd->fb_base = *addrp; debug("Video frame buffers from %lx to %lx\n", gd->video_bottom, gd->video_top); diff --git a/include/asm-generic/u-boot.h b/include/asm-generic/u-boot.h index 6f749736f1..008ebf3ca3 100644 --- a/include/asm-generic/u-boot.h +++ b/include/asm-generic/u-boot.h @@ -61,7 +61,6 @@ typedef struct bd_info { unsigned long bi_vco; /* VCO Out from PLL, in MHz */ #endif #if defined(CONFIG_M68K) - unsigned long bi_ipbfreq; /* IPB Bus Freq, in MHz */ unsigned long bi_pcifreq; /* PCI Bus Freq, in MHz */ #endif #if defined(CONFIG_EXTRA_CLOCK) @@ -69,23 +68,6 @@ typedef struct bd_info { unsigned long bi_vcofreq; /* vco Freq in MHz */ unsigned long bi_flbfreq; /* Flexbus Freq in MHz */ #endif - -#ifdef CONFIG_HAS_ETH1 - unsigned char bi_enet1addr[6]; /* OLD: see README.enetaddr */ -#endif -#ifdef CONFIG_HAS_ETH2 - unsigned char bi_enet2addr[6]; /* OLD: see README.enetaddr */ -#endif -#ifdef CONFIG_HAS_ETH3 - unsigned char bi_enet3addr[6]; /* OLD: see README.enetaddr */ -#endif -#ifdef CONFIG_HAS_ETH4 - unsigned char bi_enet4addr[6]; /* OLD: see README.enetaddr */ -#endif -#ifdef CONFIG_HAS_ETH5 - unsigned char bi_enet5addr[6]; /* OLD: see README.enetaddr */ -#endif - ulong bi_arch_number; /* unique id for this board */ ulong bi_boot_params; /* where this board expects params */ #ifdef CONFIG_NR_DRAM_BANKS diff --git a/include/init.h b/include/init.h index b5a167b6ed..e727031514 100644 --- a/include/init.h +++ b/include/init.h @@ -261,6 +261,15 @@ void relocate_code(ulong start_addr_sp, struct global_data *new_gd, __attribute__ ((noreturn)); #endif +/* Print a numeric value (for use in arch_print_bdinfo()) */ +void bdinfo_print_num(const char *name, ulong value); + +/* Print a clock speed in MHz */ +void bdinfo_print_mhz(const char *name, unsigned long hz); + +/* Show arch-specific information for the 'bd' command */ +void arch_print_bdinfo(void); + #endif /* __ASSEMBLY__ */ /* Put only stuff here that the assembler can digest */ |