2018-08-14 12:51:20

by Ramon Fried

[permalink] [raw]
Subject: PCI Endpoint - Missing inbound mapping ops ?

Hi.
I recently saw that the PCI endpoint API only supports outbound memory
mapping: (AXI -> PCI) through the map_addr op.
Why inbound mapping is missing (PCI->AXI) is missing ?
In almost all of the PCI EP controllers I've worked with there was a
need to map complete BARS or part of BARS to mmio/aperature regions on
the device.

Thanks !
Ramon.


2018-08-14 12:57:05

by Ramon Fried

[permalink] [raw]
Subject: Re: PCI Endpoint - Missing inbound mapping ops ?

On Tue, Aug 14, 2018 at 1:53 PM Kishon Vijay Abraham I <[email protected]> wrote:
>
> Hi,
>
> On Tuesday 14 August 2018 06:19 PM, Ramon Fried wrote:
> > Hi.
> > I recently saw that the PCI endpoint API only supports outbound memory
> > mapping: (AXI -> PCI) through the map_addr op.
> > Why inbound mapping is missing (PCI->AXI) is missing ?
> > In almost all of the PCI EP controllers I've worked with there was a
> > need to map complete BARS or part of BARS to mmio/aperature regions on
> > the device.
>
> pci_epc_set_bar() is used for mapping BAR.
Thanks Kishon.
what about address mapping ? Synopsys has this functionality if I
recall correctly.

>
> Thanks
> Kishon

2018-08-14 14:07:32

by Kishon Vijay Abraham I

[permalink] [raw]
Subject: Re: PCI Endpoint - Missing inbound mapping ops ?

Hi,

On Tuesday 14 August 2018 06:25 PM, Ramon Fried wrote:
> On Tue, Aug 14, 2018 at 1:53 PM Kishon Vijay Abraham I <[email protected]> wrote:
>>
>> Hi,
>>
>> On Tuesday 14 August 2018 06:19 PM, Ramon Fried wrote:
>>> Hi.
>>> I recently saw that the PCI endpoint API only supports outbound memory
>>> mapping: (AXI -> PCI) through the map_addr op.
>>> Why inbound mapping is missing (PCI->AXI) is missing ?
>>> In almost all of the PCI EP controllers I've worked with there was a
>>> need to map complete BARS or part of BARS to mmio/aperature regions on
>>> the device.
>>
>> pci_epc_set_bar() is used for mapping BAR.
> Thanks Kishon.
> what about address mapping ? Synopsys has this functionality if I
> recall correctly.

The addresses that the RC will put in BAR's is not known while we initialize
the endpoint. So we really can't map BAR's PCI address to an inbound address
while EP initialization.

I think some older version of Synopsys had this (and didn't have BAR mapping).
Actually TI's K2G had this IP. However the ATU registers here are mapped to
BAR0. So the host side PCI driver can program the PCI address (that the RC has
allocated for BARs) in ATU.

Thanks
Kishon

2018-08-14 14:55:35

by Ramon Fried

[permalink] [raw]
Subject: Re: PCI Endpoint - Missing inbound mapping ops ?

On Tue, Aug 14, 2018 at 2:04 PM Kishon Vijay Abraham I <[email protected]> wrote:
>
> Hi,
>
> On Tuesday 14 August 2018 06:25 PM, Ramon Fried wrote:
> > On Tue, Aug 14, 2018 at 1:53 PM Kishon Vijay Abraham I <[email protected]> wrote:
> >>
> >> Hi,
> >>
> >> On Tuesday 14 August 2018 06:19 PM, Ramon Fried wrote:
> >>> Hi.
> >>> I recently saw that the PCI endpoint API only supports outbound memory
> >>> mapping: (AXI -> PCI) through the map_addr op.
> >>> Why inbound mapping is missing (PCI->AXI) is missing ?
> >>> In almost all of the PCI EP controllers I've worked with there was a
> >>> need to map complete BARS or part of BARS to mmio/aperature regions on
> >>> the device.
> >>
> >> pci_epc_set_bar() is used for mapping BAR.
> > Thanks Kishon.
> > what about address mapping ? Synopsys has this functionality if I
> > recall correctly.
>
> The addresses that the RC will put in BAR's is not known while we initialize
> the endpoint. So we really can't map BAR's PCI address to an inbound address
> while EP initialization.
>
> I think some older version of Synopsys had this (and didn't have BAR mapping).
> Actually TI's K2G had this IP. However the ATU registers here are mapped to
> BAR0. So the host side PCI driver can program the PCI address (that the RC has
> allocated for BARs) in ATU.
Yes. you're right.
Thanks for the clarification.
>
> Thanks
> Kishon

2018-08-14 15:29:53

by Miguel Ojeda

[permalink] [raw]
Subject: Re: PCI Endpoint - Missing inbound mapping ops ?

Hi Kishon,

On Tue, Aug 14, 2018 at 2:53 PM, Kishon Vijay Abraham I <[email protected]> wrote:
> Hi,
>
> On Tuesday 14 August 2018 06:19 PM, Ramon Fried wrote:
>> Hi.
>> I recently saw that the PCI endpoint API only supports outbound memory
>> mapping: (AXI -> PCI) through the map_addr op.
>> Why inbound mapping is missing (PCI->AXI) is missing ?
>> In almost all of the PCI EP controllers I've worked with there was a
>> need to map complete BARS or part of BARS to mmio/aperature regions on
>> the device.
>
> pci_epc_set_bar() is used for mapping BAR.

Just to let you know, the ARC/DKIM seems wrong according to gmail and
is marked as spam. It seems it happens from time to time. Bjorn
Helgaas (in CC) also had the same problem a couple of years ago.

Cheers,
Miguel

>
> Thanks
> Kishon