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 */
67typedef cvmx_ciu_intx_en1_t             cvmx_ciu_int1_t;
68typedef cvmx_ciu_intx_sum0_t            cvmx_ciu_intx0_t;
69typedef cvmx_ciu_mbox_setx_t            cvmx_ciu_mbox_t;
70typedef cvmx_fpa_fpfx_marks_t           cvmx_fpa_fpf_marks_t;
71typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que0_page_index_t;
72typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que1_page_index_t;
73typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que2_page_index_t;
74typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que3_page_index_t;
75typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que4_page_index_t;
76typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que5_page_index_t;
77typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que6_page_index_t;
78typedef cvmx_fpa_quex_page_index_t      cvmx_fpa_que7_page_index_t;
79typedef cvmx_ipd_1st_mbuff_skip_t       cvmx_ipd_mbuff_first_skip_t;
80typedef cvmx_ipd_1st_next_ptr_back_t    cvmx_ipd_first_next_ptr_back_t;
81typedef cvmx_ipd_packet_mbuff_size_t    cvmx_ipd_mbuff_size_t;
82typedef cvmx_ipd_qosx_red_marks_t       cvmx_ipd_qos_red_marks_t;
83typedef cvmx_ipd_wqe_fpa_queue_t        cvmx_ipd_wqe_fpa_pool_t;
84typedef cvmx_l2c_pfcx_t                 cvmx_l2c_pfc0_t;
85typedef cvmx_l2c_pfcx_t                 cvmx_l2c_pfc1_t;
86typedef cvmx_l2c_pfcx_t                 cvmx_l2c_pfc2_t;
87typedef cvmx_l2c_pfcx_t                 cvmx_l2c_pfc3_t;
88typedef cvmx_lmcx_bist_ctl_t            cvmx_lmc_bist_ctl_t;
89typedef cvmx_lmcx_bist_result_t         cvmx_lmc_bist_result_t;
90typedef cvmx_lmcx_comp_ctl_t            cvmx_lmc_comp_ctl_t;
91typedef cvmx_lmcx_ctl_t                 cvmx_lmc_ctl_t;
92typedef cvmx_lmcx_ctl1_t                cvmx_lmc_ctl1_t;
93typedef cvmx_lmcx_dclk_cnt_hi_t         cvmx_lmc_dclk_cnt_hi_t;
94typedef cvmx_lmcx_dclk_cnt_lo_t         cvmx_lmc_dclk_cnt_lo_t;
95typedef cvmx_lmcx_dclk_ctl_t            cvmx_lmc_dclk_ctl_t;
96typedef cvmx_lmcx_ddr2_ctl_t            cvmx_lmc_ddr2_ctl_t;
97typedef cvmx_lmcx_delay_cfg_t           cvmx_lmc_delay_cfg_t;
98typedef cvmx_lmcx_dll_ctl_t             cvmx_lmc_dll_ctl_t;
99typedef cvmx_lmcx_dual_memcfg_t         cvmx_lmc_dual_memcfg_t;
100typedef cvmx_lmcx_ecc_synd_t            cvmx_lmc_ecc_synd_t;
101typedef cvmx_lmcx_fadr_t                cvmx_lmc_fadr_t;
102typedef cvmx_lmcx_ifb_cnt_hi_t          cvmx_lmc_ifb_cnt_hi_t;
103typedef cvmx_lmcx_ifb_cnt_lo_t          cvmx_lmc_ifb_cnt_lo_t;
104typedef cvmx_lmcx_mem_cfg0_t            cvmx_lmc_mem_cfg0_t;
105typedef cvmx_lmcx_mem_cfg1_t            cvmx_lmc_mem_cfg1_t;
106typedef cvmx_lmcx_wodt_ctl0_t           cvmx_lmc_odt_ctl_t;
107typedef cvmx_lmcx_ops_cnt_hi_t          cvmx_lmc_ops_cnt_hi_t;
108typedef cvmx_lmcx_ops_cnt_lo_t          cvmx_lmc_ops_cnt_lo_t;
109typedef cvmx_lmcx_pll_bwctl_t           cvmx_lmc_pll_bwctl_t;
110typedef cvmx_lmcx_pll_ctl_t             cvmx_lmc_pll_ctl_t;
111typedef cvmx_lmcx_pll_status_t          cvmx_lmc_pll_status_t;
112typedef cvmx_lmcx_read_level_ctl_t      cvmx_lmc_read_level_ctl_t;
113typedef cvmx_lmcx_read_level_dbg_t      cvmx_lmc_read_level_dbg_t;
114typedef cvmx_lmcx_read_level_rankx_t    cvmx_lmc_read_level_rankx_t;
115typedef cvmx_lmcx_rodt_comp_ctl_t       cvmx_lmc_rodt_comp_ctl_t;
116typedef cvmx_lmcx_rodt_ctl_t            cvmx_lmc_rodt_ctl_t;
117typedef cvmx_lmcx_wodt_ctl0_t           cvmx_lmc_wodt_ctl_t;
118typedef cvmx_lmcx_wodt_ctl0_t           cvmx_lmc_wodt_ctl0_t;
119typedef cvmx_lmcx_wodt_ctl1_t           cvmx_lmc_wodt_ctl1_t;
120typedef cvmx_mio_boot_reg_cfgx_t	cvmx_mio_boot_reg_cfg0_t;
121typedef cvmx_mio_boot_reg_timx_t	cvmx_mio_boot_reg_tim0_t;
122typedef cvmx_mio_twsx_int_t             cvmx_mio_tws_int_t;
123typedef cvmx_mio_twsx_sw_twsi_t         cvmx_mio_tws_sw_twsi_t;
124typedef cvmx_mio_twsx_sw_twsi_ext_t     cvmx_mio_tws_sw_twsi_ext_t;
125typedef cvmx_mio_twsx_twsi_sw_t         cvmx_mio_tws_twsi_sw_t;
126typedef cvmx_npi_base_addr_inputx_t     cvmx_npi_base_addr_input_t;
127typedef cvmx_npi_base_addr_outputx_t    cvmx_npi_base_addr_output_t;
128typedef cvmx_npi_buff_size_outputx_t    cvmx_npi_buff_size_output_t;
129typedef cvmx_npi_dma_highp_counts_t     cvmx_npi_dma_counts_t;
130typedef cvmx_npi_dma_highp_naddr_t      cvmx_npi_dma_naddr_t;
131typedef cvmx_npi_highp_dbell_t          cvmx_npi_dbell_t;
132typedef cvmx_npi_highp_ibuff_saddr_t    cvmx_npi_dma_ibuff_saddr_t;
133typedef cvmx_npi_mem_access_subidx_t    cvmx_npi_mem_access_subid_t;
134typedef cvmx_npi_num_desc_outputx_t     cvmx_npi_num_desc_output_t;
135typedef cvmx_npi_px_dbpair_addr_t       cvmx_npi_dbpair_addr_t;
136typedef cvmx_npi_px_instr_addr_t        cvmx_npi_instr_addr_t;
137typedef cvmx_npi_px_instr_cnts_t        cvmx_npi_instr_cnts_t;
138typedef cvmx_npi_px_pair_cnts_t         cvmx_npi_pair_cnts_t;
139typedef cvmx_npi_size_inputx_t          cvmx_npi_size_input_t;
140typedef cvmx_pci_dbellx_t               cvmx_pci_dbell_t;
141typedef cvmx_pci_dma_cntx_t             cvmx_pci_dma_cnt_t;
142typedef cvmx_pci_dma_int_levx_t         cvmx_pci_dma_int_lev_t;
143typedef cvmx_pci_dma_timex_t            cvmx_pci_dma_time_t;
144typedef cvmx_pci_instr_countx_t         cvmx_pci_instr_count_t;
145typedef cvmx_pci_pkt_creditsx_t         cvmx_pci_pkt_credits_t;
146typedef cvmx_pci_pkts_sent_int_levx_t   cvmx_pci_pkts_sent_int_lev_t;
147typedef cvmx_pci_pkts_sent_timex_t      cvmx_pci_pkts_sent_time_t;
148typedef cvmx_pci_pkts_sentx_t           cvmx_pci_pkts_sent_t;
149typedef cvmx_pip_prt_cfgx_t             cvmx_pip_port_cfg_t;
150typedef cvmx_pip_prt_tagx_t             cvmx_pip_port_tag_cfg_t;
151typedef cvmx_pip_qos_watchx_t           cvmx_pip_port_watcher_cfg_t;
152typedef cvmx_pko_mem_queue_ptrs_t       cvmx_pko_queue_cfg_t;
153typedef cvmx_pko_reg_cmd_buf_t          cvmx_pko_pool_cfg_t;
154typedef cvmx_smix_clk_t                 cvmx_smi_clk_t;
155typedef cvmx_smix_cmd_t                 cvmx_smi_cmd_t;
156typedef cvmx_smix_en_t                  cvmx_smi_en_t;
157typedef cvmx_smix_rd_dat_t              cvmx_smi_rd_dat_t;
158typedef cvmx_smix_wr_dat_t              cvmx_smi_wr_dat_t;
159typedef 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
224