components/open-fabrics/libsif/include/psifapi/psif_hw_data_be.h
changeset 7120 b01185225eaa
parent 5564 e533d5840fdd
equal deleted inserted replaced
7119:2f82d964b8be 7120:b01185225eaa
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     3  */
     3  */
     4 
     4 
     5 /*
     5 /*
     6  * Redistribution and use in source and binary forms, with or without modification,
     6  * Redistribution and use in source and binary forms, with or without
     7  * are permitted provided that the following conditions are met:
     7  *  modification, are permitted provided that the following conditions are met:
     8  *
     8  *
     9  * 1. Redistributions of source code must retain the above copyright notice,
     9  * 1. Redistributions of source code must retain the above copyright notice,
    10  *    this list of conditions and the following disclaimer.
    10  *    this list of conditions and the following disclaimer.
    11  *
    11  *
    12  * 2. Redistributions in binary form must reproduce the above copyright notice,
    12  * 2. Redistributions in binary form must reproduce the above copyright notice,
    13  *    this list of conditions and the following disclaimer in the documentation
    13  *    this list of conditions and the following disclaimer in the documentation
    14  *    and/or other materials provided with the distribution.
    14  *    and/or other materials provided with the distribution.
    15  *
    15  *
    16  * 3. Neither the name of the copyright holder nor the names of its contributors
    16  * 3. Neither the name of the copyright holder nor the names of its contributors
    17  *    may be used to endorse or promote products derived from this software without
    17  *    may be used to endorse or promote products derived from this software
    18  *    specific prior written permission.
    18  *    without specific prior written permission.
    19  *
    19  *
    20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    22  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    23  * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
    23  * ARE DISCLAIMED.
    24  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
    24  * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
    25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    25  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    26  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    27  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
    27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    28  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
    28  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    29  * OF THE POSSIBILITY OF SUCH DAMAGE.
    29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
       
    30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    30  */
    31  */
    31 
    32 
    32 #ifndef	_PSIF_HW_DATA_H_BE
    33 #ifndef	_PSIF_HW_DATA_H_BE
    33 #define	_PSIF_HW_DATA_H_BE
    34 #define	_PSIF_HW_DATA_H_BE
       
    35 
       
    36 /* CSR automated type for TSU_MMU_MMU_CONFIG */
       
    37 /* MMU Static-Configuration and Status */
       
    38 struct psif_csr_mmu_config {
       
    39 	u16	noname:4;
       
    40 	u16	pa_upper_twelve:12;
       
    41 	u16	noname1:4;
       
    42 	u16	ta_upper_twelve:12;
       
    43 	u16	cam_par_err_fatal:1;
       
    44 	u16	dis_table_ptr_trans:1;
       
    45 	u16	noname2:2;
       
    46 	u16	ptwc_hash_sel:2;
       
    47 	u16	dma_cnt_mask:8;
       
    48 	u16	sparc_pages:1;
       
    49 	u16	bit_sixty_three_value:1;
       
    50 	u16	chk_bit_sixty_three:1;
       
    51 	u16	chk_upper_addr_bits:1;
       
    52 	u16	swap_rsp:1;
       
    53 	u16	mmuc_hash_select:2;
       
    54 	u16	random_evict:1;
       
    55 	u16	mmuc_evict_algorithm:1;
       
    56 	u16	ptwc_evict_algorithm:1;
       
    57 	u16	cam_evict_cntr_cnt_sel:5;
       
    58 	u16	cam_evict_cntr_prescale_sel:3;
       
    59 } PSIF_PACKED_ALIGNED; /* struct psif_csr_mmu_config [ 8 byte] */
       
    60 
       
    61 /**
       
    62  * \brief Definition of struct returned by EPSC_QUERY_EXTERNAL_PORT_INFO
       
    63  * \details
       
    64  * This struct is returning several attributes of the external IB port. The vHCA IB portnumber
       
    65  * is set in the index field. Values returned maches description in PortInfo (See IB specification
       
    66  * 1.3 vol1 chapter 14.2.5.6), except for active speed which will return values as defined in
       
    67  * psif_port_speed.
       
    68  * \par Width
       
    69  *      64 bit
       
    70  * \par Used in
       
    71  * the parameter for the PSIF_QUERY sub-operation EPSC_QUERY_PORT_INFO - vHCA IB portnumber set in index field
       
    72  * \par Classification
       
    73  *      internal, development
       
    74  */
       
    75 
       
    76 struct psif_epsc_query_external_port_info {
       
    77 	/**< LID of the IB device connected to the external port */
       
    78 
       
    79 	u16	lid;
       
    80 	/**< IB port number of external port (on the IB device above) */
       
    81 
       
    82 	u16	portnumber:8;
       
    83 	/**< IB port state of external port values will match psif_epsc_port_state_t */
       
    84 
       
    85 	u16	port_state:4;
       
    86 	/**< Physical port state of IB port */
       
    87 
       
    88 	u16	port_physical_state:4;
       
    89 	/**< IB LinkSpeedActive of external port */
       
    90 
       
    91 	enum psif_port_speed	active_speed:8;
       
    92 
       
    93 	/**< IB LinkWidthActive of external port */
       
    94 
       
    95 	u16	active_width:8;
       
    96 	/**< Active MTU of external port (values will match psif_epsc_path_mtu_t */
       
    97 
       
    98 	u16	active_mtu:4;
       
    99 	/**< Number of operational Data VLs */
       
   100 
       
   101 	u16	operational_vls:4;
       
   102 	/**< Reserved */
       
   103 
       
   104 	u16	noname:8;
       
   105 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_query_external_port_info [ 8 byte] */
    34 
   106 
    35 /*
   107 /*
    36  * Context used by tsu_mmu when performing address translation. The structure
   108  * Context used by tsu_mmu when performing address translation. The structure
    37  * is follows: [63:56] st [55:55] no_snoop [54:53] tph [52:52] ro [51:12]
   109  * is follows: [63:56] st [55:55] no_snoop [54:53] tph [52:52] ro [51:12]
    38  * table_ptr [11:11] th [10:8] translation_type [7:4] page_size [3:3]
   110  * table_ptr [11:11] th [10:8] translation_type [7:4] page_size [3:3]
   808  */
   880  */
   809 struct psif_sq_ring {
   881 struct psif_sq_ring {
   810 	u64	something;
   882 	u64	something;
   811 } PSIF_PACKED_ALIGNED; /* struct psif_sq_ring [ 8 byte] */
   883 } PSIF_PACKED_ALIGNED; /* struct psif_sq_ring [ 8 byte] */
   812 
   884 
   813 /* Temp.definition of the send queue entry cache for the completion block 
   885 /* Temp. definition of the send queue entry cache for the completion block.
   814  * The only info used by the driver is the size of this struct,
   886  * The only info used by the driver is the size of this struct,
   815  * when allocating space for the cache in memory:
   887  * when allocating space for the cache in memory:
   816  */
   888  */
   817 struct psif_sq_cmpl {
   889 struct psif_sq_cmpl {
   818 	/* Content pt. not defined in ASIC XML */
   890 	/* Content pt. not defined in ASIC XML */
  1581  * Modify/query QP attributes. Bit mask indicating which field should be
  1653  * Modify/query QP attributes. Bit mask indicating which field should be
  1582  * modified.
  1654  * modified.
  1583  */
  1655  */
  1584 struct psif_qp_attributes {
  1656 struct psif_qp_attributes {
  1585 	/* Manually added spacing to pad outpsif_qp_attributes */
  1657 	/* Manually added spacing to pad outpsif_qp_attributes */
  1586 	u8	:7;
  1658 	u8	pad92:7;
  1587 	/* Change path req_access error if set. */
  1659 	/* Change path req_access error if set. */
  1588 	u8	req_access_error:1;
  1660 	u8	req_access_error:1;
  1589 	/* Change path MTU if set. */
  1661 	/* Change path MTU if set. */
  1590 	u16	path_mtu:1;
  1662 	u16	path_mtu:1;
  1591 	/* Change expected PSN (RQ PSN) if set. */
  1663 	/* Change expected PSN (RQ PSN) if set. */
  1836 	 * is seen, there are no outstanding transactions towards RQs or CQs for the
  1908 	 * is seen, there are no outstanding transactions towards RQs or CQs for the
  1837 	 * QP, and it should be safe to take these queues down.
  1909 	 * QP, and it should be safe to take these queues down.
  1838 	 */
  1910 	 */
  1839 	u32	notify_when_zero:1;
  1911 	u32	notify_when_zero:1;
  1840 	/* Manually added spacing to pad out psif_modify_command */
  1912 	/* Manually added spacing to pad out psif_modify_command */
  1841 	u32	:3;
  1913 	u32	pad93:3;
  1842 } PSIF_PACKED; /* struct psif_modify_command [ 5 byte] */
  1914 } PSIF_PACKED; /* struct psif_modify_command [ 5 byte] */
  1843 
  1915 
  1844 /*
  1916 /*
  1845  * Structure defining DMA Key Validation entries. This structure is specific
  1917  * Structure defining DMA Key Validation entries. This structure is specific
  1846  * to IB and has information about R/L-Key states. One entry kan represent an
  1918  * to IB and has information about R/L-Key states. One entry kan represent an
  1899 	u64	base_addr;
  1971 	u64	base_addr;
  1900 } PSIF_PACKED_ALIGNED; /* struct psif_key [32 byte] */
  1972 } PSIF_PACKED_ALIGNED; /* struct psif_key [32 byte] */
  1901 
  1973 
  1902 /**
  1974 /**
  1903  * Flash image header format for application image
  1975  * Flash image header format for application image
  1904  * extention of struct psif_flash_header_all
  1976  * extension of struct psif_flash_header_all
  1905  */
  1977  */
  1906 struct psif_flash_header_app {
  1978 struct psif_flash_header_app {
  1907 	/* byte[4:7] image type */
  1979 	/* byte[4:7] image type */
  1908 	enum psif_flash_image_type	type:32;
  1980 	enum psif_flash_image_type	type:32;
  1909 
  1981 
  2098 	u32	noname:32;
  2170 	u32	noname:32;
  2099 	/* sequence number for sanity checking */
  2171 	/* sequence number for sanity checking */
  2100 	u32	seq_num;
  2172 	u32	seq_num;
  2101 } PSIF_PACKED_ALIGNED32; /* struct psif_eq_entry [64 byte] */
  2173 } PSIF_PACKED_ALIGNED32; /* struct psif_eq_entry [64 byte] */
  2102 
  2174 
  2103 struct psif_epsc_log_stat {
       
  2104 	/* Owned by epsc runs all the way to 64 bit */
       
  2105 	u64	produce_offset;
       
  2106 	/* Owned by host */
       
  2107 	u64	consume_offset;
       
  2108 	/* Owned by host real offset modulo sz */
       
  2109 	u64	size;
       
  2110 	/* Allign to 32 byte */
       
  2111 	u64	pad;
       
  2112 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_log_stat [32 byte] */
       
  2113 
       
  2114 /**
  2175 /**
  2115  * CSR Query port structure
  2176  * CSR Query port structure
  2116  */
  2177  */
  2117 struct psif_epsc_port_attr {
  2178 struct psif_epsc_port_attr {
  2118 	/** port number */
  2179 	/** port number */
  2145 	u64	phys_state:8;
  2206 	u64	phys_state:8;
  2146 	u64	noname:48;
  2207 	u64	noname:48;
  2147 	u64	pad;
  2208 	u64	pad;
  2148 } PSIF_PACKED_ALIGNED32; /* struct psif_epsc_port_attr [64 byte] */
  2209 } PSIF_PACKED_ALIGNED32; /* struct psif_epsc_port_attr [64 byte] */
  2149 
  2210 
       
  2211 struct psif_epsc_log_stat {
       
  2212 	/* Owned by epsc runs all the way to 64 bit */
       
  2213 	u64	produce_offset;
       
  2214 	/* Owned by host */
       
  2215 	u64	consume_offset;
       
  2216 	/* Owned by host real offset modulo sz */
       
  2217 	u64	size;
       
  2218 	/* Allign to 32 byte */
       
  2219 	u64	pad;
       
  2220 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_log_stat [32 byte] */
       
  2221 
  2150 /**
  2222 /**
  2151  * Query GID response in host memory
  2223  * Query GID response in host memory
  2152  */
  2224  */
  2153 struct psif_epsc_gid_attr {
  2225 struct psif_epsc_gid_attr {
  2154 	u64	gid_0;
  2226 	u64	gid_0;
  2157 
  2229 
  2158 /**
  2230 /**
  2159  * Populate MMU table
  2231  * Populate MMU table
  2160  */
  2232  */
  2161 struct psif_epsc_exercise_mmu {
  2233 struct psif_epsc_exercise_mmu {
  2162 	/* Start adress */
  2234 	/* Start address */
  2163 	u64	host_addr;
  2235 	u64	host_addr;
  2164 	/* MMU context supplied by driver */
  2236 	/* MMU context supplied by driver */
  2165 	struct psif_mmu_cntx	mmu_cntx;
  2237 	struct psif_mmu_cntx	mmu_cntx;
  2166 	/* Buffer length in bytes */
  2238 	/* Buffer length in bytes */
  2167 	u64	length;
  2239 	u64	length;
  2221 	u64	noname:8;
  2293 	u64	noname:8;
  2222 	u64	pad;
  2294 	u64	pad;
  2223 } PSIF_PACKED_ALIGNED32; /* struct psif_epsc_device_attr [192 byte] */
  2295 } PSIF_PACKED_ALIGNED32; /* struct psif_epsc_device_attr [192 byte] */
  2224 
  2296 
  2225 /**
  2297 /**
       
  2298  * For data in response structure of EPSC_BER_DATA Op.
       
  2299  */
       
  2300 struct psif_epsc_csr_rsp_ber_data {
       
  2301 	/* Received signal values (H0 values) for each Serdes Channel per port.
       
  2302 	 status_rxd_reg0 in Sonoma PRM */
       
  2303 	u64	received_signal_values[4];
       
  2304 	/* Number of elements is same as psif_epsc_csr_ber_counters enum */
       
  2305 	u64	ber_counters[5];
       
  2306 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_rsp_ber_data [72 byte] */
       
  2307 
       
  2308 /**
  2226  * The eps-c fw csr to host sw completion
  2309  * The eps-c fw csr to host sw completion
  2227  * Response to a CSR request
  2310  * Response to a CSR request
  2228  */
  2311  */
  2229 struct psif_epsc_csr_rsp {
  2312 struct psif_epsc_csr_rsp {
  2230 	/* return status of operation */
  2313 	/* return status of operation */
  2273 	struct psif_mmu_cntx	mmu_context;
  2356 	struct psif_mmu_cntx	mmu_context;
  2274 	/** number of entries in the table */
  2357 	/** number of entries in the table */
  2275 	u32	num_entries;
  2358 	u32	num_entries;
  2276 	/** unused (padding) */
  2359 	/** unused (padding) */
  2277 	u32	noname:27;
  2360 	u32	noname:27;
  2278 	/** size of an entry as log2 value. The address to an entry is calculated
  2361 	/**
  2279 	 *  as host_addr + entry_num*(1 << extent_log2) */
  2362 	 * Size of an entry as log2 value. The address to an entry is calculated
       
  2363 	 * as host_addr + entry_num*(1 << extent_log2).
       
  2364 	 */
  2280 	u32	extent_log2:5;
  2365 	u32	extent_log2:5;
  2281 	/** MSI-X interrupt index only valid for EQ setup */
  2366 	/** MSI-X interrupt index only valid for EQ setup */
  2282 	u32	msix_index;
  2367 	u32	msix_index;
  2283 	/** unused (padding) */
  2368 	/** unused (padding) */
  2284 	u32	noname1:32;
  2369 	u32	noname1:32;
  2318 	 * is seen, there are no outstanding transactions towards RQs or CQs for the
  2403 	 * is seen, there are no outstanding transactions towards RQs or CQs for the
  2319 	 * QP, and it should be safe to take these queues down.
  2404 	 * QP, and it should be safe to take these queues down.
  2320 	 */
  2405 	 */
  2321 	u64	notify_when_zero:1;
  2406 	u64	notify_when_zero:1;
  2322 	/* Manually added spacing to pad out psif_modify_command */
  2407 	/* Manually added spacing to pad out psif_modify_command */
  2323 	u64	:3;
  2408 	u64	pad97:3;
  2324 	/* Inlined cmd_attributes : struct psif_qp_attributes (24 bits) */
  2409 	/* Inlined cmd_attributes : struct psif_qp_attributes (24 bits) */
  2325 	/* Manually added spacing to pad outpsif_qp_attributes */
  2410 	/* Manually added spacing to pad outpsif_qp_attributes */
  2326 	u64	:7;
  2411 	u64	pad98:7;
  2327 	/* Change path req_access error if set. */
  2412 	/* Change path req_access error if set. */
  2328 	u64	req_access_error:1;
  2413 	u64	req_access_error:1;
  2329 	/* Change path MTU if set. */
  2414 	/* Change path MTU if set. */
  2330 	u16	path_mtu:1;
  2415 	u16	path_mtu:1;
  2331 	/* Change expected PSN (RQ PSN) if set. */
  2416 	/* Change expected PSN (RQ PSN) if set. */
  2565 
  2650 
  2566 /**
  2651 /**
  2567  * Test operations : EPSC_TEST_HOST_RD & EPSC_TEST_HOST_WR
  2652  * Test operations : EPSC_TEST_HOST_RD & EPSC_TEST_HOST_WR
  2568  */
  2653  */
  2569 struct psif_epsc_csr_test_host_wrd {
  2654 struct psif_epsc_csr_test_host_wrd {
  2570 	struct psif_mmu_cntx	mmu_cntx;
       
  2571 	u64	host_addr;
  2655 	u64	host_addr;
       
  2656 	u32	key;
  2572 	u32	epsc_offs;
  2657 	u32	epsc_offs;
  2573 	u32	length;
  2658 	u32	length;
  2574 	/* pattern number 0..xxx */
  2659 	/* pattern number 0..xxx */
  2575 	u32	pattern;
  2660 	u32	pattern;
  2576 	u32	noname:32;
  2661 	u64	reserved_1[8];
  2577 	u64	reserved_2[7];
       
  2578 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_test_host_wrd [88 byte] */
  2662 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_test_host_wrd [88 byte] */
  2579 
  2663 
  2580 /**
  2664 /**
  2581  * Flash programming: EPSC_FLASH_START, EPSC_FLASH_RD,
  2665  * Flash programming: EPSC_FLASH_START, EPSC_FLASH_RD,
  2582  *                    EPSC_FLASH_WR & EPSC_FLASH_STOP
  2666  *                    EPSC_FLASH_WR & EPSC_FLASH_STOP
  2590 	u64	reserved[7];
  2674 	u64	reserved[7];
  2591 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_flash_access [88 byte] */
  2675 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_flash_access [88 byte] */
  2592 
  2676 
  2593 /**
  2677 /**
  2594  * IB packet trace acquire : EPSC_TRACE_ACQUIRE
  2678  * IB packet trace acquire : EPSC_TRACE_ACQUIRE
  2595  *
       
  2596  */
  2679  */
  2597 struct psif_epsc_csr_trace_acquire {
  2680 struct psif_epsc_csr_trace_acquire {
  2598 	/* Pointer to trace buffer */
  2681 	/* Pointer to trace buffer */
  2599 	u64	host_addr;
  2682 	u64	host_addr;
  2600 	/* Buffer offset in bytes */
  2683 	/* Buffer offset in bytes */
  2622 	enum psif_epsc_log_level	level:32;
  2705 	enum psif_epsc_log_level	level:32;
  2623 
  2706 
  2624 	/* Log mode to use */
  2707 	/* Log mode to use */
  2625 	enum psif_epsc_log_mode	mode:32;
  2708 	enum psif_epsc_log_mode	mode:32;
  2626 
  2709 
  2627 	/* Fields only used by log mode EPSC_LOG_MODE_HOST:
  2710 	/*
  2628 	 Start address of the data area to write to */
  2711 	 * Fields only used by log mode EPSC_LOG_MODE_HOST:
       
  2712 	 * Start address of the data area to write to.
       
  2713 	 */
  2629 	u64	base;
  2714 	u64	base;
  2630 	/* pointer to a log_stat data area */
  2715 	/* pointer to a log_stat data area */
  2631 	u64	stat_base;
  2716 	u64	stat_base;
  2632 	/* Length in bytes of the buffer */
  2717 	/* Length in bytes of the buffer */
  2633 	u64	length;
  2718 	u64	length;
  2651 	u64	epsa_addr;
  2736 	u64	epsa_addr;
  2652 	u64	reserved[8];
  2737 	u64	reserved[8];
  2653 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_epsa_cntrl [88 byte] */
  2738 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_epsa_cntrl [88 byte] */
  2654 
  2739 
  2655 /**
  2740 /**
  2656  * EPS-A to EPS-A
  2741  * host to EPS-A
  2657  */
  2742  */
  2658 struct psif_epsc_csr_epsa_cmd {
  2743 struct psif_epsc_csr_epsa_cmd {
  2659 	enum psif_epsa_command	cmd:32;
  2744 	enum psif_epsa_command	cmd:32;
  2660 
  2745 
  2661 	u32	length;
  2746 	u32	length;
  2662 	/* MMU context supplied by driver */
  2747 	/* Buffer address in host memory */
  2663 	struct psif_mmu_cntx	mmu_cntx;
       
  2664 	/* Buffer adress in host memory */
       
  2665 	u64	host_addr;
  2748 	u64	host_addr;
  2666 	u8	entry_point[16];
  2749 	u8	entry_point[16];
  2667 	u32	key;
  2750 	u32	key;
  2668 	u32	qpnum;
  2751 	u32	qpnum;
  2669 	u64	reserved[5];
  2752 	u64	reserved[6];
  2670 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_epsa_cmd [88 byte] */
  2753 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_epsa_cmd [88 byte] */
  2671 
  2754 
  2672 /**
  2755 /**
  2673  * EPSC_CLI_ACCESS - buffer size is assumed to be 4K
  2756  * EPSC_CLI_ACCESS - buffer size is presumed to be 2K
  2674  */
  2757  */
  2675 struct psif_epsc_csr_cli_access {
  2758 struct psif_epsc_csr_cli_access {
  2676 	u64	host_addr;
  2759 	u64	host_addr;
  2677 	struct psif_mmu_cntx	mmu_cntx;
  2760 	struct psif_mmu_cntx	mmu_cntx;
  2678 	u8	command[72];
  2761 	u8	command[72];
  2752 	u64	reserved[6];
  2835 	u64	reserved[6];
  2753 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_query [88 byte] */
  2836 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_query [88 byte] */
  2754 
  2837 
  2755 /**
  2838 /**
  2756  * Structure for EPSC_SET
  2839  * Structure for EPSC_SET
  2757  *
       
  2758  */
  2840  */
  2759 struct psif_epsc_csr_set {
  2841 struct psif_epsc_csr_set {
  2760 	/* UF number */
  2842 	/* UF number */
  2761 	u32	uf;
  2843 	u32	uf;
  2762 	/* Future */
  2844 	/* Future */
  2900 	 */
  2982 	 */
  2901 	u64	clear_mask;
  2983 	u64	clear_mask;
  2902 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_pma_counters [32 byte] */
  2984 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_pma_counters [32 byte] */
  2903 
  2985 
  2904 /** \brief Command params for opcode EPSC_VIMMA_CTRL_SET_VFP_VHCA_DEREGISTER
  2986 /** \brief Command params for opcode EPSC_VIMMA_CTRL_SET_VFP_VHCA_DEREGISTER
  2905  \note
  2987  *  \note This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
  2906  This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
  2988  *  \par Classification
  2907  \par Classification
  2989  *       external
  2908  external
       
  2909  */
  2990  */
  2910 struct psif_epsc_vimma_dereg {
  2991 struct psif_epsc_vimma_dereg {
  2911 	/* size 5*u64 */
  2992 	/* size 5*u64 */
  2912 	u32	noname:32;
  2993 	u32	noname:32;
  2913 	/* lowest uf index set in array below */
  2994 	/* lowest uf index set in array below */
  2917 	/* allows multi UF setting. bit0 = UF0 bit1 = UF1 etc. */
  2998 	/* allows multi UF setting. bit0 = UF0 bit1 = UF1 etc. */
  2918 	u64	uf_vector[4];
  2999 	u64	uf_vector[4];
  2919 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_dereg [40 byte] */
  3000 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_dereg [40 byte] */
  2920 
  3001 
  2921 /** \brief Struct defintion for vHCA registration details
  3002 /** \brief Struct defintion for vHCA registration details
  2922  \note
  3003  * \note This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
  2923  This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
  3004  * \par Classification
  2924  \par Classification
  3005  *      external
  2925  external
       
  2926  */
  3006  */
  2927 struct psif_epsc_vimma_vfp_reg {
  3007 struct psif_epsc_vimma_vfp_reg {
  2928 	/* size 5*u64 */
  3008 	/* size 5*u64 */
  2929 	u16	uf;
  3009 	u16	uf;
  2930 	u16	noname:16;
  3010 	u16	noname:16;
  2935 	u16	noname1:16;
  3015 	u16	noname1:16;
  2936 	u64	noname2:64;
  3016 	u64	noname2:64;
  2937 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_vfp_reg [40 byte] */
  3017 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_vfp_reg [40 byte] */
  2938 
  3018 
  2939 /** \brief Command params for opcode EPSC_VIMMA_CTRL_SET_ADMIN_MODE
  3019 /** \brief Command params for opcode EPSC_VIMMA_CTRL_SET_ADMIN_MODE
  2940  \note
  3020  *  \note This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
  2941  This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
  3021  *  \par Classification
  2942  \par Classification
  3022  *       external
  2943  external
       
  2944  */
  3023  */
  2945 struct psif_epsc_vimma_set_admmode {
  3024 struct psif_epsc_vimma_set_admmode {
  2946 	/* size 5*u64 */
  3025 	/* size 5*u64 */
  2947 	enum psif_epsc_vimma_admmode	mode:16;
  3026 	enum psif_epsc_vimma_admmode	mode:16;
  2948 
  3027 
  2954 	/* allows multi UF setting. bit0 = UF0 bit1 = UF1 etc. */
  3033 	/* allows multi UF setting. bit0 = UF0 bit1 = UF1 etc. */
  2955 	u64	uf_vector[4];
  3034 	u64	uf_vector[4];
  2956 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_set_admmode [40 byte] */
  3035 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_set_admmode [40 byte] */
  2957 
  3036 
  2958 /** \brief Command params for opcode EPSC_VIMMA_CTRL_SET_VFP_VHCA_REGISTER
  3037 /** \brief Command params for opcode EPSC_VIMMA_CTRL_SET_VFP_VHCA_REGISTER
  2959  \note
  3038  *  \note This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
  2960  This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_VFP_CAPS
  3039  *  \par Classification
  2961  \par Classification
  3040  *       external
  2962  external
       
  2963  */
  3041  */
  2964 struct psif_epsc_vimma_reg_info {
  3042 struct psif_epsc_vimma_reg_info {
  2965 	u32	noname:32;
  3043 	u32	noname:32;
  2966 	/* lowest uf index set in array below */
  3044 	/* lowest uf index set in array below */
  2967 	u16	low_uf;
  3045 	u16	low_uf;
  2970 	/* allows multi UF setting. bit0 = UF0 bit1 = UF1 etc. */
  3048 	/* allows multi UF setting. bit0 = UF0 bit1 = UF1 etc. */
  2971 	u64	uf_vector[4];
  3049 	u64	uf_vector[4];
  2972 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_reg_info [40 byte] */
  3050 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_vimma_reg_info [40 byte] */
  2973 
  3051 
  2974 /** \brief Defining params for VIMMA opcodes
  3052 /** \brief Defining params for VIMMA opcodes
  2975  \par Classification
  3053  *  \par Classification
  2976  external
  3054  *       external
  2977  */
  3055  */
  2978 union psif_epsc_vimma_ctrl_cmd {
  3056 union psif_epsc_vimma_ctrl_cmd {
  2979 	/* all union elements are size 5*u64 */
  3057 	/* all union elements are size 5*u64 */
  2980 	struct psif_epsc_vimma_dereg	dereg;
  3058 	struct psif_epsc_vimma_dereg	dereg;
  2981 	struct psif_epsc_vimma_vfp_reg	vfp_reg;
  3059 	struct psif_epsc_vimma_vfp_reg	vfp_reg;
  2982 	struct psif_epsc_vimma_set_admmode	adm_mode;
  3060 	struct psif_epsc_vimma_set_admmode	adm_mode;
  2983 	struct psif_epsc_vimma_reg_info	reg_info;
  3061 	struct psif_epsc_vimma_reg_info	reg_info;
  2984 } PSIF_PACKED; /* union psif_epsc_vimma_ctrl_cmd [40 byte] */
  3062 } PSIF_PACKED; /* union psif_epsc_vimma_ctrl_cmd [40 byte] */
  2985 
  3063 
  2986 /** \brief Defines the complete command params for VIMMA opcodes
  3064 /** \brief Defines the complete command params for VIMMA opcodes
  2987  \note
  3065  *  \note This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_BASIC_CAPS
  2988  This struct belongs to capability: EPSC_VIMMA_CTRL_CAP_PSIF_BASIC_CAPS
  3066  *   and should never change in an incompatible way.
  2989  and should never change in an incompatible way.
  3067  *  \par Classification
  2990  \par Classification
  3068  *       external
  2991  external
       
  2992  */
  3069  */
  2993 struct psif_epsc_csr_vimma_ctrl {
  3070 struct psif_epsc_csr_vimma_ctrl {
  2994 	/* VIMMA sub-opcodes triggered by EPSC_VIMMA_CTRL */
  3071 	/* VIMMA sub-opcodes triggered by EPSC_VIMMA_CTRL */
  2995 	enum psif_epsc_vimma_ctrl_opcode	opcode:32;
  3072 	enum psif_epsc_vimma_ctrl_opcode	opcode:32;
  2996 
  3073 
  3003 	/* Place to DMA back longer responses during retrieval */
  3080 	/* Place to DMA back longer responses during retrieval */
  3004 	u64	host_addr;
  3081 	u64	host_addr;
  3005 	/* Summing up to 11 * u64 which is total and max */
  3082 	/* Summing up to 11 * u64 which is total and max */
  3006 	u64	reserved[3];
  3083 	u64	reserved[3];
  3007 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_vimma_ctrl [88 byte] */
  3084 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_vimma_ctrl [88 byte] */
       
  3085 
       
  3086 /**
       
  3087  * Structure for EPSC_BER_DATA
       
  3088  */
       
  3089 struct psif_epsc_csr_ber_data {
       
  3090 	/* Buffer address in host memory */
       
  3091 	u64	host_addr;
       
  3092 	/* MMU supplied by the driver */
       
  3093 	struct psif_mmu_cntx	mmu_cntx;
       
  3094 	/* IBU port number */
       
  3095 	u32	port;
       
  3096 	/* Buffer length in bytes */
       
  3097 	u32	len;
       
  3098 } PSIF_PACKED_ALIGNED; /* struct psif_epsc_csr_ber_data [24 byte] */
  3008 
  3099 
  3009 /* Public API for mailbox requests details */
  3100 /* Public API for mailbox requests details */
  3010 union psif_epsc_csr_details {
  3101 union psif_epsc_csr_details {
  3011 	/* Anonymous data */
  3102 	/* Anonymous data */
  3012 	struct psif_epsc_csr_opaque	opaque;
  3103 	struct psif_epsc_csr_opaque	opaque;
  3072 	struct psif_epsc_flush_caches	flush_caches;
  3163 	struct psif_epsc_flush_caches	flush_caches;
  3073 	/* PMA counters query */
  3164 	/* PMA counters query */
  3074 	struct psif_epsc_csr_pma_counters	pma_counters;
  3165 	struct psif_epsc_csr_pma_counters	pma_counters;
  3075 	/* EPSC_VIMMA_CTRL: VIMMA functions */
  3166 	/* EPSC_VIMMA_CTRL: VIMMA functions */
  3076 	struct psif_epsc_csr_vimma_ctrl	vimma_ctrl;
  3167 	struct psif_epsc_csr_vimma_ctrl	vimma_ctrl;
       
  3168 	/* BER data query */
       
  3169 	struct psif_epsc_csr_ber_data	ber;
  3077 } PSIF_PACKED; /* union psif_epsc_csr_details [88 byte] */
  3170 } PSIF_PACKED; /* union psif_epsc_csr_details [88 byte] */
  3078 
  3171 
  3079 /**
  3172 /**
  3080  * The host sw to eps-c fw csr workrequest
  3173  * The host sw to eps-c fw csr workrequest
  3081  *
  3174  *
  3114 
  3207 
  3115 /**
  3208 /**
  3116  * Basic configuration data for each UF
  3209  * Basic configuration data for each UF
  3117  */
  3210  */
  3118 struct psif_epsc_csr_config {
  3211 struct psif_epsc_csr_config {
  3119 	/** Minor protocol version identifier. */
  3212 	/** Major EPS API version identifier. */
  3120 	u32	minor_ver;
  3213 	u16	epsapi_major_ver;
  3121 	/** Major protocol version identifier. */
  3214 	/** Minor EPS API version identifier. */
  3122 	u32	major_ver;
  3215 	u16	epsapi_minor_ver;
       
  3216 	/** Major HW API version identifier. */
       
  3217 	u16	hwapi_major_ver;
       
  3218 	/** Minor HW API version identifier. */
       
  3219 	u16	hwapi_minor_ver;
  3123 	/** Request base address. */
  3220 	/** Request base address. */
  3124 	u64	request;
  3221 	u64	request;
  3125 	/** Respose base address. */
  3222 	/** Respose base address. */
  3126 	u64	response;
  3223 	u64	response;
  3127 	/** Number of entries in table. */
  3224 	/** Number of entries in table. */
  3418 	u64	address;
  3515 	u64	address;
  3419 	struct psif_mmu_cntx	mmu_context;
  3516 	struct psif_mmu_cntx	mmu_context;
  3420 	/* Number of entries in table. */
  3517 	/* Number of entries in table. */
  3421 	u32	num_entries;
  3518 	u32	num_entries;
  3422 	/* Manually added spacing to pad out base addr */
  3519 	/* Manually added spacing to pad out base addr */
  3423 	u32	:27;
  3520 	u32	pad104:27;
  3424 	/*
  3521 	/*
  3425 	 * clog2_extent used for entry alignment. This field used to calculate
  3522 	 * clog2_extent used for entry alignment. This field used to calculate
  3426 	 * address for a particular entry. Address to an entry is calculated as
  3523 	 * address for a particular entry. Address to an entry is calculated as
  3427 	 * follows: host_addr + entry_num*(1 (leftshift) clog2_extent)
  3524 	 * follows: host_addr + entry_num*(1 (leftshift) clog2_extent)
  3428 	 */
  3525 	 */
  3435 	u64	orig_data;
  3532 	u64	orig_data;
  3436 	/* [191:184] padding. always zero */
  3533 	/* [191:184] padding. always zero */
  3437 	u32	zero:8;
  3534 	u32	zero:8;
  3438 	/* [183:160] psn */
  3535 	/* [183:160] psn */
  3439 	u32	psn:24;
  3536 	u32	psn:24;
  3440 	/* [159] When set to one entry has been used. When set to zero 
  3537 	/*
  3441 	 no duplicate has been written in this entry. */
  3538 	 * [159] When set to one, entry has been used. When set to zero,
       
  3539 	 * no duplicate has been written in this entry.
       
  3540 	 */
  3442 	u32	used:1;
  3541 	u32	used:1;
  3443 	/* [158] This atomic response was in error. */
  3542 	/* [158] This atomic response was in error. */
  3444 	u32	response_error:1;
  3543 	u32	response_error:1;
  3445 	/* [157:0] Padding. Always set to zero. */
  3544 	/* [157:0] Padding. Always set to zero. */
  3446 	u32	padding:30;
  3545 	u32	padding:30;
  3447 	u64	reserved[2];
  3546 	u64	reserved[2];
  3448 } PSIF_PACKED_ALIGNED; /* struct psif_atomic_retry_element [32 byte] */
  3547 } PSIF_PACKED_ALIGNED; /* struct psif_atomic_retry_element [32 byte] */
  3449 
  3548 
  3450 /* Data type for TSU_HOST_QP_BASE_ADDR - atomic replay scratch pad
  3549 /*
       
  3550  * Data type for TSU_HOST_QP_BASE_ADDR - atomic replay scratch pad
  3451  *  Layout as of 16 deep atomic queue - elements padded to 32 byte
  3551  *  Layout as of 16 deep atomic queue - elements padded to 32 byte
  3452  */
  3552  */
  3453 struct psif_atsp {
  3553 struct psif_atsp {
  3454 	struct psif_atomic_retry_element	retry[16];
  3554 	struct psif_atomic_retry_element	retry[16];
  3455 } PSIF_PACKED_ALIGNED; /* struct psif_atsp [512 byte] */
  3555 } PSIF_PACKED_ALIGNED; /* struct psif_atsp [512 byte] */