Stratix 10M PCIe BAR0 size incorrect
Hi,
I have a super simple design right now. The Stratix 10M PCIe HIP (generated in qsys) has its rxm_bar0 interface exported, and this IP is instantiated in a top-level wrapper. In Qsys, I've configured BAR0 to have a 28-bit size parameter (I assume this is the size of the address), and it is set as 64-bit prefetchable.
In the wrapper, I've hard-coded the rxm_bar0 interface's signals as follows:
- read_waitrequest -> 0
- readvalid -> 1
- readdata -> 32'hdeadbeef
On my host machine, I have some simple UIO PCIe driver code that just reads from uio0. When I boot up the machine, in lspci I can see that PCIe device 1172:0000 shows up, but its BAR0 only has "256" as its size. See lspci verbose output below:
04:00.0 Unassigned class [ff00]: Altera Corporation Device 0000 (rev 01)
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 28
NUMA node: 0
Region 0: Memory at f3100000 (64-bit, prefetchable) [size=256]
Capabilities: <access denied>
Kernel driver in use: uio_pci_genericIf I read 4 bytes, I get 0xdeadbeef, as expected. I can increase the number of bytes read to 8 or 16 with no issue. But once I go past 32, I get incorrect data starting from byte 0, and then a bus error, and then the BAR0 becomes disabled.
Does anyone know why this happens? Why isn't the size of BAR0 256 MB (2^28 bytes)?