* [PATCH 2/4] rtc: OMAP: Add system pm_power_off to rtc driver
From: Mark Brown @ 2012-11-14 5:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <331ABD5ECB02734CA317220B2BBEABC13EA6AE51@DBDE01.ent.ti.com>
On Wed, Nov 14, 2012 at 05:01:45AM +0000, AnilKumar, Chimata wrote:
> +Mark
...without any words as to why I'm being added or what the content in
the message is?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121114/770b6120/attachment.sig>
^ permalink raw reply
* [PATCH v2 5/5] ARM: Exynos4: Migrate clock support to common clock framework
From: Kukjin Kim @ 2012-11-14 5:25 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349629855-4962-6-git-send-email-thomas.abraham@linaro.org>
Thomas Abraham wrote:
>
> Remove Samsung specific clock support in Exynos4 and migrate to using
> common clock framework.
>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
> arch/arm/mach-exynos/Kconfig | 1 +
> arch/arm/mach-exynos/Makefile | 3 -
> arch/arm/mach-exynos/clock-exynos4.c | 1603
-------------------------
> ---
> arch/arm/mach-exynos/clock-exynos4.h | 35 -
> arch/arm/mach-exynos/clock-exynos4210.c | 188 ----
> arch/arm/mach-exynos/clock-exynos4212.c | 192 ----
> arch/arm/mach-exynos/common.c | 22 +-
> arch/arm/mach-exynos/common.h | 3 +
> arch/arm/mach-exynos/mach-armlex4210.c | 1 -
> arch/arm/mach-exynos/mach-exynos4-dt.c | 1 -
> arch/arm/mach-exynos/mach-nuri.c | 1 -
> arch/arm/mach-exynos/mach-origen.c | 1 -
> arch/arm/mach-exynos/mach-smdk4x12.c | 1 -
> arch/arm/mach-exynos/mach-smdkv310.c | 1 -
> arch/arm/mach-exynos/mach-universal_c210.c | 1 -
> arch/arm/mach-exynos/mct.c | 11 +-
> arch/arm/plat-samsung/Kconfig | 4 +-
> 17 files changed, 18 insertions(+), 2051 deletions(-)
> delete mode 100644 arch/arm/mach-exynos/clock-exynos4.c
> delete mode 100644 arch/arm/mach-exynos/clock-exynos4.h
> delete mode 100644 arch/arm/mach-exynos/clock-exynos4210.c
> delete mode 100644 arch/arm/mach-exynos/clock-exynos4212.c
I think, would be better to us if we could keep this clock stuff with common
clock for a moment, e.g. 3.8. In addition, the clock stuff is still updating
at this moment so we need some time to move on common clock framework
entirely. Of course, I have no objection to support common clock on new SoC
such as exynos5440 :-)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply
* [PATCH v2 5/5] ARM: Exynos4: Migrate clock support to common clock framework
From: Kukjin Kim @ 2012-11-14 5:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349629855-4962-6-git-send-email-thomas.abraham@linaro.org>
Kukjin Kim wrote:
> Thomas Abraham wrote:
> >
> > Remove Samsung specific clock support in Exynos4 and migrate to using
> > common clock framework.
> >
> > Cc: Kukjin Kim <kgene.kim@samsung.com>
> > Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> > ---
> > arch/arm/mach-exynos/Kconfig | 1 +
> > arch/arm/mach-exynos/Makefile | 3 -
> > arch/arm/mach-exynos/clock-exynos4.c | 1603
-----------------------
> --
> > ---
> > arch/arm/mach-exynos/clock-exynos4.h | 35 -
> > arch/arm/mach-exynos/clock-exynos4210.c | 188 ----
> > arch/arm/mach-exynos/clock-exynos4212.c | 192 ----
> > arch/arm/mach-exynos/common.c | 22 +-
> > arch/arm/mach-exynos/common.h | 3 +
> > arch/arm/mach-exynos/mach-armlex4210.c | 1 -
> > arch/arm/mach-exynos/mach-exynos4-dt.c | 1 -
> > arch/arm/mach-exynos/mach-nuri.c | 1 -
> > arch/arm/mach-exynos/mach-origen.c | 1 -
> > arch/arm/mach-exynos/mach-smdk4x12.c | 1 -
> > arch/arm/mach-exynos/mach-smdkv310.c | 1 -
> > arch/arm/mach-exynos/mach-universal_c210.c | 1 -
> > arch/arm/mach-exynos/mct.c | 11 +-
> > arch/arm/plat-samsung/Kconfig | 4 +-
> > 17 files changed, 18 insertions(+), 2051 deletions(-) delete mode
> > 100644 arch/arm/mach-exynos/clock-exynos4.c
> > delete mode 100644 arch/arm/mach-exynos/clock-exynos4.h
> > delete mode 100644 arch/arm/mach-exynos/clock-exynos4210.c
> > delete mode 100644 arch/arm/mach-exynos/clock-exynos4212.c
>
> I think, would be better to us if we could keep this clock stuff with
> common clock for a moment, e.g. 3.8. In addition, the clock stuff is still
> updating at this moment so we need some time to move on common clock
> framework entirely. Of course, I have no objection to support common clock
> on new SoC such as exynos5440 :-)
>
Oops, I'm resending because of e-mail client problem.
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer, SW Solution
> Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply
* [PATCH 2/4] rtc: OMAP: Add system pm_power_off to rtc driver
From: AnilKumar, Chimata @ 2012-11-14 5:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50994156.4080305@ti.com>
On Wed, Nov 14, 2012 at 10:31:42, AnilKumar, Chimata wrote:
> +Mark
>
> On Mon, Nov 12, 2012 at 15:17:13, AnilKumar, Chimata wrote:
> > On Tue, Nov 06, 2012 at 22:26:54, Cousson, Benoit wrote:
> > > Hi Anil,
> > >
> > > On 11/06/2012 06:07 AM, AnilKumar, Chimata wrote:
> > > > On Mon, Nov 05, 2012 at 22:13:25, Cousson, Benoit wrote:
> > > >> Hi Anil / Colin,
> > > >>
> > > >> On 11/05/2012 10:42 AM, AnilKumar Ch wrote:
> > > >>> From: Colin Foe-Parker <colin.foeparker@logicpd.com>
> > > >>>
> > > >>> Add system power off control to rtc driver which is the in-charge
> > > >>> of controlling the BeagleBone system power. The power_off routine
> > > >>> can be hooked up to "pm_power_off" system call.
> > > >>>
> > > >>> System power off sequence:-
> > > >>> * Set PMIC STATUS_OFF when PMIC_POWER_EN is pulled low
> > > >>> * Enable PMIC_POWER_EN in rtc module
> > > >>> * Set rtc ALARM2 time
> > > >>> * Enable ALARM2 interrupt
> > > >>>
> > > >>> Added while (1); after the above steps to make sure that no other
> > > >>> process acquire cpu. Otherwise we might see an unexpected behaviour
> > > >>> because we are shutting down all the power rails of SoC except RTC.
> > > >>>
> > > >>> Signed-off-by: Colin Foe-Parker <colin.foeparker@logicpd.com>
> > > >>> [anilkumar at ti.com: move poweroff additions to rtc driver]
> > > >>> Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
> > > >>> ---
> > > >>> Documentation/devicetree/bindings/rtc/rtc-omap.txt | 5 ++
> > > >>> drivers/rtc/rtc-omap.c | 79 +++++++++++++++++++-
> > > >>> 2 files changed, 83 insertions(+), 1 deletion(-)
> > > >>>
> > > >>> diff --git a/Documentation/devicetree/bindings/rtc/rtc-omap.txt b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
> > > >>> index b47aa41..8d9f4f9 100644
> > > >>> --- a/Documentation/devicetree/bindings/rtc/rtc-omap.txt
> > > >>> +++ b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
> > > >>> @@ -6,6 +6,10 @@ Required properties:
> > > >>> - interrupts: rtc timer, alarm interrupts in order
> > > >>> - interrupt-parent: phandle for the interrupt controller
> > > >>>
> > > >>> +Optional properties:
> > > >>> +- ti,system-power-controller: Telling whether or not rtc is controlling
> > > >>> + the system power.
> > > >>
> > > >> I don't know how it is connected at board level, but I'm not sure the
> > > >> binding is the proper one.
> > > >
> > > > Hi Benoit,
> > > > ________________________________
> > > > | ______ _______ |
> > > > | | | | | |
> > > > | |RTC | | | |
> > > > | |PMIC | Line | | |
> > > > | |PWR_EN|=======>|PWR_EN | |
> > > > | |______| |_______| |
> > > > | AM335x SoC TPS65217 |
> > > > | |
> > > > |________________________________|
> > > > BeagleBone
> > > >
> > > > This is how RTC PMIC_PWR_EN is connected to PWR_EN of TPS65217 PMIC. Only when
> > > > RTC pull low in PMIC_PWR_EN then PMIC will go to power off state provided TPS65217
> > > > status should be changed to STATUS_OFF.
> > > >
> > > > ALARM2 event should be trigger to configure PMIC_PWR_EN properly then the "Line"
> > > > driven low so that PMIC will go to shutdown mode.
Mark,
Details regarding how PMIC PWR_EN is connected to RTC module
Thanks
AnilKumar
> > >
> > > Thanks for the nice diagram :-)
> >
> > I missed this mail thread so delayed in response
> >
> > >
> > > I'm wondering if we cannot abuse the gpio binding to describe that
> > > connection instead of creating two custom attributes (PMIC + RTC).
> > >
> > > Ideally we should do that without having to change the RTC to use the
> > > gpiolib at all.
> > >
> > >
> > > rtc: rtc at 44e3e000 {
> > > compatible = "ti,da830-rtc";
> > > reg = <0x44e3e000 0x1000>;
> > > interrupts = <75, 76>;
> > > ti,hwmods = "rtc";
> > >
> > > /* expose the PWR_EN functionality of this RTC*/
> > > gpio-controller;
> > > #gpio-cells = <0>; /* assuming we can use 0 ??? */
> > > };
> > >
> > > ...
> > >
> > > tps: tps at 24 {
> > > compatible = "ti,tps65217";
> > > /*
> > > * Enable the power enable feature from
> > > * the input line if that attribute is there.
> > > */
> > > gpio-power-en = <&rtc>; /* PWR_EN */
> > >
> > > ...
> > > }
> > >
> > > Any thought?
> >
> > No, these two are independent controllers. PMIC can go to power
> > off mode if we pull PWR_EN to low. We can pull down that line
> > by any means like PRCM or GPIO or some other. So these two flags
> > should be independent from each other.
> >
> > Thanks
> > AnilKumar
> >
>
>
^ permalink raw reply
* [PATCH 2/4] rtc: OMAP: Add system pm_power_off to rtc driver
From: Mark Brown @ 2012-11-14 6:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <331ABD5ECB02734CA317220B2BBEABC13EA6AFB4@DBDE01.ent.ti.com>
On Wed, Nov 14, 2012 at 05:50:46AM +0000, AnilKumar, Chimata wrote:
> On Wed, Nov 14, 2012 at 10:31:42, AnilKumar, Chimata wrote:
*Please* cut out irrelevant context from your mails.
> Details regarding how PMIC PWR_EN is connected to RTC module
OK... but what am I expected to do with this information?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121114/8a755791/attachment.sig>
^ permalink raw reply
* [PATCH 01/17] of: add dma-mask binding
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-11-14 6:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50A3164C.3070301@gmail.com>
On 21:55 Tue 13 Nov , Rob Herring wrote:
> On 11/12/2012 02:52 AM, Wenyou Yang wrote:
> > From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> >
> > This will allow each device to specify its dma-mask for this we use the
> > coherent_dma_mask as pointer. By default the dma-mask will be set to
> > DMA_BIT_MASK(32).
>
> Do you really have a use case this is not DMA_BIT_MASK(32)?
yes as exmample on 64bit platfrom it will be 64 on x86 it's also 24, on power
pc 40
>
> > The microblaze architecture hook is drop
> >
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > Cc: grant.likely at secretlab.ca
> > Cc: rob.herring at calxeda.com
> > Cc: devicetree-discuss at lists.ozlabs.org
> > ---
> > drivers/of/platform.c | 23 ++++++++++++++++-------
> > 1 file changed, 16 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> > index b80891b..31ed405 100644
> > --- a/drivers/of/platform.c
> > +++ b/drivers/of/platform.c
> > @@ -130,6 +130,21 @@ void of_device_make_bus_id(struct device *dev)
> > dev_set_name(dev, "%s.%d", node->name, magic - 1);
> > }
> >
> > +static void of_get_dma_mask(struct device *dev, struct device_node *np)
> > +{
> > + const __be32 *prop;
> > + int len;
> > +
> > + prop = of_get_property(np, "dma-mask", &len);
>
> dma-ranges may work for this purpose.
>
> > +
> > + dev->dma_mask = &dev->coherent_dma_mask;
>
> I don't really know, but I suspect this is wrong.
no this is correct was suggest by Russell
we already do so on other ARM or SH as example
the dma expect a pointer for dma_mask but the value is the same as coherent
>
> > +
> > + if (!prop)
> > + dev->coherent_dma_mask = DMA_BIT_MASK(32);
> > + else
> > + dev->coherent_dma_mask = of_read_number(prop, len / 4);
> > +}
> > +
> > /**
> > * of_device_alloc - Allocate and initialize an of_device
> > * @np: device node to assign to device
> > @@ -171,10 +186,8 @@ struct platform_device *of_device_alloc(struct device_node *np,
> > WARN_ON(of_irq_to_resource_table(np, res, num_irq) != num_irq);
> > }
> >
> > + of_get_dma_mask(&dev->dev, np);
> > dev->dev.of_node = of_node_get(np);
> > -#if defined(CONFIG_MICROBLAZE)
> > - dev->dev.dma_mask = &dev->archdata.dma_mask;
> > -#endif
> > dev->dev.parent = parent;
> >
> > if (bus_id)
> > @@ -211,10 +224,6 @@ struct platform_device *of_platform_device_create_pdata(
> > if (!dev)
> > return NULL;
> >
> > -#if defined(CONFIG_MICROBLAZE)
> > - dev->archdata.dma_mask = 0xffffffffUL;
> > -#endif
> > - dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> > dev->dev.bus = &platform_bus_type;
> > dev->dev.platform_data = platform_data;
> >
> >
^ permalink raw reply
* [PATCH v2] i2c: at91: fix SMBus quick command
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-11-14 6:01 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352821401-1944-1-git-send-email-ludovic.desroches@atmel.com>
On 16:43 Tue 13 Nov , ludovic.desroches at atmel.com wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> The driver claims to support SMBus quick command but it was not the case.
> This patch fixes this issue.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Best Regards
J.
^ permalink raw reply
* [PATCH 1/4] mfd: tps65217: Set PMIC to shutdowm on PWR_EN toggle
From: AnilKumar, Chimata @ 2012-11-14 6:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121114022341.GM4415@opensource.wolfsonmicro.com>
On Wed, Nov 14, 2012 at 10:40:18, AnilKumar, Chimata wrote:
> On Wed, Nov 14, 2012 at 07:53:42, Mark Brown wrote:
> > On Mon, Nov 05, 2012 at 05:59:36PM +0100, Benoit Cousson wrote:
> > > On 11/05/2012 10:42 AM, AnilKumar Ch wrote:
> >
> > > > +Optional properties:
> > > > +- ti,pmic-shutdown-controller: Telling the PMIC to shutdown on PWR_EN toggle.
> >
> > > That sounds like a generic functionality to me. Don't we have some more
> > > generic way to handle that?
> >
> > > If not, that should probably not be a TI only attribute.
> >
> > It's pretty unusual to have this configurable as a single thing rather
> > than as part of flexible power sequencing or something that's just fixed
> > in silicon.
> >
Mark,
>From these two threads we can infer that this is handled in power_off
sequence only. And this is feature of PMIC to go to shutdown mode nothing
to be fixed in silicon. PWR_EN line can be connected to any of these like
PRCM control or GPIO or some other instead of RTC(in this case).
Thanks
AnilKumar
>
> "[PATCH 2/4] rtc: OMAP: Add system pm_power_off to rtc driver" thread
> have the details of how PMIC is connected to RTC module of SoC.
>
> As part of the power_off sequence we have
> 1. To write STATUS_OFF in TPS65217 PMIC. If we do so then PMIC will
> go to shutdown if PWR_EN is pulled-down. (This patch doing this)
> 2. To pull down the PWR_EN signal we have to set PMIC_PWR_EN in RTC
> module and trigger ALARM2 event. (This piece of code in 2/4 patch).
>
> Thanks
> AnilKumar
>
^ permalink raw reply
* [PATCH 1/4] mfd: tps65217: Set PMIC to shutdowm on PWR_EN toggle
From: Mark Brown @ 2012-11-14 6:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <331ABD5ECB02734CA317220B2BBEABC13EA6B043@DBDE01.ent.ti.com>
On Wed, Nov 14, 2012 at 06:11:45AM +0000, AnilKumar, Chimata wrote:
> From these two threads we can infer that this is handled in power_off
> sequence only. And this is feature of PMIC to go to shutdown mode nothing
> to be fixed in silicon. PWR_EN line can be connected to any of these like
> PRCM control or GPIO or some other instead of RTC(in this case).
OK, but why are you telling me this? What are you looking for me to do
with this information?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121114/3d0017b1/attachment-0001.sig>
^ permalink raw reply
* [PATCH v5 1/3] ARM: at91: atmel-ssc: add pinctrl support
From: Bo Shen @ 2012-11-14 6:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121113085052.GR18224@opensource.wolfsonmicro.com>
Hi Mark,
On 11/13/2012 16:50, Mark Brown wrote:
> On Mon, Nov 12, 2012 at 03:40:25PM +0800, Bo Shen wrote:
>
>> + ssc0 {
>> + pinctrl_ssc0_tx: ssc0_tx-0 {
>> + atmel,pins =
>> + <1 16 0x1 0x1 /* PB16 periph A with pull up */
>> + 1 17 0x1 0x1 /* PB17 periph A with pull up */
>> + 1 18 0x1 0x1>; /* PB18 periph A with pull up */
>> + };
>
> Do we really want the pull ups here? Normally CMOS devices don't have
> pulls, or the pulls are disabled during normal operation, as otherwise
> when the logic level is different to whatever the pull is doing power is
> wasted driving against the resistor.
After checking with internal, it does not need pull up. I will correct
this in next version.
Thanks.
Best Regards,
Bo Shen
^ permalink raw reply
* [PATCH 1/4] mfd: tps65217: Set PMIC to shutdowm on PWR_EN toggle
From: AnilKumar, Chimata @ 2012-11-14 6:49 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121114062117.GC7407@opensource.wolfsonmicro.com>
On Wed, Nov 14, 2012 at 11:51:19, Mark Brown wrote:
> On Wed, Nov 14, 2012 at 06:11:45AM +0000, AnilKumar, Chimata wrote:
>
> > From these two threads we can infer that this is handled in power_off
> > sequence only. And this is feature of PMIC to go to shutdown mode nothing
> > to be fixed in silicon. PWR_EN line can be connected to any of these like
> > PRCM control or GPIO or some other instead of RTC(in this case).
>
> OK, but why are you telling me this? What are you looking for me to do
> with this information?
>
Mark,
Earlier you have a comment on this thread, I am adding my comments
on top of it. Sorry if I am in wrong direction.
Thanks
AnilKumar
^ permalink raw reply
* [PATCH 1/4] mfd: tps65217: Set PMIC to shutdowm on PWR_EN toggle
From: Mark Brown @ 2012-11-14 7:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <331ABD5ECB02734CA317220B2BBEABC13EA6B0AF@DBDE01.ent.ti.com>
On Wed, Nov 14, 2012 at 06:49:58AM +0000, AnilKumar, Chimata wrote:
> Earlier you have a comment on this thread, I am adding my comments
> on top of it. Sorry if I am in wrong direction.
Ah, I see. I was just commenting because Benoit was asking if this
should be supported with a standard framework feature - I'm not
convinced that it should right now as there's not any clear patterns in
hardware behaviour. I've no specific interest in this system.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121114/82583125/attachment.sig>
^ permalink raw reply
* [PATCH 00/11] watchdog/at91sam9_wdt: use watchdog framework, support DT
From: Wenyou Yang @ 2012-11-14 7:15 UTC (permalink / raw)
To: linux-arm-kernel
Hi, All
The patch series is intended to convert to use the watchdog framework,
and add support to device tree.
It has been tested on sam9m10g45ek, sam9g20ek, sam9263ek and sam9g25ek.
It is based on v3.7-rc5.
Best Regards
Wenyou Yang
Wenyou Yang (11):
watchdog/at91sam9_wdt: remove the file_operations struct
watchdog/at91sam9_wdt: change the at91wdt_private struct to the
at91wdt_drvdata struct
watchdog/at91sam9_wdt: change the wdt_read and wdt_write macro to the
inline function
watchdog/at91sam9_wdt: change "at91_wdt_settimeout" function name to
"at91wdt_enable"
watchdog/at91sam9_wdt: add to use the watchdog framework
watchdog/at91sam9_wdt: change the timer function name
watchdog/at91sam9_wdt: add nowayout helpers to Watchdog Timer Driver
Kernel API
watchdog/at91sam9_wdt: use module_platform_driver()
watchdog/at91sam9_wdt: add support to device tree
watchdog/at91sam9_wdt: using dev_info replaces pr_info, dev_crit
repalces pr_crit
ARM: dts: add the watchdog nodes for atmel SoC
.../devicetree/bindings/watchdog/atmel-wdt.txt | 14 +
arch/arm/boot/dts/at91sam9260.dtsi | 6 +
arch/arm/boot/dts/at91sam9263.dtsi | 6 +
arch/arm/boot/dts/at91sam9263ek.dts | 4 +
arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 4 +
arch/arm/boot/dts/at91sam9g25ek.dts | 4 +
arch/arm/boot/dts/at91sam9g45.dtsi | 5 +
arch/arm/boot/dts/at91sam9m10g45ek.dts | 4 +
arch/arm/boot/dts/at91sam9n12.dtsi | 6 +
arch/arm/boot/dts/at91sam9n12ek.dts | 4 +
arch/arm/boot/dts/at91sam9x5.dtsi | 6 +
drivers/watchdog/Kconfig | 1 +
drivers/watchdog/at91sam9_wdt.c | 294 ++++++++------------
13 files changed, 185 insertions(+), 173 deletions(-)
create mode 100644 Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
--
1.7.9.5
^ permalink raw reply
* [PATCH 01/11] watchdog/at91sam9_wdt: remove the file_operations struct
From: Wenyou Yang @ 2012-11-14 7:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352877369-19740-1-git-send-email-wenyou.yang@atmel.com>
Remove the file_operations struct and miscdevice struct for future
add to use the watchdog framework.
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
drivers/watchdog/at91sam9_wdt.c | 131 ---------------------------------------
1 file changed, 131 deletions(-)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index 05e1be8..549c256 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -18,11 +18,9 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/errno.h>
-#include <linux/fs.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
-#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/platform_device.h>
@@ -31,7 +29,6 @@
#include <linux/jiffies.h>
#include <linux/timer.h>
#include <linux/bitops.h>
-#include <linux/uaccess.h>
#include "at91sam9_wdt.h"
@@ -102,35 +99,6 @@ static void at91_ping(unsigned long data)
}
/*
- * Watchdog device is opened, and watchdog starts running.
- */
-static int at91_wdt_open(struct inode *inode, struct file *file)
-{
- if (test_and_set_bit(0, &at91wdt_private.open))
- return -EBUSY;
-
- at91wdt_private.next_heartbeat = jiffies + heartbeat * HZ;
- mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT);
-
- return nonseekable_open(inode, file);
-}
-
-/*
- * Close the watchdog device.
- */
-static int at91_wdt_close(struct inode *inode, struct file *file)
-{
- clear_bit(0, &at91wdt_private.open);
-
- /* stop internal ping */
- if (!at91wdt_private.expect_close)
- del_timer(&at91wdt_private.timer);
-
- at91wdt_private.expect_close = 0;
- return 0;
-}
-
-/*
* Set the watchdog time interval in 1/256Hz (write-once)
* Counter is 12 bit.
*/
@@ -168,101 +136,11 @@ static const struct watchdog_info at91_wdt_info = {
WDIOF_MAGICCLOSE,
};
-/*
- * Handle commands from user-space.
- */
-static long at91_wdt_ioctl(struct file *file,
- unsigned int cmd, unsigned long arg)
-{
- void __user *argp = (void __user *)arg;
- int __user *p = argp;
- int new_value;
-
- switch (cmd) {
- case WDIOC_GETSUPPORT:
- return copy_to_user(argp, &at91_wdt_info,
- sizeof(at91_wdt_info)) ? -EFAULT : 0;
-
- case WDIOC_GETSTATUS:
- case WDIOC_GETBOOTSTATUS:
- return put_user(0, p);
-
- case WDIOC_KEEPALIVE:
- at91wdt_private.next_heartbeat = jiffies + heartbeat * HZ;
- return 0;
-
- case WDIOC_SETTIMEOUT:
- if (get_user(new_value, p))
- return -EFAULT;
-
- heartbeat = new_value;
- at91wdt_private.next_heartbeat = jiffies + heartbeat * HZ;
-
- return put_user(new_value, p); /* return current value */
-
- case WDIOC_GETTIMEOUT:
- return put_user(heartbeat, p);
- }
- return -ENOTTY;
-}
-
-/*
- * Pat the watchdog whenever device is written to.
- */
-static ssize_t at91_wdt_write(struct file *file, const char *data, size_t len,
- loff_t *ppos)
-{
- if (!len)
- return 0;
-
- /* Scan for magic character */
- if (!nowayout) {
- size_t i;
-
- at91wdt_private.expect_close = 0;
-
- for (i = 0; i < len; i++) {
- char c;
- if (get_user(c, data + i))
- return -EFAULT;
- if (c == 'V') {
- at91wdt_private.expect_close = 42;
- break;
- }
- }
- }
-
- at91wdt_private.next_heartbeat = jiffies + heartbeat * HZ;
-
- return len;
-}
-
-/* ......................................................................... */
-
-static const struct file_operations at91wdt_fops = {
- .owner = THIS_MODULE,
- .llseek = no_llseek,
- .unlocked_ioctl = at91_wdt_ioctl,
- .open = at91_wdt_open,
- .release = at91_wdt_close,
- .write = at91_wdt_write,
-};
-
-static struct miscdevice at91wdt_miscdev = {
- .minor = WATCHDOG_MINOR,
- .name = "watchdog",
- .fops = &at91wdt_fops,
-};
-
static int __init at91wdt_probe(struct platform_device *pdev)
{
struct resource *r;
int res;
- if (at91wdt_miscdev.parent)
- return -EBUSY;
- at91wdt_miscdev.parent = &pdev->dev;
-
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r)
return -ENODEV;
@@ -277,10 +155,6 @@ static int __init at91wdt_probe(struct platform_device *pdev)
if (res)
return res;
- res = misc_register(&at91wdt_miscdev);
- if (res)
- return res;
-
at91wdt_private.next_heartbeat = jiffies + heartbeat * HZ;
setup_timer(&at91wdt_private.timer, at91_ping, 0);
mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT);
@@ -295,10 +169,6 @@ static int __exit at91wdt_remove(struct platform_device *pdev)
{
int res;
- res = misc_deregister(&at91wdt_miscdev);
- if (!res)
- at91wdt_miscdev.parent = NULL;
-
return res;
}
@@ -326,4 +196,3 @@ module_exit(at91sam_wdt_exit);
MODULE_AUTHOR("Renaud CERRATO <r.cerrato@til-technologies.fr>");
MODULE_DESCRIPTION("Watchdog driver for Atmel AT91SAM9x processors");
MODULE_LICENSE("GPL");
-MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 02/11] watchdog/at91sam9_wdt: change the at91wdt_private struct to the at91wdt_drvdata struct
From: Wenyou Yang @ 2012-11-14 7:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352877369-19740-1-git-send-email-wenyou.yang@atmel.com>
Set the at91wdt_drvdata struct as the driver data of struct watchdog_device.
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
drivers/watchdog/at91sam9_wdt.c | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index 549c256..31c914a 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -66,13 +66,12 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
static void at91_ping(unsigned long data);
-static struct {
+struct at91wdt_drvdata {
void __iomem *base;
+ bool enabled; /* indicate if the watchdog is eabled */
unsigned long next_heartbeat; /* the next_heartbeat for the timer */
- unsigned long open;
- char expect_close;
struct timer_list timer; /* The timer that pings the watchdog */
-} at91wdt_private;
+};
/* ......................................................................... */
@@ -90,10 +89,12 @@ static inline void at91_wdt_reset(void)
*/
static void at91_ping(unsigned long data)
{
- if (time_before(jiffies, at91wdt_private.next_heartbeat) ||
- (!nowayout && !at91wdt_private.open)) {
+ struct watchdog_device *wddev = (struct watchdog_device *)data;
+ struct at91wdt_drvdata *driver_data = watchdog_get_drvdata(wddev);
+
+ if (time_before(jiffies, driver_data->next_heartbeat))
at91_wdt_reset();
- mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT);
+ mod_timer(&driver_data->timer, jiffies + WDT_TIMEOUT);
} else
pr_crit("I will reset your machine !\n");
}
@@ -138,26 +139,36 @@ static const struct watchdog_info at91_wdt_info = {
static int __init at91wdt_probe(struct platform_device *pdev)
{
+ struct at91wdt_drvdata *driver_data;
struct resource *r;
int res;
+ driver_data = devm_kzalloc(&pdev->dev,
+ sizeof(*driver_data), GFP_KERNEL);
+ if (!driver_data) {
+ dev_err(&pdev->dev, "Unable to alloacate watchdog device\n");
+ return -ENOMEM;
+ }
+
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r)
return -ENODEV;
- at91wdt_private.base = ioremap(r->start, resource_size(r));
- if (!at91wdt_private.base) {
+ driver_data->base = ioremap(r->start, resource_size(r));
+ if (!driver_data->base) {
dev_err(&pdev->dev, "failed to map registers, aborting.\n");
return -ENOMEM;
}
+ watchdog_set_drvdata(&at91_wddev, driver_data);
+
/* Set watchdog */
res = at91_wdt_settimeout(ms_to_ticks(WDT_HW_TIMEOUT * 1000));
if (res)
return res;
- at91wdt_private.next_heartbeat = jiffies + heartbeat * HZ;
- setup_timer(&at91wdt_private.timer, at91_ping, 0);
- mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT);
+ driver_data->next_heartbeat = jiffies + heartbeat * HZ;
+ setup_timer(&driver_data->timer, at91_ping, 0);
+ mod_timer(&driver_data->timer, jiffies + WDT_TIMEOUT);
pr_info("enabled (heartbeat=%d sec, nowayout=%d)\n",
heartbeat, nowayout);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 03/11] watchdog/at91sam9_wdt: change the wdt_read and wdt_write macro to the inline function
From: Wenyou Yang @ 2012-11-14 7:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352877369-19740-1-git-send-email-wenyou.yang@atmel.com>
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
drivers/watchdog/at91sam9_wdt.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index 31c914a..98e7d5a 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -34,11 +34,6 @@
#define DRV_NAME "AT91SAM9 Watchdog"
-#define wdt_read(field) \
- __raw_readl(at91wdt_private.base + field)
-#define wdt_write(field, val) \
- __raw_writel((val), at91wdt_private.base + field)
-
/* AT91SAM9 watchdog runs a 12bit counter @ 256Hz,
* use this to convert a watchdog
* value from/to milliseconds.
@@ -75,13 +70,24 @@ struct at91wdt_drvdata {
/* ......................................................................... */
+static inline unsigned int wdt_read(struct at91wdt_drvdata *driver_data,
+ unsigned int field)
+{
+ return __raw_readl(driver_data->base + field);
+}
+
+static inline void wdt_write(struct at91wdt_drvdata *driver_data,
+ unsigned int field, unsigned int val)
+{
+ __raw_writel((val), driver_data->base + field);
+}
/*
* Reload the watchdog timer. (ie, pat the watchdog)
*/
-static inline void at91_wdt_reset(void)
+static inline void at91_wdt_reset(struct at91wdt_drvdata *driver_data)
{
- wdt_write(AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT);
+ wdt_write(driver_data, AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT);
}
/*
@@ -103,13 +109,15 @@ static void at91_ping(unsigned long data)
* Set the watchdog time interval in 1/256Hz (write-once)
* Counter is 12 bit.
*/
-static int at91_wdt_settimeout(unsigned int timeout)
+static int at91_wdt_settimeout(struct watchdog_device *wddev,
+ unsigned int timeout)
{
+ struct at91wdt_drvdata *driver_data = watchdog_get_drvdata(wddev);
unsigned int reg;
unsigned int mr;
/* Check if disabled */
- mr = wdt_read(AT91_WDT_MR);
+ mr = wdt_read(driver_data, AT91_WDT_MR);
if (mr & AT91_WDT_WDDIS) {
pr_err("sorry, watchdog is disabled\n");
return -EIO;
@@ -126,7 +134,7 @@ static int at91_wdt_settimeout(unsigned int timeout)
| AT91_WDT_WDDBGHLT /* disabled in debug mode */
| AT91_WDT_WDD /* restart at any time */
| (timeout & AT91_WDT_WDV); /* timer value */
- wdt_write(AT91_WDT_MR, reg);
+ wdt_write(driver_data, AT91_WDT_MR, reg);
return 0;
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH 04/11] watchdog/at91sam9_wdt: change "at91_wdt_settimeout" function name to "at91wdt_enable"
From: Wenyou Yang @ 2012-11-14 7:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352877369-19740-1-git-send-email-wenyou.yang@atmel.com>
Change the "at91_wdt_settimeout" function name to "at91wdt_enable" for more reasonable,
and also set the drvdata->enabled value.
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
drivers/watchdog/at91sam9_wdt.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index 98e7d5a..e2d6111 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -13,6 +13,9 @@
* The Watchdog Timer Mode Register can be only written to once. If the
* timeout need to be set from Linux, be sure that the bootstrap or the
* bootloader doesn't write to this register.
+ * The Watchdog Timer default is running with maximum counter value
+ * (WDV=0xfff) at reset, i.e., at power-up. It MUST be either disabled
+ * or be reprogrammed within the maxinum margin(16s).
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -105,20 +108,20 @@ static void at91_ping(unsigned long data)
pr_crit("I will reset your machine !\n");
}
-/*
- * Set the watchdog time interval in 1/256Hz (write-once)
- * Counter is 12 bit.
- */
-static int at91_wdt_settimeout(struct watchdog_device *wddev,
- unsigned int timeout)
+static int at91wdt_enable(struct watchdog_device *wddev, unsigned int timeout)
{
struct at91wdt_drvdata *driver_data = watchdog_get_drvdata(wddev);
unsigned int reg;
unsigned int mr;
- /* Check if disabled */
+ /* Check if the watchdog is disabled,
+ * if disabled, the reason is the bootstrap or the bootloader has
+ * written the Watchdog Timer Mode Register to disable the
+ * watchdog timer
+ */
mr = wdt_read(driver_data, AT91_WDT_MR);
if (mr & AT91_WDT_WDDIS) {
+ driver_data->enabled = false;
pr_err("sorry, watchdog is disabled\n");
return -EIO;
}
@@ -136,6 +139,8 @@ static int at91_wdt_settimeout(struct watchdog_device *wddev,
| (timeout & AT91_WDT_WDV); /* timer value */
wdt_write(driver_data, AT91_WDT_MR, reg);
+ driver_data->enabled = true;
+
return 0;
}
@@ -169,10 +174,11 @@ static int __init at91wdt_probe(struct platform_device *pdev)
watchdog_set_drvdata(&at91_wddev, driver_data);
- /* Set watchdog */
- res = at91_wdt_settimeout(ms_to_ticks(WDT_HW_TIMEOUT * 1000));
- if (res)
- return res;
+ res = at91wdt_enable(&at91_wddev);
+ if (res) {
+ dev_err(&pdev->dev, "cannot enable watchdog (%d)\n", ret);
+ return ret;
+ }
driver_data->next_heartbeat = jiffies + heartbeat * HZ;
setup_timer(&driver_data->timer, at91_ping, 0);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 05/11] watchdog/at91sam9_wdt: add to use the watchdog framework
From: Wenyou Yang @ 2012-11-14 7:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352877369-19740-1-git-send-email-wenyou.yang@atmel.com>
For the Watchdog Timer Mode Register can be only written only once,
so struct watchdog_info options only support WDIOF_KEEPALIVEPING,
not support WDIOF_SETTIMEOUT and WDIOF_MAGICCLOSE.
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
drivers/watchdog/Kconfig | 1 +
drivers/watchdog/at91sam9_wdt.c | 90 ++++++++++++++++++++++++++++++++-------
2 files changed, 76 insertions(+), 15 deletions(-)
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index ad1bb93..dda695f 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -114,6 +114,7 @@ config AT91RM9200_WATCHDOG
config AT91SAM9X_WATCHDOG
tristate "AT91SAM9X / AT91CAP9 watchdog"
depends on ARCH_AT91 && !ARCH_AT91RM9200
+ select WATCHDOG_CORE
help
Watchdog timer embedded into AT91SAM9X and AT91CAP9 chips. This will
reboot your system when the timeout is reached.
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index e2d6111..84c2aa7 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -85,6 +85,11 @@ static inline void wdt_write(struct at91wdt_drvdata *driver_data,
__raw_writel((val), driver_data->base + field);
}
+static inline bool watchdog_is_open(struct watchdog_device *wddev)
+{
+ return test_bit(WDOG_DEV_OPEN, &wddev->status);
+}
+
/*
* Reload the watchdog timer. (ie, pat the watchdog)
*/
@@ -101,9 +106,12 @@ static void at91_ping(unsigned long data)
struct watchdog_device *wddev = (struct watchdog_device *)data;
struct at91wdt_drvdata *driver_data = watchdog_get_drvdata(wddev);
- if (time_before(jiffies, driver_data->next_heartbeat))
- at91_wdt_reset();
+ if (time_before(jiffies, driver_data->next_heartbeat)) {
+ at91_wdt_reset(driver_data);
mod_timer(&driver_data->timer, jiffies + WDT_TIMEOUT);
+
+ if (!watchdog_is_open(wddev))
+ driver_data->next_heartbeat = jiffies + heartbeat * HZ;
} else
pr_crit("I will reset your machine !\n");
}
@@ -144,17 +152,62 @@ static int at91wdt_enable(struct watchdog_device *wddev, unsigned int timeout)
return 0;
}
-static const struct watchdog_info at91_wdt_info = {
+static int at91wdt_start(struct watchdog_device *wddev)
+{
+ struct at91wdt_drvdata *driver_data = watchdog_get_drvdata(wddev);
+
+ if (driver_data->enabled)
+ return 0;
+ else
+ return -EIO;
+}
+
+static int at91wdt_stop(struct watchdog_device *wddev)
+{
+ struct at91wdt_drvdata *driver_data = watchdog_get_drvdata(wddev);
+
+ if (driver_data->enabled)
+ return -EIO;
+ else
+ return 0;
+}
+
+static int at91wdt_keepalive(struct watchdog_device *wddev)
+{
+ struct at91wdt_drvdata *driver_data = watchdog_get_drvdata(wddev);
+
+ if (driver_data->enabled) {
+ driver_data->next_heartbeat = jiffies + heartbeat * HZ;
+ return 0;
+ } else
+ return -EIO;
+}
+
+/* ......................................................................... */
+
+static const struct watchdog_info at91wdt_info = {
.identity = DRV_NAME,
- .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING |
- WDIOF_MAGICCLOSE,
+ .options = WDIOF_KEEPALIVEPING,
+ .firmware_version = 0,
+};
+
+static struct watchdog_ops at91wdt_ops = {
+ .owner = THIS_MODULE,
+ .start = at91wdt_start,
+ .stop = at91wdt_stop,
+ .ping = at91wdt_keepalive,
+};
+
+static struct watchdog_device at91_wddev = {
+ .info = &at91wdt_info,
+ .ops = &at91wdt_ops,
};
static int __init at91wdt_probe(struct platform_device *pdev)
{
struct at91wdt_drvdata *driver_data;
- struct resource *r;
- int res;
+ struct resource *res;
+ int ret;
driver_data = devm_kzalloc(&pdev->dev,
sizeof(*driver_data), GFP_KERNEL);
@@ -163,10 +216,10 @@ static int __init at91wdt_probe(struct platform_device *pdev)
return -ENOMEM;
}
- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!r)
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res)
return -ENODEV;
- driver_data->base = ioremap(r->start, resource_size(r));
+ driver_data->base = ioremap(res->start, resource_size(res));
if (!driver_data->base) {
dev_err(&pdev->dev, "failed to map registers, aborting.\n");
return -ENOMEM;
@@ -174,14 +227,21 @@ static int __init at91wdt_probe(struct platform_device *pdev)
watchdog_set_drvdata(&at91_wddev, driver_data);
- res = at91wdt_enable(&at91_wddev);
- if (res) {
+ ret = at91wdt_enable(&at91_wddev, ms_to_ticks(WDT_HW_TIMEOUT * 1000));
+ if (ret) {
dev_err(&pdev->dev, "cannot enable watchdog (%d)\n", ret);
return ret;
}
+ ret = watchdog_register_device(&at91_wddev);
+ if (ret) {
+ dev_err(&pdev->dev, "cannot register watchdog (%d)\n", ret);
+ return ret;
+ }
+
driver_data->next_heartbeat = jiffies + heartbeat * HZ;
- setup_timer(&driver_data->timer, at91_ping, 0);
+ setup_timer(&driver_data->timer, at91_ping,
+ (unsigned long)&at91_wddev);
mod_timer(&driver_data->timer, jiffies + WDT_TIMEOUT);
pr_info("enabled (heartbeat=%d sec, nowayout=%d)\n",
@@ -192,9 +252,9 @@ static int __init at91wdt_probe(struct platform_device *pdev)
static int __exit at91wdt_remove(struct platform_device *pdev)
{
- int res;
+ watchdog_unregister_device(&at91_wddev);
- return res;
+ return 0;
}
static struct platform_driver at91wdt_driver = {
--
1.7.9.5
^ permalink raw reply related
* [PATCH 06/11] watchdog/at91sam9_wdt: change the timer function name
From: Wenyou Yang @ 2012-11-14 7:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352877369-19740-1-git-send-email-wenyou.yang@atmel.com>
Change the timer function name "at91_ping" to "at91wdt_timer_tick"
as an appropriate name, and change at91_wdt_reset to at91wdt_reset
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
drivers/watchdog/at91sam9_wdt.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index 84c2aa7..d764f36 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -62,8 +62,6 @@ module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
"(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-static void at91_ping(unsigned long data);
-
struct at91wdt_drvdata {
void __iomem *base;
bool enabled; /* indicate if the watchdog is eabled */
@@ -90,24 +88,18 @@ static inline bool watchdog_is_open(struct watchdog_device *wddev)
return test_bit(WDOG_DEV_OPEN, &wddev->status);
}
-/*
- * Reload the watchdog timer. (ie, pat the watchdog)
- */
-static inline void at91_wdt_reset(struct at91wdt_drvdata *driver_data)
+static inline void at91wdt_reset(struct at91wdt_drvdata *driver_data)
{
wdt_write(driver_data, AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT);
}
-/*
- * Timer tick
- */
-static void at91_ping(unsigned long data)
+static void at91wdt_timer_tick(unsigned long data)
{
struct watchdog_device *wddev = (struct watchdog_device *)data;
struct at91wdt_drvdata *driver_data = watchdog_get_drvdata(wddev);
if (time_before(jiffies, driver_data->next_heartbeat)) {
- at91_wdt_reset(driver_data);
+ at91wdt_reset(driver_data);
mod_timer(&driver_data->timer, jiffies + WDT_TIMEOUT);
if (!watchdog_is_open(wddev))
@@ -240,7 +232,7 @@ static int __init at91wdt_probe(struct platform_device *pdev)
}
driver_data->next_heartbeat = jiffies + heartbeat * HZ;
- setup_timer(&driver_data->timer, at91_ping,
+ setup_timer(&driver_data->timer, at91wdt_timer_tick,
(unsigned long)&at91_wddev);
mod_timer(&driver_data->timer, jiffies + WDT_TIMEOUT);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 07/11] watchdog/at91sam9_wdt: add nowayout helpers to Watchdog Timer Driver Kernel API
From: Wenyou Yang @ 2012-11-14 7:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352877369-19740-1-git-send-email-wenyou.yang@atmel.com>
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
drivers/watchdog/at91sam9_wdt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index d764f36..187e33f 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -225,6 +225,8 @@ static int __init at91wdt_probe(struct platform_device *pdev)
return ret;
}
+ watchdog_set_nowayout(&at91_wddev, nowayout);
+
ret = watchdog_register_device(&at91_wddev);
if (ret) {
dev_err(&pdev->dev, "cannot register watchdog (%d)\n", ret);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 08/11] watchdog/at91sam9_wdt: use module_platform_driver()
From: Wenyou Yang @ 2012-11-14 7:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352877369-19740-1-git-send-email-wenyou.yang@atmel.com>
Using module_platform_driver() replaces module_init() and module_exit()
and makes the code simpler.
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
drivers/watchdog/at91sam9_wdt.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index 187e33f..e7ce9ea 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -252,6 +252,7 @@ static int __exit at91wdt_remove(struct platform_device *pdev)
}
static struct platform_driver at91wdt_driver = {
+ .probe = at91wdt_probe,
.remove = __exit_p(at91wdt_remove),
.driver = {
.name = "at91_wdt",
@@ -259,18 +260,7 @@ static struct platform_driver at91wdt_driver = {
},
};
-static int __init at91sam_wdt_init(void)
-{
- return platform_driver_probe(&at91wdt_driver, at91wdt_probe);
-}
-
-static void __exit at91sam_wdt_exit(void)
-{
- platform_driver_unregister(&at91wdt_driver);
-}
-
-module_init(at91sam_wdt_init);
-module_exit(at91sam_wdt_exit);
+module_platform_driver(at91wdt_driver);
MODULE_AUTHOR("Renaud CERRATO <r.cerrato@til-technologies.fr>");
MODULE_DESCRIPTION("Watchdog driver for Atmel AT91SAM9x processors");
--
1.7.9.5
^ permalink raw reply related
* [PATCH 09/11] watchdog/at91sam9_wdt: add support to device tree
From: Wenyou Yang @ 2012-11-14 7:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352877369-19740-1-git-send-email-wenyou.yang@atmel.com>
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Cc: grant.likely at secretlab.ca
Cc: rob.herring at calxeda.com
Cc: devicetree-discuss at lists.ozlabs.org
---
drivers/watchdog/at91sam9_wdt.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index e7ce9ea..cba5c5d 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -32,6 +32,7 @@
#include <linux/jiffies.h>
#include <linux/timer.h>
#include <linux/bitops.h>
+#include <linux/of.h>
#include "at91sam9_wdt.h"
@@ -251,12 +252,21 @@ static int __exit at91wdt_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_OF
+static const struct of_device_id at91wdt_match[] = {
+ { .compatible = "atmel,at91sam-wdt" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, at91wdt_match);
+#endif
+
static struct platform_driver at91wdt_driver = {
.probe = at91wdt_probe,
.remove = __exit_p(at91wdt_remove),
.driver = {
.name = "at91_wdt",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(at91wdt_match),
},
};
--
1.7.9.5
^ permalink raw reply related
* [PATCH 10/11] watchdog/at91sam9_wdt: using dev_info replaces pr_info, dev_crit repalces pr_crit
From: Wenyou Yang @ 2012-11-14 7:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352877369-19740-1-git-send-email-wenyou.yang@atmel.com>
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
drivers/watchdog/at91sam9_wdt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index cba5c5d..bd74f40 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -106,7 +106,7 @@ static void at91wdt_timer_tick(unsigned long data)
if (!watchdog_is_open(wddev))
driver_data->next_heartbeat = jiffies + heartbeat * HZ;
} else
- pr_crit("I will reset your machine !\n");
+ dev_crit(wddev->dev, "I will reset your machine !\n");
}
static int at91wdt_enable(struct watchdog_device *wddev, unsigned int timeout)
@@ -239,7 +239,7 @@ static int __init at91wdt_probe(struct platform_device *pdev)
(unsigned long)&at91_wddev);
mod_timer(&driver_data->timer, jiffies + WDT_TIMEOUT);
- pr_info("enabled (heartbeat=%d sec, nowayout=%d)\n",
+ dev_info(&pdev->dev, "enabled (heartbeat=%d sec, nowayout=%d)\n",
heartbeat, nowayout);
return 0;
--
1.7.9.5
^ permalink raw reply related
* [PATCH 11/11] ARM: dts: add the watchdog nodes for atmel SoC
From: Wenyou Yang @ 2012-11-14 7:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1352877369-19740-1-git-send-email-wenyou.yang@atmel.com>
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Cc: grant.likely at secretlab.ca
Cc: rob.herring at calxeda.com
Cc: rob at landley.net
Cc: linux at arm.linux.org.uk
Cc: devicetree-discuss at lists.ozlabs.org
Cc: linux-doc at vger.kernel.org
---
.../devicetree/bindings/watchdog/atmel-wdt.txt | 14 ++++++++++++++
arch/arm/boot/dts/at91sam9260.dtsi | 6 ++++++
arch/arm/boot/dts/at91sam9263.dtsi | 6 ++++++
arch/arm/boot/dts/at91sam9263ek.dts | 4 ++++
arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 4 ++++
arch/arm/boot/dts/at91sam9g25ek.dts | 4 ++++
arch/arm/boot/dts/at91sam9g45.dtsi | 5 +++++
arch/arm/boot/dts/at91sam9m10g45ek.dts | 4 ++++
arch/arm/boot/dts/at91sam9n12.dtsi | 6 ++++++
arch/arm/boot/dts/at91sam9n12ek.dts | 4 ++++
arch/arm/boot/dts/at91sam9x5.dtsi | 6 ++++++
11 files changed, 63 insertions(+)
create mode 100644 Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
diff --git a/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt b/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
new file mode 100644
index 0000000..5d09b87
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/atmel-wdt.txt
@@ -0,0 +1,14 @@
+* Atmel's Watchdog Timer Controller
+
+Required properties:
+- compatible : should be "atmel,at91sam-wdt"
+- reg : base physical address of the controller and length of memory mapped
+ region.
+
+Example:
+
+ watchdog at fffffd40 {
+ compatible = "atmel,at91sam-wdt";
+ reg = <0xfffffd40 0x10>;
+ status = "okay";
+ };
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index d410581..81687a3 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -86,6 +86,12 @@
interrupts = <1 4 7>;
};
+ watchdog at fffffd40 {
+ compatible = "atmel,at91sam-wdt";
+ reg = <0xfffffd40 0x10>;
+ status = "disabled";
+ };
+
tcb0: timer at fffa0000 {
compatible = "atmel,at91rm9200-tcb";
reg = <0xfffa0000 0x100>;
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
index 3e6e5c1..a25826b 100644
--- a/arch/arm/boot/dts/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/at91sam9263.dtsi
@@ -73,6 +73,12 @@
interrupts = <1 4 7>;
};
+ watchdog at fffffd40 {
+ compatible = "atmel,at91sam-wdt";
+ reg = <0xfffffd40 0x10>;
+ status = "disabled";
+ };
+
tcb0: timer at fff7c000 {
compatible = "atmel,at91rm9200-tcb";
reg = <0xfff7c000 0x100>;
diff --git a/arch/arm/boot/dts/at91sam9263ek.dts b/arch/arm/boot/dts/at91sam9263ek.dts
index f86ac4b..bc947ea 100644
--- a/arch/arm/boot/dts/at91sam9263ek.dts
+++ b/arch/arm/boot/dts/at91sam9263ek.dts
@@ -50,6 +50,10 @@
atmel,vbus-gpio = <&pioA 25 0>;
status = "okay";
};
+
+ watchdog at fffffd40 {
+ status = "okay";
+ };
};
nand0: nand at 40000000 {
diff --git a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
index e6391a4..e5797b7 100644
--- a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
+++ b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
@@ -51,6 +51,10 @@
atmel,vbus-gpio = <&pioC 5 0>;
status = "okay";
};
+
+ watchdog at fffffd40 {
+ status = "okay";
+ };
};
nand0: nand at 40000000 {
diff --git a/arch/arm/boot/dts/at91sam9g25ek.dts b/arch/arm/boot/dts/at91sam9g25ek.dts
index 877c08f..2f03edc 100644
--- a/arch/arm/boot/dts/at91sam9g25ek.dts
+++ b/arch/arm/boot/dts/at91sam9g25ek.dts
@@ -44,6 +44,10 @@
i2c2: i2c at f8018000 {
status = "okay";
};
+
+ watchdog at fffffe40 {
+ status = "okay";
+ };
};
usb0: ohci at 00600000 {
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index 3add030..c6c2c09 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -84,6 +84,11 @@
interrupts = <1 4 7>;
};
+ watchdog at fffffd40 {
+ compatible = "atmel,at91sam-wdt";
+ reg = <0xfffffd40 0x10>;
+ status = "disabled";
+ };
shdwc at fffffd10 {
compatible = "atmel,at91sam9rl-shdwc";
diff --git a/arch/arm/boot/dts/at91sam9m10g45ek.dts b/arch/arm/boot/dts/at91sam9m10g45ek.dts
index 15e1dd4..371ab40 100644
--- a/arch/arm/boot/dts/at91sam9m10g45ek.dts
+++ b/arch/arm/boot/dts/at91sam9m10g45ek.dts
@@ -54,6 +54,10 @@
i2c1: i2c at fff88000 {
status = "okay";
};
+
+ watchdog at fffffd40 {
+ status = "okay";
+ };
};
nand0: nand at 40000000 {
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index 82508d6..e5e6363 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -79,6 +79,12 @@
interrupts = <1 4 7>;
};
+ watchdog at fffffe40 {
+ compatible = "atmel,at91sam-wdt";
+ reg = <0xfffffe40 0x10>;
+ status = "disabled";
+ };
+
shdwc at fffffe10 {
compatible = "atmel,at91sam9x5-shdwc";
reg = <0xfffffe10 0x10>;
diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts
index 912b2c2..abeda7a 100644
--- a/arch/arm/boot/dts/at91sam9n12ek.dts
+++ b/arch/arm/boot/dts/at91sam9n12ek.dts
@@ -45,6 +45,10 @@
i2c1: i2c at f8014000 {
status = "okay";
};
+
+ watchdog at fffffe40 {
+ status = "okay";
+ };
};
nand0: nand at 40000000 {
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 03fc136..485f171 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -87,6 +87,12 @@
interrupts = <1 4 7>;
};
+ watchdog at fffffe40 {
+ compatible = "atmel,at91sam-wdt";
+ reg = <0xfffffe40 0x10>;
+ status = "disabled";
+ };
+
tcb0: timer at f8008000 {
compatible = "atmel,at91sam9x5-tcb";
reg = <0xf8008000 0x100>;
--
1.7.9.5
^ permalink raw reply related
* [PATCH] ARM: OMAP2+: timer: remove CONFIG_OMAP_32K_TIMER
From: Igor Grinberg @ 2012-11-14 7:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50A271A7.2000305@ti.com>
On 11/13/12 18:13, Jon Hunter wrote:
>
> On 11/13/2012 03:14 AM, Igor Grinberg wrote:
>> On 11/12/12 21:15, Jon Hunter wrote:
>>>
>>> On 11/11/2012 05:28 AM, Igor Grinberg wrote:
>>>>
>>>>
>>>> On 11/08/12 21:16, Jon Hunter wrote:
>>>>>
>>>>> On 11/08/2012 12:59 PM, Hiremath, Vaibhav wrote:
>>>>>> On Fri, Nov 09, 2012 at 00:24:23, Hunter, Jon wrote:
>>>>>>>
>>>>>>> On 11/08/2012 01:59 AM, Igor Grinberg wrote:
>>>>>>>
>>>>>>> [snip]
>>>>>>>
>>>>>>>> There is no reliable way to determine which source should be used in runtime
>>>>>>>> for boards that do not have the 32k oscillator wired.
>>>>>>>
>>>>>>> So thinking about this some more and given that we are moving away from
>>>>>>> board files, if a board does not provide a 32kHz clock source, then this
>>>>>>> should be reflected in the device-tree source file for that board.
>>>>>>> Hence, at boot time we should be able to determine if a 32kHz clock
>>>>>>> source can be used.
>>>>>>>
>>>>>>
>>>>>> Let me feed some more thoughts here :)
>>>>>>
>>>>>> The way it is being detected currently is based on timer idle status bit.
>>>>>> I am worried that, this is the only option we have.
>>>>>
>>>>> Why not use device-tree to indicate the presence of a 32k clock source?
>>>>> This seems like a board level configuration and so device-tree seems to
>>>>> be the perfect place for this IMO.
>>>>
>>>> Well, that is what my commit message says...
>>>
>>> Sorry, but that was not clear to me from whats in the commit message.
>>
>> From the commit message:
>> "1) Timer structures and initialization functions are named by the platform
>> name and the clock source in use. The decision which timer is
>> used is done statically from the machine_desc structure. In the
>> future it should come from DT."
>>
>> The last sentence has it.
>
> Right, but it does not go into the details. It would be good to have
> added a comment to the effect of "some boards do not have a 32k clock
> source and in the future this should be handled by device-tree".
Ok.
>
>> The transition to DT is not immediate and we can't (still) neglect
>> the non-DT setups.
>
> Absolutely, but I am trying to understand if there are boards being
> "neglected". I see now that your CM-T3517 would be. This was not clear
> from your patch as even the CM-T3517 board was being configured to the
> use the sync32k timer. So from looking at your patch I did not see any
> neglected boards, however, I understand your motivation to add all these
> init functions so that boards could be customised easily.
I did not changed the CM-T3517, because I believe it should be done
in a separate patch.
>
>>> Should we be doing this now instead of adding all these static timer
>>> init functions?
>>
>> I don't see this as "adding ...", I see this as expanding the setup
>> which was previously hidden by the CONFIG_OMAP_32K_TIMER option.
>>
>>>
>>> Are there any boards today (supported in the kernel that is), that don't
>>> support a 32k?
>>
>> Yes, starting from revision 1.2, CM-T3517 does not have the 32k.
>
> Thanks, this is the exact information I was looking for. You should put
> this in your commit message to highlight the fact that there are boards
> that don't have a 32k clock source.
>
> I am familiar with the OMAP devices, but less familiar with these AMxxxx
> derivatives (as I don't work with these) and so it is good to put these
> specifics in the commit message.
Ok.
--
Regards,
Igor.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox