8237-pcie-ls208x-use-unified-compatible-fsl-ls2080a-pcie-.patch 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. From 562f1311b529d81662ed41786b8d240db2e2ff51 Mon Sep 17 00:00:00 2001
  2. From: Shengzhou Liu <Shengzhou.Liu@nxp.com>
  3. Date: Tue, 6 Dec 2016 15:30:39 +0800
  4. Subject: [PATCH 237/238] pcie/ls208x: use unified compatible
  5. "fsl,ls2080a-pcie" for ls208x
  6. To avoid unnecessary reduplication, let's use unified compatible
  7. "fsl,ls2080a-pcie" for ls2080a, ls2085a, ls2088a.
  8. This patch fixes issue of pcie not working on ls2088a.
  9. Signed-off-by: Shengzhou Liu <Shengzhou.Liu@nxp.com>
  10. ---
  11. arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi | 12 ++++--------
  12. drivers/pci/host/pci-layerscape.c | 13 ++++++++-----
  13. 2 files changed, 12 insertions(+), 13 deletions(-)
  14. --- a/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
  15. +++ b/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
  16. @@ -513,8 +513,7 @@
  17. };
  18. pcie1: pcie@3400000 {
  19. - compatible = "fsl,ls2088a-pcie", "fsl,ls2080a-pcie",
  20. - "fsl,ls2085a-pcie", "snps,dw-pcie";
  21. + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
  22. reg = <0x00 0x03400000 0x0 0x00100000 /* controller registers */
  23. 0x20 0x00000000 0x0 0x00002000>; /* configuration space */
  24. reg-names = "regs", "config";
  25. @@ -539,8 +538,7 @@
  26. };
  27. pcie2: pcie@3500000 {
  28. - compatible = "fsl,ls2080a-pcie", "fsl,ls2080a-pcie",
  29. - "fsl,ls2085a-pcie", "snps,dw-pcie";
  30. + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
  31. reg = <0x00 0x03500000 0x0 0x00100000 /* controller registers */
  32. 0x28 0x00000000 0x0 0x00002000>; /* configuration space */
  33. reg-names = "regs", "config";
  34. @@ -565,8 +563,7 @@
  35. };
  36. pcie3: pcie@3600000 {
  37. - compatible = "fsl,ls2088a-pcie", "fsl,ls2080a-pcie",
  38. - "fsl,ls2085a-pcie", "snps,dw-pcie";
  39. + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
  40. reg = <0x00 0x03600000 0x0 0x00100000 /* controller registers */
  41. 0x30 0x00000000 0x0 0x00002000>; /* configuration space */
  42. reg-names = "regs", "config";
  43. @@ -591,8 +588,7 @@
  44. };
  45. pcie4: pcie@3700000 {
  46. - compatible = "fsl,ls2080a-pcie", "fsl,ls2080a-pcie",
  47. - "fsl,ls2085a-pcie", "snps,dw-pcie";
  48. + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
  49. reg = <0x00 0x03700000 0x0 0x00100000 /* controller registers */
  50. 0x38 0x00000000 0x0 0x00002000>; /* configuration space */
  51. reg-names = "regs", "config";
  52. --- a/drivers/pci/host/pci-layerscape.c
  53. +++ b/drivers/pci/host/pci-layerscape.c
  54. @@ -158,9 +158,14 @@ static void ls1021_pcie_host_init(struct
  55. static int ls_pcie_link_up(struct pcie_port *pp)
  56. {
  57. struct ls_pcie *pcie = to_ls_pcie(pp);
  58. - u32 state;
  59. + u32 state, offset;
  60. - state = (ioread32(pcie->lut + pcie->drvdata->lut_dbg) >>
  61. + if (of_get_property(pp->dev->of_node, "fsl,lut_diff", NULL))
  62. + offset = 0x407fc;
  63. + else
  64. + offset = pcie->drvdata->lut_dbg;
  65. +
  66. + state = (ioread32(pcie->lut + offset) >>
  67. pcie->drvdata->ltssm_shift) &
  68. LTSSM_STATE_MASK;
  69. @@ -261,7 +266,6 @@ static const struct of_device_id ls_pcie
  70. { .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata },
  71. { .compatible = "fsl,ls1088a-pcie", .data = &ls1088_drvdata },
  72. { .compatible = "fsl,ls2080a-pcie", .data = &ls2080_drvdata },
  73. - { .compatible = "fsl,ls2085a-pcie", .data = &ls2080_drvdata },
  74. { },
  75. };
  76. MODULE_DEVICE_TABLE(of, ls_pcie_of_match);
  77. @@ -315,8 +319,7 @@ static int __init ls_pcie_probe(struct p
  78. if (!ls_pcie_is_bridge(pcie))
  79. return -ENODEV;
  80. - if (of_device_is_compatible(pdev->dev.of_node, "fsl,ls2085a-pcie") ||
  81. - of_device_is_compatible(pdev->dev.of_node, "fsl,ls2080a-pcie") ||
  82. + if (of_device_is_compatible(pdev->dev.of_node, "fsl,ls2080a-pcie") ||
  83. of_device_is_compatible(pdev->dev.of_node, "fsl,ls1088a-pcie")) {
  84. int len;
  85. const u32 *prop;