Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Sergio Paracuellos and committed by
Thomas Bogendoerfer
201ddc05 04b153ab

-67
-2
arch/mips/ralink/common.h
··· 23 23 24 24 extern void ralink_of_remap(void); 25 25 26 - extern void ralink_rst_init(void); 27 - 28 26 extern void __init prom_soc_init(struct ralink_soc_info *soc_info); 29 27 30 28 __iomem void *plat_of_remap_node(const char *node);
-4
arch/mips/ralink/of.c
··· 81 81 { 82 82 __dt_register_buses(soc_info.compatible, "palmbus"); 83 83 84 - /* make sure that the reset controller is setup early */ 85 - if (ralink_soc != MT762X_SOC_MT7621AT) 86 - ralink_rst_init(); 87 - 88 84 return 0; 89 85 } 90 86
-61
arch/mips/ralink/reset.c
··· 10 10 #include <linux/io.h> 11 11 #include <linux/of.h> 12 12 #include <linux/delay.h> 13 - #include <linux/reset-controller.h> 14 13 15 14 #include <asm/reboot.h> 16 15 ··· 20 21 21 22 #define RSTCTL_RESET_PCI BIT(26) 22 23 #define RSTCTL_RESET_SYSTEM BIT(0) 23 - 24 - static int ralink_assert_device(struct reset_controller_dev *rcdev, 25 - unsigned long id) 26 - { 27 - u32 val; 28 - 29 - if (id == 0) 30 - return -1; 31 - 32 - val = rt_sysc_r32(SYSC_REG_RESET_CTRL); 33 - val |= BIT(id); 34 - rt_sysc_w32(val, SYSC_REG_RESET_CTRL); 35 - 36 - return 0; 37 - } 38 - 39 - static int ralink_deassert_device(struct reset_controller_dev *rcdev, 40 - unsigned long id) 41 - { 42 - u32 val; 43 - 44 - if (id == 0) 45 - return -1; 46 - 47 - val = rt_sysc_r32(SYSC_REG_RESET_CTRL); 48 - val &= ~BIT(id); 49 - rt_sysc_w32(val, SYSC_REG_RESET_CTRL); 50 - 51 - return 0; 52 - } 53 - 54 - static int ralink_reset_device(struct reset_controller_dev *rcdev, 55 - unsigned long id) 56 - { 57 - ralink_assert_device(rcdev, id); 58 - return ralink_deassert_device(rcdev, id); 59 - } 60 - 61 - static const struct reset_control_ops reset_ops = { 62 - .reset = ralink_reset_device, 63 - .assert = ralink_assert_device, 64 - .deassert = ralink_deassert_device, 65 - }; 66 - 67 - static struct reset_controller_dev reset_dev = { 68 - .ops = &reset_ops, 69 - .owner = THIS_MODULE, 70 - .nr_resets = 32, 71 - .of_reset_n_cells = 1, 72 - }; 73 - 74 - void ralink_rst_init(void) 75 - { 76 - reset_dev.of_node = of_find_compatible_node(NULL, NULL, 77 - "ralink,rt2880-reset"); 78 - if (!reset_dev.of_node) 79 - pr_err("Failed to find reset controller node"); 80 - else 81 - reset_controller_register(&reset_dev); 82 - } 83 24 84 25 static void ralink_restart(char *command) 85 26 {