LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>,
	Wim Van Sebroeck <wim@iguana.be>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-watchdog@vger.kernel.org
Subject: Re: [PATCH v3 5/8] ARM: at91: move the restart function to the system timer driver
Date: Thu, 15 Jan 2015 17:39:05 +0100	[thread overview]
Message-ID: <54B7ED29.9060700@linaro.org> (raw)
In-Reply-To: <1421077023-30954-6-git-send-email-alexandre.belloni@free-electrons.com>

On 01/12/2015 04:37 PM, Alexandre Belloni wrote:
> Restarting on an at91rm9200 is handled by using the system timer. Move that
> function to the system timer driver.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
>   arch/arm/mach-at91/at91rm9200.c      | 11 -----------
>   drivers/clocksource/timer-atmel-st.c | 12 ++++++++++++
>   2 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
> index b52916947535..4ea889cd6091 100644
> --- a/arch/arm/mach-at91/at91rm9200.c
> +++ b/arch/arm/mach-at91/at91rm9200.c
> @@ -15,7 +15,6 @@
>
>   #include <asm/mach/map.h>
>   #include <asm/system_misc.h>
> -#include <mach/at91_st.h>
>   #include <mach/hardware.h>
>
>   #include "soc.h"
> @@ -30,15 +29,6 @@ static void at91rm9200_idle(void)
>   	at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK);
>   }
>
> -static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
> -{
> -	/*
> -	 * Perform a hardware reset with the use of the Watchdog timer.
> -	 */
> -	at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
> -	at91_st_write(AT91_ST_CR, AT91_ST_WDRST);
> -}
> -
>   /* --------------------------------------------------------------------
>    *  AT91RM9200 processor initialization
>    * -------------------------------------------------------------------- */
> @@ -51,7 +41,6 @@ static void __init at91rm9200_map_io(void)
>   static void __init at91rm9200_initialize(void)
>   {
>   	arm_pm_idle = at91rm9200_idle;
> -	arm_pm_restart = at91rm9200_restart;
>   }
>
>
> diff --git a/drivers/clocksource/timer-atmel-st.c b/drivers/clocksource/timer-atmel-st.c
> index 51761f8927b7..522583d6cc78 100644
> --- a/drivers/clocksource/timer-atmel-st.c
> +++ b/drivers/clocksource/timer-atmel-st.c
> @@ -29,6 +29,7 @@
>   #include <linux/of_irq.h>
>
>   #include <asm/mach/time.h>
> +#include <asm/system_misc.h>
>
>   #include <mach/at91_st.h>
>   #include <mach/hardware.h>
> @@ -180,6 +181,15 @@ static struct clock_event_device clkevt = {
>   	.set_mode	= clkevt32k_mode,
>   };
>
> +static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
> +{
> +	/*
> +	 * Perform a hardware reset with the use of the Watchdog timer.
> +	 */
> +	at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
> +	at91_st_write(AT91_ST_CR, AT91_ST_WDRST);
> +}
> +
>   void __iomem *at91_st_base;
>   EXPORT_SYMBOL_GPL(at91_st_base);
>
> @@ -248,4 +258,6 @@ void __init at91rm9200_timer_init(void)
>
>   	/* register clocksource */
>   	clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
> +
> +	arm_pm_restart = at91rm9200_restart;
>   }

Mmh, I can't clearly explain why but I have a problem with that.

Can you explain why restart code falls in the clockevents driver ?



-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


  reply	other threads:[~2015-01-15 16:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 15:36 [PATCH v3 0/8] Atmel System Timer cleanups Alexandre Belloni
2015-01-12 15:36 ` [PATCH v3 1/8] ARM: at91/dt: declare atmel,at91rm9200-st as a syscon Alexandre Belloni
2015-01-12 15:36 ` [PATCH v3 2/8] mfd: Add atmel-st driver Alexandre Belloni
2015-01-19  9:42   ` Lee Jones
2015-01-19 22:59     ` Alexandre Belloni
2015-01-20  9:47       ` Lee Jones
2015-01-20 15:05         ` Alexandre Belloni
2015-01-20 15:36           ` Lee Jones
2015-01-20 15:49           ` Nicolas Ferre
2015-01-20 16:45             ` Lee Jones
2015-01-12 15:36 ` [PATCH v3 3/8] watchdog: at91rm9200: use the regmap from mfd Alexandre Belloni
2015-01-12 17:28   ` Guenter Roeck
2015-01-12 15:36 ` [PATCH v3 4/8] ARM: at91: time: move the system timer driver to drivers/clocksource Alexandre Belloni
2015-01-15 16:17   ` Daniel Lezcano
2015-01-12 15:37 ` [PATCH v3 5/8] ARM: at91: move the restart function to the system timer driver Alexandre Belloni
2015-01-15 16:39   ` Daniel Lezcano [this message]
2015-01-15 17:01     ` Alexandre Belloni
2015-01-15 17:13       ` Alexandre Belloni
2015-01-12 15:37 ` [PATCH v3 6/8] clocksource: atmel-st: properly initialize driver Alexandre Belloni
2015-01-15 16:05   ` Daniel Lezcano
2015-01-12 15:37 ` [PATCH v3 7/8] clocksource: atmel-st: use syscon/regmap Alexandre Belloni
2015-01-15 16:40   ` Daniel Lezcano
2015-01-15 17:02     ` Alexandre Belloni
2015-01-12 15:37 ` [PATCH v3 8/8] ARM: at91: remove useless include Alexandre Belloni
2015-01-15 16:29   ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54B7ED29.9060700@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=sameo@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=wim@iguana.be \
    --subject='Re: [PATCH v3 5/8] ARM: at91: move the restart function to the system timer driver' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).