aboutsummaryrefslogtreecommitdiffstats
path: root/roms/skiboot/doc/opal-api/opal-mpipl-173-174.rst
blob: 32e64e375ef107cc41b937e6f0a47f40cb599eb9 (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
.. _opal-api-mpipl:

OPAL MPIPL APIs
===============

.. code-block:: c

   #define OPAL_MPIPL_UPDATE                      173
   #define OPAL_MPIPL_REGISTER_TAG                174
   #define OPAL_MPIPL_QUERY_TAG                   175

These calls are used for MPIPL (Memory Preserving Initial Program Load).

It is an OPTIONAL part of the OPAL spec.

If a platform supports MPIPL, then we will have "/ibm,opal/dump" node in
device tree (see :ref:`device-tree/ibm,opal/dump`).

.. _OPAL_MPIPL_UPDATE:

OPAL_MPIPL_UPDATE
==================
Linux kernel will use this call to register/unregister MPIPL.

.. code-block:: c

   #define OPAL_MPIPL_UPDATE                      173

   int64_t opal_mpipl_update(enum mpipl_ops ops, u64 src, u64 dest, u64 size)

   /* MPIPL update operations */
   enum mpipl_ops {
        OPAL_MPIPL_ADD_RANGE            = 0,
        OPAL_MPIPL_REMOVE_RANGE         = 1,
        OPAL_MPIPL_REMOVE_ALL           = 2,
        OPAL_MPIPL_FREE_PRESERVED_MEMORY= 3,
   };

ops :
-----
  OPAL_MPIPL_ADD_RANGE
    Add new entry to MPIPL table. Kernel will send src, dest and size.
    During MPIPL content from source address is moved to destination address.
    src  = Source start address
    dest = Destination start address
    size = size

  OPAL_MPIPL_REMOVE_RANGE
    Remove kernel requested entry from MPIPL table.
    src  = Source start address
    dest = Destination start address
    size = ignore

  OPAL_MPIPL_REMOVE_ALL
    Remove all kernel passed entry from MPIPL table.
    src  = ignore
    dest = ignore
    size = ignore

  OPAL_MPIPL_FREE_PRESERVED_MEMORY
    Post MPIPL, kernel will indicate OPAL that it has processed dump and
    it can clear/release metadata area.
    src  = ignore
    dest = ignore
    size = ignore

Return Values
-------------

``OPAL_SUCCESS``
  Operation success

``OPAL_PARAMETER``
  Invalid parameter

``OPAL_RESOURCE``
  Ran out of space in MDST/MDDT table to add new entry

``OPAL_HARDWARE``
  Platform does not support fadump


.. _OPAL_MPIPL_REGISTER_TAG:

OPAL_MPIPL_REGISTER_TAG
=======================
Kernel will use this API to register tags during MPIPL registration.
It expects OPAL to preserve these tags across MPIPL. Post MPIPL Linux
kernel will use `opal_mpipl_query_tag` call to retrieve these tags.

.. code-block:: c

  opal_mpipl_register_tag(enum opal_mpipl_tags tag, uint64_t tag_val)

  tag:
   OPAL_MPIPL_TAG_KERNEL
     During first boot, kernel will setup its metadata area and asks
     OPAL to preserve metadata area pointer across MPIPL. Post MPIPL
     kernel requests OPAL to provide metadata pointer and it will use
     that pointer to retrieve metadata and create dump.

   OPAL_MPIPL_TAG_BOOT_MEM
     During MPIPL registration kernel will specify how much memory
     firmware can use for Post MPIPL load. Post MPIPL petitboot kernel
     will query for this tag to get boot memory size.

Return Values
-------------
``OPAL_SUCCESS``
  Operation success

``OPAL_PARAMETER``
  Invalid parameter

.. _OPAL_MPIPL_QUERY_TAG:

OPAL_MPIPL_QUERY_TAG
====================
Post MPIPL linux kernel will call this API to get metadata tag. And use this
tag to retrieve metadata information and generate dump.

.. code-block:: c

   #define OPAL_MPIPL_QUERY_TAG                 175

   uint64_t opal_mpipl_query_tag(enum opal_mpipl_tags tag, uint64_t *tag_val)

   enum opal_mpipl_tags {
        OPAL_MPIPL_TAG_CPU      = 0,
        OPAL_MPIPL_TAG_OPAL     = 1,
        OPAL_MPIPL_TAG_KERNEL   = 2,
        OPAL_MPIPL_TAG_BOOT_MEM = 3,
   };

  tag :
     OPAL_MPIPL_TAG_CPU
       Pointer to CPU register data content metadata area
     OPAL_MPIPL_TAG_OPAL
       Pointer to OPAL metadata area
     OPAL_MPIPL_TAG_KERNEL
       During first boot, kernel will setup its metadata area and asks
       OPAL to preserve metadata area pointer across MPIPL. Post MPIPL
       kernel calls this API to get metadata pointer and it will use
       that pointer to retrieve metadata and create dump.
     OPAL_MPIPL_TAG_BOOT_MEM
       During MPIPL registration kernel will specify how much memory
       firmware can use for Post MPIPL load. Post MPIPL petitboot kernel
       will query for this tag to get boot memory size.

Return Values
-------------

``OPAL_SUCCESS``
  Operation success

``OPAL_PARAMETER``
  Invalid parameter