From owner-svn-src-head@freebsd.org Wed Jun 13 12:39:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA3171006B6C; Wed, 13 Jun 2018 12:39:54 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-vk0-x244.google.com (mail-vk0-x244.google.com [IPv6:2607:f8b0:400c:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60B1D80570; Wed, 13 Jun 2018 12:39:54 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-vk0-x244.google.com with SMTP id s187-v6so1397945vke.9; Wed, 13 Jun 2018 05:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=BaiyBaKuEkmuC18w062ceVfWQGi4S1WnX1t2nZW6rlA=; b=eK+2m3zHcWQ2p+jJom33tL09erVIdsFybzNeJXlDsmW1HH5+ODOC5NMrqUuxbeXt6X MQfA1/8w54uxZMrQNhFkx6byQ/6oU2f90FB1+ztjH7xCX8330zvdP/vQLAC/cqK5FrXc 1a0wYTw/fJIPVY0eREIE+Dyv1jlv0VneA98FTX7cfFtBzISy/Run6cxem6/5g/Kei/D9 lqIV4MWUZHp9JTs3lGqAPyeeSuFi+pPEmCXZis6vl0Oaq7A9rM2D6L9OHNbAGYmxRFwW UYjps26XmQ3gy6AUN2xRLqRWn2tGFdetjEwWRNeTB8CiN6baGejcaZpeR4K8rFQ1F9Pb Cvrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=BaiyBaKuEkmuC18w062ceVfWQGi4S1WnX1t2nZW6rlA=; b=iVufCiCrkIU7ISfYxtuar5huAnMbcBEC/0gY0fizXbCx2S+IclTlz/hk2XccgYFxT1 64nIvLrFkET6NLHOih+kKwPQ63n7Yb+IEtePWgcz0pd0RYoT64QhMoteSA8YS0EoSjWx JxoZAPvGitEX0BTbN+8d9tNRusPLg8DrxuKeIDNkOMNd6uvI9aQBYQuGUSJjFYn89OKY p4cL9QMLqJXps8+Pn+4DOYDBMe0tPNUfSzQqgQRJKFznOy45ucRgoND4GH4Ysk29IyPg yH3UHF/n2+UXvxcEnSKUTnqVriX86h+Odo+lwZUgSOctqDfBo5CZxi0dTzgCdoY5RFbM Ad/w== X-Gm-Message-State: APt69E1Qtlpao4eJfCIKn0jPEb0yafni/tbrrhfhsJnWQHZ2ZzuUScrN Ww+DC3WlcgPIeTgrGYkas2dixhiEh6CWRgUydcY= X-Google-Smtp-Source: ADUXVKKcd3LBBp6oLPiHCozTkLYinAQyAs8oAF/tQSxybws+snXdOTnSdqijHcTX6jJtEuTAsrJk9WNzeQ/HjZfTqzs= X-Received: by 2002:a1f:1c15:: with SMTP id c21-v6mr2925652vkc.137.1528893593712; Wed, 13 Jun 2018 05:39:53 -0700 (PDT) MIME-Version: 1.0 Sender: etnapierala@gmail.com Received: by 2002:ab0:12c2:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 05:39:52 -0700 (PDT) In-Reply-To: <941a15be461602ae3d723c3f30804248@megadrive.org> References: <201806121645.w5CGjrMM099365@repo.freebsd.org> <941a15be461602ae3d723c3f30804248@megadrive.org> From: Edward Napierala Date: Wed, 13 Jun 2018 13:39:52 +0100 X-Google-Sender-Auth: SsIQnQGJtuoqMEkcPDHLEWAvKok Message-ID: Subject: Re: svn commit: r335004 - head/release/tools To: Emmanuel Vadot Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 12:39:55 -0000 2018-06-13 12:43 GMT+01:00 Emmanuel Vadot : > On 2018-06-12 18:45, Edward Tomasz Napierala wrote: > >> Author: trasz >> Date: Tue Jun 12 16:45:52 2018 >> New Revision: 335004 >> URL: https://svnweb.freebsd.org/changeset/base/335004 >> >> Log: >> Enable USB OTG serial terminal on ARM SD card images. This configures >> the system to make use of USB device mode / USB OTG to provide a >> "virtual >> serial port" on release images. >> >> Reviewed by: gjb@ >> MFC after: 2 weeks >> Relnotes: yes >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D15602 >> >> Modified: >> head/release/tools/arm.subr >> >> Modified: head/release/tools/arm.subr >> ============================================================ >> ================== >> --- head/release/tools/arm.subr Tue Jun 12 16:44:13 2018 (r335003) >> +++ head/release/tools/arm.subr Tue Jun 12 16:45:52 2018 (r335004) >> @@ -92,6 +92,41 @@ arm_create_user() { >> return 0 >> } >> >> +arm_setup_usb_otg() { >> + # Set up virtual serial port over USB OTG / device mode. >> + echo >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo '# Required for USB OTG virtual serial port.' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo 'notify 100 {' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo ' match "system" "DEVFS";' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo ' match "subsystem" "CDEV";' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo ' match "type" "CREATE";' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo ' match "cdev" "ttyU[0-9]+";' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo ' action "/sbin/init q";' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> + echo '};' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/devd.conf >> > > This will be wiped after the first update, better create > /etc/devd/otg_serial.conf > Thanks, I'll look into that. > + echo '# USB OTG virtual serial port' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys >> + echo 'ttyU0 "/usr/libexec/getty 3wire" vt100 >> onifconsole secure' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys >> + echo 'ttyU1 "/usr/libexec/getty 3wire" vt100 >> onifconsole secure' \ >> + >> ${CHROOTDIR}/${DESTDIR}/etc/ttys >> > > If I have no OTG port and a usb<->uart plugged into my board that will > give weird result no ? > No, because that port won't be marked as console. This only applies to the "virtual" OTG serial ports. > + echo '# Configure USB OTG; see usb_template(4).' \ >> + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf >> + echo 'hw.usb.template=3' \ >> + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf >> + echo 'umodem_load="YES"' \ >> + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf >> > > I'm not a big fan of always enabling this functionality. Do you have a > board that have no uart but an otg port ? > I don't, but this makes it possible to use OTG-enabled boards without using the console cable - having to check the pinouts, making sure the voltage is right etc. Do you see some problems this might cause?