From: "Pali Rohár" <pali.rohar@gmail.com>
To: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: "Tony Lindgren" <tony@atomide.com>,
"Russell King - ARM Linux" <linux@arm.linux.org.uk>,
"Arnd Bergmann" <arnd@arndb.de>,
linux-arm-kernel@lists.infradead.org,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"Ivaylo Dimitrov" <ivo.g.dimitrov.75@gmail.com>,
"Laura Abbott" <lauraa@codeaurora.org>,
"Sebastian Reichel" <sre@debian.org>,
"Will Deacon" <will.deacon@arm.com>,
linux-kernel@vger.kernel.org,
"Rob Herring" <robherring2@gmail.com>,
"Pavel Machek" <pavel@ucw.cz>,
"Grant Likely" <grant.likely@linaro.org>,
linux-omap@vger.kernel.org,
"Frank Rowand" <frowand.list@gmail.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [PATCH 5/5] arm: boot: store ATAGs structure into DT "/chosen/linux,atags" entry
Date: Tue, 15 Dec 2015 10:33:25 +0100 [thread overview]
Message-ID: <20151215093325.GK13531@pali> (raw)
In-Reply-To: <alpine.LFD.2.20.1511301041090.22569@knanqh.ubzr>
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 <pali.rohar@gmail.com> [151129 16:16]:
> > > > On Monday 30 November 2015 01:09:17 Nicolas Pitre wrote:
> > > > > On Sun, 29 Nov 2015, Russell King - ARM Linux wrote:
> > > > > > On Sat, Nov 28, 2015 at 12:34:23PM -0500, Nicolas Pitre wrote:
> > > > > > > Good. And Arnd likes the idea too. So we might be converging at
> > > > > > > last which is a good thing.
> > > > > >
> > > > > > I disagree with the idea that there is convergence. There might be
> > > > > > convergence towards an idea, but... Here's a mail extract, from
> > > > > > July 7th, from earlier in this very thread:
> > > > > >
> > > > > > Pali:
> > > > > > > Me:
> > > > > > > > Are the ATAGs at a fixed address on the N900?
> > > > > > >
> > > > > > > Yes, in board-rx51.c is:
> > > > > > >
> > > > > > > .atag_offset = 0x100
> > > > > > >
> > > > > > > and Nokia Bootloader (proprietary) store them to that address.
> > > > > > >
> > > > > > > > Can that be handled in
> > > > > > > > some kind of legacy file for the N900 which calls save_atags()
> > > > > > > > on it, so we don't end up introducing yet more stuff that we
> > > > > > > > have to maintain into the distant future? If not, what about
> > > > > > > > copying a known working atag structure into a legacy file for
> > > > > > > > the N900?
> > > > > > >
> > > > > > > I already asked question if it is possible to read ATAGs from DT
> > > > > > > booted kernel. And somebody (do not remember who) wrote to ML,
> > > > > > > that it is not possible and it can be done in that uncompress
> > > > > > > code.
> > > > >
> > > > > Who is that somebody? If ever it happened to be me then objection is
> > > > > withdrawn. Otherwise that somebody should come forth and speak up
> > > > > again.
> > > > >
> > > >
> > > > ... do not remember ... this discussion were in more email threads and
> > > > takes more then one year... sorry but my memory is not excellent
> > >
> > > Yes this certainly seems like the best solution. I think we got into
> > > the atags-to-dt track as some of the atags are already being translated.
> > >
> > > In this case there's no need to translate them AFAIK. You can just
> > > parse them and have them available for the user space. So as long as
> > > nothing trashes the atags at the atag_offset, you should be able to
> > > call a function to parse them in the n900 specific init_machine.
> > >
> > > Regards,
> > >
> > > Tony
> >
> > 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.
>
>
> Nicolas
So am I understand correctly that solution would be to hack
arch/arm/mm/mmu.c to not overwrite page at PHYS_OFFSET?
And should be this just when when we detect Nokia N900 in DT? Or for all
OMAP2 boards? Or all ARM boards?
--
Pali Rohár
pali.rohar@gmail.com
next prev parent reply other threads:[~2015-12-15 9:33 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-06 20:26 [PATCH 0/5] ATAGs to DT patches Pali Rohár
2015-07-06 20:26 ` [PATCH 1/5] arm: devtree: Set system_rev from DT "/revision" Pali Rohár
2015-12-24 19:02 ` Pali Rohár
2015-12-28 21:01 ` Frank Rowand
[not found] ` <5681A322.2090204-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-28 22:27 ` Arnd Bergmann
2016-01-05 11:37 ` Pali Rohár
2016-01-05 11:45 ` Arnd Bergmann
2016-02-05 18:15 ` [PATCH] ARM: RX51: Set system_rev from ATAGS Ivaylo Dimitrov
2016-02-08 20:48 ` Tony Lindgren
2016-02-08 21:10 ` Pali Rohár
2016-02-09 16:17 ` Tony Lindgren
2016-02-10 18:23 ` [PATCH v1] " Ivaylo Dimitrov
2016-02-11 0:19 ` Tony Lindgren
2015-07-06 20:26 ` [PATCH 2/5] arm: boot: convert ATAG_REVISION to DT "/revision" entry Pali Rohár
2015-07-06 20:26 ` [PATCH 3/5] arm: atags: Fix declaration of function save_atags Pali Rohár
2015-07-06 20:26 ` [PATCH 4/5] arm: devtree: Read ATAGs structure from DT "/chosen/linux,atags" entry Pali Rohár
2015-07-06 20:26 ` [PATCH 5/5] arm: boot: store ATAGs structure into " Pali Rohár
2015-07-07 11:32 ` Russell King - ARM Linux
2015-07-07 11:58 ` Pali Rohár
2015-07-13 13:19 ` Tony Lindgren
2015-10-12 20:16 ` Tony Lindgren
2015-10-12 20:25 ` Pali Rohár
2015-10-12 20:45 ` Tony Lindgren
2015-10-13 14:37 ` Pali Rohár
2015-11-05 11:40 ` Pali Rohár
2015-11-05 16:17 ` Tony Lindgren
2015-11-12 1:10 ` Frank Rowand
2015-11-22 6:51 ` Pavel Machek
2015-11-23 14:45 ` Pali Rohár
2015-11-25 18:16 ` Tony Lindgren
2015-11-25 19:48 ` Arnd Bergmann
2015-11-25 21:03 ` Tony Lindgren
2015-11-25 21:29 ` Arnd Bergmann
2015-11-25 21:44 ` Pali Rohár
2015-11-25 21:51 ` Arnd Bergmann
2015-11-25 22:00 ` Pali Rohár
2015-11-26 4:19 ` Frank Rowand
2015-11-26 9:07 ` Pali Rohár
2015-11-26 20:39 ` Tony Lindgren
2015-11-26 21:12 ` Ivaylo Dimitrov
2015-11-27 8:38 ` Pali Rohár
2015-11-27 8:44 ` Michael Trimarchi
2015-11-27 8:52 ` Michael Trimarchi
2015-11-27 14:51 ` Tony Lindgren
2015-11-27 13:27 ` Russell King - ARM Linux
[not found] ` <20151127132722.GA30871-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-11-27 19:51 ` Russell King - ARM Linux
2015-11-27 21:06 ` Arnd Bergmann
2015-11-27 23:28 ` Nicolas Pitre
[not found] ` <alpine.LFD.2.20.1511271817230.22569-fMhRO7WWcppj+hNMo8g0rg@public.gmane.org>
2015-11-28 12:27 ` Arnd Bergmann
2015-11-28 12:54 ` Russell King - ARM Linux
2015-11-28 12:33 ` Russell King - ARM Linux
2015-11-28 17:34 ` Nicolas Pitre
[not found] ` <alpine.LFD.2.20.1511281232440.22569-fMhRO7WWcppj+hNMo8g0rg@public.gmane.org>
2015-11-28 21:02 ` Frank Rowand
2015-11-29 18:09 ` Russell King - ARM Linux
2015-11-29 18:19 ` Pali Rohár
2015-11-29 23:13 ` Russell King - ARM Linux
2015-11-30 0:09 ` Nicolas Pitre
[not found] ` <alpine.LFD.2.20.1511291902100.22569-fMhRO7WWcppj+hNMo8g0rg@public.gmane.org>
2015-11-30 0:15 ` Pali Rohár
2015-11-30 15:23 ` Tony Lindgren
[not found] ` <20151130152352.GY2517-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2015-11-30 15:39 ` Pali Rohár
2015-11-30 16:09 ` Nicolas Pitre
2015-12-15 9:33 ` Pali Rohár [this message]
2015-12-15 11:04 ` Arnd Bergmann
2015-12-15 12:20 ` Russell King - ARM Linux
[not found] ` <20151215122038.GI30871-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-12-15 17:24 ` Nicolas Pitre
2015-12-23 14:54 ` Ivaylo Dimitrov
2015-11-28 4:06 ` [PATCH 0/5] ATAGs to DT patches Frank Rowand
2015-11-28 5:55 ` Frank Rowand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151215093325.GK13531@pali \
--to=pali.rohar@gmail.com \
--cc=afaerber@suse.de \
--cc=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=grant.likely@linaro.org \
--cc=ivo.g.dimitrov.75@gmail.com \
--cc=lauraa@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nicolas.pitre@linaro.org \
--cc=pavel@ucw.cz \
--cc=robherring2@gmail.com \
--cc=sre@debian.org \
--cc=tony@atomide.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).