/******************************************************************************* * モジュール名称 :APP02 - HK in RDN mode * * モジュールラベル :app02_Rdn_Hk * * タスク区分 :called from APP02 (Rdn) * * コーリングシーケンス:void app02_Rdn_Hk( void ) * * 戻り値 :void * * 使用上の注意 :なし * * エラー処理 :なし * * 作成日・作成者 :2012/11/24 Y.K. * ********************************************************************************/ #include "dpu_api.h" #include "dpu_api_proto.h" #include "app_core.h" #include "app_rdn_core.h" #ifdef _APP_RDN_ // Macro void app02_Rdn_PiHkGet( int, unsigned int, int, int ); // ********************** // *** HK-read in RDN *** // ********************** void app02_Rdn_PiHk() { int i_flag; unsigned char uc_status; unsigned char uc_RegStatus[0x1E]; // ------------------------- // ---- PI Link Status ---- // ------------------------- // --- Reg Status --- /* *************************************************************** [rap_dr_getRdnDpuRegister()] offset=0x0000 [N/A](不要 CPUが動いているときのみ使う情報) offset=0x0002 [N/A](不要 同上) offset=0x000A [N/A](不要 SDRAMコントローラ故障時に回復を試みるためのもの) offset=0x000C [N/A](不要 どのbitが変化したかを知ることができる。知ったところでうれしくない) **** offset=0x000E [DS_2BERRADDR](重要 SDRAMのどこでbitエラーが発生したか知ることができる) offset=0x0012 [SUNPULSE_MODE](不要 初期化で冗長モード/Slaveに固定する) offset=0x0016 [N/A](不要 初期化で固定する) offset=0x0018 [N/A](不要 初期化で固定する) offset=0x001A [N/A](不要 初期化で固定する) **** offset=0x001C [MSx_LINK_STAT](重要) *************************************************************** */ i_flag = rap_dr_getRdnDpuRegister( 0x0, 0x1E, uc_RegStatus ); if ( i_flag ) { // Guc_rdn_MwHK[20] = 0; return; } /* for (i_flag=0; i_flag<10; i_flag++) { if ( uc_RegStatus[0x1C] != 0xFF || uc_RegStatus[0x1D] != 0xFF ) break; dpu_delay(10); } if ( i_flag==10 ) { Guc_rdn_MwHK[20] = 0; return; } */ // ------------------------- // ---- SunPulse Status ---- // ------------------------- if ( uc_RegStatus[0x12] == 0x5A) { if ( uc_RegStatus[0x13] & 0x01 ) uc_status = 0x01; // Master 0x01 else uc_status = 0x02; // Slave 0x02 } else if ( uc_RegStatus[0x12] == 0xA5) uc_status = 0x03; // Register mode 0x03 else uc_status = 0x00; // Nominal mode 0x00 Guc_rdn_MwHK[19] = 0x40 + ( ( uc_status ) << 4) + // sun-pulse mode ( ( Gi_RDN_MemLoad_Ena & 0x01) << 3) + // MEM-LOAD 0:ENA 1:DIS ( ( Guc_HK_link[Gd_N_DPU1] & 0x01) ); // RDN-LINK 0:DIS 1:ENA // ----------------------------- // ---- Link Status & PI HK ---- // ----------------------------- uc_status = Guc_rdn_MwHK[20] = uc_RegStatus[0x1D]; if (Guc_dpuNo==0) { // ************* for DPU2 ********************** if ( uc_status & 0x01 ) app02_Rdn_PiHkGet( Gd_N_MWE , Gd_MWE_RdnAdr , Gd_N_MWE -Gd_N_MGFI, 40 ); if ( uc_status & 0x02 ) app02_Rdn_PiHkGet( Gd_N_SOR , Gd_SOR_RdnAdr , Gd_N_SOR -Gd_N_MGFI, 60 ); if ( uc_status & 0x0C ) app02_Rdn_PiHkGet( Gd_N_EWO , Gd_EWO_RdnAdr , Gd_N_EWO -Gd_N_MGFI, 80 ); if ( uc_status & 0x10 ) app02_Rdn_PiHkGet( Gd_N_MEF , Gd_MEF_RdnAdr , Gd_N_MEF -Gd_N_MGFI, 100 ); if ( uc_status & 0x20 ) app02_Rdn_PiHkGet( Gd_N_MGFI, Gd_MGFI_RdnAdr, 0, 120 ); if ( uc_status & 0x40 ) app02_Rdn_PiHkGet( Gd_N_MSAS, Gd_MSAS_RdnAdr, Gd_N_MSAS-Gd_N_MGFI, 140 ); if ( uc_status & 0x80 ) app02_Rdn_PiHkGet( Gd_N_MDM , Gd_MDM_RdnAdr , Gd_N_MDM -Gd_N_MGFI, 160 ); } else { // ************* for DPU1 ********************** if ( uc_status & 0x01 ) app02_Rdn_PiHkGet( Gd_N_MGFO, Gd_MGFO_RdnAdr, Gd_N_MGFO-Gd_N_MEA1, 40 ); if ( uc_status & 0x02 ) app02_Rdn_PiHkGet( Gd_N_MEA1, Gd_MEA1_RdnAdr, 0, 60 ); if ( uc_status & 0x04 ) app02_Rdn_PiHkGet( Gd_N_MEA2, Gd_MEA2_RdnAdr, Gd_N_MEA2-Gd_N_MEA1, 80 ); if ( uc_status & 0x08 ) app02_Rdn_PiHkGet( Gd_N_ENA , Gd_ENA_RdnAdr , Gd_N_ENA -Gd_N_MEA1, 100 ); if ( uc_status & 0x10 ) app02_Rdn_PiHkGet( Gd_N_MIA , Gd_MIA_RdnAdr , Gd_N_MIA -Gd_N_MEA1, 120 ); if ( uc_status & 0x20 ) app02_Rdn_PiHkGet( Gd_N_MSA , Gd_MSA_RdnAdr , Gd_N_MSA -Gd_N_MEA1, 140 ); if ( uc_status & 0x40 ) app02_Rdn_PiHkGet( Gd_N_HEPE, Gd_HEPE_RdnAdr, Gd_N_HEPE-Gd_N_MEA1, 160 ); if ( uc_status & 0x80 ) app02_Rdn_PiHkGet( Gd_N_HEPI, Gd_HEPI_RdnAdr, Gd_N_HEPI-Gd_N_MEA1, 180 ); } return; } void app02_Rdn_PiHkGet( int i_nodeId, unsigned int ui_address, int i_nodeAdd, int i_hkAdd) { int i_flag; i_flag = rap_sv_sendRdnHKCollect ( i_nodeId, ui_address ); // if (i_flag) ON/OFF if (i_flag) return; i_flag = app_Rdn_getData ( ui_address, 144, Guc_rdn_HK ); if (i_flag) return; memcpy( &(Guc_rdn_PiHK[i_nodeAdd][0]), &(Guc_rdn_HK[12]), 128); memcpy( &(Guc_rdn_MwHK[i_hkAdd]), &(Guc_rdn_HK[12]), 20); } #endif // _APP_RDN_