[PATCH] drivers: pci: imx: fix enumeration logic error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] drivers: pci: imx: fix enumeration logic error

Koen Vandeputte
By default, the subordinate is set equally to the secondary bus (1) when
the RC boots, and does not alter afterwards.

This means that theoretically, the highest bus reachable downstream is
bus 1.

Force the PCIe RC subordinate to 0xff, otherwise no downstream
devices will be detected behind bus 1 if the booting OS does not allow
enumerating a higher busnr than the subordinate value of the primary
bus.

Signed-off-by: Koen Vandeputte <[hidden email]>
---
 drivers/pci/pcie_imx.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/pci/pcie_imx.c b/drivers/pci/pcie_imx.c
index 2900c8d..9277af9 100644
--- a/drivers/pci/pcie_imx.c
+++ b/drivers/pci/pcie_imx.c
@@ -612,6 +612,17 @@ static int imx_pcie_link_up(void)
  imx_pcie_regions_setup();
 
  /*
+ * By default, the subordinate is set equally to the secondary
+ * bus (0x01) when the RC boots.
+ * This means that theoretically, only bus 1 is reachable from the RC.
+ * Force the PCIe RC subordinate to 0xff, otherwise no downstream
+ * devices will be detected if the enumeration is applied strictly.
+ */
+ tmp = readl(MX6_DBI_ADDR + 0x18);
+ tmp |= (0xff << 16);
+ writel(tmp, MX6_DBI_ADDR + 0x18);
+
+ /*
  * FIXME: Force the PCIe RC to Gen1 operation
  * The RC must be forced into Gen1 mode before bringing the link
  * up, otherwise no downstream devices are detected. After the
--
2.7.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] drivers: pci: imx: fix enumeration logic error

Stefano Babic
On 04/01/2018 14:54, Koen Vandeputte wrote:

> By default, the subordinate is set equally to the secondary bus (1) when
> the RC boots, and does not alter afterwards.
>
> This means that theoretically, the highest bus reachable downstream is
> bus 1.
>
> Force the PCIe RC subordinate to 0xff, otherwise no downstream
> devices will be detected behind bus 1 if the booting OS does not allow
> enumerating a higher busnr than the subordinate value of the primary
> bus.
>
> Signed-off-by: Koen Vandeputte <[hidden email]>
> ---
>  drivers/pci/pcie_imx.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/pci/pcie_imx.c b/drivers/pci/pcie_imx.c
> index 2900c8d..9277af9 100644
> --- a/drivers/pci/pcie_imx.c
> +++ b/drivers/pci/pcie_imx.c
> @@ -612,6 +612,17 @@ static int imx_pcie_link_up(void)
>   imx_pcie_regions_setup();
>  
>   /*
> + * By default, the subordinate is set equally to the secondary
> + * bus (0x01) when the RC boots.
> + * This means that theoretically, only bus 1 is reachable from the RC.
> + * Force the PCIe RC subordinate to 0xff, otherwise no downstream
> + * devices will be detected if the enumeration is applied strictly.
> + */
> + tmp = readl(MX6_DBI_ADDR + 0x18);
> + tmp |= (0xff << 16);
> + writel(tmp, MX6_DBI_ADDR + 0x18);
> +
> + /*
>   * FIXME: Force the PCIe RC to Gen1 operation
>   * The RC must be forced into Gen1 mode before bringing the link
>   * up, otherwise no downstream devices are detected. After the
>

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

--
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [hidden email]
=====================================================================
_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot