From patchwork Mon Oct 29 23:52:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 10660393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 95A1D174F for ; Mon, 29 Oct 2018 23:55:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A54C28CD0 for ; Mon, 29 Oct 2018 23:55:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67C3629238; Mon, 29 Oct 2018 23:55:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0B05328CD0 for ; Mon, 29 Oct 2018 23:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Flkr7IEZAyraqRveZwvEdKLcB/OSUrymyDJUSf6Mxu8=; b=HGVimCpu/Ywc8L2DRsSoIwXCMM /ROEIV7wyvKQHLmy1HvjmaTuCScOfMJzXEZDWIg4qflgyNF+FGY3qSSzukYQZdz3+6owNW2jLu3nL i1Y/Blcryz5uow9cF9BftZqXSEU+UsoSFlHhEEhdLn4rXNWlMyLn1LlQHAiKDqe7xFMfVRBpyT7be 2auG6U72UTCP7jcBYrfuyRdoievPucHCRIiii0Uk4TQnkwiTHp82Mg3D7VGhaM649iNhY/mhvlU4C CwTFZ/osFEc+bZTWqnqv6fa820xWLnmuntu774h/BgTJqliANjGL/OHY9HofHLERfYp9DIm/mOBRO JmzbQ+xA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHHNr-0006WJ-5d; Mon, 29 Oct 2018 23:55:47 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHHL2-00042a-DN for linux-arm-kernel@lists.infradead.org; Mon, 29 Oct 2018 23:53:10 +0000 Received: by mail-pf1-x444.google.com with SMTP id z2-v6so2244848pfe.2 for ; Mon, 29 Oct 2018 16:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wOKJE9uIABdH60US3sClxZQrg6R8PI279i9FOlxRlG4=; b=WZJiJ7FsHbbeZO/tb/j+6S3Yk1wYRnL75lNXEYERbkmvnjNG2uXoHgzIr4XbzLVfOK 7aVetERjzAO5EQfMfRY1G+h2EeJhdiMyehZUEDWsPPXX3hCcmANOJRtO8I0L1BsWbLBD Oi9aU5g/KYBdP2/wt0PfGRqlctLjW3Hcgao3BVaCdwbmAszwjxhPcspRvXbHsqvNUUtV VIGFdT5Ezm7cYkLJn82k4M0WO77ISyjSnHZvI6llxFKUoEDYKI7djvt6VdlBZ0+z1a5K ASlyo5+GxSFOPNNYXsfYPcTUqBfjx10fosupbrzRNRmyWFsR8kd5TwNZeP0GoI1NLZW5 M2mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wOKJE9uIABdH60US3sClxZQrg6R8PI279i9FOlxRlG4=; b=b1zSlKHnIR1hCckr5Msrfqv5AXVUtUXLjQ5PeI117f6IO+ARSwHytkOeDbTGOUpo6r B7hkQVJO0p/Ft5ViGaILxQ5JfPFgMQYQU4DRZz7R1RuztzRadit5brLDK+KpMivOgZXx bQAjuMAqujVuVcAwVOG5Eb1wjd5TJ1dKBBTljBGMSHcyUwAzzzQRLSkh/5VzVM+fj+aI M3exuGCYreLnJEHvLOasxmu1LTR+dx63+zH+QEaEZJ+qJq75irgzVr781rwCK+4xPpIC Od4efekfV7lCNny9vG+BcZ4pzLojwC3pEDuBTQxrHglPYc068NrVOxVjO0Cedd/HdifG dTeg== X-Gm-Message-State: AGRZ1gLgW3YO6sOmkQ/IE+gnNQhX1QxqpdSBXcpsYiyTl+q0oKPHAKf1 HweachfYwT7fSER7QcvslNU= X-Google-Smtp-Source: AJdET5f47m1khXFFfa05z8/iowOKmbFK5hnpI9SiwtLHld0dxYAF5hEKNCViFgZU9rKJo/TtkHsh8A== X-Received: by 2002:a62:460c:: with SMTP id t12-v6mr510305pfa.206.1540857161524; Mon, 29 Oct 2018 16:52:41 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id k13-v6sm22537981pff.30.2018.10.29.16.52.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 16:52:40 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH 4/6] of/fdt: Populate phys_initrd_start/phys_initrd_size from FDT Date: Mon, 29 Oct 2018 16:52:04 -0700 Message-Id: <20181029235206.30060-5-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181029235206.30060-1-f.fainelli@gmail.com> References: <20181029235206.30060-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181029_165252_620978_D2C00D93 X-CRM114-Status: GOOD ( 15.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , Masahiro Yamada , deanbo422@gmail.com, Frank Rowand , Florian Fainelli , linux@armlinux.org.uk, rppt@linux.ibm.com, Andrey Ryabinin , Laura Abbott , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Marc Zyngier , Andrey Konovalov , Kristina Martsenko , Russell King , Rob Herring , green.hu@gmail.com, gxt@pku.edu.cn, "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" , ard.biesheuvel@linaro.org, Johannes Weiner , Andrew Morton , Robin Murphy , Greg Hackmann MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If the architecture implements ARCH_HAS_PHYS_INITRD, make the FDT scanning code populate the physical address of the start of the FDT and its size. Signed-off-by: Florian Fainelli --- arch/arm/mm/init.c | 2 +- drivers/of/fdt.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 8f364aa24172..517e95cfb5d2 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -237,7 +237,7 @@ static void __init arm_initrd_init(void) phys_addr_t start; unsigned long size; - /* FDT scan will populate initrd_start */ + /* FDT scan will populate initrd_start and phys_initrd_start */ if (initrd_start && !phys_initrd_size) { phys_initrd_start = __virt_to_phys(initrd_start); phys_initrd_size = initrd_end - initrd_start; diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 76c83c1ffeda..313cd4f24258 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -899,6 +899,10 @@ static void __early_init_dt_declare_initrd(unsigned long start, initrd_start = (unsigned long)__va(start); initrd_end = (unsigned long)__va(end); initrd_below_start_ok = 1; +#ifdef CONFIG_ARCH_HAS_PHYS_INITRD + phys_initrd_start = start; + phys_initrd_size = end - start; +#endif } #endif