From: Chen-Yu Tsai <wens@csie.org>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: "Chen-Yu Tsai" <wens@csie.org>,
"Nicolas Pitre" <nicolas.pitre@linaro.org>,
"Dave Martin" <Dave.Martin@arm.com>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-sunxi <linux-sunxi@googlegroups.com>,
"Heiko Stübner" <heiko@sntech.de>
Subject: Re: [linux-sunxi] Re: [RFC 7/7] ARM: dts: sun9i: Add secure SRAM node used for MCPM SMP hotplug
Date: Sun, 24 May 2015 23:55:22 +0800 [thread overview]
Message-ID: <CAGb2v67+F_cnjHXgGwbewPODG=mLMPGaZCzvvLfXL=A3huceew@mail.gmail.com> (raw)
In-Reply-To: <20150520100831.GE4004@lukather>
On Wed, May 20, 2015 at 6:08 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Thu, May 14, 2015 at 02:10:11PM +0800, Chen-Yu Tsai wrote:
>> The A80 stores some magic flags in a portion of the secure SRAM. The
>> BROM jumps directly to the software entry point set by the SMP code
>> if the flags are set. This is required for CPU0 hotplugging.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> ---
>> arch/arm/boot/dts/sun9i-a80.dtsi | 20 ++++++++++++++++++++
>> 1 file changed, 20 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun9i-a80.dtsi b/arch/arm/boot/dts/sun9i-a80.dtsi
>> index 1507bd2a88f0..0695215634d4 100644
>> --- a/arch/arm/boot/dts/sun9i-a80.dtsi
>> +++ b/arch/arm/boot/dts/sun9i-a80.dtsi
>> @@ -366,6 +366,26 @@
>> */
>> ranges = <0 0 0 0x20000000>;
>>
>> + sram_b: sram@00020000 {
>> + /* 256 KiB secure SRAM at 0x20000 */
>> + compatible = "mmio-sram";
>> + reg = <0x00020000 0x40000>;
>> +
>
> We should probably add a property to that SRAM to tell the driver not
> to access it if we're not booted in secure mode.
(CC-ing Heiko...)
That kind of puts architecture (ARM) dependent code into a platform
driver. Furthermore, AFAIK there isn't a safe way to check if we're
in secure mode or not. Checking SCR raises an undefined instruction
exception in non-secure mode. Can the kernel handle that? I really
don't understand this bit well.
> Otherwise, bad things might happen.
The kernel (or rather the bootloader) boots in secure mode by default,
and we don't have any bootloader support to boot into non-secure mode
ATM. Couldn't we have the bootloader mark the SRAM as disabled when
booting into non-secure when we add that support?
ChenYu
next prev parent reply other threads:[~2015-05-24 15:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 6:10 [RFC 0/7] ARM: sun9i: SMP support with Multi-Cluster Power Management Chen-Yu Tsai
2015-05-14 6:10 ` [RFC 1/7] ARM: sun9i: Support SMP on A80 with Multi-Cluster Power Management (MCPM) Chen-Yu Tsai
2015-05-14 6:10 ` [RFC 2/7] ARM: dts: sun9i: Add CCI-400 device nodes for A80 Chen-Yu Tsai
2015-05-17 14:51 ` Maxime Ripard
2015-05-19 7:12 ` Chen-Yu Tsai
2015-05-14 6:10 ` [RFC 3/7] ARM: dts: sun9i: Add CPUCFG device node for A80 dtsi Chen-Yu Tsai
2015-05-14 6:10 ` [RFC 4/7] ARM: dts: sun9i: Add PRCM device node for the " Chen-Yu Tsai
2015-05-17 14:54 ` Maxime Ripard
2015-05-19 3:08 ` Chen-Yu Tsai
2015-05-14 6:10 ` [RFC 5/7] ARM: sunxi: mcpm: Support CPU/cluster power down and hotplugging for cpu1~7 Chen-Yu Tsai
2015-05-14 6:10 ` [RFC 6/7] ARM: sunxi: mcpm: Support cpu0 hotplug Chen-Yu Tsai
2015-05-14 6:10 ` [RFC 7/7] ARM: dts: sun9i: Add secure SRAM node used for MCPM SMP hotplug Chen-Yu Tsai
2015-05-20 10:08 ` Maxime Ripard
2015-05-24 15:55 ` Chen-Yu Tsai [this message]
2015-05-25 21:24 ` [linux-sunxi] " Maxime Ripard
2015-05-26 16:47 ` Chen-Yu Tsai
2015-06-11 16:33 ` Maxime Ripard
2015-05-16 10:08 ` [linux-sunxi] [RFC 0/7] ARM: sun9i: SMP support with Multi-Cluster Power Management Ian Campbell
2015-05-17 14:38 ` Maxime Ripard
2015-05-18 5:19 ` Nicolas Pitre
2015-05-18 9:04 ` Maxime Ripard
2015-05-19 2:51 ` Chen-Yu Tsai
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='CAGb2v67+F_cnjHXgGwbewPODG=mLMPGaZCzvvLfXL=A3huceew@mail.gmail.com' \
--to=wens@csie.org \
--cc=Dave.Martin@arm.com \
--cc=heiko@sntech.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=maxime.ripard@free-electrons.com \
--cc=nicolas.pitre@linaro.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).