From: Arnd Bergmann <arnd@arndb.de>
To: Mohit Kumar <mohit.kumar@st.com>
Cc: Pratyush Anand <pratyush.anand@st.com>,
Jingoo Han <jg1.han@samsung.com>,
Viresh Kumar <viresh.linux@gmail.com>,
spear-devel@list.st.com, linux-pci@vger.kernel.org
Subject: Re: [PATCH V5 7/8] pcie: SPEAr13xx: Add designware pcie support
Date: Mon, 10 Feb 2014 16:43:22 +0100 [thread overview]
Message-ID: <201402101643.23186.arnd@arndb.de> (raw)
In-Reply-To: <5c82e0b022ce6ce9c42afdc9e59081a95a9394ac.1391871170.git.pratyush.anand@st.com>
On Monday 10 February 2014, Mohit Kumar wrote:
> diff --git a/Documentation/devicetree/bindings/pci/spear13xx-pcie.txt b/Documentation/devicetree/bindings/pci/spear13xx-pcie.txt
> new file mode 100644
> index 0000000..dc8ae44
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pci/spear13xx-pcie.txt
> @@ -0,0 +1,7 @@
> +Required properties:
> +- compatible : should be "st,spear1340-pcie", "snps,dw-pcie".
> +- pcie_is_gen1: pass <1> if forced gen1 initialization is needed to work with
> + some buggy cards else pass <0>.
Better make this an optional property that is only present if gen1 is forced,
and then use of_property_read_bool to check it.
Also, use the common naming convention: "-" instead of "_", and you may want to
prefix it with 'st,'.
> +- phys : phandle to phy node associated with pcie controller
> +- phy-names : must be "pcie-phy"
> +- All other definitions as per generic PCI bindings
Please send the binding to the devicetree mailing list, ideally as a separate patch.
> diff --git a/arch/arm/boot/dts/spear1310.dtsi b/arch/arm/boot/dts/spear1310.dtsi
> index 64e7dd5..8d7aefe 100644
> --- a/arch/arm/boot/dts/spear1310.dtsi
> +++ b/arch/arm/boot/dts/spear1310.dtsi
Best split out the DT changes as well, since we may want to apply them through
the arm-soc tree.
> @@ -83,6 +83,63 @@
> status = "disabled";
> };
>
> + pcie0: pcie@b1000000 {
> + compatible = "st,spear1340-pcie", "snps,dw-pcie";
> + reg = <0xb1000000 0x4000>;
> + interrupts = <0 68 0x4>;
> + interrupt-map-mask = <0 0 0 0>;
> + interrupt-map = <0x0 0 &gic 68>;
> + pcie_is_gen1 = <0>;
> + num-lanes = <1>;
> + phys = <&miphy0 1>;
> + phy-names = "pcie-phy";
> + #address-cells = <3>;
> + #size-cells = <2>;
> + device_type = "pci";
> + ranges = <0x00000800 0 0x80000000 0x80000000 0 0x00020000 /* configuration space */
> + 0x81000000 0 0 0x80020000 0 0x00010000 /* downstream I/O */
> + 0x82000000 0 0x80030000 0xc0030000 0 0x0ffd0000>; /* non-prefetchable memory */
> + status = "disabled";
> + };
But keep the changes for the phy together with the pci changes.
> @@ -338,6 +338,7 @@
> reg = <0xe07008c4 0x4>;
> thermal_flags = <0x7000>;
> };
> +
> };
> };
> };
I assume this change was not intentional.
> diff --git a/arch/arm/configs/spear13xx_defconfig b/arch/arm/configs/spear13xx_defconfig
> index 1e0bb6f..96ede50 100644
> --- a/arch/arm/configs/spear13xx_defconfig
> +++ b/arch/arm/configs/spear13xx_defconfig
> @@ -11,6 +11,8 @@ CONFIG_ARCH_SPEAR13XX=y
> CONFIG_MACH_SPEAR1310=y
> CONFIG_MACH_SPEAR1340=y
> # CONFIG_SWP_EMULATE is not set
> +CONFIG_PCI_MSI=y
> +CONFIG_PCIE_SPEAR13XX=y
> CONFIG_SMP=y
> # CONFIG_SMP_ON_UP is not set
> # CONFIG_ARM_CPU_TOPOLOGY is not set
This change can also get folded into patch 3.
> diff --git a/arch/arm/mach-spear/Kconfig b/arch/arm/mach-spear/Kconfig
> index 7e7f1b0..701b6c3 100644
> --- a/arch/arm/mach-spear/Kconfig
> +++ b/arch/arm/mach-spear/Kconfig
> @@ -28,6 +28,7 @@ config ARCH_SPEAR13XX
> select USE_OF
> select MFD_SYSCON
> select PHY_ST_MIPHY40LP
> + select PCI
> help
> Supports for ARM's SPEAR13XX family
>
This doesn't seem right: You are making it impossible to turn off PCI
here. Better use MIGHT_HAVE_PCI instead to make CONFIG_PCI a user-selectable
option.
> diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig
> index 47d46c6..df52fad 100644
> --- a/drivers/pci/host/Kconfig
> +++ b/drivers/pci/host/Kconfig
> @@ -33,4 +33,9 @@ config PCI_RCAR_GEN2
> There are 3 internal PCI controllers available with a single
> built-in EHCI/OHCI host controller present on each one.
>
> +config PCIE_SPEAR13XX
> + bool "STMicroelectronics SPEAr PCIe controller"
> + depends on ARCH_SPEAR13XX
> + select PCIEPORTBUS
> + select PCIE_DW
> endmenu
This can probably be "tristate" instead of "bool. You need to add
a help text.
> diff --git a/drivers/pci/host/Makefile b/drivers/pci/host/Makefile
> index 13fb333..42a491d 100644
> --- a/drivers/pci/host/Makefile
> +++ b/drivers/pci/host/Makefile
> @@ -4,3 +4,4 @@ obj-$(CONFIG_PCI_IMX6) += pci-imx6.o
> obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o
> obj-$(CONFIG_PCI_TEGRA) += pci-tegra.o
> obj-$(CONFIG_PCI_RCAR_GEN2) += pci-rcar-gen2.o
> +obj-$(CONFIG_PCIE_SPEAR13XX) += pcie-spear13xx.o
I'd use the "pci" naming instead of "pcie" here for consistency.
> +
> +/* SPEAr13xx PCIe driver does not allow module unload */
> +
> +static int __init pcie_init(void)
> +{
> +
> + return platform_driver_probe(&spear13xx_pcie_driver,
> + spear13xx_pcie_probe);
> +}
This should be platform_driver_register() so you can support
deferred probing, e.g. if the phy driver gets loaded after the
PCI driver.
Arnd
next prev parent reply other threads:[~2014-02-10 15:43 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 8:51 [PATCH V5 0/8]PCI:Add SPEAr13xx PCie support Mohit Kumar
2014-02-10 8:51 ` Mohit Kumar
2014-02-10 8:51 ` Mohit Kumar
2014-02-10 8:51 ` [PATCH V5 1/8] clk: SPEAr13xx: Fix pcie clock name Mohit Kumar
2014-02-10 8:51 ` [PATCH V5 2/8] SPEAr13xx: Fix static mapping table Mohit Kumar
2014-02-10 8:51 ` [PATCH V5 3/8] SPEAr13xx: defconfig: Update Mohit Kumar
2014-02-10 8:51 ` [PATCH V5 4/8] phy: st-miphy-40lp: Add skeleton driver Mohit Kumar
2014-02-10 8:51 ` Mohit Kumar
2014-02-10 8:51 ` Mohit Kumar
2014-02-10 15:54 ` Arnd Bergmann
2014-02-10 15:54 ` Arnd Bergmann
2014-02-10 15:54 ` Arnd Bergmann
2014-02-11 3:57 ` Mohit KUMAR DCG
2014-02-11 3:57 ` Mohit KUMAR DCG
2014-02-11 3:57 ` Mohit KUMAR DCG
2014-02-11 14:38 ` Arnd Bergmann
2014-02-11 14:38 ` Arnd Bergmann
2014-02-12 4:52 ` Mohit KUMAR DCG
2014-02-12 4:52 ` Mohit KUMAR DCG
2014-02-19 4:09 ` Mohit KUMAR DCG
2014-02-19 4:09 ` Mohit KUMAR DCG
2014-02-19 4:09 ` Mohit KUMAR DCG
2014-02-10 8:51 ` [PATCH V5 5/8] SPEAr13xx: Fixup: Move SPEAr1340 SATA platform code to phy driver Mohit Kumar
2014-02-10 8:51 ` Mohit Kumar
2014-02-10 8:51 ` Mohit Kumar
2014-02-10 8:51 ` [PATCH V5 6/8] phy: st-miphy-40lp: Add SPEAr1310 and SPEAr1340 PCIe phy support Mohit Kumar
2014-02-10 8:51 ` Mohit Kumar
2014-02-10 8:51 ` [PATCH V5 7/8] pcie: SPEAr13xx: Add designware pcie support Mohit Kumar
2014-02-10 15:43 ` Arnd Bergmann [this message]
2014-02-11 4:23 ` Mohit KUMAR DCG
2014-02-11 12:38 ` Arnd Bergmann
2014-02-10 8:51 ` [PATCH V5 8/8] MAINTAINERS: Add ST SPEAr13xx PCIe driver maintainer Mohit Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201402101643.23186.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=jg1.han@samsung.com \
--cc=linux-pci@vger.kernel.org \
--cc=mohit.kumar@st.com \
--cc=pratyush.anand@st.com \
--cc=spear-devel@list.st.com \
--cc=viresh.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.