From patchwork Fri May 29 13:10:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 49211 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 75AE0218E7 for ; Fri, 29 May 2015 13:31:19 +0000 (UTC) Received: by wifx6 with SMTP id x6sf6403303wif.1 for ; Fri, 29 May 2015 06:31:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding :subject:precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=i+qu4JcwmpfOvQPc3hh5aOk2MxpZWeTw0Nwuhd/yXYk=; b=ePBo4Y7amm5/sBlgGvWY2GoclyxayRM4W5y/Ng2Wi50n4f4HJhcxyXTQ+BPC3p5PB/ DK0+TxB5zOIoD9BH+qZN4Wh4N7y1BYR+RHJrrn0v2OyCaCkzagioJWWZXSjpktYKEvgb LzO6XtMGDCspEaCtpR6QjpZTKTEqCnoiLZ+OwmBIedz6TgVXOgezazy3v6jNCYBb1bVW r9qRxIFyfDRQ211RY3CzvNPVomO6Nb2E+ks9pzO2Bl+SJuu3dXEy9lE3SQIGsU+N+14e UIAkc0x1a0PMW4ITkg0R6nJI1RiXRIKDO5SpGKB38unWPgIuaAz3+mB5/bEUn5ydOKem X91g== X-Gm-Message-State: ALoCoQkwnvrW2WMAdERaXFWxlTZLMXV5JhhETJoVa1asLgHzelOa1mw5171u/B1bjLN/nDFkg6ck X-Received: by 10.112.29.39 with SMTP id g7mr7422175lbh.1.1432906278313; Fri, 29 May 2015 06:31:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.202 with SMTP id y10ls189668lal.1.gmail; Fri, 29 May 2015 06:31:18 -0700 (PDT) X-Received: by 10.152.3.33 with SMTP id 1mr7970603laz.109.1432906278166; Fri, 29 May 2015 06:31:18 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id oe4si4711822lbc.49.2015.05.29.06.31.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 06:31:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labko7 with SMTP id ko7so52213612lab.2 for ; Fri, 29 May 2015 06:31:17 -0700 (PDT) X-Received: by 10.112.155.197 with SMTP id vy5mr7869459lbb.29.1432906277737; Fri, 29 May 2015 06:31:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp336164lbb; Fri, 29 May 2015 06:31:16 -0700 (PDT) X-Received: by 10.55.52.129 with SMTP id b123mr16065688qka.34.1432906276119; Fri, 29 May 2015 06:31:16 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g6si5586597qce.39.2015.05.29.06.31.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 29 May 2015 06:31:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:35950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyKNX-0000iG-6Y for patch@linaro.org; Fri, 29 May 2015 09:31:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyK3z-0003vu-0F for qemu-devel@nongnu.org; Fri, 29 May 2015 09:11:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyK3v-0003aX-UD for qemu-devel@nongnu.org; Fri, 29 May 2015 09:11:02 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyK3v-0003US-Kj for qemu-devel@nongnu.org; Fri, 29 May 2015 09:10:59 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1YyK3i-0005mo-0t for qemu-devel@nongnu.org; Fri, 29 May 2015 14:10:46 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 29 May 2015 14:10:22 +0100 Message-Id: <1432905045-22138-17-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1432905045-22138-1-git-send-email-peter.maydell@linaro.org> References: <1432905045-22138-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 16/39] hw/arm/virt: Move common definitions to virt.h 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Shannon Zhao Move some common definitions to virt.h. These will be used by generating ACPI tables. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Alex Bennée Message-id: 1432522520-8068-3-git-send-email-zhaoshenglong@huawei.com Signed-off-by: Peter Maydell --- hw/arm/virt.c | 21 +------------------ include/hw/arm/virt.h | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 20 deletions(-) create mode 100644 include/hw/arm/virt.h diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a7f9a10..8959d0c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -31,6 +31,7 @@ #include "hw/sysbus.h" #include "hw/arm/arm.h" #include "hw/arm/primecell.h" +#include "hw/arm/virt.h" #include "hw/devices.h" #include "net/net.h" #include "sysemu/block-backend.h" @@ -44,8 +45,6 @@ #include "qemu/error-report.h" #include "hw/pci-host/gpex.h" -#define NUM_VIRTIO_TRANSPORTS 32 - /* Number of external interrupt lines to configure the GIC with */ #define NUM_IRQS 128 @@ -60,24 +59,6 @@ #define GIC_FDT_IRQ_PPI_CPU_START 8 #define GIC_FDT_IRQ_PPI_CPU_WIDTH 8 -enum { - VIRT_FLASH, - VIRT_MEM, - VIRT_CPUPERIPHS, - VIRT_GIC_DIST, - VIRT_GIC_CPU, - VIRT_UART, - VIRT_MMIO, - VIRT_RTC, - VIRT_FW_CFG, - VIRT_PCIE, -}; - -typedef struct MemMapEntry { - hwaddr base; - hwaddr size; -} MemMapEntry; - typedef struct VirtBoardInfo { struct arm_boot_info bootinfo; const char *cpu_model; diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h new file mode 100644 index 0000000..2fe0d2e --- /dev/null +++ b/include/hw/arm/virt.h @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2015 Linaro Limited + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2 or later, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + * Emulate a virtual board which works by passing Linux all the information + * it needs about what devices are present via the device tree. + * There are some restrictions about what we can do here: + * + we can only present devices whose Linux drivers will work based + * purely on the device tree with no platform data at all + * + we want to present a very stripped-down minimalist platform, + * both because this reduces the security attack surface from the guest + * and also because it reduces our exposure to being broken when + * the kernel updates its device tree bindings and requires further + * information in a device binding that we aren't providing. + * This is essentially the same approach kvmtool uses. + */ + +#ifndef QEMU_ARM_VIRT_H +#define QEMU_ARM_VIRT_H + +#include "qemu-common.h" + +#define NUM_VIRTIO_TRANSPORTS 32 + +enum { + VIRT_FLASH, + VIRT_MEM, + VIRT_CPUPERIPHS, + VIRT_GIC_DIST, + VIRT_GIC_CPU, + VIRT_UART, + VIRT_MMIO, + VIRT_RTC, + VIRT_FW_CFG, + VIRT_PCIE, +}; + +typedef struct MemMapEntry { + hwaddr base; + hwaddr size; +} MemMapEntry; + + +#endif