From: Pavel Machek <pavel@ucw.cz>
To: Jeff Ohlstein <johlstei@codeaurora.org>
Cc: Daniel Walker <dwalker@codeaurora.org>,
linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Stephen Boyd <sboyd@codeaurora.org>,
Abhijeet Dharmapurikar <adharmap@codeaurora.org>,
David Brown <davidb@codeaurora.org>,
Bryan Huntsman <bryanh@codeaurora.org>,
Russell King <linux@arm.linux.org.uk>
Subject: Re: [PATCH 1/5] msm: Secure Channel Manager (SCM) support
Date: Wed, 15 Dec 2010 08:48:11 +0100 [thread overview]
Message-ID: <20101215074811.GA2483@ucw.cz> (raw)
In-Reply-To: <1291619778-30289-2-git-send-email-johlstei@codeaurora.org>
Hi!
> +/**
> + * struct scm_response - one SCM response buffer
> + * @len: total available memory for response
> + * @buf_offset: start of response data relative to start of scm_response
> + * @is_complete: indicates if the command has finished processing
> + */
> +struct scm_response {
> + u32 len;
> + u32 buf_offset;
> + u32 is_complete;
> +};
Alignment is off here.
> +static u32 smc(dma_addr_t cmd_addr)
> +{
> + int context_id;
> + register u32 r0 asm("r0") = 1;
> + register u32 r1 asm("r1") = (u32)&context_id;
> + register u32 r2 asm("r2") = (u32)cmd_addr;
Are these neccessary?
> + asm(
> + __asmeq("%0", "r0")
> + __asmeq("%1", "r0")
> + __asmeq("%2", "r1")
> + __asmeq("%3", "r2")
> + "smc #0 @ switch to secure world\n"
> + : "=r" (r0)
> + : "r" (r0), "r" (r1), "r" (r2)
> + : "r3");
> + return r0;
> +}
> +u32 scm_get_version(void)
> +{
> + int context_id;
> + static u32 version = -1;
> + register u32 r0 asm("r0") = 0x1 << 8;
> + register u32 r1 asm("r1") = (u32)&context_id;
And does this even work?
> + if (version != -1)
> + return version;
> +
> + mutex_lock(&scm_lock);
> + asm(
> + __asmeq("%0", "r1")
> + __asmeq("%1", "r0")
> + __asmeq("%2", "r1")
> + "smc #0 @ switch to secure world\n"
> + : "=r" (r1)
> + : "r" (r0), "r" (r1)
> + : "r2", "r3");
> + version = r1;
> + mutex_unlock(&scm_lock);
> +
> + return version;
> +}
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2010-12-15 7:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-06 7:16 [PATCH 0/5] SMP support for msm Jeff Ohlstein
2010-12-06 7:16 ` [PATCH 1/5] msm: Secure Channel Manager (SCM) support Jeff Ohlstein
2010-12-06 20:00 ` Valdis.Kletnieks
2010-12-06 20:52 ` Russell King - ARM Linux
2010-12-15 7:48 ` Pavel Machek [this message]
2010-12-15 14:05 ` David Brown
2010-12-15 16:07 ` Russell King - ARM Linux
2010-12-06 7:16 ` [PATCH 2/5] msm: scm-boot: Support for setting cold/warm boot addresses Jeff Ohlstein
2010-12-06 7:16 ` [PATCH 3/5] msm: timer: SMP timer support for msm Jeff Ohlstein
2010-12-06 9:56 ` Thomas Gleixner
2010-12-06 10:20 ` Russell King - ARM Linux
2010-12-06 11:11 ` Thomas Gleixner
2010-12-07 4:49 ` Jeff Ohlstein
2010-12-07 8:17 ` Russell King - ARM Linux
2010-12-20 12:21 ` Russell King - ARM Linux
2010-12-06 7:16 ` [PATCH 4/5] msm: hotplug: support cpu hotplug on msm Jeff Ohlstein
2010-12-06 7:16 ` [PATCH 5/5] msm: add SMP support for msm Jeff Ohlstein
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=20101215074811.GA2483@ucw.cz \
--to=pavel@ucw.cz \
--cc=adharmap@codeaurora.org \
--cc=bryanh@codeaurora.org \
--cc=davidb@codeaurora.org \
--cc=dwalker@codeaurora.org \
--cc=johlstei@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=sboyd@codeaurora.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).