005-v6.5-07-mips-ralink-remove-reset-related-code.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. From 201ddc05777cd8e084b508bcdda22214bfe2895e Mon Sep 17 00:00:00 2001
  2. From: Sergio Paracuellos <[email protected]>
  3. Date: Mon, 19 Jun 2023 06:09:39 +0200
  4. Subject: [PATCH 7/9] mips: ralink: remove reset related code
  5. A proper clock driver for ralink SoCs has been added. This driver is also
  6. a reset provider for the SoC. Hence there is no need to have reset related
  7. code in 'arch/mips/ralink' folder anymore. The only code that remains is
  8. the one related with mips_reboot_setup where a PCI reset is performed.
  9. We maintain this because I cannot test old ralink board with PCI to be
  10. sure all works if we remove also this code.
  11. Signed-off-by: Sergio Paracuellos <[email protected]>
  12. Signed-off-by: Thomas Bogendoerfer <[email protected]>
  13. ---
  14. arch/mips/ralink/common.h | 2 --
  15. arch/mips/ralink/of.c | 4 ----
  16. arch/mips/ralink/reset.c | 61 -----------------------------------------------
  17. 3 files changed, 67 deletions(-)
  18. --- a/arch/mips/ralink/common.h
  19. +++ b/arch/mips/ralink/common.h
  20. @@ -23,8 +23,6 @@ extern struct ralink_soc_info soc_info;
  21. extern void ralink_of_remap(void);
  22. -extern void ralink_rst_init(void);
  23. -
  24. extern void __init prom_soc_init(struct ralink_soc_info *soc_info);
  25. __iomem void *plat_of_remap_node(const char *node);
  26. --- a/arch/mips/ralink/of.c
  27. +++ b/arch/mips/ralink/of.c
  28. @@ -81,10 +81,6 @@ static int __init plat_of_setup(void)
  29. {
  30. __dt_register_buses(soc_info.compatible, "palmbus");
  31. - /* make sure that the reset controller is setup early */
  32. - if (ralink_soc != MT762X_SOC_MT7621AT)
  33. - ralink_rst_init();
  34. -
  35. return 0;
  36. }
  37. --- a/arch/mips/ralink/reset.c
  38. +++ b/arch/mips/ralink/reset.c
  39. @@ -10,7 +10,6 @@
  40. #include <linux/io.h>
  41. #include <linux/of.h>
  42. #include <linux/delay.h>
  43. -#include <linux/reset-controller.h>
  44. #include <asm/reboot.h>
  45. @@ -22,66 +21,6 @@
  46. #define RSTCTL_RESET_PCI BIT(26)
  47. #define RSTCTL_RESET_SYSTEM BIT(0)
  48. -static int ralink_assert_device(struct reset_controller_dev *rcdev,
  49. - unsigned long id)
  50. -{
  51. - u32 val;
  52. -
  53. - if (id == 0)
  54. - return -1;
  55. -
  56. - val = rt_sysc_r32(SYSC_REG_RESET_CTRL);
  57. - val |= BIT(id);
  58. - rt_sysc_w32(val, SYSC_REG_RESET_CTRL);
  59. -
  60. - return 0;
  61. -}
  62. -
  63. -static int ralink_deassert_device(struct reset_controller_dev *rcdev,
  64. - unsigned long id)
  65. -{
  66. - u32 val;
  67. -
  68. - if (id == 0)
  69. - return -1;
  70. -
  71. - val = rt_sysc_r32(SYSC_REG_RESET_CTRL);
  72. - val &= ~BIT(id);
  73. - rt_sysc_w32(val, SYSC_REG_RESET_CTRL);
  74. -
  75. - return 0;
  76. -}
  77. -
  78. -static int ralink_reset_device(struct reset_controller_dev *rcdev,
  79. - unsigned long id)
  80. -{
  81. - ralink_assert_device(rcdev, id);
  82. - return ralink_deassert_device(rcdev, id);
  83. -}
  84. -
  85. -static const struct reset_control_ops reset_ops = {
  86. - .reset = ralink_reset_device,
  87. - .assert = ralink_assert_device,
  88. - .deassert = ralink_deassert_device,
  89. -};
  90. -
  91. -static struct reset_controller_dev reset_dev = {
  92. - .ops = &reset_ops,
  93. - .owner = THIS_MODULE,
  94. - .nr_resets = 32,
  95. - .of_reset_n_cells = 1,
  96. -};
  97. -
  98. -void ralink_rst_init(void)
  99. -{
  100. - reset_dev.of_node = of_find_compatible_node(NULL, NULL,
  101. - "ralink,rt2880-reset");
  102. - if (!reset_dev.of_node)
  103. - pr_err("Failed to find reset controller node");
  104. - else
  105. - reset_controller_register(&reset_dev);
  106. -}
  107. -
  108. static void ralink_restart(char *command)
  109. {
  110. if (IS_ENABLED(CONFIG_PCI)) {