pcf_ebus.c (181332) | pcf_ebus.c (233018) |
---|---|
1/*- 2 * Copyright (c) 2004 Marius Strobl, Joerg Wunsch 3 * 4 * derived from sys/i386/isa/pcf.c which is: 5 * 6 * Copyright (c) 1998 Nicolas Souchu, Marc Bouget 7 * All rights reserved. 8 * --- 14 unchanged lines hidden (view full) --- 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 Marius Strobl, Joerg Wunsch 3 * 4 * derived from sys/i386/isa/pcf.c which is: 5 * 6 * Copyright (c) 1998 Nicolas Souchu, Marc Bouget 7 * All rights reserved. 8 * --- 14 unchanged lines hidden (view full) --- 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/pcf/pcf_ebus.c 181332 2008-08-05 17:39:37Z jhb $"); | 31__FBSDID("$FreeBSD: head/sys/dev/pcf/pcf_ebus.c 233018 2012-03-15 22:53:39Z nwhitehorn $"); |
32 33/* 34 * Device specific driver for the EBus i2c devices found on some sun4u 35 * systems. On systems not having a boot-bus controller the i2c devices 36 * are PCF8584. 37 * 38 * Known onboard slave devices on the primary bus are: 39 * --- 102 unchanged lines hidden (view full) --- 142 int rv = ENXIO; 143 phandle_t node; 144 uint64_t own_addr; 145 146 sc = DEVTOSOFTC(dev); 147 mtx_init(&sc->pcf_lock, device_get_nameunit(dev), "pcf", MTX_DEF); 148 149 /* get OFW node of the pcf */ | 32 33/* 34 * Device specific driver for the EBus i2c devices found on some sun4u 35 * systems. On systems not having a boot-bus controller the i2c devices 36 * are PCF8584. 37 * 38 * Known onboard slave devices on the primary bus are: 39 * --- 102 unchanged lines hidden (view full) --- 142 int rv = ENXIO; 143 phandle_t node; 144 uint64_t own_addr; 145 146 sc = DEVTOSOFTC(dev); 147 mtx_init(&sc->pcf_lock, device_get_nameunit(dev), "pcf", MTX_DEF); 148 149 /* get OFW node of the pcf */ |
150 if ((node = ofw_bus_get_node(dev)) <= 0) { | 150 if ((node = ofw_bus_get_node(dev)) == -1) { |
151 device_printf(dev, "cannot get OFW node\n"); 152 goto error; 153 } 154 155 /* IO port is mandatory */ 156 sc->res_ioport = bus_alloc_resource_any(dev, SYS_RES_MEMORY, 157 &sc->rid_ioport, RF_ACTIVE); 158 if (sc->res_ioport == 0) { --- 96 unchanged lines hidden --- | 151 device_printf(dev, "cannot get OFW node\n"); 152 goto error; 153 } 154 155 /* IO port is mandatory */ 156 sc->res_ioport = bus_alloc_resource_any(dev, SYS_RES_MEMORY, 157 &sc->rid_ioport, RF_ACTIVE); 158 if (sc->res_ioport == 0) { --- 96 unchanged lines hidden --- |