/*******************************E2E ECC Test Code on SPC58Nxxxxx controller*************************************/ /* align this to a 0-modulo-8 address (aligned to 8 bytes) */ static vuint32_t test[2] __attribute__ ((aligned (8))) = { 0xBABADEDA, 0xABBAABBA }; static void SetupE2EECSR0_for_1b_ECC_fault(void) { asm("lis 4, 0x0000"); asm("addi 4, 4, 0x1001"); asm("mtdcr 511, 4"); } static void SetupE2EECSR0_for_2b_ECC_fault(void) { asm("lis 4, 0x0000"); asm("addi 4, 4, 0x1003"); asm("mtdcr 511, 4"); } void E2EECC_SPC85XX(void) { register uint32 test_read = 0; /*1b Test code*/ /*Error injection*/ if(test_e2eecc_flag == 1) { SetupE2EECSR0_for_1b_ECC_fault(); test[0] = test_read; test_read = test[0]; test_e2eecc_flag = 0; } else if (test_e2eecc_flag == 2) { /*2b Test code*/ SetupE2EECSR0_for_2b_ECC_fault(); test[0] = test_read; test_read = test[0]; test_e2eecc_flag = 0; } } /*******************SBC chnages*******************************/ FS_SAFE_I_INPUTS FS8X_FS_I_SAFE_INPUTS_ADDR, FS8X_FS_I_FCCU_CFG_FCCU1_FCCU2_PAIR | FS8X_FS_I_FCCU12_FLT_POL_FCCU1_H_FCCU2_L | FS8X_FS_I_FCCU12_FS_IMPACT_FS0B_RSTB | FS8X_FS_I_FCCU1_FS_REACT_FS0B | FS8X_FS_I_ERRMON_ACK_TIME_8MS | FS8X_FS_I_ERRMON_FS_IMPACT_FS0B, FS8X_FS_I_FCCU_CFG_MASK | FS8X_FS_I_FCCU12_FLT_POL_MASK | FS8X_FS_I_FCCU12_FS_IMPACT_MASK | FS8X_FS_I_ERRMON_ACK_TIME_MASK | FS8X_FS_I_ERRMON_FS_IMPACT_MASK, (bool)TRUE, /*************************FCCU Configuration ************************************/ Fccu_ChlConfig[FCCU_NO_OF_FAULT_CHANNELS] = { FCCU_HW_RECOVERABLE, FCCU_NONE_REACTION, FCCU_DISABLE_TIMEOUT, FCCU_DISABLE_ALARM_IRQ, FCCU_DISABLE_NMI, FCCU_ENABLE_EOUT }; // for particualr channel