diff options
author | Simon Glass <sjg@chromium.org> | 2020-11-05 06:32:05 -0700 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2020-11-06 10:18:20 +0800 |
commit | 3a8ee3df836614b68881f5b84d3197305ee1b08e (patch) | |
tree | ff5e90586913588eb3dcb8babb01cd2893a8644a /board | |
parent | a40f890bdb01c54745274a939cd23942d92648ab (diff) | |
download | u-boot-3a8ee3df836614b68881f5b84d3197305ee1b08e.tar.gz u-boot-3a8ee3df836614b68881f5b84d3197305ee1b08e.tar.bz2 u-boot-3a8ee3df836614b68881f5b84d3197305ee1b08e.zip |
board: Rename uclass to sysinfo
This uclass is intended to provide a way to obtain information about a
U-Boot board. But the concept of a U-Boot 'board' is the whole system,
not just one circuit board, meaning that 'board' is something of a
misnomer for this uclass.
In addition, the name 'board' is a bit overused in U-Boot and we want to
use the same uclass to provide SMBIOS information.
The obvious name is 'system' but that is so vague as to be meaningless.
Use 'sysinfo' instead, since this uclass is aimed at providing information
on the system.
Rename everything accordingly.
Note: Due to the patch delta caused by the symbol renames, this patch
shows some renamed files as being deleted in one place and created in
another.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/gdsys/common/cmd_ioloop.c | 12 | ||||
-rw-r--r-- | board/gdsys/mpc8308/gazerbeam.c | 47 | ||||
-rw-r--r-- | board/google/chromebook_coral/coral.c | 2 |
3 files changed, 33 insertions, 28 deletions
diff --git a/board/gdsys/common/cmd_ioloop.c b/board/gdsys/common/cmd_ioloop.c index 3ea2bec8eb..658756d984 100644 --- a/board/gdsys/common/cmd_ioloop.c +++ b/board/gdsys/common/cmd_ioloop.c @@ -16,7 +16,7 @@ #include <dm.h> #include <misc.h> #include <regmap.h> -#include <board.h> +#include <sysinfo.h> #include "../../../drivers/misc/gdsys_soc.h" #include "../../../drivers/misc/gdsys_ioep.h" @@ -506,11 +506,11 @@ int do_ioloop(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) int do_iodev(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct udevice *ioep = NULL; - struct udevice *board; + struct udevice *sysinfo; char name[8]; int ret; - if (board_get(&board)) + if (sysinfo_get(&sysinfo)) return CMD_RET_FAILURE; if (argc > 1) { @@ -518,7 +518,8 @@ int do_iodev(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) snprintf(name, sizeof(name), "ioep%d", i); - ret = uclass_get_device_by_phandle(UCLASS_MISC, board, name, &ioep); + ret = uclass_get_device_by_phandle(UCLASS_MISC, sysinfo, name, + &ioep); if (ret || !ioep) { printf("Invalid IOEP %d\n", i); @@ -532,7 +533,8 @@ int do_iodev(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) while (1) { snprintf(name, sizeof(name), "ioep%d", i); - ret = uclass_get_device_by_phandle(UCLASS_MISC, board, name, &ioep); + ret = uclass_get_device_by_phandle(UCLASS_MISC, sysinfo, + name, &ioep); if (ret || !ioep) break; diff --git a/board/gdsys/mpc8308/gazerbeam.c b/board/gdsys/mpc8308/gazerbeam.c index c317260251..0e7fa1e333 100644 --- a/board/gdsys/mpc8308/gazerbeam.c +++ b/board/gdsys/mpc8308/gazerbeam.c @@ -6,7 +6,6 @@ */ #include <common.h> -#include <board.h> #include <command.h> #include <dm.h> #include <env.h> @@ -15,11 +14,12 @@ #include <init.h> #include <miiphy.h> #include <misc.h> +#include <sysinfo.h> #include <tpm-v1.h> #include <video_osd.h> #include "../common/ihs_mdio.h" -#include "../../../drivers/board/gazerbeam.h" +#include "../../../drivers/sysinfo/gazerbeam.h" DECLARE_GLOBAL_DATA_PTR; @@ -43,22 +43,22 @@ static int get_tpm(struct udevice **devp) int board_early_init_r(void) { - struct udevice *board; + struct udevice *sysinfo; struct udevice *serdes; int mc = 0; int con = 0; - if (board_get(&board)) - puts("Could not find board information device.\n"); + if (sysinfo_get(&sysinfo)) + puts("Could not find sysinfo information device.\n"); /* Initialize serdes */ - uclass_get_device_by_phandle(UCLASS_MISC, board, "serdes", &serdes); + uclass_get_device_by_phandle(UCLASS_MISC, sysinfo, "serdes", &serdes); - if (board_detect(board)) + if (sysinfo_detect(sysinfo)) puts("Device information detection failed.\n"); - board_get_int(board, BOARD_MULTICHANNEL, &mc); - board_get_int(board, BOARD_VARIANT, &con); + sysinfo_get_int(sysinfo, BOARD_MULTICHANNEL, &mc); + sysinfo_get_int(sysinfo, BOARD_VARIANT, &con); if (mc == 2 || mc == 1) dev_disable_by_path("/immr@e0000000/i2c@3100/pca9698@22"); @@ -84,18 +84,18 @@ int board_early_init_r(void) return 0; } -int checkboard(void) +int checksysinfo(void) { - struct udevice *board; + struct udevice *sysinfo; char *s = env_get("serial#"); int mc = 0; int con = 0; - if (board_get(&board)) - puts("Could not find board information device.\n"); + if (sysinfo_get(&sysinfo)) + puts("Could not find sysinfo information device.\n"); - board_get_int(board, BOARD_MULTICHANNEL, &mc); - board_get_int(board, BOARD_VARIANT, &con); + sysinfo_get_int(sysinfo, BOARD_MULTICHANNEL, &mc); + sysinfo_get_int(sysinfo, BOARD_VARIANT, &con); puts("Board: Gazerbeam "); printf("%s ", mc == 4 ? "MC4" : mc == 2 ? "MC2" : "SC"); @@ -123,20 +123,22 @@ int last_stage_init(void) { int fpga_hw_rev = 0; int i; - struct udevice *board; + struct udevice *sysinfo; struct udevice *osd; struct video_osd_info osd_info; struct udevice *tpm; int ret; - if (board_get(&board)) - puts("Could not find board information device.\n"); + if (sysinfo_get(&sysinfo)) + puts("Could not find sysinfo information device.\n"); - if (board) { - int res = board_get_int(board, BOARD_HWVERSION, &fpga_hw_rev); + if (sysinfo) { + int res = sysinfo_get_int(sysinfo, BOARD_HWVERSION, + &fpga_hw_rev); if (res) - printf("Could not determind FPGA HW revision (res = %d)\n", res); + printf("Could not determind FPGA HW revision (res = %d)\n", + res); } env_set_ulong("fpga_hw_rev", fpga_hw_rev); @@ -154,7 +156,8 @@ int last_stage_init(void) snprintf(name, sizeof(name), "rxaui%d", i); /* Disable RXAUI polarity inversion */ - ret = uclass_get_device_by_phandle(UCLASS_MISC, board, name, &rxaui); + ret = uclass_get_device_by_phandle(UCLASS_MISC, sysinfo, + name, &rxaui); if (!ret) misc_set_enabled(rxaui, false); } diff --git a/board/google/chromebook_coral/coral.c b/board/google/chromebook_coral/coral.c index f5ae48290f..b8b923c139 100644 --- a/board/google/chromebook_coral/coral.c +++ b/board/google/chromebook_coral/coral.c @@ -150,7 +150,7 @@ static const struct udevice_id coral_ids[] = { U_BOOT_DRIVER(coral_drv) = { .name = "coral", - .id = UCLASS_BOARD, + .id = UCLASS_SYSINFO, .of_match = coral_ids, ACPI_OPS_PTR(&coral_acpi_ops) }; |