Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965005AbbLOLFa (ORCPT ); Tue, 15 Dec 2015 06:05:30 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:63752 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964803AbbLOLF2 convert rfc822-to-8bit (ORCPT ); Tue, 15 Dec 2015 06:05:28 -0500 From: Arnd Bergmann To: Pali =?ISO-8859-1?Q?Roh=E1r?= Cc: Nicolas Pitre , Tony Lindgren , Russell King - ARM Linux , linux-arm-kernel@lists.infradead.org, "devicetree@vger.kernel.org" , Ivaylo Dimitrov , Laura Abbott , Sebastian Reichel , Will Deacon , linux-kernel@vger.kernel.org, Rob Herring , Pavel Machek , Grant Likely , linux-omap@vger.kernel.org, Frank Rowand , Andreas =?ISO-8859-1?Q?F=E4rber?= Subject: Re: [PATCH 5/5] arm: boot: store ATAGs structure into DT "/chosen/linux,atags" entry Date: Tue, 15 Dec 2015 12:04:35 +0100 Message-ID: <1684644.M9TF75k3RB@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20151215093325.GK13531@pali> References: <20150713131902.GH26485@atomide.com> <20151215093325.GK13531@pali> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" X-Provags-ID: V03:K0:i1x6gJag3vCqONDDLoZ0wF//pDcchV3EgXYxmcRAKwRtSO8F1j2 jl5pgBVmnYR7PeIH0nfUsoTn5631uomHgtPAtDUkX2vysc4j+oiaIX0UxZ1ErMtlEk9VXhg lVHz4a1kO6m9xguTLNg5Cx4DThpVvuELtGlIyBrudDU34k2i2ANsjHI06uMLyN7ia4t0lLN ilTkBzpP9Qgggbe3JP3qw== X-UI-Out-Filterresults: notjunk:1;V01:K0:coegQ8i96Kc=:tGZ7TYOnp4nNHOc3VoUrrN MMU1DbH3Yrc3wwD8kutS8DeXQ74ZaE1h47FRNoa6DVawuBU6LXFvgroQzBwDZ9a4s8nCXI9Kw cxiWP6+YlkAH4PsCbDN3JXKawVwszBuLZNTjhopTWygH5gZ1X28c5gESFomKWOnQFeDKXmhl/ 7/umYGqfnd5HHKeYuSIS1Y9JXgyxTaAhPPRcHmYTeaOAyh5tHTGGYWPFWCVvFdtPOGobwCrhR rVEZ9anP5RN+u0W/WfWbMojWm+Pk0wRUM3qrv5Ojx4FofE0WzwP2dp5KaXmvn38GGTvtAPgG1 Tm5Lsh+ggXC//M3L6aN0X/dU8bxVQE7oORwEd6Lf3dOjZ/yRSiD/JrJw5lwxxlkmz+svPpct7 939ZzaiDqFfB0W/nOtswLaeD5e/Ox6dEQxMnJfS8bVagOrdJdiAbZ4dIauZ7lOORLYfckw0FL ECcMqzi0jXRAransrHIvD3n3PuvFky3wxI2PdX4VrPWSZK0nZnrPA/evwI4Z7JVwRiwzDTL5k rRAIXvsIsw5qiSOKi4vEV1Rw8UWxzqNi1TR7+tPoB6CcsPMK6qow3Smh7ZQI4i/YFwX3PN/AV MhyIkXEE8BWwJ4Q+57nTY5Vc8pgmJu/sWeojFAKcK9KvD21pilMnNKVU16skRuw1APvDNpTlE sj8dxaDISWr693AGjHkAyi2gtbJoI+Di+4el29O8GzI8jdcRZvGpXOpiQe6G8i2w20bL/EbEP nmXPBw2osIJQgqMo Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2142 Lines: 47 On Tuesday 15 December 2015 10:33:25 Pali Roh?r wrote: > On Monday 30 November 2015 11:09:42 Nicolas Pitre wrote: > > On Mon, 30 Nov 2015, Pali Roh?r wrote: > > > On Monday 30 November 2015 07:23:53 Tony Lindgren wrote: > > > > * Pali Roh?r [151129 16:16]: > > > > > On Monday 30 November 2015 01:09:17 Nicolas Pitre wrote: > > > > > > On Sun, 29 Nov 2015, Russell King - ARM Linux wrote: > > > In arch/arm/kernel/setup.c is function setup_arch() and it calls: > > > > > > mdesc = setup_machine_fdt(__atags_pointer); > > > if (!mdesc) > > > mdesc = setup_machine_tags(__atags_pointer, __machine_arch_type); > > > > > > So it looks like that on atags address is stored either atags structure > > > or DT structure... so it is truth kernel uncompress code put DT blob to > > > same offset where is expected atags structure? > > > > No. It doesn't put it anywhere. Those functions read DT/ATAGs from the > > passed address. But you know this address won't be the one you want for > > the legacy ATAGs. > > > > What you should do is to add a init_early hook to your mdesc structure > > and retrieve your ATAGs from there directly at PAGE_OFFSET + 0x100. > > > > Now I suspect paging_init() marks the point where the ATAGs will be > > overwritten. To prevent this, you might have to add an additional tweak > > in arm_mm_memblock_reserve() similar to the one already present for > > CONFIG_SA1111. Something like: > > > > memblock_reserve(PHYS_OFFSET, PAGE_SIZE); > > > > And later on you can return that page back to the system. > > > > So am I understand correctly that solution would be to hack > arch/arm/mm/mmu.c to not overwrite page at PHYS_OFFSET? I would think we can just copy the data from PAGE_OFFSET + 0x100 to a some other page from your init_early hook. IIRC you can't use kmalloc there, but memblock_alloc() should work. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/