Skip to contentSkip to conversation

PCI:designware:Fix iATU programming for cfg1, io and mem viewport

PATCH Jingoo Han 4 participants 8 messages Feb 21, 2014 – Feb 27, 2014 PCI

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

T24gVGh1cnNkYXksIEZlYnJ1YXJ5IDIwLCAyMDE0IDEwOjM0IFBNLCBNb2hpdCBLVU1BUiBEQ0cg d3JvdGU6DQo+IFRodXJzZGF5LCBGZWJydWFyeSAyMCwgMjAxNCA1OjQzIFBNLCBLaXNob24gVmlq YXkgQWJyYWhhbSBJIHdyb3RlOg0KPiA+IE9uIFRodXJzZGF5IDIwIEZlYnJ1YXJ5IDIwMTQgMDU6 MjggUE0sIE1vaGl0IEtVTUFSIERDRyB3cm90ZToNCj4gPiA+IE9uIFRodXJzZGF5LCBGZWJydWFy eSAyMCwgMjAxNCA1OjA4IFBNLCBLaXNob24gVmlqYXkgQWJyYWhhbSBJIHdyb3RlOg0KPiA+ID4+ IE9uIFRodXJzZGF5IDIwIEZlYnJ1YXJ5IDIwMTQgMTA6NTIgQU0sIE1vaGl0IEt1bWFyIHdyb3Rl Og0KPiA+ID4+PiBUaGlzIHBhdGNoIGNvcnJlY3QgaUFUVSBwcm9ncmFtbWluZyBmb3IgY2ZnMSwg aW8gYW5kIG1lbSB2aWV3cG9ydC4NCj4gPiA+Pj4gRW5hYmxlIEFUVSBvbmx5IGFmdGVyIGNvbmZp Z3VyaW5nIGl0Lg0KPiA+ID4+DQo+ID4gPj4gRG9lcyB0aGlzIHBhdGNoIGFjdHVhbGx5IGZpeGVz IGRldmljZSBlbnVtZXJhdGlvbiBiZWhpbmQgYSBQQ0llLXBjaQ0KPiA+ID4+IGJyaWRnZSBvciB0 aGlzIGlzIG1vcmUgb2YgY2xlYW5pbmcgdXAgdGhlIHNlcXVlbmNlPw0KPiA+ID4+DQo+ID4gPiAt IFRoaXMgcGF0Y2ggY29ycmVjdHMgQVRVIHByb2dyYW1taW5nIHNlcXVlbmNlLiBJIGFtIG5vdC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vIEhhbg0K

#1 lore raw

Hi,

Quoted 21 lines · Jingoo Han
Quoted 20 lines · Mohit KUMAR DCG
Quoted 9 lines · Kishon Vijay Abraham I
Quoted 8 lines · Mohit KUMAR DCG
Quoted 7 lines · Kishon Vijay Abraham I
Quoted 2 lines · Mohit Kumar

This patch correct iATU programming for cfg1, io and mem viewport. Enable ATU only after configuring it.

Does this patch actually fixes device enumeration behind a PCIe-pci bridge or this is more of cleaning up the sequence?

Quoted 7 lines
Quoted 2 lines

- This patch corrects ATU programming sequence. I am not aware of any such issue with current driver. Pls specify which bridge do you use in your

setup and what is the problem?

I tried with card [1], it had a PLX bridge chip. It couldn't read the configuration space of the device connected to the PCIe-PCI bridge.

- I don’t have the mentioned card with me, but we are successfully using Lecroy PTC switch and SIL3124-2CB364 PCI-X compatible RAID card.

Quoted 8 lines
Quoted 2 lines

May be Jingoo or others can also comment if they are using PCI bridge card.

Hi Kishon,
Nice to see you again. :-)

I don't have PCIe-PCI bridge. Currently, I can test Ethernet cards and SATA cards.

The problem seems to be seen only if a device is connected after PCIe-PCI bridge. I've tested USB and Ethernet cards but that works just fine.

Quoted 4 lines

By the way, according to the Datasheet, PCIE_ATU_CR1 setting can be followed by PCIE_ATU_CR2 setting as below:

Quoted 8 lines

