From bad391b21c4b73b90a766786caff711d6a6433a5 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 9 Feb 2014 20:55:49 +0000 Subject: [PATCH] Add FDT matching code. --- sys/arm/at91/at91_mci.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/arm/at91/at91_mci.c b/sys/arm/at91/at91_mci.c index 0026c3bdf828..5d5822802a82 100644 --- a/sys/arm/at91/at91_mci.c +++ b/sys/arm/at91/at91_mci.c @@ -25,6 +25,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -62,6 +64,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + #include "mmcbr_if.h" #include "opt_at91.h" @@ -342,7 +350,10 @@ at91_mci_fini(device_t dev) static int at91_mci_probe(device_t dev) { - +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,hsmci")) + return (ENXIO); +#endif device_set_desc(dev, "MCI mmc/sd host bridge"); return (0); } @@ -1393,5 +1404,10 @@ static driver_t at91_mci_driver = { static devclass_t at91_mci_devclass; +#ifdef FDT +DRIVER_MODULE(at91_mci, simplebus, at91_mci_driver, at91_mci_devclass, NULL, + NULL); +#else DRIVER_MODULE(at91_mci, atmelarm, at91_mci_driver, at91_mci_devclass, NULL, NULL); +#endif