isp_sbus.c (207579) | isp_sbus.c (218691) |
---|---|
1/*- 2 * Copyright (c) 1997-2006 by Matthew Jacob 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 */ 26/* 27 * SBus specific probe and attach routines for Qlogic ISP SCSI adapters. 28 * FreeBSD Version. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997-2006 by Matthew Jacob 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 */ 26/* 27 * SBus specific probe and attach routines for Qlogic ISP SCSI adapters. 28 * FreeBSD Version. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/isp/isp_sbus.c 207579 2010-05-03 18:39:40Z marius $"); | 32__FBSDID("$FreeBSD: head/sys/dev/isp/isp_sbus.c 218691 2011-02-14 21:50:51Z marius $"); |
33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/linker.h> 37#include <sys/firmware.h> 38#include <sys/bus.h> 39#include <sys/kernel.h> 40#include <sys/module.h> --- 355 unchanged lines hidden (view full) --- 396isp_sbus_wr_reg(ispsoftc_t *isp, int regoff, uint32_t val) 397{ 398 struct isp_sbussoftc *sbs = (struct isp_sbussoftc *) isp; 399 int offset = sbs->sbus_poff[(regoff & _BLK_REG_MASK) >> _BLK_REG_SHFT]; 400 offset += (regoff & 0xff); 401 isp_prt(isp, ISP_LOGDEBUG3, 402 "isp_sbus_wr_reg(off %x) = %x", regoff, val); 403 bus_space_write_2(isp->isp_bus_tag, isp->isp_bus_handle, offset, val); | 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/linker.h> 37#include <sys/firmware.h> 38#include <sys/bus.h> 39#include <sys/kernel.h> 40#include <sys/module.h> --- 355 unchanged lines hidden (view full) --- 396isp_sbus_wr_reg(ispsoftc_t *isp, int regoff, uint32_t val) 397{ 398 struct isp_sbussoftc *sbs = (struct isp_sbussoftc *) isp; 399 int offset = sbs->sbus_poff[(regoff & _BLK_REG_MASK) >> _BLK_REG_SHFT]; 400 offset += (regoff & 0xff); 401 isp_prt(isp, ISP_LOGDEBUG3, 402 "isp_sbus_wr_reg(off %x) = %x", regoff, val); 403 bus_space_write_2(isp->isp_bus_tag, isp->isp_bus_handle, offset, val); |
404 MEMORYBARRIER(isp, SYNC_REG, offset, 2); | 404 MEMORYBARRIER(isp, SYNC_REG, offset, 2, -1); |
405} 406 407struct imush { 408 ispsoftc_t *isp; 409 int error; 410}; 411 412static void imc(void *, bus_dma_segment_t *, int, int); --- 78 unchanged lines hidden (view full) --- 491 isp_prt(isp, ISP_LOGERR, 492 "cannot create a dma tag for control spaces"); 493 free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); 494 free(isp->isp_xflist, M_DEVBUF); 495 ISP_LOCK(isp); 496 return (1); 497 } 498 | 405} 406 407struct imush { 408 ispsoftc_t *isp; 409 int error; 410}; 411 412static void imc(void *, bus_dma_segment_t *, int, int); --- 78 unchanged lines hidden (view full) --- 491 isp_prt(isp, ISP_LOGERR, 492 "cannot create a dma tag for control spaces"); 493 free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); 494 free(isp->isp_xflist, M_DEVBUF); 495 ISP_LOCK(isp); 496 return (1); 497 } 498 |
499 if (bus_dmamem_alloc(isp->isp_osinfo.cdmat, (void **)&base, BUS_DMA_NOWAIT, | 499 if (bus_dmamem_alloc(isp->isp_osinfo.cdmat, (void **)&base, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, |
500 &isp->isp_osinfo.cdmap) != 0) { 501 isp_prt(isp, ISP_LOGERR, 502 "cannot allocate %d bytes of CCB memory", len); 503 bus_dma_tag_destroy(isp->isp_osinfo.cdmat); 504 free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); 505 free(isp->isp_xflist, M_DEVBUF); 506 ISP_LOCK(isp); 507 return (1); --- 213 unchanged lines hidden --- | 500 &isp->isp_osinfo.cdmap) != 0) { 501 isp_prt(isp, ISP_LOGERR, 502 "cannot allocate %d bytes of CCB memory", len); 503 bus_dma_tag_destroy(isp->isp_osinfo.cdmat); 504 free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); 505 free(isp->isp_xflist, M_DEVBUF); 506 ISP_LOCK(isp); 507 return (1); --- 213 unchanged lines hidden --- |