blob: 4739eef1b756b6ea031e355fbed8f7ce9be3c22f [file] [log] [blame]
Balamanikandan Gunasundar935a9bd2022-10-25 16:21:04 +05301// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2022 Microchip Technology Inc. and its subsidiaries
4 */
5
6#include <dm/device.h>
7#include <dm/read.h>
8#include <dm/uclass.h>
9#include <fdtdec.h>
10
11static int atmel_ebi_probe(struct udevice *dev)
12{
13 int ret;
14 struct udevice *ndev;
15
16 ret = uclass_get_device_by_driver(UCLASS_MTD,
17 DM_DRIVER_GET(atmel_nand_controller),
18 &ndev);
19 if (ret)
20 printf("Failed to probe nand driver (err = %d)\n", ret);
21
22 return ret;
23}
24
25static const struct udevice_id atmel_ebi_match[] = {
26 {.compatible = "microchip,sam9x60-ebi"},
27 {.compatible = "atmel,sama5d3-ebi"},
28 { /* Sentinel */ }
29};
30
31U_BOOT_DRIVER(atmel_ebi) = {
32 .name = "atmel_ebi",
33 .id = UCLASS_NOP,
34 .of_match = atmel_ebi_match,
35 .probe = atmel_ebi_probe,
36 .bind = dm_scan_fdt_dev,
37};