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: 9111831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2A6EB9F1C3 for ; Tue, 17 May 2016 12:09:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4CFEA202F0 for ; Tue, 17 May 2016 12:09:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6A09020279 for ; Tue, 17 May 2016 12:09:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b2dnR-0006eP-78; Tue, 17 May 2016 12:08:21 +0000 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b2dn8-0006UN-7r for linux-arm-kernel@lists.infradead.org; Tue, 17 May 2016 12:08:03 +0000 Received: by mail-lf0-x22e.google.com with SMTP id m64so5857156lfd.1 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=eRJ+RBqhfCMlP7socLErv8jDT3Jh/X6Z9YdCJiyNIG4Zq9ty26oMqfszkQNJcCjXbi OLIV0YWdrk/74fk9vLcBa6Pjkxdp1TnIRT5OitBcqOOgue5nD8XUZkEmqV/UPR+Wku7m Cx4WbpdghHS5o3TmTCxu1UXep/hzB+RLZ6ZCBFCkcdJTryjYD/baKCg7Z9+N8DxNiUN+ boRVLldUt+6VqqineTXGbQcY8BOmix6jjDzYw+bprF9hNIhD23j1BUKhzyFFTn9Eq9p1 caF9ekrCzM5eAFlKDjF1SvEJG10pax5gQiN3TF7dmtizleAOaXCZI9eDfIkk8B7/tz6S pSbQ== X-Gm-Message-State: AOPr4FVX6kX9ghv+2Gr5iuYs4jHLURP6a0qr/vfRhD3Wmp3a5UvdHY7HVBtKS/7a5yMCAIJs 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160517_050802_481909_F610C1CC X-CRM114-Status: GOOD ( 15.30 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Graeme Gregory , Jon Masters , Will Deacon , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Aleksey Makarov , "Zheng, Lv" , Catalin Marinas , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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);