| Michael Ellerman | 0cc4746 | 2005-12-04 18:39:37 +1100 | [diff] [blame] | 1 | #ifndef _PPC64_KDUMP_H | 
 | 2 | #define _PPC64_KDUMP_H | 
 | 3 |  | 
| Dale Farnsworth | f8f50b1 | 2008-12-17 10:09:26 +0000 | [diff] [blame] | 4 | #include <asm/page.h> | 
 | 5 |  | 
| Anton Blanchard | b5416ca | 2010-06-07 15:34:38 +0000 | [diff] [blame] | 6 | /* | 
 | 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 Ellerman | 4731041 | 2006-05-17 18:00:49 +1000 | [diff] [blame] | 15 | #define KDUMP_KERNELBASE	0x2000000 | 
| Anton Blanchard | b5416ca | 2010-06-07 15:34:38 +0000 | [diff] [blame] | 16 | #endif | 
| Michael Ellerman | 4731041 | 2006-05-17 18:00:49 +1000 | [diff] [blame] | 17 |  | 
| Michael Ellerman | 0cc4746 | 2005-12-04 18:39:37 +1100 | [diff] [blame] | 18 | /* How many bytes to reserve at zero for kdump. The reserve limit should | 
| Michael Ellerman | 4731041 | 2006-05-17 18:00:49 +1000 | [diff] [blame] | 19 |  * 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. Sant | e269d26 | 2006-09-08 07:59:52 +0530 | [diff] [blame] | 21 | #define KDUMP_RESERVE_LIMIT	0x10000 /* 64K */ | 
| Michael Ellerman | 0cc4746 | 2005-12-04 18:39:37 +1100 | [diff] [blame] | 22 |  | 
| Michael Ellerman | 4731041 | 2006-05-17 18:00:49 +1000 | [diff] [blame] | 23 | #ifdef CONFIG_CRASH_DUMP | 
 | 24 |  | 
| Dale Farnsworth | f8f50b1 | 2008-12-17 10:09:26 +0000 | [diff] [blame] | 25 | /* | 
 | 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 Ellerman | 0cc4746 | 2005-12-04 18:39:37 +1100 | [diff] [blame] | 32 | #define KDUMP_TRAMPOLINE_START	0x0100 | 
 | 33 | #define KDUMP_TRAMPOLINE_END	0x3000 | 
| Dale Farnsworth | f8f50b1 | 2008-12-17 10:09:26 +0000 | [diff] [blame] | 34 | #else | 
 | 35 | #define KDUMP_TRAMPOLINE_START	(0x0100 + PAGE_OFFSET) | 
 | 36 | #define KDUMP_TRAMPOLINE_END	(0x3000 + PAGE_OFFSET) | 
 | 37 | #endif /* __powerpc64__ */ | 
| Michael Ellerman | 0cc4746 | 2005-12-04 18:39:37 +1100 | [diff] [blame] | 38 |  | 
| Haren Myneni | 5f50867 | 2006-06-22 23:35:10 -0700 | [diff] [blame] | 39 | #define KDUMP_MIN_TCE_ENTRIES	2048 | 
 | 40 |  | 
| Michael Ellerman | 4731041 | 2006-05-17 18:00:49 +1000 | [diff] [blame] | 41 | #endif /* CONFIG_CRASH_DUMP */ | 
 | 42 |  | 
 | 43 | #ifndef __ASSEMBLY__ | 
| Michael Ellerman | 4731041 | 2006-05-17 18:00:49 +1000 | [diff] [blame] | 44 |  | 
| Mohan Kumar M | 54622f1 | 2008-10-21 17:38:10 +0000 | [diff] [blame] | 45 | #if defined(CONFIG_CRASH_DUMP) && !defined(CONFIG_RELOCATABLE) | 
| Michael Ellerman | 4731041 | 2006-05-17 18:00:49 +1000 | [diff] [blame] | 46 | extern void reserve_kdump_trampoline(void); | 
 | 47 | extern void setup_kdump_trampoline(void); | 
| Mohan Kumar M | 54622f1 | 2008-10-21 17:38:10 +0000 | [diff] [blame] | 48 | #else | 
 | 49 | /* !CRASH_DUMP || RELOCATABLE */ | 
| Michael Ellerman | 4731041 | 2006-05-17 18:00:49 +1000 | [diff] [blame] | 50 | static inline void reserve_kdump_trampoline(void) { ; } | 
 | 51 | static inline void setup_kdump_trampoline(void) { ; } | 
| Mohan Kumar M | 54622f1 | 2008-10-21 17:38:10 +0000 | [diff] [blame] | 52 | #endif | 
| Michael Ellerman | 4731041 | 2006-05-17 18:00:49 +1000 | [diff] [blame] | 53 |  | 
| Michael Ellerman | 4731041 | 2006-05-17 18:00:49 +1000 | [diff] [blame] | 54 | #endif /* __ASSEMBLY__ */ | 
| Michael Ellerman | 0cc4746 | 2005-12-04 18:39:37 +1100 | [diff] [blame] | 55 |  | 
 | 56 | #endif /* __PPC64_KDUMP_H */ |