blob: 8d6ea5daa37c4162af8895ffcce7537e0c3bb3d8 [file] [log] [blame]
Simon Glass3a028c22024-08-07 16:47:30 -06001.. SPDX-License-Identifier: GPL-2.0+:
2
3upl command
4===========
5
6Synopsis
7--------
8
9::
10
11 upl write
12 upl read <addr>
13 upl info [-v]
14
15Description
16-----------
17
18The *upl* command is used to test U-Boot's support for the Universal Payload
Simon Glass7869aa72024-08-07 16:47:36 -060019Specification (UPL) firmware standard (see :doc:`../upl`). It allows creation of
20a fake handoff for use in testing.
Simon Glass3a028c22024-08-07 16:47:30 -060021
22
23upl write
24~~~~~~~~~
25
26Write a fake UPL handoff structure. The `upladdr` environment variable is set to
27the address of this structure and `uplsize` is set to the size.
28
29
30upl read
31~~~~~~~~
32
33Read a UPL handoff structure into internal state. This allows testing that the
34handoff can be obtained.
35
36upl info
37~~~~~~~~
38
39Show basic information about usage of UPL:
40
41 UPL state
42 active or inactive (indicates whether U-Boot booted from UPL or not)
43
44 fit
45 Address of the FIT which was loaded
46
47 conf_offset 2a4
48 FIT offset of the chosen configuration
49
50For each image the following information is shown:
51
52 Image number
53 Images are numbered from 0
54
55 load
56 Address to which the image was loaded
57
58 size
59 Size of the loaded image
60
61 offset
62 FIT offset of the image
63
64 description
65 Description of the image
66
67
68Example
69-------
70
71This shows checking whether a UPL handoff was read at start-up::
72
73 => upl info
74 UPL state: active
75
76This shows how to use the command to write and display the handoff::
77
78 => upl write
79 UPL handoff written to bc8a5e0 size 662
80 => print upladdr
81 upladdr=bc8a5e0
82 => print uplsize
83 uplsize=662
84
85 > fdt addr ${upladdr}
86 Working FDT set to bc8a5e0
87 => fdt print
88 / {
89 #address-cells = <0x00000001>;
90 #size-cells = <0x00000001>;
91 options {
92 upl-params {
93 smbios = <0x00000123>;
94 acpi = <0x00000456>;
95 bootmode = "default", "s3";
96 addr-width = <0x0000002e>;
97 acpi-nvs-size = <0x00000100>;
98 };
99 upl-image {
100 fit = <0x00000789>;
101 conf-offset = <0x00000234>;
102 image-1 {
103 load = <0x00000001>;
104 size = <0x00000002>;
105 offset = <0x00000003>;
106 description = "U-Boot";
107 };
108 image-2 {
109 load = <0x00000004>;
110 size = <0x00000005>;
111 offset = <0x00000006>;
112 description = "ATF";
113 };
114 };
115 };
116 memory@0x10 {
117 reg = <0x00000010 0x00000020 0x00000030 0x00000040 0x00000050 0x00000060>;
118 };
119 memory@0x70 {
120 reg = <0x00000070 0x00000080>;
121 hotpluggable;
122 };
123 memory-map {
124 acpi@0x11 {
125 reg = <0x00000011 0x00000012 0x00000013 0x00000014 0x00000015 0x00000016 0x00000017 0x00000018 0x00000019 0x0000001a>;
126 usage = "acpi-reclaim";
127 };
128 u-boot@0x21 {
129 reg = <0x00000021 0x00000022>;
130 usage = "boot-data";
131 };
132 efi@0x23 {
133 reg = <0x00000023 0x00000024>;
134 usage = "runtime-code";
135 };
136 empty@0x25 {
137 reg = <0x00000025 0x00000026 0x00000027 0x00000028>;
138 };
139 acpi-things@0x2a {
140 reg = <0x0000002a 0x00000000>;
141 usage = "acpi-nvs", "runtime-code";
142 };
143 };
144 reserved-memory {
145 mmio@0x2b {
146 reg = <0x0000002b 0x0000002c>;
147 };
148 memory@0x2d {
149 reg = <0x0000002d 0x0000002e 0x0000002f 0x00000030>;
150 no-map;
151 };
152 };
153 serial@0xf1de0000 {
154 compatible = "ns16550a";
155 clock-frequency = <0x001c2000>;
156 current-speed = <0x0001c200>;
157 reg = <0xf1de0000 0x00000100>;
158 reg-io-shift = <0x00000002>;
159 reg-offset = <0x00000040>;
160 virtual-reg = <0x20000000>;
161 access-type = "mmio";
162 };
163 framebuffer@0xd0000000 {
164 compatible = "simple-framebuffer";
165 reg = <0xd0000000 0x10000000>;
166 width = <0x00000500>;
167 height = <0x00000500>;
168 stride = <0x00001400>;
169 format = "a8r8g8b8";
170 };
171 };
172 =>
173
174This showing reading the handoff into internal state::
175
176 => upl read bc8a5e0
177 Reading UPL at bc8a5e0
178 =>
179
180This shows getting basic information about UPL:
181
182 => upl info -v
183 UPL state: active
184 fit 1264000
185 conf_offset 2a4
186 image 0: load 200000 size 105f5c8 offset a4: U-Boot 2024.07-00770-g739ee12e8358 for sandbox board