OpenNSL API Guide and Reference Manual
pci.h
Go to the documentation of this file.
1 /*
2  * $Id: pci_util.h Broadcom OpenNSL $
3  * $Copyright: Copyright 2016-2017 Broadcom Corporation.
4  * This program is the proprietary software of Broadcom Corporation
5  * and/or its licensors, and may only be used, duplicated, modified
6  * or distributed pursuant to the terms and conditions of a separate,
7  * written license agreement executed between you and Broadcom
8  * (an "Authorized License"). Except as set forth in an Authorized
9  * License, Broadcom grants no license (express or implied), right
10  * to use, or waiver of any kind with respect to the Software, and
11  * Broadcom expressly reserves all rights in and to the Software
12  * and all intellectual property rights therein. IF YOU HAVE
13  * NO AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE
14  * IN ANY WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE
15  * ALL USE OF THE SOFTWARE.
16  *
17  * Except as expressly set forth in the Authorized License,
18  *
19  * 1. This program, including its structure, sequence and organization,
20  * constitutes the valuable trade secrets of Broadcom, and you shall use
21  * all reasonable efforts to protect the confidentiality thereof,
22  * and to use this information only in connection with your use of
23  * Broadcom integrated circuit products.
24  *
25  * 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS
26  * PROVIDED "AS IS" AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES,
27  * REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY,
28  * OR OTHERWISE, WITH RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY
29  * DISCLAIMS ANY AND ALL IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY,
30  * NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF VIRUSES,
31  * ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
32  * CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING
33  * OUT OF USE OR PERFORMANCE OF THE SOFTWARE.
34  *
35  * 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL
36  * BROADCOM OR ITS LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL,
37  * INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY DAMAGES WHATSOEVER
38  * ARISING OUT OF OR IN ANY WAY RELATING TO YOUR USE OF OR INABILITY
39  * TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF THE
40  * POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF
41  * THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR USD 1.00,
42  * WHICHEVER IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING
43  * ANY FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.$
44  *
45  * File: pci_util.h
46  *
47  * Purpose: This file contains OpenNSL PCI utility functions.
48  */
49 #ifndef PCI_UTIL_H
50 #define PCI_UTIL_H
51 
52 #include <stdint.h>
53 
54 #define OPENNSL_CMIC_LED_DATA_RAM_SIZE 0x100
55 #define OPENNSL_CMIC_LED_PROGRAM_RAM_SIZE 0x100
56 #define OPENNSL_CMIC_LED_REG_SIZE 4
57 #define OPENNSL_CMIC_LEDUP0_CTRL_OFFSET 0x20000
58 #define OPENNSL_CMIC_LEDUP0_STATUS_OFFSET 0x20004
59 #define OPENNSL_CMIC_LEDUP0_DATA_RAM_OFFSET 0x20400
60 #define OPENNSL_CMIC_LEDUP0_PROGRAM_RAM_OFFSET 0x20800
61 #define OPENNSL_CMIC_LEDUP1_CTRL_OFFSET 0x21000
62 #define OPENNSL_CMIC_LEDUP1_STATUS_OFFSET 0x21004
63 #define OPENNSL_CMIC_LEDUP1_DATA_RAM_OFFSET 0x21400
64 #define OPENNSL_CMIC_LEDUP1_PROGRAM_RAM_OFFSET 0x21800
65 #define OPENNSL_CMIC_MMU_COSLC_COUNT_ADDR 10341
66 #define OPENNSL_CMIC_MMU_COSLC_COUNT_DATA 10342
67 
68 #define OPENNSL_LC_LED_ENABLE 0x1
69 
70 
71 
72 /*****************************************************************/
80 uint32_t opennsl_pci_read(int unit, uint32_t addr);
81 
82 /*****************************************************************/
91 int opennsl_pci_write(int unit, uint32_t addr, uint32_t data);
92 
93 
94 #endif /* PCI_UTIL_H */