Skip to content

Commit 201ddc0

Browse files
parakatsbogend
authored andcommitted
mips: ralink: remove reset related code
A proper clock driver for ralink SoCs has been added. This driver is also a reset provider for the SoC. Hence there is no need to have reset related code in 'arch/mips/ralink' folder anymore. The only code that remains is the one related with mips_reboot_setup where a PCI reset is performed. We maintain this because I cannot test old ralink board with PCI to be sure all works if we remove also this code. Signed-off-by: Sergio Paracuellos <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 04b153a commit 201ddc0

File tree

3 files changed

+0
-67
lines changed

3 files changed

+0
-67
lines changed

arch/mips/ralink/common.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ extern struct ralink_soc_info soc_info;
2323

2424
extern void ralink_of_remap(void);
2525

26-
extern void ralink_rst_init(void);
27-
2826
extern void __init prom_soc_init(struct ralink_soc_info *soc_info);
2927

3028
__iomem void *plat_of_remap_node(const char *node);

arch/mips/ralink/of.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ static int __init plat_of_setup(void)
8181
{
8282
__dt_register_buses(soc_info.compatible, "palmbus");
8383

84-
/* make sure that the reset controller is setup early */
85-
if (ralink_soc != MT762X_SOC_MT7621AT)
86-
ralink_rst_init();
87-
8884
return 0;
8985
}
9086

arch/mips/ralink/reset.c

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <linux/io.h>
1111
#include <linux/of.h>
1212
#include <linux/delay.h>
13-
#include <linux/reset-controller.h>
1413

1514
#include <asm/reboot.h>
1615

@@ -22,66 +21,6 @@
2221
#define RSTCTL_RESET_PCI BIT(26)
2322
#define RSTCTL_RESET_SYSTEM BIT(0)
2423

25-
static int ralink_assert_device(struct reset_controller_dev *rcdev,
26-
unsigned long id)
27-
{
28-
u32 val;
29-
30-
if (id == 0)
31-
return -1;
32-
33-
val = rt_sysc_r32(SYSC_REG_RESET_CTRL);
34-
val |= BIT(id);
35-
rt_sysc_w32(val, SYSC_REG_RESET_CTRL);
36-
37-
return 0;
38-
}
39-
40-
static int ralink_deassert_device(struct reset_controller_dev *rcdev,
41-
unsigned long id)
42-
{
43-
u32 val;
44-
45-
if (id == 0)
46-
return -1;
47-
48-
val = rt_sysc_r32(SYSC_REG_RESET_CTRL);
49-
val &= ~BIT(id);
50-
rt_sysc_w32(val, SYSC_REG_RESET_CTRL);
51-
52-
return 0;
53-
}
54-
55-
static int ralink_reset_device(struct reset_controller_dev *rcdev,
56-
unsigned long id)
57-
{
58-
ralink_assert_device(rcdev, id);
59-
return ralink_deassert_device(rcdev, id);
60-
}
61-
62-
static const struct reset_control_ops reset_ops = {
63-
.reset = ralink_reset_device,
64-
.assert = ralink_assert_device,
65-
.deassert = ralink_deassert_device,
66-
};
67-
68-
static struct reset_controller_dev reset_dev = {
69-
.ops = &reset_ops,
70-
.owner = THIS_MODULE,
71-
.nr_resets = 32,
72-
.of_reset_n_cells = 1,
73-
};
74-
75-
void ralink_rst_init(void)
76-
{
77-
reset_dev.of_node = of_find_compatible_node(NULL, NULL,
78-
"ralink,rt2880-reset");
79-
if (!reset_dev.of_node)
80-
pr_err("Failed to find reset controller node");
81-
else
82-
reset_controller_register(&reset_dev);
83-
}
84-
8524
static void ralink_restart(char *command)
8625
{
8726
if (IS_ENABLED(CONFIG_PCI)) {

0 commit comments

Comments
 (0)