From: Thierry Reding <treding@nvidia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 09/12] tegra124: Add PSCI support for Tegra124
Date: Thu, 26 Feb 2015 10:24:55 +0100 [thread overview]
Message-ID: <20150226092454.GB27867@ulmo.nvidia.com> (raw)
In-Reply-To: <27f92794c702079de414b7fd49c6934710cffdf1.1424247246.git.jan.kiszka@siemens.com>
On Wed, Feb 18, 2015 at 09:14:03AM +0100, Jan Kiszka wrote:
[...]
> diff --git a/arch/arm/cpu/armv7/tegra124/ap.c b/arch/arm/cpu/armv7/tegra124/ap.c
[...]
> +void ap_pm_init(void)
> +{
> + struct flow_ctlr *flow = (struct flow_ctlr *)NV_PA_FLOW_BASE;
> + struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
> +
> + writel((u32)park_cpu, EXCEP_VECTOR_CPU_RESET_VECTOR);
> +
> + tegra_powergate_power_on(TEGRA_POWERGATE_CPU1);
> + tegra_powergate_power_on(TEGRA_POWERGATE_CPU2);
> + tegra_powergate_power_on(TEGRA_POWERGATE_CPU3);
> +
> + writel((2 << CSR_WAIT_WFI_SHIFT) | CSR_ENABLE, &flow->cpu1_csr);
> + writel((4 << CSR_WAIT_WFI_SHIFT) | CSR_ENABLE, &flow->cpu2_csr);
> + writel((8 << CSR_WAIT_WFI_SHIFT) | CSR_ENABLE, &flow->cpu3_csr);
> +
> + writel(EVENT_MODE_STOP, &flow->halt_cpu1_events);
> + writel(EVENT_MODE_STOP, &flow->halt_cpu2_events);
> + writel(EVENT_MODE_STOP, &flow->halt_cpu3_events);
> +
> + while (readl(&pmc->pmc_pwrgate_status) & ((1 << TEGRA_POWERGATE_CPU1) |
> + (1 << TEGRA_POWERGATE_CPU2) |
> + (1 << TEGRA_POWERGATE_CPU3)))
> + /* wait */;
> +}
As discussed previously I don't quite understand why the sequence:
1) program CSR registers
2) program halt events
3) power on CPUs
does not work. Testing shows that PSCI will work with that sequence once
the kernel is loaded. However I can also confirm that U-Boot doesn't see
the power partition status updated to "off", so I assume the partitions
will indeed still be powered on if we change the sequence.
So until we find out why that's happening I think it's safe to go with
the above sequence, since it does what we want. Perhaps add a comment
describing the ambiguity?
Also as a cosmetic cleanup, perhaps rather than checking the PMC power
gate status register you check bit 16 of each CPU's CSR register, which
should mirror the corresponding power gate status bit. That way you
don't need to access the PMC registers but restrict register accesses to
a single IP block in this code.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150226/d99451b0/attachment.sig>
next prev parent reply other threads:[~2015-02-26 9:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-18 8:13 [U-Boot] [PATCH v3 00/12] Add PSCI support for Jetson TK1/Tegra124 + CNTFRQ fix Jan Kiszka
2015-02-18 8:13 ` [U-Boot] [PATCH v3 01/12] ARM: Factor out reusable psci_cpu_off_common Jan Kiszka
2015-02-18 8:13 ` [U-Boot] [PATCH v3 02/12] ARM: Factor out reusable psci_cpu_entry Jan Kiszka
2015-02-18 8:13 ` [U-Boot] [PATCH v3 03/12] ARM: Factor out reusable psci_get_cpu_stack_top Jan Kiszka
2015-02-18 8:13 ` [U-Boot] [PATCH v3 04/12] ARM: Put target PC for PSCI CPU_ON on per-CPU stack Jan Kiszka
2015-02-18 8:13 ` [U-Boot] [PATCH v3 05/12] tegra124: Add more registers to struct mc_ctlr Jan Kiszka
2015-02-18 8:14 ` [U-Boot] [PATCH v3 06/12] virt-dt: Allow reservation of secure region when in a RAM carveout Jan Kiszka
2015-02-18 8:14 ` [U-Boot] [PATCH v3 07/12] tegra: Make tegra_powergate_power_on public Jan Kiszka
2015-02-18 8:14 ` [U-Boot] [PATCH v3 08/12] tegra: Add ap_pm_init hook Jan Kiszka
2015-02-18 8:14 ` [U-Boot] [PATCH v3 09/12] tegra124: Add PSCI support for Tegra124 Jan Kiszka
2015-02-26 9:08 ` Thierry Reding
2015-02-26 11:48 ` Jan Kiszka
2015-02-26 9:24 ` Thierry Reding [this message]
2015-02-18 8:14 ` [U-Boot] [PATCH v3 10/12] jetson-tk1: Add PSCI configuration options and reserve secure code Jan Kiszka
2015-02-18 8:14 ` [U-Boot] [PATCH v3 11/12] tegra124: Reserve secure RAM using MC_SECURITY_CFG{0, 1}_0 Jan Kiszka
2015-02-18 8:14 ` [U-Boot] [PATCH v3 12/12] tegra: Set CNTFRQ for secondary CPUs Jan Kiszka
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=20150226092454.GB27867@ulmo.nvidia.com \
--to=treding@nvidia.com \
--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