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 156509dc74SThomas Petazzoni/* 166509dc74SThomas Petazzoni * This is the entry point through which CPUs exiting cpuidle deep 176509dc74SThomas Petazzoni * idle state are going. 186509dc74SThomas Petazzoni */ 196509dc74SThomas PetazzoniENTRY(armada_370_xp_cpu_resume) 206509dc74SThomas PetazzoniARM_BE8(setend be ) @ go BE8 if entered LE 216509dc74SThomas Petazzoni bl ll_add_cpu_to_smp_group 226509dc74SThomas Petazzoni bl ll_enable_coherency 236509dc74SThomas Petazzoni b cpu_resume 246509dc74SThomas PetazzoniENDPROC(armada_370_xp_cpu_resume) 256509dc74SThomas Petazzoni 26e53b1fd4SGregory CLEMENTENTRY(armada_38x_cpu_resume) 27e53b1fd4SGregory CLEMENT /* do we need it for Armada 38x*/ 28e53b1fd4SGregory CLEMENTARM_BE8(setend be ) @ go BE8 if entered LE 29e53b1fd4SGregory CLEMENT bl v7_invalidate_l1 30e53b1fd4SGregory CLEMENT mrc p15, 4, r1, c15, c0 @ get SCU base address 31e53b1fd4SGregory CLEMENT orr r1, r1, #0x8 @ SCU CPU Power Status Register 32e53b1fd4SGregory CLEMENT mrc 15, 0, r0, cr0, cr0, 5 @ get the CPU ID 33e53b1fd4SGregory CLEMENT and r0, r0, #15 34e53b1fd4SGregory CLEMENT add r1, r1, r0 35e53b1fd4SGregory CLEMENT mov r0, #0x0 36e53b1fd4SGregory CLEMENT strb r0, [r1] @ switch SCU power state to Normal mode 37e53b1fd4SGregory CLEMENT b cpu_resume 38e53b1fd4SGregory CLEMENTENDPROC(armada_38x_cpu_resume) 39e53b1fd4SGregory CLEMENT 403076cc58SGregory CLEMENT.global mvebu_boot_wa_start 413076cc58SGregory CLEMENT.global mvebu_boot_wa_end 423076cc58SGregory CLEMENT 433076cc58SGregory CLEMENT/* The following code will be executed from SRAM */ 443076cc58SGregory CLEMENTENTRY(mvebu_boot_wa_start) 453076cc58SGregory CLEMENTmvebu_boot_wa_start: 463076cc58SGregory CLEMENTARM_BE8(setend be) 473076cc58SGregory CLEMENT adr r0, 1f 483076cc58SGregory CLEMENT ldr r0, [r0] @ load the address of the 493076cc58SGregory CLEMENT @ resume register 503076cc58SGregory CLEMENT ldr r0, [r0] @ load the value in the 513076cc58SGregory CLEMENT @ resume register 523076cc58SGregory CLEMENTARM_BE8(rev r0, r0) @ the value is stored LE 533076cc58SGregory CLEMENT mov pc, r0 @ jump to this value 543076cc58SGregory CLEMENT/* 553076cc58SGregory CLEMENT * the last word of this piece of code will be filled by the physical 563076cc58SGregory CLEMENT * address of the boot address register just after being copied in SRAM 573076cc58SGregory CLEMENT */ 583076cc58SGregory CLEMENT1: 593076cc58SGregory CLEMENT .long . 603076cc58SGregory CLEMENTmvebu_boot_wa_end: 613076cc58SGregory CLEMENTENDPROC(mvebu_boot_wa_end) 62