furia_micro_seq.h (2277B)
1 /* 2 * 3 * 4 * 5 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 6 * 7 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 8 */ 9 #ifndef __FURIA_MICRO_SEQ_H__ 10 #define __FURIA_MICRO_SEQ_H__ 11 /* 12 * Includes 13 */ 14 #include <phymod/phymod.h> 15 16 /* 17 * Defines 18 */ 19 #define MICRO_CHECKSUM_ZERO_CODE (0x600D) 20 21 /* 22 * Types 23 */ 24 typedef enum FURIA_MSGOUT 25 { 26 MSGOUT_DONTCARE = 0x0000, 27 MSGOUT_GET_CNT = 0x8888, 28 MSGOUT_GET_LSB = 0xABCD, 29 MSGOUT_GET_MSB = 0x4321, 30 MSGOUT_GET_2B = 0xEEEE, 31 MSGOUT_GET_B = 0xF00D, 32 MSGOUT_ERR = 0x0BAD, 33 MSGOUT_NEXT = 0x2222, 34 MSGOUT_NOT_DWNLD = 0x0101, 35 MSGOUT_DWNLD_ALREADY = 0x0202, 36 MSGOUT_DWNLD_DONE = 0x0303, 37 MSGOUT_PRGRM_DONE = 0x1414 38 } FURIA_MSGOUT_E; 39 40 /* 41 * Macros 42 */ 43 44 /* 45 * Global Variables 46 */ 47 48 /* 49 * Functions 50 */ 51 52 /** Wait master message out 53 * This function is to ensure whether master has sent the previous message 54 * out successfully 55 * 56 * @param pa Pointer to phymod access structure 57 * @param exp_message Expected message specified by user 58 * @param poll_time Poll interval 59 * 60 * @return PHYMOD_E_NONE successful function execution 61 */ 62 int _furia_wait_mst_msgout(const phymod_access_t *pa, 63 FURIA_MSGOUT_E exp_message, 64 int poll_time); 65 66 67 /** Download and Fuse firmware 68 * This function is used to download the firmware through I2C/MDIO 69 * and fuse it to SPI EEPROM if prg_eeprom flag is set 70 * 71 * @param pa Pointer to phymod access structure 72 * @param new_fw Pointer to firmware array 73 * @param fw_length Length of the firmware array 74 * @param prg_eeprom Flag used to program EEPROM 75 * 76 * @return num_bytes number of bytes successfully downloaded 77 */ 78 int furia_download_prog_eeprom(const phymod_access_t *pa, 79 uint8_t *new_fw, 80 uint32_t fw_length, 81 uint8_t prg_eeprom); 82 83 int furia_firmware_info_get(const phymod_access_t *pa, 84 phymod_core_firmware_info_t *fw_info); 85 #endif