summaryrefslogtreecommitdiffstats
path: root/sys/dev/cfi
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2010-07-11 21:08:29 +0000
committerraj <raj@FreeBSD.org>2010-07-11 21:08:29 +0000
commit6496d826ccfca6b78860dfa86efcb3f96cb6053f (patch)
tree827f9dce3768613a609f3a9e594b123936ec2e0e /sys/dev/cfi
parent710dc13ac9dfbfa4fead6e52f9efb9e7b6af119e (diff)
downloadFreeBSD-src-6496d826ccfca6b78860dfa86efcb3f96cb6053f.zip
FreeBSD-src-6496d826ccfca6b78860dfa86efcb3f96cb6053f.tar.gz
Convert Freescale PowerPC platforms to FDT convention.
The following systems are affected: - MPC8555CDS - MPC8572DS This overhaul covers the following major changes: - All integrated peripherals drivers for Freescale MPC85XX SoC, which are currently in the FreeBSD source tree are reworked and adjusted so they derive config data out of the device tree blob (instead of hard coded / tabelarized values). - This includes: LBC, PCI / PCI-Express, I2C, DS1553, OpenPIC, TSEC, SEC, QUICC, UART, CFI. - Thanks to the common FDT infrastrucutre (fdtbus, simplebus) we retire ocpbus(4) driver, which was based on hard-coded config data. Note that world for these platforms has to be built WITH_FDT. Reviewed by: imp Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/dev/cfi')
-rw-r--r--sys/dev/cfi/cfi_bus_fdt.c (renamed from sys/dev/cfi/cfi_bus_lbc.c)32
1 files changed, 11 insertions, 21 deletions
diff --git a/sys/dev/cfi/cfi_bus_lbc.c b/sys/dev/cfi/cfi_bus_fdt.c
index df24f38..bfbd65f 100644
--- a/sys/dev/cfi/cfi_bus_lbc.c
+++ b/sys/dev/cfi/cfi_bus_fdt.c
@@ -35,49 +35,39 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/kernel.h>
-#include <sys/malloc.h>
#include <sys/module.h>
-#include <sys/rman.h>
-#include <sys/sysctl.h>
#include <machine/bus.h>
#include <dev/cfi/cfi_var.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
-#include <powerpc/mpc85xx/lbc.h>
+static int cfi_fdt_probe(device_t);
-static int cfi_lbc_probe(device_t);
-
-static device_method_t cfi_lbc_methods[] = {
+static device_method_t cfi_fdt_methods[] = {
/* device interface */
- DEVMETHOD(device_probe, cfi_lbc_probe),
+ DEVMETHOD(device_probe, cfi_fdt_probe),
DEVMETHOD(device_attach, cfi_attach),
DEVMETHOD(device_detach, cfi_detach),
{0, 0}
};
-static driver_t cfi_lbc_driver = {
+static driver_t cfi_fdt_driver = {
cfi_driver_name,
- cfi_lbc_methods,
+ cfi_fdt_methods,
sizeof(struct cfi_softc),
};
-DRIVER_MODULE (cfi, lbc, cfi_lbc_driver, cfi_devclass, 0, 0);
+DRIVER_MODULE (cfi, lbc, cfi_fdt_driver, cfi_devclass, 0, 0);
static int
-cfi_lbc_probe(device_t dev)
+cfi_fdt_probe(device_t dev)
{
- uintptr_t devtype;
- int error;
-
- error = BUS_READ_IVAR(device_get_parent(dev), dev, LBC_IVAR_DEVTYPE,
- &devtype);
- if (error)
- return (error);
- if (devtype != LBC_DEVTYPE_CFI)
- return (EINVAL);
+ if (!ofw_bus_is_compatible(dev, "cfi-flash"))
+ return (ENXIO);
return (cfi_probe(dev));
}
OpenPOWER on IntegriCloud