summaryrefslogtreecommitdiff
path: root/cmd/bdinfo.c
AgeCommit message (Collapse)AuthorFilesLines
2020-07-17treewide: convert bd_t to struct bd_info by coccinelleMasahiro Yamada1-2/+2
The Linux coding style guide (Documentation/process/coding-style.rst) clearly says: It's a **mistake** to use typedef for structures and pointers. Besides, using typedef for structures is annoying when you try to make headers self-contained. Let's say you have the following function declaration in a header: void foo(bd_t *bd); This is not self-contained since bd_t is not defined. To tell the compiler what 'bd_t' is, you need to include <asm/u-boot.h> #include <asm/u-boot.h> void foo(bd_t *bd); Then, the include direcective pulls in more bloat needlessly. If you use 'struct bd_info' instead, it is enough to put a forward declaration as follows: struct bd_info; void foo(struct bd_info *bd); Right, typedef'ing bd_t is a mistake. I used coccinelle to generate this commit. The semantic patch that makes this change is as follows: <smpl> @@ typedef bd_t; @@ -bd_t +struct bd_info </smpl> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-25bdinfo: Update the file commentsSimon Glass1-6/+2
Update the comment at the top of the file to indicate what this file does. Also drop the line at the bottom and an unnecessary header include. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: m68k: ppc: Move arch-specific code from bdinfoSimon Glass1-8/+0
We don't have an easy way to share these three lines of code with two architectures. We also want to make it clear that this code is actually arch-specific. So just duplicate it in each arch-specific file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-06-25bdinfo: m68k: Move m68k-specific info into its own fileSimon Glass1-15/+0
We don't really want to have m68k-specific code in a generic file. Create a new arch-specific function to hold it, and move it into that. Make the function weak so that any arch can implement it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Angelo Dureghello <angelo.dureghello@timesys.com> Tested-by: Angelo Dureghello <angelo.dureghello@timesys.com>
2020-06-25bdinfo: ppc: Move PPC-specific info into its own fileSimon Glass1-27/+0
We don't really want to have PPC-specific code in a generic file. Create a new arch-specific function to hold it, and move it into that. Make the function weak so that any arch can implement it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-06-25bdinfo: arm: Move ARM-specific info into its own fileSimon Glass1-38/+7
We don't really want to have ARM-specific code in a generic file. Create a new arch-specific function to hold it, and move it into that. Make the function weak so that any arch can implement it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: Export some basic printing functionsSimon Glass1-39/+39
At present the functions to print a number and a frequency are static. We want to move some of the code in here to an arch-specific file. For consistency that code should use these same functions. So export them with an appropriate name. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: net: Inline print_eth_ip_addr()Simon Glass1-11/+4
This function only has two lines of code now, so inline it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: net: Drop legacy ethernet bdinfoSimon Glass1-24/+2
This code pre-dates driver model and the migration date is nearly upon us. Pare the print_eths() function down and enable it for driver model, since it works correctly. The IP address is already printed in print_eth_ip_addr() so we can remove that. Since this results in a one-line print_eths() function, inline it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: net: ppc: Drop prints for CONFIG_HAS_ETHnSimon Glass1-15/+0
These config options have not been migrated to Kconfig. This should be handled using driver model, iterating over the available Ethernet devices. For now, remove the code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-06-25bdinfo: Drop print_cpu_word_size()Simon Glass1-6/+1
This function only has one line of code in it so inline it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: Drop print_bi_flash()Simon Glass1-8/+3
This function only has three lines of code in it so inline it. This helps to put all the code in one place for future partitioning. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: Drop print_bi_boot_params()Simon Glass1-7/+1
This function only has one line of code in it so inline it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: sh: arc: Drop arch-specific print_bi_mem()Simon Glass1-15/+2
It isn't worth having arch-specific code for such minor output differences. In fact it is better if all archs are consistent. Drop the arch-specific code in print_bi_mem() and inline it to avoid a two-line function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
2020-06-25bdinfo: ppc: Drop arch-specific print_baudrate()Simon Glass1-10/+1
This function outputs the same basic info. Since the baud rate is commonly 115200 these is often no difference. Drop the arch-specific code and inline it to avoid a one-line function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-06-25bdinfo: Drop print_std_bdinfo()Simon Glass1-10/+5
Everything in this function is standard now so it serves no purpose. Move it into the generic do_bdinfo() function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: Drop unnecessary inline on functionsSimon Glass1-7/+7
This serves no purpose since the compiler will inline the functions automatically. Drop use of inline in this file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: microblaze: sh: nios2: Drop arch-specific flash infoSimon Glass1-14/+3
The differences these architectures have are minor and not worth the extra code. Use the generic version always. Tidy up the code style by removing unnecessary tabs. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: Drop unused __maybe_unusedSimon Glass1-5/+2
Some of these are not needed now. Drop them to avoid cluttering the code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: Drop the option to not use the generic 'bd' commandSimon Glass1-59/+0
Now that all architectures are using the generic do_bdinfo(), drop the option to not use it. When new architectures are added, they will get at least some useful information from the generic implementation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: arc: Use the generic bd commandSimon Glass1-11/+1
There is nothing new in the arc 'bd' command beyond what is already there. Switch it over to use the generic code. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Alexey Brodkin <abrodkin@synopsys.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: arm: Use the generic bd commandSimon Glass1-58/+44
Unfortunately ARM has a lot of special stuff. Move it into the generic function for now, so we can have it all in one place. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: m68k: Use the generic bd commandSimon Glass1-30/+19
Unfortunately m68k has a lot of special stuff. Move it into the generic function for now, so we can have it all in one place. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: powerpc: Use the generic bd commandSimon Glass1-48/+41
Unfortunately PowerPC has a lot of special stuff. Move it into the generic function for now, so we can have it all in one place. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: riscv: Use the generic bd commandSimon Glass1-14/+1
This arch has none of its own info to show. Move it over to use the generic do_bdinfo(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Rick Chen <rick@andestech.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: nds32: Use the generic bd commandSimon Glass1-13/+1
This arch has none of its own info to show. Move it over to use the generic do_bdinfo(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Rick Chen <rick@andestech.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: sandbox: Use the generic bd commandSimon Glass1-15/+1
Sandbox has a printout of 'FB base' but this code is not used since sandbox uses driver model for everything. Move sandbox over to use the generic do_bdinfo(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: x86: Use the generic bd commandSimon Glass1-19/+2
This arch shows 'ethspeed' info but only the freescale drivers use it, so it can be dropped. It also calls print_bi_dram() which is safe to call from any arch since it has an #ifdef inside it. Add this to the generic do_bdinfo() and move x86 over to use it. Put it first since pytests rely on seeing it before memstart in find_ram_base(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: sh: Use the generic bd commandSimon Glass1-12/+1
This arch has no code that is not already in the generic function. Drop the arch-specific function and change sh over to use the generic one. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: microblaze: Use the generic bd commandSimon Glass1-23/+7
Microblaze prints out ethernet and FDT information. This is useful to most archs, so move it into the generic code and move microblaze over to use it. Note that FDT information is shown for all boards, since they should be using device tree by now. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: nios2: Use the generic bd commandSimon Glass1-18/+1
Nios2 currently has some code to output SRAM information which is behind an #ifdef. No nios2 boards define this option, so the code can be removed. Move Nios2 over to use the generic function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: mips: Use the generic bd commandSimon Glass1-9/+4
MIPS currently has a few extra things which are generally useful. Add them to the generic function and move MIPS over to use it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2020-06-25bdinfo: xtensa: Create a generic do_bdinfo for xtensaSimon Glass1-3/+9
This arch uses only the generic function. It would be nice if all the archs did the same. As a first step, create a new generic function for the 'bd' command and make xtensa use it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-05-19command: Remove the cmd_tbl_t typedefSimon Glass1-14/+14
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-19common: Drop net.h from common headerSimon Glass1-0/+2
Move this header out of the common header. Network support is used in quite a few places but it still does not warrant blanket inclusion. Note that this net.h header itself has quite a lot in it. It could be split into the driver-mode support, functions, structures, checksumming, etc. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-04cmd: Add an indication of 32/64-bit to bdinfoSimon Glass1-0/+20
It is useful to know what mode U-Boot is running in. Add a message at the end of the 'bdinfo' output. Suggested-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: change commit tag to 'cmd' as this is not x86 specific] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2020-01-07bdinfo: show multi_dtb_fitHeiko Schocher1-0/+3
if MULTI_DTB_FIT is enabled it is helpful to display the value of gd->multi_dtb_fit in bdinfo. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-12-03Move strtomhz() to vsprintf.hSimon Glass1-0/+1
At present this function sits in its own file but it does not really justify it. There are similar string functions in vsprintf.h, so move it there. Also add the missing function comment. Use the vsprintf.h include file explicitly where needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-08-11env: Move env_get() to env.hSimon Glass1-0/+1
Move env_get() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-30bdinfo: show fb base with DM_VIDEOHeiko Schocher1-1/+1
show Framebuffer base with CONFIG_DM_VIDEO enabled. Signed-off-by: Heiko Schocher <hs@denx.de>
2019-05-18CONFIG_SPL_SYS_[DI]CACHE_OFF: addTrevor Woerner1-1/+1
While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances where these configuration items are conditional on SPL. This commit adds SPL variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates the configurations as required. Acked-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Trevor Woerner <trevor@toganlabs.com> [trini: Make the default depend on the setting for full U-Boot, update more zynq hardware] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-11-16cmd/bdinfo: correct output of numerical valuesHeinrich Schuchardt1-2/+2
Display all digits on 64bit systems. Currently we print only the lower 32 bits. Examples of values that can exceed 32 bits are the size and start of memory banks. For fdt_blob use the same output method as for other values. This avoids misalignment. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2018-10-03riscv: cmd: bdinfo: Print the relocation addressBin Meng1-0/+2
Add printing of U-Boot relocation address. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
2018-10-03riscv: Remove mach typeBin Meng1-1/+0
Since the mach_id is not used by RISC-V, remove it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-06powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xxChristophe Leroy1-1/+1
CONFIG_8xx doesn't mean much outside of arch/powerpc/ This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ... It also renames 8xx_immap.h to immap_8xx.h to be consistent with other file names. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
2018-01-30cmd/bdinfo: print relocation info on X86Heinrich Schuchardt1-0/+2
For debugging U-Boot in qemu-x86 the relocation address is needed. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2018-01-12riscv: Modify generic codes to support RISC-VRick Chen1-0/+15
Support common commands bdinfo and image format, also modify common generic flow for RISC-V. Signed-off-by: Rick Chen <rick@andestech.com> Signed-off-by: Rick Chen <rickchen36@gmail.com> Signed-off-by: Greentime Hu <green.hu@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass1-3/+3
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-13cmd/bdinfo: correct comment in board_detailChris Packham1-1/+1
This appears to be a simple typo that dates back to the original implementation of board_detail in commit e79394643b26 ("common: Update cmd_bdinfo for PPC"). Signed-off-by: Chris Packham <judge.packham@gmail.com>