blob: 5e9f3e128ee261a7e25b79a06c67118a37bb26ec [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * Copyright (C) 2001 Mike Corrigan IBM Corporation
Stephen Rothwellfcee3892005-06-21 17:15:34 -07003 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
Stephen Rothwellfcee3892005-06-21 17:15:34 -07008 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
Stephen Rothwellfcee3892005-06-21 17:15:34 -070013 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
Kelly Dalyecb3ca272005-11-02 15:53:01 +110018#ifndef _ASM_POWERPC_ISERIES_LPAR_MAP_H
19#define _ASM_POWERPC_ISERIES_LPAR_MAP_H
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Stephen Rothwell2ad56492005-08-17 13:01:50 +100021#ifndef __ASSEMBLY__
22
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#include <asm/types.h>
24
Stephen Rothwell16a15a32007-08-20 14:58:36 +100025#endif
26
Stephen Rothwellfcee3892005-06-21 17:15:34 -070027/*
28 * The iSeries hypervisor will set up mapping for one or more
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 * ESID/VSID pairs (in SLB/segment registers) and will set up
30 * mappings of one or more ranges of pages to VAs.
31 * We will have the hypervisor set up the ESID->VSID mapping
32 * for the four kernel segments (C-F). With shared processors,
33 * the hypervisor will clear all segment registers and reload
Stephen Rothwellfcee3892005-06-21 17:15:34 -070034 * these four whenever the processor is switched from one
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 * partition to another.
36 */
37
38/* The Vsid and Esid identified below will be used by the hypervisor
39 * to set up a memory mapping for part of the load area before giving
40 * control to the Linux kernel. The load area is 64 MB, but this must
41 * not attempt to map the whole load area. The Hashed Page Table may
42 * need to be located within the load area (if the total partition size
43 * is 64 MB), but cannot be mapped. Typically, this should specify
44 * to map half (32 MB) of the load area.
Stephen Rothwellfcee3892005-06-21 17:15:34 -070045 *
46 * The hypervisor will set up page table entries for the number of
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 * pages specified.
48 *
49 * In 32-bit mode, the hypervisor will load all four of the
Stephen Rothwellfcee3892005-06-21 17:15:34 -070050 * segment registers (identified by the low-order four bits of the
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 * Esid field. In 64-bit mode, the hypervisor will load one SLB
52 * entry to map the Esid to the Vsid.
53*/
54
David Gibson488f8492005-07-27 11:44:21 -070055#define HvEsidsToMap 2
56#define HvRangesToMap 1
57
Stephen Rothwellfcee3892005-06-21 17:15:34 -070058/* Hypervisor initially maps 32MB of the load area */
59#define HvPagesToMap 8192
Linus Torvalds1da177e2005-04-16 15:20:36 -070060
Stephen Rothwell16a15a32007-08-20 14:58:36 +100061#ifndef __ASSEMBLY__
Stephen Rothwellfcee3892005-06-21 17:15:34 -070062struct LparMap {
David Gibson488f8492005-07-27 11:44:21 -070063 u64 xNumberEsids; // Number of ESID/VSID pairs
64 u64 xNumberRanges; // Number of VA ranges to map
65 u64 xSegmentTableOffs; // Page number within load area of seg table
Stephen Rothwellfcee3892005-06-21 17:15:34 -070066 u64 xRsvd[5];
David Gibson488f8492005-07-27 11:44:21 -070067 struct {
68 u64 xKernelEsid; // Esid used to map kernel load
69 u64 xKernelVsid; // Vsid used to map kernel load
70 } xEsids[HvEsidsToMap];
71 struct {
72 u64 xPages; // Number of pages to be mapped
73 u64 xOffset; // Offset from start of load area
74 u64 xVPN; // Virtual Page Number
75 } xRanges[HvRangesToMap];
Linus Torvalds1da177e2005-04-16 15:20:36 -070076};
77
Stephen Rothwell2ad56492005-08-17 13:01:50 +100078extern const struct LparMap xLparMap;
79
80#endif /* __ASSEMBLY__ */
81
82/* the fixed address where the LparMap exists */
83#define LPARMAP_PHYS 0x7000
Stephen Rothwell0bc0ffd2005-06-21 17:15:36 -070084
Kelly Dalyecb3ca272005-11-02 15:53:01 +110085#endif /* _ASM_POWERPC_ISERIES_LPAR_MAP_H */