summaryrefslogtreecommitdiff
path: root/drivers/watchdog/ziirave_wdt.c
AgeCommit message (Collapse)Author
2021-06-21watchdog: ziirave_wdt: Remove VERSION_FMT defines and add sysfs newlinesJuerg Haefliger
Remove the ZIIRAVE_{BL,FW}_VERION_FMT defines since they're only used in very few places. While at it, add newlines to sysfs outputs. Suggested-By: Joe Perches <joe@perches.com> Signed-off-by: Juerg Haefliger <juergh@canonical.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210520072918.76482-1-juergh@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2021-06-21watchdog: Use sysfs_emit() and sysfs_emit_at() in "show" functionsJuerg Haefliger
Convert sprintf() in sysfs "show" functions to sysfs_emit() and sysfs_emit_at() in order to check for buffer overruns in sysfs outputs. Signed-off-by: Juerg Haefliger <juergh@canonical.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210511061812.480172-1-juergh@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2021-02-07watchdog: ziirave_wdt: remove unused including <linux/version.h>Tian Tao
Remove including <linux/version.h> that don't need it. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/1608886154-55309-1-git-send-email-tiantao6@hisilicon.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2020-04-01watchdog: ziirave_wdt: change name to be more specificLucas Stach
The RAVE watchdog is not a full system watchdog, but is used to reset ethernet switch when required. Change the name to better reflect this usage. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200313101138.25915-1-l.stach@pengutronix.de Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Update checked I2C functionality maskAndrey Smirnov
Update checked I2C functionality mask to reflect all of the SMBus primitives used by this driver. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-23-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Drop ziirave_firm_write_block_data()Andrey Smirnov
There's only one user of ziirave_firm_write_block_data(), so we may as well inline it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-22-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Fix DOWNLOAD_START payloadAndrey Smirnov
Bootloader firmware expects the following traffic for DOWNLOAD_END: S Addr Wr [A] 0x10 [A] P using ziirave_firm_write_byte() will result in S Addr Wr [A] 0x10 [A] 0x01 [A] 0x01 [A] P which happens to work because firmware will ignore any extra bytes sent. Fix this by converting the code to use i2c_smbus_write_byte() instead. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-21-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Drop status polling codeAndrey Smirnov
Bootloader firmware doesn't implement DOWNLOAD_START or DOWNLOAD_PACKET in a non-blocking way. It will stretch the clock of the first status byte read until the operation is complete. Polling for the status is not really necessary since it will always succed on the first try. Replace polling code with a simple single byte read to simplify things. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-20-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Fix RESET_PROCESSOR payloadAndrey Smirnov
Bootloader firmware expects the following traffic for RESET_PROCESSOR: S Addr Wr [A] 0x0b [A] 0x01 [A] P using ziirave_firm_write_byte() will result in S Addr Wr [A] 0x0b [A] 0x01 [A] 0x01 [A] P which happens to work because firmware will ignore any extra bytes and expected magic value matches byte count sent by i2c_smbus_write_block_data(). Fix this by converting the code to use i2c_smbus_write_byte_data() instead. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-19-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Fix DOWNLOAD_END payloadAndrey Smirnov
Bootloader firmware expects the following traffic for DOWNLOAD_END: S Addr Wr [A] 0x11 [A] P using ziirave_firm_write_byte() will result in S Addr Wr [A] 0x11 [A] 0x01 [A] 0x01 [A] P which happens to work because firmware will ignore any extra bytes sent. Fix this by converting the code to use i2c_smbus_write_byte() instead. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-18-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Fix JUMP_TO_BOOTLOADER payloadAndrey Smirnov
Bootloader firmware expects the following traffic for JUMP_TO_BOOTLOADER: S Addr Wr [A] 0x0c [A] 0x01 [A] P using ziirave_firm_write_byte() will result in S Addr Wr [A] 0x0c [A] 0x01 [A] 0x01 [A] P which happens to work because firmware will ignore any extra bytes and expected magic value matches byte count sent by i2c_smbus_write_block_data(). Fix this by converting the code to use i2c_smbus_write_byte_data() instead. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-17-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Fix misleading error messageAndrey Smirnov
Fix misleading error message in ziirave_wdt_init_duration(). Saying "unable to set ..." implies that an attempt at communication with watchdog device has taken palce and was not successful. In this case, however, all it indicates is that no reset pulse duration was specified either via kernel parameter or Device Tree. Re-phase the log message to be more clear about benign nature of this event. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-16-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Don't try to program readonly flashAndrey Smirnov
Bootloader code will ignore any attempts to write data to any flash area outside of [ZIIRAVE_FIRM_FLASH_MEMORY_START; ZIIRAVE_FIRM_FLASH_MEMORY_END]. Firmware update code already have an appropriate check to skip those areas when validating updated firmware. Firmware programming code, OTOH, does not and will needlessly send no-op I2C traffic. Add an appropriate check to __ziirave_firm_write_pkt() so as to save all of that wasted effort. While at it, normalize all of the address handling code to use full 32-bit address in units of bytes and convert it to an appropriate value only in places where that is necessary. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-15-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Don't read out more than 'len' firmware bytesAndrey Smirnov
We only compare first 'len' bytes of read firmware, so we don't need to read more that that. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-14-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Don't check if ihex record length is zeroAndrey Smirnov
Ihex_next_binrec() will return NULL if next record's 'len' is zero, so explicit checks for that in the driver are unnecessary. Drop them. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-13-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Make use of put_unaligned_le16Andrey Smirnov
Instead of doing this explicitly use put_unaligned_le16() to place 16-bit address value into command payload. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-12-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Zero out only what's necessaryAndrey Smirnov
Instead of zeroing out all of the packet and then overwriting a significant portion of those zeros via memcpy(), zero out only a portion of the packet that is known to not contain any data. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-11-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Fix incorrect use of ARRAY_SIZEAndrey Smirnov
Both memset() and ziirave_firm_write_block_data() expect length in bytes as an argument, not a number of elements in array. It just happens that in this particular case both values are equal. Modify the code to use sizeof() instead. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-10-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Skip zeros when calculating checksumAndrey Smirnov
Zeros don't contribute anything to checksum value, so we can skip unused portion of the packet when calculating its checksum. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-9-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Check packet length only onceAndrey Smirnov
We don't need to check for packet length more than once, so drop the extra check in ziirave_firm_upload(). While at it move the check at the very start of __ziirave_firm_write_pkt(), as to not waste any time preparing a packet we'll never use. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-8-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Simplify ziirave_firm_write_pkt()Andrey Smirnov
There no reason why ziirave_firm_write_pkt() has to take firmware data via 'struct ihex_binrec' and it can just take address, data pointer and data length as individual arguments. Make this change to allow us to drastically simplify handling page crossing case by removing all of the extra code required to split 'struct ihex_binrec' into two. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-7-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Log bootloader/firmware info during probeAndrey Smirnov
Log bootloader/firmware info during probe. This information is available via sysfs already, but it's really helpful to have this in kernel log during startup as well. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-6-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Don't bail out on unexpected timeout valueAndrey Smirnov
Reprogramming bootloader on watchdog MCU will result in reported default timeout value of "0". That in turn will be unnecessarily rejected by the driver as invalid device (-ENODEV). Simplify probe to read stored timeout value, set it to a sane default if it is bogus, and then program that value unconditionally. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-5-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Be more verbose during firmware updateAndrey Smirnov
Add more error logging to ziirave_firm_upload() for diagnostics. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-4-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Be verbose about errors in probe()Andrey Smirnov
The driver is quite silent in case of probe failure, which makes it more difficult to diagnose problem from the kernel log. Add logging to all of the silent error paths ziirave_wdt_probe() to improve that. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-3-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-09-17watchdog: ziirave_wdt: Add missing newlineAndrey Smirnov
Add missing newline. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rick Ramstetter <rick@anteaterllc.com> Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190812200906.31344-2-andrew.smirnov@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157Thomas Gleixner
Based on 3 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [graeme] [gregory] [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema] [hk] [hemahk]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1105 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-05watchdog: ziirave_wdt: drop warning after calling watchdog_init_timeoutWolfram Sang
The core will print out details now. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2017-09-09watchdog: ziirave: constify i2c_device_idArvind Yadav
i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2016-09-23watchdog: ziirave_wdt: Add support to upload the firmware.Enric Balletbo i Serra
This patch adds and entry to the sysfs to start firmware upload process on the specified device with the requested firmware. The uploading of the firmware needs only to happen once per firmware upgrade, as the firmware is stored in persistent storage. If the firmware upload or the firmware verification fails then we print and error message and exit. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2016-07-17watchdog: ziirave_wdt: Correct I2C device id to fix module autoloading.Enric Balletbo i Serra
The I2C core removes the manufacturer prefix from the compatible field so it reports to user-space the uevent i2c:rave-wdt, but this doesn't match with the i2c_device_id (i2c:ziirave-wdt) array so the module is not autoloaded. Correct the I2C device id to match with the reported uevent and fix the module autoloading functionality. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2016-03-01watchdog: ziirave_wdt: Rename "trigger" reset reason "hw watchdog"Martyn Welch
The Zodiac watchdog is implemented on a microcontoller. The reset reason currently labelled "trigger" is not to detect when the watchdog has triggered (as had been initially understood and suggested by the naming), but to inform the reader that the watchdog, which in fact has it's own hardware watchdog, has been reset because the hardware watchdog has triggered. Renaming to "hw watchdog". Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2016-01-11watchdog: ziirave: Use watchdog infrastructure to create sysfs attributesGuenter Roeck
The watchdog core now supports creating driver specific sysfs attributes when creating the watchdog device. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2015-12-28watchdog: Zodiac Aerospace RAVE Switch Watchdog Processor DriverMartyn Welch
This patch adds a driver for the Zodiac Aerospace RAVE Watchdog Procesor. This device implements a watchdog timer, accessible over I2C. Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>