public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 08/13] ARM: tegra: add SPL/AVP (arm720t) CPU files for Tegra124
Date: Fri, 24 Jan 2014 10:47:04 -0700	[thread overview]
Message-ID: <52E2A718.1030002@wwwdotorg.org> (raw)
In-Reply-To: <20140124154453.GH25720@ulmo.nvidia.com>

On 01/24/2014 08:44 AM, Thierry Reding wrote:
> On Thu, Jan 23, 2014 at 05:42:55PM -0700, Stephen Warren wrote:

>> +static bool is_partition_powered(u32 mask)
>> +{
>> +	struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
>> +	u32 reg;
>> +
>> +	/* Get power gate status */
>> +	reg = readl(&pmc->pmc_pwrgate_status);
>> +	return (reg & mask) == mask;
>> +}
> 
> Why can't we pass in the partition ID? That way we don't even have to
> define the masks in the header file. It's pretty redundant.
> 
>> +static void power_partition(u32 status, u32 partid)
>> +{
>> +	struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
>> +
>> +	debug("%s: status = %08X, part ID = %08X\n", __func__, status, partid);
>> +	/* Is the partition already on? */
>> +	if (!is_partition_powered(status)) {
>> +		/* No, toggle the partition power state (OFF -> ON) */
>> +		debug("power_partition, toggling state\n");
>> +		writel(START_CP | partid, &pmc->pmc_pwrgate_toggle);
>> +
>> +		/* Wait for the power to come up */
>> +		while (!is_partition_powered(status))
>> +			;
>> +
>> +		/* Give I/O signals time to stabilize */
>> +		udelay(IO_STABILIZATION_DELAY);
>> +	}
>> +}
> 
> This is being called as follows:
> 
> 	power_partition(CRAIL, CRAILID);
> 	power_partition(C0NC, C0NCID);
> 	power_partition(CE0, CE0ID);
> 
> So instead of passing in (1 << CRAILID, CRAILID), why not just pass
> around the partition ID only and compute the status mask as needed?
> 
> Now that I mention it, I do have a vague recollection that I said the
> exact same thing during my initial review of Tom's patches.

Oh, I see what you mean now. I hadn't realized that "CRAIL == 1 <<
CRAILID", so hadn't understood what you meant before. I'll certainly fix
that up.

  reply	other threads:[~2014-01-24 17:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-24  0:42 [U-Boot] [PATCH V2 01/13] mmc: tegra: support Tegra124 Stephen Warren
2014-01-24  0:42 ` [U-Boot] [PATCH V2 02/13] ARM: tegra: misc cleanups triggered by Tegra124 review Stephen Warren
2014-01-24  0:42 ` [U-Boot] [PATCH V2 03/13] ARM: tegra: enable PLLX only once it's been fully configured Stephen Warren
2014-01-24  0:42 ` [U-Boot] [PATCH V2 04/13] ARM: tegra: remove a conditional for CSITE rate Stephen Warren
2014-01-24  0:42 ` [U-Boot] [PATCH V2 05/13] ARM: tegra: only build __pinmux_nand() when it's needed Stephen Warren
2014-01-24  0:42 ` [U-Boot] [PATCH V2 06/13] ARM: tegra: fix a typo in the tegra114.dtsi Stephen Warren
2014-01-24  0:42 ` [U-Boot] [PATCH V2 07/13] ARM: tegra: add/edit headers for Tegra124 Stephen Warren
2014-01-24 15:20   ` Thierry Reding
2014-01-24 17:46     ` Stephen Warren
2014-01-24 18:08     ` Stephen Warren
2014-01-24  0:42 ` [U-Boot] [PATCH V2 08/13] ARM: tegra: add SPL/AVP (arm720t) CPU files " Stephen Warren
2014-01-24 15:44   ` Thierry Reding
2014-01-24 17:47     ` Stephen Warren [this message]
2014-01-24 18:29     ` Stephen Warren
2014-01-24  0:42 ` [U-Boot] [PATCH V2 09/13] ARM: tegra: Add CPU (armv7) " Stephen Warren
2014-01-24  0:42 ` [U-Boot] [PATCH V2 10/13] ARM: tegra: add common (shared) CPU files Stephen Warren
2014-01-24  0:42 ` [U-Boot] [PATCH V2 11/13] ARM: tegra: add DT files for Tegra124 and Venice2 Stephen Warren
2014-01-24  0:42 ` [U-Boot] [PATCH V2 12/13] ARM: tegra: add Venice2 (Tegra124) board Stephen Warren
2014-01-24  0:43 ` [U-Boot] [PATCH V2 13/13] ARM: tegra: fix "bootp" issue for Tegra124 too Stephen Warren
2014-01-24  6:53   ` Jim Lin
2014-01-27 16:49     ` Stephen Warren
2014-01-24 13:56 ` [U-Boot] [PATCH V2 01/13] mmc: tegra: support Tegra124 Pantelis Antoniou
2014-01-24 16:10 ` Thierry Reding

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=52E2A718.1030002@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.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