xref: /openbmc/linux/arch/arm/mach-mvebu/pmsu_ll.S (revision f746ac32)
16509dc74SThomas Petazzoni/*
26509dc74SThomas Petazzoni * Copyright (C) 2014 Marvell
36509dc74SThomas Petazzoni *
46509dc74SThomas Petazzoni * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
56509dc74SThomas Petazzoni * Gregory Clement <gregory.clement@free-electrons.com>
66509dc74SThomas Petazzoni *
76509dc74SThomas Petazzoni * This file is licensed under the terms of the GNU General Public
86509dc74SThomas Petazzoni * License version 2.  This program is licensed "as is" without any
96509dc74SThomas Petazzoni * warranty of any kind, whether express or implied.
106509dc74SThomas Petazzoni */
116509dc74SThomas Petazzoni
126509dc74SThomas Petazzoni#include <linux/linkage.h>
136509dc74SThomas Petazzoni#include <asm/assembler.h>
146509dc74SThomas Petazzoni
15f746ac32SGregory CLEMENT
16f746ac32SGregory CLEMENTENTRY(armada_38x_scu_power_up)
17f746ac32SGregory CLEMENT	mrc     p15, 4, r1, c15, c0	@ get SCU base address
18f746ac32SGregory CLEMENT	orr	r1, r1, #0x8		@ SCU CPU Power Status Register
19f746ac32SGregory CLEMENT	mrc	15, 0, r0, cr0, cr0, 5	@ get the CPU ID
20f746ac32SGregory CLEMENT	and	r0, r0, #15
21f746ac32SGregory CLEMENT	add	r1, r1, r0
22f746ac32SGregory CLEMENT	mov	r0, #0x0
23f746ac32SGregory CLEMENT	strb	r0, [r1]		@ switch SCU power state to Normal mode
24f746ac32SGregory CLEMENT	ret	lr
25f746ac32SGregory CLEMENTENDPROC(armada_38x_scu_power_up)
26f746ac32SGregory CLEMENT
276509dc74SThomas Petazzoni/*
286509dc74SThomas Petazzoni * This is the entry point through which CPUs exiting cpuidle deep
296509dc74SThomas Petazzoni * idle state are going.
306509dc74SThomas Petazzoni */
316509dc74SThomas PetazzoniENTRY(armada_370_xp_cpu_resume)
326509dc74SThomas PetazzoniARM_BE8(setend	be )			@ go BE8 if entered LE
336509dc74SThomas Petazzoni	bl	ll_add_cpu_to_smp_group
346509dc74SThomas Petazzoni	bl	ll_enable_coherency
356509dc74SThomas Petazzoni	b	cpu_resume
366509dc74SThomas PetazzoniENDPROC(armada_370_xp_cpu_resume)
376509dc74SThomas Petazzoni
38e53b1fd4SGregory CLEMENTENTRY(armada_38x_cpu_resume)
39e53b1fd4SGregory CLEMENT	/* do we need it for Armada 38x*/
40e53b1fd4SGregory CLEMENTARM_BE8(setend	be )			@ go BE8 if entered LE
41e53b1fd4SGregory CLEMENT	bl	v7_invalidate_l1
42f746ac32SGregory CLEMENT	bl	armada_38x_scu_power_up
43e53b1fd4SGregory CLEMENT	b	cpu_resume
44e53b1fd4SGregory CLEMENTENDPROC(armada_38x_cpu_resume)
45e53b1fd4SGregory CLEMENT
463076cc58SGregory CLEMENT.global mvebu_boot_wa_start
473076cc58SGregory CLEMENT.global mvebu_boot_wa_end
483076cc58SGregory CLEMENT
493076cc58SGregory CLEMENT/* The following code will be executed from SRAM */
503076cc58SGregory CLEMENTENTRY(mvebu_boot_wa_start)
513076cc58SGregory CLEMENTmvebu_boot_wa_start:
523076cc58SGregory CLEMENTARM_BE8(setend	be)
533076cc58SGregory CLEMENT	adr	r0, 1f
543076cc58SGregory CLEMENT	ldr	r0, [r0]		@ load the address of the
553076cc58SGregory CLEMENT					@ resume register
563076cc58SGregory CLEMENT	ldr	r0, [r0]		@ load the value in the
573076cc58SGregory CLEMENT					@ resume register
583076cc58SGregory CLEMENTARM_BE8(rev	r0, r0)			@ the value is stored LE
593076cc58SGregory CLEMENT	mov	pc, r0			@ jump to this value
603076cc58SGregory CLEMENT/*
613076cc58SGregory CLEMENT * the last word of this piece of code will be filled by the physical
623076cc58SGregory CLEMENT * address of the boot address register just after being copied in SRAM
633076cc58SGregory CLEMENT */
643076cc58SGregory CLEMENT1:
653076cc58SGregory CLEMENT	.long   .
663076cc58SGregory CLEMENTmvebu_boot_wa_end:
673076cc58SGregory CLEMENTENDPROC(mvebu_boot_wa_end)
68