From owner-svn-src-all@freebsd.org Wed Jun 13 13:30:46 2018 Return-Path: Delivered-To: svn-src-all@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 C4BF7100B464 for ; Wed, 13 Jun 2018 13:30:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (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 51C168328D for ; Wed, 13 Jun 2018 13:30:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id p185-v6so3834644itp.4 for ; Wed, 13 Jun 2018 06:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=J1sMxIAwDBO3alSLuVfb4JrbmY7i904BAu0jM/Ecd04=; b=sNqNb5VKT04PvYI+8ApFcozjh7bePgoTfHuSYgPqzEm2gpba/3VdQWS44D5xH5b9uH mS2ne0k2rHpgh7SbFaJ/dubD7JdPhyiP68CTT4omY43nIdJ6Ir5zH4Agvz7nkSfhww0c OXlfw8akQqBWDH7xZ+/v3bSPw9SN6L9bulp32CgaHymy9CVb13usMUmSL/ZW5UFJFuuW jLh0jd3+pVjzxnWZjKIWJ4GzhikfG4+bkhLxwkQbYN1CnpSIY301IyFCLXn8mexTczH/ 4rE1JcOk7q5lRg5DVJ1S2QKJeK/Le/VudxohNks+5VfTeh/iXOVDupWMqerMn3I+v+c6 LnNw== 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=J1sMxIAwDBO3alSLuVfb4JrbmY7i904BAu0jM/Ecd04=; b=cad98jwZid5WeV+uoYXe3EeRbqDc9VDlUmNmrsn52Fg2IzAZrx7e+qkl9ffRiohQRf b53f2Hz14pnluHRPffcoJbqzuS45RZMR19p6fAF8Jj5SMm6cTBPLp2Wbzq5pZIWovZjk v8TdiiMEWmGEkj+wYdMdpi8D/rS4cuVcLF0nfHRCQjJyyrhPTqVpQE4SyfUhCYIClegx nYej0+AaX8g1OZfnr/clB6HnjdhfvPP05ZyHHQy1wTAkDEKqBKw699iILS9TIOaJJYce xzUaMln57laFIXTS5rt5obKJmF29en7WGtTGgCf4vQK+nYJI4KQDQaL9br/sADct58u1 2FFw== X-Gm-Message-State: APt69E2Fvw5DvpIepoaZtxyVElvpyw5i0KqjG741jaotV/vO02zT9lhw wMw8PVcDV1c7m4JBc8+g8FGl943RNh4IvwH2F5Xf3w== X-Google-Smtp-Source: ADUXVKIDJM7s+RWD89SdwiMF0yjUj69jC84P/7tIjQCPs9uj5f3TqHaHR1Z+pUhDY3eaw6KDEY8tQy6zZwP8A0Yd6Y0= X-Received: by 2002:a24:7c8d:: with SMTP id a135-v6mr4600571itd.73.1528896645550; Wed, 13 Jun 2018 06:30:45 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 06:30:44 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806121645.w5CGjrMM099365@repo.freebsd.org> <941a15be461602ae3d723c3f30804248@megadrive.org> From: Warner Losh Date: Wed, 13 Jun 2018 07:30:44 -0600 X-Google-Sender-Auth: 3oKCDpfCHV0-vrwB9F6oXiDqEO8 Message-ID: Subject: Re: svn commit: r335004 - head/release/tools To: Edward Napierala Cc: Emmanuel Vadot , 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-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 13:30:47 -0000 On Wed, Jun 13, 2018 at 6:39 AM, Edward Napierala wrote: > 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. > Right, and console is an overloaded term. Here it just means 'tty marked by the kernel that gets a getty started on it automatically after it shows up' not 'the device that gets all the kernel I/O.' > + 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? > I don't, but I still have the same reservations at the name overloading... Warner