All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mark A. Greer" <mgreer@animalcreek.com>
To: Paul Walmsley <paul@pwsan.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/7] ARM: OMAP2xxx: hwmod: Convert SHAM crypto device data to hwmod
Date: Tue, 23 Oct 2012 15:02:37 -0700	[thread overview]
Message-ID: <20121023220237.GA19671@animalcreek.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1210221935320.13464@utopia.booyaka.com>

On Mon, Oct 22, 2012 at 07:49:47PM +0000, Paul Walmsley wrote:
> On Mon, 22 Oct 2012, Mark A. Greer wrote:
> 
> > On Sat, Oct 20, 2012 at 07:40:19PM +0000, Paul Walmsley wrote:
> >
> > > >  static void omap_init_sham(void)
> > > >  {
> > > > -	if (cpu_is_omap24xx()) {
> > > > -		sham_device.resource = omap2_sham_resources;
> > > > -		sham_device.num_resources = omap2_sham_resources_sz;
> > > > +	if (cpu_is_omap24xx() &&
> > > > +	    (omap2_cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_IDLEST4) &
> > > > +						 OMAP24XX_ST_SHA_MASK)) {
> > > 
> > > Hmm.  Not sure I understand the purpose of this CM read.  Don't we want to 
> > > initialize this device unconditionally?
> > 
> > No, the device doesn't exist on all parts.
> 
> It should exist on all OMAP2xxx, AFAIK.  (Whether some bootloader 
> firewalled it off is another matter, of course.)
> 
> >  This is the only way to tell if its there (AFAIK).
> 
> Hmm.  I don't think the CM_IDLEST bits work that way, in the general case.  
> They just indicate whether the PRCM considers that IP block to be 
> currently accessible.  So for example if the clocks are disabled to an IP 
> block, the CM_IDLEST bit would indicate that it's not accessible.  The 
> software could then enable the clocks, and the CM_IDLEST bit would 
> indicate that it is accessible.  We use this in the clock framework and 
> hwmod code after enabling clocks to wait until the system considers the IP 
> block accessible.  See for example
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/arm/mach-omap2/clock.c;h=961ac8f7e13d8c84a1cbb4587255ea685520bd18;hb=HEAD#l80
> 
> ...
> 
> Now it's possible that on some TI chips, the CM_IDLEST bit is tied to the 
> SIdleAck signal originating from the IP block.  (I've been told that on 
> other OMAPs, CM_IDLEST is actually tied to the SIdleReq signal originating 
> from the PRCM, which is not terribly useful...)  So if it's tied to the 
> SIdleAck signal, and the PRCM clocks are enabled, then it might provide an 
> indication of whether the IP block exists on that chip.  But ultimately 
> the IP block might still be firewalled off even if it appears to exist to 
> the PRCM.  So for 3xxx, I'd suggest just adding it to the appropriate 
> GP-specific hwmod init lists, such as omap3xxx_gp_hwmod_ocp_ifs.

Paul, thank you for the clear explanation.

I've talked to some hardware guys and I have come to the following
conclusions:

a) What you say above about CM_IDLEST is correct.
b) There seems to be no good way, in general, to tell if the SHA
   (or AES or RNG or ...) module exists.
c) The best thing to do is what you suggest and add the SHA hwmod
   data for all omap2's and omap3 GP's.

I will respin my patches with everyone's comments addressed later today.

Thanks everyone.

Mark
--

WARNING: multiple messages have this Message-ID (diff)
From: mgreer@animalcreek.com (Mark A. Greer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] ARM: OMAP2xxx: hwmod: Convert SHAM crypto device data to hwmod
Date: Tue, 23 Oct 2012 15:02:37 -0700	[thread overview]
Message-ID: <20121023220237.GA19671@animalcreek.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1210221935320.13464@utopia.booyaka.com>

