2008-03-03 17:17:00 +00:00
|
|
|
/*-
|
|
|
|
* Copyright 1998 Massachusetts Institute of Technology
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software and
|
|
|
|
* its documentation for any purpose and without fee is hereby
|
|
|
|
* granted, provided that both the above copyright notice and this
|
|
|
|
* permission notice appear in all copies, that both the above
|
|
|
|
* copyright notice and this permission notice appear in all
|
|
|
|
* supporting documentation, and that the name of M.I.T. not be used
|
|
|
|
* in advertising or publicity pertaining to distribution of the
|
|
|
|
* software without specific, written prior permission. M.I.T. makes
|
|
|
|
* no representations about the suitability of this software for any
|
|
|
|
* purpose. It is provided "as is" without express or implied
|
|
|
|
* warranty.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
|
|
|
|
* ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
|
|
|
|
* SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
|
|
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
/*-
|
|
|
|
* Copyright 2001 by Thomas Moestl <tmm@FreeBSD.org>. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/module.h>
|
|
|
|
#include <sys/bus.h>
|
|
|
|
#include <sys/cons.h>
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
#include <sys/malloc.h>
|
|
|
|
#include <sys/rman.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Device interface
|
|
|
|
*/
|
|
|
|
static int nexus_probe(device_t);
|
2011-01-29 20:28:17 +00:00
|
|
|
static int nexus_attach(device_t);
|
2008-03-03 17:17:00 +00:00
|
|
|
static int nexus_activate_resource(device_t, device_t, int, int,
|
2008-12-17 15:31:15 +00:00
|
|
|
struct resource *);
|
2008-03-03 17:17:00 +00:00
|
|
|
static int nexus_deactivate_resource(device_t, device_t, int, int,
|
2008-12-17 15:31:15 +00:00
|
|
|
struct resource *);
|
2008-03-03 17:17:00 +00:00
|
|
|
|
|
|
|
static device_method_t nexus_methods[] = {
|
|
|
|
/* Device interface */
|
|
|
|
DEVMETHOD(device_probe, nexus_probe),
|
2011-01-29 20:28:17 +00:00
|
|
|
DEVMETHOD(device_attach, nexus_attach),
|
2008-03-03 17:17:00 +00:00
|
|
|
DEVMETHOD(device_detach, bus_generic_detach),
|
|
|
|
DEVMETHOD(device_shutdown, bus_generic_shutdown),
|
|
|
|
DEVMETHOD(device_suspend, bus_generic_suspend),
|
|
|
|
DEVMETHOD(device_resume, bus_generic_resume),
|
|
|
|
|
|
|
|
/* Bus interface. Resource management is business of the children... */
|
2011-01-29 20:28:17 +00:00
|
|
|
DEVMETHOD(bus_add_child, bus_generic_add_child),
|
2008-03-03 17:17:00 +00:00
|
|
|
DEVMETHOD(bus_probe_nomatch, NULL),
|
|
|
|
DEVMETHOD(bus_read_ivar, NULL),
|
|
|
|
DEVMETHOD(bus_write_ivar, NULL),
|
|
|
|
DEVMETHOD(bus_setup_intr, NULL),
|
|
|
|
DEVMETHOD(bus_teardown_intr, NULL),
|
|
|
|
DEVMETHOD(bus_alloc_resource, NULL),
|
|
|
|
DEVMETHOD(bus_activate_resource, nexus_activate_resource),
|
|
|
|
DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource),
|
|
|
|
DEVMETHOD(bus_release_resource, NULL),
|
|
|
|
|
2011-11-22 21:28:20 +00:00
|
|
|
DEVMETHOD_END
|
2008-03-03 17:17:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static driver_t nexus_driver = {
|
|
|
|
"nexus",
|
|
|
|
nexus_methods
|
|
|
|
};
|
|
|
|
|
|
|
|
static devclass_t nexus_devclass;
|
|
|
|
|
|
|
|
DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0);
|
|
|
|
|
|
|
|
static int
|
2011-01-29 20:28:17 +00:00
|
|
|
nexus_probe(device_t dev)
|
2008-03-03 17:17:00 +00:00
|
|
|
{
|
|
|
|
|
2011-01-29 20:28:17 +00:00
|
|
|
if (!bootverbose)
|
|
|
|
device_quiet(dev);
|
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
2010-07-11 21:08:29 +00:00
|
|
|
return (BUS_PROBE_DEFAULT);
|
2008-03-03 17:17:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2011-01-29 20:28:17 +00:00
|
|
|
nexus_attach(device_t dev)
|
|
|
|
{
|
|
|
|
|
|
|
|
bus_generic_probe(dev);
|
|
|
|
bus_generic_attach(dev);
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
nexus_activate_resource(device_t bus, device_t child, int type, int rid,
|
2008-03-03 17:17:00 +00:00
|
|
|
struct resource *res)
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Not much to be done yet... */
|
|
|
|
return (rman_activate_resource(res));
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2011-01-29 20:28:17 +00:00
|
|
|
nexus_deactivate_resource(device_t bus, device_t child, int type, int rid,
|
2008-03-03 17:17:00 +00:00
|
|
|
struct resource *res)
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Not much to be done yet... */
|
|
|
|
return (rman_deactivate_resource(res));
|
|
|
|
}
|