|
| 1 | +/* $NetBSD: cpufunc_asm_pj4b.S,v 1.7 2015/04/15 10:52:18 hsuenaga Exp $ */ |
| 2 | + |
| 3 | +/******************************************************************************* |
| 4 | +Copyright (C) Marvell International Ltd. and its affiliates |
| 5 | + |
| 6 | +Developed by Semihalf |
| 7 | + |
| 8 | +******************************************************************************** |
| 9 | +Marvell BSD License |
| 10 | + |
| 11 | +If you received this File from Marvell, you may opt to use, redistribute and/or |
| 12 | +modify this File under the following licensing terms. |
| 13 | +Redistribution and use in source and binary forms, with or without modification, |
| 14 | +are permitted provided that the following conditions are met: |
| 15 | + |
| 16 | + * Redistributions of source code must retain the above copyright notice, |
| 17 | + this list of conditions and the following disclaimer. |
| 18 | + |
| 19 | + * Redistributions in binary form must reproduce the above copyright |
| 20 | + notice, this list of conditions and the following disclaimer in the |
| 21 | + documentation and/or other materials provided with the distribution. |
| 22 | + |
| 23 | + * Neither the name of Marvell nor the names of its contributors may be |
| 24 | + used to endorse or promote products derived from this software without |
| 25 | + specific prior written permission. |
| 26 | + |
| 27 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 28 | +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 29 | +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 30 | +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
| 31 | +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 32 | +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 33 | +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 34 | +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 35 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 36 | +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 37 | + |
| 38 | +*******************************************************************************/ |
| 39 | + |
| 40 | +#include <arm/armreg.h> |
| 41 | +#include <machine/asm.h> |
| 42 | + |
| 43 | +.Lpj4b_cache_line_size: |
| 44 | + .word _C_LABEL(arm_dcache_align) |
| 45 | + |
| 46 | +ENTRY(pj4b_cpu_sleep) |
| 47 | + dsb |
| 48 | + wfi @ wait for an interrupt |
| 49 | + dsb @ Erratum#ARM-CPU-4742 |
| 50 | + mov pc, lr |
| 51 | + |
| 52 | +ENTRY(pj4b_config) |
| 53 | + /* Set Auxiliary Debug Modes Control 0 register */ |
| 54 | + mrc p15, 1, r0, c15, c1, 0 |
| 55 | + bic r0, r0, #(1 << 12) @ Erratum#ARM-CPU-6136 |
| 56 | + @ LDSTM 1st issue is single word |
| 57 | + orr r0, r0, #(1 << 22) @ DVM_WAKEUP enable |
| 58 | + mcr p15, 1, r0, c15, c1, 0 |
| 59 | + |
| 60 | + /* Set Auxiliary Debug Modes Control 1 register */ |
| 61 | + mrc p15, 1, r0, c15, c1, 1 |
| 62 | + bic r0, r0, #(1 << 2) @ Erratum#ARM-CPU-6409 |
| 63 | + @ Disable static branch prediction |
| 64 | + orr r0, r0, #(1 << 5) @ STREX backoff disable |
| 65 | + mcr p15, 1, r0, c15, c1, 1 |
| 66 | + |
| 67 | + /* Set Auxiliary Debug Modes Control 2 register */ |
| 68 | + mrc p15, 1, r0, c15, c1, 2 |
| 69 | + bic r0, r0, #(1 << 23) @ Enable fast LDR |
| 70 | + orr r0, r0, #(1 << 25) @ Intervention Interleave disable |
| 71 | + orr r0, r0, #(1 << 27) @ Critical word 1st sequencing dis. |
| 72 | + orr r0, r0, #(1 << 29) @ Disable MO device R/W |
| 73 | + orr r0, r0, #(1 << 30) @ L1 cache strict round-robin |
| 74 | + orr r0, r0, #(1 << 31) @ Enable write evict |
| 75 | + mcr p15, 1, r0, c15, c1, 2 |
| 76 | + |
| 77 | + /* Set Auxiliary FUnction Modes Control 0 register */ |
| 78 | + mrc p15, 1, r0, c15, c2, 0 |
| 79 | +#ifdef MULTIPROCESSOR |
| 80 | + orr r0, r0, #(1 << 1) @ SMP/nAMP enable |
| 81 | +#endif |
| 82 | + orr r0, r0, #(1 << 2) @ L2 parity enable |
| 83 | + orr r0, r0, #(1 << 8) @ Cache & TLB maintenance broadcast |
| 84 | + mcr p15, 1, r0, c15, c2, 0 |
| 85 | + |
| 86 | + mov pc, lr |
0 commit comments