2 * Copyright (C) 2006 Semihalf, Marian Balakowicz <m8@semihalf.com>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
19 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #include <machine/param.h>
33 #include <machine/asm.h>
34 #include <machine/spr.h>
35 #include <machine/psl.h>
36 #include <machine/pte.h>
37 #include <machine/trap.h>
38 #include <machine/vmparam.h>
39 #include <machine/tlb.h>
43 * void remap_ccsrbar(vm_offset_t old_ccsrbar_va, vm_offset_t new_ccsrbar_va,
44 * vm_offset_t new_ccsrbar_pa)
52 * CCSRBAR updating sequence according
53 * to section 4.3.1.1.1 of MPC8555E RM.
56 /* Read current value of CCSRBAR */
61 rlwinm %r6, %r5, 20, 12, 23
65 * Read from address that is outside of CCSRBAR space.
66 * We have RAM locations available at KERNBASE.
69 addi %r7, %r7, KERNBASE@l
73 /* Read value of CCSRBAR from new location */
79 * void switch_to_as0(void)
82 mflr %r5 /* Save LR */
85 lis %r6, (PSL_IS | PSL_DS)@ha
86 ori %r6, %r6, (PSL_IS | PSL_DS)@l
88 and %r3, %r3, %r6 /* Clear IS/DS bits */
91 1: mflr %r4 /* Use current address */
92 addi %r4, %r4, 20 /* Increment to instruction after rfi */
97 mtlr %r5 /* Restore LR */
101 * void load_pid0(tlbtid_t)