2 * Copyright (c) 2007 Semihalf, Rafal Jaworowski <raj@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.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 #include <machine/asm.h>
32 * Entry point to the loader that U-Boot passes control to.
37 /* Hint where to look for the API signature */
38 lis %r11, uboot_address@ha
39 addi %r11, %r11, uboot_address@l
41 /* Save U-Boot's r14 */
42 lis %r11, saved_regs@ha
43 addi %r11, %r11, saved_regs@l
45 /* Disable interrupts */
47 andi. %r11, %r11, ~0x8000@l
59 /* Restore U-Boot's r14 */
60 lis %r11, saved_regs@ha
61 addi %r11, %r11, saved_regs@l
63 /* Enable interrupts */
65 ori %r11, %r11, 0x8000@l
67 /* Call into U-Boot */
68 lis %r11, syscall_ptr@ha
69 addi %r11, %r11, syscall_ptr@l
73 /* Disable interrupts */
75 andi. %r11, %r11, ~0x8000@l