From tomek.cedro@gmail.com  Sun Feb 10 16:24:31 2013
Return-Path: <tomek.cedro@gmail.com>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id C4ADC9D2
	for <bug-followup@freebsd.org>; Sun, 10 Feb 2013 16:24:31 +0000 (UTC)
	(envelope-from tomek.cedro@gmail.com)
Received: from mail-qe0-f49.google.com (mail-qe0-f49.google.com [209.85.128.49])
	by mx1.freebsd.org (Postfix) with ESMTP id 38DF66A6
	for <bug-followup@freebsd.org>; Sun, 10 Feb 2013 16:24:31 +0000 (UTC)
Received: by mail-qe0-f49.google.com with SMTP id 5so2263060qea.22
        for <bug-followup@freebsd.org>; Sun, 10 Feb 2013 08:24:24 -0800 (PST)
Received: by 10.49.71.204 with HTTP; Sun, 10 Feb 2013 08:16:13 -0800 (PST)
Message-Id: <CAFYkXjksX-Co3v+L67eb_4TODcFwFWFb=b+D3H8-P9A5usE8Jg@mail.gmail.com>
Date: Sun, 10 Feb 2013 17:16:13 +0100
From: CeDeROM <cederom@tlen.pl>
Sender: tomek.cedro@gmail.com
To: Hans Petter Selasky <hselasky@c2i.net>
Cc: bug-followup@freebsd.org
In-Reply-To: <201302101100.41499.hselasky@c2i.net>
Subject: Re: Fwd: kern/175893: kernel/usb/uftdi patch to recognise a KT-LINK
 ft2232 based device
References: <201302061749.r16Hn7Mi058214@red.freebsd.org>
	<201302061750.r16Ho0mr077614@freefall.freebsd.org>
	<CAFYkXjm-0rFh4_1LJ9G4_OKMfhU2Ajdh-4W+_x7ogtetb_D=mw@mail.gmail.com>
	<201302101100.41499.hselasky@c2i.net>

>Number:         176014
>Category:       kern
>Synopsis:       Re: kern/175893: kernel/usb/uftdi patch to recognise a KT-LINK ft2232 based device
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 10 16:30:00 UTC 2013
>Closed-Date:    Sun Feb 10 21:22:46 UTC 2013
>Last-Modified:  Sun Feb 10 21:22:58 UTC 2013
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 On Sun, Feb 10, 2013 at 11:00 AM, Hans Petter Selasky <hselasky@c2i.net> wrote:
 > Have you tested your patch? Are you sure this driver uses the kernel uftdi
 > driver and not libftdi?
 >
 > Does your application work without your patch?
 
 Hello Hans :-) UFTDI driver is used to access RS232 channel(s) of
 FT2232H chip inside KT-LINK with /dev/cuaUn device. KT-LINK has two
 channels - one for RS232 port and second for JTAG/SWD/(...).
 Applications using libftdi and libusb use the JTAG port of the KT-LINK
 interface. Still it is possible to use RS232 channel as a serial
 console with Minicom. My patch adds support for KT-LINK interface in
 uftdi serial console driver to be used as /dev/cuaUn. UTFDI driver
 creates two nodes for both channels (i.e. /dev/cuaU3 and /dev/cuaU4).
 
 Yes I have tested my patch - it is working well with Minicom and
 different devices as serial port usb dongle. Still I can use both
 RS232 channel and JTAG channel at the same time with one KT-LINK
 interface:
 
 <= TESTING STARTS
 
 => DMESG:
 
 ugen1.6: <Kristech> at usbus1
 uftdi0: <KT-LINK> on usbus1
 uftdi1: <KT-LINK> on usbus1
 
 
 => UrJTAG / LIBFTDI:
 
 % ./jtag
 
 UrJTAG 0.10 #
 Copyright (C) 2002, 2003 ETC s.r.o.
 Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors
 
 UrJTAG is free software, covered by the GNU General Public License, and you are
 welcome to change it and/or distribute copies of it under certain conditions.
 There is absolutely no warranty for UrJTAG.
 
 warning: UrJTAG may damage your hardware!
 Type "quit" to exit, "help" for help.
 
 jtag> cable kt-link
 Connected to libftdi driver.
 nSRST pin state is high...
 KT-LINK JTAG Mode Initialization OK!
 jtag> detect
 jtag> freq 100000
 Setting TCK frequency to 100000 Hz
 jtag> detect
 IR length: 9
 Chain length: 2
 Device Id: 00111011101000000000010001110111 (0x3BA00477)
   Unknown manufacturer! (01000111011)
 (/tmp/openocd/target/share/urjtag/MANUFACTURERS)
 Device Id: 00000110010000010100000001000001 (0x06414041)
   Unknown manufacturer! (00000100000)
 (/tmp/openocd/target/share/urjtag/MANUFACTURERS)
 
 
 => MINICOM/UFTDI:
 
 Welcome to minicom 2.6.1
 
 OPTIONS: I18n
 Compiled on Oct 14 2012, 07:52:31.
 Port /dev/cuaU4
 
 Press CTRL-A Z for help on special keys
 
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
 <= TESTING ENDS
 
 No Minicom does not work with KT-LINK without my patch because system
 does not recognize this device as FTDI chip that can be used with
 UFTDI driver. My patch adds necessary identification numbers, no other
 modifications.
 
 ! The only remark is that I can connect to /dev/cuaU3 when this
 channel is already used by LibFTDI, which breaks funcion of the JTAG
 channel/application if active, but I guess this is some kind of
 non-blocking feature of the FreeBSD..? Still it is possible to use
 JTAG channel with LibFTDI and RS232 channel with UFTDI driver
 independently. Also When I shutdown Minicom operating at JTAG channel
 I can again initialize the JTAG channel on the LibFTDI applications
 and use it with no problem.
 
 Best regards :-)
 Tomek
 
 -- 
 CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Sun Feb 10 21:21:21 UTC 2013 
State-Changed-Why:  
Misfiled followup to kern/175893; content migrated. 


Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Feb 10 21:21:21 UTC 2013 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=176014 
>Unformatted:
