Re: [PATCHv5 1/6] PCI: mobiveil: Refactor Mobiveil PCIe Host Bridge IP driver

2019-04-23 Thread Subrahmanya Lingappa
i/controller/mobiveil' and refactor it according > to the RC and EP abstraction. > > Signed-off-by: Hou Zhiqiang > Reviewed-by: Minghuan Lian > Reviewed-by: Subrahmanya Lingappa > --- > V5: > - Regenerated this patch on the new base. > - Retouched the changel

Re: [PATCHv4 11/28] PCI: mobiveil: only fix up the Class Code field

2019-03-13 Thread Subrahmanya Lingappa
cient to mention in code comment: "Fixing the class code as hardware is not reflecting the correct class code", And the changelog for this patch mentioning "avoid changing the revision ID during the class code fix". Is that OK? Thanks, > > > > Fixes

Re: [PATCH 1/6] PCI: mobiveil: Add the EP mode support

2019-03-07 Thread Subrahmanya Lingappa
/* MSI information */ > struct mutex lock; /* protect bitmap variable */ > @@ -169,6 +190,29 @@ struct mobiveil_pab_ops { > int (*host_init)(struct mobiveil_pcie *pcie); > }; > > +struct mobiveil_pcie_ep_ops { > + void (*ep_init)(struct mobiveil_pcie_ep *ep); > + int (*raise_irq)(struct mobiveil_pcie_ep *ep, u8 func_no, > +enum pci_epc_irq_type type, u16 interrupt_num); > +}; > + > +struct mobiveil_pcie_ep { > + struct pci_epc *epc; > + struct mobiveil_pcie_ep_ops *ops; > + phys_addr_t phys_base; > + size_t addr_size; > + size_t page_size; > + phys_addr_t *outbound_addr; > + unsigned long *ob_window_map; > + u32 num_ob_windows; > + void __iomem *msi_mem; > + phys_addr_t msi_mem_phys; > + u8 msi_cap; /* MSI capability offset */ > + u8 msix_cap;/* MSI-X capability offset */ > + u8 bar_num; > + u32 pf_num; > +}; > + > struct mobiveil_pcie { > struct platform_device *pdev; > struct list_head *resources; > @@ -181,7 +225,10 @@ struct mobiveil_pcie { > u32 ib_wins_configured; /* configured inbound windows */ > const struct mobiveil_pab_ops *ops; > struct root_port rp; > + struct mobiveil_pcie_ep ep; > }; > +#define to_mobiveil_pcie_from_ep(endpoint) \ > + container_of((endpoint), struct mobiveil_pcie, ep) > > int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie); > int mobiveil_host_init(struct mobiveil_pcie *pcie, bool reinit); > @@ -226,4 +273,21 @@ static inline void csr_writeb(struct mobiveil_pcie > *pcie, u32 val, u32 off) > csr_write(pcie, val, off, 0x1); > } > > +void program_ib_windows_ep(struct mobiveil_pcie *pcie, u8 func_no, > + int bar, u64 phys); > +int program_ob_windows_ep(struct mobiveil_pcie *pcie, int win_num, int type, > + u64 phys, u64 bus_addr, u8 func, u64 size); > +void mobiveil_pcie_disable_ib_win_ep(struct mobiveil_pcie *pci, > +u8 func_no, u8 bar); > +int mobiveil_pcie_ep_init(struct mobiveil_pcie_ep *ep); > +int mobiveil_pcie_ep_raise_legacy_irq(struct mobiveil_pcie_ep *ep, u8 > func_no); > +int mobiveil_pcie_ep_raise_msi_irq(struct mobiveil_pcie_ep *ep, u8 func_no, > +u8 interrupt_num); > +int mobiveil_pcie_ep_raise_msix_irq(struct mobiveil_pcie_ep *ep, u8 func_no, > +u16 interrupt_num); > +void mobiveil_pcie_ep_reset_bar(struct mobiveil_pcie *pci, enum pci_barno > bar); > +void mobiveil_pcie_enable_bridge_pio(struct mobiveil_pcie *pci); > +void mobiveil_pcie_enable_engine_apio(struct mobiveil_pcie *pci); > +void mobiveil_pcie_enable_engine_ppio(struct mobiveil_pcie *pci); > +void mobiveil_pcie_enable_msi_ep(struct mobiveil_pcie *pci); > #endif /* _PCIE_MOBIVEIL_H */ > -- > 1.7.1 > Please review and fix macro alignments, otherwise looks ok. Reviewed-by: Subrahmanya Lingappa

Re: [PATCHv3 25/27] PCI: mobiveil: ls_pcie_g4: add Workaround for A-011451

2019-02-08 Thread Subrahmanya Lingappa
ZQ, On Tue, Jan 29, 2019 at 1:41 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > When LX2 PCIe controller is sending multiple split completions and > ACK latency expires indicating that ACK should be send at priority. > But because of large number of split completions and FC update DLLP, > the

Re: [PATCHv3 24/27] PCI: mobiveil: ls_pcie_g4: add Workaround for A-011577

2019-02-08 Thread Subrahmanya Lingappa
ZQ, On Tue, Jan 29, 2019 at 1:41 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > PCIe configuration access to non-existent function triggered > SERROR interrupt exception. > > Workaround: > Disable error reporting on AXI bus during the Vendor ID read > transactions in enumeration. > > This ERRATA

Re: [PATCHv3 23/27] PCI: mobiveil: add PCIe Gen4 RC driver for NXP Layerscape SoCs

2019-02-08 Thread Subrahmanya Lingappa
ZQ, On Tue, Jan 29, 2019 at 1:40 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > This PCIe controller is based on the Mobiveil GPEX IP, which is > compatible with the PCI Express™ Base Specification, Revision 4.0. > > Signed-off-by: Hou Zhiqiang > Reviewed-by: Minghuan Lian > --- > V3: > - No

Re: [PATCHv3 21/27] PCI: mobiveil: make mobiveil_host_init can be used to re-init host

2019-02-08 Thread Subrahmanya Lingappa
struct list_head resources; > + struct list_head *resources; > void __iomem *csr_axi_slave_base; /* PAB registers base */ > phys_addr_t pcie_reg_base; /* Physical PCIe Controller Base */ > void __iomem *apb_csr_base; /* MSI register base */ > @@ -165,6 +165,7 @@ struct mobiveil_pcie { > }; > > int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie); > +int mobiveil_host_init(struct mobiveil_pcie *pcie, bool reinit); > bool mobiveil_pcie_link_up(struct mobiveil_pcie *pcie); > int mobiveil_bringup_link(struct mobiveil_pcie *pcie); > void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, u64 > cpu_addr, > -- > 2.17.1 > Reviewed-by: Subrahmanya Lingappa

