From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: Reading twd_base at run-time
Date: Wed, 01 Apr 2015 15:56:47 +0100 [thread overview]
Message-ID: <551C072F.4090800@arm.com> (raw)
In-Reply-To: <551C0325.7090500@free.fr>
On 01/04/15 15:39, Mason wrote:
> On 01/04/2015 15:14, Marc Zyngier wrote:
>> On 01/04/15 14:01, Mason wrote:
>>> On 01/04/2015 14:28, Marc Zyngier wrote:
>>>
>>>> It is worth mentioning that PERIPH_BASE is *not* an architected
>>>> register, so an implementation is perfectly allowed not to implement it.
>>>> Even on Cortex A9, a UP implementation will report PERIPH_BASE as zero.
>>>> It is still likely to have a TWD though.
>>>
>>> It is interesting that you would mention TWD and UP implementations,
>>> because "config HAVE_ARM_TWD" depends on SMP, as I mentioned in a
>>> separate thread ("Dropping "depends on SMP" for HAVE_ARM_TWD").
>>>
>>> Would it make sense to drop the dependency?
>>>
>>> I have a single-core Cortex A9 MPcore system where I want to use
>>> the local timers. If it's too much trouble changing the build
>>> options, I suppose I can just run an SMP kernel?
>>
>> There used to be a time where the TWD was completely tied to the SMP
>> code, but I think we now deal with per-cpu timers in a way similar to
>> the global timers (more or less...).
>>
>> Worth trying, and see what breaks. On the other hand, SMP on UP should
>> give you the same result.
>
> And now that you mention SMP_ON_UP and TI, I remembered just where
> I got the crazy idea to get PERIPH_BASE from CP15 ;-)
>
> commit bc41b8724 ("Update SMP_ON_UP code to detect A9MPCore with
> 1 CPU devices")
>
> arch/arm/kernel/head.S | 21 ++++++++++++++++++++-
>
> @ If a future SoC *does* use 0x0 as the PERIPH_BASE, then the
> @ below address check will need to be #ifdef'd or equivalent
> @ for the Aegis platform.
> mrc p15, 4, r0, c15, c0 @ get SCU base address
> teq r0, #0x0 @ '0' on actual UP A9 hardware
> beq __fixup_smp_on_up @ So its an A9 UP
>
>
> Isn't this as problematic here as doing it later in the boot.
The problem is that this is the only known way to detect this horrible
piece of junk. Otherwise, we're going to treat it as a proper SMP
platform, and things will break (the HW advertises itself as MPx1, but
has no SCU).
> Is the DT data already available in head.S?
It is available in the sense that it is in memory, but at that stage,
we're not in a position to use it. We're at a point where we're barely
finding out what sort of CPU we have.
DT will only be really available much later in the boot process.
M.
--
Jazz is not dead. It just smells funny...
prev parent reply other threads:[~2015-04-01 14:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 16:16 Reading twd_base at run-time Mason
2015-03-27 16:35 ` Marc Zyngier
2015-03-27 20:33 ` Mason
2015-03-27 20:53 ` Russell King - ARM Linux
2015-04-01 12:07 ` Mason
2015-04-01 12:12 ` Russell King - ARM Linux
2015-04-01 12:47 ` Mason
2015-04-01 12:28 ` Marc Zyngier
2015-04-01 12:47 ` Mason
2015-04-01 13:01 ` Mason
2015-04-01 13:14 ` Marc Zyngier
2015-04-01 14:39 ` Mason
2015-04-01 14:56 ` Marc Zyngier [this message]
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=551C072F.4090800@arm.com \
--to=marc.zyngier@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.