On Mon, Oct 22, 2012 at 07:49:47PM +0000, Paul Walmsley wrote:
> On Mon, 22 Oct 2012, Mark A. Greer wrote:
> 
> > On Sat, Oct 20, 2012 at 07:40:19PM +0000, Paul Walmsley wrote:
> >
> > > >  static void omap_init_sham(void)
> > > >  {
> > > > -	if (cpu_is_omap24xx()) {
> > > > -		sham_device.resource = omap2_sham_resources;
> > > > -		sham_device.num_resources = omap2_sham_resources_sz;
> > > > +	if (cpu_is_omap24xx() &&
> > > > +	    (omap2_cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_IDLEST4) &
> > > > +						 OMAP24XX_ST_SHA_MASK)) {
> > > 
> > > Hmm.  Not sure I understand the purpose of this CM read.  Don't we want to 
> > > initialize this device unconditionally?
> > 
> > No, the device doesn't exist on all parts.
> 
> It should exist on all OMAP2xxx, AFAIK.  (Whether some bootloader 
> firewalled it off is another matter, of course.)
> 
> >  This is the only way to tell if its there (AFAIK).
> 
> Hmm.  I don't think the CM_IDLEST bits work that way, in the general case.  
> They just indicate whether the PRCM considers that IP block to be 
> currently accessible.  So for example if the clocks are disabled to an IP 
> block, the CM_IDLEST bit would indicate that it's not accessible.  The 
> software could then enable the clocks, and the CM_IDLEST bit would 
> indicate that it is accessible.  We use this in the clock framework and 
> hwmod code after enabling clocks to wait until the system considers the IP 
> block accessible.  See for example
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/arm/mach-omap2/clock.c;h=961ac8f7e13d8c84a1cbb4587255ea685520bd18;hb=HEAD#l80
> 
> ...
> 
> Now it's possible that on some TI chips, the CM_IDLEST bit is tied to the 
> SIdleAck signal originating from the IP block.  (I've been told that on 
> other OMAPs, CM_IDLEST is actually tied to the SIdleReq signal originating 
> from the PRCM, which is not terribly useful...)  So if it's tied to the 
> SIdleAck signal, and the PRCM clocks are enabled, then it might provide an 
> indication of whether the IP block exists on that chip.  But ultimately 
> the IP block might still be firewalled off even if it appears to exist to 
> the PRCM.  So for 3xxx, I'd suggest just adding it to the appropriate 
> GP-specific hwmod init lists, such as omap3xxx_gp_hwmod_ocp_ifs.

Paul, thank you for the clear explanation.

I've talked to some hardware guys and I have come to the following
conclusions:

a) What you say above about CM_IDLEST is correct.
b) There seems to be no good way, in general, to tell if the SHA
   (or AES or RNG or ...) module exists.
c) The best thing to do is what you suggest and add the SHA hwmod
   data for all omap2's and omap3 GP's.

I will respin my patches with everyone's comments addressed later today.

Thanks everyone.

Mark
--

  reply	other threads:[~2012-10-23 22:02 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 21:53 [PATCH 0/7] crypto: omap-sham updates Mark A. Greer
2012-10-19 21:53 ` Mark A. Greer
2012-10-19 21:53 ` [PATCH 1/7] ARM: OMAP2xxx: hwmod: Convert SHAM crypto device data to hwmod Mark A. Greer
2012-10-19 21:53   ` Mark A. Greer
2012-10-20 19:40   ` Paul Walmsley
2012-10-20 19:40     ` Paul Walmsley
2012-10-22 19:33     ` Mark A. Greer
2012-10-22 19:33       ` Mark A. Greer
2012-10-22 19:49       ` Paul Walmsley
2012-10-22 19:49         ` Paul Walmsley
2012-10-23 22:02         ` Mark A. Greer [this message]
2012-10-23 22:02           ` Mark A. Greer
2012-10-19 21:53 ` [PATCH 2/7] ARM: OMAP2xxx: hwmod: Add DMA information for SHAM module Mark A. Greer
2012-10-19 21:53   ` Mark A. Greer
2012-10-20 19:40   ` Paul Walmsley
2012-10-20 19:40     ` Paul Walmsley
2012-10-22 19:37     ` Mark A. Greer
2012-10-22 19:37       ` Mark A. Greer
2012-10-22 19:53       ` Paul Walmsley
2012-10-22 19:53         ` Paul Walmsley
2012-10-22 20:01         ` Mark A. Greer
2012-10-22 20:01           ` Mark A. Greer
2012-10-19 21:53 ` [PATCH 3/7] ARM: OMAP3xxx: hwmod: Convert SHAM crypto device data to hwmod Mark A. Greer
2012-10-19 21:53   ` Mark A. Greer
2012-10-20 19:41   ` Paul Walmsley
2012-10-20 19:41     ` Paul Walmsley
2012-10-19 21:53 ` [PATCH 4/7] ARM: OMAP2+: Remove unnecessary message when no SHA IP is present Mark A. Greer
2012-10-19 21:53   ` Mark A. Greer
2012-10-19 21:53 ` [PATCH 5/7] crypto: omap-sham: Convert to use pm_runtime API Mark A. Greer
2012-10-19 21:53   ` Mark A. Greer
2012-10-19 21:53 ` [PATCH 6/7] crypto: omap-sham: Add code to use dmaengine API Mark A. Greer
2012-10-19 21:53   ` Mark A. Greer
2012-10-21 11:52   ` Kasatkin, Dmitry
2012-10-21 11:52     ` Kasatkin, Dmitry
2012-10-22 20:53     ` Mark A. Greer
2012-10-22 20:53       ` Mark A. Greer
2012-10-19 21:54 ` [PATCH 7/7] crypto: omap_sham: Remove usage of private DMA API Mark A. Greer
2012-10-19 21:54   ` Mark A. Greer
2012-10-20 19:34 ` [PATCH 0/7] crypto: omap-sham updates Paul Walmsley
2012-10-20 19:34   ` Paul Walmsley
2012-10-22 19:38   ` Mark A. Greer
2012-10-22 19:38     ` Mark A. Greer
2012-10-21  6:28 ` Santosh Shilimkar
2012-10-22 19:46   ` Mark A. Greer

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=20121023220237.GA19671@animalcreek.com \
    --to=mgreer@animalcreek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    /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.