Rajat Dongre
Rajat Dongre

Reputation: 1

Getting Page Fault while accessing another PCIe NTB switch(SW2 NTB1) from one PCIe NTB switch(SW1 NTB0)

  1. I am getting page fault while accessing another PCI NTB switch config space.

  2. The steps that I followed are below:

I am using two PCIe NTB switch.

  1. Microchip pcie ntb switch
  2. Microchip Pcie ntb switch
  1. both switch is having two partition one is upstream and NT and second is NT only and crosslink between both switch.

  2. I have added translated base address to 0x4000000 to BAR2 LUT table at index 0. and added this address in another switch partition 1 BAR 0 (translated base address)

  3. In switch 1: I have added base address to LUT table at 0th Index Translated Base address : 0x04000000 Destinition partion : 1

  4. I am trying to fetch address of it to access config space of another switch (SW2 NTB1 BAR0) so the address for this is BAR2 + LUT0.

    BAR2's physical address is 0xaf310004

  5. To access LUT0 entry. = BAR2 + LUT0 = af310004

  6. but when i am trying access Device ID of another PCIe switch it is giving page fault.

  7. please let me know where I am wrong

I checked physical crosslink using its chiplink tool In switch 2 I have added BAR0 base address to 0x4000000 using static enumeration.

Your help is really appreatiated

  `/*short code */
  PHYS_ADDR *sw2Ntb1regAddr;
  UINT32 sizeMapReg;
  UINT32 data;

  idt_ntb_peer_mw_set_trans(ndev, 0, 0, 0x04000000, 0); 
  /* lukup table idx 0 */
    ret = idt_ntb_peer_mw_get_addr(ndev, 0, &sw2Ntb1regAddr, &sizeMapReg);
    if(ret != Success)
    {
    console_printf("NP: %s @ line %d, ret = %d\n", __FUNCTION__, __LINE__, ret);
    }
 
 /* Trying to access Device ID : register address : 0x2000 from SW2 PCIe NTB config space * /
 memcpy(&data, sw2NtbregAddr + 0x2000, 4);  /* page fault error */ 
 printf("Device ID %X", data); `


I am expecting solution or  where I am wrong here 

Upvotes: 0

Views: 64

Answers (0)

Related Questions