Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

NetBSD/evbarm on qemu



Hi folks --

I've made some improvements to the VEXPRESS_A15 kernel over the past few days that makes it somewhat usable under qemu. If you want to try it:

 - Build the VEXPRESS_A15 kernel (netbsd.ub) from a -current source tree.
 - Install the sysutils/dtb-arm-vexpress package from pkgsrc and grab a
   copy of vexpress-v2p-ca15-tc1.dtb from /usr/pkg/share/dtb/arm.
 - Grab a copy of armv7.img.gz from a build and uncompress it.
 - Create an SD card image file that is larger than the source image, eg:
     $ dd if=/dev/zero of=sdcard.img bs=1m count=2048
 - Write armv7.img to the beginning of that:
     $ dd if=armv7.img of=sdcard.img bs=1m conv=notrunc
 - Boot qemu. On the first boot it will grow the root fs to the available
   size and automatically reboot.
     $ qemu-system-arm -M vexpress-a15 -kernel netbsd.ub -dtb
       vexpress-v2p-ca15-tc1.dtb -nographic -sd sdcard.img
       -append'root=ld0a'

What works:

 - Serial console
 - Ethernet
 - SD card
 - Reboot/poweroff functions

Some known issues (feel free to help with fixes!)

 - Ethernet driver reports periodic "watchdog timeout" messages.

 - The vexpress-a15 machine is a dual CPU machine. By default qemu enables
   a single CPU; use the '-smp 2' flag to turn on the second one. The kernel
   knows how to spin up the secondary CPU, but the gic driver fails
   shortly after the CPU finishes attaching:

panic: kernel diagnostic assertion "old_ipl != IPL_HIGH" failed: file "/usr/home/jmcneill/netbsd/cvs-src/sys/arch/arm/cortex/gic.c", line 234 old_ipl 7 pmr 0x80 hppir 0

 - If you request more than 128MB of RAM ('-m 1024m' flag) the kernel
   will fail to boot. This is because qemu will load the dtb at a higher
   address (88000000 / +128MB from start) when emulating more than 128MB
   of RAM and the initial MMU table only maps the first 128MB. Workaround
   this by changing INIT_MEMSIZE from 128 to 256 in
   sys/arch/evbarm/vexpress/vexpress_start.S. Note that a kernel built
   with this change will no longer boot with the default (128m) memory
   settings.

I've included a dmesg below.

Enjoy!
Jared


$ qemu-system-arm -M vexpress-a15 -kernel netbsd.ub -dtb vexpress-v2p-ca15-tc1.dtb -nographic -sd sdcard.img -append 'root=ld0a -s'
[ Kernel symbol table missing! ]
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 7.99.75 (VEXPRESS_A15) #35: Fri Jun  2 18:25:24 ADT 2017
	jmcneill%undine.invisible.ca@localhost:/usr/home/jmcneill/netbsd/cvs-src/sys/arch/evbarm/compile/obj/VEXPRESS_A15
