summaryrefslogtreecommitdiff
path: root/common/board_info.c
AgeCommit message (Collapse)Author
2021-07-14board-info: Call sysinfo_detect() before sysinfo_get_str()Marek Vasut
The sysinfo_get_str() implementation checks whether the sysinfo was even detected. In U-Boot proper, sysinfo_detect() is not called anywhere but on one specific board. Call sysinfo_detect() before sysinfo_get_str() to make sure the sysinfo is detected and sysinfo_get_str() returns valid value instead of -EPERM. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-14board-info: Use sysinfo_get()Marek Vasut
Replace uclass_first_device_err(UCLASS_SYSINFO, &dev) with sysinfo_get(&dev). The board_info code may use sysinfo to print board information, so use the sysinfo functions consistently. The sysinfo_get() is internally implemented as return uclass_first_device_err(UCLASS_SYSINFO, &dev) anyway, so there is no functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-27sysinfo: Allow showing model info from sysinfoSimon Glass
Some boards may want to show the SKU ID or other information obtained at runtime. Allow this to come from sysinfo. The board can then provide a sysinfo driver to provide it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2021-02-02common: Drop asm/global_data.h from common headerSimon Glass
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2020-05-18common: Drop init.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
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-03-05libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>Masahiro Yamada
Thomas reported U-Boot failed to build host tools if libfdt-devel package is installed because tools include libfdt headers from /usr/include/ instead of using internal ones. This commit moves the header code: include/libfdt.h -> include/linux/libfdt.h include/libfdt_env.h -> include/linux/libfdt_env.h and replaces include directives: #include <libfdt.h> -> #include <linux/libfdt.h> #include <libfdt_env.h> -> #include <linux/libfdt_env.h> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-11-28generic-board: make show_board_info a weak functionMarcel Ziswiler
Make show_board_info() a weak function which allows for custom board specific implementations thereof. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2016-11-28Revert "generic-board: allow showing custom board info"Marcel Ziswiler
Drop CONFIG_CUSTOM_BOARDINFO as it is not Kconfig compliant and anyway not really used anywhere plus the upcoming weak show_board_info() approach seems much superior. This reverts commit a9ad18c9d5fe2554753b0f9a52adfd5ebce61147. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2015-08-13generic-board: allow showing custom board infoMarcel Ziswiler
Allow showing custom board info from a checkboard() function being implemented if CONFIG_CUSTOM_BOARDINFO is specified. Previously the device tree model was always displayed not taking any CONFIG_CUSTOM_BOARDINFO into account. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-08-05common: Print nothing in the __weak checkboard()Bin Meng
Do not print confusing "Board: Unknown" during boot. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-07-27generic_board: Call "checkboard" even though the root node has a "model" ↵Haikun.Wang@freescale.com
property In case of enable CONFIG_OF_CONTROL and has a "model" property in the root node, the board special "checkboard" will not be called. Usually we show some useful version information in the function. This patch enable call "checkboard" in any case. It is not conflicting with showing "model" at the same time. For example on LS2085AQDS: Showing "model" only: Model: Freescale Layerscape 2085a QDS Board Showing "checkboard" only: Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4 Showing both: Model: Freescale Layerscape 2085a QDS Board Board: LS2085E-QDS, Board Arch: V1, Board version: B, boot from vBank: 4 Signed-off-by: Haikun Wang <haikun.wang@freescale.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-01-29generic-board: show model name in board_init_f() tooMasahiro Yamada
The common/board_r.c has show_model_r() to display the model name if the DTB has a "model" property. It sounds useful to have a similar function in common/board_f.c too because most of the boards show their board name before relocation. Instead of implementing the same function in both common/board_f.c and common/board_r.c, let's split it up into common/show_board_info.c. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>