From patchwork Tue Dec 3 11:15:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 21957 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 66017202AE for ; Tue, 3 Dec 2013 11:42:45 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ld13sf31325330vcb.5 for ; Tue, 03 Dec 2013 03:42:45 -0800 (PST) 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=lvuvPoYnqKcaQL9Mv3P61N+m7Zyf/JigU8htz4yPujo=; b=m81qYMm9RJO+jqLvOaHp1Fi2uh1fCc3KGueTjx5ESamM9vKG34zLPaPcaQ1/XwnbxX LnxSgL+oonWXlbgAHiKtzL6G+PYCijmj/t8Nl2e9ph390KQSe9qX1DyXjSP13r9v9MSw yo/0ombO/YwzfJTqsCHosGVM+429DDVYaD3Lb9PuPh7LlBFEvFBm7/aTOQn3KQ93P4aF QYXAqjuLkD4jg62FpEOCGLghEdzTnJ/I3tRJEQz96ElPzS9MNyaCqndUC0WwQLA/3DqC OtnYx3lbDYZcD5E2vhU+6T+Jda5OQEKByEZnhyQx1jXtQMMiMngKDvQYmIwiRG7F8WCn nVRQ== X-Gm-Message-State: ALoCoQl7cVV4vUPIXYu2y7yxPvMvDi7ZiDgKudiRJN/MWaMep1cCQ5As3tRKomUmaz2qjQHBcP36 X-Received: by 10.236.118.17 with SMTP id k17mr865790yhh.47.1386070965200; Tue, 03 Dec 2013 03:42:45 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.165 with SMTP id d5ls4050106qed.77.gmail; Tue, 03 Dec 2013 03:42:45 -0800 (PST) X-Received: by 10.58.188.42 with SMTP id fx10mr74307vec.51.1386070965091; Tue, 03 Dec 2013 03:42:45 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id tw10si31193763vec.120.2013.12.03.03.42.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 03:42:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 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.176; Received: by mail-ve0-f176.google.com with SMTP id oz11so10117475veb.35 for ; Tue, 03 Dec 2013 03:42:45 -0800 (PST) X-Received: by 10.58.117.7 with SMTP id ka7mr571367veb.44.1386070964854; Tue, 03 Dec 2013 03:42:44 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp200543vcz; Tue, 3 Dec 2013 03:42:44 -0800 (PST) X-Received: by 10.236.15.102 with SMTP id e66mr1257765yhe.69.1386070964422; Tue, 03 Dec 2013 03:42:44 -0800 (PST) Received: from hanjun-Latitude-D630 ([219.142.3.202]) by mx.google.com with ESMTPS id 25si38860623yhc.182.2013.12.03.03.42.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 03:42:44 -0800 (PST) Received-SPF: neutral (google.com: 219.142.3.202 is neither permitted nor denied by best guess record for domain of root@hanjun-latitude-d630) client-ip=219.142.3.202; Received: from hanjun-Latitude-D630 (localhost [127.0.0.1]) by hanjun-Latitude-D630 (8.14.4/8.14.4/Debian-2ubuntu2) with ESMTP id rB3BHXsC022544; Tue, 3 Dec 2013 19:17:34 +0800 Received: (from root@localhost) by hanjun-Latitude-D630 (8.14.4/8.14.4/Submit) id rB3BHQZj022540; Tue, 3 Dec 2013 19:17:26 +0800 From: Hanjun Guo To: Daniel Lezcano , "Rafael J. Wysocki" , Catalin Marinas , Will Deacon , Russell King - ARM Linux Cc: Grant Likely , Matthew Garrett , Olof Johansson , Linus Walleij , Bjorn Helgaas , Rob Herring , Mark Rutland , Jon Masters , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, linaro-acpi@lists.linaro.org, Hanjun Guo Subject: [RFC part3 PATCH 0/2] Using ACPI GTDT table to initialize arch timer Date: Tue, 3 Dec 2013 19:15:26 +0800 Message-Id: <1386069328-22502-1-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This is the last part of patch set for core of ARM64 ACPI, and is based on the patch set part2 "Using ACPI MADT table to initialise SMP and GIC". ACPI GTDT (Generic Timer Description Table) is used for ARM/ARM64 only, and contains the information for arch timer initialisation. This patch trys to convert the arch timer to ACPI using GTDT. After this patch set was posted, we already finished the SMP, GIC and arch timer initialisation, which all are essential for ARM64 core system running, then we will focus on converting the device drivers to ACPI. Here is the GTDT ASL code I used: --- platforms/foundation-v8.acpi/gtdt.asl | 35 ++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) Hanjun Guo (2): clocksource / arch_timer: Use ACPI GTDT table to initialize arch timer ARM64 / clocksource: Use arch_timer_acpi_init() arch/arm64/kernel/time.c | 4 ++ drivers/clocksource/arm_arch_timer.c | 129 ++++++++++++++++++++++++++++++---- include/clocksource/arm_arch_timer.h | 7 +- 3 files changed, 124 insertions(+), 16 deletions(-) diff --git a/platforms/foundation-v8.acpi/gtdt.asl b/platforms/foundation-v8.acpi/gtdt.asl index 18c821a..714d61c 100644 --- a/platforms/foundation-v8.acpi/gtdt.asl +++ b/platforms/foundation-v8.acpi/gtdt.asl @@ -1,5 +1,6 @@ /* * Copyright (c) 2013, Al Stone + * Hanjun Guo * * [GTDT] Generic Timer Description Table * Format: [ByteLength] FieldName : HexFieldValue @@ -21,22 +22,32 @@ [0004] Flags (decoded below) : 00000001 Memory Present : 1 -[0004] Secure PL1 Interrupt : 00000000 -[0004] SPL1 Flags (decoded below) : 00000000 - Trigger Mode : 0 +/* In Foundation model's dts file, the last cell of interrupts + * is 0xff01, it means its cpu mask is FF, and trigger type + * and flag is 1 = low-to-high edge triggered. + * + * so in ACPI the Trigger Mode is 1 - Edge triggered, and + * Polarity is 0 - Active high as ACPI spec describled. + * + * using direct mapping for hwirqs, it means that we using + * ID [16, 31] for PPI, not [0, 15] used in FDT. + */ +[0004] Secure PL1 Interrupt : 0000001d +[0004] SPL1 Flags (decoded below) : 00000001 + Trigger Mode : 1 Polarity : 0 -[0004] Non-Secure PL1 Interrupt : 00000000 -[0004] NSPL1 Flags (decoded below) : 00000000 - Trigger Mode : 0 +[0004] Non-Secure PL1 Interrupt : 0000001e +[0004] NSPL1 Flags (decoded below) : 00000001 + Trigger Mode : 1 Polarity : 0 -[0004] Virtual Timer Interrupt : 00000000 -[0004] VT Flags (decoded below) : 00000000 - Trigger Mode : 0 +[0004] Virtual Timer Interrupt : 0000001b +[0004] VT Flags (decoded below) : 00000001 + Trigger Mode : 1 Polarity : 0 -[0004] Non-Secure PL2 Interrupt : 00000000 -[0004] NSPL2 Flags (decoded below) : 00000000 - Trigger Mode : 0 +[0004] Non-Secure PL2 Interrupt : 0000001a +[0004] NSPL2 Flags (decoded below) : 00000001 + Trigger Mode : 1 Polarity : 0