blob: 3a58eba2b33edecf061e79aae8db6ea05b1066de [file] [log] [blame]
Shad Ansari2f7f9be2017-06-07 13:34:53 -07001/*
2<:copyright-BRCM:2016:DUAL/GPL:standard
3
4 Broadcom Proprietary and Confidential.(c) 2016 Broadcom
5 All Rights Reserved
6
7Unless you and Broadcom execute a separate written software license
8agreement governing use of this software, this software is licensed
9to you under the terms of the GNU General Public License version 2
10(the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
11with the following added to such license:
12
13 As a special exception, the copyright holders of this software give
14 you permission to link this software with independent modules, and
15 to copy and distribute the resulting executable under terms of your
16 choice, provided that you also meet, for each linked independent
17 module, the terms and conditions of the license of that module.
18 An independent module is a module which is not derived from this
19 software. The special exception does not apply to any modifications
20 of the software.
21
22Not withstanding the above, under no circumstances may you combine
23this software in any way with any other Broadcom software provided
24under a license other than the GPL, without Broadcom's express prior
25written consent.
26
27:>
28 */
29#ifndef _BCMOLT_BOARD_H_
30#define _BCMOLT_BOARD_H_
31
32#include <bcmos_system.h>
33#include <bcmolt_model_types.h>
34
35typedef enum
36{
37 SVK_1 = 0x7, /* SVK #1 - BCM968620S: all PON flavors supported, SFP+ */
38 SVK_2_XG = 0x6, /* SVK #2 - BCM968620XG: XGPON */
39 SVK_2_XE = 0x5, /* SVK #2 - BCM968620XE: 10G EPON */
40 SVK_3 = 0x4, /* SVK #3 - BCM968620K: all PON flavors supported, XFP */
41} bcm_board_svk_board_id;
42
43bcmos_errno bcm_board_dev_change(uint32_t addr);
44bcmos_errno bcm_board_dev_write(uint32_t count, uint32_t addr, uint32_t val);
45bcmos_errno bcm_board_dev_read(uint32_t count, uint32_t addr, uint32_t *val);
46bcmos_errno bcm_board_switch_write(uint32_t val);
47bcmos_errno bcm_board_switch_read(uint32_t *val);
48bcmos_errno bcm_board_fpga_write(uint32_t addr, uint32_t val);
49bcmos_errno bcm_board_fpga_read(uint32_t addr, uint32_t *val);
50bcmos_errno bcm_board_host_event_write(uint32_t val);
51
52bcmos_errno bcm_board_fpga_version_get(uint32_t *version);
53
54/* FPGA GPIO access */
55typedef enum
56{
57 BCM_FPGA_GPIO_DIR_INPUT,
58 BCM_FPGA_GPIO_DIR_OUTPUT,
59} bcm_fpga_gpio_dir;
60
61typedef enum
62{
63 GPON_DPLL,
64 EPON_DPLL,
65 GPON_SYNCE
66} bcm_dpll_users;
67
68typedef struct
69{
70 uint8_t page;
71 uint8_t reg;
72 uint8_t data;
73} dpll_command;
74
75bcmos_errno bcm_board_fpga_set_gpio_dir(bcmolt_gpio_pin gpio_pin, bcm_fpga_gpio_dir dir);
76bcmos_errno bcm_board_fpga_get_gpio_dir(bcmolt_gpio_pin gpio_pin, bcm_fpga_gpio_dir *dir);
77bcmos_errno bcm_board_fpga_write_gpio(bcmolt_gpio_pin gpio_pin, uint32_t val);
78bcmos_errno bcm_board_fpga_read_gpio(bcmolt_gpio_pin gpio_pin, uint32_t *val);
79bcmos_errno bcm_board_fpga_gen_gpio_irq(bcmolt_ext_irq ext_irq);
80
81bcmos_errno bcm_board_trx_enable(uint8_t pon, bcmos_bool is_enabled);
82bcmos_errno bcm_board_trx_present(uint8_t pon);
83bcmos_errno bcm_board_device_reset(void);
84bcmos_errno bcm_board_device_on(void);
85bcmos_errno bcm_board_device_off(void);
86bcmos_errno bcm_board_kt2_device_on(void);
87bcmos_errno bcm_board_kt2_device_off(void);
88bcmos_errno bcm_board_get_board_id(bcm_board_svk_board_id * board_id);
89bcmos_errno bcm_board_fpga_reg_read(uint32_t reg, uint32_t *val);
90bcmos_errno bcm_board_fpga_reg_write(uint32_t reg, uint32_t val);
91bcmos_errno bcm_board_pci_debug(uint32_t device, uint32_t command, int32_t start, int32_t howmany, uint32_t *dumpptr);
92bcmos_errno bcm_board_burn_pon_dpll(bcm_dpll_users dpll_dev);
93bcmos_errno bcm_board_write_dpll(uint32_t page, uint32_t reg, uint32_t val);
94bcmos_errno bcm_board_read_dpll(uint32_t page, uint32_t reg, uint32_t *val);
95
96bcmos_errno bcm_board_init(void);
97void bcm_board_uninit(void);
98
99#endif
100