2 * Copyright (C) 2016 Broadcom Corporation
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
15 #include <asm/regdef.h>
16 #include <asm/mipsregs.h>
17 #include <asm/bmips.h>
27 * a0: AON_CTRL base register
28 * a1: D-Cache line size
32 /* Get the address of s3_context */
51 /* Write-back gp registers - cache will be gone */
56 /* Flush at least 64 bytes */
64 /* Drop to deep standby */
66 sw zero, AON_CTRL_PM_CTRL(a0)
67 lw zero, AON_CTRL_PM_CTRL(a0)
68 sw t1, AON_CTRL_PM_CTRL(a0)
69 lw t1, AON_CTRL_PM_CTRL(a0)
71 li t1, (PM_WARM_CONFIG | PM_PWR_DOWN)
72 sw t1, AON_CTRL_PM_CTRL(a0)
73 lw t1, AON_CTRL_PM_CTRL(a0)
75 /* Enable CP0 interrupt 2 and wait for interrupt */
78 li t1, ~(ST0_IM | ST0_IE)
88 /* Wait for interrupt */
94 /* Clear call/return stack */
101 /* Clear jump target buffer */
111 /* Setup mmu defaults */
113 mtc0 zero, CP0_ENTRYHI
114 li k0, PM_DEFAULT_MASK
115 mtc0 k0, CP0_PAGEMASK
117 li sp, BMIPS_WARM_RESTART_VEC
118 la k0, plat_wired_tlb_setup
122 /* Restore general purpose registers */
137 /* Restore CP0 status */
141 /* Return to caller */