Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Dec 2015 14:55:55 -0800
From:      Thomas Skibo <thomasskibo@yahoo.com>
To:        freebsd-arm@freebsd.org
Subject:   Re: u-boot and ubldr on arm64
Message-ID:  <E613E62C-24C9-4216-BD78-4D4AD57F3C17@yahoo.com>

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

Wow.  That came together fast.  It was only a matter of getting a few =
drivers properly configured into the kernel and getting the right =
entries in the device tree.  Hats off to you guys working on the arm64 =
implementation.

=E2=80=94
Thomas Skibo
thomasskibo@yahoo.com


FreeBSD booting on a simulated Zynq UltraScale =E2=80=A6

Script started on Fri 18 Dec 2015 02:36:06 PM PST
=1B]0;skibo@robleda: =
~/Projects/Zynq/qemu=07skibo@robleda:~/Projects/Zynq/qemu$ source GO.txt=20=

WARNING: Image format was not specified for '../debug.qemu/SDCARD.img' =
and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, =
write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
QEMU 2.4.93 monitor - type 'help' for more information
(qemu) c=1B[K
(qemu)=20

U-Boot 2015.07-00006-gd3fba7f-dirty (Dec 18 2015 - 11:17:12 -0800) =
Xilinx ZynqMP

I2C:   ready
DRAM:  1 GiB
Enabling Caches...
EL Level:	EL1
NAND: =20
ERROR:arasan_nand_reset timedout
ERROR:arasan_nand_read_buf timedout:Buff RDY
ERROR:arasan_nand_read_buf timedout:Xfer CMPLT
ERROR:arasan_nand_read_buf timedout:Buff RDY
ERROR:arasan_nand_read_buf timedout:Xfer CMPLT
ERROR:arasan_nand_read_buf timedout:Buff RDY
ERROR:arasan_nand_read_buf timedout:Xfer CMPLT
ERROR:arasan_nand_read_buf timedout:Buff RDY
ERROR:arasan_nand_read_buf timedout:Xfer CMPLT
arasan_nand_init: nand_scan_ident failed
NAND init failed
0 MiB
MMC:   zynq_sdhci: 0
Using default environment

In:    serial
Out:   serial
Err:   serial
Bootmode: JTAG_MODE
SCSI:  SATA link 0 timeout.
AHCI 0001.0000 32 slots 2 ports 1.5 Gbps 0x3 impl SATA mode
flags: ncq only=20
scanning bus for devices...
Found 0 device(s).
Net:   Gem.ff0b0000
Hit any key to stop autoboot:  5 =08=08=08 0=20
ZynqMP> fatload mmc 0 0x1000000 ubldr
reading ubldr
254704 bytes read in 74 ms (3.3 MiB/s)
ZynqMP> setenv fdt_file board.dtb
ZynqMP> bootelf 0x1000000
## Starting application at 0x010000b0 ...
Consoles: U-Boot console =20
Compatible U-Boot API signature found @3df02860

FreeBSD/aarch64 U-Boot loader, Revision 1.2
(skibo@ashbury, Fri Dec 18 12:37:40 PST 2015)

DRAM: 1024MB
Number of U-Boot devices: 2
U-Boot env: loaderdev not set, will probe all devices.
Found U-Boot device: disk
  Probing all disk devices...
  Checking unit=3D0 slice=3D<auto> partition=3D<auto>... good.
Booting from disk0s2a:
=
|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08=
\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08=
-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08=
/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08=
|=08/=08-=08\=08|=08/boot/kernel/kernel data=3D0x5f4a28+0x2f4620 =
/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08=
|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08=
\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08syms=3D[0x8+0xc1020\=08|=08=
/=08-=08\=08|=08+0x8+0xbebb3/=08-=08\=08|=08/=08-=08]

Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/boot/kernel/kernel] in 9 seconds... Booting =
[/boot/kernel/kernel]...              =20
\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/boot/kernel/board=
.dtb size=3D0x716
Loaded DTB from file 'board.dtb'.
/=08-=08\=08|=08Kernel entry at 0x0x1201000...
Kernel args: (null)
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2015 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 11.0-CURRENT #13 r292424M: Fri Dec 18 14:30:15 PST 2015
    skibo@ashbury:/usr/obj/arm64.aarch64/usr/src/sys/EP108 arm64
