summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/Kconfig4
-rw-r--r--drivers/Makefile2
-rw-r--r--drivers/board/board-uclass.c71
-rw-r--r--drivers/sysinfo/Kconfig (renamed from drivers/board/Kconfig)16
-rw-r--r--drivers/sysinfo/Makefile (renamed from drivers/board/Makefile)6
-rw-r--r--drivers/sysinfo/gazerbeam.c (renamed from drivers/board/gazerbeam.c)74
-rw-r--r--drivers/sysinfo/gazerbeam.h (renamed from drivers/board/gazerbeam.h)0
-rw-r--r--drivers/sysinfo/sandbox.c (renamed from drivers/board/sandbox.c)50
-rw-r--r--drivers/sysinfo/sandbox.h (renamed from drivers/board/sandbox.h)0
-rw-r--r--drivers/sysinfo/sysinfo-uclass.c71
-rw-r--r--drivers/timer/mpc83xx_timer.c10
11 files changed, 152 insertions, 152 deletions
diff --git a/drivers/Kconfig b/drivers/Kconfig
index ed8a39c994..b1ada1cb7f 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -30,8 +30,6 @@ source "drivers/ddr/Kconfig"
source "drivers/demo/Kconfig"
-source "drivers/board/Kconfig"
-
source "drivers/ddr/fsl/Kconfig"
source "drivers/dfu/Kconfig"
@@ -114,6 +112,8 @@ source "drivers/spi/Kconfig"
source "drivers/spmi/Kconfig"
+source "drivers/sysinfo/Kconfig"
+
source "drivers/sysreset/Kconfig"
source "drivers/tee/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index 33f1d536cd..e371bc32bb 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -27,9 +27,9 @@ obj-$(CONFIG_$(SPL_TPL_)TIMER) += timer/
obj-$(CONFIG_$(SPL_TPL_)VIRTIO) += virtio/
obj-$(CONFIG_$(SPL_)DM_MAILBOX) += mailbox/
obj-$(CONFIG_$(SPL_)REMOTEPROC) += remoteproc/
+obj-$(CONFIG_$(SPL_)SYSINFO) += sysinfo/
obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm/
obj-$(CONFIG_$(SPL_TPL_)ACPI_PMC) += power/acpi_pmc/
-obj-$(CONFIG_$(SPL_)BOARD) += board/
obj-$(CONFIG_XEN) += xen/
obj-$(CONFIG_$(SPL_)FPGA) += fpga/
diff --git a/drivers/board/board-uclass.c b/drivers/board/board-uclass.c
deleted file mode 100644
index b5485e9895..0000000000
--- a/drivers/board/board-uclass.c
+++ /dev/null
@@ -1,71 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2017
- * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
- */
-
-#include <common.h>
-#include <dm.h>
-#include <board.h>
-
-int board_get(struct udevice **devp)
-{
- return uclass_first_device_err(UCLASS_BOARD, devp);
-}
-
-int board_detect(struct udevice *dev)
-{
- struct board_ops *ops = board_get_ops(dev);
-
- if (!ops->detect)
- return -ENOSYS;
-
- return ops->detect(dev);
-}
-
-int board_get_fit_loadable(struct udevice *dev, int index,
- const char *type, const char **strp)
-{
- struct board_ops *ops = board_get_ops(dev);
-
- if (!ops->get_fit_loadable)
- return -ENOSYS;
-
- return ops->get_fit_loadable(dev, index, type, strp);
-}
-
-int board_get_bool(struct udevice *dev, int id, bool *val)
-{
- struct board_ops *ops = board_get_ops(dev);
-
- if (!ops->get_bool)
- return -ENOSYS;
-
- return ops->get_bool(dev, id, val);
-}
-
-int board_get_int(struct udevice *dev, int id, int *val)
-{
- struct board_ops *ops = board_get_ops(dev);
-
- if (!ops->get_int)
- return -ENOSYS;
-
- return ops->get_int(dev, id, val);
-}
-
-int board_get_str(struct udevice *dev, int id, size_t size, char *val)
-{
- struct board_ops *ops = board_get_ops(dev);
-
- if (!ops->get_str)
- return -ENOSYS;
-
- return ops->get_str(dev, id, size, val);
-}
-
-UCLASS_DRIVER(board) = {
- .id = UCLASS_BOARD,
- .name = "board",
- .post_bind = dm_scan_fdt_dev,
-};
diff --git a/drivers/board/Kconfig b/drivers/sysinfo/Kconfig
index 254f657049..39141500a0 100644
--- a/drivers/board/Kconfig
+++ b/drivers/sysinfo/Kconfig
@@ -1,24 +1,24 @@
-menuconfig BOARD
- bool "Device Information"
+menuconfig SYSINFO
+ bool "Device System Information"
help
Support methods to query hardware configurations from internal
mechanisms (e.g. reading GPIO values, determining the presence of
devices on busses, etc.). This enables the usage of U-Boot with
modular board architectures.
-if BOARD
+if SYSINFO
-config SPL_BOARD
+config SPL_SYSINFO
depends on SPL_DM
bool "Enable board driver support in SPL"
-config BOARD_GAZERBEAM
- bool "Enable board driver for the Gazerbeam board"
+config SYSINFO_GAZERBEAM
+ bool "Enable sysinfo driver for the Gazerbeam board"
help
Support querying device information for the gdsys Gazerbeam board.
-config BOARD_SANDBOX
- bool "Enable board driver for the Sandbox board"
+config SYSINFO_SANDBOX
+ bool "Enable sysinfo driver for the Sandbox board"
help
Support querying device information for the Sandbox boards.
diff --git a/drivers/board/Makefile b/drivers/sysinfo/Makefile
index cc16361755..aecf0b0d47 100644
--- a/drivers/board/Makefile
+++ b/drivers/sysinfo/Makefile
@@ -2,6 +2,6 @@
#
# (C) Copyright 2017
# Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
-obj-y += board-uclass.o
-obj-$(CONFIG_BOARD_GAZERBEAM) += gazerbeam.o
-obj-$(CONFIG_BOARD_SANDBOX) += sandbox.o
+obj-y += sysinfo-uclass.o
+obj-$(CONFIG_SYSINFO_GAZERBEAM) += gazerbeam.o
+obj-$(CONFIG_SYSINFO_SANDBOX) += sandbox.o
diff --git a/drivers/board/gazerbeam.c b/drivers/sysinfo/gazerbeam.c
index ed50fc530c..9e7a496655 100644
--- a/drivers/board/gazerbeam.c
+++ b/drivers/sysinfo/gazerbeam.c
@@ -6,7 +6,7 @@
#include <common.h>
#include <dm.h>
-#include <board.h>
+#include <sysinfo.h>
#include <i2c.h>
#include <log.h>
#include <asm/gpio.h>
@@ -27,16 +27,16 @@ static const int SC_GPIO_NO;
static const int CON_GPIO_NO = 1;
/**
- * struct board_gazerbeam_priv - Private data structure for the gazerbeam board
- * driver.
- * @reset_gpios: GPIOs for the board's reset GPIOs.
- * @var_gpios: GPIOs for the board's hardware variant GPIOs
- * @ver_gpios: GPIOs for the board's hardware version GPIOs
- * @variant: Container for the board's hardware variant (CON/CPU)
- * @multichannel: Container for the board's multichannel variant (MC4/MC2/SC)
- * @hwversion: Container for the board's hardware version
+ * struct sysinfo_gazerbeam_priv - Private data structure for the gazerbeam
+ * sysinfo driver
+ * @reset_gpios: GPIOs for the sysinfo's reset GPIOs.
+ * @var_gpios: GPIOs for the sysinfo's hardware variant GPIOs
+ * @ver_gpios: GPIOs for the sysinfo's hardware version GPIOs
+ * @variant: Container for the sysinfo's hardware variant (CON/CPU)
+ * @multichannel: Container for the sysinfo's multichannel variant (MC4/MC2/SC)
+ * @hwversion: Container for the sysinfo's hardware version
*/
-struct board_gazerbeam_priv {
+struct sysinfo_gazerbeam_priv {
struct gpio_desc reset_gpios[2];
struct gpio_desc var_gpios[2];
struct gpio_desc ver_gpios[4];
@@ -46,19 +46,19 @@ struct board_gazerbeam_priv {
};
/**
- * _read_board_variant_data() - Read variant information from the hardware.
- * @dev: The board device for which to determine the multichannel and device
+ * _read_sysinfo_variant_data() - Read variant information from the hardware.
+ * @dev: The sysinfo device for which to determine the multichannel and device
* type information.
*
- * The data read from the board's hardware (mostly hard-wired GPIOs) is stored
+ * The data read from the sysinfo's hardware (mostly hard-wired GPIOs) is stored
* in the private data structure of the driver to be used by other driver
* methods.
*
* Return: 0 if OK, -ve on error.
*/
-static int _read_board_variant_data(struct udevice *dev)
+static int _read_sysinfo_variant_data(struct udevice *dev)
{
- struct board_gazerbeam_priv *priv = dev_get_priv(dev);
+ struct sysinfo_gazerbeam_priv *priv = dev_get_priv(dev);
struct udevice *i2c_bus;
struct udevice *dummy;
char *listname;
@@ -129,10 +129,10 @@ static int _read_board_variant_data(struct udevice *dev)
}
/**
- * _read_hwversion() - Read the hardware version from the board.
- * @dev: The board device for which to read the hardware version.
+ * _read_hwversion() - Read the hardware version from the sysinfo.
+ * @dev: The sysinfo device for which to read the hardware version.
*
- * The hardware version read from the board (from hard-wired GPIOs) is stored
+ * The hardware version read from the sysinfo (from hard-wired GPIOs) is stored
* in the private data structure of the driver to be used by other driver
* methods.
*
@@ -140,7 +140,7 @@ static int _read_board_variant_data(struct udevice *dev)
*/
static int _read_hwversion(struct udevice *dev)
{
- struct board_gazerbeam_priv *priv = dev_get_priv(dev);
+ struct sysinfo_gazerbeam_priv *priv = dev_get_priv(dev);
int res;
res = gpio_request_list_by_name(dev, "ver-gpios", priv->ver_gpios,
@@ -172,11 +172,11 @@ static int _read_hwversion(struct udevice *dev)
return 0;
}
-static int board_gazerbeam_detect(struct udevice *dev)
+static int sysinfo_gazerbeam_detect(struct udevice *dev)
{
int res;
- res = _read_board_variant_data(dev);
+ res = _read_sysinfo_variant_data(dev);
if (res) {
debug("%s: Error reading multichannel variant (err = %d)\n",
dev->name, res);
@@ -193,9 +193,9 @@ static int board_gazerbeam_detect(struct udevice *dev)
return 0;
}
-static int board_gazerbeam_get_int(struct udevice *dev, int id, int *val)
+static int sysinfo_gazerbeam_get_int(struct udevice *dev, int id, int *val)
{
- struct board_gazerbeam_priv *priv = dev_get_priv(dev);
+ struct sysinfo_gazerbeam_priv *priv = dev_get_priv(dev);
switch (id) {
case BOARD_MULTICHANNEL:
@@ -215,19 +215,19 @@ static int board_gazerbeam_get_int(struct udevice *dev, int id, int *val)
return 0;
}
-static const struct udevice_id board_gazerbeam_ids[] = {
- { .compatible = "gdsys,board_gazerbeam" },
+static const struct udevice_id sysinfo_gazerbeam_ids[] = {
+ { .compatible = "gdsys,sysinfo-gazerbeam" },
{ /* sentinel */ }
};
-static const struct board_ops board_gazerbeam_ops = {
- .detect = board_gazerbeam_detect,
- .get_int = board_gazerbeam_get_int,
+static const struct sysinfo_ops sysinfo_gazerbeam_ops = {
+ .detect = sysinfo_gazerbeam_detect,
+ .get_int = sysinfo_gazerbeam_get_int,
};
-static int board_gazerbeam_probe(struct udevice *dev)
+static int sysinfo_gazerbeam_probe(struct udevice *dev)
{
- struct board_gazerbeam_priv *priv = dev_get_priv(dev);
+ struct sysinfo_gazerbeam_priv *priv = dev_get_priv(dev);
int gpio_num, i;
gpio_num = gpio_request_list_by_name(dev, "reset-gpios",
@@ -255,11 +255,11 @@ static int board_gazerbeam_probe(struct udevice *dev)
return 0;
}
-U_BOOT_DRIVER(board_gazerbeam) = {
- .name = "board_gazerbeam",
- .id = UCLASS_BOARD,
- .of_match = board_gazerbeam_ids,
- .ops = &board_gazerbeam_ops,
- .priv_auto_alloc_size = sizeof(struct board_gazerbeam_priv),
- .probe = board_gazerbeam_probe,
+U_BOOT_DRIVER(sysinfo_gazerbeam) = {
+ .name = "sysinfo_gazerbeam",
+ .id = UCLASS_SYSINFO,
+ .of_match = sysinfo_gazerbeam_ids,
+ .ops = &sysinfo_gazerbeam_ops,
+ .priv_auto_alloc_size = sizeof(struct sysinfo_gazerbeam_priv),
+ .probe = sysinfo_gazerbeam_probe,
};
diff --git a/drivers/board/gazerbeam.h b/drivers/sysinfo/gazerbeam.h
index 171729d203..171729d203 100644
--- a/drivers/board/gazerbeam.h
+++ b/drivers/sysinfo/gazerbeam.h
diff --git a/drivers/board/sandbox.c b/drivers/sysinfo/sandbox.c
index 50621e47a4..62a1cb4ac6 100644
--- a/drivers/board/sandbox.c
+++ b/drivers/sysinfo/sandbox.c
@@ -6,11 +6,11 @@
#include <common.h>
#include <dm.h>
-#include <board.h>
+#include <sysinfo.h>
#include "sandbox.h"
-struct board_sandbox_priv {
+struct sysinfo_sandbox_priv {
bool called_detect;
int test_i1;
int test_i2;
@@ -19,9 +19,9 @@ struct board_sandbox_priv {
char vacation_spots[][64] = {"R'lyeh", "Dreamlands", "Plateau of Leng",
"Carcosa", "Yuggoth", "The Nameless City"};
-int board_sandbox_detect(struct udevice *dev)
+int sysinfo_sandbox_detect(struct udevice *dev)
{
- struct board_sandbox_priv *priv = dev_get_priv(dev);
+ struct sysinfo_sandbox_priv *priv = dev_get_priv(dev);
priv->called_detect = true;
priv->test_i2 = 100;
@@ -29,9 +29,9 @@ int board_sandbox_detect(struct udevice *dev)
return 0;
}
-int board_sandbox_get_bool(struct udevice *dev, int id, bool *val)
+int sysinfo_sandbox_get_bool(struct udevice *dev, int id, bool *val)
{
- struct board_sandbox_priv *priv = dev_get_priv(dev);
+ struct sysinfo_sandbox_priv *priv = dev_get_priv(dev);
switch (id) {
case BOOL_CALLED_DETECT:
@@ -43,9 +43,9 @@ int board_sandbox_get_bool(struct udevice *dev, int id, bool *val)
return -ENOENT;
}
-int board_sandbox_get_int(struct udevice *dev, int id, int *val)
+int sysinfo_sandbox_get_int(struct udevice *dev, int id, int *val)
{
- struct board_sandbox_priv *priv = dev_get_priv(dev);
+ struct sysinfo_sandbox_priv *priv = dev_get_priv(dev);
switch (id) {
case INT_TEST1:
@@ -63,9 +63,9 @@ int board_sandbox_get_int(struct udevice *dev, int id, int *val)
return -ENOENT;
}
-int board_sandbox_get_str(struct udevice *dev, int id, size_t size, char *val)
+int sysinfo_sandbox_get_str(struct udevice *dev, int id, size_t size, char *val)
{
- struct board_sandbox_priv *priv = dev_get_priv(dev);
+ struct sysinfo_sandbox_priv *priv = dev_get_priv(dev);
int i1 = priv->test_i1;
int i2 = priv->test_i2;
int index = (i1 * i2) % ARRAY_SIZE(vacation_spots);
@@ -80,28 +80,28 @@ int board_sandbox_get_str(struct udevice *dev, int id, size_t size, char *val)
return -ENOENT;
}
-static const struct udevice_id board_sandbox_ids[] = {
- { .compatible = "sandbox,board_sandbox" },
+static const struct udevice_id sysinfo_sandbox_ids[] = {
+ { .compatible = "sandbox,sysinfo-sandbox" },
{ /* sentinel */ }
};
-static const struct board_ops board_sandbox_ops = {
- .detect = board_sandbox_detect,
- .get_bool = board_sandbox_get_bool,
- .get_int = board_sandbox_get_int,
- .get_str = board_sandbox_get_str,
+static const struct sysinfo_ops sysinfo_sandbox_ops = {
+ .detect = sysinfo_sandbox_detect,
+ .get_bool = sysinfo_sandbox_get_bool,
+ .get_int = sysinfo_sandbox_get_int,
+ .get_str = sysinfo_sandbox_get_str,
};
-int board_sandbox_probe(struct udevice *dev)
+int sysinfo_sandbox_probe(struct udevice *dev)
{
return 0;
}
-U_BOOT_DRIVER(board_sandbox) = {
- .name = "board_sandbox",
- .id = UCLASS_BOARD,
- .of_match = board_sandbox_ids,
- .ops = &board_sandbox_ops,
- .priv_auto_alloc_size = sizeof(struct board_sandbox_priv),
- .probe = board_sandbox_probe,
+U_BOOT_DRIVER(sysinfo_sandbox) = {
+ .name = "sysinfo_sandbox",
+ .id = UCLASS_SYSINFO,
+ .of_match = sysinfo_sandbox_ids,
+ .ops = &sysinfo_sandbox_ops,
+ .priv_auto_alloc_size = sizeof(struct sysinfo_sandbox_priv),
+ .probe = sysinfo_sandbox_probe,
};
diff --git a/drivers/board/sandbox.h b/drivers/sysinfo/sandbox.h
index 2cff494f56..2cff494f56 100644
--- a/drivers/board/sandbox.h
+++ b/drivers/sysinfo/sandbox.h
diff --git a/drivers/sysinfo/sysinfo-uclass.c b/drivers/sysinfo/sysinfo-uclass.c
new file mode 100644
index 0000000000..6df58fe160
--- /dev/null
+++ b/drivers/sysinfo/sysinfo-uclass.c
@@ -0,0 +1,71 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2017
+ * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <sysinfo.h>
+
+int sysinfo_get(struct udevice **devp)
+{
+ return uclass_first_device_err(UCLASS_SYSINFO, devp);
+}
+
+int sysinfo_detect(struct udevice *dev)
+{
+ struct sysinfo_ops *ops = sysinfo_get_ops(dev);
+
+ if (!ops->detect)
+ return -ENOSYS;
+
+ return ops->detect(dev);
+}
+
+int sysinfo_get_fit_loadable(struct udevice *dev, int index, const char *type,
+ const char **strp)
+{
+ struct sysinfo_ops *ops = sysinfo_get_ops(dev);
+
+ if (!ops->get_fit_loadable)
+ return -ENOSYS;
+
+ return ops->get_fit_loadable(dev, index, type, strp);
+}
+
+int sysinfo_get_bool(struct udevice *dev, int id, bool *val)
+{
+ struct sysinfo_ops *ops = sysinfo_get_ops(dev);
+
+ if (!ops->get_bool)
+ return -ENOSYS;
+
+ return ops->get_bool(dev, id, val);
+}
+
+int sysinfo_get_int(struct udevice *dev, int id, int *val)
+{
+ struct sysinfo_ops *ops = sysinfo_get_ops(dev);
+
+ if (!ops->get_int)
+ return -ENOSYS;
+
+ return ops->get_int(dev, id, val);
+}
+
+int sysinfo_get_str(struct udevice *dev, int id, size_t size, char *val)
+{
+ struct sysinfo_ops *ops = sysinfo_get_ops(dev);
+
+ if (!ops->get_str)
+ return -ENOSYS;
+
+ return ops->get_str(dev, id, size, val);
+}
+
+UCLASS_DRIVER(sysinfo) = {
+ .id = UCLASS_SYSINFO,
+ .name = "sysinfo",
+ .post_bind = dm_scan_fdt_dev,
+};
diff --git a/drivers/timer/mpc83xx_timer.c b/drivers/timer/mpc83xx_timer.c
index ba7704225a..6139252a73 100644
--- a/drivers/timer/mpc83xx_timer.c
+++ b/drivers/timer/mpc83xx_timer.c
@@ -5,12 +5,12 @@
*/
#include <common.h>
-#include <board.h>
#include <clk.h>
#include <dm.h>
#include <irq_func.h>
#include <log.h>
#include <status_led.h>
+#include <sysinfo.h>
#include <time.h>
#include <timer.h>
#include <watchdog.h>
@@ -97,7 +97,7 @@ int interrupt_init(void)
{
immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
struct udevice *csb;
- struct udevice *board;
+ struct udevice *sysinfo;
struct udevice *timer;
struct mpc83xx_timer_priv *timer_priv;
struct clk clock;
@@ -112,12 +112,12 @@ int interrupt_init(void)
timer_priv = dev_get_priv(timer);
- if (board_get(&board)) {
- debug("%s: board device could not be fetched.\n", __func__);
+ if (sysinfo_get(&sysinfo)) {
+ debug("%s: sysinfo device could not be fetched.\n", __func__);
return -ENOENT;
}
- ret = uclass_get_device_by_phandle(UCLASS_SIMPLE_BUS, board,
+ ret = uclass_get_device_by_phandle(UCLASS_SIMPLE_BUS, sysinfo,
"csb", &csb);
if (ret) {
debug("%s: Could not retrieve CSB device (error: %d)",