summaryrefslogtreecommitdiffstats
path: root/src/include/usr/vmmconst.h
blob: d3b29415e46b12565853eb51f2c6ddca7ad8c36e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/include/usr/vmmconst.h $                                  */
/*                                                                        */
/* IBM CONFIDENTIAL                                                       */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2011,2013              */
/*                                                                        */
/* p1                                                                     */
/*                                                                        */
/* Object Code Only (OCO) source materials                                */
/* Licensed Internal Code Source Materials                                */
/* IBM HostBoot Licensed Internal Code                                    */
/*                                                                        */
/* The source code for this program is not published or otherwise         */
/* divested of its trade secrets, irrespective of what has been           */
/* deposited with the U.S. Copyright Office.                              */
/*                                                                        */
/* Origin: 30                                                             */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
#ifndef _VMMCONST_H
#define _VMMCONST_H

/**
 * This file contains any hardcoded memory addresses used by the
 * Virtual Memory Subsystem
 */

#include <limits.h>

/**
 * Segments
 */

/** Stacks are all 1TB in size. */
#define VMM_SEGMENT_SIZE (1 * TERABYTE)

/** Base Segment is at 0 TB */
#define VMM_VADDR_BASE_SEGMENT  (0 * TERABYTE)

/** Stack Segment is at 1 TB */
#define VMM_VADDR_STACK_SEGMENT  (VMM_VADDR_BASE_SEGMENT + VMM_SEGMENT_SIZE)

/** Device Segments are at 2 TB - 10 TB */
#define VMM_VADDR_DEVICE_SEGMENT_FIRST  \
            (VMM_VADDR_STACK_SEGMENT + VMM_SEGMENT_SIZE)

#define VMM_VADDR_DEVICE_SEGMENT_LAST  \
            (VMM_VADDR_DEVICE_SEGMENT_FIRST + (8 * VMM_SEGMENT_SIZE))

/**
 * Blocks
 */

/** Base Segment Base Block Base Address */
#define VMM_ADDR_BASE_BLOCK 0

/** Base Segment Base Block size */
#define VMM_BASE_BLOCK_SIZE (8*MEGABYTE)

/** Base Segment Extended Memory Block Base Address */
#define VMM_ADDR_EXTEND_BLOCK (VMM_ADDR_BASE_BLOCK + VMM_BASE_BLOCK_SIZE)

/** Maximize size of Base Segment Memory after expansion */
#define VMM_MEMORY_SIZE (32*MEGABYTE)

/** Base Segment Extended Memory Block Size */
#define VMM_EXTEND_BLOCK_SIZE (VMM_MEMORY_SIZE-VMM_BASE_BLOCK_SIZE)

/**
 * Resource Providers
 */

/** Extended Image is at 1GB */
#define VMM_VADDR_VFS_EXT_MODULE  (1 * GIGABYTE)
// Note : vfs.h hardcodes this value due to external compile issues

/** PNOR Resource Provider is at 2GB */
#define VMM_VADDR_PNOR_RP  (2 * GIGABYTE)

/** Attribute Resource Provider */
// Note: Not simplified to make it easier to extract with the PNOR targeting
// image generator script
// WARNING: 4 GB range deliberately chosen so that 64-bit Hostboot pointers
// are similar to 32 bit FSP pointers, except that the upper 32 bits are
// set to 0x00000001.  This allows both FSP and Hostboot to opearate on the same
// targeting image
#define VMM_VADDR_ATTR_RP  (4ul * 1024ul * 1024ul * 1024ul)

/** Virtual memory block priorities */
enum BlockPriority
{
    PNOR_PRIORITY = 0, //No dependencies
    VFS_PRIORITY  = (PNOR_PRIORITY + 1), //Dependent on PNOR
    ATTR_PRIORITY = (PNOR_PRIORITY + 1), //Dependent on PNOR
};

/**
 * Other Constants
 */

/** Segment Size in bits per SLBE  */
#define SLBE_s 40