total memory = 128 MB
avail memory = 121 MB
sysctl_createv: sysctl_create(machine_arch) returned 17
armfdt0 (root)
fdt0 at armfdt0: V2P-CA15
fdt1 at fdt0
fdt2 at fdt1: V2M-P1
fdt3 at fdt2
fdt4 at fdt0
cpus0 at fdt0
cpu0 at cpus0: Cortex-A15 r2p1 (Cortex V7A core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB/64B 2-way L1 PIPT Instruction cache
cpu0: 32KB/64B 2-way write-back-locking-C L1 PIPT Data cache
cpu0: 2304KB/64B 16-way write-through L2 PIPT Unified cache
vfp0 at cpu0: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
cpu1 at cpus0: disabled (unresponsive)
gic0 at fdt0: GIC
armgic0 at gic0: Generic Interrupt Controller, 160 sources (160 valid)
armgic0: 256 Priorities, 128 SPIs, 16 PPIs, 16 SGIs
gtmr0 at fdt0: Generic Timer
armgtmr0 at gtmr0: ARMv7 Generic 64-bit Timer (62500 kHz)
armgtmr0: interrupting on irq 27
fregulator0 at fdt2: 3V3
fclock0 at fdt2: 32768 Hz fixed clock
fclock1 at fdt2: 1000000 Hz fixed clock
fclock2 at fdt2: 24000000 Hz fixed clock
/dcc at fdt0 not configured
vxsysreg0 at fdt3
/smb@08000000/motherboard/iofpga@3,00000000/sysctl@020000 at fdt3 not configured
/smb@08000000/motherboard/mcc at fdt2 not configured
/smb@08000000/motherboard/vram@2,00000000 at fdt2 not configured
/smb@08000000/motherboard/iofpga@3,00000000/clcd@1f0000 at fdt3 not configured
/virtio_mmio@1c130000 at fdt0 not configured
/virtio_mmio@1c130200 at fdt0 not configured
/virtio_mmio@1c130400 at fdt0 not configured
/virtio_mmio@1c130600 at fdt0 not configured
/hdlcd@2b000000 at fdt0 not configured
/memory-controller@2b0a0000 at fdt0 not configured
/memory-controller@7ffd0000 at fdt0 not configured
/dma@7ffb0000 at fdt0 not configured
/pmu at fdt0 not configured
/smb@08000000/motherboard/flash@0,00000000 at fdt2 not configured
/smb@08000000/motherboard/psram@1,00000000 at fdt2 not configured
smsh0 at fdt2: SMSC LAN9118 Rev 1
smsh0: MAC address 52:54:00:12:34:56
ukphy0 at smsh0 phy 1: OUI 0x00800f, model 0x000d, rev. 1
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
smsh0: interrupting on GIC irq 47
/smb@08000000/motherboard/usb@2,03000000 at fdt2 not configured
/smb@08000000/motherboard/leds at fdt2 not configured
/smb@08000000/motherboard/iofpga@3,00000000/i2c@030000 at fdt3 not configured
/smb@08000000/motherboard/iofpga@3,00000000/aaci@040000 at fdt3 not configured
plmmc0 at fdt3
sdmmc0 at plmmc0
/smb@08000000/motherboard/iofpga@3,00000000/kmi@060000 at fdt3 not configured
/smb@08000000/motherboard/iofpga@3,00000000/kmi@070000 at fdt3 not configured
plcom0 at fdt3
plcom0: txfifo disabled
plcom0: console
plcom1 at fdt3
plcom1: txfifo disabled
plcom2 at fdt3
plcom2: txfifo disabled
plcom3 at fdt3
plcom3: txfifo disabled
/smb@08000000/motherboard/iofpga@3,00000000/wdt@0f0000 at fdt3 not configured
/smb@08000000/motherboard/iofpga@3,00000000/timer@110000 at fdt3 not configured
/smb@08000000/motherboard/iofpga@3,00000000/timer@120000 at fdt3 not configured
/smb@08000000/motherboard/iofpga@3,00000000/i2c@160000 at fdt3 not configured
/smb@08000000/motherboard/iofpga@3,00000000/rtc@170000 at fdt3 not configured
/smb@08000000/motherboard/iofpga@3,00000000/compact-flash@1a0000 at fdt3 not configured
ld0 at sdmmc0: <0xaa:0x5859:QEMU!:0x01:0xdeadbeef:0x062>
ld0: 2048 MB, 1040 cyl, 64 head, 63 sec, 512 bytes/sect x 4194304 sectors
ld0: 1914880 trailing sectors not covered by disklabel
ld0: 4-bit width, 12.000 MHz
boot device: ld0
ld0: 1914880 trailing sectors not covered by disklabel
root on ld0a dumps on ld0b
ld0: 1914880 trailing sectors not covered by disklabel
ld0: 1914880 trailing sectors not covered by disklabel
root file system type: ffs
kern.module.path=/stand/evbarm/7.99.75/modules
WARNING: no TOD clock present
WARNING: using filesystem time
WARNING: CHECK AND RESET THE DATE!
Enter pathname of shell or RETURN for /bin/sh: Terminal type is vt100.
We recommend that you create a non-root account and use su(1) for root access.
# uname -a
NetBSD  7.99.75 NetBSD 7.99.75 (VEXPRESS_A15) #35: Fri Jun  2 18:25:24 ADT 2017  jmcneill%undine.invisible.ca@localhost:/usr/home/jmcneill/netbsd/cvs-src/sys/arch/evbarm/compile/obj/VEXPRESS_A15 evbarm
# poweroff
poweroff: powered off by root
syncing disks... done
unmounting file systems...
unmounting done


Home | Main Index | Thread Index | Old Index