Commit 24ef111e authored by Wu Liliu's avatar Wu Liliu Committed by guzitao
Browse files

sw64: compatible with suspend implementation

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IB73UR



--------------------------------

Modify the suspend function to adapt to different firmware.

Signed-off-by: default avatarWu Liliu <wuliliu@wxiat.com>
Reviewed-by: default avatarHe Sheng <hesheng@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent 6468a66f
Loading
Loading
Loading
Loading
+17 −16
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ static void downshift_freq(void)
			return;
	}


	core_id = rcid_to_core_id(cpu_to_rcid(cpuid));
	node_id = rcid_to_domain_id(cpu_to_rcid(cpuid));

@@ -542,10 +543,11 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
	wmb();
	smp_rcb->ready = 0;

#ifdef CONFIG_SUBARCH_C3B
	if (!is_junzhang_v1()) {
		/* send wake up signal */
		send_wakeup_interrupt(cpu);
#endif
	}

	smp_boot_one_cpu(cpu, tidle);

#ifdef CONFIG_SUBARCH_C3B
@@ -841,17 +843,16 @@ void arch_cpu_idle_dead(void)
	}

#ifdef CONFIG_SUSPEND

#ifdef CONFIG_SUBARCH_C3B
	if (!is_junzhang_v1()) {
		sleepen();
		send_sleep_interrupt(smp_processor_id());
		while (1)
			asm("nop");
#else
	} else {
		asm volatile("halt");
		while (1)
			asm("nop");
#endif
	}

#else
	asm volatile("memb");
+8 −8
Original line number Diff line number Diff line
@@ -38,14 +38,14 @@ void sw64_suspend_enter(void)
	disable_local_timer();
	current_thread_info()->pcb.tp = rtid();

#ifdef CONFIG_SUBARCH_C3B
	if (!is_junzhang_v1())
		sw64_suspend_deep_sleep(&suspend_state);
#else
	else {
		pme_state = PME_WFW;
		sw64_write_csr_imb(PME_EN, CSR_INT_EN);
		asm("halt");
		local_irq_disable();
#endif
	}

	wrtp(current_thread_info()->pcb.tp);

+9 −9
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ asmlinkage void do_entInt(unsigned long type, unsigned long vector,
		nmi_enter();
	old_regs = set_irq_regs(regs);

#ifdef CONFIG_SUBARCH_C4
	if (is_junzhang_v1()) {
		if (pme_state == PME_WFW) {
			pme_state = PME_PENDING;
			goto out;
@@ -101,7 +101,7 @@ asmlinkage void do_entInt(unsigned long type, unsigned long vector,
			handle_device_interrupt(vector);
			pme_state = PME_CLEAR;
		}
#endif
	}

	if (is_guest_or_emul()) {
		if ((type & 0xffff) > 15) {