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 /test | |
parent | a40f890bdb01c54745274a939cd23942d92648ab (diff) | |
download | u-boot-3a8ee3df836614b68881f5b84d3197305ee1b08e.tar.gz |
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 'test')
-rw-r--r-- | test/dm/Makefile | 2 | ||||
-rw-r--r-- | test/dm/board.c | 59 | ||||
-rw-r--r-- | test/dm/sysinfo.c | 59 |
3 files changed, 60 insertions, 60 deletions
diff --git a/test/dm/Makefile b/test/dm/Makefile index 57e13ad533..46e076ed09 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -21,7 +21,6 @@ obj-$(CONFIG_ACPIGEN) += acpigen.o obj-$(CONFIG_ACPIGEN) += acpi_dp.o obj-$(CONFIG_SOUND) += audio.o obj-$(CONFIG_BLK) += blk.o -obj-$(CONFIG_BOARD) += board.o obj-$(CONFIG_BUTTON) += button.o obj-$(CONFIG_DM_BOOTCOUNT) += bootcount.o obj-$(CONFIG_CLK) += clk.o clk_ccf.o @@ -78,6 +77,7 @@ obj-$(CONFIG_DM_SERIAL) += serial.o obj-$(CONFIG_CPU) += cpu.o obj-$(CONFIG_SOC_DEVICE) += soc.o obj-$(CONFIG_SOUND) += sound.o +obj-$(CONFIG_SYSINFO) += sysinfo.o obj-$(CONFIG_TEE) += tee.o obj-$(CONFIG_VIRTIO_SANDBOX) += virtio.o obj-$(CONFIG_DMA) += dma.o diff --git a/test/dm/board.c b/test/dm/board.c deleted file mode 100644 index f3e7f63f25..0000000000 --- a/test/dm/board.c +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2018 - * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc - */ - -#include <common.h> -#include <dm.h> -#include <log.h> -#include <dm/test.h> -#include <board.h> -#include <test/test.h> -#include <test/ut.h> - -#include "../../drivers/board/sandbox.h" - -static int dm_test_board(struct unit_test_state *uts) -{ - struct udevice *board; - bool called_detect; - char str[64]; - int i; - - board_get(&board); - ut_assert(board); - - board_get_bool(board, BOOL_CALLED_DETECT, &called_detect); - ut_assert(!called_detect); - - board_detect(board); - - board_get_bool(board, BOOL_CALLED_DETECT, &called_detect); - ut_assert(called_detect); - - board_get_str(board, STR_VACATIONSPOT, sizeof(str), str); - ut_assertok(strcmp(str, "R'lyeh")); - - board_get_int(board, INT_TEST1, &i); - ut_asserteq(0, i); - - board_get_int(board, INT_TEST2, &i); - ut_asserteq(100, i); - - board_get_str(board, STR_VACATIONSPOT, sizeof(str), str); - ut_assertok(strcmp(str, "Carcosa")); - - board_get_int(board, INT_TEST1, &i); - ut_asserteq(1, i); - - board_get_int(board, INT_TEST2, &i); - ut_asserteq(99, i); - - board_get_str(board, STR_VACATIONSPOT, sizeof(str), str); - ut_assertok(strcmp(str, "Yuggoth")); - - return 0; -} - -DM_TEST(dm_test_board, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); diff --git a/test/dm/sysinfo.c b/test/dm/sysinfo.c new file mode 100644 index 0000000000..4aaa9e85bc --- /dev/null +++ b/test/dm/sysinfo.c @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2018 + * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc + */ + +#include <common.h> +#include <dm.h> +#include <log.h> +#include <dm/test.h> +#include <sysinfo.h> +#include <test/test.h> +#include <test/ut.h> + +#include "../../drivers/sysinfo/sandbox.h" + +static int dm_test_sysinfo(struct unit_test_state *uts) +{ + struct udevice *sysinfo; + bool called_detect; + char str[64]; + int i; + + ut_assertok(sysinfo_get(&sysinfo)); + ut_assert(sysinfo); + + sysinfo_get_bool(sysinfo, BOOL_CALLED_DETECT, &called_detect); + ut_assert(!called_detect); + + sysinfo_detect(sysinfo); + + sysinfo_get_bool(sysinfo, BOOL_CALLED_DETECT, &called_detect); + ut_assert(called_detect); + + sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), str); + ut_assertok(strcmp(str, "R'lyeh")); + + sysinfo_get_int(sysinfo, INT_TEST1, &i); + ut_asserteq(0, i); + + sysinfo_get_int(sysinfo, INT_TEST2, &i); + ut_asserteq(100, i); + + sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), str); + ut_assertok(strcmp(str, "Carcosa")); + + sysinfo_get_int(sysinfo, INT_TEST1, &i); + ut_asserteq(1, i); + + sysinfo_get_int(sysinfo, INT_TEST2, &i); + ut_asserteq(99, i); + + sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), str); + ut_assertok(strcmp(str, "Yuggoth")); + + return 0; +} + +DM_TEST(dm_test_sysinfo, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); |