This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TCI6638K2K pcie boot 问题



请高手指导:

      因为我们的代码要在DDR中运行,上电后,通过PCIe向6638的L2中写入了DDR3的初始化代码,成功后又向6638中写入正式运行的代码,之后将PC指针强制跳转到代码运行地址,代码没有运行起来。

   DDR3初始化代码中做了一个无线循环,下面是代码

    DEVICE_REG32_W(MAGIC_ADDR, 0);
    void (*exit)();
    UINT32 i, entry_addr;

    DEVICE_REG32_W(MAGIC_ADDR, 0);
 
    while(1)
    {
        entry_addr = DEVICE_REG32_R(MAGIC_ADDR);
        if (entry_addr != 0)
        {
             exit = (void (*)())entry_addr;
            (*exit)();
        }
        for (i=0; i < 100; i++)
            asm("nop");
 }

RC端代码:

 PushData(ddr_init,0,&boot_entry_addr0);

 WDC_WriteAddr32(hDev,1,0xffffc,boot_entry_addr0);

  while (1) {
       WDC_ReadAddr32(hDev, 3, 0, &tempReg);                                                                                                                                                                                                         if (tempReg == 0)  break;
       for (i = 0; i < 1000; i++) i++;
  }

PushData(core0_code,0,&boot_entry_addr0);

 WDC_WriteAddr32(hDev,1,0xffffc,boot_entry_addr0);

  • 请高手指导:

          因为我们的代码要在DDR中运行,上电后,通过PCIe向6638的L2中写入了DDR3的初始化代码,成功后又向6638中写入正式运行的代码,之后将PC指针强制跳转到代码运行地址,代码没有运行起来。

       DDR3初始化代码中做了一个无线循环,下面是代码

        DEVICE_REG32_W(MAGIC_ADDR, 0);
        void (*exit)();
        UINT32 i, entry_addr;

        DEVICE_REG32_W(MAGIC_ADDR, 0);
     
        while(1)
        {
            entry_addr = DEVICE_REG32_R(MAGIC_ADDR);
            if (entry_addr != 0)
            {
                 exit = (void (*)())entry_addr;
                (*exit)();
            }
            for (i=0; i < 100; i++)
                asm("nop");
     }

    RC端代码:

     PushData(ddr_init,0,&boot_entry_addr0);//向6638L2中写入代码,并提取运行首地址

     WDC_WriteAddr32(hDev,1,0xffffc,boot_entry_addr0);//将运行首地址写入BOOT MAGIC地址

    WDC_WriteAddr32(hDev,0,0x54,0x0);//向6638发送MSI中断

      while (1) {
           WDC_ReadAddr32(hDev, 3, 0, &tempReg);                                                                                                                                                                                                         if (tempReg == 0)  break;
           for (i = 0; i < 1000; i++) i++;
      }

    PushData(core0_code,0,&boot_entry_addr0);//向6638中写入正式运行代码并提取首地址

     WDC_WriteAddr32(hDev,1,0xffffc,boot_entry_addr0);//将运行首地址写入BOOT MAGIC地址

  • DDR初始化部分的代码有正常运行起来么,初始化之后DDR测试通过么。参考mcsdk中6678相关的PCIE boot例程,如附件所示。

    pcie.7z
  • 谢谢你的回复!问题已解决,由于在等待代码跳转部分做了一个设置标志位的操作,导致代码跳转不正确,删除后已能正常启动!