1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00

Add basic FDT support for the mx25l SPI flash.

Sponsored by:	Rubicon Communications (Netgate)
This commit is contained in:
Luiz Otavio O Souza 2016-03-30 17:00:33 +00:00
parent 320d842101
commit 8f74c88a73
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297423

View File

@ -26,6 +26,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "opt_platform.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bio.h>
@ -40,6 +42,12 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <geom/geom_disk.h>
#ifdef FDT
#include <dev/fdt/fdt_common.h>
#include <dev/ofw/ofw_bus_subr.h>
#include <dev/ofw/openfirm.h>
#endif
#include <dev/spibus/spi.h>
#include "spibus_if.h"
@ -360,7 +368,15 @@ mx25l_read(device_t dev, off_t offset, caddr_t data, off_t count)
static int
mx25l_probe(device_t dev)
{
#ifdef FDT
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_is_compatible(dev, "st,m25p"))
return (ENXIO);
#endif
device_set_desc(dev, "M25Pxx Flash Family");
return (0);
}