From patchwork Tue Jul 3 14:22:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 1151251 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork1.kernel.org (Postfix) with ESMTP id 2808040134 for ; Tue, 3 Jul 2012 14:25:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Sm42L-00071g-SA; Tue, 03 Jul 2012 14:25:05 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Sm42L-00071R-0S for spi-devel-general@lists.sourceforge.net; Tue, 03 Jul 2012 14:25:05 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of lunn.ch designates 80.238.139.98 as permitted sender) client-ip=80.238.139.98; envelope-from=andrew@lunn.ch; helo=londo.lunn.ch; Received: from londo.lunn.ch ([80.238.139.98]) by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1Sm42H-0006GA-8s for spi-devel-general@lists.sourceforge.net; Tue, 03 Jul 2012 14:25:04 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1Sm40N-0005ak-00; Tue, 03 Jul 2012 16:23:03 +0200 From: Andrew Lunn To: Jason Cooper Subject: [PATCH v2 09/12] ARM: Kirkwood: DTify the watchdog timer. Date: Tue, 3 Jul 2012 16:22:42 +0200 Message-Id: <1341325365-21393-10-git-send-email-andrew@lunn.ch> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1341325365-21393-1-git-send-email-andrew@lunn.ch> References: <1341325365-21393-1-git-send-email-andrew@lunn.ch> X-Spam-Score: -1.2 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record 0.3 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Sm42H-0006GA-8s Cc: Andrew Lunn , devicetree-discuss@lists.ozlabs.org, rob.herring@calxeda.com, Michael Walle , linux-i2c@vger.kernel.org, spi-devel-general@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net Add device tree support to the Orion watchdog timer, and enable its use in the kirkwood devices using device tree. Signed-off-by: Andrew Lunn --- Documentation/devicetree/bindings/watchdog/marvel.txt | 14 ++++++++++++++ arch/arm/boot/dts/kirkwood.dtsi | 6 ++++++ arch/arm/mach-kirkwood/board-dt.c | 2 +- drivers/watchdog/orion_wdt.c | 8 ++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/watchdog/marvel.txt diff --git a/Documentation/devicetree/bindings/watchdog/marvel.txt b/Documentation/devicetree/bindings/watchdog/marvel.txt new file mode 100644 index 0000000..0b2503a --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/marvel.txt @@ -0,0 +1,14 @@ +* Marvell Orion Watchdog Time + +Required Properties: + +- Compatibility : "marvell,orion-wdt" +- reg : Address of the timer registers + +Example: + + wdt@20300 { + compatible = "marvell,orion-wdt"; + reg = <0x20300 0x28>; + status = "okay"; + }; diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi index c8bc122..be8e127 100644 --- a/arch/arm/boot/dts/kirkwood.dtsi +++ b/arch/arm/boot/dts/kirkwood.dtsi @@ -69,6 +69,12 @@ status = "disabled"; }; + wdt@20300 { + compatible = "marvell,orion-wdt"; + reg = <0x20300 0x28>; + status = "okay"; + }; + nand@3000000 { #address-cells = <1>; #size-cells = <1>; diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index b7cd6d2..73e75cf 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -30,6 +30,7 @@ struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", NULL), + OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), {}, }; @@ -55,7 +56,6 @@ static void __init kirkwood_dt_init(void) kirkwood_clk_init(); /* internal devices that every board has */ - kirkwood_wdt_init(); kirkwood_xor0_init(); kirkwood_xor1_init(); kirkwood_crypto_init(); diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index 0f57369..1531e02 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c @@ -25,6 +25,7 @@ #include #include #include +#include #include /* @@ -295,6 +296,12 @@ static void orion_wdt_shutdown(struct platform_device *pdev) orion_wdt_disable(); } +static const struct of_device_id orion_wdt_of_match_table[] __devinitdata = { + { .compatible = "marvell,orion-wdt", }, + {}, +}; +MODULE_DEVICE_TABLE(of, orion_wdt_of_match_table); + static struct platform_driver orion_wdt_driver = { .probe = orion_wdt_probe, .remove = __devexit_p(orion_wdt_remove), @@ -302,6 +309,7 @@ static struct platform_driver orion_wdt_driver = { .driver = { .owner = THIS_MODULE, .name = "orion_wdt", + .of_match_table = of_match_ptr(orion_wdt_of_match_table), }, };