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.

[参考译文] CCS/TCI6638K2K:PCIe MSI X68 WindRiver

Guru**** 3004740 points

Other Parts Discussed in Thread: SYSBIOS

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/915399/ccs-tci6638k2k-pcie-msi-x68-windriver

器件型号:TCI6638K2K

工具/软件:Code Composer Studio

您好、TI 工程师:

   由于引导模式为 PCIe、因此应已在引导加载程序中实现与 PCIe 相关的初始化。 以下代码是与 PCIe 相关的配置、但无法在 Windows 下补充 MSI 中断。 我不知道配置有问题。

#include

#include

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

#include
#include

#include
#include
#include


#include

#include
#include

#include
#include


#include
#include

#include

#include

#include <ti/sysbios/family/c64p/Hwi.h>


CSL_CPINTCRegs* gpCIC1_regs =(CSL_CPINTCRegs*) CSL_CIC_1_regs;
/* CIC 路由事件 CPU 的寄存器指针。
默认情况下,它是 CIC0;但对于内核4~7,它是 CIC1*/
CSL_CPINTCRegs* gpCIC 寄存器=(CSL_CPINTCRegs*) CSL_CIC 寄存器0_regs;
CSL_CPINTCRegs* gpCIC0_regs =(CSL_CPINTCRegs*) CSL_CIC_0_regs;

CSL_CgemRegs * gpCgem_regs =(CSL_CgemRegs *) CSL_C66X_COREPAC_REG_BASE_ADDRESS_REGS;

静态内联 unsigned int swap_ENDIAN (unsigned int byte_index)
{
此处需要注意 μ s
#ifdef _big_ENDIAN
返回((byte_index&0xFFFFFFFC)+(3-byte_index&3));
其他
返回 byte_index;
#endif
}

/*启用到 CPU 的中断:IER |= uiIER_en_MASK;GIE=1*/
void cpu_interrupt_enable (uint32 uiir_en_mask)
{
IER |= uiIER en_mask;

//启用 GIE
TSR = TSR|1;
}

静态内联 void keyston_CIC_EVENT_MAP (CSL_CPINTCRegs* cpIntcRegs、int input_event_num、int out_num)
{
/*将输入事件映射到输出*/
cpIntcRegs->ch_map[swap_ENDIAN (input_event_num)]= out_num;

/*清除输入中断事件*/
cpIntcRegs->STATUS_CLR_index_REG= INPUT_EVENT_num;

/*启用输入中断事件*/
cpIntcRegs->enable_set_index_REG= input_event_num;

/*启用输出*/
cpIntcRegs->hin_enable_set_index_REG= out_num;
}


int uiPCIE_ERROR_HOST_EVENT_num=0;
int uiPCIE_MSI_HOST_EVENT_num=1;

void PCIe_interrupts_Init (void)
{
/*禁用全局主机中断。 *
gpCIC0_regs->global_enable_hint_REG=0;

/*将 PCIe 错误/PM/复位中断事件映射到 CIC0 out0*/
PCIE的普通事件中断 μ s
KeySton_CIC_EVENT_MAP (gpCIC0_regs、CSL_CIC0_PCIe_INT12、uiPCIE_ERROR_HOST_EVENT_num);
KeySton_CIC_EVENT_MAP (gpCIC0_regs、CSL_CIC0_PCIe_INT13、uiPCIE_ERROR_HOST_EVENT_num);

/*启用全局主机中断。 *
gpCIC0_regs->global_enable_hint_REG= 1;

/*MAP PCIe ERROR/PM/复位中断表单 CICO 到 INT5;
将 PCIe MSI 中断映射到 int4 */
PCIE的MIS事件中断 μ s
gpCgem regs->INTMUX1 =<CSL_CGEM_INTMUX1_INTSEL5_SHIFT)
|(CSL_C66X_COREPAC_PCIe_INT4_PLUS_N<<CSL_CGEM_INTMUX1_INTSEL4_SHIFT)
|(CSL_C66X_COREPAC_CIC_OUT1<CSL_C66X_COREPAC_CIC_OUT1<<CSL_CGEM_INTMUX1_INTSEL6_SHIFT);


//启用 int4~int6
CPU_INTERRUPT_ENABLE ((1<<4)|(1<<5)|(1<<6));
}


int main (vod)
{

PCIe_interrupts_Init();

*(unsigned int*) 0x21800200 = 0xF7100001;//RC bar0 addr 0xF7100000带外 OB_OFFSET_INDEX
*(unsigned int*)(0x21800204)= 0x00;//OB_OFFSET_HI

*(unsigned int*) 0x21801050=0x417050;//MSI_CAP
*(unsigned int*) 0x21801054=0xF7100054;//MSI_LOW32
*(unsigned int*) 0x21801058=0x00;//MSI_UP32
*(unsigned int*) 0x2180105c=16;//MSI_DATA

放置("PCIe test msi start.");
*(unsigned int*)(0x50000108)=0xF;//MSI_IRQ_ENABLE_SET
*(unsigned int*)(0x50000054)=16;//MSI_IRQ
*(unsigned int*)(0x5000010C)=0xF;//MSI_IRQ_ENABLE_CLR
放置("PCIe test msi les.");
}

(1).MSI 中断不能通过 Windows 在 BAR0地址0xF7100000 Windows 上查找 PCIe 来捕获。 我不知道配置有问题

(2).在我初始化0x21801054 MSI_LOW32后、查询地址为0xFEE00318、我不知道该地址与 BAR0起始地址有什么关系、也不知道我将使用什么地址进行 OUTBAND 处理

(3)。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我们提供了一个适用于 Linux 和 C6678的示例 PCIe 驱动程序。 PCIe IP 与 K2K 相同。 您可以参阅以下内容: pdk_c667x_2_0_xx\packages/ti\boot\examples\pcie 中的 software-dl.ti.com/.../index_FDS.html  

    -文件夹 linux_host_loader 和 pcieboot_interrupt。 中断在两个方向上工作。

    此致、Eric  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

      该参考示例使用正常中断、到目前为止、我可以调试、我想使用 MSI 中断 processing.ca、 这是您可以帮助的  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我提到的 PCIe 引导示例使用传统 PCIe 中断、而不是 MSI。 我们在两个 TI 板之间提供了 MSI 的 PCIe 示例、您可以参考该示例并将其移植到 x86 MSI 中。 请参阅  pdk_c667x_2_0_xx\packages/ti\drv\PCIe\examples\samples\src。

    此致、Eric