Re: [PATCHv3 20/27] PCI: mobiveil: add Byte and Half-Word width register accessors

2019-02-08 Thread Subrahmanya Lingappa
static inline void csr_writeb(struct mobiveil_pcie *pcie, u32 val, u32 off) > +{ > + csr_write(pcie, val, off, 0x1); > +} > + > #endif /* _PCIE_MOBIVEIL_H */ > -- > 2.17.1 > Reviewed-by: Subrahmanya Lingappa

Re: [PATCHv3 18/27] PCI: mobiveil: continue to initialize the host upon no PCIe link

2019-02-08 Thread Subrahmanya Lingappa
biveil.c > @@ -222,7 +222,7 @@ int mobiveil_bringup_link(struct mobiveil_pcie *pcie) > usleep_range(LINK_WAIT_MIN, LINK_WAIT_MAX); > } > > - dev_err(>pdev->dev, "link never came up\n"); > + dev_info(>pdev->dev, "link never came up\n"); > > return -ETIMEDOUT; > } > -- > 2.17.1 > Reviewed-by: Subrahmanya Lingappa

Re: [PATCHv3 19/27] PCI: mobiveil: disabled IB and OB windows set by bootloader

2019-02-08 Thread Subrahmanya Lingappa
ram_ib_windows(struct mobiveil_pcie *pcie, int win_num, u64 > cpu_addr, > u64 pci_addr, u32 type, u64 size); > +void mobiveil_pcie_disable_ob_win(struct mobiveil_pcie *pci, int win_num); > +void mobiveil_pcie_disable_ib_win(struct mobiveil_pcie *pci, int win_num); > u32 csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size); > void csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, size_t size); > > -- > 2.17.1 > Reviewed-by: Subrahmanya Lingappa

Re: [PATCHv3 17/27] PCI: mobiveil: fix the checking of valid device

