From owner-svn-ports-all@freebsd.org Sat Mar 12 13:29:50 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EE33ACD55F; Sat, 12 Mar 2016 13:29:50 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ADB668B; Sat, 12 Mar 2016 13:29:50 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2CDTnsx063316; Sat, 12 Mar 2016 13:29:49 GMT (envelope-from lev@FreeBSD.org) Received: (from lev@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2CDTmIN063310; Sat, 12 Mar 2016 13:29:48 GMT (envelope-from lev@FreeBSD.org) Message-Id: <201603121329.u2CDTmIN063310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lev set sender to lev@FreeBSD.org using -f From: "Lev A. Serebryakov" Date: Sat, 12 Mar 2016 13:29:48 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r410881 - in head/devel/msp430-debug-stack: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Mar 2016 13:29:50 -0000 Author: lev Date: Sat Mar 12 13:29:48 2016 New Revision: 410881 URL: https://svnweb.freebsd.org/changeset/ports/410881 Log: Add support for TI USB debug interfaces. Submitted by: Andre Albsmeier Added: head/devel/msp430-debug-stack/files/mspfet.conf (contents, props changed) head/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_FetControl.cpp (contents, props changed) head/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.cpp (contents, props changed) head/devel/msp430-debug-stack/files/pkg-message.in (contents, props changed) Modified: head/devel/msp430-debug-stack/Makefile head/devel/msp430-debug-stack/pkg-plist Modified: head/devel/msp430-debug-stack/Makefile ============================================================================== --- head/devel/msp430-debug-stack/Makefile Sat Mar 12 13:12:24 2016 (r410880) +++ head/devel/msp430-debug-stack/Makefile Sat Mar 12 13:29:48 2016 (r410881) @@ -2,7 +2,7 @@ PORTNAME= msp430-debug-stack PORTVERSION= 3.05.01.01 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel MASTER_SITES= http://www.ti.com/lit/sw/slac460n/ \ http://www.ti.com/lit/ug/slau320v/:doc1 \ @@ -23,16 +23,21 @@ LIB_DEPENDS= libboost_filesystem.so:${PO BROKEN_FreeBSD_9= does not build (internal compiler error) -USES= compiler:c++11-lib gmake zip:infozip +USES= compiler:c++11-lib dos2unix gmake zip:infozip USE_LDCONFIG= yes WRKSRC= ${WRKDIR}/MSPDebugStack_OS_Package +DOS2UNIX_REGEX= .*\.(cpp|h) MAKE_ARGS+= BOOST_DIR=${LOCALBASE} \ HIDAPI_DIR=${LOCALBASE} MAKE_JOBS_UNSAFE= yes +SUB_FILES+= pkg-message + +REINPLACE_ARGS= -i "" + post-patch: @${FIND} ${WRKSRC}/DLL430_v3/src/TI/DLL430 \ \( -name '*.cpp' -o -name '*.h' \) -print0 | ${XARGS} -0 \ @@ -45,5 +50,7 @@ do-install: ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/slau320v.pdf ${STAGEDIR}${DOCSDIR}/ ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/slau656.pdf ${STAGEDIR}${DOCSDIR}/ + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/devd + ${INSTALL_DATA} ${FILESDIR}/mspfet.conf ${STAGEDIR}${PREFIX}/etc/devd .include Added: head/devel/msp430-debug-stack/files/mspfet.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/msp430-debug-stack/files/mspfet.conf Sat Mar 12 13:29:48 2016 (r410881) @@ -0,0 +1,25 @@ +# +# $FreeBSD$ +# +# Warning: Only a single instance of each FET product is supported +# + +attach 20 { + device-name "umodem[0-9]+"; + match "vendor" "0x2047"; # TI MSPBSL_STANDARD_USB_VID + match "product" "0x001(0|3|4)"; # Products: UIF eZ-FET MSP-FET + match "interface" "0"; # JTAG-Interface + action "cd /dev; p=$product; dn=$device-name; \ + un=$(sysctl -n dev.umodem.${dn#umodem}.ttyname); \ + chmod 666 cua$un; ln -sf cua$un mspfet${p#0x}"; +}; + +notify 20 { + match "system" "USB"; + match "subsystem" "INTERFACE"; + match "type" "DETACH"; + match "vendor" "0x2047"; # TI MSPBSL_STANDARD_USB_VID + match "product" "0x001(0|3|4)"; # Products: UIF eZ-FET MSP-FET + match "interface" "0"; # JTAG-Interface + action "p=$product; rm /dev/mspfet${p#0x}"; +}; Added: head/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_FetControl.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_FetControl.cpp Sat Mar 12 13:29:48 2016 (r410881) @@ -0,0 +1,11 @@ +--- DLL430_v3/src/TI/DLL430/FetControl.cpp.orig 2016-03-12 13:23:34 UTC ++++ DLL430_v3/src/TI/DLL430/FetControl.cpp +@@ -214,7 +214,7 @@ bool FetControl::resetCommunication() + data.push_back(0x00); + this->sendData(data); // reset connection + +- std::this_thread::sleep_for(std::chrono::milliseconds(100)); ++ std::this_thread::sleep_for(std::chrono::milliseconds(300)); + + HalExecElement* el = new HalExecElement(ID_Zero); + el->appendInputData8(STREAM_CORE_ZERO_VERSION); Added: head/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.cpp Sat Mar 12 13:29:48 2016 (r410881) @@ -0,0 +1,42 @@ +--- DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp.orig 2016-03-12 13:23:34 UTC ++++ DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp +@@ -303,6 +303,22 @@ void UsbCdcIoChannel::createCdcPortList( + } + #else + stringstream cdcIdStream; ++ ++#ifdef __FreeBSD__ ++ ++ path p( "/dev" ); ++ if( exists(p) && is_directory(p) ) { ++ ++ cdcIdStream << hex << setfill('0') << "mspfet" << setw(4) << productId; ++ ++ const directory_iterator end; ++ for( directory_iterator it(p); it != end; ++it ) { ++ ++ string dir = it->path().string(); ++ if( dir.find( cdcIdStream.str() ) != string::npos ) { ++ { ++ ++#else + cdcIdStream << hex << setfill('0') << "usb:v" << setw(4) << vendorId << "p" << setw(4) << productId; + + path p("/sys/class/tty/"); +@@ -317,13 +333,14 @@ void UsbCdcIoChannel::createCdcPortList( + string modalias; + int interfaceNumber = -1; + +- ifstream modAliasStream((it->path()/"device/modalias").string().c_str()); ++ std::ifstream modAliasStream((it->path()/"device/modalias").string().c_str()); + modAliasStream >> modalias; + +- ifstream ifNumStream((it->path()/"device/bInterfaceNumber").string().c_str()); ++ std::ifstream ifNumStream((it->path()/"device/bInterfaceNumber").string().c_str()); + ifNumStream >> interfaceNumber; + if (modalias.find(cdcIdStream.str()) == 0 && interfaceNumber == 0) + { ++#endif + const string filename = it->path().filename().string(); + const string portPath = string("/dev/") + filename; + Added: head/devel/msp430-debug-stack/files/pkg-message.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/msp430-debug-stack/files/pkg-message.in Sat Mar 12 13:29:48 2016 (r410881) @@ -0,0 +1,8 @@ +------------------------------------------------------------------------- + + When plugging in FET debuggers a symlink will be created from + the corresponding cuaU device to mspfetXX with XX being the + product number (see mspfet.conf). + Only a single instance of each FET product is supported. + +------------------------------------------------------------------------- Modified: head/devel/msp430-debug-stack/pkg-plist ============================================================================== --- head/devel/msp430-debug-stack/pkg-plist Sat Mar 12 13:12:24 2016 (r410880) +++ head/devel/msp430-debug-stack/pkg-plist Sat Mar 12 13:29:48 2016 (r410881) @@ -8,3 +8,4 @@ include/libmsp430/MSP430_HIL.h lib/libmsp430.so %%PORTDOCS%%%%DOCSDIR%%/slau320v.pdf %%PORTDOCS%%%%DOCSDIR%%/slau656.pdf +etc/devd/mspfet.conf