]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - sys/contrib/octeon-sdk/cvmx-csr.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / sys / contrib / octeon-sdk / cvmx-csr.h
1 /***********************license start***************
2  * Copyright (c) 2003-2010  Cavium Inc. (support@cavium.com). All rights
3  * reserved.
4  *
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  *   * Redistributions of source code must retain the above copyright
11  *     notice, this list of conditions and the following disclaimer.
12  *
13  *   * Redistributions in binary form must reproduce the above
14  *     copyright notice, this list of conditions and the following
15  *     disclaimer in the documentation and/or other materials provided
16  *     with the distribution.
17
18  *   * Neither the name of Cavium Inc. nor the names of
19  *     its contributors may be used to endorse or promote products
20  *     derived from this software without specific prior written
21  *     permission.
22
23  * This Software, including technical data, may be subject to U.S. export  control
24  * laws, including the U.S. Export Administration Act and its  associated
25  * regulations, and may be subject to export or import  regulations in other
26  * countries.
27
28  * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29  * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR
30  * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31  * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32  * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33  * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34  * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35  * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36  * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE  RISK ARISING OUT OF USE OR
37  * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38  ***********************license end**************************************/
39
40
41
42
43
44
45
46 /**
47  * @file
48  *
49  * Configuration and status register (CSR) address and type definitions for
50  * Octoen.
51  *
52  * <hr>$Revision: 70030 $<hr>
53  *
54  */
55 #ifndef __CVMX_CSR_H__
56 #define __CVMX_CSR_H__
57
58 #ifndef CVMX_ENABLE_CSR_ADDRESS_CHECKING
59 #define CVMX_ENABLE_CSR_ADDRESS_CHECKING 0
60 #endif
61
62 #include "cvmx-platform.h"
63 #include "cvmx-csr-enums.h"
64 #include "cvmx-csr-typedefs.h"
65
66 /* Map the HW names to the SDK historical names */
67 typedef cvmx_ciu_intx_en1_t             cvmx_ciu_int1_t;
68 typedef cvmx_ciu_intx_sum0_t            cvmx_ciu_intx0_t;
69 typedef cvmx_ciu_mbox_setx_t            cvmx_ciu_mbox_t;
70 typedef cvmx_fpa_fpfx_marks_t           cvmx_fpa_fpf_marks_t;
71 typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que0_page_index_t;
72 typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que1_page_index_t;
73 typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que2_page_index_t;
74 typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que3_page_index_t;
75 typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que4_page_index_t;
76 typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que5_page_index_t;
77 typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que6_page_index_t;
78 typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que7_page_index_t;
79 typedef cvmx_ipd_1st_mbuff_skip_t       cvmx_ipd_mbuff_first_skip_t;
80 typedef cvmx_ipd_1st_next_ptr_back_t    cvmx_ipd_first_next_ptr_back_t;
81 typedef cvmx_ipd_packet_mbuff_size_t    cvmx_ipd_mbuff_size_t;
82 typedef cvmx_ipd_qosx_red_marks_t       cvmx_ipd_qos_red_marks_t;
83 typedef cvmx_ipd_wqe_fpa_queue_t        cvmx_ipd_wqe_fpa_pool_t;
84 typedef cvmx_l2c_pfcx_t                 cvmx_l2c_pfc0_t;
85 typedef cvmx_l2c_pfcx_t                 cvmx_l2c_pfc1_t;
86 typedef cvmx_l2c_pfcx_t                 cvmx_l2c_pfc2_t;
87 typedef cvmx_l2c_pfcx_t                 cvmx_l2c_pfc3_t;
88 typedef cvmx_lmcx_bist_ctl_t            cvmx_lmc_bist_ctl_t;
89 typedef cvmx_lmcx_bist_result_t         cvmx_lmc_bist_result_t;
90 typedef cvmx_lmcx_comp_ctl_t            cvmx_lmc_comp_ctl_t;
91 typedef cvmx_lmcx_ctl_t                 cvmx_lmc_ctl_t;
92 typedef cvmx_lmcx_ctl1_t                cvmx_lmc_ctl1_t;
93 typedef cvmx_lmcx_dclk_cnt_hi_t         cvmx_lmc_dclk_cnt_hi_t;
94 typedef cvmx_lmcx_dclk_cnt_lo_t         cvmx_lmc_dclk_cnt_lo_t;
95 typedef cvmx_lmcx_dclk_ctl_t            cvmx_lmc_dclk_ctl_t;
96 typedef cvmx_lmcx_ddr2_ctl_t            cvmx_lmc_ddr2_ctl_t;
97 typedef cvmx_lmcx_delay_cfg_t           cvmx_lmc_delay_cfg_t;
98 typedef cvmx_lmcx_dll_ctl_t             cvmx_lmc_dll_ctl_t;
99 typedef cvmx_lmcx_dual_memcfg_t         cvmx_lmc_dual_memcfg_t;
100 typedef cvmx_lmcx_ecc_synd_t            cvmx_lmc_ecc_synd_t;
101 typedef cvmx_lmcx_fadr_t                cvmx_lmc_fadr_t;
102 typedef cvmx_lmcx_ifb_cnt_hi_t          cvmx_lmc_ifb_cnt_hi_t;
103 typedef cvmx_lmcx_ifb_cnt_lo_t          cvmx_lmc_ifb_cnt_lo_t;
104 typedef cvmx_lmcx_mem_cfg0_t            cvmx_lmc_mem_cfg0_t;
105 typedef cvmx_lmcx_mem_cfg1_t            cvmx_lmc_mem_cfg1_t;
106 typedef cvmx_lmcx_wodt_ctl0_t           cvmx_lmc_odt_ctl_t;
107 typedef cvmx_lmcx_ops_cnt_hi_t          cvmx_lmc_ops_cnt_hi_t;
108 typedef cvmx_lmcx_ops_cnt_lo_t          cvmx_lmc_ops_cnt_lo_t;
109 typedef cvmx_lmcx_pll_bwctl_t           cvmx_lmc_pll_bwctl_t;
110 typedef cvmx_lmcx_pll_ctl_t             cvmx_lmc_pll_ctl_t;
111 typedef cvmx_lmcx_pll_status_t          cvmx_lmc_pll_status_t;
112 typedef cvmx_lmcx_read_level_ctl_t      cvmx_lmc_read_level_ctl_t;
113 typedef cvmx_lmcx_read_level_dbg_t      cvmx_lmc_read_level_dbg_t;
114 typedef cvmx_lmcx_read_level_rankx_t    cvmx_lmc_read_level_rankx_t;
115 typedef cvmx_lmcx_rodt_comp_ctl_t       cvmx_lmc_rodt_comp_ctl_t;
116 typedef cvmx_lmcx_rodt_ctl_t            cvmx_lmc_rodt_ctl_t;
117 typedef cvmx_lmcx_wodt_ctl0_t           cvmx_lmc_wodt_ctl_t;
118 typedef cvmx_lmcx_wodt_ctl0_t           cvmx_lmc_wodt_ctl0_t;
119 typedef cvmx_lmcx_wodt_ctl1_t           cvmx_lmc_wodt_ctl1_t;
120 typedef cvmx_mio_boot_reg_cfgx_t        cvmx_mio_boot_reg_cfg0_t;
121 typedef cvmx_mio_boot_reg_timx_t        cvmx_mio_boot_reg_tim0_t;
122 typedef cvmx_mio_twsx_int_t             cvmx_mio_tws_int_t;
123 typedef cvmx_mio_twsx_sw_twsi_t         cvmx_mio_tws_sw_twsi_t;
124 typedef cvmx_mio_twsx_sw_twsi_ext_t     cvmx_mio_tws_sw_twsi_ext_t;
125 typedef cvmx_mio_twsx_twsi_sw_t         cvmx_mio_tws_twsi_sw_t;
126 typedef cvmx_npi_base_addr_inputx_t     cvmx_npi_base_addr_input_t;
127 typedef cvmx_npi_base_addr_outputx_t    cvmx_npi_base_addr_output_t;
128 typedef cvmx_npi_buff_size_outputx_t    cvmx_npi_buff_size_output_t;
129 typedef cvmx_npi_dma_highp_counts_t     cvmx_npi_dma_counts_t;
130 typedef cvmx_npi_dma_highp_naddr_t      cvmx_npi_dma_naddr_t;
131 typedef cvmx_npi_highp_dbell_t          cvmx_npi_dbell_t;
132 typedef cvmx_npi_highp_ibuff_saddr_t    cvmx_npi_dma_ibuff_saddr_t;
133 typedef cvmx_npi_mem_access_subidx_t    cvmx_npi_mem_access_subid_t;
134 typedef cvmx_npi_num_desc_outputx_t     cvmx_npi_num_desc_output_t;
135 typedef cvmx_npi_px_dbpair_addr_t       cvmx_npi_dbpair_addr_t;
136 typedef cvmx_npi_px_instr_addr_t        cvmx_npi_instr_addr_t;
137 typedef cvmx_npi_px_instr_cnts_t        cvmx_npi_instr_cnts_t;
138 typedef cvmx_npi_px_pair_cnts_t         cvmx_npi_pair_cnts_t;
139 typedef cvmx_npi_size_inputx_t          cvmx_npi_size_input_t;
140 typedef cvmx_pci_dbellx_t               cvmx_pci_dbell_t;
141 typedef cvmx_pci_dma_cntx_t             cvmx_pci_dma_cnt_t;
142 typedef cvmx_pci_dma_int_levx_t         cvmx_pci_dma_int_lev_t;
143 typedef cvmx_pci_dma_timex_t            cvmx_pci_dma_time_t;
144 typedef cvmx_pci_instr_countx_t         cvmx_pci_instr_count_t;
145 typedef cvmx_pci_pkt_creditsx_t         cvmx_pci_pkt_credits_t;
146 typedef cvmx_pci_pkts_sent_int_levx_t   cvmx_pci_pkts_sent_int_lev_t;
147 typedef cvmx_pci_pkts_sent_timex_t      cvmx_pci_pkts_sent_time_t;
148 typedef cvmx_pci_pkts_sentx_t           cvmx_pci_pkts_sent_t;
149 typedef cvmx_pip_prt_cfgx_t             cvmx_pip_port_cfg_t;
150 typedef cvmx_pip_prt_tagx_t             cvmx_pip_port_tag_cfg_t;
151 typedef cvmx_pip_qos_watchx_t           cvmx_pip_port_watcher_cfg_t;
152 typedef cvmx_pko_mem_queue_ptrs_t       cvmx_pko_queue_cfg_t;
153 typedef cvmx_pko_reg_cmd_buf_t          cvmx_pko_pool_cfg_t;
154 typedef cvmx_smix_clk_t                 cvmx_smi_clk_t;
155 typedef cvmx_smix_cmd_t                 cvmx_smi_cmd_t;
156 typedef cvmx_smix_en_t                  cvmx_smi_en_t;
157 typedef cvmx_smix_rd_dat_t              cvmx_smi_rd_dat_t;
158 typedef cvmx_smix_wr_dat_t              cvmx_smi_wr_dat_t;
159 typedef cvmx_tim_reg_flags_t            cvmx_tim_control_t;
160
161 /* The CSRs for bootbus region zero used to be independent of the
162     other 1-7. As of SDK 1.7.0 these were combined. These macros
163     are for backwards compactability */
164 #define CVMX_MIO_BOOT_REG_CFG0          CVMX_MIO_BOOT_REG_CFGX(0)
165 #define CVMX_MIO_BOOT_REG_TIM0          CVMX_MIO_BOOT_REG_TIMX(0)
166
167 /* The CN3XXX and CN58XX chips used to not have a LMC number
168     passed to the address macros. These are here to supply backwards
169     compatability with old code. Code should really use the new addresses
170     with bus arguments for support on other chips */
171 #define CVMX_LMC_BIST_CTL               CVMX_LMCX_BIST_CTL(0)
172 #define CVMX_LMC_BIST_RESULT            CVMX_LMCX_BIST_RESULT(0)
173 #define CVMX_LMC_COMP_CTL               CVMX_LMCX_COMP_CTL(0)
174 #define CVMX_LMC_CTL                    CVMX_LMCX_CTL(0)
175 #define CVMX_LMC_CTL1                   CVMX_LMCX_CTL1(0)
176 #define CVMX_LMC_DCLK_CNT_HI            CVMX_LMCX_DCLK_CNT_HI(0)
177 #define CVMX_LMC_DCLK_CNT_LO            CVMX_LMCX_DCLK_CNT_LO(0)
178 #define CVMX_LMC_DCLK_CTL               CVMX_LMCX_DCLK_CTL(0)
179 #define CVMX_LMC_DDR2_CTL               CVMX_LMCX_DDR2_CTL(0)
180 #define CVMX_LMC_DELAY_CFG              CVMX_LMCX_DELAY_CFG(0)
181 #define CVMX_LMC_DLL_CTL                CVMX_LMCX_DLL_CTL(0)
182 #define CVMX_LMC_DUAL_MEMCFG            CVMX_LMCX_DUAL_MEMCFG(0)
183 #define CVMX_LMC_ECC_SYND               CVMX_LMCX_ECC_SYND(0)
184 #define CVMX_LMC_FADR                   CVMX_LMCX_FADR(0)
185 #define CVMX_LMC_IFB_CNT_HI             CVMX_LMCX_IFB_CNT_HI(0)
186 #define CVMX_LMC_IFB_CNT_LO             CVMX_LMCX_IFB_CNT_LO(0)
187 #define CVMX_LMC_MEM_CFG0               CVMX_LMCX_MEM_CFG0(0)
188 #define CVMX_LMC_MEM_CFG1               CVMX_LMCX_MEM_CFG1(0)
189 #define CVMX_LMC_OPS_CNT_HI             CVMX_LMCX_OPS_CNT_HI(0)
190 #define CVMX_LMC_OPS_CNT_LO             CVMX_LMCX_OPS_CNT_LO(0)
191 #define CVMX_LMC_PLL_BWCTL              CVMX_LMCX_PLL_BWCTL(0)
192 #define CVMX_LMC_PLL_CTL                CVMX_LMCX_PLL_CTL(0)
193 #define CVMX_LMC_PLL_STATUS             CVMX_LMCX_PLL_STATUS(0)
194 #define CVMX_LMC_READ_LEVEL_CTL         CVMX_LMCX_READ_LEVEL_CTL(0)
195 #define CVMX_LMC_READ_LEVEL_DBG         CVMX_LMCX_READ_LEVEL_DBG(0)
196 #define CVMX_LMC_READ_LEVEL_RANKX       CVMX_LMCX_READ_LEVEL_RANKX(0)
197 #define CVMX_LMC_RODT_COMP_CTL          CVMX_LMCX_RODT_COMP_CTL(0)
198 #define CVMX_LMC_RODT_CTL               CVMX_LMCX_RODT_CTL(0)
199 #define CVMX_LMC_WODT_CTL               CVMX_LMCX_WODT_CTL0(0)
200 #define CVMX_LMC_WODT_CTL0              CVMX_LMCX_WODT_CTL0(0)
201 #define CVMX_LMC_WODT_CTL1              CVMX_LMCX_WODT_CTL1(0)
202
203 /* The CN3XXX and CN58XX chips used to not have a TWSI bus number
204     passed to the address macros. These are here to supply backwards
205     compatability with old code. Code should really use the new addresses
206     with bus arguments for support on other chips */
207 #define CVMX_MIO_TWS_INT            CVMX_MIO_TWSX_INT(0)
208 #define CVMX_MIO_TWS_SW_TWSI        CVMX_MIO_TWSX_SW_TWSI(0)
209 #define CVMX_MIO_TWS_SW_TWSI_EXT    CVMX_MIO_TWSX_SW_TWSI_EXT(0)
210 #define CVMX_MIO_TWS_TWSI_SW        CVMX_MIO_TWSX_TWSI_SW(0)
211
212 /* The CN3XXX and CN58XX chips used to not have a SMI/MDIO bus number
213     passed to the address macros. These are here to supply backwards
214     compatability with old code. Code should really use the new addresses
215     with bus arguments for support on other chips */
216 #define CVMX_SMI_CLK    CVMX_SMIX_CLK(0)
217 #define CVMX_SMI_CMD    CVMX_SMIX_CMD(0)
218 #define CVMX_SMI_EN     CVMX_SMIX_EN(0)
219 #define CVMX_SMI_RD_DAT CVMX_SMIX_RD_DAT(0)
220 #define CVMX_SMI_WR_DAT CVMX_SMIX_WR_DAT(0)
221
222 #endif /* __CVMX_CSR_H__ */
223