| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Routines for doing kexec-based kdump. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2005, IBM Corp. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Created by: Michael Ellerman |
|---|
| 7 | | - * |
|---|
| 8 | | - * This source code is licensed under the GNU General Public License, |
|---|
| 9 | | - * Version 2. See the file COPYING for more details. |
|---|
| 10 | 8 | */ |
|---|
| 11 | 9 | |
|---|
| 12 | 10 | #undef DEBUG |
|---|
| .. | .. |
|---|
| 20 | 18 | #include <asm/firmware.h> |
|---|
| 21 | 19 | #include <linux/uaccess.h> |
|---|
| 22 | 20 | #include <asm/rtas.h> |
|---|
| 21 | +#include <asm/inst.h> |
|---|
| 23 | 22 | |
|---|
| 24 | 23 | #ifdef DEBUG |
|---|
| 25 | 24 | #include <asm/udbg.h> |
|---|
| .. | .. |
|---|
| 36 | 35 | |
|---|
| 37 | 36 | static void __init create_trampoline(unsigned long addr) |
|---|
| 38 | 37 | { |
|---|
| 39 | | - unsigned int *p = (unsigned int *)addr; |
|---|
| 38 | + struct ppc_inst *p = (struct ppc_inst *)addr; |
|---|
| 40 | 39 | |
|---|
| 41 | 40 | /* The maximum range of a single instruction branch, is the current |
|---|
| 42 | 41 | * instruction's address + (32 MB - 4) bytes. For the trampoline we |
|---|
| .. | .. |
|---|
| 46 | 45 | * branch to "addr" we jump to ("addr" + 32 MB). Although it requires |
|---|
| 47 | 46 | * two instructions it doesn't require any registers. |
|---|
| 48 | 47 | */ |
|---|
| 49 | | - patch_instruction(p, PPC_INST_NOP); |
|---|
| 50 | | - patch_branch(++p, addr + PHYSICAL_START, 0); |
|---|
| 48 | + patch_instruction(p, ppc_inst(PPC_INST_NOP)); |
|---|
| 49 | + patch_branch((void *)p + 4, addr + PHYSICAL_START, 0); |
|---|
| 51 | 50 | } |
|---|
| 52 | 51 | |
|---|
| 53 | 52 | void __init setup_kdump_trampoline(void) |
|---|
| .. | .. |
|---|
| 110 | 109 | vaddr = __va(paddr); |
|---|
| 111 | 110 | csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); |
|---|
| 112 | 111 | } else { |
|---|
| 113 | | - vaddr = __ioremap(paddr, PAGE_SIZE, 0); |
|---|
| 112 | + vaddr = ioremap_cache(paddr, PAGE_SIZE); |
|---|
| 114 | 113 | csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); |
|---|
| 115 | 114 | iounmap(vaddr); |
|---|
| 116 | 115 | } |
|---|