From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424679AbcBSPf3 (ORCPT ); Fri, 19 Feb 2016 10:35:29 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:51345 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751732AbcBSPf2 (ORCPT ); Fri, 19 Feb 2016 10:35:28 -0500 From: Arnd Bergmann To: Chris Brandt Cc: Nicolas Pitre , Jon Medhurst , Russell King , Ard Biesheuvel , Marc Zyngier , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH 4/9] ARM: add CONFIG_PHYS_OFFSET default values Date: Fri, 19 Feb 2016 16:34:51 +0100 Message-ID: <14272873.q312Ii8Axy@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> <3974581.yknKb3tq7o@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:F/oBESp25cjh3LITVf5OuQNbJtgwssrQQHzfniQE10AOSoZP8E6 gEx5NinHv7DcUprHGsNTEYX/5STdPULxG1oxS/QFpzkw0qB/QxGgoq/PmI0kQYb9OH/ppBF Tz7nD5/TT7nc/NbFHAPeoiY65h9yxQhlcurjcquY/W9L1aBMeHxYJNDwhBWcZu1pgc842Ds OMf7N12PxJnd4eE+PjXtw== X-UI-Out-Filterresults: notjunk:1;V01:K0:L9cus2/8gQc=:6NScIyAcs/2UvHiAPMZMRL xADdUK3lCz5aXAy38LELtnJ4nm9C/rP7QrEdqyAghVqZVgMC9FuzVPVkLGEYX+EeKUrk/XJg/ hzSqiIgX42unssniOnhW9lxQYgvIdTWVltEpS3TcTT51WNVzBWImET/U2FjirnSRqElSlvL1k 7RnkMAXOEeM+pKBXHzc8doov7PwT02DmyVFFOnWsa/cCFeI7ltsivhgh03S9dL5TbhmhyeY4Y hbZK+6xjCTXl5j0MKWhx/2+pcqD0XdqXGPAnLcRI19jdCafQ/pT0SWFBIlrGMaJp8xFIdLcSU Nxb2ZYwRWuiYXSEKd/8HxMt9NGzpQQah/OIB6nGMMbXCh7eH3QhM2qr75OJ12J4ha5saHzoEe U7Qilkp+FN5BnFrPSmu8Tzp5BDMqlhycsNpHaUl/W6OeB4JgPHV+5lcTUBCT9HG8yJVkj6bD9 5q8KZ8oF3VDWJDmxrboohfXPW1oHD8mDloHFv5f2d7xu4ADU0/Mfnb4Mk4JzaBUQ/u4m06usf np3dUkTLeznemfV+Mu2Zv7Ol+4tlsdo6JDVHioWaqa1cQdcYLeHohrRsvIsM5OACjB8SFFuyf cGsL40bswzWXxfkEs0Txx+K6JHcIhn5gRoUDtkKTYN1gckhtBhmjjbvS7jCWi0zdeMLQmbFeb rxLjln/IPAFoIB24sVrSnsLPOjT615IrBY9K9ejGzozzE1tfzg0C+xxij8JrZ38+vPvRVQro/ LhL7U65EAvZxh+BT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 19 February 2016 14:29:00 Chris Brandt wrote: > On 19 Feb 2016, Arnd Bergmann wrote: > > > On Thursday 18 February 2016 11:02:33 Nicolas Pitre wrote: > > > > > > Acked-by: Nicolas Pitre > > > > > > Is there a way to provide a default for defaults? > > > > We could have something like > > > > config PHYS_OFFSET_0 > > bool > > > > config PHYS_OFFSET_1 > > bool > > > > config PHYS_OFFSET_2 > > bool > > > > ... (we need 8 of the 16 possible addresses) > > > > > > config PHYS_OFFSET > > hex "Physical address of main memory" if MMU > > default DRAM_BASE if !MMU > > default 0x00000000 if PHYS_OFFSET_0 > > default 0x10000000 if PHYS_OFFSET_1 > > default 0x20000000 if PHYS_OFFSET_2 > > default 0x30000000 if PHYS_OFFSET_3 > > default 0x70000000 if PHYS_OFFSET_7 > > default 0x80000000 if PHYS_OFFSET_8 > > default 0xa0000000 if PHYS_OFFSET_A > > default 0xc0000000 if PHYS_OFFSET_C > > > > > > and then select one of the bool symbols from each platform. > > Would that address your question? > > > Here's a question: > > Can we just get rid of PHYS_OFFSET??? > > If it's only used at boot for XIP systems, we could: > > A) pass it in via an unused register like atags and DT > or > B) just assume that atags or DT is in RAM, so round down to the nearest section and assume that is the start of your RAM > > If it is needed after initial boot, then on first boot we save what was passed in from the boot loader for later use. Hmm, you mean making phys_offset a runtime variable instead of patching it at early boot time in the instructions? I have no idea if that works, how much effort it would be, or how much it would enlarge the kernel image size, but you can definitely try. Of course we must not break existing platforms using XIP_KERNEL already, but the installed base among systems that are upgrading to modern kernels is very small now, given how all modern platforms don't support XIP_KERNEL today, or have no MMU to start with. Arnd