FreeBSD clang version 3.7.0 (tags/RELEASE_370/final 246257) 20150906
WARNING: WITNESS option enabled, expect reduced performance.
CPU(0): ARM Cortex-A53 r0p4
FreeBSD/SMP: Multiprocessor System Detected: 1 CPUs
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
gic0: <ARM Generic Interrupt Controller> mem =
0xf9010000-0xf901ffff,0xf902f000-0xf9030fff,0xf9040000-0xf905ffff,0xf906f0=
00-0xf9070fff on simplebus0
gic0: pn 0x0, arch 0x0, rev 0x0, implementer 0x0 irqs 192
generic_timer0: <ARMv8 Generic Timer> irq 29,30,27,26 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 20000000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 20000000 Hz quality 1000
uart0: <Cadence UART> mem 0xff000000-0xff000fff irq 53 on simplebus1
uart0: console (115200,n,8,1)
uart1: <Cadence UART> mem 0xff010000-0xff010fff irq 54 on simplebus1
cgem0: <Cadence CGEM Gigabit Ethernet Interface> mem =
0xff0b0000-0xff0b0fff irq 89,89 on simplebus1
miibus0: <MII bus> on cgem0
e1000phy0: <Marvell 88E1111 Gigabit PHY> PHY 0 on miibus0
e1000phy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, =
1000baseT-FDX, 1000baseT-FDX-master, auto
e1000phy1: <Marvell 88E1111 Gigabit PHY> PHY 23 on miibus0
e1000phy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, =
1000baseT-FDX, 1000baseT-FDX-master, auto
cgem0: Ethernet address: 00:0a:35:00:01:22
sdhci_fdt0: <Zynq-7000 generic fdt SDHCI controller> mem =
0xff160000-0xff160fff irq 80 on simplebus1
sdhci_fdt0: 1 slot(s) allocated
mmc0: <MMC/SD bus> on sdhci_fdt0
sdhci_fdt1: <Zynq-7000 generic fdt SDHCI controller> mem =
0xff170000-0xff170fff irq 81 on simplebus1
sdhci_fdt1: 1 slot(s) allocated
cryptosoft0: <software crypto>
Timecounters tick every 1.000 msec
IPsec: Initialized Security Association Processing.
mmcsd0: 1GB <SD QEMU! 0.1 SN DEADBEEF MFG 02/2006 by 170 XY> at mmc0 =
26.0MHz/4bit/65535-block
Release APs
APs not started
WARNING: WITNESS option enabled, expect reduced performance.
Trying to mount root from ufs:/dev/mmcsd0s2a [rw,noatime]...
warning: no time-of-day clock registered, system time will not be set =
accurately
/etc/rc: WARNING: hostid: unable to figure out a UUID from DMI data, =
generating a new one
Setting hostuuid: 4e162d3e-a5d7-11e5-8aa7-000a35000122.
Setting hostid: 0x4f90b3ff.
No suitable dump device was found.
Starting file system checks:
/dev/mmcsd0s2a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/mmcsd0s2a: clean, 65088 free (24 frags, 8133 blocks, 0.0% =
fragmentation)
Mounting local file systems:random: unblocking device.
.
Setting hostname: ep108.
Setting up =
harvesting:[UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,K=
EYBOARD,ATTACH,CACHED
Feeding entropy:.
cgem0: link state changed to UP
Starting Network: lo0 cgem0.
lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=3D600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128=20
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2=20
	inet 127.0.0.1 netmask 0xff000000=20
	groups: lo=20
	nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL>
cgem0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu =
1500
	options=3D80008<VLAN_MTU,LINKSTATE>
	ether 00:0a:35:00:01:22
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
	nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Starting devd.
Starting dhclient.
DHCPDISCOVER on cgem0 to 255.255.255.255 port 67 interval 8
DHCPOFFER from 10.0.2.2
DHCPREQUEST on cgem0 to 255.255.255.255 port 67
DHCPACK from 10.0.2.2
bound to 10.0.2.15 -- renewal in 43200 seconds.
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Generating host.conf.
Creating and/or trimming log files.
Setting date via ntp.
18 Dec 22:38:59 ntpdate[411]: step time server 204.9.54.119 offset =
-14.044636 sec
Starting casperd.
Clearing /tmp (X related).
Updating motd:.
Mounting late file systems:.
Generating RSA1 host key.
2048 83:c8:bc:8c:44:42:d1:1f:54:ec:3c:5e:3e:35:b6:da  root@ep108 (RSA1)
Generating RSA host key.
2048 67:0e:ba:8b:ba:17:7f:5a:b3:ee:16:87:45:75:38:dd  root@ep108 (RSA)
Generating DSA host key.
1024 e9:68:09:85:a3:aa:b6:63:6b:ea:56:4e:c7:cc:f6:79  root@ep108 (DSA)
Generating ECDSA host key.
256 07:95:21:95:89:8c:b7:f5:8e:b6:b7:5d:ad:3a:75:a0  root@ep108 (ECDSA)
Generating ED25519 host key.
256 9b:45:c1:ad:ca:ee:97:d1:66:35:05:73:5c:04:21:d4  root@ep108 =
(ED25519)
Performing sanity check on sshd configuration.
Starting sshd.
Starting background file system checks in 60 seconds.

Fri Dec 18 22:43:31 UTC 2015

FreeBSD/arm64 (ep108) (ttyu0)

login: root
FreeBSD 11.0-CURRENT (EP108) #13 r292424M: Fri Dec 18 14:30:15 PST 2015

Welcome to FreeBSD!

Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories:   https://www.FreeBSD.org/security/
FreeBSD Handbook:      https://www.FreeBSD.org/handbook/
FreeBSD FAQ:           https://www.FreeBSD.org/faq/
Questions List: =
https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums:        https://forums.FreeBSD.org/

Documents installed with the system are in the =
/usr/local/share/doc/freebsd/
directory, or can be installed later with:  pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed:  freebsd-version ; uname -a
Please include that output and any error messages when posting =
questions.
Introduction to manual pages:  man man
FreeBSD directory layout:      man hier

Edit /etc/motd to change this login announcement.
root@ep108:~ # ifconfig
cgem0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu =
1500
        options=3D80008<VLAN_MTU,LINKSTATE>
        ether 00:0a:35:00:01:22
        inet 10.0.2.15 netmask 0xffffff00 broadcast 10.0.2.255=20
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3D600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128=20
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2=20
        inet 127.0.0.1 netmask 0xff000000=20
        groups: lo=20
        nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL>
root@ep108:~ # ping 192.18.=08=1B[K=08=1B[K68.1.6
PING 192.168.1.6 (192.168.1.6): 56 data bytes
^C
--- 192.168.1.6 ping statistics ---
9 packets transmitted, 0 packets received, 100.0% packet loss
root@ep108:~ # netstat -r
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            10.0.2.2           UGS       cgem0
10.0.2.0/24        link#1             U         cgem0
10.0.2.15          link#1             UHS         lo0
localhost          link#2             UH          lo0

Internet6:
Destination        Gateway            Flags     Netif Expire
::/96              localhost          UGRS        lo0
localhost          link#2             UH          lo0
::ffff:0.0.0.0/96  localhost          UGRS        lo0
fe80::/10          localhost          UGRS        lo0
fe80::%lo0/64      link#2             U           lo0
fe80::1%lo0        link#2             UHS         lo0
ff02::/16          localhost          UGRS        lo0
root@ep108:~ # ping 10.0.2.2
PING 10.0.2.2 (10.0.2.2): 56 data bytes
64 bytes from 10.0.2.2: icmp_seq=3D0 ttl=3D255 time=3D17.714 ms
64 bytes from 10.0.2.2: icmp_seq=3D1 ttl=3D255 time=3D8.325 ms
64 bytes from 10.0.2.2: icmp_seq=3D2 ttl=3D255 time=3D19.037 ms
64 bytes from 10.0.2.2: icmp_seq=3D3 ttl=3D255 time=3D7.879 ms
64 bytes from 10.0.2.2: icmp_seq=3D4 ttl=3D255 time=3D16.681 ms
64 bytes from 10.0.2.2: icmp_seq=3D5 ttl=3D255 time=3D31.147 ms
64 bytes from 10.0.2.2: icmp_seq=3D6 ttl=3D255 time=3D10.499 ms
64 bytes from 10.0.2.2: icmp_seq=3D7 ttl=3D255 time=3D8.870 ms
64 bytes from 10.0.2.2: icmp_seq=3D8 ttl=3D255 time=3D22.995 ms
64 bytes from 10.0.2.2: icmp_seq=3D9 ttl=3D255 time=3D18.287 ms
64 bytes from 10.0.2.2: icmp_seq=3D10 ttl=3D255 time=3D8.224 ms
64 bytes from 10.0.2.2: icmp_seq=3D11 ttl=3D255 time=3D8.943 ms
64 bytes from 10.0.2.2: icmp_seq=3D12 ttl=3D255 time=3D7.763 ms
64 bytes from 10.0.2.2: icmp_seq=3D13 ttl=3D255 time=3D8.771 ms
64 bytes from 10.0.2.2: icmp_seq=3D14 ttl=3D255 time=3D7.967 ms
^C
--- 10.0.2.2 ping statistics ---
15 packets transmitted, 15 packets received, 0.0% packet loss
round-trip min/avg/max/stddev =3D 7.763/13.540/31.147/6.862 ms
root@ep108:~ #=20
root@ep108:~ # sysctl -a | grep cgem
dev.miibus.0.%parent: cgem0
dev.cgem.0.stats.rx_frames_udp_csum_errs: 0
dev.cgem.0.stats.rx_frames_tcp_csum_errs: 0
dev.cgem.0.stats.rx_frames_ip_hdr_csum_errs: 0
dev.cgem.0.stats.rx_overrun_errs: 0
dev.cgem.0.stats.rx_resource_errs: 0
dev.cgem.0.stats.rx_align_errs: 0
dev.cgem.0.stats.rx_symbol_errs: 0
dev.cgem.0.stats.rx_frames_length_errs: 0
dev.cgem.0.stats.rx_frames_fcs_errs: 0
dev.cgem.0.stats.rx_frames_jabber: 0
dev.cgem.0.stats.rx_frames_oversize: 0
dev.cgem.0.stats.rx_frames_undersize: 0
dev.cgem.0.stats.rx_frames_1024to1536b: 0
dev.cgem.0.stats.rx_frames_512to1023b: 1291
dev.cgem.0.stats.rx_frames_256to511b: 0
dev.cgem.0.stats.rx_frames_128to255b: 1187
dev.cgem.0.stats.rx_frames_65to127b: 9734
dev.cgem.0.stats.rx_frames_64b: 1069
dev.cgem.0.stats.rx_frames_pause: 0
dev.cgem.0.stats.rx_frames_multi: 0
dev.cgem.0.stats.rx_frames_bcast: 1291
dev.cgem.0.stats.rx_frames: 13321
dev.cgem.0.stats.rx_bytes: 8138301600956416
dev.cgem.0.stats.tx_carrier_sense_errs: 0
dev.cgem.0.stats.tx_deferred_frames: 0
dev.cgem.0.stats.tx_late_collisn: 0
dev.cgem.0.stats.tx_excsv_collisn: 0
dev.cgem.0.stats.tx_multi_collisn: 0
dev.cgem.0.stats.tx_single_collisn: 0
dev.cgem.0.stats.tx_under_runs: 0
dev.cgem.0.stats.tx_frames_1024to1536b: 0
dev.cgem.0.stats.tx_frames_512to1023b: 0
dev.cgem.0.stats.tx_frames_256to511b: 1293
dev.cgem.0.stats.tx_frames_128to255b: 0
dev.cgem.0.stats.tx_frames_65to127b: 12343
dev.cgem.0.stats.tx_frames_64b: 1713
dev.cgem.0.stats.tx_frames_pause: 0
dev.cgem.0.stats.tx_frames_multi: 0
dev.cgem.0.stats.tx_frames_bcast: 3006
dev.cgem.0.stats.tx_frames: 15349
dev.cgem.0.stats.tx_bytes: 7029916570746880
dev.cgem.0._txdefragfails: 0
dev.cgem.0._txdefrags: 0
dev.cgem.0._txdmamapfails: 0
dev.cgem.0._txfull: 0
dev.cgem.0._rxdmamapfails: 0
dev.cgem.0._rxnobufs: 0
dev.cgem.0._rxoverruns: 0
dev.cgem.0.rxhangwar: 1
dev.cgem.0.rxbufs: 256
dev.cgem.0.%parent: simplebus1
dev.cgem.0.%pnpinfo: name=3Dethernet@ff0b0000 compat=3Dcadence,gem
dev.cgem.0.%location:=20
dev.cgem.0.%driver: cgem
dev.cgem.0.%desc: Cadence CGEM Gigabit Ethernet Interface
dev.cgem.%parent:=20
root@ep108:~ #=20
root@ep108:~ # ls
.cshrc          .k5login        .login          .profile
root@ep108:~ # ls /
.cshrc          boot            libexec         root            var
.profile        dev             media           sbin
.snap           entropy         mnt             sys
COPYRIGHT       etc             proc            tmp
bin             lib             rescue          usr
root@ep108:~ # halt
Waiting (max 60 seconds) for system process `vnlru' to stop...done
Waiting (max 60 seconds) for system process `bufdaemon' to stop...done
Waiting (max 60 seconds) for system process `syncer' to stop...
Syncing disks, vnodes remaining...2 1 0 0 0 done
All buffers synced.
lock order reversal:
 1st 0xffffffc002a3fb78 ufs (ufs) @ /usr/src/sys/kern/vfs_mount.c:1224
 2nd 0xffffffc002a3f5f0 syncer (syncer) @ =
/usr/src/sys/kern/vfs_subr.c:2604
stack backtrace:
#0 0xffffff8000221ec8 at witness_debugger+0x68
#1 0xffffff80001aa1e4 at __lockmgr_args+0x980
#2 0xffffff8000468da0 at VOP_LOCK1_APV+0xf8
#3 0xffffff80002836f4 at _vn_lock+0x80
#4 0xffffff8000275a20 at vputx+0x1ac
#5 0xffffff800026dd9c at dounmount+0x410
#6 0xffffff8000276f14 at vfs_unmountall+0x7c
#7 0xffffff800025a120 at bufshutdown+0x390
#8 0xffffff80001cc090 at kern_reboot+0x190
#9 0xffffff80001cbe94 at sys_reboot+0x38c
#10 0xffffff800045bd9c at do_el0_sync+0x474
#11 0xffffff800044a9d0 at handle_el0_sync+0x64
lock order reversal:
 1st 0xffffffc002a3fb78 ufs (ufs) @ /usr/src/sys/kern/vfs_mount.c:1224
 2nd 0xffffffc002a3f9a0 devfs (devfs) @ =
/usr/src/sys/ufs/ffs/ffs_vfsops.c:1375
stack backtrace:
#0 0xffffff8000221ec8 at witness_debugger+0x68
#1 0xffffff80001aa1e4 at __lockmgr_args+0x980
#2 0xffffff8000468da0 at VOP_LOCK1_APV+0xf8
#3 0xffffff80002836f4 at _vn_lock+0x80
#4 0xffffff8000400bf0 at ffs_flushfiles+0xa0
#5 0xffffff80003e7c14 at softdep_flushfiles+0x2d4
#6 0xffffff8000403350 at ffs_unmount+0x88
#7 0xffffff800026dec0 at dounmount+0x534
#8 0xffffff8000276f14 at vfs_unmountall+0x7c
#9 0xffffff800025a120 at bufshutdown+0x390
#10 0xffffff80001cc090 at kern_reboot+0x190
#11 0xffffff80001cbe94 at sys_reboot+0x38c
#12 0xffffff800045bd9c at do_el0_sync+0x474
#13 0xffffff800044a9d0 at handle_el0_sync+0x64
Uptime: 21m11s

The operating system has halted.
Please press any key to reboot.

(qemu) q=1B[K=1B[Dqu=1B[K=1B[D=1B[Dqui=1B[K=1B[D=1B[D=1B[Dquit=1B[K
=1B]0;skibo@robleda: =
~/Projects/Zynq/qemu=07skibo@robleda:~/Projects/Zynq/qemu$ exit

Script done on Fri 18 Dec 2015 02:43:42 PM PST





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E613E62C-24C9-4216-BD78-4D4AD57F3C17>