From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/10] arm: zynq: Load scu baseaddress at run time
Date: Mon, 25 Mar 2013 10:37:21 -0500 [thread overview]
Message-ID: <51506F31.2080709@gmail.com> (raw)
In-Reply-To: <CAHTX3dJfvFNNuyJC54fS=NCpRxovVsxHTss8wJd_QOB2PaxL7g@mail.gmail.com>
On 03/25/2013 09:51 AM, Michal Simek wrote:
> Hi Rob,
>
> 2013/3/25 Rob Herring <robherring2@gmail.com>:
>> On 03/25/2013 08:53 AM, Michal Simek wrote:
>>> Use Cortex a9 cp15 to read scu baseaddress.
[...]
>>> +static void __init scu_init(void)
>>> +{
>>> + unsigned long base;
>>> +
>>> + base = scu_a9_get_base();
>>> + zynq_cortex_a9_scu_map.pfn = __phys_to_pfn(base);
>>> + zynq_cortex_a9_scu_map.virtual = base;
>>
>> You are setting the virtual address to the physical base?
>>
>>> + iotable_init(&zynq_cortex_a9_scu_map, 1);
>>
>> Then creating a static mapping...
>>
>>> + scu_base = ioremap(base, zynq_cortex_a9_scu_map.length);
>>
>> And also a dynamic mapping?
>
> Yes - exactly.
You are simply getting lucky that it works. If the physical address did
not happen to be in the vmalloc address region, it would not work. You
should not do this because you have an implicit requirement and the code
will look broken to anyone that reads it.
> I was talking to Olof about this code at ELC and he mentioned that someone
> else might know better way how to do it.
>
> It is quite a long time I played with this code.
> I found this solution in vexpress platform (mach-vexpress/platsmp.c)
>
> IRC: Static mapping is necessary to be able to access device so early.
Only to read the number of cores. That's not really worth an early
mapping. I would move to using DT to count the number of cores. Support
for that is already in place.
> On the other hand you can't use this static mapping when kernel runs
> for that you need to use dynamic allocation.
> Calling ioremap so early caused that the return address is the same
> and you can just use it later. and it is also in the correct vmalloc area.
>
> We are using scu_base for power management code.
> Let me check if dynamic mapping is also required.
The should be no reason you need both.
Rob
next prev parent reply other threads:[~2013-03-25 15:37 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-25 13:53 [PATCH 01/10] arm: zynq: Use standard timer binding Michal Simek
2013-03-25 13:53 ` [PATCH 02/10] arm: zynq: Move timer to clocksource interface Michal Simek
2013-03-25 13:53 ` [PATCH 03/10] arm: zynq: Move timer to generic location Michal Simek
2013-03-25 16:01 ` Steffen Trumtrar
2013-03-25 16:24 ` Michal Simek
2013-03-25 13:53 ` [PATCH 04/10] arm: zynq: Load scu baseaddress at run time Michal Simek
2013-03-25 14:06 ` Rob Herring
2013-03-25 14:51 ` Michal Simek
2013-03-25 15:37 ` Rob Herring [this message]
2013-03-25 16:07 ` Michal Simek
2013-03-25 22:34 ` Rob Herring
2013-03-26 10:45 ` Michal Simek
2013-03-26 12:28 ` Rob Herring
2013-03-26 12:33 ` Michal Simek
2013-04-02 16:40 ` Pawel Moll
[not found] ` <CAHTX3dKD4G0E8qoxTR2HnJVdagoeOerM+TiZzkJUPjcGwYdX_Q@mail.gmail.com>
2013-04-03 7:25 ` Steffen Trumtrar
2013-04-03 16:06 ` Pawel Moll
[not found] ` <CAHTX3dJMpp+E2u-cAeYbqtxC1WAYWpCeRx6W7G=dWDcgzUz5DA@mail.gmail.com>
2013-04-03 17:11 ` Pawel Moll
2013-03-25 13:53 ` [PATCH 05/10] arm: zynq: Move slcr initialization to separate file Michal Simek
2013-03-25 16:19 ` Steffen Trumtrar
2013-03-25 16:37 ` Michal Simek
2013-03-25 13:53 ` [PATCH 06/10] arm: zynq: Add support for system reset Michal Simek
2013-03-25 13:53 ` [PATCH 07/10] arm: zynq: Add support for pmu Michal Simek
2013-03-25 13:53 ` [PATCH 08/10] arm: zynq: Add smp support Michal Simek
2013-03-25 14:16 ` Rob Herring
2013-03-25 16:31 ` Michal Simek
2013-03-25 22:10 ` Rob Herring
2013-03-26 7:42 ` Michal Simek
2013-04-01 22:40 ` Rob Herring
2013-04-03 6:44 ` Michal Simek
2013-03-25 13:53 ` [PATCH 09/10] arm: zynq: Add hotplug support Michal Simek
2013-03-25 13:53 ` [PATCH 10/10] arm: zynq: Add cpuidle support Michal Simek
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=51506F31.2080709@gmail.com \
--to=robherring2@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).