Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jul 2019 18:12:02 +0200
From:      Milan Obuch <freebsd-arm@dino.sk>
To:        freebsd-arm@freebsd.org
Subject:   Zybo Z7 board running FreeBSD success
Message-ID:  <20190722181202.5d69411e@zeta.dino.sk>

next in thread | raw e-mail | index | archive | help
Hi,

page at http://www.skibo.net/zedbsd/ lists Zybo can run FreeBSD, but
image provided does not work on Zybo Z7 I have. After some struggles I
found a way to do it. My work is based on image provided there and,
with some help from Thomas Skibo, I was able to run it on my board.

There was two troubles caused by some differences of the boards, main
one being different clock speed. I've got DTS from Thomas, which should
work on Z7, but it was not enough. It turned out u-boot need to be
built specifically for Z7 vs. original Zybo. Fortunatelly, we have
sysutils/u-boot-zybo port in our tree and it was easy to modify it for
Z7. Basically, rewrite Makefile zybo -> zybo-z7 and using 2019.01
u-boot sources. Detail on freebsd-uboot mailing list.

For some reason, not yet known, I must set verbose boot to overcome
panic from kernel at start. See serial console output in that case:

Copyright (c) 1992-2018 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
    The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.0-RELEASE r341741 ZEDBOARD arm
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
CPU: ARM Cortex-A9 r3p0 (ECO: 0x00000000)
CPU Features: 
  Multiprocessing, Thumb2, Security, VMSAv7, Coherent Walk
Optional instructions: 
  UMULL, SMULL, SIMD(ext)
LoUU:2 LoC:2 LoUIS:2 
Cache level 1:
 32KB/32B 4-way data cache WB Read-Alloc Write-Alloc
 32KB/32B 4-way instruction cache Read-Alloc
real memory  = 0 (0 MB)
avail memory = 1039699968 (991 MB)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
random: unblocking device.
random: entropy device external interface
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
simplebus1: <Flattened device tree simple bus> on ofwbus0
l2cache0: <PL310 L2 cache controller> mem 0xf02000-0xf02fff irq 0 on simplebus0
l2cache0: cannot allocate IRQ, not using interrupt
l2cache0: Part number: 0x3, release: 0x8
l2cache0: L2 Cache enabled: 512KB/32B 8 ways
gic0: <ARM Generic Interrupt Controller> mem 0xf01000-0xf01fff,0xf00100-0xf001ff on simplebus0
gic0: pn 0x39, arch 0x1, rev 0x2, implementer 0x43b irqs 96
mp_tmr0: <ARM MPCore Timers> mem 0xf00200-0xf002ff,0xf00600-0xf0061f irq 2,3 on simplebus0
Timecounter "MPCore" frequency 333333333 Hz quality 800
Event timer "MPCore" frequency 333333333 Hz quality 1000
zy7_slcr0: <Zynq-7000 slcr block> mem 0-0xfff on simplebus0
zy7_devcfg0: <Zynq devcfg block> mem 0x7000-0x7fff irq 1 on simplebus0
uart0: <Cadence UART> mem 0x1000-0x1fff irq 7 on simplebus1
uart0: console (-1,n,8,1)
ehci0: <Zynq-7000 EHCI USB 2.0 controller> mem 0x2000-0x2fff irq 8 on simplebus1
usbus0: EHCI version 1.0
usbus0: stop timeout
usbus0 on ehci0
gpio0: <Zynq-7000 GPIO driver> mem 0xa000-0xafff irq 10 on simplebus1
gpiobus0: <GPIO bus> on gpio0
gpioc0: <GPIO controller> on gpio0
cgem0: <Cadence CGEM Gigabit Ethernet Interface> mem 0xb000-0xbfff irq 11 on simplebus1
miibus0: <MII bus> on cgem0
rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 0 on miibus0
rgephy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
rgephy1: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 1 on miibus0
rgephy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto
cgem0: Ethernet address: 00:18:3e:02:c1:3c
sdhci_fdt0: <Zynq-7000 generic fdt SDHCI controller> mem 0x100000-0x100fff irq 14 on simplebus1
sdhci_fdt0: 1 slot(s) allocated
mmc0: <MMC/SD bus> on sdhci_fdt0
cryptosoft0: <software crypto>
Timecounters tick every 1.000 msec
usbus0: 480Mbps High Speed USB v2.0
ugen0.1: <Xilinx EHCI root HUB> at usbus0
uhub0: <Xilinx EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
mmcsd0: 16GB <SDHC SD16G 6.1 SN 85E15EE5 MFG 11/2018 by 159 TI> at mmc0 25.0MHz/4bit/65535-block
vm_thread_new: kstack allocation failed
panic: kproc_start: bufdaemon: error 12
cpuid = 0
time = 1
Uptime: 1s
Automatic reboot in 15 seconds - press a key on the console to abort

No idea what's wrong, and why verbose boot 'fixes' (or maybe better
just works around this) a problem. Any hint? Note: real memory being
0 MB is surely an error, but it shows this way when booting verbose
too.

Also our wiki at https://wiki.freebsd.org/FreeBSD/arm/Zedboard should
be updated, it lists Thomas' page has 11-RELEASE images, while in
reality it is 12.0-RELEASE.

For now, what works for me:

- serial console, of course
- ethernet port (I can ssh into and from Zybo Z7)
- USB port (flash disk partitions shown with gpart, could be mounted)
- SD card, booted from it
- gpio should work, at least gpioctl -lv spits a lot lines :)

Currently, nothing else seen. I plan to investigate FPGA possibilities,
too, but that's basically FreeBSD unrelated.

Regards,
Milan



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