2 Replies Latest reply on Aug 6, 2018 10:09 AM by jafoste4

    reset cpu1 SDK

    raha_2181

      Hi,

      I have a problem to reset cpu1 from cpu0,

      I use standalode bsp v6, and here is the code I use in application project of cpu0 to reset cpu1:

      #define A9_CPU_RST_CTRL           (XSLCR_BASEADDR + 0x244)

      #define A9_RST1_MASK              0x00000002

      #define A9_CLKSTOP1_MASK          0x00000020

      #define XSLCR_LOCK_ADDR           (XSLCR_BASEADDR + 0x4)

      #define XSLCR_LOCK_CODE           0x0000767B

      #define CPU1_CATCH                0xFFFFFFF0

       

      Xil_Out32(XSLCR_UNLOCK_ADDR, XSLCR_UNLOCK_CODE);

      RegVal = Xil_In32(A9_CPU_RST_CTRL);

      RegVal |= A9_RST1_MASK;

      Xil_Out32(A9_CPU_RST_CTRL, RegVal);

      RegVal |= A9_CLKSTOP1_MASK;

      Xil_Out32(A9_CPU_RST_CTRL, RegVal);

      RegVal &= ~A9_RST1_MASK;

      Xil_Out32(A9_CPU_RST_CTRL, RegVal);

      RegVal &= ~A9_CLKSTOP1_MASK;

      Xil_Out32(A9_CPU_RST_CTRL, RegVal);

      Xil_Out32(XSLCR_LOCK_ADDR, XSLCR_LOCK_CODE);

      Xil_Out32(CPU1_CATCH, APP_CPU1_ADDR);

      dmb();

      sev();

       

      After trying this part of code, cpu1 stuck at wfe loop as follows:

      00000130:   and     r1, r1, #15

      00000134:   cmp     r1, #0

      00000138:   beq     +60     ; addr=0x0000017c

      0000013c:    wfe

      00000140:    b       -12     ; addr=0x0000013c

      I would really appreciate if anybody can help me with the instruction to reset cpu1.

      Thanks,

      -- raha