linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
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 17:34:15 -0500	[thread overview]
Message-ID: <5150D0E7.90101@gmail.com> (raw)
In-Reply-To: <CAHTX3d+1auKVLko+LKAA+a4rh4Rfw19ggzmS7DhvYuuCAWUwHA@mail.gmail.com>

On 03/25/2013 11:07 AM, Michal Simek wrote:
> 2013/3/25 Rob Herring <robherring2@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.
> 
> yeah correct. I will add there a comment to mentioned that.

I think leaving the define would be better, but either way is fine.

>>> 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.
> 
> What's the functions for that?
> From my point of view is better to read it directly on SoC and not to read
> dts. It should be also faster.

Actually, I think you just remove all the code related to
set_cpu_possible().

The relevant function is arm_dt_init_cpu_maps.

Rob

  reply	other threads:[~2013-03-25 22:34 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
2013-03-25 16:07         ` Michal Simek
2013-03-25 22:34           ` Rob Herring [this message]
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=5150D0E7.90101@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).