From owner-freebsd-arm@freebsd.org Sun Jul 24 22:25:12 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 F3128BA3FFA for ; Sun, 24 Jul 2016 22:25:12 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::231]) (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 B7C721BF2 for ; Sun, 24 Jul 2016 22:25:12 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: by mail-oi0-x231.google.com with SMTP id l72so229855110oig.2 for ; Sun, 24 Jul 2016 15:25:12 -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 :cc; bh=tZUOruRWc6NENZMCrgB3M3cAgJHpDSWtbQGfRjGhWPI=; b=OTw1C0LTAQ1gt4oEr545KQBqWhnjGnq1h3LRATmv/yugYGng7DleVKsxlK6F5ZTg9G sA+I/NYQUZ99fackkJBsy95nD4DxXOPhay14GtqhKfBntB1qv1lNLUTstvg8v4noAW3t 3Zss/VMI4un2DQaMjs5RcP4dcwUd3YKVqVXCbnERPXg+Sknula9tA32WAHCGVRITN5cl t4xSr1CdGloQQyo/Y5/66bs7eD3dxUrTY+LFHylWxPyPcqQlr04yU0p3lP18YjsqcjYZ 6QfqlVukPq1vX6fSUhsq2NdLXiDhmw1iEz+egSwl+rXFmecq/GiZnY5J8uu3J4U3uADZ 6g8w== 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:cc; bh=tZUOruRWc6NENZMCrgB3M3cAgJHpDSWtbQGfRjGhWPI=; b=dxonETca0XO26TNwSBM4xIjCH0J6qVvjR0xQF4aT2tXzIM2ZvArih57swdNSE1jadG B72Yp0o9xQHqE9sJaGs0LXZzckYo9V1lVAxjq8CRgNgWG7BUCCh8LolrLxhqfIWGKo7o eGAKSBGgIaSfhXFmEEDTFV2EHND/tRrXg4O93xrTXQgmMGDAoL3sahqKvt5wwB7XDbIk K/8NYQyWl5L/jRDDlxImM1WekUYSKkEUsRWbBzAv8JJAowX3i85W+WMRVav2OjNxCBww VPikqF1fLbHXmPEpHplnfGpSQrOf4Jv7KjpivEb3ei4mdbBYlrP3GVjqNP8DMBcWozk7 8+zQ== X-Gm-Message-State: AEkoouuk9XkYpBD8wzq5gTrdN7yga4RHL0SIGvPGuk3wGdBhJUcYwuxZtYR4fchLNHIWVu2lFc/HC/txYcynOg== X-Received: by 10.157.17.251 with SMTP id y56mr7305129oty.144.1469399111941; Sun, 24 Jul 2016 15:25:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.20.8 with HTTP; Sun, 24 Jul 2016 15:25:11 -0700 (PDT) In-Reply-To: References: From: Lee D Date: Sun, 24 Jul 2016 18:25:11 -0400 Message-ID: Subject: Re: Questions about writing custom boot loader, Zynq, Zybo To: Thomas Skibo Cc: 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: Sun, 24 Jul 2016 22:25:13 -0000 On Sun, Jul 24, 2016 at 11:43 AM, Thomas Skibo via freebsd-arm < freebsd-arm@freebsd.org> wrote: > > > > I have the following problems while the kernel is booting: > > > > 1. RS232 port switches to double speed when the kernel starts printing > > (230400 baud instead of 115200 baud). > > This may be due to a clock not getting initialized correctly. See below. > > > > > 2. The ethernet driver cannot find the MAC address > > The ethernet address is set by u-boot. Without an ethernet address, the > driver (cgem) is supposed to pick a random one. > > > > > 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= . > > > > > 4. Is the exact ps7_init.c that Thomas Skibo used for his Zybo binaries > > available anywhere? > > I build the u-boot binaries from sources at > https://github.com/Xilinx/u-boot-xlnx, specifically release v2016.1. The > ps7_init.c and ps7_init.h used are in directory > board/xilinx/zynq/zybo_hw_platform. There are ps7_init.[ch] for other > boards there too. > > > =E2=80=94 > Thomas Skibo > thomasskibo@yahoo.com > > > Thanks for the tips. The RS232 issue was simple. Xilinx (or possibly Digilent) changed the default clock for the serial port from 50MHz to 100MHz. I made the correction in the DTS file and now the baud rate is correct. Do you know if passing a boot params structure in R0 is necessary for the kernel to boot? I still can't seem to get past that timer message. This is what I've done: 1. Made sure I am working with a bare default Zybo config generated in Vivado 2016.2 2. compared my ps_init.[ch] to the one you pointed me to. There were no significant differences except for the RS232 clock rate. I had some MIO pins configured, and my DRAM timings were different. my DRAM works fine with standalone apps so I assume that was a tweak made by Digilent and not an issue. 3. added printf's to inittimecounter() in src/sys/kern/kern_tc.c. It is clear that it completes normally. Also the timer appears to be running. However that function is part of the kernel init sequence (SYSINIT macro), so I don't know what is getting called next. 4. I removed the ehci device from the DTS, and commented out all USB related entries in the zybo kernel config file. Still it freezes after that timer message. So probably not USB related. 5. Checked to make sure that the USB3320 chip is not being held in reset by the GPIO line. My next steps are: 1. keep digging through the kernel and placing printfs to pinpoint where it is failing. 2. try the ps_init.[ch] files you showed me in my project, even though they shouldn't make any difference. 3. try passing a boot params structure in r0. Thanks again for pointing me to the original ps_init files, that was very helpful to be able to see those. Lee