/** Page Size in bits per SLBE  */
#define SLBE_b 12

/** Hardwired pointer to output SLW image in real mem */
/** 128M + 32M  */
/** SLW image must be on 1M boundary */
/** set_pore_bars expects a region size in MB.  It must be a power of 2 */
#define OUTPUT_PORE_IMG_ADDR        128*MEGABYTE + 32*MEGABYTE
#define MAX_OUTPUT_PORE_IMG_IN_MB   4


/**
 * Test Constants
 */

/** Base virtual address used in remove pages test */
#define VMM_VADDR_RMVPAGE_TEST (700 * GIGABYTE)

/** Block size used in remove pages test */
#define VMM_SIZE_RMVPAGE_TEST (8 * PAGESIZE)

/** Chunk of physical memory to use for HostServices Attributes */
#define HSVC_TEST_MEMORY_ADDR  (VMM_MEMORY_SIZE + 32*MEGABYTE)
#define HSVC_TEST_MEMORY_SIZE  (2*MEGABYTE)

/* Chunk of physical memory used for Dump Source Table */
//#define DUMP_TEST_SRC_MEM_ADDR  (VMM_MEMORY_SIZE + 64*MEGABYTE)
#define DUMP_TEST_MEMORY_ADDR (HSVC_TEST_MEMORY_ADDR + HSVC_TEST_MEMORY_SIZE)
#define DUMP_TEST_MEMORY_SIZE  (4*MEGABYTE)


// The rest of  these #defines will be moved to dumpif.H.

#define DUMP_TEST_SRC_MEM_ADDR  (HSVC_TEST_MEMORY_ADDR + HSVC_TEST_MEMORY_SIZE)
#define DUMP_TEST_SRC_MEM_SIZE  (MEGABYTE)

/* Chunk of physical memory used for Dump Destination Table */
#define DUMP_TEST_DST_MEM_ADDR  (DUMP_TEST_SRC_MEM_ADDR + DUMP_TEST_SRC_MEM_SIZE)
#define DUMP_TEST_DST_MEM_SIZE  (MEGABYTE)

/* Chunk of physical memory used for Dump Results Table */
#define DUMP_TEST_RESULTS_MEM_ADDR  (DUMP_TEST_DST_MEM_ADDR + DUMP_TEST_DST_MEM_SIZE)
#define DUMP_TEST_RESULTS_MEM_SIZE  (MEGABYTE)

// Data location where the src, destination tables point to.
#define DUMP_TEST_SRC_DATA_AREA      DUMP_TEST_RESULTS_MEM_ADDR +  DUMP_TEST_RESULTS_MEM_SIZE
#define DUMP_TEST_DST_DATA_AREA      DUMP_TEST_SRC_DATA_AREA +  DUMP_TEST_DATA_SIZE
#define DUMP_TEST_DATA_SIZE          MEGABYTE

// default enums to point out the start and end of the DUMP Tables in memory
#define DUMP_TEST_TABLE_START  DUMP_TEST_SRC_MEM_ADDR
#define DUMP_TEST_TABLE_SIZE  DUMP_TEST_SRC_MEM_SIZE + DUMP_TEST_DST_MEM_SIZE + DUMP_TEST_RESULTS_MEM_SIZE
#define DUMP_TEST_TABLE_END  DUMP_TEST_TABLE_START + DUMP_TEST_TABLE_SIZE 

// In addition to the dump table locations we have scratch data area that is used
// to put the SRC data that the MDST will point to.

// This is the size of all the Data used for Dump testing
#define DUMP_TEST_ALL_SIZE = DUMP_TEST_TABLE_SIZE + (2*MEGABYTE)
// This is the ending address of test Data area
#define DUMP_TEST_ALL_END = DUMP_TEST_TABLE_START + DUMP_TEST_ALL_SIZE


#endif /* _VMMCONST_H */
OpenPOWER on IntegriCloud