From patchwork Thu Jul 24 12:59:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 34199 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E5F4920C7F for ; Thu, 24 Jul 2014 12:59:55 +0000 (UTC) Received: by mail-oi0-f72.google.com with SMTP id a141sf10404132oig.11 for ; Thu, 24 Jul 2014 05:59:55 -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:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=6CQ7T8bLfqSYmy9iF4E2QT8y/RL6JoCtyGHzrcn+bMs=; b=I+JG1PTIGI4l112xynOC5Wz30Zhvo3avgjofOdCVn3OpKHbmalLtctYjCnKBs9JylJ SLCLsFGXHYk/9A48bCe1S+e1HrqPrg+uZMtxQ5r3olxsoeSuH4R8xrcqKi5l7QPyxptc d9s/TWNm3TnvxR2CtwGmBihB+oRpBtRapA5LJDy3M1Vh4ZsqZsuGFkxegw5NVqvzBdH2 jr3yTnlOokXFPwrTkc7a/HvKR7MUxbStEOV9+6Mjafu2NdlJFgi4l89LqxPK419eeabu TduLf2xaEv+iP6g2mrKVEWRuvGg3uIoz3vYiT3mniCK943x5z/AXnqiv8BymB9a2nXCO yMWw== X-Gm-Message-State: ALoCoQlOZFabFhxStKPUS59duqgSVcpPrpqpo/O3T5fbai24cDjclvCJfmvtwTRWFf/wILazPFoK X-Received: by 10.182.166.36 with SMTP id zd4mr4224861obb.43.1406206795326; Thu, 24 Jul 2014 05:59:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.51 with SMTP id s48ls776278qgs.64.gmail; Thu, 24 Jul 2014 05:59:55 -0700 (PDT) X-Received: by 10.220.199.193 with SMTP id et1mr12015783vcb.58.1406206794178; Thu, 24 Jul 2014 05:59:54 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id bh2si4836958vec.95.2014.07.24.05.59.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Jul 2014 05:59:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id hq11so4844924vcb.2 for ; Thu, 24 Jul 2014 05:59:54 -0700 (PDT) X-Received: by 10.52.120.38 with SMTP id kz6mr9974508vdb.86.1406206794077; Thu, 24 Jul 2014 05:59:54 -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.221.37.5 with SMTP id tc5csp362673vcb; Thu, 24 Jul 2014 05:59:53 -0700 (PDT) X-Received: by 10.68.131.230 with SMTP id op6mr9943438pbb.55.1406206792960; Thu, 24 Jul 2014 05:59:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rz4si5915798pab.184.2014.07.24.05.59.52 for ; Thu, 24 Jul 2014 05:59:52 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758803AbaGXM7v (ORCPT + 13 others); Thu, 24 Jul 2014 08:59:51 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:37835 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758743AbaGXM7s (ORCPT ); Thu, 24 Jul 2014 08:59:48 -0400 Received: by mail-pd0-f178.google.com with SMTP id w10so3628356pde.37 for ; Thu, 24 Jul 2014 05:59:48 -0700 (PDT) X-Received: by 10.70.60.226 with SMTP id k2mr10253963pdr.130.1406206788314; Thu, 24 Jul 2014 05:59:48 -0700 (PDT) Received: from localhost ([183.247.163.231]) by mx.google.com with ESMTPSA id y12sm7369297pdk.21.2014.07.24.05.59.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 24 Jul 2014 05:59:47 -0700 (PDT) From: Hanjun Guo To: Catalin Marinas , "Rafael J. Wysocki" , Mark Rutland Cc: Graeme Gregory , Arnd Bergmann , Grant Likely , Sudeep Holla , Will Deacon , Jason Cooper , Marc Zyngier , Bjorn Helgaas , Daniel Lezcano , Mark Brown , Robert Richter , Lv Zheng , Robert Moore , Lorenzo Pieralisi , Liviu Dudau , Randy Dunlap , Charles.Garcia-Tobin@arm.com, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-acpi-private@linaro.org, Hanjun Guo Subject: [PATCH 1/3] ACPI / ACPICA: Introduce ARM Boot Architecture Flags in FADT Date: Thu, 24 Jul 2014 20:59:15 +0800 Message-Id: <1406206757-15512-2-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1406206757-15512-1-git-send-email-hanjun.guo@linaro.org> References: <1406206757-15512-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@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.220.171 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The Power State Coordination Interface (PSCI) defines an API that can be used to coordinate power control amongst the various supervisory systems concurrently running on a device. ACPI support for this technology would require the addition of two flags: PSCI_COMPLIANT and PSCI_USE_HVC. When set, the former signals to the OS that the hardware is PSCI compliant. The latter selects the appropriate conduit for PSCI calls by toggling between Hypervisor Calls (HVC) and Secure Monitor Calls (SMC). An ARM Boot Architecture Flags structure to support new ARM hardware was introduced in FADT in ACPI 5.1, add the code accordingly to implement that in ACPICA core. Since ACPI 5.1 doesn't support self defined PSCI function IDs, which means that only PSCI 0.2+ is supported in ACPI. Signed-off-by: Hanjun Guo --- include/acpi/actbl.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 1cc7ef1..e339a28 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h @@ -270,7 +270,8 @@ struct acpi_table_fadt { u32 flags; /* Miscellaneous flag bits (see below for individual flags) */ struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */ u8 reset_value; /* Value to write to the reset_register port to reset the system */ - u8 reserved4[3]; /* Reserved, must be zero */ + u16 arm_boot_flags; /* ARM Boot Architecture Flags (see below for individual flags) */ + u8 minor_version; /* Minor version of this FADT structure */ u64 Xfacs; /* 64-bit physical address of FACS */ u64 Xdsdt; /* 64-bit physical address of DSDT */ struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ @@ -285,7 +286,7 @@ struct acpi_table_fadt { struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register (ACPI 5.0) */ }; -/* Masks for FADT Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */ +/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */ #define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */ #define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */ @@ -296,6 +297,11 @@ struct acpi_table_fadt { #define FADT2_REVISION_ID 3 +/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) */ + +#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: PSCI 0.2+ is implemented */ +#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: HVC must be used instead of SMC as the PSCI conduit */ + /* Masks for FADT flags */ #define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */ @@ -399,7 +405,7 @@ struct acpi_table_desc { * FADT V5 size: 0x10C */ #define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) -#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3) +#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (arm_boot_flags) + 3) #define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) #define ACPI_FADT_V5_SIZE (u32) (sizeof (struct acpi_table_fadt))