1. Setup the Index Register.
2. Setup the Region Base and Limit Address Registers.
3. Setup the Target Address Registers.
4. Configure the region through the Region Control 1 Register.
5. Enable the region.

Thus, how about testing the following patch? I also moved PCIE_ATU_CR1 as well as PCIE_ATU_CR2.

Thanks for the patch. I have just burnt my PCIE-to-PCI bridge card :-s Will test this once I get a new card.

Thanks
Kishon

#2 lore raw

Hi Kishon,

Quoted 2 lines · Kishon Vijay Abraham I

Thanks for the patch. I have just burnt my PCIE-to-PCI bridge card :-s Will test this once I get a new card.

were you able to solve issue in PCIE-to-PCI bridge.

On SPEAr I see issues with PCIe to PCI bridge and PCIe to PCIe switch.

Imprecise external abort is generated, providing hook for abort(similar to imx6) solves this.

Thanks and Regards,
Ajay

#3 lore raw
Quoted 7 lines · Ajay Khandelwal

Hi Kishon,

Quoted 2 lines · Kishon Vijay Abraham I

Thanks for the patch. I have just burnt my PCIE-to-PCI bridge card :-s Will test this once I get a new card.

were you able to solve issue in PCIE-to-PCI bridge.

oh yes. I was giving the total configuration space as 4k (2k for cfg0 and 2k for cfg1). But there was some problem when I write 0x800 to PCIE_ATU_LOWER_BASE. If I read back PCIE_ATU_LOWER_BASE after writing 0x800, it has 0x0.

So I increased the configuration space to 8k (4k for cfg0 and 4k for cfg1). With this I write 0x1000 to PCIE_ATU_LOWER_BASE and able to enumerate devices behind a PCIE-to-PCI bridge.

Quoted 5 lines

On SPEAr I see issues with PCIe to PCI bridge and PCIe to PCIe switch.

Imprecise external abort is generated, providing hook for abort(similar to imx6) solves this.

But this issue seems to be different :-s

Thanks
Kishon

#4 lore raw
Quoted 9 lines · Kishon Vijay Abraham I
Quoted 7 lines · Ajay Khandelwal

Hi Kishon,

Quoted 2 lines · Kishon Vijay Abraham I

Thanks for the patch. I have just burnt my PCIE-to-PCI bridge card :-s Will test this once I get a new card.

were you able to solve issue in PCIE-to-PCI bridge.

Quoted 8 lines

oh yes. I was giving the total configuration space as 4k (2k for cfg0 and 2k for cfg1). But there was some problem when I write 0x800 to PCIE_ATU_LOWER_BASE. If I read back PCIE_ATU_LOWER_BASE after writing 0x800, it has 0x0.

So I increased the configuration space to 8k (4k for cfg0 and 4k for cfg1). With this I write 0x1000 to PCIE_ATU_LOWER_BASE and able to enumerate devices behind a PCIE-to-PCI bridge.

As per designware specs minimum value of CX_ATU_MIN_REGION_SIZE is 4 KB. Depending on the SOC it can be configured from 4 to 64KB. So you can not have an address translation unit less than 4 KB in any SOC.

I think, it would be worth to mention this information in designware pcie binding documentation.

However I am surprised, how does it work in case of exynos. Jingoo?? Size of configuration space passed from DT is 0x1000 in exynos. As per my understanding (and what snps specs says), this value should be minimum 0x2000 in any SOC, as we divide this space equally for cfg0 and cfg1 in driver.

Regards
Pratysuh

Quoted 10 lines
Quoted 5 lines

On SPEAr I see issues with PCIe to PCI bridge and PCIe to PCIe switch.

Imprecise external abort is generated, providing hook for abort(similar to imx6) solves this.

But this issue seems to be different :-s

Thanks
Kishon

author
#5 lore raw
Quoted 15 lines · Pratyush Anand
Quoted 14 lines · Kishon Vijay Abraham I
Quoted 7 lines · Ajay Khandelwal

Hi Kishon,

Quoted 2 lines · Kishon Vijay Abraham I

Thanks for the patch. I have just burnt my PCIE-to-PCI bridge card :-s Will test this once I get a new card.

were you able to solve issue in PCIE-to-PCI bridge.

oh yes. I was giving the total configuration space as 4k (2k for cfg0 and 2k for cfg1). But there was some problem when I write 0x800 to PCIE_ATU_LOWER_BASE. If I read back PCIE_ATU_LOWER_BASE after writing 0x800, it has 0x0.

Quoted 7 lines
Quoted 3 lines

So I increased the configuration space to 8k (4k for cfg0 and 4k for cfg1). With this I write 0x1000 to PCIE_ATU_LOWER_BASE and able to enumerate devices behind a PCIE-to-PCI bridge.

As per designware specs minimum value of CX_ATU_MIN_REGION_SIZE is 4 KB. Depending on the SOC it can be configured from 4 to 64KB. So you can not have an address translation unit less than 4 KB in any SOC.

In the case of Exynos, the minimum value of CX_ATU_MIN_REGION_SIZE is 64KB.

Quoted 5 lines

I think, it would be worth to mention this information in designware pcie binding documentation.

However I am surprised, how does it work in case of exynos. Jingoo??

I don't know. However, there was no issue at my side. Currently, I am testing only Ethernet cards & SATA cards.

Quoted 4 lines

Size of configuration space passed from DT is 0x1000 in exynos. As per my understanding (and what snps specs says), this value should be minimum 0x2000 in any SOC, as we divide this space equally for cfg0 and cfg1 in driver.

I changed 'Size of configuration space passed from DT' from 0x1000 to 0x2000 as below:

	ranges = <0x00000800 0 0x40000000 0x40000000 0 0x00002000   /* configuration space */
		     0x81000000 0 0          0x40002000 0 0x00010000   /* downstream I/O */

0x82000000 0 0x40012000 0x40012000 0 0x1ffee000>; /* non-prefetchable memory */

Then, I tested it on Exynos platform; it works properly with Ethernet card.

Best regards,
Jingoo Han

Quoted 14 lines

Regards
Pratysuh

Quoted 10 lines
Quoted 5 lines

On SPEAr I see issues with PCIe to PCI bridge and PCIe to PCIe switch.

Imprecise external abort is generated, providing hook for abort(similar to imx6) solves this.

But this issue seems to be different :-s

Thanks
Kishon

author
#6 lore raw
Quoted 20 lines · Jingoo Han
Quoted 19 lines · Pratyush Anand
Quoted 17 lines · Kishon Vijay Abraham I
Quoted 7 lines · Ajay Khandelwal

Hi Kishon,

Quoted 2 lines · Kishon Vijay Abraham I

Thanks for the patch. I have just burnt my PCIE-to-PCI bridge card :-s Will test this once I get a new card.

were you able to solve issue in PCIE-to-PCI bridge.

oh yes. I was giving the total configuration space as 4k (2k for cfg0 and 2k for cfg1). But there was some problem when I write 0x800 to PCIE_ATU_LOWER_BASE. If I read back PCIE_ATU_LOWER_BASE after writing 0x800, it has 0x0.

So I increased the configuration space to 8k (4k for cfg0 and 4k for cfg1). With this I write 0x1000 to PCIE_ATU_LOWER_BASE and able to enumerate devices behind a PCIE-to-PCI bridge.

Quoted 5 lines
Quoted 3 lines

As per designware specs minimum value of CX_ATU_MIN_REGION_SIZE is 4 KB. Depending on the SOC it can be configured from 4 to 64KB. So you can not have an address translation unit less than 4 KB in any SOC.

In the case of Exynos, the minimum value of CX_ATU_MIN_REGION_SIZE is 64KB.

Oh! Sorry.

I got the response from one of our hardware engineers about 'CX_ATU_MIN_REGION_SIZE'. The minimum value of CX_ATU_MIN_REGION_SIZE is 4KB.

Sorry for confusing you. :-(

Best regards,
Jingoo Han

Quoted 42 lines
Quoted 6 lines

I think, it would be worth to mention this information in designware pcie binding documentation.

However I am surprised, how does it work in case of exynos. Jingoo??

I don't know. However, there was no issue at my side. Currently, I am testing only Ethernet cards & SATA cards.

Quoted 4 lines

Size of configuration space passed from DT is 0x1000 in exynos. As per my understanding (and what snps specs says), this value should be minimum 0x2000 in any SOC, as we divide this space equally for cfg0 and cfg1 in driver.

I changed 'Size of configuration space passed from DT' from 0x1000 to 0x2000 as below:

	ranges = <0x00000800 0 0x40000000 0x40000000 0 0x00002000   /* configuration space */
		     0x81000000 0 0          0x40002000 0 0x00010000   /* downstream I/O */

0x82000000 0 0x40012000 0x40012000 0 0x1ffee000>; /* non-prefetchable memory */

Then, I tested it on Exynos platform; it works properly with Ethernet card.

Best regards,
Jingoo Han

Quoted 14 lines

Regards
Pratysuh

Quoted 10 lines
Quoted 5 lines

On SPEAr I see issues with PCIe to PCI bridge and PCIe to PCIe switch.

Imprecise external abort is generated, providing hook for abort(similar to imx6) solves this.

But this issue seems to be different :-s

Thanks
Kishon

#7 lore raw
Quoted 25 lines · Jingoo Han
Quoted 24 lines · Jingoo Han
Quoted 22 lines · Pratyush Anand
Quoted 9 lines · Kishon Vijay Abraham I
Quoted 7 lines · Ajay Khandelwal

Hi Kishon,

Quoted 2 lines · Kishon Vijay Abraham I

Thanks for the patch. I have just burnt my PCIE-to-PCI bridge card :-s Will test this once I get a new card.

were you able to solve issue in PCIE-to-PCI bridge.

Quoted 8 lines

oh yes. I was giving the total configuration space as 4k (2k for cfg0 and 2k for cfg1). But there was some problem when I write 0x800 to PCIE_ATU_LOWER_BASE. If I read back PCIE_ATU_LOWER_BASE after writing 0x800, it has 0x0.

So I increased the configuration space to 8k (4k for cfg0 and 4k for cfg1). With this I write 0x1000 to PCIE_ATU_LOWER_BASE and able to enumerate devices behind a PCIE-to-PCI bridge.

As per designware specs minimum value of CX_ATU_MIN_REGION_SIZE is 4 KB. Depending on the SOC it can be configured from 4 to 64KB. So you can not have an address translation unit less than 4 KB in any SOC.

Quoted 7 lines
Quoted 1 line

In the case of Exynos, the minimum value of CX_ATU_MIN_REGION_SIZE is 64KB.

Oh! Sorry.

I got the response from one of our hardware engineers about 'CX_ATU_MIN_REGION_SIZE'. The minimum value of CX_ATU_MIN_REGION_SIZE is 4KB.

In case of 4 KB, you should keep configuration space size in DT as 0x2000.

With the current value (0x1000) you will not have any problem in cfg0 transfer, however you will not be able to execute cfg1. To test cfg1 transaction you will need a PICe card having multiple EP below a bridge.

Regards
Pratyush

Quoted 48 lines

Sorry for confusing you. :-(

Best regards,
Jingoo Han

Quoted 42 lines
Quoted 6 lines

I think, it would be worth to mention this information in designware pcie binding documentation.

However I am surprised, how does it work in case of exynos. Jingoo??

I don't know. However, there was no issue at my side. Currently, I am testing only Ethernet cards & SATA cards.

Quoted 4 lines

Size of configuration space passed from DT is 0x1000 in exynos. As per my understanding (and what snps specs says), this value should be minimum 0x2000 in any SOC, as we divide this space equally for cfg0 and cfg1 in driver.

I changed 'Size of configuration space passed from DT' from 0x1000 to 0x2000 as below:

	ranges = <0x00000800 0 0x40000000 0x40000000 0 0x00002000   /* configuration space */
		     0x81000000 0 0          0x40002000 0 0x00010000   /* downstream I/O */

0x82000000 0 0x40012000 0x40012000 0 0x1ffee000>; /* non-prefetchable memory */

Then, I tested it on Exynos platform; it works properly with Ethernet card.

Best regards,
Jingoo Han

Quoted 14 lines

Regards
Pratysuh

Quoted 10 lines
Quoted 5 lines

On SPEAr I see issues with PCIe to PCI bridge and PCIe to PCIe switch.

Imprecise external abort is generated, providing hook for abort(similar to imx6) solves this.

But this issue seems to be different :-s

Thanks
Kishon