Commit 6abb0576 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge tag 'tegra-for-3.10-fixes' of...

Merge tag 'tegra-for-3.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/fixes-non-critical

From Stephen Warren <swarren@wwwdotorg.org>:

ARM: tegra: minor fixes

This branch contains a variety of small build and run-time fixes that
weren't important enough for 3.9.

* Enable CPU errata WARs in secondary reset handler as a preparation
  for multi-platform support, and a related fix.
* Don't touch DBLGAR in reset/resume handlers, so enable the code to
  run on A15 cores.
* Minor build fixes.
* A fix to the Tegra clock driver.
* Some error-handling fixes.

This branch is based on the previous fixes-for-mmc pull request.

* tag 'tegra-for-3.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra:
  ARM: tegra: powergate: Don't error out if new state == old state
  ARM: tegra: Export tegra_powergate_sequence_power_up()
  memory: tegra30: Fix build error w/o PM
  ARM: tegra: fix ignored return value of regulator_enable
  ARM: tegra: fix the logical detection of power on sequence of warm boot CPUs
  ARM: tegra: Fix unchecked return value
  ARM: tegra: don't unlock MMIO access to DBGLAR
  clk: tegra: No 7.1 super clk dividers on Tegra20
  ARM: tegra: remove save/restore of CPU diag register
  ARM: tegra: add CPU errata WARs to Tegra reset handler
  ARM: dts: tegra: fix the activate polarity of cd-gpio in mmc host
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 8bd2bcf3 eebd1fda
...@@ -444,7 +444,7 @@ usb@c5004000 { ...@@ -444,7 +444,7 @@ usb@c5004000 {
}; };
sdhci@c8000600 { sdhci@c8000600 {
cd-gpios = <&gpio 23 0>; /* gpio PC7 */ cd-gpios = <&gpio 23 1>; /* gpio PC7 */
}; };
sound { sound {
......
...@@ -437,7 +437,7 @@ usb-phy@c5004400 { ...@@ -437,7 +437,7 @@ usb-phy@c5004400 {
sdhci@c8000200 { sdhci@c8000200 {
status = "okay"; status = "okay";
cd-gpios = <&gpio 69 0>; /* gpio PI5 */ cd-gpios = <&gpio 69 1>; /* gpio PI5 */
wp-gpios = <&gpio 57 0>; /* gpio PH1 */ wp-gpios = <&gpio 57 0>; /* gpio PH1 */
power-gpios = <&gpio 155 0>; /* gpio PT3 */ power-gpios = <&gpio 155 0>; /* gpio PT3 */
bus-width = <4>; bus-width = <4>;
...@@ -445,7 +445,7 @@ sdhci@c8000200 { ...@@ -445,7 +445,7 @@ sdhci@c8000200 {
sdhci@c8000600 { sdhci@c8000600 {
status = "okay"; status = "okay";
cd-gpios = <&gpio 58 0>; /* gpio PH2 */ cd-gpios = <&gpio 58 1>; /* gpio PH2 */
wp-gpios = <&gpio 59 0>; /* gpio PH3 */ wp-gpios = <&gpio 59 0>; /* gpio PH3 */
power-gpios = <&gpio 70 0>; /* gpio PI6 */ power-gpios = <&gpio 70 0>; /* gpio PI6 */
bus-width = <8>; bus-width = <8>;
......
...@@ -436,7 +436,7 @@ usb-phy@c5004400 { ...@@ -436,7 +436,7 @@ usb-phy@c5004400 {
sdhci@c8000000 { sdhci@c8000000 {
status = "okay"; status = "okay";
cd-gpios = <&gpio 173 0>; /* gpio PV5 */ cd-gpios = <&gpio 173 1>; /* gpio PV5 */
wp-gpios = <&gpio 57 0>; /* gpio PH1 */ wp-gpios = <&gpio 57 0>; /* gpio PH1 */
power-gpios = <&gpio 169 0>; /* gpio PV1 */ power-gpios = <&gpio 169 0>; /* gpio PV1 */
bus-width = <4>; bus-width = <4>;
......
...@@ -584,7 +584,7 @@ sdhci@c8000000 { ...@@ -584,7 +584,7 @@ sdhci@c8000000 {
sdhci@c8000400 { sdhci@c8000400 {
status = "okay"; status = "okay";
cd-gpios = <&gpio 69 0>; /* gpio PI5 */ cd-gpios = <&gpio 69 1>; /* gpio PI5 */
wp-gpios = <&gpio 57 0>; /* gpio PH1 */ wp-gpios = <&gpio 57 0>; /* gpio PH1 */
power-gpios = <&gpio 70 0>; /* gpio PI6 */ power-gpios = <&gpio 70 0>; /* gpio PI6 */
bus-width = <4>; bus-width = <4>;
......
...@@ -465,7 +465,7 @@ usb@c5008000 { ...@@ -465,7 +465,7 @@ usb@c5008000 {
}; };
sdhci@c8000600 { sdhci@c8000600 {
cd-gpios = <&gpio 58 0>; /* gpio PH2 */ cd-gpios = <&gpio 58 1>; /* gpio PH2 */
wp-gpios = <&gpio 59 0>; /* gpio PH3 */ wp-gpios = <&gpio 59 0>; /* gpio PH3 */
bus-width = <4>; bus-width = <4>;
status = "okay"; status = "okay";
......
...@@ -325,7 +325,7 @@ sdhci@c8000000 { ...@@ -325,7 +325,7 @@ sdhci@c8000000 {
sdhci@c8000600 { sdhci@c8000600 {
status = "okay"; status = "okay";
cd-gpios = <&gpio 121 0>; /* gpio PP1 */ cd-gpios = <&gpio 121 1>; /* gpio PP1 */
wp-gpios = <&gpio 122 0>; /* gpio PP2 */ wp-gpios = <&gpio 122 0>; /* gpio PP2 */
bus-width = <4>; bus-width = <4>;
}; };
......
...@@ -520,7 +520,7 @@ sdhci@c8000000 { ...@@ -520,7 +520,7 @@ sdhci@c8000000 {
sdhci@c8000400 { sdhci@c8000400 {
status = "okay"; status = "okay";
cd-gpios = <&gpio 69 0>; /* gpio PI5 */ cd-gpios = <&gpio 69 1>; /* gpio PI5 */
wp-gpios = <&gpio 57 0>; /* gpio PH1 */ wp-gpios = <&gpio 57 0>; /* gpio PH1 */
power-gpios = <&gpio 70 0>; /* gpio PI6 */ power-gpios = <&gpio 70 0>; /* gpio PI6 */
bus-width = <4>; bus-width = <4>;
......
...@@ -510,6 +510,7 @@ usb@c5008000 { ...@@ -510,6 +510,7 @@ usb@c5008000 {
sdhci@c8000400 { sdhci@c8000400 {
status = "okay"; status = "okay";
cd-gpios = <&gpio 69 1>; /* gpio PI5 */
wp-gpios = <&gpio 173 0>; /* gpio PV5 */ wp-gpios = <&gpio 173 0>; /* gpio PV5 */
bus-width = <8>; bus-width = <8>;
}; };
......
...@@ -257,7 +257,7 @@ pmc { ...@@ -257,7 +257,7 @@ pmc {
sdhci@78000000 { sdhci@78000000 {
status = "okay"; status = "okay";
cd-gpios = <&gpio 69 0>; /* gpio PI5 */ cd-gpios = <&gpio 69 1>; /* gpio PI5 */
wp-gpios = <&gpio 155 0>; /* gpio PT3 */ wp-gpios = <&gpio 155 0>; /* gpio PT3 */
power-gpios = <&gpio 31 0>; /* gpio PD7 */ power-gpios = <&gpio 31 0>; /* gpio PD7 */
bus-width = <4>; bus-width = <4>;
......
...@@ -311,7 +311,7 @@ pmc { ...@@ -311,7 +311,7 @@ pmc {
sdhci@78000000 { sdhci@78000000 {
status = "okay"; status = "okay";
cd-gpios = <&gpio 69 0>; /* gpio PI5 */ cd-gpios = <&gpio 69 1>; /* gpio PI5 */
wp-gpios = <&gpio 155 0>; /* gpio PT3 */ wp-gpios = <&gpio 155 0>; /* gpio PT3 */
power-gpios = <&gpio 31 0>; /* gpio PD7 */ power-gpios = <&gpio 31 0>; /* gpio PD7 */
bus-width = <4>; bus-width = <4>;
......
...@@ -62,7 +62,11 @@ int __init harmony_pcie_init(void) ...@@ -62,7 +62,11 @@ int __init harmony_pcie_init(void)
goto err_reg; goto err_reg;
} }
regulator_enable(regulator); err = regulator_enable(regulator);
if (err) {
pr_err("%s: regulator_enable failed: %d\n", __func__, err);
goto err_en;
}
err = tegra_pcie_init(true, true); err = tegra_pcie_init(true, true);
if (err) { if (err) {
...@@ -74,6 +78,7 @@ int __init harmony_pcie_init(void) ...@@ -74,6 +78,7 @@ int __init harmony_pcie_init(void)
err_pcie: err_pcie:
regulator_disable(regulator); regulator_disable(regulator);
err_en:
regulator_put(regulator); regulator_put(regulator);
err_reg: err_reg:
gpio_free(en_vdd_1v05); gpio_free(en_vdd_1v05);
......
...@@ -102,12 +102,8 @@ static bool tegra30_cpu_core_power_down(struct cpuidle_device *dev, ...@@ -102,12 +102,8 @@ static bool tegra30_cpu_core_power_down(struct cpuidle_device *dev,
smp_wmb(); smp_wmb();
save_cpu_arch_register();
cpu_suspend(0, tegra30_sleep_cpu_secondary_finish); cpu_suspend(0, tegra30_sleep_cpu_secondary_finish);
restore_cpu_arch_register();
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu); clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
return true; return true;
......
...@@ -7,8 +7,5 @@ ...@@ -7,8 +7,5 @@
ENTRY(tegra_secondary_startup) ENTRY(tegra_secondary_startup)
bl v7_invalidate_l1 bl v7_invalidate_l1
/* Enable coresight */
mov32 r0, 0xC5ACCE55
mcr p14, 0, r0, c7, c12, 6
b secondary_startup b secondary_startup
ENDPROC(tegra_secondary_startup) ENDPROC(tegra_secondary_startup)
...@@ -91,7 +91,7 @@ static int tegra30_power_up_cpu(unsigned int cpu) ...@@ -91,7 +91,7 @@ static int tegra30_power_up_cpu(unsigned int cpu)
if (cpumask_test_cpu(cpu, &tegra_cpu_init_mask)) { if (cpumask_test_cpu(cpu, &tegra_cpu_init_mask)) {
timeout = jiffies + msecs_to_jiffies(50); timeout = jiffies + msecs_to_jiffies(50);
do { do {
if (!tegra_powergate_is_powered(pwrgateid)) if (tegra_powergate_is_powered(pwrgateid))
goto remove_clamps; goto remove_clamps;
udelay(10); udelay(10);
} while (time_before(jiffies, timeout)); } while (time_before(jiffies, timeout));
...@@ -124,6 +124,9 @@ static int tegra30_power_up_cpu(unsigned int cpu) ...@@ -124,6 +124,9 @@ static int tegra30_power_up_cpu(unsigned int cpu)
/* Remove I/O clamps. */ /* Remove I/O clamps. */
ret = tegra_powergate_remove_clamping(pwrgateid); ret = tegra_powergate_remove_clamping(pwrgateid);
if (ret)
return ret;
udelay(10); udelay(10);
/* Clear flow controller CSR. */ /* Clear flow controller CSR. */
......
...@@ -46,26 +46,11 @@ ...@@ -46,26 +46,11 @@
#define PMC_CPUPWROFF_TIMER 0xcc #define PMC_CPUPWROFF_TIMER 0xcc
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static unsigned int g_diag_reg;
static DEFINE_SPINLOCK(tegra_lp2_lock); static DEFINE_SPINLOCK(tegra_lp2_lock);
static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE); static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
static struct clk *tegra_pclk; static struct clk *tegra_pclk;
void (*tegra_tear_down_cpu)(void); void (*tegra_tear_down_cpu)(void);
void save_cpu_arch_register(void)
{
/* read diagnostic register */
asm("mrc p15, 0, %0, c15, c0, 1" : "=r"(g_diag_reg) : : "cc");
return;
}
void restore_cpu_arch_register(void)
{
/* write diagnostic register */
asm("mcr p15, 0, %0, c15, c0, 1" : : "r"(g_diag_reg) : "cc");
return;
}
static void set_power_timers(unsigned long us_on, unsigned long us_off) static void set_power_timers(unsigned long us_on, unsigned long us_off)
{ {
unsigned long long ticks; unsigned long long ticks;
...@@ -119,8 +104,6 @@ static void restore_cpu_complex(void) ...@@ -119,8 +104,6 @@ static void restore_cpu_complex(void)
tegra_cpu_clock_resume(); tegra_cpu_clock_resume();
flowctrl_cpu_suspend_exit(cpu); flowctrl_cpu_suspend_exit(cpu);
restore_cpu_arch_register();
} }
/* /*
...@@ -145,8 +128,6 @@ static void suspend_cpu_complex(void) ...@@ -145,8 +128,6 @@ static void suspend_cpu_complex(void)
tegra_cpu_clock_suspend(); tegra_cpu_clock_suspend();
flowctrl_cpu_suspend_enter(cpu); flowctrl_cpu_suspend_enter(cpu);
save_cpu_arch_register();
} }
void tegra_clear_cpu_in_lp2(int phy_cpu_id) void tegra_clear_cpu_in_lp2(int phy_cpu_id)
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/export.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
...@@ -75,7 +76,7 @@ static int tegra_powergate_set(int id, bool new_state) ...@@ -75,7 +76,7 @@ static int tegra_powergate_set(int id, bool new_state)
if (status == new_state) { if (status == new_state) {
spin_unlock_irqrestore(&tegra_powergate_lock, flags); spin_unlock_irqrestore(&tegra_powergate_lock, flags);
return -EINVAL; return 0;
} }
pmc_write(PWRGATE_TOGGLE_START | id, PWRGATE_TOGGLE); pmc_write(PWRGATE_TOGGLE_START | id, PWRGATE_TOGGLE);
...@@ -168,6 +169,7 @@ int tegra_powergate_sequence_power_up(int id, struct clk *clk) ...@@ -168,6 +169,7 @@ int tegra_powergate_sequence_power_up(int id, struct clk *clk)
err_power: err_power:
return ret; return ret;
} }
EXPORT_SYMBOL(tegra_powergate_sequence_power_up);
int tegra_cpu_powergate_id(int cpuid) int tegra_cpu_powergate_id(int cpuid)
{ {
......
...@@ -41,9 +41,6 @@ ...@@ -41,9 +41,6 @@
*/ */
ENTRY(tegra_resume) ENTRY(tegra_resume)
bl v7_invalidate_l1 bl v7_invalidate_l1
/* Enable coresight */
mov32 r0, 0xC5ACCE55
mcr p14, 0, r0, c7, c12, 6
cpu_id r0 cpu_id r0
cmp r0, #0 @ CPU0? cmp r0, #0 @ CPU0?
...@@ -99,6 +96,8 @@ ENTRY(__tegra_cpu_reset_handler_start) ...@@ -99,6 +96,8 @@ ENTRY(__tegra_cpu_reset_handler_start)
* *
* Register usage within the reset handler: * Register usage within the reset handler:
* *
* Others: scratch
* R6 = SoC ID << 8
* R7 = CPU present (to the OS) mask * R7 = CPU present (to the OS) mask
* R8 = CPU in LP1 state mask * R8 = CPU in LP1 state mask
* R9 = CPU in LP2 state mask * R9 = CPU in LP2 state mask
...@@ -114,6 +113,40 @@ ENTRY(__tegra_cpu_reset_handler_start) ...@@ -114,6 +113,40 @@ ENTRY(__tegra_cpu_reset_handler_start)
ENTRY(__tegra_cpu_reset_handler) ENTRY(__tegra_cpu_reset_handler)
cpsid aif, 0x13 @ SVC mode, interrupts disabled cpsid aif, 0x13 @ SVC mode, interrupts disabled
mov32 r6, TEGRA_APB_MISC_BASE
ldr r6, [r6, #APB_MISC_GP_HIDREV]
and r6, r6, #0xff00
#ifdef CONFIG_ARCH_TEGRA_2x_SOC
t20_check:
cmp r6, #(0x20 << 8)
bne after_t20_check
t20_errata:
# Tegra20 is a Cortex-A9 r1p1
mrc p15, 0, r0, c1, c0, 0 @ read system control register
orr r0, r0, #1 << 14 @ erratum 716044
mcr p15, 0, r0, c1, c0, 0 @ write system control register
mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register
orr r0, r0, #1 << 4 @ erratum 742230
orr r0, r0, #1 << 11 @ erratum 751472
mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register
b after_errata
after_t20_check:
#endif
#ifdef CONFIG_ARCH_TEGRA_3x_SOC
t30_check:
cmp r6, #(0x30 << 8)
bne after_t30_check
t30_errata:
# Tegra30 is a Cortex-A9 r2p9
mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register
orr r0, r0, #1 << 6 @ erratum 743622
orr r0, r0, #1 << 11 @ erratum 751472
mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register
b after_errata
after_t30_check:
#endif
after_errata:
mrc p15, 0, r10, c0, c0, 5 @ MPIDR mrc p15, 0, r10, c0, c0, 5 @ MPIDR
and r10, r10, #0x3 @ R10 = CPU number and r10, r10, #0x3 @ R10 = CPU number
mov r11, #1 mov r11, #1
...@@ -129,16 +162,13 @@ ENTRY(__tegra_cpu_reset_handler) ...@@ -129,16 +162,13 @@ ENTRY(__tegra_cpu_reset_handler)
#ifdef CONFIG_ARCH_TEGRA_2x_SOC #ifdef CONFIG_ARCH_TEGRA_2x_SOC
/* Are we on Tegra20? */ /* Are we on Tegra20? */
mov32 r6, TEGRA_APB_MISC_BASE cmp r6, #(0x20 << 8)
ldr r0, [r6, #APB_MISC_GP_HIDREV]
and r0, r0, #0xff00
cmp r0, #(0x20 << 8)
bne 1f bne 1f
/* If not CPU0, don't let CPU0 reset CPU1 now that CPU1 is coming up. */ /* If not CPU0, don't let CPU0 reset CPU1 now that CPU1 is coming up. */
mov32 r6, TEGRA_PMC_BASE mov32 r5, TEGRA_PMC_BASE
mov r0, #0 mov r0, #0
cmp r10, #0 cmp r10, #0
strne r0, [r6, #PMC_SCRATCH41] strne r0, [r5, #PMC_SCRATCH41]
1: 1:
#endif #endif
......
...@@ -711,8 +711,8 @@ static void tegra20_pll_init(void) ...@@ -711,8 +711,8 @@ static void tegra20_pll_init(void)
} }
static const char *cclk_parents[] = { "clk_m", "pll_c", "clk_32k", "pll_m", static const char *cclk_parents[] = { "clk_m", "pll_c", "clk_32k", "pll_m",
"pll_p_cclk", "pll_p_out4_cclk", "pll_p", "pll_p_out4",
"pll_p_out3_cclk", "clk_d", "pll_x" }; "pll_p_out3", "clk_d", "pll_x" };
static const char *sclk_parents[] = { "clk_m", "pll_c_out1", "pll_p_out4", static const char *sclk_parents[] = { "clk_m", "pll_c_out1", "pll_p_out4",
"pll_p_out3", "pll_p_out2", "clk_d", "pll_p_out3", "pll_p_out2", "clk_d",
"clk_32k", "pll_m_out1" }; "clk_32k", "pll_m_out1" };
...@@ -721,38 +721,6 @@ static void tegra20_super_clk_init(void) ...@@ -721,38 +721,6 @@ static void tegra20_super_clk_init(void)
{ {
struct clk *clk; struct clk *clk;
/*
* DIV_U71 dividers for CCLK, these dividers are used only
* if parent clock is fixed rate.
*/
/*
* Clock input to cclk divided from pll_p using
* U71 divider of cclk.
*/
clk = tegra_clk_register_divider("pll_p_cclk", "pll_p",
clk_base + SUPER_CCLK_DIVIDER, 0,
TEGRA_DIVIDER_INT, 16, 8, 1, NULL);
clk_register_clkdev(clk, "pll_p_cclk", NULL);
/*
* Clock input to cclk divided from pll_p_out3 using
* U71 divider of cclk.
*/
clk = tegra_clk_register_divider("pll_p_out3_cclk", "pll_p_out3",
clk_base + SUPER_CCLK_DIVIDER, 0,
TEGRA_DIVIDER_INT, 16, 8, 1, NULL);
clk_register_clkdev(clk, "pll_p_out3_cclk", NULL);
/*
* Clock input to cclk divided from pll_p_out4 using
* U71 divider of cclk.
*/
clk = tegra_clk_register_divider("pll_p_out4_cclk", "pll_p_out4",
clk_base + SUPER_CCLK_DIVIDER, 0,
TEGRA_DIVIDER_INT, 16, 8, 1, NULL);
clk_register_clkdev(clk, "pll_p_out4_cclk", NULL);
/* CCLK */ /* CCLK */
clk = tegra_clk_register_super_mux("cclk", cclk_parents, clk = tegra_clk_register_super_mux("cclk", cclk_parents,
ARRAY_SIZE(cclk_parents), CLK_SET_RATE_PARENT, ARRAY_SIZE(cclk_parents), CLK_SET_RATE_PARENT,
......
...@@ -268,6 +268,7 @@ static const u32 tegra30_mc_ctx[] = { ...@@ -268,6 +268,7 @@ static const u32 tegra30_mc_ctx[] = {
MC_INTMASK, MC_INTMASK,
}; };
#ifdef CONFIG_PM
static int tegra30_mc_suspend(struct device *dev) static int tegra30_mc_suspend(struct device *dev)
{ {
int i; int i;
...@@ -291,6 +292,7 @@ static int tegra30_mc_resume(struct device *dev) ...@@ -291,6 +292,7 @@ static int tegra30_mc_resume(struct device *dev)
mc_readl(mc, MC_TIMING_CONTROL); mc_readl(mc, MC_TIMING_CONTROL);
return 0; return 0;
} }
#endif
static UNIVERSAL_DEV_PM_OPS(tegra30_mc_pm, static UNIVERSAL_DEV_PM_OPS(tegra30_mc_pm,
tegra30_mc_suspend, tegra30_mc_suspend,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment