//******************************************************************************************** // // Copyright Texas Instruments Inc // TI Proprietary Information Internal Data // This is a general provisioning script for the TLK10022 Apply Settings Portion of the GUI // // Author: Matt Sunna // Modified Date: July 12, 2013 // Revision: Rev 0.0 //******************************************************************************************** //******************************************************************************************** // Script Command Parameter Reference //******************************************************************************************** //SET BOARD(BOARD_NUMBER) //MDIO22 WRITE (CHANNEL_NAME,®ISTERNAME) //MDIO22 WRITE IMM (CH_ADDR,DEVICE_ADDR,REGISTER_ADDR,REGISTER_VALUE) //MDIO22 READ (CHANNEL_NAME,®ISTERNAME) //MDIO22 READ UNTIL (CHANNEL_NAME,®ISTERNAME,MASK,EXPECTED,TIMEOUT(ms)) //MDIO22 READ IMM(CH_ADDR,DEVICE_ADDR,REGISTER_ADDR,MASK,EXPECTED,TIMEOUT(ms)) //I2C WRITE (®ISTER_NAME) //I2C WRITE IMM (DEVICE_ADDRESS,REGISTER_ADDRESS, REGISTER_VALUE ) //I2C READ (®ISTER_NAME) //I2C READ UNTIL (®ISTER_NAME, MASK, EXPECTED,TIMEOUT(ms)) //I2C READ IMM (DEVICE_ADDRESS,REGISTER_ADDRESS, MASK, EXPECTED,TIMEOUT(ms)) //DELAY //This reads the test time per parameter field in the HS Link Optimizer and waits that amount of time //WAIT(time ms) //MDIO22 WRITE FUNC (CHANNEL_NAME, FIELD_NAME, Data[in hex]) //******************************************************************************************** // CDCM6208 Clock Generator Configuration //******************************************************************************************** // Configure the Primary/Secondary Oscillator Enable Pins I2C WRITE (REGISTER_04) // Wait 100mS WAIT(100) // Disable the CDCM6208 during configuration I2C WRITE FUNC (I2C_RESETN/PWR,0x0) // Wait 100mS WAIT(100) //Configure the CDCM6208 Registers SPI WRITE (CLK_REGISTER_0) SPI WRITE (CLK_REGISTER_1) SPI WRITE (CLK_REGISTER_2) SPI WRITE (CLK_REGISTER_3) SPI WRITE (CLK_REGISTER_4) SPI WRITE (CLK_REGISTER_5) SPI WRITE (CLK_REGISTER_6) SPI WRITE (CLK_REGISTER_7) SPI WRITE (CLK_REGISTER_8) SPI WRITE (CLK_REGISTER_9) SPI WRITE (CLK_REGISTER_10) SPI WRITE (CLK_REGISTER_11) SPI WRITE (CLK_REGISTER_12) SPI WRITE (CLK_REGISTER_13) SPI WRITE (CLK_REGISTER_14) SPI WRITE (CLK_REGISTER_15) SPI WRITE (CLK_REGISTER_16) SPI WRITE (CLK_REGISTER_17) SPI WRITE (CLK_REGISTER_18) SPI WRITE (CLK_REGISTER_19) SPI WRITE (CLK_REGISTER_20) //SPI WRITE (CLK_REGISTER_21) //SPI WRITE (CLK_REGISTER_40) //Enable the CDCM6208 after the configuration is complete I2C WRITE FUNC (I2C_RESETN/PWR,0x1) //******************************************************************************************** // TLK10022 Soft Reset and Mode Configuration //******************************************************************************************** // Configure MODE_SEL and ST Pins I2C WRITE (REGISTER_05) // Wait 100mS WAIT(100) // Soft Reset & disable global config MDIO22 WRITE FUNC (GLOBAL,GLOBAL_RESET,0x1) MDIO22 WRITE FUNC (GLOBAL,GLOBAL_RESET,0x0) MDIO22 WRITE (GLOBAL,GLOBAL_CONTROL_1) // Configure Operating Mode Registers MDIO22 WRITE (A,CHANNEL_CONTROL_1) MDIO22 WRITE (B,CHANNEL_CONTROL_1) //******************************************************************************************** // CH A Provisioning //******************************************************************************************** MDIO22 WRITE (A,CHANNEL_CONTROL_1) MDIO22 WRITE FUNC (A,LT_ENABLE, 0x0) MDIO22 WRITE (A,HS_SERDES_CONTROL_1) MDIO22 WRITE (A,HS_SERDES_CONTROL_2) MDIO22 WRITE (A,HS_SERDES_CONTROL_3) MDIO22 WRITE (A,HS_SERDES_CONTROL_4) MDIO22 WRITE (A,LS_SERDES_CONTROL_1) MDIO22 WRITE (A,LN3_LS_SERDES_CONTROL_2) MDIO22 WRITE (A,LN2_LS_SERDES_CONTROL_2) MDIO22 WRITE (A,LN1_LS_SERDES_CONTROL_2) MDIO22 WRITE (A,LN0_LS_SERDES_CONTROL_2) MDIO22 WRITE (A,LN3_LS_SERDES_CONTROL_3) MDIO22 WRITE (A,LN2_LS_SERDES_CONTROL_3) MDIO22 WRITE (A,LN1_LS_SERDES_CONTROL_3) MDIO22 WRITE (A,LN0_LS_SERDES_CONTROL_3) MDIO22 WRITE (A,HS_OVERLAY_CONTROL) MDIO22 WRITE (A,LN3_LS_TP_OVERLAY_CONTROL) MDIO22 WRITE (A,LN2_LS_TP_OVERLAY_CONTROL) MDIO22 WRITE (A,LN1_LS_TP_OVERLAY_CONTROL) MDIO22 WRITE (A,LN0_LS_TP_OVERLAY_CONTROL) MDIO22 WRITE (A,HS_TP_CONTROL) MDIO22 WRITE (A,CLK_SEL_CONTROL) MDIO22 WRITE (A,CLK_CONTROL) MDIO22 WRITE (A,SKEW_CONFIG_CONTROL) MDIO22 WRITE (A,HS_ALIGN_CODE_CONTROL) MDIO22 WRITE (A,BIT_LM_CONTROL) MDIO22 WRITE (A,LN3_LS_TXFIFO_CONTROL) MDIO22 WRITE (A,LN2_LS_TXFIFO_CONTROL) MDIO22 WRITE (A,LN1_LS_TXFIFO_CONTROL) MDIO22 WRITE (A,LN0_LS_TXFIFO_CONTROL) MDIO22 WRITE (A,LN3_LS_LOS_CONTROL) MDIO22 WRITE (A,LN2_LS_LOS_CONTROL) MDIO22 WRITE (A,LN1_LS_LOS_CONTROL) MDIO22 WRITE (A,LN0_LS_LOS_CONTROL) MDIO22 WRITE (A,LN3_DATA_SRC_CONTROL) MDIO22 WRITE (A,LN2_DATA_SRC_CONTROL) MDIO22 WRITE (A,LN1_DATA_SRC_CONTROL) MDIO22 WRITE (A,LN0_DATA_SRC_CONTROL) MDIO22 WRITE (A,LN3_LS_CH_CONTROL_1) MDIO22 WRITE (A,LN2_LS_CH_CONTROL_1) MDIO22 WRITE (A,LN1_LS_CH_CONTROL_1) MDIO22 WRITE (A,LN0_LS_CH_CONTROL_1) MDIO22 WRITE (A,HS_CH_CONTROL_1) MDIO22 WRITE (A,VS_TX_MARKER_SEARCH_CHAR) MDIO22 WRITE (A,VS_TX_MARKER_REPLACE_CHAR) MDIO22 WRITE (A,VS_RX_MARKER_SEARCH_CHAR) MDIO22 WRITE (A,VS_RX_MARKER_REPLACE_CHAR) MDIO22 WRITE (A,VS_TX_IDLE_P_CHAR) MDIO22 WRITE (A,VS_TX_IDLE_N_CHAR) MDIO22 WRITE (A,VS_RX_IDLE_P_CHAR) MDIO22 WRITE (A,VS_RX_IDLE_N_CHAR) MDIO22 WRITE (A,VS_TX_SCR_CONTROL) MDIO22 WRITE (A,VS_TX_SCR_SEED_CONTROL_1) MDIO22 WRITE (A,VS_TX_SCR_SEED_CONTROL_0) MDIO22 WRITE (A,VS_TX_SCR_POLY_CONTROL_1) MDIO22 WRITE (A,VS_TX_SCR_POLY_CONTROL_0) MDIO22 WRITE (A,VS_RX_DESCR_CONTROL) MDIO22 WRITE (A,VS_RX_DESCR_SEED_CONTROL_1) MDIO22 WRITE (A,VS_RX_DESCR_SEED_CONTROL_0) MDIO22 WRITE (A,VS_RX_DESCR_POLY_CONTROL_1) MDIO22 WRITE (A,VS_RX_DESCR_POLY_CONTROL_0) MDIO22 WRITE (A,MC_AUTO_CONTROL) //******************************************************************************************** // CH B Provisioning //******************************************************************************************** MDIO22 WRITE (B,CHANNEL_CONTROL_1) MDIO22 WRITE FUNC (B,LT_ENABLE, 0x0) MDIO22 WRITE (B,HS_SERDES_CONTROL_1) MDIO22 WRITE (B,HS_SERDES_CONTROL_2) MDIO22 WRITE (B,HS_SERDES_CONTROL_3) MDIO22 WRITE (B,HS_SERDES_CONTROL_4) MDIO22 WRITE (B,LS_SERDES_CONTROL_1) MDIO22 WRITE (B,LN3_LS_SERDES_CONTROL_2) MDIO22 WRITE (B,LN2_LS_SERDES_CONTROL_2) MDIO22 WRITE (B,LN1_LS_SERDES_CONTROL_2) MDIO22 WRITE (B,LN0_LS_SERDES_CONTROL_2) MDIO22 WRITE (B,LN3_LS_SERDES_CONTROL_3) MDIO22 WRITE (B,LN2_LS_SERDES_CONTROL_3) MDIO22 WRITE (B,LN1_LS_SERDES_CONTROL_3) MDIO22 WRITE (B,LN0_LS_SERDES_CONTROL_3) MDIO22 WRITE (B,HS_OVERLAY_CONTROL) MDIO22 WRITE (B,LN3_LS_TP_OVERLAY_CONTROL) MDIO22 WRITE (B,LN2_LS_TP_OVERLAY_CONTROL) MDIO22 WRITE (B,LN1_LS_TP_OVERLAY_CONTROL) MDIO22 WRITE (B,LN0_LS_TP_OVERLAY_CONTROL) MDIO22 WRITE (B,HS_TP_CONTROL) MDIO22 WRITE (B,CLK_SEL_CONTROL) MDIO22 WRITE (B,CLK_CONTROL) MDIO22 WRITE (B,SKEW_CONFIG_CONTROL) MDIO22 WRITE (B,HS_ALIGN_CODE_CONTROL) MDIO22 WRITE (B,BIT_LM_CONTROL) MDIO22 WRITE (B,LN3_LS_TXFIFO_CONTROL) MDIO22 WRITE (B,LN2_LS_TXFIFO_CONTROL) MDIO22 WRITE (B,LN1_LS_TXFIFO_CONTROL) MDIO22 WRITE (B,LN0_LS_TXFIFO_CONTROL) MDIO22 WRITE (B,LN3_LS_LOS_CONTROL) MDIO22 WRITE (B,LN2_LS_LOS_CONTROL) MDIO22 WRITE (B,LN1_LS_LOS_CONTROL) MDIO22 WRITE (B,LN0_LS_LOS_CONTROL) MDIO22 WRITE (B,LN3_DATA_SRC_CONTROL) MDIO22 WRITE (B,LN2_DATA_SRC_CONTROL) MDIO22 WRITE (B,LN1_DATA_SRC_CONTROL) MDIO22 WRITE (B,LN0_DATA_SRC_CONTROL) MDIO22 WRITE (B,LN3_LS_CH_CONTROL_1) MDIO22 WRITE (B,LN2_LS_CH_CONTROL_1) MDIO22 WRITE (B,LN1_LS_CH_CONTROL_1) MDIO22 WRITE (B,LN0_LS_CH_CONTROL_1) MDIO22 WRITE (B,HS_CH_CONTROL_1) MDIO22 WRITE (B,VS_TX_MARKER_SEARCH_CHAR) MDIO22 WRITE (B,VS_TX_MARKER_REPLACE_CHAR) MDIO22 WRITE (B,VS_RX_MARKER_SEARCH_CHAR) MDIO22 WRITE (B,VS_RX_MARKER_REPLACE_CHAR) MDIO22 WRITE (B,VS_TX_IDLE_P_CHAR) MDIO22 WRITE (B,VS_TX_IDLE_N_CHAR) MDIO22 WRITE (B,VS_RX_IDLE_P_CHAR) MDIO22 WRITE (B,VS_RX_IDLE_N_CHAR) MDIO22 WRITE (B,VS_TX_SCR_CONTROL) MDIO22 WRITE (B,VS_TX_SCR_SEED_CONTROL_1) MDIO22 WRITE (B,VS_TX_SCR_SEED_CONTROL_0) MDIO22 WRITE (B,VS_TX_SCR_POLY_CONTROL_1) MDIO22 WRITE (B,VS_TX_SCR_POLY_CONTROL_0) MDIO22 WRITE (B,VS_RX_DESCR_CONTROL) MDIO22 WRITE (B,VS_RX_DESCR_SEED_CONTROL_1) MDIO22 WRITE (B,VS_RX_DESCR_SEED_CONTROL_0) MDIO22 WRITE (B,VS_RX_DESCR_POLY_CONTROL_1) MDIO22 WRITE (B,VS_RX_DESCR_POLY_CONTROL_0) MDIO22 WRITE (B,MC_AUTO_CONTROL) //******************************************************************************************** // Issue Data Path Reset //******************************************************************************************** WAIT(500) MDIO22 WRITE (A,CHANNEL_CONTROL_1) MDIO22 WRITE (B,CHANNEL_CONTROL_1) MDIO22 WRITE FUNC (A,DATAPATH_RESET,0x1) MDIO22 WRITE FUNC (B,DATAPATH_RESET,0x1) MDIO22 WRITE FUNC (A,DATAPATH_RESET,0x0) MDIO22 WRITE FUNC (B,DATAPATH_RESET,0x0) // Wait 1000mS WAIT(1000) //******************************************************************************************** // Verify HS_AZ_DONE and LS/HS PLL Lock Status //******************************************************************************************** // Read and Clear Latched Status Register Bits MDIO22 READ (A,CHANNEL_STATUS_1) MDIO22 READ (B,CHANNEL_STATUS_1) // Poll LS/HS_PLL_LOCK,HS_AZ_DONE MDIO22 READ UNTIL (A,CHANNEL_STATUS_1,0x1003,0x1003,1000) MDIO22 READ UNTIL (B,CHANNEL_STATUS_1,0x1003,0x1003,1000) // Wait 100mS WAIT(100) //******************************************************************************************** // Clear Status Registers and Error Counters //******************************************************************************************** // Read and Clear Latched Status Register Bits MDIO22 READ (A,CHANNEL_STATUS_1) MDIO22 READ (B,CHANNEL_STATUS_1) // Read and Clear Latched Status Register Bits MDIO22 READ (A,LN0_LS_STATUS_1) MDIO22 READ (A,LN1_LS_STATUS_1) MDIO22 READ (A,LN2_LS_STATUS_1) MDIO22 READ (A,LN3_LS_STATUS_1) MDIO22 READ (B,LN0_LS_STATUS_1) MDIO22 READ (B,LN1_LS_STATUS_1) MDIO22 READ (B,LN2_LS_STATUS_1) MDIO22 READ (B,LN3_LS_STATUS_1) // Read and Clear Latched Status Register Bits MDIO22 READ (A,HS_STATUS_1) MDIO22 READ (B,HS_STATUS_1) // Read and Clear Latched Status Register Bits MDIO22 READ (A,LT_LINK_PARTNER_CONTROL) MDIO22 READ (B,LT_LINK_PARTNER_CONTROL) // Read and Clear Latched Status Register Bits MDIO22 READ (A,LINK_PARTNER_STATUS) MDIO22 READ (B,LINK_PARTNER_STATUS) // Read and Clear Latched Status Register Bits MDIO22 READ (A,LT_LOCAL_DEVICE_STATUS) MDIO22 READ (B,LT_LOCAL_DEVICE_STATUS) // Read and Clear Error Counters MDIO22 READ (A,HS_ERROR_COUNTER) MDIO22 READ (B,HS_ERROR_COUNTER) MDIO22 READ (A,LS_LN0_ERROR_COUNTER) MDIO22 READ (B,LS_LN0_ERROR_COUNTER) MDIO22 READ (A,LS_LN1_ERROR_COUNTER) MDIO22 READ (B,LS_LN1_ERROR_COUNTER) MDIO22 READ (A,LS_LN2_ERROR_COUNTER) MDIO22 READ (B,LS_LN2_ERROR_COUNTER) MDIO22 READ (A,LS_LN3_ERROR_COUNTER) MDIO22 READ (B,LS_LN3_ERROR_COUNTER) //******************************************************************************************** // Verify Channel Status //******************************************************************************************** // Read and Clear Latched Status Register Bits MDIO22 READ (A,CHANNEL_STATUS_1) MDIO22 READ (B,CHANNEL_STATUS_1) // Read and Clear Latched Status Register Bits MDIO22 READ (A,LN0_LS_STATUS_1) MDIO22 READ (A,LN1_LS_STATUS_1) MDIO22 READ (A,LN2_LS_STATUS_1) MDIO22 READ (A,LN3_LS_STATUS_1) MDIO22 READ (B,LN0_LS_STATUS_1) MDIO22 READ (B,LN1_LS_STATUS_1) MDIO22 READ (B,LN2_LS_STATUS_1) MDIO22 READ (B,LN3_LS_STATUS_1) // Read and Clear Latched Status Register Bits MDIO22 READ (A,HS_STATUS_1) MDIO22 READ (B,HS_STATUS_1) // Read and Clear Latched Status Register Bits MDIO22 READ (A,LT_LINK_PARTNER_CONTROL) MDIO22 READ (B,LT_LINK_PARTNER_CONTROL) // Read and Clear Latched Status Register Bits MDIO22 READ (A,LINK_PARTNER_STATUS) MDIO22 READ (B,LINK_PARTNER_STATUS) // Read and Clear Latched Status Register Bits MDIO22 READ (A,LT_LOCAL_DEVICE_STATUS) MDIO22 READ (B,LT_LOCAL_DEVICE_STATUS) // Read and Clear Error Counters MDIO22 READ (A,HS_ERROR_COUNTER) MDIO22 READ (B,HS_ERROR_COUNTER) MDIO22 READ (A,LS_LN0_ERROR_COUNTER) MDIO22 READ (B,LS_LN0_ERROR_COUNTER) MDIO22 READ (A,LS_LN1_ERROR_COUNTER) MDIO22 READ (B,LS_LN1_ERROR_COUNTER) MDIO22 READ (A,LS_LN2_ERROR_COUNTER) MDIO22 READ (B,LS_LN2_ERROR_COUNTER) MDIO22 READ (A,LS_LN3_ERROR_COUNTER) MDIO22 READ (B,LS_LN3_ERROR_COUNTER)