Shad Ansari | 2f7f9be | 2017-06-07 13:34:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | <:copyright-BRCM:2016:DUAL/GPL:standard |
| 3 | |
| 4 | Broadcom Proprietary and Confidential.(c) 2016 Broadcom |
| 5 | All Rights Reserved |
| 6 | |
| 7 | Unless you and Broadcom execute a separate written software license |
| 8 | agreement governing use of this software, this software is licensed |
| 9 | to you under the terms of the GNU General Public License version 2 |
| 10 | (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, |
| 11 | with 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 | |
| 22 | Not withstanding the above, under no circumstances may you combine |
| 23 | this software in any way with any other Broadcom software provided |
| 24 | under a license other than the GPL, without Broadcom's express prior |
| 25 | written 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 | |
| 35 | typedef 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 | |
| 43 | bcmos_errno bcm_board_dev_change(uint32_t addr); |
| 44 | bcmos_errno bcm_board_dev_write(uint32_t count, uint32_t addr, uint32_t val); |
| 45 | bcmos_errno bcm_board_dev_read(uint32_t count, uint32_t addr, uint32_t *val); |
| 46 | bcmos_errno bcm_board_switch_write(uint32_t val); |
| 47 | bcmos_errno bcm_board_switch_read(uint32_t *val); |
| 48 | bcmos_errno bcm_board_fpga_write(uint32_t addr, uint32_t val); |
| 49 | bcmos_errno bcm_board_fpga_read(uint32_t addr, uint32_t *val); |
| 50 | bcmos_errno bcm_board_host_event_write(uint32_t val); |
| 51 | |
| 52 | bcmos_errno bcm_board_fpga_version_get(uint32_t *version); |
| 53 | |
| 54 | /* FPGA GPIO access */ |
| 55 | typedef enum |
| 56 | { |
| 57 | BCM_FPGA_GPIO_DIR_INPUT, |
| 58 | BCM_FPGA_GPIO_DIR_OUTPUT, |
| 59 | } bcm_fpga_gpio_dir; |
| 60 | |
| 61 | typedef enum |
| 62 | { |
| 63 | GPON_DPLL, |
| 64 | EPON_DPLL, |
| 65 | GPON_SYNCE |
| 66 | } bcm_dpll_users; |
| 67 | |
| 68 | typedef struct |
| 69 | { |
| 70 | uint8_t page; |
| 71 | uint8_t reg; |
| 72 | uint8_t data; |
| 73 | } dpll_command; |
| 74 | |
| 75 | bcmos_errno bcm_board_fpga_set_gpio_dir(bcmolt_gpio_pin gpio_pin, bcm_fpga_gpio_dir dir); |
| 76 | bcmos_errno bcm_board_fpga_get_gpio_dir(bcmolt_gpio_pin gpio_pin, bcm_fpga_gpio_dir *dir); |
| 77 | bcmos_errno bcm_board_fpga_write_gpio(bcmolt_gpio_pin gpio_pin, uint32_t val); |
| 78 | bcmos_errno bcm_board_fpga_read_gpio(bcmolt_gpio_pin gpio_pin, uint32_t *val); |
| 79 | bcmos_errno bcm_board_fpga_gen_gpio_irq(bcmolt_ext_irq ext_irq); |
| 80 | |
| 81 | bcmos_errno bcm_board_trx_enable(uint8_t pon, bcmos_bool is_enabled); |
| 82 | bcmos_errno bcm_board_trx_present(uint8_t pon); |
| 83 | bcmos_errno bcm_board_device_reset(void); |
| 84 | bcmos_errno bcm_board_device_on(void); |
| 85 | bcmos_errno bcm_board_device_off(void); |
| 86 | bcmos_errno bcm_board_kt2_device_on(void); |
| 87 | bcmos_errno bcm_board_kt2_device_off(void); |
| 88 | bcmos_errno bcm_board_get_board_id(bcm_board_svk_board_id * board_id); |
| 89 | bcmos_errno bcm_board_fpga_reg_read(uint32_t reg, uint32_t *val); |
| 90 | bcmos_errno bcm_board_fpga_reg_write(uint32_t reg, uint32_t val); |
| 91 | bcmos_errno bcm_board_pci_debug(uint32_t device, uint32_t command, int32_t start, int32_t howmany, uint32_t *dumpptr); |
| 92 | bcmos_errno bcm_board_burn_pon_dpll(bcm_dpll_users dpll_dev); |
| 93 | bcmos_errno bcm_board_write_dpll(uint32_t page, uint32_t reg, uint32_t val); |
| 94 | bcmos_errno bcm_board_read_dpll(uint32_t page, uint32_t reg, uint32_t *val); |
| 95 | |
| 96 | bcmos_errno bcm_board_init(void); |
| 97 | void bcm_board_uninit(void); |
| 98 | |
| 99 | #endif |
| 100 | |