Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 May 2020 23:38:53 -0700
From:      John-Mark Gurney <jmg@funkthat.com>
To:        freebsd-arm@FreeBSD.org
Subject:   Re: need help w/ Cora-Z7, XC7Z007S Zynq board
Message-ID:  <20200517063853.GI4213@funkthat.com>
In-Reply-To: <20200516221344.GH4213@funkthat.com>
References:  <20200516221344.GH4213@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
John-Mark Gurney wrote this message on Sat, May 16, 2020 at 15:13 -0700:
> 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

After a bit of digging, I think I have found the solution.  It looks
like slcr is suppose to be set to the frequency of the ps clk, which
is 50 MHz, and then the global_timer is suppose to be set to half the
CPU clock frequency, which on this board is, I believe, 650 MHz, so
using the following in the dts made things work:
&slcr {
	clock-frequency = <50000000>;
};

&global_timer {
	clock-frequency = <325000000>;
};

ping times look good sane (after I realized that wifi has a tad slower),
and I've been running ntpd for over 20 minutes, and it hasn't bombed
out yet, and the offset/jitter look good.

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200517063853.GI4213>