2
0

180-Revert-bcma-init-serial-console-directly-from-ChipCo.patch 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
  2. Subject: [PATCH] Revert "bcma: init serial console directly from ChipCommon
  3. code"
  4. MIME-Version: 1.0
  5. Content-Type: text/plain; charset=UTF-8
  6. Content-Transfer-Encoding: 8bit
  7. This reverts commit 4c81acab3816 ("bcma: init serial console directly
  8. from ChipCommon code") as it broke IRQ assignment. Getting IRQ with
  9. bcma_core_irq helper on SoC requires MIPS core to be set. It happens
  10. *after* ChipCommon initialization so we can't do this so early.
  11. This fixes a user reported regression. It wasn't critical as serial was
  12. still somehow working but lack of IRQs was making in unreliable.
  13. Fixes: 4c81acab3816 ("bcma: init serial console directly from ChipCommon code")
  14. Reported-by: Felix Fietkau <nbd@nbd.name>
  15. Cc: stable@vger.kernel.org # 4.6+
  16. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  17. ---
  18. drivers/bcma/bcma_private.h | 3 +++
  19. drivers/bcma/driver_chipcommon.c | 11 +++--------
  20. drivers/bcma/driver_mips.c | 3 +++
  21. 3 files changed, 9 insertions(+), 8 deletions(-)
  22. --- a/drivers/bcma/bcma_private.h
  23. +++ b/drivers/bcma/bcma_private.h
  24. @@ -45,6 +45,9 @@ int bcma_sprom_get(struct bcma_bus *bus)
  25. void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
  26. void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
  27. void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
  28. +#ifdef CONFIG_BCMA_DRIVER_MIPS
  29. +void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
  30. +#endif /* CONFIG_BCMA_DRIVER_MIPS */
  31. /* driver_chipcommon_b.c */
  32. int bcma_core_chipcommon_b_init(struct bcma_drv_cc_b *ccb);
  33. --- a/drivers/bcma/driver_chipcommon.c
  34. +++ b/drivers/bcma/driver_chipcommon.c
  35. @@ -15,8 +15,6 @@
  36. #include <linux/platform_device.h>
  37. #include <linux/bcma/bcma.h>
  38. -static void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
  39. -
  40. static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
  41. u32 mask, u32 value)
  42. {
  43. @@ -186,9 +184,6 @@ void bcma_core_chipcommon_early_init(str
  44. if (cc->capabilities & BCMA_CC_CAP_PMU)
  45. bcma_pmu_early_init(cc);
  46. - if (IS_BUILTIN(CONFIG_BCM47XX) && bus->hosttype == BCMA_HOSTTYPE_SOC)
  47. - bcma_chipco_serial_init(cc);
  48. -
  49. if (bus->hosttype == BCMA_HOSTTYPE_SOC)
  50. bcma_core_chipcommon_flash_detect(cc);
  51. @@ -378,9 +373,9 @@ u32 bcma_chipco_gpio_pulldown(struct bcm
  52. return res;
  53. }
  54. -static void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
  55. +#ifdef CONFIG_BCMA_DRIVER_MIPS
  56. +void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
  57. {
  58. -#if IS_BUILTIN(CONFIG_BCM47XX)
  59. unsigned int irq;
  60. u32 baud_base;
  61. u32 i;
  62. @@ -422,5 +417,5 @@ static void bcma_chipco_serial_init(stru
  63. ports[i].baud_base = baud_base;
  64. ports[i].reg_shift = 0;
  65. }
  66. -#endif /* CONFIG_BCM47XX */
  67. }
  68. +#endif /* CONFIG_BCMA_DRIVER_MIPS */
  69. --- a/drivers/bcma/driver_mips.c
  70. +++ b/drivers/bcma/driver_mips.c
  71. @@ -278,9 +278,12 @@ static void bcma_core_mips_nvram_init(st
  72. void bcma_core_mips_early_init(struct bcma_drv_mips *mcore)
  73. {
  74. + struct bcma_bus *bus = mcore->core->bus;
  75. +
  76. if (mcore->early_setup_done)
  77. return;
  78. + bcma_chipco_serial_init(&bus->drv_cc);
  79. bcma_core_mips_nvram_init(mcore);
  80. mcore->early_setup_done = true;