]> git.baikalelectronics.ru Git - uboot.git/commitdiff
memory: atmel-ebi: add Atmel EBI (External Bus Interface) driver
authorBalamanikandan Gunasundar <balamanikandan.gunasundar@microchip.com>
Tue, 25 Oct 2022 10:51:04 +0000 (16:21 +0530)
committerEugen Hristev <eugen.hristev@microchip.com>
Thu, 8 Dec 2022 16:06:27 +0000 (18:06 +0200)
The EBI is used to access peripherals like NAND, SRAM, NOR etc. Add
this driver to probe the nand flash controller. This is a dummy driver
and not yet a complete device driver for EBI.

Signed-off-by: Balamanikandan Gunasundar <balamanikandan.gunasundar@microchip.com>
MAINTAINERS
drivers/memory/Kconfig
drivers/memory/Makefile
drivers/memory/atmel_ebi.c [new file with mode: 0644]

index 75b27bc1cc4b205bc2cf1f054f234785fc26db59..3a0aab499feb6063cca44452d87cb0a45d9a6e40 100644 (file)
@@ -409,6 +409,7 @@ T:  git https://source.denx.de/u-boot/custodians/u-boot-atmel.git
 F:     arch/arm/mach-at91/
 F:     board/atmel/
 F:     drivers/cpu/at91_cpu.c
+F:     drivers/memory/atmel-ebi.c
 F:     drivers/misc/microchip_flexcom.c
 F:     drivers/timer/atmel_tcb_timer.c
 F:     include/dt-bindings/mfd/atmel-flexcom.h
index 56b89f17be5ce9c7fdafb90e880ea08b1c5abd1f..22cb9d637c5e22c284dd5828f5828b775daeae71 100644 (file)
@@ -13,6 +13,13 @@ config MEMORY
          SRAM, Ethernet adapters, FPGAs, etc.
          For now this uclass has no methods yet.
 
+config ATMEL_EBI
+       bool "Support for Atmel EBI"
+       help
+         Driver for Atmel EBI controller. This is a dummy
+         driver. Doesn't provide an access to EBI controller. Select
+         this option to enable the NAND flash controller driver
+
 config SANDBOX_MEMORY
        bool "Enable Sandbox Memory Controller driver"
        depends on SANDBOX && MEMORY
index 2b196d78c0bffdd0d96436481c7846edfd4d2689..1cabf8ac9cd8e41cc85b9a9e73e0c04043ec69d9 100644 (file)
@@ -2,5 +2,6 @@
 obj-$(CONFIG_MEMORY) += memory-uclass.o
 obj-$(CONFIG_SANDBOX_MEMORY) += memory-sandbox.o
 obj-$(CONFIG_STM32_FMC2_EBI) += stm32-fmc2-ebi.o
+obj-$(CONFIG_ATMEL_EBI) += atmel_ebi.o
 obj-$(CONFIG_TI_AEMIF) += ti-aemif.o
 obj-$(CONFIG_TI_GPMC) += ti-gpmc.o
diff --git a/drivers/memory/atmel_ebi.c b/drivers/memory/atmel_ebi.c
new file mode 100644 (file)
index 0000000..4739eef
--- /dev/null
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2022 Microchip Technology Inc. and its subsidiaries
+ */
+
+#include <dm/device.h>
+#include <dm/read.h>
+#include <dm/uclass.h>
+#include <fdtdec.h>
+
+static int atmel_ebi_probe(struct udevice *dev)
+{
+       int ret;
+       struct udevice *ndev;
+
+       ret = uclass_get_device_by_driver(UCLASS_MTD,
+                                         DM_DRIVER_GET(atmel_nand_controller),
+                                         &ndev);
+       if (ret)
+               printf("Failed to probe nand driver (err = %d)\n", ret);
+
+       return ret;
+}
+
+static const struct udevice_id atmel_ebi_match[] = {
+       {.compatible = "microchip,sam9x60-ebi"},
+       {.compatible = "atmel,sama5d3-ebi"},
+       { /* Sentinel */ }
+};
+
+U_BOOT_DRIVER(atmel_ebi) = {
+       .name = "atmel_ebi",
+       .id = UCLASS_NOP,
+       .of_match = atmel_ebi_match,
+       .probe = atmel_ebi_probe,
+       .bind = dm_scan_fdt_dev,
+};