Re: [patches] Re: [PATCH 01/17] drivers: support PCIe in RISCV

2017-06-23 Thread Palmer Dabbelt
On Wed, 07 Jun 2017 10:40:50 PDT (-0700), Olof Johansson wrote:
> On Wed, Jun 7, 2017 at 10:09 AM, Wesley Terpstra  wrote:
>>
>>
>> On Jun 7, 2017 7:26 AM, "Christoph Hellwig"  wrote:
>>
>> On Tue, Jun 06, 2017 at 03:59:51PM -0700, Palmer Dabbelt wrote:
>>> From: "Wesley W. Terpstra" 
>>>
>>> There are RISC-V systems that have been mapped to Xilinx FPGAs that have
>>> their PCIe controllers on chip.  These build system changes allow RISC-V
>>> systems to enable the Xilinx PCIe controller, and to setup PCIe IRQs.
>>>
>>> Signed-off-by: Palmer Dabbelt 
>>> ---
>>>  drivers/pci/Makefile | 1 +
>>>  drivers/pci/host/Kconfig | 2 +-
>>>  2 files changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
>>> index 462c1f5f5546..a29d9ec05d13 100644
>>> --- a/drivers/pci/Makefile
>>> +++ b/drivers/pci/Makefile
>>> @@ -41,6 +41,7 @@ obj-$(CONFIG_MIPS) += setup-irq.o
>>>  obj-$(CONFIG_TILE) += setup-irq.o
>>>  obj-$(CONFIG_SPARC_LEON) += setup-irq.o
>>>  obj-$(CONFIG_M68K) += setup-irq.o
>>> +obj-$(CONFIG_RISCV) += setup-irq.o
>>
>> Can we do a cleanup here and add a ARCH_USE_GENERIC_PCI_SETUP Kconfig
>> symbol that all these architectures can select?
>>
>>
>> That would probably be better. I did not want to touch other arch/ folders
>> in our changes.
>
> I understand that approach when you're doing things in your tree
> early, but in this case (and at this phase in submission/merging),
> don't be afraid to touch other architectures and refactor/clean up.
>
> Please do the refactor in a separate preceding patch and submit it
> separate/soon instead of keeping it just in the series and bundled
> with your addition. That way it can go in when ready even if the rest
> of the series is spinning.

Makes sense.  I've started submitting the various smaller patches so we can get
them all in to make our patch set smaller.


Re: [PATCH 01/17] drivers: support PCIe in RISCV

2017-06-07 Thread Olof Johansson
On Wed, Jun 7, 2017 at 10:09 AM, Wesley Terpstra  wrote:
>
>
> On Jun 7, 2017 7:26 AM, "Christoph Hellwig"  wrote:
>
> On Tue, Jun 06, 2017 at 03:59:51PM -0700, Palmer Dabbelt wrote:
>> From: "Wesley W. Terpstra" 
>>
>> There are RISC-V systems that have been mapped to Xilinx FPGAs that have
>> their PCIe controllers on chip.  These build system changes allow RISC-V
>> systems to enable the Xilinx PCIe controller, and to setup PCIe IRQs.
>>
>> Signed-off-by: Palmer Dabbelt 
>> ---
>>  drivers/pci/Makefile | 1 +
>>  drivers/pci/host/Kconfig | 2 +-
>>  2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
>> index 462c1f5f5546..a29d9ec05d13 100644
>> --- a/drivers/pci/Makefile
>> +++ b/drivers/pci/Makefile
>> @@ -41,6 +41,7 @@ obj-$(CONFIG_MIPS) += setup-irq.o
>>  obj-$(CONFIG_TILE) += setup-irq.o
>>  obj-$(CONFIG_SPARC_LEON) += setup-irq.o
>>  obj-$(CONFIG_M68K) += setup-irq.o
>> +obj-$(CONFIG_RISCV) += setup-irq.o
>
> Can we do a cleanup here and add a ARCH_USE_GENERIC_PCI_SETUP Kconfig
> symbol that all these architectures can select?
>
>
> That would probably be better. I did not want to touch other arch/ folders
> in our changes.

I understand that approach when you're doing things in your tree
early, but in this case (and at this phase in submission/merging),
don't be afraid to touch other architectures and refactor/clean up.

Please do the refactor in a separate preceding patch and submit it
separate/soon instead of keeping it just in the series and bundled
with your addition. That way it can go in when ready even if the rest
of the series is spinning.


-Olof


Re: [PATCH 01/17] drivers: support PCIe in RISCV

