Skip to contentSkip to conversation

ARM: sunxi: Remove sun4i reboot code from mach directory

PATCH New Maxime Ripard 3 participants 5 messages Aug 29, 2014 – Sep 11, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: sunxi: Remove sun4i reboot code from mach directory

Now that the restart code has been merged in the watchdog driver, we don't need the restart code in the mach-sunxi directory anymore.

Remove it entirely.

---

Hi Arnd, Kevin, Olof,

I don't know if this can be considered 3.17 material, but if so, it would be great if you could merge it directly.

Thanks!
Maxime

 arch/arm/mach-sunxi/sunxi.c | 76 ---------------------------------------------
 1 file changed, 76 deletions(-)
arch/arm/mach-sunxi/sunxi.c +0 -76
index 42d4753683ce..d7598aeed803 100644
@@ -12,81 +12,9 @@
 
 #include <linux/clk-provider.h>
 #include <linux/clocksource.h>
-#include <linux/delay.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <linux/of_platform.h>
-#include <linux/io.h>
-#include <linux/reboot.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/system_misc.h>
-
-#define SUN4I_WATCHDOG_CTRL_REG		0x00
-#define SUN4I_WATCHDOG_CTRL_RESTART		BIT(0)
-#define SUN4I_WATCHDOG_MODE_REG		0x04
-#define SUN4I_WATCHDOG_MODE_ENABLE		BIT(0)
-#define SUN4I_WATCHDOG_MODE_RESET_ENABLE	BIT(1)
-
-#define SUN6I_WATCHDOG1_IRQ_REG		0x00
-#define SUN6I_WATCHDOG1_CTRL_REG	0x10
-#define SUN6I_WATCHDOG1_CTRL_RESTART		BIT(0)
-#define SUN6I_WATCHDOG1_CONFIG_REG	0x14
-#define SUN6I_WATCHDOG1_CONFIG_RESTART		BIT(0)
-#define SUN6I_WATCHDOG1_CONFIG_IRQ		BIT(1)
-#define SUN6I_WATCHDOG1_MODE_REG	0x18
-#define SUN6I_WATCHDOG1_MODE_ENABLE		BIT(0)
-
-static void __iomem *wdt_base;
-
-static void sun4i_restart(enum reboot_mode mode, const char *cmd)
-{
-	if (!wdt_base)
-		return;
-
-	/* Enable timer and set reset bit in the watchdog */
-	writel(SUN4I_WATCHDOG_MODE_ENABLE | SUN4I_WATCHDOG_MODE_RESET_ENABLE,
-	       wdt_base + SUN4I_WATCHDOG_MODE_REG);
-
-	/*
-	 * Restart the watchdog. The default (and lowest) interval
-	 * value for the watchdog is 0.5s.
-	 */
-	writel(SUN4I_WATCHDOG_CTRL_RESTART, wdt_base + SUN4I_WATCHDOG_CTRL_REG);
-
-	while (1) {
-		mdelay(5);
-		writel(SUN4I_WATCHDOG_MODE_ENABLE | SUN4I_WATCHDOG_MODE_RESET_ENABLE,
-		       wdt_base + SUN4I_WATCHDOG_MODE_REG);
-	}
-}
-
-static struct of_device_id sunxi_restart_ids[] = {
-	{ .compatible = "allwinner,sun4i-a10-wdt" },
-	{ /*sentinel*/ }
-};
-
-static void sunxi_setup_restart(void)
-{
-	struct device_node *np;
-
-	np = of_find_matching_node(NULL, sunxi_restart_ids);
-	if (WARN(!np, "unable to setup watchdog restart"))
-		return;
-
-	wdt_base = of_iomap(np, 0);
-	WARN(!wdt_base, "failed to map watchdog base address");
-}
-
-static void __init sunxi_dt_init(void)
-{
-	sunxi_setup_restart();
-
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
 
 static const char * const sunxi_board_dt_compat[] = {
 	"allwinner,sun4i-a10",
@@ -96,9 +24,7 @@ static const char * const sunxi_board_dt_compat[] = {
 };
 
 DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
-	.init_machine	= sunxi_dt_init,
 	.dt_compat	= sunxi_board_dt_compat,
-	.restart	= sun4i_restart,
 MACHINE_END
 
 static const char * const sun6i_board_dt_compat[] = {
@@ -126,9 +52,7 @@ static const char * const sun7i_board_dt_compat[] = {
 };
 
 DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
-	.init_machine	= sunxi_dt_init,
 	.dt_compat	= sun7i_board_dt_compat,
-	.restart	= sun4i_restart,
 MACHINE_END
 
 static const char * const sun8i_board_dt_compat[] = {
Signature · 1 line
2.0.2
#1 lore raw

PATCH 1/1 ARM: sunxi: Remove sun4i reboot code from mach directory

Quoted 5 lines · Maxime Ripard

Now that the restart code has been merged in the watchdog driver, we don't need the restart code in the mach-sunxi directory anymore.

Remove it entirely.

Quoted 7 lines

---

Hi Arnd, Kevin, Olof,

I don't know if this can be considered 3.17 material, but if so, it would be great if you could merge it directly.

I don't think it's v3.17 material at this point in the cycle because it's not a regression fix.

Please add it to your queue for v3.18.

Kevin

#2 lore raw

PATCH 1/1 ARM: sunxi: Remove sun4i reboot code from mach directory

Quoted 12 lines · Kevin Hilman
Quoted 10 lines · Maxime Ripard

Now that the restart code has been merged in the watchdog driver, we don't need the restart code in the mach-sunxi directory anymore.

Remove it entirely.

---

Hi Arnd, Kevin, Olof,

Quoted 7 lines
Quoted 2 lines

I don't know if this can be considered 3.17 material, but if so, it would be great if you could merge it directly.

I don't think it's v3.17 material at this point in the cycle because it's not a regression fix.

Please add it to your queue for v3.18.

I agree. I had actually put it into my apply-for-3.18 queue already, but it's better if this comes through the normal cleanups from Maxime, unless he has nothing else yet and prefers me to apply it to the next/cleanup branch now.

Arnd

#3 lore raw

PATCH 1/1 ARM: sunxi: Remove sun4i reboot code from mach directory

Hi,

Quoted 19 lines · Arnd Bergmann
Quoted 18 lines · Kevin Hilman
Quoted 5 lines · Maxime Ripard

Now that the restart code has been merged in the watchdog driver, we don't need the restart code in the mach-sunxi directory anymore.

Remove it entirely.

Quoted 7 lines

---

Hi Arnd, Kevin, Olof,

I don't know if this can be considered 3.17 material, but if so, it would be great if you could merge it directly.

I don't think it's v3.17 material at this point in the cycle because it's not a regression fix.

Quoted 6 lines
Quoted 1 line

Please add it to your queue for v3.18.

I agree. I had actually put it into my apply-for-3.18 queue already, but it's better if this comes through the normal cleanups from Maxime, unless he has nothing else yet and prefers me to apply it to the next/cleanup branch now.

If possible, yes. I have no other cleanups queued up so far.

Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140911/92b81b62/attachment.sig>
#4 lore raw

PATCH 1/1 ARM: sunxi: Remove sun4i reboot code from mach directory

Quoted 20 lines · On Thursday 11 September 2014 19:54:26 Maxime Ripard wrote:
Quoted 19 lines · Arnd Bergmann
Quoted 18 lines · Kevin Hilman
Quoted 5 lines · Maxime Ripard

Now that the restart code has been merged in the watchdog driver, we don't need the restart code in the mach-sunxi directory anymore.

Remove it entirely.

Quoted 7 lines

---

Hi Arnd, Kevin, Olof,

I don't know if this can be considered 3.17 material, but if so, it would be great if you could merge it directly.

I don't think it's v3.17 material at this point in the cycle because it's not a regression fix.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Please add it to your queue for v3.18.

I agree. I had actually put it into my apply-for-3.18 queue already, but it's better if this comes through the normal cleanups from Maxime, unless he has nothing else yet and prefers me to apply it to the next/cleanup branch now.

If possible, yes. I have no other cleanups queued up so far.

Ok, applied to next/cleanup now.

Arnd