From patchwork Thu Sep 12 10:17:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 274494 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6F8662C0207 for ; Thu, 12 Sep 2013 20:43:57 +1000 (EST) Received: from localhost ([::1]:40953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VK4NO-0007ls-4i for incoming@patchwork.ozlabs.org; Thu, 12 Sep 2013 06:43:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VK4N8-0007lZ-LM for qemu-devel@nongnu.org; Thu, 12 Sep 2013 06:43:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VK4N7-0004Rn-F2 for qemu-devel@nongnu.org; Thu, 12 Sep 2013 06:43:38 -0400 Received: from 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:1d0::1]:43964 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VK4N7-0004Rc-73 for qemu-devel@nongnu.org; Thu, 12 Sep 2013 06:43:37 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VK3yD-0002ba-U6; Thu, 12 Sep 2013 11:17:53 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 12 Sep 2013 11:17:50 +0100 Message-Id: <1378981073-9989-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Alexander Graf , kvmarm@lists.cs.columbia.edu, "Mian M. Hamayun" , patches@linaro.org Subject: [Qemu-devel] [PATCH v7 0/3] hw/arm: Add 'virt' platform X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch series adds a 'virt' platform which uses the kernel's mach-virt (fully device-tree driven) support to create a simple minimalist platform intended for use for KVM VM guests. The major change here is that I've added a PL011 UART. Sample command line: qemu-system-arm -machine type=virt -display none \ -kernel zImage \ -append 'root=/dev/vda rw console=ttyAMA0 rootwait' -cpu cortex-a15 \ -device virtio-blk-device,drive=foo \ -drive if=none,file=arm-wheezy.img,id=foo \ -m 2048 -serial stdio Note that there is no earlyprintk via the PL011 because there's no defined device tree binding for "hey, here is your earlyprintk UART". *** NOTE *** to get the PL011 to work you'll need to tweak the kernel a bit: Otherwise the kernel doesn't ever add the clock to its list, and then it refuses to probe for the PL011. (I'm told this isn't really the right fix, though, and ideally the call should be done in some generic location rather than in every machine's init function.) The alternative would be for the kernel to be fixed to follow its own device tree binding documentation and not require clocks/clock-names properties on the pl011 node. Changes from John Rigby's v3->my v4: * renamed user-facing machine to just "virt" * removed the A9 support (it can't work since the A9 has no generic timers) * added virtio-mmio transports instead of random set of 'soc' devices * instead of updating io_base as we step through adding devices, define a memory map with an array (similar to vexpress) * folded in some minor fixes from John's aarch64-support patch * rather than explicitly doing endian-swapping on FDT cells, use fdt APIs that let us just pass in host-endian values and let the fdt layer take care of the swapping * miscellaneous minor code cleanups and style fixes Changes v4->v5: * removed outdated TODO remarks from commit messages Changes v5->v6: * adjusted the memory map as per Anup's review comments (actually made the changes this time!) Changes v6->v7: * added a PL011 UART, at Alex's suggestion (and the accompanying fake clock dtb node that this requires) * added an irqmap[] in parallel with the memmap[] so that our assignment of devices to irq lines is neatly in one place * the removal of arm_pic allows us to get rid of an irritating array sized to the number of CPUs * included the "terminate dtb reservemap" patch since it's a dependency to get the kernel to boot John Rigby (1): hw/arm/boot: Allow boards to provide an fdt blob Peter Maydell (2): device_tree.c: Terminate the empty reservemap in create_device_tree() hw/arm: Add 'virt' platform device_tree.c | 4 + hw/arm/Makefile.objs | 2 +- hw/arm/boot.c | 32 ++-- hw/arm/virt.c | 419 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/hw/arm/arm.h | 7 + 5 files changed, 451 insertions(+), 13 deletions(-) create mode 100644 hw/arm/virt.c Reviewed-by: Chritoffer Dall diff --git a/arch/arm/mach-virt/virt.c b/arch/arm/mach-virt/virt.c index b184e57..2b6aceb 100644 --- a/arch/arm/mach-virt/virt.c +++ b/arch/arm/mach-virt/virt.c @@ -21,11 +21,13 @@ #include #include #include +#include #include static void __init virt_init(void) { + of_clk_init(NULL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); }