linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sonny Rao <sonnyrao@chromium.org>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	Doug Anderson <dianders@chromium.org>,
	Will Deacon <Will.Deacon@arm.com>,
	"olof@lixom.net" <olof@lixom.net>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Mark Rutland <Mark.Rutland@arm.com>,
	Sudeep Holla <Sudeep.Holla@arm.com>,
	Christopher Covington <cov@codeaurora.org>,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Nathan Lynch <Nathan_Lynch@mentor.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	Pawel Moll <Pawel.Moll@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	"galak@codeaurora.org" <galak@codeaurora.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Heiko Stuebner <heiko@sntech.de>
Subject: Re: [PATCH v2] clocksource: arch_timer: Allow the device tree to specify the physical timer
Date: Thu, 11 Sep 2014 20:25:27 -0700	[thread overview]
Message-ID: <CAPz6YkUOR-+CEx__FGZkR42RRcn7hjdR_B95MBBe2zfR-70fqQ@mail.gmail.com> (raw)
In-Reply-To: <541249B8.301@codeaurora.org>

On Thu, Sep 11, 2014 at 6:17 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> On 09/11/14 17:14, Sonny Rao wrote:
>
> On Thu, Sep 11, 2014 at 4:56 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
>>
>>
>> Where does this platform jump to when a CPU comes up? Is it
>> rockchip_secondary_startup()? I wonder if that path could have this
>> little bit of assembly to poke the cntvoff in monitor mode and then jump
>> to secondary_startup()? Before we boot any secondary CPUs we could also
>> read the cntvoff for CPU0 in the platform specific layer (where we know
>> we're running in secure mode) and then use that value as the "reset"
>> value for the secondaries. Or does this platform boot up in secure mode
>> some times and non-secure mode other times?
>
>
> Yes, In our case, with our firmware, we will go through some internal Rom
> code and then jump to rockchip_secondary_startup, but I don't think it's
> correct to force all users of this SoC to do it that way.
>
>
> What's being forced? The way internal rom jumps to sram? Is there any other
> way that secondary CPUs come out of reset on this SoC? From looking at the
> code it seems like the only path is internal rom jumps to sram (where
> rockchip_secondary_trampoline lives) which jumps to
> rockchip_secondary_startup() which then does an invalidate and jump to
> secondary_startup(). Linux controls everything besides the internal rom. Is
> something different in your case?


There are other ways it can be done, and I don't know all of the
possibilities, but there seems to be some protocol with the iROM that
tells it where to go, which the current SMP patches are using by
putting a magic number and an address in SRAM.  I think it's true that
in our case, it really is pretty simple and we have secure SVC mode
and not much else runs (besides the iROM).

Since I don't know all of the possibilities, I didn't want to preclude
the possibility that someone else handled things differently and
entered the kernel in non-secure mode, and have some code there that
broke in that instance, that's all I meant by "forced".

>
>  If there were a reasonable way to determine for sure that we are in secure
> mode, then yes we could do what you're suggesting, and I'd be happy to code
> that up.
>
>
> I think the problem is that there isn't a great way to determine whether
> we're in secure mode or not, and this is maybe by design?  I don't
> particularly understand that design choice.  It would be nice to hear some
> rationale from ARM folks.
>
>
> I'm thinking we would have a different boot-method for secure vs. non-secure
> and then we would know to configure cntvoff or not based on the boot method.
> Isn't that a reasonable way of knowing what should be done? It seems like we
> can at least modify the DT for this SoC.

Putting something into the device-tree is in fact the point of this
patch, so it is sort of doing what you're suggesting, although this
patch is about being able use to physical counters and doesn't
indicate anything about secure vs non-secure.  What else do you think
could be used to differentiate between the two cases, besides putting
it into the DT?

>
> I still wonder if there is such a bootloader/hypervisor/rom that's putting
> this SoC into non-secure mode and not configuring cntvoff. Doug's comments
> seem to suggest that the whole world would be different if this were true.
> Maybe Heiko knows?

As far as I'm aware, there's no bootloader/firmware that's ever
putting the CPU into non-secure mode for our case.

> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> hosted by The Linux Foundation

  parent reply	other threads:[~2014-09-12  3:25 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11 16:16 [PATCH v2] clocksource: arch_timer: Allow the device tree to specify the physical timer Doug Anderson
2014-09-11 16:47 ` Will Deacon
2014-09-11 16:59   ` Doug Anderson
2014-09-11 17:07     ` Will Deacon
2014-09-11 17:14       ` Doug Anderson
2014-09-11 17:00   ` Marc Zyngier
2014-09-11 17:11     ` Doug Anderson
2014-09-11 17:22       ` Marc Zyngier
2014-09-11 17:29         ` Doug Anderson
2014-09-11 17:43           ` Marc Zyngier
2014-09-11 23:55             ` Doug Anderson
2014-09-11 23:56             ` Stephen Boyd
2014-09-12  0:01               ` Doug Anderson
2014-09-12 10:20                 ` Marc Zyngier
     [not found]               ` <CAPz6YkUTXU9_b2BU5QghKTHVTJ3ngVX9EOzsMWnjigtV9TioHw@mail.gmail.com>
     [not found]                 ` <541249B8.301@codeaurora.org>
2014-09-12  3:25                   ` Sonny Rao [this message]
2014-09-12 11:43             ` Christopher Covington
2014-09-12 12:14               ` Marc Zyngier
2014-09-12 18:59                 ` Stephen Boyd
2014-09-15 11:10                   ` Catalin Marinas
2014-09-15 20:33                     ` Stephen Boyd
2014-09-15 21:47                       ` Sonny Rao
2014-09-15 21:49                         ` Stephen Boyd
2014-09-15 21:52                           ` Sonny Rao
2014-09-15 22:04                             ` Sonny Rao
2014-09-15 22:51                               ` Christopher Covington
2014-09-16  0:24                                 ` Sonny Rao
2014-09-16 10:42                                 ` Catalin Marinas
2014-09-16 11:22                                   ` Christopher Covington
2014-09-16 11:03                       ` Catalin Marinas

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=CAPz6YkUOR-+CEx__FGZkR42RRcn7hjdR_B95MBBe2zfR-70fqQ@mail.gmail.com \
    --to=sonnyrao@chromium.org \
    --cc=Catalin.Marinas@arm.com \
    --cc=Lorenzo.Pieralisi@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=Nathan_Lynch@mentor.com \
    --cc=Pawel.Moll@arm.com \
    --cc=Sudeep.Holla@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=cov@codeaurora.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=galak@codeaurora.org \
    --cc=heiko@sntech.de \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=olof@lixom.net \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=tglx@linutronix.de \
    /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).