Date: Mon, 2 Jul 2012 14:37:07 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 213777 for review Message-ID: <201207021437.q62Eb7FO062263@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@213777?ac=10 Change 213777 by rwatson@rwatson_svr_ctsrd_mipsbuild on 2012/07/02 14:36:44 Define a kernel option to disable console-level flow control for writes in the Altera JTAG UART driver, and set in various BERI kernel configurations. In the future we will try to do something more interesting with the AC bit. This doesn't affect the high-level tty driver, which exposes flow control up the stack, but should prevent the boot from stalling when JTAG is not connected. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/conf/options.mips#5 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4_MDROOT#5 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4_SDROOT#6 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_SIM_MDROOT#2 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/conf/options.mips#5 (text+ko) ==== @@ -47,6 +47,8 @@ ISA_MIPS64 opt_cputype.h ISA_MIPS64v2 opt_cputype.h +ALTERA_JTAG_UART_FC_DISABLE opt_jtag_uart.h + COMPAT_FREEBSD32 opt_compat.h YAMON opt_global.h ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c#3 (text+ko) ==== @@ -31,6 +31,8 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_jtag_uart.h" + #include <sys/param.h> #include <sys/cons.h> #include <sys/endian.h> @@ -154,6 +156,42 @@ ALTERA_JTAG_UART_CONTROL_OFF))); } +static inline void +aju_cons_control_write(uint32_t v) +{ + + mips_iowrite_uint32le(mips_phys_to_uncached(BERI_UART_BASE + + ALTERA_JTAG_UART_CONTROL_OFF), v); +} + +/* + * Routines to query (and clear) the AC bit, which indicates that a JTAG + * client has polled since it was last cleared. + */ +__unused static int +aju_cons_ac_get(void) +{ + uint32_t v; + + AJU_CONSOLE_LOCK_ASSERT(); + + v = aju_cons_control_read(); + return ((v & ALTERA_JTAG_UART_CONTROL_AC) != 0); + +} + +__unused static int +aju_cons_ac_clear(void) +{ + uint32_t v; + + AJU_CONSOLE_LOCK_ASSERT(); + + v = aju_cons_control_read(); + v &= ~ALTERA_JTAG_UART_CONTROL_AC; + aju_cons_control_write(v); +} + /* * Slightly higher-level routines aware of buffering and flow control. */ @@ -161,8 +199,12 @@ aju_cons_writable(void) { +#ifdef ALTERA_JTAG_UART_FC_DISABLE + return (1); +#else return ((aju_cons_control_read() & ALTERA_JTAG_UART_CONTROL_WSPACE) != 0); +#endif } static int ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4_MDROOT#5 (text+ko) ==== @@ -21,6 +21,8 @@ makeoptions MFS_IMAGE=/local/scratch/rnw24/mdroot.img options ROOTDEVNAME=\"ufs:md0\" +options ALTERA_JTAG_UART_FC_DISABLE + device altera_avgen device altera_jtag_uart device altera_sdcard ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4_SDROOT#6 (text+ko) ==== @@ -14,6 +14,8 @@ options ROOTDEVNAME=\"ufs:altera_sdcard0\" +options ALTERA_JTAG_UART_FC_DISABLE + device altera_avgen device altera_jtag_uart device altera_sdcard ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_SIM_MDROOT#2 (text+ko) ==== @@ -20,6 +20,8 @@ makeoptions MFS_IMAGE=/local/scratch/rnw24/mdroot.img options ROOTDEVNAME=\"ufs:md0\" +options ALTERA_JTAG_UART_FC_DISABLE + device altera_avgen device altera_jtag_uart device altera_sdcard
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207021437.q62Eb7FO062263>