From patchwork Thu Apr 10 11:46:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 28163 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A00F120671 for ; Thu, 10 Apr 2014 11:51:20 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id hw13sf9651541qab.3 for ; Thu, 10 Apr 2014 04:51:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc: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=l6wDtfaBXoKgvcT20Lkw3oE2NPBahNe2dt0yB/B9unM=; b=Akv1/lM3Z9KPhU0cmGkHDkmGboYHpsivs0A38JrI49ND+sh/ySWN1E+IlU+L3MMXA6 urrdDFNxtab7svbEqo/egxqLYtNB3B+hBQY2ElT/0tb6etUBRyptJPQv8wI3MPHhFO24 yc8ArU12cWAnchKwKbcLx3NN2u3T7qAn9bMYABUX9JDNe5fQ4+cSujL+UfxFpEWKL4YQ VU9CtAzPnEpvzGfm7syhBo6OwJtpGs6Lz9LtcpvK0CjlekWtvhmH4iP6BoiRbmr8ogRi ol1Aj/VsG8Wh3EB4Ip+m8B8IUlMx1IMoE9IQo2byJJK6AitB1ZrO+JaddsauiYVmv3LA 13PA== X-Gm-Message-State: ALoCoQnYoWCWRLbPGq1qEqD7AsGvFAAHm3qgEjyVfsMxvFRmw0WlijisTv1SQgyG//5QqNbBnHZ4 X-Received: by 10.58.82.193 with SMTP id k1mr7780413vey.41.1397130680193; Thu, 10 Apr 2014 04:51:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.115 with SMTP id w106ls1106387qgw.53.gmail; Thu, 10 Apr 2014 04:51:20 -0700 (PDT) X-Received: by 10.221.34.7 with SMTP id sq7mr14157947vcb.5.1397130680000; Thu, 10 Apr 2014 04:51:20 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id sn5si647696vdc.83.2014.04.10.04.51.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 04:51:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id jw12so3253198veb.37 for ; Thu, 10 Apr 2014 04:51:19 -0700 (PDT) X-Received: by 10.52.251.199 with SMTP id zm7mr11933911vdc.21.1397130679919; Thu, 10 Apr 2014 04:51:19 -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.220.221.72 with SMTP id ib8csp52697vcb; Thu, 10 Apr 2014 04:51:19 -0700 (PDT) X-Received: by 10.140.34.168 with SMTP id l37mr18797648qgl.85.1397130679480; Thu, 10 Apr 2014 04:51:19 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x8si572119qar.203.2014.04.10.04.51.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 10 Apr 2014 04:51:19 -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]:50438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYDVn-000135-42 for patch@linaro.org; Thu, 10 Apr 2014 07:51:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYDSd-0002qV-Rb for qemu-devel@nongnu.org; Thu, 10 Apr 2014 07:48:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYDSX-0002Tw-Uh for qemu-devel@nongnu.org; Thu, 10 Apr 2014 07:48:03 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:50011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYDSX-0002Tq-MM for qemu-devel@nongnu.org; Thu, 10 Apr 2014 07:47:57 -0400 Received: by mail-pa0-f51.google.com with SMTP id kq14so3843088pab.24 for ; Thu, 10 Apr 2014 04:47:57 -0700 (PDT) X-Received: by 10.68.163.3 with SMTP id ye3mr19170265pbb.78.1397130476984; Thu, 10 Apr 2014 04:47:56 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id kt8sm19638002pab.7.2014.04.10.04.47.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 04:47:55 -0700 (PDT) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Thu, 10 Apr 2014 17:16:51 +0530 Message-Id: <1397130414-5551-5-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397130414-5551-1-git-send-email-pranavkumar@linaro.org> References: <1397130414-5551-1-git-send-email-pranavkumar@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.51 Cc: peter.maydell@linaro.org, Anup Patel , patches@apm.com, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, Pranavkumar Sawargaonkar Subject: [Qemu-devel] [RFC PATCH V3 4/7] target-arm: Provide PSCI v0.2 constants to generic QEMU code 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: pranavkumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 Provide QEMU PSCI v0.2 constants for non-KVM code; this will allow us to avoid an #ifdef in boards which set up a PSCI v0.2 node in the device tree. Signed-off-by: Pranavkumar Sawargaonkar Signed-off-by: Anup Patel --- target-arm/kvm-consts.h | 63 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/target-arm/kvm-consts.h b/target-arm/kvm-consts.h index 6009a33..5cf93ab 100644 --- a/target-arm/kvm-consts.h +++ b/target-arm/kvm-consts.h @@ -38,17 +38,58 @@ MISMATCH_CHECK(CP_REG_SIZE_U64, KVM_REG_SIZE_U64) MISMATCH_CHECK(CP_REG_ARM, KVM_REG_ARM) MISMATCH_CHECK(CP_REG_ARCH_MASK, KVM_REG_ARCH_MASK) -#define PSCI_FN_BASE 0x95c1ba5e -#define PSCI_FN(n) (PSCI_FN_BASE + (n)) -#define PSCI_FN_CPU_SUSPEND PSCI_FN(0) -#define PSCI_FN_CPU_OFF PSCI_FN(1) -#define PSCI_FN_CPU_ON PSCI_FN(2) -#define PSCI_FN_MIGRATE PSCI_FN(3) - -MISMATCH_CHECK(PSCI_FN_CPU_SUSPEND, KVM_PSCI_FN_CPU_SUSPEND) -MISMATCH_CHECK(PSCI_FN_CPU_OFF, KVM_PSCI_FN_CPU_OFF) -MISMATCH_CHECK(PSCI_FN_CPU_ON, KVM_PSCI_FN_CPU_ON) -MISMATCH_CHECK(PSCI_FN_MIGRATE, KVM_PSCI_FN_MIGRATE) +/* PSCI v0.1 interface */ +#define QEMU_PSCI_FN_BASE 0x95c1ba5e +#define QEMU_PSCI_FN(n) (QEMU_PSCI_FN_BASE + (n)) +#define QEMU_PSCI_FN_CPU_SUSPEND QEMU_PSCI_FN(0) +#define QEMU_PSCI_FN_CPU_OFF QEMU_PSCI_FN(1) +#define QEMU_PSCI_FN_CPU_ON QEMU_PSCI_FN(2) +#define QEMU_PSCI_FN_MIGRATE QEMU_PSCI_FN(3) + +MISMATCH_CHECK(QEMU_PSCI_FN_CPU_SUSPEND, KVM_PSCI_FN_CPU_SUSPEND) +MISMATCH_CHECK(QEMU_PSCI_FN_CPU_OFF, KVM_PSCI_FN_CPU_OFF) +MISMATCH_CHECK(QEMU_PSCI_FN_CPU_ON, KVM_PSCI_FN_CPU_ON) +MISMATCH_CHECK(QEMU_PSCI_FN_MIGRATE, KVM_PSCI_FN_MIGRATE) + +/* PSCI v0.2 interface */ +#define QEMU_PSCI_0_2_FN_BASE 0x84000000 +#define QEMU_PSCI_0_2_FN(n) (QEMU_PSCI_0_2_FN_BASE + (n)) +#define QEMU_PSCI_0_2_FN64_BASE 0xC4000000 +#define QEMU_PSCI_0_2_FN64(n) (QEMU_PSCI_0_2_FN64_BASE + (n)) +#define QEMU_PSCI_0_2_FN_PSCI_VERSION QEMU_PSCI_0_2_FN(0) +#define QEMU_PSCI_0_2_FN_CPU_SUSPEND QEMU_PSCI_0_2_FN(1) +#define QEMU_PSCI_0_2_FN_CPU_OFF QEMU_PSCI_0_2_FN(2) +#define QEMU_PSCI_0_2_FN_CPU_ON QEMU_PSCI_0_2_FN(3) +#define QEMU_PSCI_0_2_FN_AFFINITY_INFO QEMU_PSCI_0_2_FN(4) +#define QEMU_PSCI_0_2_FN_MIGRATE QEMU_PSCI_0_2_FN(5) +#define QEMU_PSCI_0_2_FN_MIGRATE_INFO_TYPE QEMU_PSCI_0_2_FN(6) +#define QEMU_PSCI_0_2_FN_MIGRATE_INFO_UP_CPU QEMU_PSCI_0_2_FN(7) +#define QEMU_PSCI_0_2_FN_SYSTEM_OFF QEMU_PSCI_0_2_FN(8) +#define QEMU_PSCI_0_2_FN_SYSTEM_RESET QEMU_PSCI_0_2_FN(9) +#define QEMU_PSCI_0_2_FN64_CPU_SUSPEND QEMU_PSCI_0_2_FN64(1) +#define QEMU_PSCI_0_2_FN64_CPU_ON QEMU_PSCI_0_2_FN64(3) +#define QEMU_PSCI_0_2_FN64_AFFINITY_INFO QEMU_PSCI_0_2_FN64(4) +#define QEMU_PSCI_0_2_FN64_MIGRATE QEMU_PSCI_0_2_FN64(5) +#define QEMU_PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU QEMU_PSCI_0_2_FN64(7) + +MISMATCH_CHECK(QEMU_PSCI_0_2_FN_PSCI_VERSION, PSCI_0_2_FN_PSCI_VERSION) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN_CPU_SUSPEND, PSCI_0_2_FN_CPU_SUSPEND) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN_CPU_OFF, PSCI_0_2_FN_CPU_OFF) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN_CPU_ON, PSCI_0_2_FN_CPU_ON) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN_AFFINITY_INFO, PSCI_0_2_FN_AFFINITY_INFO) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN_MIGRATE, PSCI_0_2_FN_MIGRATE) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN_MIGRATE_INFO_TYPE, \ + PSCI_0_2_FN_MIGRATE_INFO_TYPE) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN_MIGRATE_INFO_UP_CPU, \ + PSCI_0_2_FN_MIGRATE_INFO_UP_CPU) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN_SYSTEM_OFF, PSCI_0_2_FN_SYSTEM_OFF) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN_SYSTEM_RESET, PSCI_0_2_FN_SYSTEM_RESET) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN64_CPU_SUSPEND, PSCI_0_2_FN64_CPU_SUSPEND) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN64_CPU_ON, PSCI_0_2_FN64_CPU_ON) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN64_AFFINITY_INFO, PSCI_0_2_FN64_AFFINITY_INFO) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN64_MIGRATE, PSCI_0_2_FN64_MIGRATE) +MISMATCH_CHECK(QEMU_PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU, \ + PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU) /* Note that KVM uses overlapping values for AArch32 and AArch64 * target CPU numbers. AArch32 targets: