342-MIPS-BCM63XX-split-PCIe-reset-signals.patch 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. From 4bdfacdeaf3c988c4f3256c88118893eac640b03 Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <jogo@openwrt.org>
  3. Date: Sun, 8 Dec 2013 14:17:50 +0100
  4. Subject: [PATCH 52/53] MIPS: BCM63XX: split PCIE reset signals
  5. ---
  6. arch/mips/bcm63xx/reset.c | 39 ++++++++++++++--------
  7. arch/mips/include/asm/mach-bcm63xx/bcm63xx_reset.h | 2 ++
  8. arch/mips/pci/pci-bcm63xx.c | 7 ++++
  9. 3 files changed, 34 insertions(+), 14 deletions(-)
  10. --- a/arch/mips/bcm63xx/reset.c
  11. +++ b/arch/mips/bcm63xx/reset.c
  12. @@ -28,7 +28,9 @@
  13. [BCM63XX_RESET_PCM] = BCM## __cpu ##_RESET_PCM, \
  14. [BCM63XX_RESET_MPI] = BCM## __cpu ##_RESET_MPI, \
  15. [BCM63XX_RESET_PCIE] = BCM## __cpu ##_RESET_PCIE, \
  16. - [BCM63XX_RESET_PCIE_EXT] = BCM## __cpu ##_RESET_PCIE_EXT,
  17. + [BCM63XX_RESET_PCIE_EXT] = BCM## __cpu ##_RESET_PCIE_EXT, \
  18. + [BCM63XX_RESET_PCIE_CORE] = BCM## __cpu ##_RESET_PCIE_CORE, \
  19. + [BCM63XX_RESET_PCIE_HARD] = BCM## __cpu ##_RESET_PCIE_HARD,
  20. #define BCM3368_RESET_SPI SOFTRESET_3368_SPI_MASK
  21. #define BCM3368_RESET_ENET SOFTRESET_3368_ENET_MASK
  22. @@ -42,6 +44,8 @@
  23. #define BCM3368_RESET_MPI SOFTRESET_3368_MPI_MASK
  24. #define BCM3368_RESET_PCIE 0
  25. #define BCM3368_RESET_PCIE_EXT 0
  26. +#define BCM3368_RESET_PCIE_CORE 0
  27. +#define BCM3368_RESET_PCIE_HARD 0
  28. #define BCM6318_RESET_SPI SOFTRESET_6318_SPI_MASK
  29. @@ -54,11 +58,10 @@
  30. #define BCM6318_RESET_ENETSW SOFTRESET_6318_ENETSW_MASK
  31. #define BCM6318_RESET_PCM 0
  32. #define BCM6318_RESET_MPI 0
  33. -#define BCM6318_RESET_PCIE \
  34. - (SOFTRESET_6318_PCIE_MASK | \
  35. - SOFTRESET_6318_PCIE_CORE_MASK | \
  36. - SOFTRESET_6318_PCIE_HARD_MASK)
  37. +#define BCM6318_RESET_PCIE SOFTRESET_6318_PCIE_MASK
  38. #define BCM6318_RESET_PCIE_EXT SOFTRESET_6318_PCIE_EXT_MASK
  39. +#define BCM6318_RESET_PCIE_CORE SOFTRESET_6318_PCIE_CORE_MASK
  40. +#define BCM6318_RESET_PCIE_HARD SOFTRESET_6318_PCIE_HARD_MASK
  41. #define BCM6328_RESET_SPI SOFTRESET_6328_SPI_MASK
  42. #define BCM6328_RESET_ENET 0
  43. @@ -70,11 +73,10 @@
  44. #define BCM6328_RESET_ENETSW SOFTRESET_6328_ENETSW_MASK
  45. #define BCM6328_RESET_PCM SOFTRESET_6328_PCM_MASK
  46. #define BCM6328_RESET_MPI 0
  47. -#define BCM6328_RESET_PCIE \
  48. - (SOFTRESET_6328_PCIE_MASK | \
  49. - SOFTRESET_6328_PCIE_CORE_MASK | \
  50. - SOFTRESET_6328_PCIE_HARD_MASK)
  51. +#define BCM6328_RESET_PCIE SOFTRESET_6328_PCIE_MASK
  52. #define BCM6328_RESET_PCIE_EXT SOFTRESET_6328_PCIE_EXT_MASK
  53. +#define BCM6328_RESET_PCIE_CORE SOFTRESET_6328_PCIE_CORE_MASK
  54. +#define BCM6328_RESET_PCIE_HARD SOFTRESET_6328_PCIE_HARD_MASK
  55. #define BCM6338_RESET_SPI SOFTRESET_6338_SPI_MASK
  56. #define BCM6338_RESET_ENET SOFTRESET_6338_ENET_MASK
  57. @@ -88,6 +90,8 @@
  58. #define BCM6338_RESET_MPI 0
  59. #define BCM6338_RESET_PCIE 0
  60. #define BCM6338_RESET_PCIE_EXT 0
  61. +#define BCM6338_RESET_PCIE_CORE 0
  62. +#define BCM6338_RESET_PCIE_HARD 0
  63. #define BCM6348_RESET_SPI SOFTRESET_6348_SPI_MASK
  64. #define BCM6348_RESET_ENET SOFTRESET_6348_ENET_MASK
  65. @@ -101,6 +105,8 @@
  66. #define BCM6348_RESET_MPI 0
  67. #define BCM6348_RESET_PCIE 0
  68. #define BCM6348_RESET_PCIE_EXT 0
  69. +#define BCM6348_RESET_PCIE_CORE 0
  70. +#define BCM6348_RESET_PCIE_HARD 0
  71. #define BCM6358_RESET_SPI SOFTRESET_6358_SPI_MASK
  72. #define BCM6358_RESET_ENET SOFTRESET_6358_ENET_MASK
  73. @@ -114,6 +120,8 @@
  74. #define BCM6358_RESET_MPI SOFTRESET_6358_MPI_MASK
  75. #define BCM6358_RESET_PCIE 0
  76. #define BCM6358_RESET_PCIE_EXT 0
  77. +#define BCM6358_RESET_PCIE_CORE 0
  78. +#define BCM6358_RESET_PCIE_HARD 0
  79. #define BCM6362_RESET_SPI SOFTRESET_6362_SPI_MASK
  80. #define BCM6362_RESET_ENET 0
  81. @@ -125,9 +133,10 @@
  82. #define BCM6362_RESET_ENETSW SOFTRESET_6362_ENETSW_MASK
  83. #define BCM6362_RESET_PCM SOFTRESET_6362_PCM_MASK
  84. #define BCM6362_RESET_MPI 0
  85. -#define BCM6362_RESET_PCIE (SOFTRESET_6362_PCIE_MASK | \
  86. - SOFTRESET_6362_PCIE_CORE_MASK)
  87. +#define BCM6362_RESET_PCIE SOFTRESET_6362_PCIE_MASK
  88. #define BCM6362_RESET_PCIE_EXT SOFTRESET_6362_PCIE_EXT_MASK
  89. +#define BCM6362_RESET_PCIE_CORE SOFTRESET_6362_PCIE_CORE_MASK
  90. +#define BCM6362_RESET_PCIE_HARD 0
  91. #define BCM6368_RESET_SPI SOFTRESET_6368_SPI_MASK
  92. #define BCM6368_RESET_ENET 0
  93. @@ -141,6 +150,8 @@
  94. #define BCM6368_RESET_MPI SOFTRESET_6368_MPI_MASK
  95. #define BCM6368_RESET_PCIE 0
  96. #define BCM6368_RESET_PCIE_EXT 0
  97. +#define BCM6368_RESET_PCIE_CORE 0
  98. +#define BCM6368_RESET_PCIE_HARD 0
  99. #define BCM63268_RESET_SPI SOFTRESET_63268_SPI_MASK
  100. #define BCM63268_RESET_ENET 0
  101. @@ -152,10 +163,10 @@
  102. #define BCM63268_RESET_ENETSW SOFTRESET_63268_ENETSW_MASK
  103. #define BCM63268_RESET_PCM SOFTRESET_63268_PCM_MASK
  104. #define BCM63268_RESET_MPI 0
  105. -#define BCM63268_RESET_PCIE (SOFTRESET_63268_PCIE_MASK | \
  106. - SOFTRESET_63268_PCIE_CORE_MASK | \
  107. - SOFTRESET_63268_PCIE_HARD_MASK)
  108. +#define BCM63268_RESET_PCIE SOFTRESET_63268_PCIE_MASK
  109. #define BCM63268_RESET_PCIE_EXT SOFTRESET_63268_PCIE_EXT_MASK
  110. +#define BCM63268_RESET_PCIE_CORE SOFTRESET_63268_PCIE_CORE_MASK
  111. +#define BCM63268_RESET_PCIE_HARD SOFTRESET_63268_PCIE_HARD_MASK
  112. /*
  113. * core reset bits
  114. --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_reset.h
  115. +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_reset.h
  116. @@ -14,6 +14,8 @@ enum bcm63xx_core_reset {
  117. BCM63XX_RESET_MPI,
  118. BCM63XX_RESET_PCIE,
  119. BCM63XX_RESET_PCIE_EXT,
  120. + BCM63XX_RESET_PCIE_CORE,
  121. + BCM63XX_RESET_PCIE_HARD,
  122. };
  123. void bcm63xx_core_set_reset(enum bcm63xx_core_reset, int reset);
  124. --- a/arch/mips/pci/pci-bcm63xx.c
  125. +++ b/arch/mips/pci/pci-bcm63xx.c
  126. @@ -135,9 +135,16 @@ static void __init bcm63xx_reset_pcie(vo
  127. /* reset the PCIe core */
  128. bcm63xx_core_set_reset(BCM63XX_RESET_PCIE, 1);
  129. + bcm63xx_core_set_reset(BCM63XX_RESET_PCIE_CORE, 1);
  130. bcm63xx_core_set_reset(BCM63XX_RESET_PCIE_EXT, 1);
  131. + if (BCMCPU_IS_6328() || BCMCPU_IS_63268()) {
  132. + bcm63xx_core_set_reset(BCM63XX_RESET_PCIE_HARD, 1);
  133. + mdelay(10);
  134. + bcm63xx_core_set_reset(BCM63XX_RESET_PCIE_HARD, 0);
  135. + }
  136. mdelay(10);
  137. + bcm63xx_core_set_reset(BCM63XX_RESET_PCIE_CORE, 0);
  138. bcm63xx_core_set_reset(BCM63XX_RESET_PCIE, 0);
  139. mdelay(10);