isp_sbus.c (256281) | isp_sbus.c (290785) |
---|---|
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: stable/10/sys/dev/isp/isp_sbus.c 246713 2013-02-12 16:57:20Z kib $"); | 32__FBSDID("$FreeBSD: stable/10/sys/dev/isp/isp_sbus.c 290785 2015-11-13 19:42:55Z mav $"); |
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> --- 7 unchanged lines hidden (view full) --- 48#include <machine/resource.h> 49#include <sys/rman.h> 50#include <sparc64/sbus/sbusvar.h> 51 52#include <dev/isp/isp_freebsd.h> 53 54static uint32_t isp_sbus_rd_reg(ispsoftc_t *, int); 55static void isp_sbus_wr_reg(ispsoftc_t *, int, uint32_t); | 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> --- 7 unchanged lines hidden (view full) --- 48#include <machine/resource.h> 49#include <sys/rman.h> 50#include <sparc64/sbus/sbusvar.h> 51 52#include <dev/isp/isp_freebsd.h> 53 54static uint32_t isp_sbus_rd_reg(ispsoftc_t *, int); 55static void isp_sbus_wr_reg(ispsoftc_t *, int, uint32_t); |
56static int isp_sbus_rd_isr(ispsoftc_t *, uint32_t *, uint16_t *, uint16_t *); | 56static int isp_sbus_rd_isr(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); |
57static int isp_sbus_mbxdma(ispsoftc_t *); 58static int isp_sbus_dmasetup(ispsoftc_t *, XS_T *, void *); 59 60 61static void isp_sbus_reset0(ispsoftc_t *); 62static void isp_sbus_reset1(ispsoftc_t *); 63static void isp_sbus_dumpregs(ispsoftc_t *, const char *); 64 --- 318 unchanged lines hidden (view full) --- 383#define IspVirt2Off(a, x) \ 384 (((struct isp_sbussoftc *)a)->sbus_poff[((x) & _BLK_REG_MASK) >> \ 385 _BLK_REG_SHFT] + ((x) & 0xff)) 386 387#define BXR2(sbc, off) \ 388 bus_space_read_2(isp->isp_bus_tag, isp->isp_bus_handle, off) 389 390static int | 57static int isp_sbus_mbxdma(ispsoftc_t *); 58static int isp_sbus_dmasetup(ispsoftc_t *, XS_T *, void *); 59 60 61static void isp_sbus_reset0(ispsoftc_t *); 62static void isp_sbus_reset1(ispsoftc_t *); 63static void isp_sbus_dumpregs(ispsoftc_t *, const char *); 64 --- 318 unchanged lines hidden (view full) --- 383#define IspVirt2Off(a, x) \ 384 (((struct isp_sbussoftc *)a)->sbus_poff[((x) & _BLK_REG_MASK) >> \ 385 _BLK_REG_SHFT] + ((x) & 0xff)) 386 387#define BXR2(sbc, off) \ 388 bus_space_read_2(isp->isp_bus_tag, isp->isp_bus_handle, off) 389 390static int |
391isp_sbus_rd_isr(ispsoftc_t *isp, uint32_t *isrp, uint16_t *semap, uint16_t *mbp) | 391isp_sbus_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) |
392{ 393 uint16_t isr, sema; 394 395 isr = BXR2(sbc, IspVirt2Off(isp, BIU_ISR)); 396 sema = BXR2(sbc, IspVirt2Off(isp, BIU_SEMA)); 397 isp_prt(isp, ISP_LOGDEBUG3, "ISR 0x%x SEMA 0x%x", isr, sema); 398 isr &= INT_PENDING_MASK(isp); 399 sema &= BIU_SEMA_LOCK; 400 if (isr == 0 && sema == 0) { 401 return (0); 402 } 403 *isrp = isr; | 392{ 393 uint16_t isr, sema; 394 395 isr = BXR2(sbc, IspVirt2Off(isp, BIU_ISR)); 396 sema = BXR2(sbc, IspVirt2Off(isp, BIU_SEMA)); 397 isp_prt(isp, ISP_LOGDEBUG3, "ISR 0x%x SEMA 0x%x", isr, sema); 398 isr &= INT_PENDING_MASK(isp); 399 sema &= BIU_SEMA_LOCK; 400 if (isr == 0 && sema == 0) { 401 return (0); 402 } 403 *isrp = isr; |
404 if ((*semap = sema) != 0) { 405 *mbp = BXR2(sbc, IspVirt2Off(isp, OUTMAILBOX0)); 406 } | 404 if ((*semap = sema) != 0) 405 *info = BXR2(sbc, IspVirt2Off(isp, OUTMAILBOX0)); |
407 return (1); 408} 409 410static uint32_t 411isp_sbus_rd_reg(ispsoftc_t *isp, int regoff) 412{ 413 uint16_t rval; 414 struct isp_sbussoftc *sbs = (struct isp_sbussoftc *) isp; --- 305 unchanged lines hidden --- | 406 return (1); 407} 408 409static uint32_t 410isp_sbus_rd_reg(ispsoftc_t *isp, int regoff) 411{ 412 uint16_t rval; 413 struct isp_sbussoftc *sbs = (struct isp_sbussoftc *) isp; --- 305 unchanged lines hidden --- |