From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-la0-x233.google.com ([2a00:1450:4010:c03::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UFRPc-0003Ev-RC for barebox@lists.infradead.org; Tue, 12 Mar 2013 15:46:50 +0000 Received: by mail-la0-f51.google.com with SMTP id fo13so5419888lab.10 for ; Tue, 12 Mar 2013 08:46:46 -0700 (PDT) MIME-Version: 1.0 From: "Renaud C." Date: Tue, 12 Mar 2013 16:46:04 +0100 Message-ID: Content-Type: multipart/mixed; boundary=f46d0401f9d5609a9104d7bc3282 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 2/7] Watchdog driver for AT91SAM9 SOC To: barebox --f46d0401f9d5609a9104d7bc3282 Content-Type: multipart/alternative; boundary=f46d0401f9d5609a8904d7bc3280 --f46d0401f9d5609a8904d7bc3280 Content-Type: text/plain; charset=ISO-8859-1 This patch add watchdog driver for AT91SAM9 SOC. Beware that the watchdog unit is write once. I only added the at91_add_device_watchdog(void) API for AT91SAM9260 devices, but the driver should work on all AT91SAM9. --f46d0401f9d5609a8904d7bc3280 Content-Type: text/html; charset=ISO-8859-1
This patch add watchdog driver for AT91SAM9 SOC. Beware that the watchdog unit is write once. I only added the at91_add_device_watchdog(void) API for AT91SAM9260 devices, but the driver should work on all AT91SAM9.
--f46d0401f9d5609a8904d7bc3280-- --f46d0401f9d5609a9104d7bc3282 Content-Type: application/octet-stream; name="added-watchdog-driver-for-at91sam9x.patch" Content-Disposition: attachment; filename="added-watchdog-driver-for-at91sam9x.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_he78f9of0 RnJvbSA3ZjdkNmJmM2NhYzE3ZmJjZWRmZDE2ODQ0N2U1NTViZDk2MjIwMGNmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBD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lZ2lz dGVyKCZwcml2LT53ZCk7CisJaWYgKHJjICE9IDApCisJCWdvdG8gb25fZXJyb3I7CisKKwlpZiAo c2FtOV93YXRjaGRvZ19pc19kaXNhYmxlZChwcml2KSkKKwkJZGV2X3dhcm4oZGV2LCAid2F0Y2hk b2cgaXMgZGlzYWJsZWRcbiIpOworCWVsc2UKKwkJZGV2X2luZm8oZGV2LCAiZW5hYmxlZCwgdGlt ZW91dCBpcyAlZCBzZWMuXG4iLAorCQkJCXRpY2tzX3RvX3NlYyhhdDkxX3dkdF9yZWFkKHByaXYs IEFUOTFfV0RUX01SKSAmIEFUOTFfV0RUX1dEVikpOworCisJZGV2LT5wcml2ID0gcHJpdjsKKwly ZXR1cm4gMDsKKworb25fZXJyb3I6CisJZnJlZShwcml2KTsKKwlyZXR1cm4gcmM7Cit9CisKK3N0 YXRpYyB2b2lkIHNhbTlfd2RfcmVtb3ZlKHN0cnVjdCBkZXZpY2VfZCAqZGV2KQoreworCXN0cnVj dCBzYW05X3dkdCAqcHJpdj0gZGV2LT5wcml2OworCXdhdGNoZG9nX2RlcmVnaXN0ZXIoJnByaXYt PndkKTsKKwlmcmVlKHByaXYpOworfQorCitzdGF0aWMgc3RydWN0IGRyaXZlcl9kIHNhbTlfd2Rf ZHJpdmVyID0geworCS5uYW1lICAgPSAiYXQ5MV93ZCIsCisJLnByb2JlICA9IHNhbTlfd2RfcHJv YmUsCisJLnJlbW92ZSA9IHNhbTlfd2RfcmVtb3ZlLAorfTsKKworc3RhdGljIGludCBzYW05X3dk X2luaXQodm9pZCkKK3sKKwlwbGF0Zm9ybV9kcml2ZXJfcmVnaXN0ZXIoJnNhbTlfd2RfZHJpdmVy KTsKKwlyZXR1cm4gMDsKK30KKworZGV2aWNlX2luaXRjYWxsKHNhbTlfd2RfaW5pdCk7Ci0tIAox LjcuMi41Cgo= --f46d0401f9d5609a9104d7bc3282 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --f46d0401f9d5609a9104d7bc3282--