From patchwork Tue May 17 12:06:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 9111791 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 10FE7BF29F for ; Tue, 17 May 2016 12:08:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3279F20279 for ; Tue, 17 May 2016 12:08:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4381520303 for ; Tue, 17 May 2016 12:08:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932105AbcEQMHn (ORCPT ); Tue, 17 May 2016 08:07:43 -0400 Received: from mail-lf0-f50.google.com ([209.85.215.50]:36740 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751721AbcEQMHl (ORCPT ); Tue, 17 May 2016 08:07:41 -0400 Received: by mail-lf0-f50.google.com with SMTP id u64so5845006lff.3 for ; Tue, 17 May 2016 05:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VQSHBGLjSIZvZNdZllOi7FLWWeWahN6E/TUTaj+Aftw=; b=J834iUiuOOnfzhXDI8tJClUtmcHzAAT7upVT7R8kQdANesGkxquZH7QGZFA3Sy8epe ajUzRDNaWD59OJx0zGWSnZfHm+YfJU1hwdRszaLpwpQ0NzO8lm5O+IdhpnIuPB05XswI d8i96plXmyfaAAUwd0hWF9Sg65Cdw4L3L3BWU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VQSHBGLjSIZvZNdZllOi7FLWWeWahN6E/TUTaj+Aftw=; b=WBJjLOzaoBJsQnOzU0d8XoHTyT6Khk7DBn6KM6StT1iCxCL2rRKJX6WrE1L9fmKbUY acAYklCCN+LNAS2WlftStta7tGSe7/T1XRiiH3+G2qirHZmkK54ekPhcDDxEcz8Wr7xl TpvOpCz2UGXlUhIhvNZkGNtc8PTxbB1ItRaUGngInqqyVP3a0dCn/UOlVcOvZQTKjeRk Uc8D8AGE0LTVbHmKmSFqLN8hEWlk8x7v0el/oYrkdxGEJfdbQeaNTuG3nFlk/ArfG0+Y mj7hgR+jKRztJnokXy0qP+oTOkgeaNi0beGnArKTyh/uA4fC4i0LWtP5/K+6I09xajq2 rMRg== X-Gm-Message-State: AOPr4FUBmT0WJntlJSktU02toXz5SoqkUMPFIbRJfZ/LJFhWPFdztK5txAfFlHLbtmbkNfni X-Received: by 10.25.133.213 with SMTP id h204mr345475lfd.73.1463486860332; Tue, 17 May 2016 05:07:40 -0700 (PDT) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id n37sm466314lfg.46.2016.05.17.05.07.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 May 2016 05:07:39 -0700 (PDT) From: Aleksey Makarov To: Russell King , "Rafael J . Wysocki" , Len Brown Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Aleksey Makarov , Graeme Gregory , Jon Masters , "Zheng, Lv" , Mark Rutland , Catalin Marinas , Will Deacon Subject: [PATCH 3/3] ACPI: ARM64: support for ACPI_TABLE_UPGRADE Date: Tue, 17 May 2016 15:06:03 +0300 Message-Id: <1463486765-31827-4-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1463486765-31827-1-git-send-email-aleksey.makarov@linaro.org> References: <1463486765-31827-1-git-send-email-aleksey.makarov@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jon Masters This patch adds support for ACPI_TABLE_UPGRADE for ARM64 To access initrd image we need to move initialization of linear mapping a bit earlier. Signed-off-by: Jon Masters Signed-off-by: Aleksey Makarov --- arch/arm64/kernel/setup.c | 6 ++++-- drivers/acpi/Kconfig | 2 +- drivers/acpi/tables.c | 10 +++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index feab2ee..1d5e24f 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -261,11 +261,13 @@ void __init setup_arch(char **cmdline_p) efi_init(); arm64_memblock_init(); + paging_init(); + + early_initrd_acpi_init(); + /* Parse the ACPI tables for possible boot-time configuration */ acpi_boot_table_init(); - paging_init(); - if (acpi_disabled) unflatten_device_tree(); diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index c204344..ec694c0 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -313,7 +313,7 @@ config ACPI_CUSTOM_DSDT config ACPI_TABLE_UPGRADE bool "Allow upgrading ACPI tables via initrd" - depends on BLK_DEV_INITRD && X86 + depends on BLK_DEV_INITRD && (X86 || ARM64) default y help This option provides functionality to upgrade arbitrary ACPI tables diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 82be84a..c35034d8 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -482,6 +482,14 @@ static DECLARE_BITMAP(acpi_initrd_installed, NR_ACPI_INITRD_TABLES); #define MAP_CHUNK_SIZE (NR_FIX_BTMAPS << PAGE_SHIFT) +#if defined(CONFIG_X86) +#define MAX_PHYS_ACPI_TABLES (max_low_pfn_mapped << PAGE_SHIFT) +#elif defined(CONFIG_ARM64) +#define MAX_PHYS_ACPI_TABLES PFN_PHYS(max_pfn) +#else +#error "MAX_PHYS_ACPI_TABLES is not defiend for this architecture" +#endif + static void __init acpi_table_initrd_init(void *data, size_t size) { int sig, no, table_nr = 0, total_offset = 0; @@ -541,7 +549,7 @@ static void __init acpi_table_initrd_init(void *data, size_t size) return; acpi_tables_addr = - memblock_find_in_range(0, max_low_pfn_mapped << PAGE_SHIFT, + memblock_find_in_range(0, MAX_PHYS_ACPI_TABLES, all_tables_size, PAGE_SIZE); if (!acpi_tables_addr) { WARN_ON(1);