From owner-freebsd-arm@freebsd.org Mon Jul 25 03:37:04 2016 Return-Path: Delivered-To: freebsd-arm@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 0E628BA3657 for ; Mon, 25 Jul 2016 03:37:04 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: from mail-oi0-x243.google.com (mail-oi0-x243.google.com [IPv6:2607:f8b0:4003:c06::243]) (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 C818A117B for ; Mon, 25 Jul 2016 03:37:03 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: by mail-oi0-x243.google.com with SMTP id c199so15565107oig.1 for ; Sun, 24 Jul 2016 20:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=SzIUO9zXtGgmtpq7WsZsJMpwXhzJNVFNKmA+ta699jw=; b=wQD6I3lB1Le27oLaLtddewr5fLA0kmwCxuIDgdexK3C9xJHct1cdNmNCSUGS2Zuw6U 4Wv+kTPokOqXSBQhhVYgXjCVorxReIyxXug8XzHXBkcw0+uSedbcI2dD/VeUQ3l+KvOV n6YAYkxWt9cd0K0lGDs23JIXT7bi6hlnMSbKKgxot9SrTYU3PyGB5z/Fh3KmgZr3is26 lHsEeoN6ykohQlhTG1btvy/N0FlrsBFGj6a0xv6oS0SAe/BnRJ5SnS8seDt930ro0wFg tZ960uhPAa0pwdaKJFCz+TlbRjyVviYOsD0q278AdE/eLYX1ZHkWd7J4W4tD1dyFs+HA fD4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=SzIUO9zXtGgmtpq7WsZsJMpwXhzJNVFNKmA+ta699jw=; b=OKbwu8saPdn/Lxt8pZ7m0lgQU7mUOGMHHrtsXs1l0XbgfLK6jx7IXKx0WEObvfUIG1 m3FdJ/Rh4zFq0JhZ/LWnGMjotIWsYc61bBaVMv9a4g/2IFQ4pBNdcg91cge7gEvQk3uW 5hXybdtXUYeE6T7qVqhGaot21Kqo0kzo8k81ItFJjGaCX0GvGYHxrnnjpIe1hAbxh/WD gjIiM+d+Ftq7Vzr88qn97AyRvuqBv3y6/a8L1k13eq+bAXkClRYrzwZ/do8o0GSOYm2z ndY2IqJeuXG6mBdHZZglk51P1+sfYBS/4tvohD7lm/MFx3t6F8NnXEh9xxHnTHsSMJlu BqZg== X-Gm-Message-State: AEkoouuUUdqqeJ+xujD2QG7Psbs+g0pk9pjDwGDJ7nF49kM/jdoj+8tvOLcPb+rWR1V6jPo6QlKgeUNOY3qR5Q== X-Received: by 10.202.224.198 with SMTP id x189mr8279544oig.169.1469417822840; Sun, 24 Jul 2016 20:37:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.20.8 with HTTP; Sun, 24 Jul 2016 20:37:02 -0700 (PDT) In-Reply-To: References: From: Lee D Date: Sun, 24 Jul 2016 23:37:02 -0400 Message-ID: Subject: Re: Questions about writing custom boot loader, Zynq, Zybo To: freebsd-arm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2016 03:37:04 -0000 On Sun, Jul 24, 2016 at 11:43 AM, Thomas Skibo via freebsd-arm < freebsd-arm@freebsd.org> wrote: > > > > > 3. Is there anything special about how the Zynq is configured in > > ps7_init.c? > > Absolutely. ps7_init.c sets up all the clocks and DDR parameters and is > very board specific. This might be why you=E2=80=99re having problems wi= th the > RS232 port. The clock settings may not match the clock values in the dtb= . > I was able to track down my boot hang to the mmc_wait_for_req() function in src/sys/dev/mmc/mmc.c. It gets stuck in an msleep call waiting for a mutex to be released... I think... the call looks like: while ((req->flags & MMC_REQ_DONE) =3D=3D 0) { msleep(req, &sc->sc_mtx, 0, "mmcreq", 0); } It's not spinning in that while loop, it just never returns from msleep(). I'm not sure if this is a timer problem or an MMC driver problem. I've tried setting the Zynq SD controller to the same register values it has when booting normally with u-boot, but to no avail. Does u-boot do any important configuration to the timers or to the SD controller? Suggestions welcome... I'm not sure how to continue debugging this. Thanks, Lee