2019-02-08 Thread Subrahmanya Lingappa
ZQ, On Tue, Jan 29, 2019 at 1:40 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > Avoid to issue CFG transactions to link partner when the PCIe > link is not up. And allow CFG transactions to all functions of > Endpoint implemented multiple functions. > > Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add

Re: [PATCHv3 16/27] PCI: mobiveil: refactor Mobiveil PCIe Host Bridge IP driver

2019-02-08 Thread Subrahmanya Lingappa
; create mode 100644 drivers/pci/controller/mobiveil/pcie-mobiveil.c > create mode 100644 drivers/pci/controller/mobiveil/pcie-mobiveil.h > > diff --git a/MAINTAINERS b/MAINTAINERS > index ddcdc29dfe1f..3bca9642b08b 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS &g

Re: [PATCHv3 14/27] PCI: mobiveil: initialize Primary/Secondary/Subordinate bus number

2019-02-08 Thread Subrahmanya Lingappa
r_readl(pcie, PCI_PRIMARY_BUS); > + value &= 0xff00; > + value |= 0x00ff0100; > + csr_writel(pcie, value, PCI_PRIMARY_BUS); > + > /* > * program Bus Master Enable Bit in Command Register in PAB Config > * Space > -- > 2.17.1 > Reviewed-by: Subrahmanya Lingappa

Re: [PATCHv3 15/27] dt-bindings: pci: mobiveil: change gpio_slave and apb_csr to optional

2019-02-08 Thread Subrahmanya Lingappa
On Tue, Jan 29, 2019 at 1:40 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > Change the "gpio_slave" and "apb_csr" to optional, the "gpio_slave" > is not used in current code, and "apb_csr" is not used by some > platforms. > > Signed

Re: [PATCHv3 13/27] PCI: mobiveil: move irq chained handler setup out of DT parse

2019-02-08 Thread Subrahmanya Lingappa
; > } > > @@ -902,6 +900,8 @@ static int mobiveil_pcie_probe(struct platform_device > *pdev) > goto error; > } > > + irq_set_chained_handler_and_data(pcie->irq, mobiveil_pcie_isr, pcie); > + > ret = devm_request_pci_bus_resources(dev, >resources); > if (ret) > goto error; > -- > 2.17.1 > Reviewed-by: Subrahmanya Lingappa

Re: [PATCHv3 01/27] PCI: mobiveil: uniform the register accessors

2019-02-06 Thread Subrahmanya Lingappa
Lorenzo, On Tue, Feb 5, 2019 at 11:13 PM Lorenzo Pieralisi wrote: > > On Tue, Feb 05, 2019 at 11:09:19AM +0530, Subrahmanya Lingappa wrote: > > Reviewed-by: Subrahmanya Lingappa > > I have a feeling you do not read what I write. My apologies, I do read. I am new to reviewing

Re: [PATCHv3 11/27] PCI: mobiveil: only fix up the Class Code field

2019-02-04 Thread Subrahmanya Lingappa
Reviewed-by: Subrahmanya Lingappa On Tue, Jan 29, 2019 at 1:39 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > Fix up the Class Code to PCI bridge, do not change the Revision ID. > And move the fixup to mobiveil_host_init function. > > Fixes: 9af6bcb11e12 ("PCI: mobive

Re: [PATCHv3 12/27] PCI: mobiveil: move out the link up waiting from mobiveil_host_init

2019-02-04 Thread Subrahmanya Lingappa
Reviewed-by: Subrahmanya Lingappa On Tue, Jan 29, 2019 at 1:39 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > Host initial sequence does not depend on PCIe link up, so move it > to the place just before the enumeration. > > Signed-off-by: Hou Zhiqiang > Reviewed-by: M

Re: [PATCHv3 10/27] PCI: mobiveil: fix the INTx process error

2019-02-04 Thread Subrahmanya Lingappa
Reviewed-by: Subrahmanya Lingappa On Tue, Jan 29, 2019 at 1:39 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > In the loop block, there is not code change the loop key, > this patch updated the loop key by re-read the INTx status > register. > > This patch also change t

Re: [PATCHv3 09/27] PCI: mobiveil: correct inbound/outbound window setup routines

2019-02-04 Thread Subrahmanya Lingappa
ZQ, please correct the tab spacing of the macro definitions, otherwise its OK. Reviewed-by: Subrahmanya Lingappa On Tue, Jan 29, 2019 at 1:39 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > Outbound window routine: > - Removed unused var definition and register read operati

Re: [PATCHv3 08/27] PCI: mobiveil: use the 1st inbound window for MEM inbound transactions

2019-02-04 Thread Subrahmanya Lingappa
Reviewed-by: Subrahmanya Lingappa On Tue, Jan 29, 2019 at 1:39 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > The inbound windows have different register set with outbound windows. > This patch change the MEM inbound window to the first one. > > Signed-off-by: Hou

Re: [PATCHv3 07/27] PCI: mobiveil: use WIN_NUM_0 explicitly for CFG outbound window

2019-02-04 Thread Subrahmanya Lingappa
Reviewed-by: Subrahmanya Lingappa On Tue, Jan 29, 2019 at 1:39 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > As the .map_bus() use the WIN_NUM_0 for CFG transactions, > it's better passing WIN_NUM_0 explicitly when initialize > the CFG outbound window. > > Sig

Re: [PATCHv3 06/27] PCI: mobiveil: replace the resource list iteration function

2019-02-04 Thread Subrahmanya Lingappa
Reviewed-by: Subrahmanya Lingappa On Tue, Jan 29, 2019 at 1:39 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > As it won't delete any node in this iteration, replaced > the function resource_list_for_each_entry_safe() with > the resource_list_for_each_entry(). > > Sig

Re: [PATCHv3 05/27] PCI: mobiveil: correct PCI base address in MEM/IO outbound windows

2019-02-04 Thread Subrahmanya Lingappa
Reviewed-by: Subrahmanya Lingappa On Tue, Jan 29, 2019 at 1:39 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > It should get PCI base address from the DT node property 'ranges' > to setup MEM/IO outbound windows instead of always zero. > > Fixes: 9af6bcb11e12 ("PCI: m

Re: [PATCHv3 04/27] PCI: mobiveil: remove flag MSI_FLAG_MULTI_PCI_MSI

2019-02-04 Thread Subrahmanya Lingappa
Zhiqiang, why are we removing multi-MSI support ? what functionality this driver is not providing to support it ? Thanks. On Tue, Jan 29, 2019 at 1:38 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > The current code does not support multiple MSIs, so remove > the corresponding flag from the

Re: [PATCHv3 03/27] PCI: mobiveil: correct the returned error number

2019-02-04 Thread Subrahmanya Lingappa
Reviewed-by: Subrahmanya Lingappa On Tue, Jan 29, 2019 at 1:38 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > This patch corrected the returned error number by convention, > and removed a unnecessary error check. > > Signed-off-by: Hou Zhiqiang > Reviewed-by: M

Re: [PATCHv3 02/27] PCI: mobiveil: format the code without function change

2019-02-04 Thread Subrahmanya Lingappa
Zhiqiang, On Tue, Jan 29, 2019 at 1:38 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > Just format the code without functionality change. > > Signed-off-by: Hou Zhiqiang > Reviewed-by: Minghuan Lian > --- > V3: > - No change > > drivers/pci/controller/pcie-mobiveil.c | 261

Re: [PATCHv3 01/27] PCI: mobiveil: uniform the register accessors

2019-02-04 Thread Subrahmanya Lingappa
Reviewed-by: Subrahmanya Lingappa On Tue, Jan 29, 2019 at 1:38 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > It's confused that R/W some registers by csr_readl()/csr_writel(), > while others by read_paged_register()/write_paged_register(). > Actually the low 3KB of 4KB PC

Re: [PATCHv3 00/27] PCI: refactor Mobiveil driver and add PCIe Gen4 driver for NXP Layerscape SoCs

2019-02-04 Thread Subrahmanya Lingappa
Lorenzo, My apologies again, I have started looking into these. Thanks, On Mon, Feb 4, 2019 at 9:43 PM Lorenzo Pieralisi wrote: > > On Mon, Feb 04, 2019 at 07:44:25PM +0530, Subrahmanya Lingappa wrote: > >Bjorn, > >My apologies, I was away for a while from this

Re: [PATCH 00/23] PCI: refactor the Mobiveil driver and add PCIe support for NXP LX SoCs

2018-12-09 Thread Subrahmanya Lingappa
Lorenzo, You are right, I reviewed few DT files, will need some time to review this train. I will start doing it in a while. Thanks for pitching in. Thanks. On Mon, Dec 3, 2018 at 8:58 AM Lorenzo Pieralisi wrote: > > On Tue, Nov 06, 2018 at 01:19:03PM +, Z.q. Hou wrote: > > From: Hou

Re: [PATCH 15/23] dt-bindings: pci: mobiveil: change gpio_slave and apb_csr to optional

2018-11-14 Thread Subrahmanya Lingappa
Acked-by: Subrahmanya Lingappa On Tue, Nov 6, 2018 at 6:50 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > Change the "gpio_slave" and "apb_csr" to optional, the "gpio_slave" > is not used in current code, and "apb_csr" is not u

Re: [PATCH 15/23] dt-bindings: pci: mobiveil: change gpio_slave and apb_csr to optional

2018-11-14 Thread Subrahmanya Lingappa
Acked-by: Subrahmanya Lingappa On Tue, Nov 6, 2018 at 6:50 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > Change the "gpio_slave" and "apb_csr" to optional, the "gpio_slave" > is not used in current code, and "apb_csr" is not u

Re: [PATCH] PCI: remove unnecessary check of device_type == pci

2018-09-11 Thread Subrahmanya Lingappa
onsidered deprecated for > FDT though we've still been requiring it for PCI hosts as it is useful > for finding PCI buses. > > Cc: Will Deacon > Cc: Lorenzo Pieralisi > Cc: Bjorn Helgaas > Cc: Alan Douglas > Cc: Subrahmanya Lingappa > Cc: Michal Simek > Cc: linux-

Re: [PATCH] PCI: remove unnecessary check of device_type == pci

2018-09-11 Thread Subrahmanya Lingappa
onsidered deprecated for > FDT though we've still been requiring it for PCI hosts as it is useful > for finding PCI buses. > > Cc: Will Deacon > Cc: Lorenzo Pieralisi > Cc: Bjorn Helgaas > Cc: Alan Douglas > Cc: Subrahmanya Lingappa > Cc: Michal Simek > Cc: linux-

Re: [PATCH AUTOSEL 4.18 068/131] PCI: mobiveil: Add missing ../pci.h include

2018-09-02 Thread Subrahmanya Lingappa
Acked-by: Subrahmanya Lingappa Thanks. On Sun, Sep 2, 2018 at 6:34 PM Sasha Levin wrote: > > From: Lorenzo Pieralisi > > [ Upstream commit d3743012230f8dab30d47caba1f2ee9e382385e7 ] > > PCI mobiveil host controller driver currently fails to compile > with the following e

Re: [PATCH AUTOSEL 4.18 068/131] PCI: mobiveil: Add missing ../pci.h include

2018-09-02 Thread Subrahmanya Lingappa
Acked-by: Subrahmanya Lingappa Thanks. On Sun, Sep 2, 2018 at 6:34 PM Sasha Levin wrote: > > From: Lorenzo Pieralisi > > [ Upstream commit d3743012230f8dab30d47caba1f2ee9e382385e7 ] > > PCI mobiveil host controller driver currently fails to compile > with the following e

Re: [PATCH AUTOSEL 4.18 069/131] PCI: mobiveil: Fix struct mobiveil_pcie.pcie_reg_base address type

2018-09-02 Thread Subrahmanya Lingappa
Acked-by: Subrahmanya Lingappa Thanks. On Sun, Sep 2, 2018 at 6:34 PM Sasha Levin wrote: > > From: Lorenzo Pieralisi > > [ Upstream commit af3f606e0bbb6d811c50b7b90fe324b07fb7cab8 ] > > The field pcie_reg_base in struct mobiveil_pcie represents a physical >

Re: [PATCH AUTOSEL 4.18 069/131] PCI: mobiveil: Fix struct mobiveil_pcie.pcie_reg_base address type

2018-09-02 Thread Subrahmanya Lingappa
Acked-by: Subrahmanya Lingappa Thanks. On Sun, Sep 2, 2018 at 6:34 PM Sasha Levin wrote: > > From: Lorenzo Pieralisi > > [ Upstream commit af3f606e0bbb6d811c50b7b90fe324b07fb7cab8 ] > > The field pcie_reg_base in struct mobiveil_pcie represents a physical >