Questions about writing custom boot loader, Zynq, Zybo

Lee D embaudarm at gmail.com
Sun Jul 24 22:25:13 UTC 2016


On Sun, Jul 24, 2016 at 11:43 AM, Thomas Skibo via freebsd-arm <
freebsd-arm at 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’re having problems with 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.
>
>
>> Thomas Skibo
> thomasskibo at 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


More information about the freebsd-arm mailing list