1 From 201ddc05777cd8e084b508bcdda22214bfe2895e Mon Sep 17 00:00:00 2001
2 From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
3 Date: Mon, 19 Jun 2023 06:09:39 +0200
4 Subject: [PATCH 7/9] mips: ralink: remove reset related code
6 A proper clock driver for ralink SoCs has been added. This driver is also
7 a reset provider for the SoC. Hence there is no need to have reset related
8 code in 'arch/mips/ralink' folder anymore. The only code that remains is
9 the one related with mips_reboot_setup where a PCI reset is performed.
10 We maintain this because I cannot test old ralink board with PCI to be
11 sure all works if we remove also this code.
13 Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
14 Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
16 arch/mips/ralink/common.h | 2 --
17 arch/mips/ralink/of.c | 4 ----
18 arch/mips/ralink/reset.c | 61 -----------------------------------------------
19 3 files changed, 67 deletions(-)
21 --- a/arch/mips/ralink/common.h
22 +++ b/arch/mips/ralink/common.h
23 @@ -23,8 +23,6 @@ extern struct ralink_soc_info soc_info;
25 extern void ralink_of_remap(void);
27 -extern void ralink_rst_init(void);
29 extern void __init prom_soc_init(struct ralink_soc_info *soc_info);
31 __iomem void *plat_of_remap_node(const char *node);
32 --- a/arch/mips/ralink/of.c
33 +++ b/arch/mips/ralink/of.c
34 @@ -95,10 +95,6 @@ static int __init plat_of_setup(void)
36 __dt_register_buses(soc_info.compatible, "palmbus");
38 - /* make sure that the reset controller is setup early */
39 - if (ralink_soc != MT762X_SOC_MT7621AT)
45 --- a/arch/mips/ralink/reset.c
46 +++ b/arch/mips/ralink/reset.c
50 #include <linux/delay.h>
51 -#include <linux/reset-controller.h>
53 #include <asm/reboot.h>
56 #define RSTCTL_RESET_PCI BIT(26)
57 #define RSTCTL_RESET_SYSTEM BIT(0)
59 -static int ralink_assert_device(struct reset_controller_dev *rcdev,
67 - val = rt_sysc_r32(SYSC_REG_RESET_CTRL);
69 - rt_sysc_w32(val, SYSC_REG_RESET_CTRL);
74 -static int ralink_deassert_device(struct reset_controller_dev *rcdev,
82 - val = rt_sysc_r32(SYSC_REG_RESET_CTRL);
84 - rt_sysc_w32(val, SYSC_REG_RESET_CTRL);
89 -static int ralink_reset_device(struct reset_controller_dev *rcdev,
92 - ralink_assert_device(rcdev, id);
93 - return ralink_deassert_device(rcdev, id);
96 -static const struct reset_control_ops reset_ops = {
97 - .reset = ralink_reset_device,
98 - .assert = ralink_assert_device,
99 - .deassert = ralink_deassert_device,
102 -static struct reset_controller_dev reset_dev = {
104 - .owner = THIS_MODULE,
106 - .of_reset_n_cells = 1,
109 -void ralink_rst_init(void)
111 - reset_dev.of_node = of_find_compatible_node(NULL, NULL,
112 - "ralink,rt2880-reset");
113 - if (!reset_dev.of_node)
114 - pr_err("Failed to find reset controller node");
116 - reset_controller_register(&reset_dev);
119 static void ralink_restart(char *command)
121 if (IS_ENABLED(CONFIG_PCI)) {