From patchwork Wed Sep 23 00:37:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 54013 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 9CE4B22D91 for ; Wed, 23 Sep 2015 00:41:06 +0000 (UTC) Received: by lagj9 with SMTP id j9sf15164525lag.0 for ; Tue, 22 Sep 2015 17:41:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=dT+366U15HCNECDhn5TkuLNgnO551QDNbZF5ZfgTs9s=; b=H/MwyXo+RGpX+zNKu2V1P7+bIZ7tg+SDVmE6bClCZ6QLprbm/Ya3EWwqmNyPgynPc6 4ubpugzP3eBZPmPU2Z16PVFYJFFrpzSdIb1slX+w5NldciY80lBoQ0OS5PPNeqfnQUBC Npu2DPm8VXzlFL+RsWVkgT50s9bS4YSTfGWAxp0H2qylnlkvhWzUubKcIC6/+dYVvSHa SUVrkF6HygEr+odWMXp961vdQ5DjTEEf/D1H1nHu5iVA8wLf1gsrFEYSqGW2EACN4dux 1j6jhhzYHVwxvjJWciChSqW2MYsWPSbVfW+bmswZO+B1aQHYape7e8OJH49HErfy9xBb zMFg== X-Gm-Message-State: ALoCoQkyb5qZnhfvY5F3+7XwIBLqWqD2+uvb1iyZWsWqqym+3zohdtpG38CBaj7rDrQ9jM22t5bU X-Received: by 10.112.149.39 with SMTP id tx7mr4789285lbb.11.1442968865252; Tue, 22 Sep 2015 17:41:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.73 with SMTP id k9ls16056lam.19.gmail; Tue, 22 Sep 2015 17:41:05 -0700 (PDT) X-Received: by 10.25.43.9 with SMTP id r9mr3311527lfr.45.1442968865121; Tue, 22 Sep 2015 17:41:05 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id b21si1602738lfe.29.2015.09.22.17.41.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2015 17:41:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lacao8 with SMTP id ao8so9643072lac.3 for ; Tue, 22 Sep 2015 17:41:04 -0700 (PDT) X-Received: by 10.112.202.35 with SMTP id kf3mr800517lbc.19.1442968864677; Tue, 22 Sep 2015 17:41:04 -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.112.59.35 with SMTP id w3csp789735lbq; Tue, 22 Sep 2015 17:41:03 -0700 (PDT) X-Received: by 10.66.161.7 with SMTP id xo7mr7527500pab.57.1442968863300; Tue, 22 Sep 2015 17:41:03 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ph2si6339165pac.118.2015.09.22.17.41.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2015 17:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; 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 1ZeY5K-0005UE-2Z; Wed, 23 Sep 2015 00:38:58 +0000 Received: from mail-pa0-f52.google.com ([209.85.220.52]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZeY5H-0005PL-Pv for linux-arm-kernel@lists.infradead.org; Wed, 23 Sep 2015 00:38:56 +0000 Received: by padhy16 with SMTP id hy16so23859008pad.1 for ; Tue, 22 Sep 2015 17:38:35 -0700 (PDT) X-Received: by 10.66.235.226 with SMTP id up2mr34488194pac.89.1442968714981; Tue, 22 Sep 2015 17:38:34 -0700 (PDT) Received: from localhost.localdomain ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id ja4sm1927162pbb.19.2015.09.22.17.38.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Sep 2015 17:38:34 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, will.deacon@arm.com, catalin.marinas@arm.com Subject: [PATCH v2 1/7] of/fdt: make memblock minimum physical address arch configurable Date: Tue, 22 Sep 2015 17:37:37 -0700 Message-Id: <1442968663-31843-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442968663-31843-1-git-send-email-ard.biesheuvel@linaro.org> References: <1442968663-31843-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150922_173855_889277_53C5909B X-CRM114-Status: GOOD ( 13.09 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.52 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.220.52 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@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.215.53 as permitted sender) smtp.mailfrom=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 By default, early_init_dt_add_memory_arch() ignores memory below the base of the kernel image since it won't be addressable via the linear mapping. However, this is not appropriate anymore once we decouple the kernel text mapping from the linear mapping, so archs may want to drop the low limit entirely. So allow the minimum to be overridden by setting MIN_MEMBLOCK_ADDR. Signed-off-by: Ard Biesheuvel Acked-by: Mark RUtland Acked-by: Rob Herring --- drivers/of/fdt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 6e82bc42373b..5e7ef800a816 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -967,13 +967,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, } #ifdef CONFIG_HAVE_MEMBLOCK +#ifndef MIN_MEMBLOCK_ADDR +#define MIN_MEMBLOCK_ADDR __pa(PAGE_OFFSET) +#endif #ifndef MAX_MEMBLOCK_ADDR #define MAX_MEMBLOCK_ADDR ((phys_addr_t)~0) #endif void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) { - const u64 phys_offset = __pa(PAGE_OFFSET); + const u64 phys_offset = MIN_MEMBLOCK_ADDR; if (!PAGE_ALIGNED(base)) { if (size < PAGE_SIZE - (base & ~PAGE_MASK)) {