blob: 6857af58b02eef9ddc9f2a91d42d28259a5a4b6b [file] [log] [blame]
Michael Ellerman0cc47462005-12-04 18:39:37 +11001#ifndef _PPC64_KDUMP_H
2#define _PPC64_KDUMP_H
3
Dale Farnsworthf8f50b12008-12-17 10:09:26 +00004#include <asm/page.h>
5
Anton Blanchardb5416ca2010-06-07 15:34:38 +00006/*
7 * If CONFIG_RELOCATABLE is enabled we can place the kdump kernel anywhere.
8 * To keep enough space in the RMO for the first stage kernel on 64bit, we
9 * place it at 64MB. If CONFIG_RELOCATABLE is not enabled we must place
10 * the second stage at 32MB.
11 */
12#if defined(CONFIG_RELOCATABLE) && defined(CONFIG_PPC64)
13#define KDUMP_KERNELBASE 0x4000000
14#else
Michael Ellerman47310412006-05-17 18:00:49 +100015#define KDUMP_KERNELBASE 0x2000000
Anton Blanchardb5416ca2010-06-07 15:34:38 +000016#endif
Michael Ellerman47310412006-05-17 18:00:49 +100017
Michael Ellerman0cc47462005-12-04 18:39:37 +110018/* How many bytes to reserve at zero for kdump. The reserve limit should
Michael Ellerman47310412006-05-17 18:00:49 +100019 * be greater or equal to the trampoline's end address.
20 * Reserve to the end of the FWNMI area, see head_64.S */
Sachin P. Sante269d262006-09-08 07:59:52 +053021#define KDUMP_RESERVE_LIMIT 0x10000 /* 64K */
Michael Ellerman0cc47462005-12-04 18:39:37 +110022
Michael Ellerman47310412006-05-17 18:00:49 +100023#ifdef CONFIG_CRASH_DUMP
24
Dale Farnsworthf8f50b12008-12-17 10:09:26 +000025/*
26 * On PPC64 translation is disabled during trampoline setup, so we use
27 * physical addresses. Though on PPC32 translation is already enabled,
28 * so we can't do the same. Luckily create_trampoline() creates relative
29 * branches, so we can just add the PAGE_OFFSET and don't worry about it.
30 */
31#ifdef __powerpc64__
Michael Ellerman0cc47462005-12-04 18:39:37 +110032#define KDUMP_TRAMPOLINE_START 0x0100
33#define KDUMP_TRAMPOLINE_END 0x3000
Dale Farnsworthf8f50b12008-12-17 10:09:26 +000034#else
35#define KDUMP_TRAMPOLINE_START (0x0100 + PAGE_OFFSET)
36#define KDUMP_TRAMPOLINE_END (0x3000 + PAGE_OFFSET)
37#endif /* __powerpc64__ */
Michael Ellerman0cc47462005-12-04 18:39:37 +110038
Haren Myneni5f508672006-06-22 23:35:10 -070039#define KDUMP_MIN_TCE_ENTRIES 2048
40
Michael Ellerman47310412006-05-17 18:00:49 +100041#endif /* CONFIG_CRASH_DUMP */
42
43#ifndef __ASSEMBLY__
Michael Ellerman47310412006-05-17 18:00:49 +100044
Mohan Kumar M54622f12008-10-21 17:38:10 +000045#if defined(CONFIG_CRASH_DUMP) && !defined(CONFIG_RELOCATABLE)
Michael Ellerman47310412006-05-17 18:00:49 +100046extern void reserve_kdump_trampoline(void);
47extern void setup_kdump_trampoline(void);
Mohan Kumar M54622f12008-10-21 17:38:10 +000048#else
49/* !CRASH_DUMP || RELOCATABLE */
Michael Ellerman47310412006-05-17 18:00:49 +100050static inline void reserve_kdump_trampoline(void) { ; }
51static inline void setup_kdump_trampoline(void) { ; }
Mohan Kumar M54622f12008-10-21 17:38:10 +000052#endif
Michael Ellerman47310412006-05-17 18:00:49 +100053
Michael Ellerman47310412006-05-17 18:00:49 +100054#endif /* __ASSEMBLY__ */
Michael Ellerman0cc47462005-12-04 18:39:37 +110055
56#endif /* __PPC64_KDUMP_H */