/* * AVR power-management chip interface for the Buffalo Linkstation / * Kurobox Platform. * * Author: 2006 (c) G. Liakhovetski * g.liakhovetski@gmx.de * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of * any kind, whether express or implied.
*/ #include <linux/workqueue.h> #include <linux/string.h> #include <linux/delay.h> #include <linux/serial_reg.h> #include <linux/serial_8250.h> #include <linux/of.h> #include <linux/of_address.h> #include <asm/io.h> #include <asm/termbits.h>
staticvoid wd_stop(struct work_struct *unused)
{ constchar string[] = "AAAAFFFFJJJJ>>>>VVVV>>>>ZZZZVVVVKKKK"; int i = 0, rescue = 8; int len = strlen(string);
while (rescue--) { int j; char lsr = in_8(avr_addr + UART_LSR);
if (lsr & (UART_LSR_THRE | UART_LSR_TEMT)) { for (j = 0; j < 16 && i < len; j++, i++)
out_8(avr_addr + UART_TX, string[i]); if (i == len) { /* Read "OK" back: 4ms for the last "KKKK"
plus a couple bytes back */
msleep(7);
printk("linkstation: disarming the AVR watchdog: "); while (in_8(avr_addr + UART_LSR) & UART_LSR_DR)
printk("%c", in_8(avr_addr + UART_RX)); break;
}
}
msleep(17);
}
printk("\n");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.