summaryrefslogtreecommitdiff
path: root/drivers/memory
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@kernel.org>2022-10-20 16:30:46 +0300
committerTom Rini <trini@konsulko.com>2022-10-26 22:21:11 +0300
commit2c120375e949807ce8e3b077d6537e2d8d69a87c (patch)
treeddc0bf5aa3151a16dd7b2d1cb45af9a318b59eca /drivers/memory
parent27e6ebc5ea71c824234e862e55485de841ae29ac (diff)
downloadu-boot-2c120375e949807ce8e3b077d6537e2d8d69a87c.tar.xz
dm: memory: Introduce new uclass
Introduce UCLASS_MEMORY for future Memory Controller device drivers. Signed-off-by: Roger Quadros <rogerq@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/Kconfig17
-rw-r--r--drivers/memory/Makefile2
-rw-r--r--drivers/memory/memory-sandbox.c18
-rw-r--r--drivers/memory/memory-uclass.c13
4 files changed, 50 insertions, 0 deletions
diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
index 7271892763..c621f5bba3 100644
--- a/drivers/memory/Kconfig
+++ b/drivers/memory/Kconfig
@@ -4,6 +4,23 @@
menu "Memory Controller drivers"
+config MEMORY
+ bool "Enable Driver Model for Memory Controller drivers"
+ depends on DM
+ help
+ Enable driver model for Memory Controller devices.
+ These devices provide Memory bus interface to various devices like
+ SRAM, Ethernet adapters, FPGAs, etc.
+ For now this uclass has no methods yet.
+
+config SANDBOX_MEMORY
+ bool "Enable Sandbox Memory Controller driver"
+ depends on SANDBOX && MEMORY
+ help
+ This is a driver model based Memory Controller driver for sandbox.
+ Currently it is a stub only, as there are no usable uclass methods
+ yet.
+
config STM32_FMC2_EBI
bool "Support for FMC2 External Bus Interface on STM32MP SoCs"
depends on ARCH_STM32MP
diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile
index fec52efb60..b27f701865 100644
--- a/drivers/memory/Makefile
+++ b/drivers/memory/Makefile
@@ -1,3 +1,5 @@
+obj-$(CONFIG_MEMORY) += memory-uclass.o
+obj-$(CONFIG_SANDBOX_MEMORY) += memory-sandbox.o
obj-$(CONFIG_STM32_FMC2_EBI) += stm32-fmc2-ebi.o
obj-$(CONFIG_TI_AEMIF) += ti-aemif.o
diff --git a/drivers/memory/memory-sandbox.c b/drivers/memory/memory-sandbox.c
new file mode 100644
index 0000000000..f2ede50863
--- /dev/null
+++ b/drivers/memory/memory-sandbox.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2022
+ * Texas Instruments Incorporated, <www.ti.com>
+ */
+
+#include <dm.h>
+
+static const struct udevice_id sandbox_memory_match[] = {
+ { .compatible = "sandbox,memory" },
+ { /* sentinel */ }
+};
+
+U_BOOT_DRIVER(sandbox_memory) = {
+ .name = "sandbox_memory",
+ .id = UCLASS_MEMORY,
+ .of_match = sandbox_memory_match,
+};
diff --git a/drivers/memory/memory-uclass.c b/drivers/memory/memory-uclass.c
new file mode 100644
index 0000000000..d6d37fe777
--- /dev/null
+++ b/drivers/memory/memory-uclass.c
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2022
+ * Texas Instruments Incorporated, <www.ti.com>
+ */
+
+#include <dm.h>
+
+UCLASS_DRIVER(memory) = {
+ .name = "memory",
+ .id = UCLASS_MEMORY,
+ .post_bind = dm_scan_fdt_dev,
+};