2017-06-07 Thread Christoph Hellwig
On Tue, Jun 06, 2017 at 03:59:51PM -0700, Palmer Dabbelt wrote:
> From: "Wesley W. Terpstra" 
> 
> There are RISC-V systems that have been mapped to Xilinx FPGAs that have
> their PCIe controllers on chip.  These build system changes allow RISC-V
> systems to enable the Xilinx PCIe controller, and to setup PCIe IRQs.
> 
> Signed-off-by: Palmer Dabbelt 
> ---
>  drivers/pci/Makefile | 1 +
>  drivers/pci/host/Kconfig | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
> index 462c1f5f5546..a29d9ec05d13 100644
> --- a/drivers/pci/Makefile
> +++ b/drivers/pci/Makefile
> @@ -41,6 +41,7 @@ obj-$(CONFIG_MIPS) += setup-irq.o
>  obj-$(CONFIG_TILE) += setup-irq.o
>  obj-$(CONFIG_SPARC_LEON) += setup-irq.o
>  obj-$(CONFIG_M68K) += setup-irq.o
> +obj-$(CONFIG_RISCV) += setup-irq.o

Can we do a cleanup here and add a ARCH_USE_GENERIC_PCI_SETUP Kconfig
symbol that all these architectures can select?

>  
>  #
>  # ACPI Related PCI FW Functions
> diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig
> index 7f47cd5e10a5..5148f3d3cab7 100644
> --- a/drivers/pci/host/Kconfig
> +++ b/drivers/pci/host/Kconfig
> @@ -71,7 +71,7 @@ config PCI_HOST_GENERIC
>  
>  config PCIE_XILINX
>   bool "Xilinx AXI PCIe host bridge support"
> - depends on ARCH_ZYNQ || MICROBLAZE
> + depends on ARCH_ZYNQ || MICROBLAZE || RISCV

What about of arch support does this driver need?  It seems to compile
just fine on x86 for me, so maybe we should just drop the arch
dependency entirely.


Re: [PATCH 01/17] drivers: support PCIe in RISCV

2017-06-07 Thread Geert Uytterhoeven
CC pci folks

On Wed, Jun 7, 2017 at 12:59 AM, Palmer Dabbelt  wrote:
> From: "Wesley W. Terpstra" 
>
> There are RISC-V systems that have been mapped to Xilinx FPGAs that have
> their PCIe controllers on chip.  These build system changes allow RISC-V
> systems to enable the Xilinx PCIe controller, and to setup PCIe IRQs.
>
> Signed-off-by: Palmer Dabbelt 
> ---
>  drivers/pci/Makefile | 1 +
>  drivers/pci/host/Kconfig | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
> index 462c1f5f5546..a29d9ec05d13 100644
> --- a/drivers/pci/Makefile
> +++ b/drivers/pci/Makefile
> @@ -41,6 +41,7 @@ obj-$(CONFIG_MIPS) += setup-irq.o
>  obj-$(CONFIG_TILE) += setup-irq.o
>  obj-$(CONFIG_SPARC_LEON) += setup-irq.o
>  obj-$(CONFIG_M68K) += setup-irq.o
> +obj-$(CONFIG_RISCV) += setup-irq.o
>
>  #
>  # ACPI Related PCI FW Functions
> diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig
> index 7f47cd5e10a5..5148f3d3cab7 100644
> --- a/drivers/pci/host/Kconfig
> +++ b/drivers/pci/host/Kconfig
> @@ -71,7 +71,7 @@ config PCI_HOST_GENERIC
>
>  config PCIE_XILINX
> bool "Xilinx AXI PCIe host bridge support"
> -   depends on ARCH_ZYNQ || MICROBLAZE
> +   depends on ARCH_ZYNQ || MICROBLAZE || RISCV
> help
>   Say 'Y' here if you want kernel to support the Xilinx AXI PCIe
>   Host Bridge driver.
> --
> 2.13.0


[PATCH 01/17] drivers: support PCIe in RISCV

2017-06-06 Thread Palmer Dabbelt
From: "Wesley W. Terpstra" 

There are RISC-V systems that have been mapped to Xilinx FPGAs that have
their PCIe controllers on chip.  These build system changes allow RISC-V
systems to enable the Xilinx PCIe controller, and to setup PCIe IRQs.

Signed-off-by: Palmer Dabbelt 
---
 drivers/pci/Makefile | 1 +
 drivers/pci/host/Kconfig | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 462c1f5f5546..a29d9ec05d13 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -41,6 +41,7 @@ obj-$(CONFIG_MIPS) += setup-irq.o
 obj-$(CONFIG_TILE) += setup-irq.o
 obj-$(CONFIG_SPARC_LEON) += setup-irq.o
 obj-$(CONFIG_M68K) += setup-irq.o
+obj-$(CONFIG_RISCV) += setup-irq.o
 
 #
 # ACPI Related PCI FW Functions
diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig
index 7f47cd5e10a5..5148f3d3cab7 100644
--- a/drivers/pci/host/Kconfig
+++ b/drivers/pci/host/Kconfig
@@ -71,7 +71,7 @@ config PCI_HOST_GENERIC
 
 config PCIE_XILINX
bool "Xilinx AXI PCIe host bridge support"
-   depends on ARCH_ZYNQ || MICROBLAZE
+   depends on ARCH_ZYNQ || MICROBLAZE || RISCV
help
  Say 'Y' here if you want kernel to support the Xilinx AXI PCIe
  Host Bridge driver.
-- 
2.13.0