Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * LparMap.h |
| 3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
Stephen Rothwell | fcee389 | 2005-06-21 17:15:34 -0700 | [diff] [blame] | 4 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
Stephen Rothwell | fcee389 | 2005-06-21 17:15:34 -0700 | [diff] [blame] | 9 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Stephen Rothwell | fcee389 | 2005-06-21 17:15:34 -0700 | [diff] [blame] | 14 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | */ |
Kelly Daly | ecb3ca2 | 2005-11-02 15:53:01 +1100 | [diff] [blame^] | 19 | #ifndef _ASM_POWERPC_ISERIES_LPAR_MAP_H |
| 20 | #define _ASM_POWERPC_ISERIES_LPAR_MAP_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
Stephen Rothwell | 2ad5649 | 2005-08-17 13:01:50 +1000 | [diff] [blame] | 22 | #ifndef __ASSEMBLY__ |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #include <asm/types.h> |
| 25 | |
Stephen Rothwell | fcee389 | 2005-06-21 17:15:34 -0700 | [diff] [blame] | 26 | /* |
| 27 | * The iSeries hypervisor will set up mapping for one or more |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | * ESID/VSID pairs (in SLB/segment registers) and will set up |
| 29 | * mappings of one or more ranges of pages to VAs. |
| 30 | * We will have the hypervisor set up the ESID->VSID mapping |
| 31 | * for the four kernel segments (C-F). With shared processors, |
| 32 | * the hypervisor will clear all segment registers and reload |
Stephen Rothwell | fcee389 | 2005-06-21 17:15:34 -0700 | [diff] [blame] | 33 | * these four whenever the processor is switched from one |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | * partition to another. |
| 35 | */ |
| 36 | |
| 37 | /* The Vsid and Esid identified below will be used by the hypervisor |
| 38 | * to set up a memory mapping for part of the load area before giving |
| 39 | * control to the Linux kernel. The load area is 64 MB, but this must |
| 40 | * not attempt to map the whole load area. The Hashed Page Table may |
| 41 | * need to be located within the load area (if the total partition size |
| 42 | * is 64 MB), but cannot be mapped. Typically, this should specify |
| 43 | * to map half (32 MB) of the load area. |
Stephen Rothwell | fcee389 | 2005-06-21 17:15:34 -0700 | [diff] [blame] | 44 | * |
| 45 | * The hypervisor will set up page table entries for the number of |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | * pages specified. |
| 47 | * |
| 48 | * In 32-bit mode, the hypervisor will load all four of the |
Stephen Rothwell | fcee389 | 2005-06-21 17:15:34 -0700 | [diff] [blame] | 49 | * segment registers (identified by the low-order four bits of the |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | * Esid field. In 64-bit mode, the hypervisor will load one SLB |
| 51 | * entry to map the Esid to the Vsid. |
| 52 | */ |
| 53 | |
David Gibson | 488f849 | 2005-07-27 11:44:21 -0700 | [diff] [blame] | 54 | #define HvEsidsToMap 2 |
| 55 | #define HvRangesToMap 1 |
| 56 | |
Stephen Rothwell | fcee389 | 2005-06-21 17:15:34 -0700 | [diff] [blame] | 57 | /* Hypervisor initially maps 32MB of the load area */ |
| 58 | #define HvPagesToMap 8192 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
Stephen Rothwell | fcee389 | 2005-06-21 17:15:34 -0700 | [diff] [blame] | 60 | struct LparMap { |
David Gibson | 488f849 | 2005-07-27 11:44:21 -0700 | [diff] [blame] | 61 | u64 xNumberEsids; // Number of ESID/VSID pairs |
| 62 | u64 xNumberRanges; // Number of VA ranges to map |
| 63 | u64 xSegmentTableOffs; // Page number within load area of seg table |
Stephen Rothwell | fcee389 | 2005-06-21 17:15:34 -0700 | [diff] [blame] | 64 | u64 xRsvd[5]; |
David Gibson | 488f849 | 2005-07-27 11:44:21 -0700 | [diff] [blame] | 65 | struct { |
| 66 | u64 xKernelEsid; // Esid used to map kernel load |
| 67 | u64 xKernelVsid; // Vsid used to map kernel load |
| 68 | } xEsids[HvEsidsToMap]; |
| 69 | struct { |
| 70 | u64 xPages; // Number of pages to be mapped |
| 71 | u64 xOffset; // Offset from start of load area |
| 72 | u64 xVPN; // Virtual Page Number |
| 73 | } xRanges[HvRangesToMap]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | }; |
| 75 | |
Stephen Rothwell | 2ad5649 | 2005-08-17 13:01:50 +1000 | [diff] [blame] | 76 | extern const struct LparMap xLparMap; |
| 77 | |
| 78 | #endif /* __ASSEMBLY__ */ |
| 79 | |
| 80 | /* the fixed address where the LparMap exists */ |
| 81 | #define LPARMAP_PHYS 0x7000 |
Stephen Rothwell | 0bc0ffd | 2005-06-21 17:15:36 -0700 | [diff] [blame] | 82 | |
Kelly Daly | ecb3ca2 | 2005-11-02 15:53:01 +1100 | [diff] [blame^] | 83 | #endif /* _ASM_POWERPC_ISERIES_LPAR_MAP_H */ |