Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8e89a8e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: spm: Update msm_spm_turn_on_cpu_rail() to use new SAW2 base address"

parents 7bbb7d77 5515dbc7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
#define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x15A0
#define SCSS_CPU1CORE_RESET 0xD80
#define SCSS_DBG_STATUS_CORE_PWRDUP 0xE64

#define MSM8960_SAW2_BASE_ADDR 0x02089000
/*
 * Write pen_release in a way that is guaranteed to be visible to all
 * observers, irrespective of whether they're taking part in coherency
@@ -104,7 +104,7 @@ static int __cpuinit msm8960_release_secondary(unsigned long base,
	if (!base_ptr)
		return -ENODEV;

	msm_spm_turn_on_cpu_rail(cpu);
	msm_spm_turn_on_cpu_rail(MSM8960_SAW2_BASE_ADDR, cpu);

	writel_relaxed(0x109, base_ptr+0x04);
	writel_relaxed(0x101, base_ptr+0x04);
+2 −9
Original line number Diff line number Diff line
@@ -131,14 +131,7 @@ struct msm_spm_platform_data {
int msm_spm_set_low_power_mode(unsigned int mode, bool notify_rpm);
int msm_spm_set_vdd(unsigned int cpu, unsigned int vlevel);
unsigned int msm_spm_get_vdd(unsigned int cpu);
#if defined(CONFIG_MSM_SPM_V2)
int msm_spm_turn_on_cpu_rail(unsigned int cpu);
#else
static inline int msm_spm_turn_on_cpu_rail(unsigned int cpu)
{
	return -ENOSYS;
}
#endif
int msm_spm_turn_on_cpu_rail(unsigned long base, unsigned int cpu);

/* Internal low power management specific functions */

@@ -208,7 +201,7 @@ static inline void msm_spm_reinit(void)
	/* empty */
}

static inline int msm_spm_turn_on_cpu_rail(unsigned int cpu)
static inline int msm_spm_turn_on_cpu_rail(unsigned long base, unsigned int cpu)
{
	return -ENOSYS;
}
+20 −17
Original line number Diff line number Diff line
@@ -206,38 +206,41 @@ spm_failed_malloc:

/**
 * msm_spm_turn_on_cpu_rail(): Power on cpu rail before turning on core
 * @base: core 0's base SAW address
 * @cpu: core id
 */
int msm_spm_turn_on_cpu_rail(unsigned int cpu)
int msm_spm_turn_on_cpu_rail(unsigned long base, unsigned int cpu)
{
	uint32_t val = 0;
	uint32_t timeout = 0;
	uint32_t timeout = 512; /* delay for voltage to settle on the core */
	void *reg = NULL;
	void *saw_bases[] = {
		0,
		MSM_SAW1_BASE,
		MSM_SAW2_BASE,
		MSM_SAW3_BASE
	};

	if (cpu == 0 || cpu >= num_possible_cpus())
		return -EINVAL;

	reg = saw_bases[cpu];
	reg = ioremap_nocache(base + (cpu * 0x10000), SZ_4K);
	if (!reg)
		return -ENOMEM;

	if (soc_class_is_msm8960() || soc_class_is_msm8930() ||
	    soc_class_is_apq8064()) {
		val = 0xA4;
		reg += 0x14;
		timeout = 512;
	} else {
		return -ENOSYS;
	}
	reg += 0x1C;

	/*
	 * Set FTS2 type CPU supply regulator to 1.15 V. This assumes that the
	 * regulator is already configured in LV range.
	 */
	val = 0x40000E6;
	writel_relaxed(val, reg);
	mb();
	udelay(timeout);

	/* Enable CPU supply regulator */
	val = 0x2030080;
	writel_relaxed(val, reg);
	mb();
	udelay(timeout);

	iounmap(reg);

	return 0;
}
EXPORT_SYMBOL(msm_spm_turn_on_cpu_rail);