From owner-freebsd-arm@freebsd.org Mon Aug 6 07:00:30 2018 Return-Path: Delivered-To: freebsd-arm@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 E678110709DC for ; Mon, 6 Aug 2018 07:00:29 +0000 (UTC) (envelope-from freebsd-arm@sentry.org) Received: from shadow.sentry.org (shadow.sentry.org [210.8.237.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "shadow.sentry.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D4DF8BE28 for ; Mon, 6 Aug 2018 07:00:28 +0000 (UTC) (envelope-from freebsd-arm@sentry.org) Received: from shadow.sentry.org (localhost [127.0.0.1]) by shadow.sentry.org (8.15.2/8.15.2) with ESMTP id w7670OpW084216 for ; Mon, 6 Aug 2018 17:00:24 +1000 (AEST) (envelope-from freebsd-arm@sentry.org) Subject: Re: usb-only rpi 3b+ (+UART foo) To: freebsd-arm@freebsd.org References: <20180806042122.GD30738@phouka1.phouka.net> From: Trev Message-ID: <74185d99-25d3-a7d3-3569-f7f917298612@sentry.org> Date: Mon, 6 Aug 2018 17:00:24 +1000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 MIME-Version: 1.0 In-Reply-To: <20180806042122.GD30738@phouka1.phouka.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (shadow.sentry.org [0.0.0.0]); Mon, 06 Aug 2018 17:00:24 +1000 (AEST) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 07:00:30 -0000 John Kennedy wrote on 08/06/18 14:21: > I'm trying to boot using only USB (no SD card). Seems like it should be easy. > > Booted up via my SD card with the USB drive attached, I can see and use it easily: > > # usbconfig > ugen0.1: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA) > ugen0.2: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (2mA) > ugen0.3: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (2mA) > ugen0.4: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA) > ugen0.5: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (98mA) > --> ugen0.6: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA) > > The RPI doesn't get the green boot-light or the rainbow screen. So low-level > stuff is obviously AWOL. I've put program_usb_boot_mode=1 into the config.txt, > but can't verify it with vcgencmd since that won't compile on arm64 (I haven't > tried burning raspbian and seeing if they have a working port to verify). I didn't need to add anything to the config.txt file for my RPi2 to attempt to boot from USB instead of the micro-SD card. The SD card kept being assigned as disk2, with the USB memory keys taking up disk0 and disk1, and then the system would unsuccessfully try booting from disk0 and finding no kernel file as that happened to be the /usr file system. After much google-fu, the workaround I found was to halt the boot at the uboot loader prompt (you have two seconds) and then: setenv loaderdev disk2 saveenv boot The above creates a persistent uboot.env file, so no manual intervention is needed again (unless the number of USB memory keys changes). This might help in your situation with appropriate disk number tweak. > As a real disk, it's power light comes up delayed. It seems like it should be > lit before 5-seconds, but I don't know if that is enough for the RPI to try > and enumerate it. Currently I'm trying to divide and conquer by putting the > MSDOS boot partition on an SD card and then boot USB off of that, or at least > try to figure out what is wrong from there. I recall adding a 15 second delay (kern.cam.boot_delay="15000") in bootloader.conf.local to avoid USB memory device enumeration issues. > So my USB console cable finally arrived and I plugged it in: > > kernel: ugen0.4: at usbus0 > kernel: uslcom0 on uhub0 > kernel: uslcom0: on usbus0 > > Connecting via this from my amd64 FreeBSD box: > > screen /dev/cuaU0 115200 > > It's dropping some characters, so hopefully I won't add typos: [chomp] > If anybody has some suggestions on how to get that cable to not murder the > serial output (from the RPI), that would be helpful. The input (to RPI) seems > totally fine looking at the HDMI console output, but what comes back is very > spotty (lots of dropped characters, don't see mangling). In any case: [chomp] > [cat /boot/msdos/config.txt] > arm_control=0x200 > dtparam=audio=on,i2c_arm=on,spi=on > dtoverlay=mmc > dtoverlay=pwm > dtoverlay=pi3-disable-bt > device_tree_address=0x4000 > kernel=u-boot.bin > > program_usb_boot_mode=1 > enable_uart=1 Did you add the enable_uart=1 too? I made no change to config.txt to get console output (and I am also using a Silicon Labs CP2102 USB to UART Bridge Controller on my RPi3B+). I had no dropped characters, using screen on macOS. [Sorry I can't check - I'm currently interstate for a few more days]