From owner-freebsd-arm@freebsd.org Sat May 16 22:13:50 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B86BD2FF441 for ; Sat, 16 May 2020 22:13:50 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gold.funkthat.com [IPv6:2001:470:800b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Pfgd2cjHz45wR for ; Sat, 16 May 2020 22:13:46 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 04GMDi3j008094 (version=TLSv1.2 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sat, 16 May 2020 15:13:44 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 04GMDiN1008092 for freebsd-arm@FreeBSD.org; Sat, 16 May 2020 15:13:44 -0700 (PDT) (envelope-from jmg) Date: Sat, 16 May 2020 15:13:44 -0700 From: John-Mark Gurney To: freebsd-arm@FreeBSD.org Subject: need help w/ Cora-Z7, XC7Z007S Zynq board Message-ID: <20200516221344.GH4213@funkthat.com> Mail-Followup-To: freebsd-arm@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Sat, 16 May 2020 15:13:44 -0700 (PDT) X-Rspamd-Queue-Id: 49Pfgd2cjHz45wR X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jmg@gold.funkthat.com has no SPF policy when checking 2001:470:800b::2) smtp.mailfrom=jmg@gold.funkthat.com X-Spamd-Result: default: False [-2.25 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; IP_SCORE(-1.46)[ipnet: 2001:470::/32(-4.11), asn: 6939(-3.16), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; TO_DN_NONE(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-0.995,0]; DMARC_NA(0.00)[funkthat.com]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[jmg@funkthat.com,jmg@gold.funkthat.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[jmg@funkthat.com,jmg@gold.funkthat.com]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 22:13:50 -0000 Hello, Recently got the Cora-Z7 board, and want to get FreeBSD working on it. With a bit of help from manu, I managed to get FreeBSD booting on it, but running into issues w/ the clocks. The issue is that I need to set the clock-frequency for the global-clock, otherwise I don't have an event timer and the kernel panics. I configured it in the dts: https://www.funkthat.com/~jmg/FreeBSD/cora-z7/zynq-coraz7.dts But the issue is that time passes approximately 6.25x faster than it should. This was measured via pinging a remote host on the board, and via another machine, observing that it was about 6.23x difference, and noticing that 50MHz/8MHz is 6.25x. The 50 MHz speed was selected because the Cora-Z7 user guide says that the PS_CLK block is provided a 50 MHz clock, and the dts provided by Digilent uses 50 MHz as well: https://github.com/Digilent/u-boot-digilent/blob/master/arch/arm/dts/zynq-coraz7.dts#L41 If I change the clock to 8MHz, it hangs at: mmcsd0: 16GB at mmc0 50.0MHz/4bit/65535-block WARNING: WITNESS option enabled, expect reduced performance. Root mount waiting for: CAM Anyone have any suggestions on how to proceed? This is using the latest 13.0-CURRENT GENERICSD snapshot image. To boot, I did have to use the vendor supplied u-boot, as getting digilent's u-boot to compile wasn't easy as they haven't updated to the current version of OpenSSL, and porting their changes over mainline u-boot was going to be a bit of work. I was able to extract the boot.bin from their BSP package, and put that on the FAT file system (I did end up reformatting the FAT to FAT32, but not sure if this was needed or not), along w/ the above mentioned dts compiled to dtb. U-boot commands: fatload mmc 0 $netstart EFI/BOOT/bootarm.efi bootefi $netstart and then loader fails to properly get the boot device set: Command line arguments: l Image base: 0x10000000 EFI version: 2.05 EFI Firmware: Das U-boot (rev 0.00) Console: comconsole (0) Load Path: /uEnv.txt Load Device: sdhci@e0100000.blk Startup error in /boot/lua/loader.lua: LUA ERROR: cannot open /boot/lua/loader.lua: no such file or directory. so, I have to manually load the kernel and dtb with the following commands: set currdev=disk0s2a load /boot/kernel/kernel set currdev=disk0s1 set hw.ncpu=1 load -t dtb dtb/zynq-coraz7.dtb set currdev=disk0s2a boot The hw.ncpu=1 is necessary as we haven't committed the review that detects number of cpus by the registers: https://reviews.freebsd.org/D14429 dmesg: https://www.funkthat.com/~jmg/FreeBSD/cora-z7/dmesg.cora.z7.txt -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."