From owner-freebsd-arm@FreeBSD.ORG Mon Mar 17 02:16:48 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16CEC600; Mon, 17 Mar 2014 02:16:48 +0000 (UTC) Received: from mail-la0-x232.google.com (mail-la0-x232.google.com [IPv6:2a00:1450:4010:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 52B7AEF8; Mon, 17 Mar 2014 02:16:47 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id y1so3245706lam.37 for ; Sun, 16 Mar 2014 19:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=uzq1Bn+U489aDslWo7Xgvxt7jr3kghUnU3z6m/cGOx4=; b=l0pxrjgp7g8Zg0kPOnbm7+nB8Us2VuLn0psPlPqrqeGF2gqP4TgmS6EMBv4RKIh90x DUYeBpECpp+zm86vW8tQBcLLWA1oRIUWv3Zm3S8nPrNj47xLG6N9gvj5mh3yI+5IUcS1 y6Zlfma6inagfBVt+jOQsSQBSmk55Y62wiAZRtEFsg6KwZJl+EN1q0aV5TPmfoCuWnaC L9QyqStsQj1+REBSoJY3xQ4T5a9ypN9xn2dX5lpbdQiQxagFRvwieTTj7EXEvsrQasvO yrB6SBMaJV98N+5JyT5j2sZEp6K3nxFnnGcDns0boihka4WBGZRpPCkzdCDS0KDIw784 mVhQ== MIME-Version: 1.0 X-Received: by 10.112.94.229 with SMTP id df5mr6547lbb.36.1395022604794; Sun, 16 Mar 2014 19:16:44 -0700 (PDT) Sender: pkelsey@gmail.com Received: by 10.112.142.10 with HTTP; Sun, 16 Mar 2014 19:16:44 -0700 (PDT) In-Reply-To: References: Date: Sun, 16 Mar 2014 22:16:44 -0400 X-Google-Sender-Auth: wKizg1qUeRKVSOrovzvs2qt1seY Message-ID: Subject: Re: Booting FreeBSD from eMMC on BeagleBone Black From: Patrick Kelsey To: Rui Paulo Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: freebsd-arm X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 02:16:48 -0000 On Sun, Mar 16, 2014 at 9:33 PM, Rui Paulo wrote: > On 16 Mar 2014, at 14:59, Patrick Kelsey wrote: > > > - Improved disk probing support that will now by default find and use the > > first suitable partition among the available storage devices. > > I think this introduced a bug where, if you have a non-responsive boot > device, ubldr will stop and won't try network booting: > > ## Starting application at 0x01000054 ... > Consoles: U-Boot console > Compatible API signature found @1d800a8 > Number of U-Boot devices: 2 > > FreeBSD/armv6 U-Boot loader, Revision 1.2 > (rpaulo@zedfs.local, Fri Mar 14 22:35:47 PDT 2014) > DRAM: 256MB > Unknown device type '' <------------ this is new > Found U-Boot device: disk > Probing all storage devices... > Checking unit=0 slice=0 partition=-1...disk0: read failed, error=1 > > Checking unit=1 slice=0 partition=-1... > Checking unit=2 slice=0 partition=-1... > Checking unit=3 slice=0 partition=-1... > Checking unit=4 slice=0 partition=-1... > Checking unit=5 slice=0 partition=-1... > > can't load 'kernel' > > Type '?' for a list of commands, 'help' for more detailed help. > loader> > > It stops here and doesn't try net0 booting. > > I think the problem is that some of the conditionals in sys/boot/uboot/common/main.c:main() are broken. I believe I sowed the seed for this in the original patch I sent to Ian, which appears to have had an out-of-order set of tests in the disk conditional, which in hindsight turned out to work due to a friendly coincidence (namely disk appearing before net in the devsw). That bad-pattern conditional seems to have gotten munged a bit further and propagated in some of the refactoring Ian did when integrating my patch. I believe sys/boot/uboot/common/main.c, starting around line 442, should look like this: if (strcmp(devsw[i]->dv_name, "disk") == 0 && (load_type == -1 || (load_type & DEV_TYP_STOR))) { if (probe_disks(i, load_type, load_unit, load_slice, load_partition) == 0) break; } if (strcmp(devsw[i]->dv_name, "net") == 0 && (load_type == -1 || (load_type & DEV_TYP_NET))) break; Can you give that a try? -Patrick