1325618Ssbruno/* 2325618Ssbruno * BSD LICENSE 3325618Ssbruno * 4325618Ssbruno * Copyright(c) 2017 Cavium, Inc.. All rights reserved. 5325618Ssbruno * All rights reserved. 6325618Ssbruno * 7325618Ssbruno * Redistribution and use in source and binary forms, with or without 8325618Ssbruno * modification, are permitted provided that the following conditions 9325618Ssbruno * are met: 10325618Ssbruno * 11325618Ssbruno * * Redistributions of source code must retain the above copyright 12325618Ssbruno * notice, this list of conditions and the following disclaimer. 13325618Ssbruno * * Redistributions in binary form must reproduce the above copyright 14325618Ssbruno * notice, this list of conditions and the following disclaimer in 15325618Ssbruno * the documentation and/or other materials provided with the 16325618Ssbruno * distribution. 17325618Ssbruno * * Neither the name of Cavium, Inc. nor the names of its 18325618Ssbruno * contributors may be used to endorse or promote products derived 19325618Ssbruno * from this software without specific prior written permission. 20325618Ssbruno * 21325618Ssbruno * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22325618Ssbruno * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23325618Ssbruno * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24325618Ssbruno * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25325618Ssbruno * OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26325618Ssbruno * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27325618Ssbruno * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28325618Ssbruno * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29325618Ssbruno * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30325618Ssbruno * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31325618Ssbruno * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32325618Ssbruno */ 33325618Ssbruno/*$FreeBSD: stable/11/sys/dev/liquidio/base/cn23xx_pf_device.h 325618 2017-11-09 19:52:56Z sbruno $*/ 34325618Ssbruno 35325618Ssbruno/* \file cn23xx_device.h 36325618Ssbruno * \brief Host Driver: Routines that perform CN23XX specific operations. 37325618Ssbruno */ 38325618Ssbruno 39325618Ssbruno#ifndef __CN23XX_PF_DEVICE_H__ 40325618Ssbruno#define __CN23XX_PF_DEVICE_H__ 41325618Ssbruno 42325618Ssbruno#include "cn23xx_pf_regs.h" 43325618Ssbruno 44325618Ssbruno/* 45325618Ssbruno * Register address and configuration for a CN23XX devices. 46325618Ssbruno * If device specific changes need to be made then add a struct to include 47325618Ssbruno * device specific fields as shown in the commented section 48325618Ssbruno */ 49325618Ssbrunostruct lio_cn23xx_pf { 50325618Ssbruno /* PCI interrupt summary register */ 51325618Ssbruno uint32_t intr_sum_reg64; 52325618Ssbruno 53325618Ssbruno /* PCI interrupt enable register */ 54325618Ssbruno uint32_t intr_enb_reg64; 55325618Ssbruno 56325618Ssbruno /* The PCI interrupt mask used by interrupt handler */ 57325618Ssbruno uint64_t intr_mask64; 58325618Ssbruno 59325618Ssbruno struct lio_config *conf; 60325618Ssbruno}; 61325618Ssbruno 62325618Ssbruno#define BUSY_READING_REG_PF_LOOP_COUNT 10000 63325618Ssbruno 64325618Ssbrunoint lio_cn23xx_pf_setup_device(struct octeon_device *oct); 65325618Ssbruno 66325618Ssbrunouint32_t lio_cn23xx_pf_get_oq_ticks(struct octeon_device *oct, 67325618Ssbruno uint32_t time_intr_in_us); 68325618Ssbruno 69325618Ssbrunoint lio_cn23xx_pf_fw_loaded(struct octeon_device *oct); 70325618Ssbruno 71325618Ssbruno#endif /* __CN23XX_PF_DEVICE_H__ */ 72