2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2012-08-31 08:30:09 +00:00
|
|
|
/*
|
2012-12-11 13:34:13 +00:00
|
|
|
* Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved.
|
|
|
|
*/
|
2012-08-31 08:30:09 +00:00
|
|
|
|
2012-09-19 22:50:56 +00:00
|
|
|
#include <common.h>
|
2012-08-31 08:30:09 +00:00
|
|
|
#include <asm/io.h>
|
2012-09-19 22:50:56 +00:00
|
|
|
#include <asm/arch/tegra.h>
|
|
|
|
#include <asm/arch-tegra/pmc.h>
|
2015-02-20 08:04:04 +00:00
|
|
|
#include "../cpu.h"
|
2012-08-31 08:30:09 +00:00
|
|
|
|
|
|
|
static void enable_cpu_power_rail(void)
|
|
|
|
{
|
2012-09-05 00:00:24 +00:00
|
|
|
struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
|
2012-08-31 08:30:09 +00:00
|
|
|
u32 reg;
|
|
|
|
|
|
|
|
reg = readl(&pmc->pmc_cntrl);
|
|
|
|
reg |= CPUPWRREQ_OE;
|
|
|
|
writel(reg, &pmc->pmc_cntrl);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The TI PMU65861C needs a 3.75ms delay between enabling
|
|
|
|
* the power rail and enabling the CPU clock. This delay
|
|
|
|
* between SM1EN and SM1 is for switching time + the ramp
|
|
|
|
* up of the voltage to the CPU (VDD_CPU from PMU).
|
|
|
|
*/
|
|
|
|
udelay(3750);
|
|
|
|
}
|
|
|
|
|
|
|
|
void start_cpu(u32 reset_vector)
|
|
|
|
{
|
|
|
|
/* Enable VDD_CPU */
|
|
|
|
enable_cpu_power_rail();
|
|
|
|
|
|
|
|
/* Hold the CPUs in reset */
|
|
|
|
reset_A9_cpu(1);
|
|
|
|
|
|
|
|
/* Disable the CPU clock */
|
|
|
|
enable_cpu_clock(0);
|
|
|
|
|
|
|
|
/* Enable CoreSight */
|
|
|
|
clock_enable_coresight(1);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Set the entry point for CPU execution from reset,
|
|
|
|
* if it's a non-zero value.
|
|
|
|
*/
|
|
|
|
if (reset_vector)
|
|
|
|
writel(reset_vector, EXCEP_VECTOR_CPU_RESET_VECTOR);
|
|
|
|
|
|
|
|
/* Enable the CPU clock */
|
|
|
|
enable_cpu_clock(1);
|
|
|
|
|
|
|
|
/* If the CPU doesn't already have power, power it up */
|
|
|
|
powerup_cpu();
|
|
|
|
|
|
|
|
/* Take the CPU out of reset */
|
|
|
|
reset_A9_cpu(0);
|
|
|
|
}
|