blob: 5c32e38c1c0168aab1fa9fc202f3e9f6973709d8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * LparMap.h
3 * Copyright (C) 2001 Mike Corrigan IBM Corporation
Stephen Rothwellfcee3892005-06-21 17:15:34 -07004 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 * 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 Rothwellfcee3892005-06-21 17:15:34 -07009 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 * 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 Rothwellfcee3892005-06-21 17:15:34 -070014 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070015 * 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 */
19#ifndef _LPARMAP_H
20#define _LPARMAP_H
21
22#include <asm/types.h>
23
Stephen Rothwellfcee3892005-06-21 17:15:34 -070024/*
25 * The iSeries hypervisor will set up mapping for one or more
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 * ESID/VSID pairs (in SLB/segment registers) and will set up
27 * mappings of one or more ranges of pages to VAs.
28 * We will have the hypervisor set up the ESID->VSID mapping
29 * for the four kernel segments (C-F). With shared processors,
30 * the hypervisor will clear all segment registers and reload
Stephen Rothwellfcee3892005-06-21 17:15:34 -070031 * these four whenever the processor is switched from one
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 * partition to another.
33 */
34
35/* The Vsid and Esid identified below will be used by the hypervisor
36 * to set up a memory mapping for part of the load area before giving
37 * control to the Linux kernel. The load area is 64 MB, but this must
38 * not attempt to map the whole load area. The Hashed Page Table may
39 * need to be located within the load area (if the total partition size
40 * is 64 MB), but cannot be mapped. Typically, this should specify
41 * to map half (32 MB) of the load area.
Stephen Rothwellfcee3892005-06-21 17:15:34 -070042 *
43 * The hypervisor will set up page table entries for the number of
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 * pages specified.
45 *
46 * In 32-bit mode, the hypervisor will load all four of the
Stephen Rothwellfcee3892005-06-21 17:15:34 -070047 * segment registers (identified by the low-order four bits of the
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 * Esid field. In 64-bit mode, the hypervisor will load one SLB
49 * entry to map the Esid to the Vsid.
50*/
51
David Gibson488f8492005-07-27 11:44:21 -070052#define HvEsidsToMap 2
53#define HvRangesToMap 1
54
Stephen Rothwellfcee3892005-06-21 17:15:34 -070055/* Hypervisor initially maps 32MB of the load area */
56#define HvPagesToMap 8192
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
Stephen Rothwellfcee3892005-06-21 17:15:34 -070058struct LparMap {
David Gibson488f8492005-07-27 11:44:21 -070059 u64 xNumberEsids; // Number of ESID/VSID pairs
60 u64 xNumberRanges; // Number of VA ranges to map
61 u64 xSegmentTableOffs; // Page number within load area of seg table
Stephen Rothwellfcee3892005-06-21 17:15:34 -070062 u64 xRsvd[5];
David Gibson488f8492005-07-27 11:44:21 -070063 struct {
64 u64 xKernelEsid; // Esid used to map kernel load
65 u64 xKernelVsid; // Vsid used to map kernel load
66 } xEsids[HvEsidsToMap];
67 struct {
68 u64 xPages; // Number of pages to be mapped
69 u64 xOffset; // Offset from start of load area
70 u64 xVPN; // Virtual Page Number
71 } xRanges[HvRangesToMap];
Linus Torvalds1da177e2005-04-16 15:20:36 -070072};
73
Stephen Rothwell0bc0ffd2005-06-21 17:15:36 -070074extern struct LparMap xLparMap;
75
Linus Torvalds1da177e2005-04-16 15:20:36 -070076#endif /* _LPARMAP_H */