diff options
author | Mark Hatle <mark.hatle@amd.com> | 2024-11-11 11:24:08 -0700 |
---|---|---|
committer | Mark Hatle <mark.hatle@amd.com> | 2024-11-11 11:24:08 -0700 |
commit | ee6e2f1f4fc8d438bfde7634e31657b52970fda9 (patch) | |
tree | 38b5366d82e15538ab3c5e4f9a3dd1dcac26ff20 /meta-xilinx-core/recipes-devtools/qemu | |
parent | 03d3b2ce359a1c2959f04588cf2c4a1b0dcb4de8 (diff) | |
parent | 7c79383570dc4182bb21cdee68598ccf47403150 (diff) | |
download | meta-xilinx-ee6e2f1f4fc8d438bfde7634e31657b52970fda9.tar.gz |
Merge remote-tracking branch 'origin/rel-v2024.2' into scarthgap-next
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/recipes-devtools/qemu')
9 files changed, 2907 insertions, 17 deletions
diff --git a/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch b/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch index f310edfa..77b13aa2 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch +++ b/meta-xilinx-core/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch | |||
@@ -35,14 +35,45 @@ if '-bootbin' in APU_args: | |||
35 | if PMU_args and PLM_args: | 35 | if PMU_args and PLM_args: |
36 | sys.exit("\nError: -pmu-args can not be used with -plm-args\n") | 36 | sys.exit("\nError: -pmu-args can not be used with -plm-args\n") |
37 | 37 | ||
38 | if ('--help' in APU_args) or (not PMU_args and not PLM_args): | 38 | help_options = ['-h', '-help', '--help'] |
39 | print("AMD FPGA QEMU multiarch wrapper\nVersion 2024.1\n\nUsage:") | 39 | def help(status): |
40 | print("AMD FPGA QEMU multiarch wrapper\nVersion 2024.2\n\nUsage:") | ||
40 | print(f" {sys.argv[0]} <APU options> [-pmu-args <pmu options>]") | 41 | print(f" {sys.argv[0]} <APU options> [-pmu-args <pmu options>]") |
41 | print(f" {sys.argv[0]} <APU options> [-plm-args <plm options>]\n") | 42 | print(f" {sys.argv[0]} <APU options> [-plm-args <plm options>]\n") |
42 | sys.exit(1) | 43 | if status == 0: |
44 | print(f"\n") | ||
45 | if set(PMU_args).intersection(set(help_options)): | ||
46 | print(f"PMU Options:\n") | ||
47 | pmu_args_s = ' '.join(PMU_args) | ||
48 | help_cmd = f'{binpath}/qemu-system-microblazeel {pmu_args_s}' | ||
49 | elif set(PLM_args).intersection(set(help_options)): | ||
50 | print(f"PLM Options:\n") | ||
51 | plm_args_s = ' '.join(PLM_args) | ||
52 | help_cmd = f'{binpath}/qemu-system-microblazeel {plm_args_s}' | ||
53 | else: | ||
54 | if not set(APU_args).intersection(set(help_options)): | ||
55 | APU_args.append('-help') | ||
56 | print(f"APU Options:\n") | ||
57 | print(f" -bootbin <boot.bin> - Use a boot.bin instead of individual firmware, device trees and bootloader\n") | ||
58 | apu_args_s = ' '.join(APU_args) | ||
59 | help_cmd = f'{binpath}/qemu-system-aarch64 {apu_args_s}' | ||
60 | |||
61 | print(f"{help_cmd}\n") | ||
62 | process = subprocess.Popen(help_cmd, shell=True, stderr=subprocess.PIPE) | ||
63 | status = process.wait() | ||
64 | sys.exit(status) | ||
65 | |||
66 | if set(APU_args).intersection(set(help_options)) or set(PMU_args).intersection(set(help_options)) or set(PLM_args).intersection(set(help_options)): | ||
67 | help(0) | ||
68 | |||
69 | if not PMU_args and not PLM_args: | ||
70 | help(1) | ||
43 | 71 | ||
44 | if PMU_args: | 72 | if PMU_args: |
45 | PMU_rom = PMU_args[PMU_args.index('-kernel')+1] | 73 | try: |
74 | PMU_rom = PMU_args[PMU_args.index('-kernel')+1] | ||
75 | except: | ||
76 | PMU_rom = "" | ||
46 | 77 | ||
47 | if not os.path.exists(PMU_rom): | 78 | if not os.path.exists(PMU_rom): |
48 | sys.exit(f'\nERROR: Missing PMU ROM: {PMU_rom}' | 79 | sys.exit(f'\nERROR: Missing PMU ROM: {PMU_rom}' |
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch new file mode 100644 index 00000000..ff7f64ad --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | From 84986d94277de2ac853cb613c37dbafe485f0981 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
3 | Date: Fri, 6 Oct 2023 18:41:14 +0300 | ||
4 | Subject: [PATCH 1/2] python: rename QEMUMonitorProtocol.cmd() to cmd_raw() | ||
5 | |||
6 | Having cmd() and command() methods in one class doesn't look good. | ||
7 | Rename cmd() to cmd_raw(), to show its meaning better. | ||
8 | |||
9 | We also want to rename command() to cmd() in future, so this commit is | ||
10 | a necessary step. | ||
11 | |||
12 | Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
13 | Reviewed-by: Eric Blake <eblake@redhat.com> | ||
14 | Message-id: 20231006154125.1068348-5-vsementsov@yandex-team.ru | ||
15 | Signed-off-by: John Snow <jsnow@redhat.com> | ||
16 | |||
17 | Upstream-Status: Backport (37274707f6f3868fae7e0055d9a703006fc142d0) | ||
18 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
19 | --- | ||
20 | python/qemu/machine/machine.py | 2 +- | ||
21 | python/qemu/qmp/legacy.py | 8 ++------ | ||
22 | tests/qemu-iotests/iotests.py | 2 +- | ||
23 | 3 files changed, 4 insertions(+), 8 deletions(-) | ||
24 | |||
25 | diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py | ||
26 | index c16a0b6fed..82fa8cdddf 100644 | ||
27 | --- a/python/qemu/machine/machine.py | ||
28 | +++ b/python/qemu/machine/machine.py | ||
29 | @@ -686,7 +686,7 @@ def qmp(self, cmd: str, | ||
30 | conv_keys = True | ||
31 | |||
32 | qmp_args = self._qmp_args(conv_keys, args) | ||
33 | - ret = self._qmp.cmd(cmd, args=qmp_args) | ||
34 | + ret = self._qmp.cmd_raw(cmd, args=qmp_args) | ||
35 | if cmd == 'quit' and 'error' not in ret and 'return' in ret: | ||
36 | self._quit_issued = True | ||
37 | return ret | ||
38 | diff --git a/python/qemu/qmp/legacy.py b/python/qemu/qmp/legacy.py | ||
39 | index e1e9383978..e5fa1ce9c4 100644 | ||
40 | --- a/python/qemu/qmp/legacy.py | ||
41 | +++ b/python/qemu/qmp/legacy.py | ||
42 | @@ -194,21 +194,17 @@ def cmd_obj(self, qmp_cmd: QMPMessage) -> QMPMessage: | ||
43 | ) | ||
44 | ) | ||
45 | |||
46 | - def cmd(self, name: str, | ||
47 | - args: Optional[Dict[str, object]] = None, | ||
48 | - cmd_id: Optional[object] = None) -> QMPMessage: | ||
49 | + def cmd_raw(self, name: str, | ||
50 | + args: Optional[Dict[str, object]] = None) -> QMPMessage: | ||
51 | """ | ||
52 | Build a QMP command and send it to the QMP Monitor. | ||
53 | |||
54 | :param name: command name (string) | ||
55 | :param args: command arguments (dict) | ||
56 | - :param cmd_id: command id (dict, list, string or int) | ||
57 | """ | ||
58 | qmp_cmd: QMPMessage = {'execute': name} | ||
59 | if args: | ||
60 | qmp_cmd['arguments'] = args | ||
61 | - if cmd_id: | ||
62 | - qmp_cmd['id'] = cmd_id | ||
63 | return self.cmd_obj(qmp_cmd) | ||
64 | |||
65 | def command(self, cmd: str, **kwds: object) -> QMPReturnValue: | ||
66 | diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py | ||
67 | index ef66fbd62b..8ffd9fb660 100644 | ||
68 | --- a/tests/qemu-iotests/iotests.py | ||
69 | +++ b/tests/qemu-iotests/iotests.py | ||
70 | @@ -460,7 +460,7 @@ def __init__(self, *args: str, instance_id: str = 'a', qmp: bool = False): | ||
71 | def qmp(self, cmd: str, args: Optional[Dict[str, object]] = None) \ | ||
72 | -> QMPMessage: | ||
73 | assert self._qmp is not None | ||
74 | - return self._qmp.cmd(cmd, args) | ||
75 | + return self._qmp.cmd_raw(cmd, args) | ||
76 | |||
77 | def get_qmp(self) -> QEMUMonitorProtocol: | ||
78 | assert self._qmp is not None | ||
79 | -- | ||
80 | 2.34.1 | ||
81 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-python-qemu-rename-command-to-cmd.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-python-qemu-rename-command-to-cmd.patch new file mode 100644 index 00000000..e776a537 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-python-qemu-rename-command-to-cmd.patch | |||
@@ -0,0 +1,1011 @@ | |||
1 | From a7037d9661d40351b15d8c8bf209b512a7b5047e Mon Sep 17 00:00:00 2001 | ||
2 | From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
3 | Date: Fri, 6 Oct 2023 18:41:15 +0300 | ||
4 | Subject: [PATCH 2/2] python/qemu: rename command() to cmd() | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Use a shorter name. We are going to move in iotests from qmp() to | ||
10 | command() where possible. But command() is longer than qmp() and don't | ||
11 | look better. Let's rename. | ||
12 | |||
13 | You can simply grep for '\.command(' and for 'def command(' to check | ||
14 | that everything is updated (command() in tests/docker/docker.py is | ||
15 | unrelated). | ||
16 | |||
17 | Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | ||
18 | Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> | ||
19 | Reviewed-by: Eric Blake <eblake@redhat.com> | ||
20 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | ||
21 | Reviewed-by: Juan Quintela <quintela@redhat.com> | ||
22 | Message-id: 20231006154125.1068348-6-vsementsov@yandex-team.ru | ||
23 | [vsementsov: also update three occurrences in | ||
24 | tests/avocado/machine_aspeed.py and keep r-b] | ||
25 | Signed-off-by: John Snow <jsnow@redhat.com> | ||
26 | |||
27 | Upstream-status: Backport (684750ab4f8a3ad69512b71532408be3ac2547d4) | ||
28 | |||
29 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
30 | --- | ||
31 | docs/devel/testing.rst | 10 +- | ||
32 | python/qemu/machine/machine.py | 8 +- | ||
33 | python/qemu/qmp/legacy.py | 2 +- | ||
34 | python/qemu/qmp/qmp_shell.py | 11 +- | ||
35 | python/qemu/utils/qemu_ga_client.py | 2 +- | ||
36 | python/qemu/utils/qom.py | 8 +- | ||
37 | python/qemu/utils/qom_common.py | 2 +- | ||
38 | python/qemu/utils/qom_fuse.py | 6 +- | ||
39 | scripts/cpu-x86-uarch-abi.py | 4 +- | ||
40 | scripts/device-crash-test | 8 +- | ||
41 | scripts/render_block_graph.py | 8 +- | ||
42 | tests/avocado/avocado_qemu/__init__.py | 4 +- | ||
43 | tests/avocado/cpu_queries.py | 5 +- | ||
44 | tests/avocado/hotplug_cpu.py | 10 +- | ||
45 | tests/avocado/info_usernet.py | 4 +- | ||
46 | tests/avocado/machine_arm_integratorcp.py | 6 +- | ||
47 | tests/avocado/machine_aspeed.py | 12 +- | ||
48 | tests/avocado/machine_m68k_nextcube.py | 4 +- | ||
49 | tests/avocado/machine_mips_malta.py | 6 +- | ||
50 | tests/avocado/machine_s390_ccw_virtio.py | 28 ++-- | ||
51 | tests/avocado/migration.py | 10 +- | ||
52 | tests/avocado/pc_cpu_hotplug_props.py | 2 +- | ||
53 | tests/avocado/version.py | 4 +- | ||
54 | tests/avocado/virtio_check_params.py | 6 +- | ||
55 | tests/avocado/virtio_version.py | 5 +- | ||
56 | tests/avocado/x86_cpu_model_versions.py | 13 +- | ||
57 | tests/migration/guestperf/engine.py | 150 +++++++++++----------- | ||
58 | tests/qemu-iotests/256 | 34 ++--- | ||
59 | tests/qemu-iotests/257 | 36 +++--- | ||
60 | 29 files changed, 207 insertions(+), 201 deletions(-) | ||
61 | |||
62 | diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst | ||
63 | index b6ad21bed1..dddf1d6140 100644 | ||
64 | --- a/docs/devel/testing.rst | ||
65 | +++ b/docs/devel/testing.rst | ||
66 | @@ -1014,8 +1014,8 @@ class. Here's a simple usage example: | ||
67 | """ | ||
68 | def test_qmp_human_info_version(self): | ||
69 | self.vm.launch() | ||
70 | - res = self.vm.command('human-monitor-command', | ||
71 | - command_line='info version') | ||
72 | + res = self.vm.cmd('human-monitor-command', | ||
73 | + command_line='info version') | ||
74 | self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)') | ||
75 | |||
76 | To execute your test, run: | ||
77 | @@ -1065,15 +1065,15 @@ and hypothetical example follows: | ||
78 | first_machine.launch() | ||
79 | second_machine.launch() | ||
80 | |||
81 | - first_res = first_machine.command( | ||
82 | + first_res = first_machine.cmd( | ||
83 | 'human-monitor-command', | ||
84 | command_line='info version') | ||
85 | |||
86 | - second_res = second_machine.command( | ||
87 | + second_res = second_machine.cmd( | ||
88 | 'human-monitor-command', | ||
89 | command_line='info version') | ||
90 | |||
91 | - third_res = self.get_vm(name='third_machine').command( | ||
92 | + third_res = self.get_vm(name='third_machine').cmd( | ||
93 | 'human-monitor-command', | ||
94 | command_line='info version') | ||
95 | |||
96 | diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py | ||
97 | index 82fa8cdddf..0c48b76731 100644 | ||
98 | --- a/python/qemu/machine/machine.py | ||
99 | +++ b/python/qemu/machine/machine.py | ||
100 | @@ -691,16 +691,16 @@ def qmp(self, cmd: str, | ||
101 | self._quit_issued = True | ||
102 | return ret | ||
103 | |||
104 | - def command(self, cmd: str, | ||
105 | - conv_keys: bool = True, | ||
106 | - **args: Any) -> QMPReturnValue: | ||
107 | + def cmd(self, cmd: str, | ||
108 | + conv_keys: bool = True, | ||
109 | + **args: Any) -> QMPReturnValue: | ||
110 | """ | ||
111 | Invoke a QMP command. | ||
112 | On success return the response dict. | ||
113 | On failure raise an exception. | ||
114 | """ | ||
115 | qmp_args = self._qmp_args(conv_keys, args) | ||
116 | - ret = self._qmp.command(cmd, **qmp_args) | ||
117 | + ret = self._qmp.cmd(cmd, **qmp_args) | ||
118 | if cmd == 'quit': | ||
119 | self._quit_issued = True | ||
120 | return ret | ||
121 | diff --git a/python/qemu/qmp/legacy.py b/python/qemu/qmp/legacy.py | ||
122 | index e5fa1ce9c4..22a2b5616e 100644 | ||
123 | --- a/python/qemu/qmp/legacy.py | ||
124 | +++ b/python/qemu/qmp/legacy.py | ||
125 | @@ -207,7 +207,7 @@ def cmd_raw(self, name: str, | ||
126 | qmp_cmd['arguments'] = args | ||
127 | return self.cmd_obj(qmp_cmd) | ||
128 | |||
129 | - def command(self, cmd: str, **kwds: object) -> QMPReturnValue: | ||
130 | + def cmd(self, cmd: str, **kwds: object) -> QMPReturnValue: | ||
131 | """ | ||
132 | Build and send a QMP command to the monitor, report errors if any | ||
133 | """ | ||
134 | diff --git a/python/qemu/qmp/qmp_shell.py b/python/qemu/qmp/qmp_shell.py | ||
135 | index 619ab42ced..08240c16f8 100644 | ||
136 | --- a/python/qemu/qmp/qmp_shell.py | ||
137 | +++ b/python/qemu/qmp/qmp_shell.py | ||
138 | @@ -194,11 +194,12 @@ def close(self) -> None: | ||
139 | super().close() | ||
140 | |||
141 | def _fill_completion(self) -> None: | ||
142 | - cmds = self.cmd('query-commands') | ||
143 | - if 'error' in cmds: | ||
144 | - return | ||
145 | - for cmd in cmds['return']: | ||
146 | - self._completer.append(cmd['name']) | ||
147 | + try: | ||
148 | + cmds = cast(List[Dict[str, str]], self.cmd('query-commands')) | ||
149 | + for cmd in cmds: | ||
150 | + self._completer.append(cmd['name']) | ||
151 | + except ExecuteError: | ||
152 | + pass | ||
153 | |||
154 | def _completer_setup(self) -> None: | ||
155 | self._completer = QMPCompleter() | ||
156 | diff --git a/python/qemu/utils/qemu_ga_client.py b/python/qemu/utils/qemu_ga_client.py | ||
157 | index d8411bb2d0..9a665e6e99 100644 | ||
158 | --- a/python/qemu/utils/qemu_ga_client.py | ||
159 | +++ b/python/qemu/utils/qemu_ga_client.py | ||
160 | @@ -64,7 +64,7 @@ | ||
161 | class QemuGuestAgent(QEMUMonitorProtocol): | ||
162 | def __getattr__(self, name: str) -> Callable[..., Any]: | ||
163 | def wrapper(**kwds: object) -> object: | ||
164 | - return self.command('guest-' + name.replace('_', '-'), **kwds) | ||
165 | + return self.cmd('guest-' + name.replace('_', '-'), **kwds) | ||
166 | return wrapper | ||
167 | |||
168 | |||
169 | diff --git a/python/qemu/utils/qom.py b/python/qemu/utils/qom.py | ||
170 | index bcf192f477..426a0f245f 100644 | ||
171 | --- a/python/qemu/utils/qom.py | ||
172 | +++ b/python/qemu/utils/qom.py | ||
173 | @@ -84,7 +84,7 @@ def __init__(self, args: argparse.Namespace): | ||
174 | self.value = args.value | ||
175 | |||
176 | def run(self) -> int: | ||
177 | - rsp = self.qmp.command( | ||
178 | + rsp = self.qmp.cmd( | ||
179 | 'qom-set', | ||
180 | path=self.path, | ||
181 | property=self.prop, | ||
182 | @@ -129,7 +129,7 @@ def __init__(self, args: argparse.Namespace): | ||
183 | self.prop = tmp[1] | ||
184 | |||
185 | def run(self) -> int: | ||
186 | - rsp = self.qmp.command( | ||
187 | + rsp = self.qmp.cmd( | ||
188 | 'qom-get', | ||
189 | path=self.path, | ||
190 | property=self.prop | ||
191 | @@ -231,8 +231,8 @@ def _list_node(self, path: str) -> None: | ||
192 | if item.child: | ||
193 | continue | ||
194 | try: | ||
195 | - rsp = self.qmp.command('qom-get', path=path, | ||
196 | - property=item.name) | ||
197 | + rsp = self.qmp.cmd('qom-get', path=path, | ||
198 | + property=item.name) | ||
199 | print(f" {item.name}: {rsp} ({item.type})") | ||
200 | except ExecuteError as err: | ||
201 | print(f" {item.name}: <EXCEPTION: {err!s}> ({item.type})") | ||
202 | diff --git a/python/qemu/utils/qom_common.py b/python/qemu/utils/qom_common.py | ||
203 | index 80da1b2304..dd2c8b1908 100644 | ||
204 | --- a/python/qemu/utils/qom_common.py | ||
205 | +++ b/python/qemu/utils/qom_common.py | ||
206 | @@ -140,7 +140,7 @@ def qom_list(self, path: str) -> List[ObjectPropertyInfo]: | ||
207 | """ | ||
208 | :return: a strongly typed list from the 'qom-list' command. | ||
209 | """ | ||
210 | - rsp = self.qmp.command('qom-list', path=path) | ||
211 | + rsp = self.qmp.cmd('qom-list', path=path) | ||
212 | # qom-list returns List[ObjectPropertyInfo] | ||
213 | assert isinstance(rsp, list) | ||
214 | return [ObjectPropertyInfo.make(x) for x in rsp] | ||
215 | diff --git a/python/qemu/utils/qom_fuse.py b/python/qemu/utils/qom_fuse.py | ||
216 | index 8dcd59fcde..cf7e344bd5 100644 | ||
217 | --- a/python/qemu/utils/qom_fuse.py | ||
218 | +++ b/python/qemu/utils/qom_fuse.py | ||
219 | @@ -137,7 +137,7 @@ def read(self, path: str, size: int, offset: int, fh: IO[bytes]) -> bytes: | ||
220 | if path == '': | ||
221 | path = '/' | ||
222 | try: | ||
223 | - data = str(self.qmp.command('qom-get', path=path, property=prop)) | ||
224 | + data = str(self.qmp.cmd('qom-get', path=path, property=prop)) | ||
225 | data += '\n' # make values shell friendly | ||
226 | except ExecuteError as err: | ||
227 | raise FuseOSError(EPERM) from err | ||
228 | @@ -152,8 +152,8 @@ def readlink(self, path: str) -> Union[bool, str]: | ||
229 | return False | ||
230 | path, prop = path.rsplit('/', 1) | ||
231 | prefix = '/'.join(['..'] * (len(path.split('/')) - 1)) | ||
232 | - return prefix + str(self.qmp.command('qom-get', path=path, | ||
233 | - property=prop)) | ||
234 | + return prefix + str(self.qmp.cmd('qom-get', path=path, | ||
235 | + property=prop)) | ||
236 | |||
237 | def getattr(self, path: str, | ||
238 | fh: Optional[IO[bytes]] = None) -> Mapping[str, object]: | ||
239 | diff --git a/scripts/cpu-x86-uarch-abi.py b/scripts/cpu-x86-uarch-abi.py | ||
240 | index 82ff07582f..379a3c64bd 100644 | ||
241 | --- a/scripts/cpu-x86-uarch-abi.py | ||
242 | +++ b/scripts/cpu-x86-uarch-abi.py | ||
243 | @@ -94,8 +94,8 @@ | ||
244 | |||
245 | for name in sorted(names): | ||
246 | cpu = shell.cmd("query-cpu-model-expansion", | ||
247 | - { "type": "static", | ||
248 | - "model": { "name": name }}) | ||
249 | + { "type": "static", | ||
250 | + "model": { "name": name }}) | ||
251 | |||
252 | got = {} | ||
253 | for (feature, present) in cpu["return"]["model"]["props"].items(): | ||
254 | diff --git a/scripts/device-crash-test b/scripts/device-crash-test | ||
255 | index b74d887331..9bf9d0d6e6 100755 | ||
256 | --- a/scripts/device-crash-test | ||
257 | +++ b/scripts/device-crash-test | ||
258 | @@ -269,14 +269,14 @@ def formatTestCase(t): | ||
259 | |||
260 | def qomListTypeNames(vm, **kwargs): | ||
261 | """Run qom-list-types QMP command, return type names""" | ||
262 | - types = vm.command('qom-list-types', **kwargs) | ||
263 | + types = vm.cmd('qom-list-types', **kwargs) | ||
264 | return [t['name'] for t in types] | ||
265 | |||
266 | |||
267 | def infoQDM(vm): | ||
268 | """Parse 'info qdm' output""" | ||
269 | args = {'command-line': 'info qdm'} | ||
270 | - devhelp = vm.command('human-monitor-command', **args) | ||
271 | + devhelp = vm.cmd('human-monitor-command', **args) | ||
272 | for l in devhelp.split('\n'): | ||
273 | l = l.strip() | ||
274 | if l == '' or l.endswith(':'): | ||
275 | @@ -304,9 +304,9 @@ class QemuBinaryInfo(object): | ||
276 | # there's no way to query DeviceClass::user_creatable using QMP, | ||
277 | # so use 'info qdm': | ||
278 | self.no_user_devs = set([d['name'] for d in infoQDM(vm, ) if d['no-user']]) | ||
279 | - self.machines = list(m['name'] for m in vm.command('query-machines')) | ||
280 | + self.machines = list(m['name'] for m in vm.cmd('query-machines')) | ||
281 | self.user_devs = self.alldevs.difference(self.no_user_devs) | ||
282 | - self.kvm_available = vm.command('query-kvm')['enabled'] | ||
283 | + self.kvm_available = vm.cmd('query-kvm')['enabled'] | ||
284 | finally: | ||
285 | vm.shutdown() | ||
286 | |||
287 | diff --git a/scripts/render_block_graph.py b/scripts/render_block_graph.py | ||
288 | index 8f731a5cfe..3e1a2e3fa7 100755 | ||
289 | --- a/scripts/render_block_graph.py | ||
290 | +++ b/scripts/render_block_graph.py | ||
291 | @@ -43,13 +43,13 @@ def render_block_graph(qmp, filename, format='png'): | ||
292 | representation in @format into "@filename.@format" | ||
293 | ''' | ||
294 | |||
295 | - bds_nodes = qmp.command('query-named-block-nodes') | ||
296 | + bds_nodes = qmp.cmd('query-named-block-nodes') | ||
297 | bds_nodes = {n['node-name']: n for n in bds_nodes} | ||
298 | |||
299 | - job_nodes = qmp.command('query-block-jobs') | ||
300 | + job_nodes = qmp.cmd('query-block-jobs') | ||
301 | job_nodes = {n['device']: n for n in job_nodes} | ||
302 | |||
303 | - block_graph = qmp.command('x-debug-query-block-graph') | ||
304 | + block_graph = qmp.cmd('x-debug-query-block-graph') | ||
305 | |||
306 | graph = Digraph(comment='Block Nodes Graph') | ||
307 | graph.format = format | ||
308 | @@ -94,7 +94,7 @@ class LibvirtGuest(): | ||
309 | def __init__(self, name): | ||
310 | self.name = name | ||
311 | |||
312 | - def command(self, cmd): | ||
313 | + def cmd(self, cmd): | ||
314 | # only supports qmp commands without parameters | ||
315 | m = {'execute': cmd} | ||
316 | ar = ['virsh', 'qemu-monitor-command', self.name, json.dumps(m)] | ||
317 | diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py | ||
318 | index 33090903f1..1a4d40a46f 100644 | ||
319 | --- a/tests/avocado/avocado_qemu/__init__.py | ||
320 | +++ b/tests/avocado/avocado_qemu/__init__.py | ||
321 | @@ -408,8 +408,8 @@ class LinuxSSHMixIn: | ||
322 | |||
323 | def ssh_connect(self, username, credential, credential_is_key=True): | ||
324 | self.ssh_logger = logging.getLogger('ssh') | ||
325 | - res = self.vm.command('human-monitor-command', | ||
326 | - command_line='info usernet') | ||
327 | + res = self.vm.cmd('human-monitor-command', | ||
328 | + command_line='info usernet') | ||
329 | port = get_info_usernet_hostfwd_port(res) | ||
330 | self.assertIsNotNone(port) | ||
331 | self.assertGreater(port, 0) | ||
332 | diff --git a/tests/avocado/cpu_queries.py b/tests/avocado/cpu_queries.py | ||
333 | index cf69f69b11..86c2d5c92d 100644 | ||
334 | --- a/tests/avocado/cpu_queries.py | ||
335 | +++ b/tests/avocado/cpu_queries.py | ||
336 | @@ -23,12 +23,13 @@ def test(self): | ||
337 | self.vm.add_args('-S') | ||
338 | self.vm.launch() | ||
339 | |||
340 | - cpus = self.vm.command('query-cpu-definitions') | ||
341 | + cpus = self.vm.cmd('query-cpu-definitions') | ||
342 | for c in cpus: | ||
343 | self.log.info("Checking CPU: %s", c) | ||
344 | self.assertNotIn('', c['unavailable-features'], c['name']) | ||
345 | |||
346 | for c in cpus: | ||
347 | model = {'name': c['name']} | ||
348 | - e = self.vm.command('query-cpu-model-expansion', model=model, type='full') | ||
349 | + e = self.vm.cmd('query-cpu-model-expansion', model=model, | ||
350 | + type='full') | ||
351 | self.assertEquals(e['model']['name'], c['name']) | ||
352 | diff --git a/tests/avocado/hotplug_cpu.py b/tests/avocado/hotplug_cpu.py | ||
353 | index 6374bf1b54..292bb43e4d 100644 | ||
354 | --- a/tests/avocado/hotplug_cpu.py | ||
355 | +++ b/tests/avocado/hotplug_cpu.py | ||
356 | @@ -29,9 +29,9 @@ def test(self): | ||
357 | with self.assertRaises(AssertionError): | ||
358 | self.ssh_command('test -e /sys/devices/system/cpu/cpu1') | ||
359 | |||
360 | - self.vm.command('device_add', | ||
361 | - driver='Haswell-x86_64-cpu', | ||
362 | - socket_id=0, | ||
363 | - core_id=1, | ||
364 | - thread_id=0) | ||
365 | + self.vm.cmd('device_add', | ||
366 | + driver='Haswell-x86_64-cpu', | ||
367 | + socket_id=0, | ||
368 | + core_id=1, | ||
369 | + thread_id=0) | ||
370 | self.ssh_command('test -e /sys/devices/system/cpu/cpu1') | ||
371 | diff --git a/tests/avocado/info_usernet.py b/tests/avocado/info_usernet.py | ||
372 | index fdc4d90c42..e1aa7a6e0a 100644 | ||
373 | --- a/tests/avocado/info_usernet.py | ||
374 | +++ b/tests/avocado/info_usernet.py | ||
375 | @@ -22,8 +22,8 @@ def test_hostfwd(self): | ||
376 | self.require_netdev('user') | ||
377 | self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22') | ||
378 | self.vm.launch() | ||
379 | - res = self.vm.command('human-monitor-command', | ||
380 | - command_line='info usernet') | ||
381 | + res = self.vm.cmd('human-monitor-command', | ||
382 | + command_line='info usernet') | ||
383 | port = get_info_usernet_hostfwd_port(res) | ||
384 | self.assertIsNotNone(port, | ||
385 | ('"info usernet" output content does not seem to ' | ||
386 | diff --git a/tests/avocado/machine_arm_integratorcp.py b/tests/avocado/machine_arm_integratorcp.py | ||
387 | index 1ffe1073ef..87f5cf3953 100644 | ||
388 | --- a/tests/avocado/machine_arm_integratorcp.py | ||
389 | +++ b/tests/avocado/machine_arm_integratorcp.py | ||
390 | @@ -81,9 +81,9 @@ def test_framebuffer_tux_logo(self): | ||
391 | self.boot_integratorcp() | ||
392 | framebuffer_ready = 'Console: switching to colour frame buffer device' | ||
393 | wait_for_console_pattern(self, framebuffer_ready) | ||
394 | - self.vm.command('human-monitor-command', command_line='stop') | ||
395 | - self.vm.command('human-monitor-command', | ||
396 | - command_line='screendump %s' % screendump_path) | ||
397 | + self.vm.cmd('human-monitor-command', command_line='stop') | ||
398 | + self.vm.cmd('human-monitor-command', | ||
399 | + command_line='screendump %s' % screendump_path) | ||
400 | logger = logging.getLogger('framebuffer') | ||
401 | |||
402 | cpu_count = 1 | ||
403 | diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py | ||
404 | index 724ee72c02..68619bbbdc 100644 | ||
405 | --- a/tests/avocado/machine_aspeed.py | ||
406 | +++ b/tests/avocado/machine_aspeed.py | ||
407 | @@ -181,8 +181,8 @@ def test_arm_ast2500_evb_buildroot(self): | ||
408 | 'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d'); | ||
409 | exec_command_and_wait_for_pattern(self, | ||
410 | 'cat /sys/class/hwmon/hwmon1/temp1_input', '0') | ||
411 | - self.vm.command('qom-set', path='/machine/peripheral/tmp-test', | ||
412 | - property='temperature', value=18000); | ||
413 | + self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', | ||
414 | + property='temperature', value=18000); | ||
415 | exec_command_and_wait_for_pattern(self, | ||
416 | 'cat /sys/class/hwmon/hwmon1/temp1_input', '18000') | ||
417 | |||
418 | @@ -213,8 +213,8 @@ def test_arm_ast2600_evb_buildroot(self): | ||
419 | 'i2c i2c-3: new_device: Instantiated device lm75 at 0x4d'); | ||
420 | exec_command_and_wait_for_pattern(self, | ||
421 | 'cat /sys/class/hwmon/hwmon0/temp1_input', '0') | ||
422 | - self.vm.command('qom-set', path='/machine/peripheral/tmp-test', | ||
423 | - property='temperature', value=18000); | ||
424 | + self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', | ||
425 | + property='temperature', value=18000); | ||
426 | exec_command_and_wait_for_pattern(self, | ||
427 | 'cat /sys/class/hwmon/hwmon0/temp1_input', '18000') | ||
428 | |||
429 | @@ -357,8 +357,8 @@ def test_arm_ast2600_evb_sdk(self): | ||
430 | 'i2c i2c-5: new_device: Instantiated device lm75 at 0x4d'); | ||
431 | self.ssh_command_output_contains( | ||
432 | 'cat /sys/class/hwmon/hwmon19/temp1_input', '0') | ||
433 | - self.vm.command('qom-set', path='/machine/peripheral/tmp-test', | ||
434 | - property='temperature', value=18000); | ||
435 | + self.vm.cmd('qom-set', path='/machine/peripheral/tmp-test', | ||
436 | + property='temperature', value=18000); | ||
437 | self.ssh_command_output_contains( | ||
438 | 'cat /sys/class/hwmon/hwmon19/temp1_input', '18000') | ||
439 | |||
440 | diff --git a/tests/avocado/machine_m68k_nextcube.py b/tests/avocado/machine_m68k_nextcube.py | ||
441 | index 6790e7d9cd..d6da2fbb01 100644 | ||
442 | --- a/tests/avocado/machine_m68k_nextcube.py | ||
443 | +++ b/tests/avocado/machine_m68k_nextcube.py | ||
444 | @@ -43,8 +43,8 @@ def check_bootrom_framebuffer(self, screenshot_path): | ||
445 | # 'displaysurface_create 1120x832' trace-event. | ||
446 | time.sleep(2) | ||
447 | |||
448 | - self.vm.command('human-monitor-command', | ||
449 | - command_line='screendump %s' % screenshot_path) | ||
450 | + self.vm.cmd('human-monitor-command', | ||
451 | + command_line='screendump %s' % screenshot_path) | ||
452 | |||
453 | @skipUnless(PIL_AVAILABLE, 'Python PIL not installed') | ||
454 | def test_bootrom_framebuffer_size(self): | ||
455 | diff --git a/tests/avocado/machine_mips_malta.py b/tests/avocado/machine_mips_malta.py | ||
456 | index 92233451c5..9bd54518bf 100644 | ||
457 | --- a/tests/avocado/machine_mips_malta.py | ||
458 | +++ b/tests/avocado/machine_mips_malta.py | ||
459 | @@ -71,9 +71,9 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_count): | ||
460 | framebuffer_ready = 'Console: switching to colour frame buffer device' | ||
461 | wait_for_console_pattern(self, framebuffer_ready, | ||
462 | failure_message='Kernel panic - not syncing') | ||
463 | - self.vm.command('human-monitor-command', command_line='stop') | ||
464 | - self.vm.command('human-monitor-command', | ||
465 | - command_line='screendump %s' % screendump_path) | ||
466 | + self.vm.cmd('human-monitor-command', command_line='stop') | ||
467 | + self.vm.cmd('human-monitor-command', | ||
468 | + command_line='screendump %s' % screendump_path) | ||
469 | logger = logging.getLogger('framebuffer') | ||
470 | |||
471 | match_threshold = 0.95 | ||
472 | diff --git a/tests/avocado/machine_s390_ccw_virtio.py b/tests/avocado/machine_s390_ccw_virtio.py | ||
473 | index e7a2a20ba6..e1f493bc44 100644 | ||
474 | --- a/tests/avocado/machine_s390_ccw_virtio.py | ||
475 | +++ b/tests/avocado/machine_s390_ccw_virtio.py | ||
476 | @@ -107,10 +107,10 @@ def test_s390x_devices(self): | ||
477 | 'dd if=/dev/hwrng of=/dev/null bs=1k count=10', | ||
478 | '10+0 records out') | ||
479 | self.clear_guest_dmesg() | ||
480 | - self.vm.command('device_del', id='rn1') | ||
481 | + self.vm.cmd('device_del', id='rn1') | ||
482 | self.wait_for_crw_reports() | ||
483 | self.clear_guest_dmesg() | ||
484 | - self.vm.command('device_del', id='rn2') | ||
485 | + self.vm.cmd('device_del', id='rn2') | ||
486 | self.wait_for_crw_reports() | ||
487 | exec_command_and_wait_for_pattern(self, | ||
488 | 'dd if=/dev/hwrng of=/dev/null bs=1k count=10', | ||
489 | @@ -132,8 +132,8 @@ def test_s390x_devices(self): | ||
490 | '0x0000000c') | ||
491 | # add another device | ||
492 | self.clear_guest_dmesg() | ||
493 | - self.vm.command('device_add', driver='virtio-net-ccw', | ||
494 | - devno='fe.0.4711', id='net_4711') | ||
495 | + self.vm.cmd('device_add', driver='virtio-net-ccw', | ||
496 | + devno='fe.0.4711', id='net_4711') | ||
497 | self.wait_for_crw_reports() | ||
498 | exec_command_and_wait_for_pattern(self, 'for i in 1 2 3 4 5 6 7 ; do ' | ||
499 | 'if [ -e /sys/bus/ccw/devices/*4711 ]; then break; fi ;' | ||
500 | @@ -141,7 +141,7 @@ def test_s390x_devices(self): | ||
501 | '0.0.4711') | ||
502 | # and detach it again | ||
503 | self.clear_guest_dmesg() | ||
504 | - self.vm.command('device_del', id='net_4711') | ||
505 | + self.vm.cmd('device_del', id='net_4711') | ||
506 | self.vm.event_wait(name='DEVICE_DELETED', | ||
507 | match={'data': {'device': 'net_4711'}}) | ||
508 | self.wait_for_crw_reports() | ||
509 | @@ -151,10 +151,10 @@ def test_s390x_devices(self): | ||
510 | # test the virtio-balloon device | ||
511 | exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo', | ||
512 | 'MemTotal: 115640 kB') | ||
513 | - self.vm.command('human-monitor-command', command_line='balloon 96') | ||
514 | + self.vm.cmd('human-monitor-command', command_line='balloon 96') | ||
515 | exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo', | ||
516 | 'MemTotal: 82872 kB') | ||
517 | - self.vm.command('human-monitor-command', command_line='balloon 128') | ||
518 | + self.vm.cmd('human-monitor-command', command_line='balloon 128') | ||
519 | exec_command_and_wait_for_pattern(self, 'head -n 1 /proc/meminfo', | ||
520 | 'MemTotal: 115640 kB') | ||
521 | |||
522 | @@ -245,7 +245,7 @@ def test_s390x_fedora(self): | ||
523 | '12+0 records out') | ||
524 | with tempfile.NamedTemporaryFile(suffix='.ppm', | ||
525 | prefix='qemu-scrdump-') as ppmfile: | ||
526 | - self.vm.command('screendump', filename=ppmfile.name) | ||
527 | + self.vm.cmd('screendump', filename=ppmfile.name) | ||
528 | ppmfile.seek(0) | ||
529 | line = ppmfile.readline() | ||
530 | self.assertEqual(line, b"P6\n") | ||
531 | @@ -261,16 +261,16 @@ def test_s390x_fedora(self): | ||
532 | # Hot-plug a virtio-crypto device and see whether it gets accepted | ||
533 | self.log.info("Test hot-plug virtio-crypto device") | ||
534 | self.clear_guest_dmesg() | ||
535 | - self.vm.command('object-add', qom_type='cryptodev-backend-builtin', | ||
536 | - id='cbe0') | ||
537 | - self.vm.command('device_add', driver='virtio-crypto-ccw', id='crypdev0', | ||
538 | - cryptodev='cbe0', devno='fe.0.2342') | ||
539 | + self.vm.cmd('object-add', qom_type='cryptodev-backend-builtin', | ||
540 | + id='cbe0') | ||
541 | + self.vm.cmd('device_add', driver='virtio-crypto-ccw', id='crypdev0', | ||
542 | + cryptodev='cbe0', devno='fe.0.2342') | ||
543 | exec_command_and_wait_for_pattern(self, | ||
544 | 'while ! (dmesg -c | grep Accelerator.device) ; do' | ||
545 | ' sleep 1 ; done', 'Accelerator device is ready') | ||
546 | exec_command_and_wait_for_pattern(self, 'lscss', '0.0.2342') | ||
547 | - self.vm.command('device_del', id='crypdev0') | ||
548 | - self.vm.command('object-del', id='cbe0') | ||
549 | + self.vm.cmd('device_del', id='crypdev0') | ||
550 | + self.vm.cmd('object-del', id='cbe0') | ||
551 | exec_command_and_wait_for_pattern(self, | ||
552 | 'while ! (dmesg -c | grep Start.virtcrypto_remove) ; do' | ||
553 | ' sleep 1 ; done', 'Start virtcrypto_remove.') | ||
554 | diff --git a/tests/avocado/migration.py b/tests/avocado/migration.py | ||
555 | index fdc1d234fb..09b62f813e 100644 | ||
556 | --- a/tests/avocado/migration.py | ||
557 | +++ b/tests/avocado/migration.py | ||
558 | @@ -30,7 +30,7 @@ class MigrationTest(QemuSystemTest): | ||
559 | |||
560 | @staticmethod | ||
561 | def migration_finished(vm): | ||
562 | - return vm.command('query-migrate')['status'] in ('completed', 'failed') | ||
563 | + return vm.cmd('query-migrate')['status'] in ('completed', 'failed') | ||
564 | |||
565 | def assert_migration(self, src_vm, dst_vm): | ||
566 | wait.wait_for(self.migration_finished, | ||
567 | @@ -41,10 +41,10 @@ def assert_migration(self, src_vm, dst_vm): | ||
568 | timeout=self.timeout, | ||
569 | step=0.1, | ||
570 | args=(dst_vm,)) | ||
571 | - self.assertEqual(src_vm.command('query-migrate')['status'], 'completed') | ||
572 | - self.assertEqual(dst_vm.command('query-migrate')['status'], 'completed') | ||
573 | - self.assertEqual(dst_vm.command('query-status')['status'], 'running') | ||
574 | - self.assertEqual(src_vm.command('query-status')['status'],'postmigrate') | ||
575 | + self.assertEqual(src_vm.cmd('query-migrate')['status'], 'completed') | ||
576 | + self.assertEqual(dst_vm.cmd('query-migrate')['status'], 'completed') | ||
577 | + self.assertEqual(dst_vm.cmd('query-status')['status'], 'running') | ||
578 | + self.assertEqual(src_vm.cmd('query-status')['status'],'postmigrate') | ||
579 | |||
580 | def do_migrate(self, dest_uri, src_uri=None): | ||
581 | dest_vm = self.get_vm('-incoming', dest_uri) | ||
582 | diff --git a/tests/avocado/pc_cpu_hotplug_props.py b/tests/avocado/pc_cpu_hotplug_props.py | ||
583 | index 52b878188e..b56f51d02a 100644 | ||
584 | --- a/tests/avocado/pc_cpu_hotplug_props.py | ||
585 | +++ b/tests/avocado/pc_cpu_hotplug_props.py | ||
586 | @@ -32,4 +32,4 @@ def test_no_die_id(self): | ||
587 | self.vm.add_args('-smp', '1,sockets=2,cores=2,threads=2,maxcpus=8') | ||
588 | self.vm.add_args('-device', 'qemu64-x86_64-cpu,socket-id=1,core-id=0,thread-id=0') | ||
589 | self.vm.launch() | ||
590 | - self.assertEquals(len(self.vm.command('query-cpus-fast')), 2) | ||
591 | + self.assertEquals(len(self.vm.cmd('query-cpus-fast')), 2) | ||
592 | diff --git a/tests/avocado/version.py b/tests/avocado/version.py | ||
593 | index dd775955eb..93ffdf3d97 100644 | ||
594 | --- a/tests/avocado/version.py | ||
595 | +++ b/tests/avocado/version.py | ||
596 | @@ -20,6 +20,6 @@ class Version(QemuSystemTest): | ||
597 | def test_qmp_human_info_version(self): | ||
598 | self.vm.add_args('-nodefaults') | ||
599 | self.vm.launch() | ||
600 | - res = self.vm.command('human-monitor-command', | ||
601 | - command_line='info version') | ||
602 | + res = self.vm.cmd('human-monitor-command', | ||
603 | + command_line='info version') | ||
604 | self.assertRegexpMatches(res, r'^(\d+\.\d+\.\d)') | ||
605 | diff --git a/tests/avocado/virtio_check_params.py b/tests/avocado/virtio_check_params.py | ||
606 | index 4093da8a67..f4314ef824 100644 | ||
607 | --- a/tests/avocado/virtio_check_params.py | ||
608 | +++ b/tests/avocado/virtio_check_params.py | ||
609 | @@ -51,8 +51,8 @@ def query_virtqueue(self, vm, dev_type_name): | ||
610 | error = None | ||
611 | props = None | ||
612 | |||
613 | - output = vm.command('human-monitor-command', | ||
614 | - command_line = 'info qtree') | ||
615 | + output = vm.cmd('human-monitor-command', | ||
616 | + command_line = 'info qtree') | ||
617 | props_list = DEV_TYPES[dev_type_name].values(); | ||
618 | pattern = self.make_pattern(props_list) | ||
619 | res = re.findall(pattern, output) | ||
620 | @@ -121,7 +121,7 @@ def test_machine_types(self): | ||
621 | # collect all machine types except 'none', 'isapc', 'microvm' | ||
622 | with QEMUMachine(self.qemu_bin) as vm: | ||
623 | vm.launch() | ||
624 | - machines = [m['name'] for m in vm.command('query-machines')] | ||
625 | + machines = [m['name'] for m in vm.cmd('query-machines')] | ||
626 | vm.shutdown() | ||
627 | machines.remove('none') | ||
628 | machines.remove('isapc') | ||
629 | diff --git a/tests/avocado/virtio_version.py b/tests/avocado/virtio_version.py | ||
630 | index c84e48813a..afe5e828b5 100644 | ||
631 | --- a/tests/avocado/virtio_version.py | ||
632 | +++ b/tests/avocado/virtio_version.py | ||
633 | @@ -48,7 +48,8 @@ def pci_modern_device_id(virtio_devid): | ||
634 | return virtio_devid + 0x1040 | ||
635 | |||
636 | def devtype_implements(vm, devtype, implements): | ||
637 | - return devtype in [d['name'] for d in vm.command('qom-list-types', implements=implements)] | ||
638 | + return devtype in [d['name'] for d in | ||
639 | + vm.cmd('qom-list-types', implements=implements)] | ||
640 | |||
641 | def get_pci_interfaces(vm, devtype): | ||
642 | interfaces = ('pci-express-device', 'conventional-pci-device') | ||
643 | @@ -78,7 +79,7 @@ def run_device(self, devtype, opts=None, machine='pc'): | ||
644 | vm.add_args('-S') | ||
645 | vm.launch() | ||
646 | |||
647 | - pcibuses = vm.command('query-pci') | ||
648 | + pcibuses = vm.cmd('query-pci') | ||
649 | alldevs = [dev for bus in pcibuses for dev in bus['devices']] | ||
650 | devfortest = [dev for dev in alldevs | ||
651 | if dev['qdev_id'] == 'devfortest'] | ||
652 | diff --git a/tests/avocado/x86_cpu_model_versions.py b/tests/avocado/x86_cpu_model_versions.py | ||
653 | index a6edf74c1c..9e07b8a55d 100644 | ||
654 | --- a/tests/avocado/x86_cpu_model_versions.py | ||
655 | +++ b/tests/avocado/x86_cpu_model_versions.py | ||
656 | @@ -84,7 +84,8 @@ def test_4_0_alias_compatibility(self): | ||
657 | # with older QEMU versions that didn't have the versioned CPU model | ||
658 | self.vm.add_args('-S') | ||
659 | self.vm.launch() | ||
660 | - cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions')) | ||
661 | + cpus = dict((m['name'], m) for m in | ||
662 | + self.vm.cmd('query-cpu-definitions')) | ||
663 | |||
664 | self.assertFalse(cpus['Cascadelake-Server']['static'], | ||
665 | 'unversioned Cascadelake-Server CPU model must not be static') | ||
666 | @@ -115,7 +116,8 @@ def test_4_1_alias(self): | ||
667 | self.vm.add_args('-S') | ||
668 | self.vm.launch() | ||
669 | |||
670 | - cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions')) | ||
671 | + cpus = dict((m['name'], m) for m in | ||
672 | + self.vm.cmd('query-cpu-definitions')) | ||
673 | |||
674 | self.assertFalse(cpus['Cascadelake-Server']['static'], | ||
675 | 'unversioned Cascadelake-Server CPU model must not be static') | ||
676 | @@ -220,7 +222,8 @@ def test_none_alias(self): | ||
677 | self.vm.add_args('-S') | ||
678 | self.vm.launch() | ||
679 | |||
680 | - cpus = dict((m['name'], m) for m in self.vm.command('query-cpu-definitions')) | ||
681 | + cpus = dict((m['name'], m) for m in | ||
682 | + self.vm.cmd('query-cpu-definitions')) | ||
683 | |||
684 | self.assertFalse(cpus['Cascadelake-Server']['static'], | ||
685 | 'unversioned Cascadelake-Server CPU model must not be static') | ||
686 | @@ -246,8 +249,8 @@ class CascadelakeArchCapabilities(avocado_qemu.QemuSystemTest): | ||
687 | :avocado: tags=arch:x86_64 | ||
688 | """ | ||
689 | def get_cpu_prop(self, prop): | ||
690 | - cpu_path = self.vm.command('query-cpus-fast')[0].get('qom-path') | ||
691 | - return self.vm.command('qom-get', path=cpu_path, property=prop) | ||
692 | + cpu_path = self.vm.cmd('query-cpus-fast')[0].get('qom-path') | ||
693 | + return self.vm.cmd('qom-get', path=cpu_path, property=prop) | ||
694 | |||
695 | def test_4_1(self): | ||
696 | """ | ||
697 | diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestperf/engine.py | ||
698 | index e69d16a62c..da96ca034a 100644 | ||
699 | --- a/tests/migration/guestperf/engine.py | ||
700 | +++ b/tests/migration/guestperf/engine.py | ||
701 | @@ -77,7 +77,7 @@ def _cpu_timing(self, pid): | ||
702 | return TimingRecord(pid, now, 1000 * (stime + utime) / jiffies_per_sec) | ||
703 | |||
704 | def _migrate_progress(self, vm): | ||
705 | - info = vm.command("query-migrate") | ||
706 | + info = vm.cmd("query-migrate") | ||
707 | |||
708 | if "ram" not in info: | ||
709 | info["ram"] = {} | ||
710 | @@ -109,7 +109,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
711 | src_vcpu_time = [] | ||
712 | src_pid = src.get_pid() | ||
713 | |||
714 | - vcpus = src.command("query-cpus-fast") | ||
715 | + vcpus = src.cmd("query-cpus-fast") | ||
716 | src_threads = [] | ||
717 | for vcpu in vcpus: | ||
718 | src_threads.append(vcpu["thread-id"]) | ||
719 | @@ -128,82 +128,82 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
720 | if self._verbose: | ||
721 | print("Starting migration") | ||
722 | if scenario._auto_converge: | ||
723 | - resp = src.command("migrate-set-capabilities", | ||
724 | - capabilities = [ | ||
725 | - { "capability": "auto-converge", | ||
726 | - "state": True } | ||
727 | - ]) | ||
728 | - resp = src.command("migrate-set-parameters", | ||
729 | - cpu_throttle_increment=scenario._auto_converge_step) | ||
730 | + resp = src.cmd("migrate-set-capabilities", | ||
731 | + capabilities = [ | ||
732 | + { "capability": "auto-converge", | ||
733 | + "state": True } | ||
734 | + ]) | ||
735 | + resp = src.cmd("migrate-set-parameters", | ||
736 | + cpu_throttle_increment=scenario._auto_converge_step) | ||
737 | |||
738 | if scenario._post_copy: | ||
739 | - resp = src.command("migrate-set-capabilities", | ||
740 | - capabilities = [ | ||
741 | - { "capability": "postcopy-ram", | ||
742 | - "state": True } | ||
743 | - ]) | ||
744 | - resp = dst.command("migrate-set-capabilities", | ||
745 | - capabilities = [ | ||
746 | - { "capability": "postcopy-ram", | ||
747 | - "state": True } | ||
748 | - ]) | ||
749 | - | ||
750 | - resp = src.command("migrate-set-parameters", | ||
751 | - max_bandwidth=scenario._bandwidth * 1024 * 1024) | ||
752 | - | ||
753 | - resp = src.command("migrate-set-parameters", | ||
754 | - downtime_limit=scenario._downtime) | ||
755 | + resp = src.cmd("migrate-set-capabilities", | ||
756 | + capabilities = [ | ||
757 | + { "capability": "postcopy-ram", | ||
758 | + "state": True } | ||
759 | + ]) | ||
760 | + resp = dst.cmd("migrate-set-capabilities", | ||
761 | + capabilities = [ | ||
762 | + { "capability": "postcopy-ram", | ||
763 | + "state": True } | ||
764 | + ]) | ||
765 | + | ||
766 | + resp = src.cmd("migrate-set-parameters", | ||
767 | + max_bandwidth=scenario._bandwidth * 1024 * 1024) | ||
768 | + | ||
769 | + resp = src.cmd("migrate-set-parameters", | ||
770 | + downtime_limit=scenario._downtime) | ||
771 | |||
772 | if scenario._compression_mt: | ||
773 | - resp = src.command("migrate-set-capabilities", | ||
774 | - capabilities = [ | ||
775 | - { "capability": "compress", | ||
776 | - "state": True } | ||
777 | - ]) | ||
778 | - resp = src.command("migrate-set-parameters", | ||
779 | - compress_threads=scenario._compression_mt_threads) | ||
780 | - resp = dst.command("migrate-set-capabilities", | ||
781 | - capabilities = [ | ||
782 | - { "capability": "compress", | ||
783 | - "state": True } | ||
784 | - ]) | ||
785 | - resp = dst.command("migrate-set-parameters", | ||
786 | - decompress_threads=scenario._compression_mt_threads) | ||
787 | + resp = src.cmd("migrate-set-capabilities", | ||
788 | + capabilities = [ | ||
789 | + { "capability": "compress", | ||
790 | + "state": True } | ||
791 | + ]) | ||
792 | + resp = src.cmd("migrate-set-parameters", | ||
793 | + compress_threads=scenario._compression_mt_threads) | ||
794 | + resp = dst.cmd("migrate-set-capabilities", | ||
795 | + capabilities = [ | ||
796 | + { "capability": "compress", | ||
797 | + "state": True } | ||
798 | + ]) | ||
799 | + resp = dst.cmd("migrate-set-parameters", | ||
800 | + decompress_threads=scenario._compression_mt_threads) | ||
801 | |||
802 | if scenario._compression_xbzrle: | ||
803 | - resp = src.command("migrate-set-capabilities", | ||
804 | - capabilities = [ | ||
805 | - { "capability": "xbzrle", | ||
806 | - "state": True } | ||
807 | - ]) | ||
808 | - resp = dst.command("migrate-set-capabilities", | ||
809 | - capabilities = [ | ||
810 | - { "capability": "xbzrle", | ||
811 | - "state": True } | ||
812 | - ]) | ||
813 | - resp = src.command("migrate-set-parameters", | ||
814 | - xbzrle_cache_size=( | ||
815 | - hardware._mem * | ||
816 | - 1024 * 1024 * 1024 / 100 * | ||
817 | - scenario._compression_xbzrle_cache)) | ||
818 | + resp = src.cmd("migrate-set-capabilities", | ||
819 | + capabilities = [ | ||
820 | + { "capability": "xbzrle", | ||
821 | + "state": True } | ||
822 | + ]) | ||
823 | + resp = dst.cmd("migrate-set-capabilities", | ||
824 | + capabilities = [ | ||
825 | + { "capability": "xbzrle", | ||
826 | + "state": True } | ||
827 | + ]) | ||
828 | + resp = src.cmd("migrate-set-parameters", | ||
829 | + xbzrle_cache_size=( | ||
830 | + hardware._mem * | ||
831 | + 1024 * 1024 * 1024 / 100 * | ||
832 | + scenario._compression_xbzrle_cache)) | ||
833 | |||
834 | if scenario._multifd: | ||
835 | - resp = src.command("migrate-set-capabilities", | ||
836 | - capabilities = [ | ||
837 | - { "capability": "multifd", | ||
838 | - "state": True } | ||
839 | - ]) | ||
840 | - resp = src.command("migrate-set-parameters", | ||
841 | - multifd_channels=scenario._multifd_channels) | ||
842 | - resp = dst.command("migrate-set-capabilities", | ||
843 | - capabilities = [ | ||
844 | - { "capability": "multifd", | ||
845 | - "state": True } | ||
846 | - ]) | ||
847 | - resp = dst.command("migrate-set-parameters", | ||
848 | - multifd_channels=scenario._multifd_channels) | ||
849 | - | ||
850 | - resp = src.command("migrate", uri=connect_uri) | ||
851 | + resp = src.cmd("migrate-set-capabilities", | ||
852 | + capabilities = [ | ||
853 | + { "capability": "multifd", | ||
854 | + "state": True } | ||
855 | + ]) | ||
856 | + resp = src.cmd("migrate-set-parameters", | ||
857 | + multifd_channels=scenario._multifd_channels) | ||
858 | + resp = dst.cmd("migrate-set-capabilities", | ||
859 | + capabilities = [ | ||
860 | + { "capability": "multifd", | ||
861 | + "state": True } | ||
862 | + ]) | ||
863 | + resp = dst.cmd("migrate-set-parameters", | ||
864 | + multifd_channels=scenario._multifd_channels) | ||
865 | + | ||
866 | + resp = src.cmd("migrate", uri=connect_uri) | ||
867 | |||
868 | post_copy = False | ||
869 | paused = False | ||
870 | @@ -228,7 +228,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
871 | |||
872 | if progress._status in ("completed", "failed", "cancelled"): | ||
873 | if progress._status == "completed" and paused: | ||
874 | - dst.command("cont") | ||
875 | + dst.cmd("cont") | ||
876 | if progress_history[-1] != progress: | ||
877 | progress_history.append(progress) | ||
878 | |||
879 | @@ -256,13 +256,13 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
880 | if progress._ram._iterations > scenario._max_iters: | ||
881 | if self._verbose: | ||
882 | print("No completion after %d iterations over RAM" % scenario._max_iters) | ||
883 | - src.command("migrate_cancel") | ||
884 | + src.cmd("migrate_cancel") | ||
885 | continue | ||
886 | |||
887 | if time.time() > (start + scenario._max_time): | ||
888 | if self._verbose: | ||
889 | print("No completion after %d seconds" % scenario._max_time) | ||
890 | - src.command("migrate_cancel") | ||
891 | + src.cmd("migrate_cancel") | ||
892 | continue | ||
893 | |||
894 | if (scenario._post_copy and | ||
895 | @@ -270,7 +270,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
896 | not post_copy): | ||
897 | if self._verbose: | ||
898 | print("Switching to post-copy after %d iterations" % scenario._post_copy_iters) | ||
899 | - resp = src.command("migrate-start-postcopy") | ||
900 | + resp = src.cmd("migrate-start-postcopy") | ||
901 | post_copy = True | ||
902 | |||
903 | if (scenario._pause and | ||
904 | @@ -278,7 +278,7 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): | ||
905 | not paused): | ||
906 | if self._verbose: | ||
907 | print("Pausing VM after %d iterations" % scenario._pause_iters) | ||
908 | - resp = src.command("stop") | ||
909 | + resp = src.cmd("stop") | ||
910 | paused = True | ||
911 | |||
912 | def _is_ppc64le(self): | ||
913 | diff --git a/tests/qemu-iotests/256 b/tests/qemu-iotests/256 | ||
914 | index d7e67f4a05..f34af6cef7 100755 | ||
915 | --- a/tests/qemu-iotests/256 | ||
916 | +++ b/tests/qemu-iotests/256 | ||
917 | @@ -40,25 +40,25 @@ with iotests.FilePath('img0') as img0_path, \ | ||
918 | def create_target(filepath, name, size): | ||
919 | basename = os.path.basename(filepath) | ||
920 | nodename = "file_{}".format(basename) | ||
921 | - log(vm.command('blockdev-create', job_id='job1', | ||
922 | - options={ | ||
923 | - 'driver': 'file', | ||
924 | - 'filename': filepath, | ||
925 | - 'size': 0, | ||
926 | - })) | ||
927 | + log(vm.cmd('blockdev-create', job_id='job1', | ||
928 | + options={ | ||
929 | + 'driver': 'file', | ||
930 | + 'filename': filepath, | ||
931 | + 'size': 0, | ||
932 | + })) | ||
933 | vm.run_job('job1') | ||
934 | - log(vm.command('blockdev-add', driver='file', | ||
935 | - node_name=nodename, filename=filepath)) | ||
936 | - log(vm.command('blockdev-create', job_id='job2', | ||
937 | - options={ | ||
938 | - 'driver': iotests.imgfmt, | ||
939 | - 'file': nodename, | ||
940 | - 'size': size, | ||
941 | - })) | ||
942 | + log(vm.cmd('blockdev-add', driver='file', | ||
943 | + node_name=nodename, filename=filepath)) | ||
944 | + log(vm.cmd('blockdev-create', job_id='job2', | ||
945 | + options={ | ||
946 | + 'driver': iotests.imgfmt, | ||
947 | + 'file': nodename, | ||
948 | + 'size': size, | ||
949 | + })) | ||
950 | vm.run_job('job2') | ||
951 | - log(vm.command('blockdev-add', driver=iotests.imgfmt, | ||
952 | - node_name=name, | ||
953 | - file=nodename)) | ||
954 | + log(vm.cmd('blockdev-add', driver=iotests.imgfmt, | ||
955 | + node_name=name, | ||
956 | + file=nodename)) | ||
957 | |||
958 | log('--- Preparing images & VM ---\n') | ||
959 | vm.add_object('iothread,id=iothread0') | ||
960 | diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 | ||
961 | index e7e7a2317e..7d3720b8e5 100755 | ||
962 | --- a/tests/qemu-iotests/257 | ||
963 | +++ b/tests/qemu-iotests/257 | ||
964 | @@ -160,26 +160,26 @@ class Drive: | ||
965 | file_node_name = "file_{}".format(basename) | ||
966 | vm = self.vm | ||
967 | |||
968 | - log(vm.command('blockdev-create', job_id='bdc-file-job', | ||
969 | - options={ | ||
970 | - 'driver': 'file', | ||
971 | - 'filename': self.path, | ||
972 | - 'size': 0, | ||
973 | - })) | ||
974 | + log(vm.cmd('blockdev-create', job_id='bdc-file-job', | ||
975 | + options={ | ||
976 | + 'driver': 'file', | ||
977 | + 'filename': self.path, | ||
978 | + 'size': 0, | ||
979 | + })) | ||
980 | vm.run_job('bdc-file-job') | ||
981 | - log(vm.command('blockdev-add', driver='file', | ||
982 | - node_name=file_node_name, filename=self.path)) | ||
983 | - | ||
984 | - log(vm.command('blockdev-create', job_id='bdc-fmt-job', | ||
985 | - options={ | ||
986 | - 'driver': fmt, | ||
987 | - 'file': file_node_name, | ||
988 | - 'size': size, | ||
989 | - })) | ||
990 | + log(vm.cmd('blockdev-add', driver='file', | ||
991 | + node_name=file_node_name, filename=self.path)) | ||
992 | + | ||
993 | + log(vm.cmd('blockdev-create', job_id='bdc-fmt-job', | ||
994 | + options={ | ||
995 | + 'driver': fmt, | ||
996 | + 'file': file_node_name, | ||
997 | + 'size': size, | ||
998 | + })) | ||
999 | vm.run_job('bdc-fmt-job') | ||
1000 | - log(vm.command('blockdev-add', driver=fmt, | ||
1001 | - node_name=name, | ||
1002 | - file=file_node_name)) | ||
1003 | + log(vm.cmd('blockdev-add', driver=fmt, | ||
1004 | + node_name=name, | ||
1005 | + file=file_node_name)) | ||
1006 | self.fmt = fmt | ||
1007 | self.size = size | ||
1008 | self.node = name | ||
1009 | -- | ||
1010 | 2.34.1 | ||
1011 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc index 3e56e349..26327ba3 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees.inc | |||
@@ -14,12 +14,12 @@ REPO ?= "git://github.com/Xilinx/qemu-devicetrees.git;protocol=https" | |||
14 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" | 14 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" |
15 | SRC_URI = "${REPO};${BRANCHARG}" | 15 | SRC_URI = "${REPO};${BRANCHARG}" |
16 | 16 | ||
17 | SRC_URI += "file://0001-versal-Reorder-serial-ports.patch" | ||
18 | SRC_URI += "file://0001-versal-net-Reorder-serial-port.patch" | ||
19 | |||
17 | S = "${WORKDIR}/git" | 20 | S = "${WORKDIR}/git" |
18 | 21 | ||
19 | # Don't need to do anything | 22 | do_install[noexec] = '1' |
20 | do_install() { | ||
21 | : | ||
22 | } | ||
23 | 23 | ||
24 | do_deploy() { | 24 | do_deploy() { |
25 | # single-arch dtbs | 25 | # single-arch dtbs |
@@ -33,4 +33,7 @@ do_deploy() { | |||
33 | done | 33 | done |
34 | } | 34 | } |
35 | 35 | ||
36 | addtask deploy after do_install | 36 | addtask deploy after do_install before do_build |
37 | |||
38 | COMPATIBLE_HOST:class-target = "none" | ||
39 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-Reorder-serial-ports.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-Reorder-serial-ports.patch new file mode 100644 index 00000000..23ed3659 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-Reorder-serial-ports.patch | |||
@@ -0,0 +1,1466 @@ | |||
1 | From 2da2588a1dda1fd7fd2f6fc89db13cc5694d793e Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Hatle <mark.hatle@amd.com> | ||
3 | Date: Sat, 24 Aug 2024 11:23:18 -0600 | ||
4 | Subject: [PATCH] versal: Reorder serial ports | ||
5 | |||
6 | This change affects the order of the serial ports when calling qemu. | ||
7 | Previously the serial ports 0 & 1 were the PMC (firmware) uartlite, | ||
8 | while the standard serial pors were 2 & 3. Reverse this order to | ||
9 | ensure that the first two serial ports are the ones used by Linux. | ||
10 | |||
11 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
12 | --- | ||
13 | board-versal-pmc-virt-alt.dts | 230 ++++++++++++++++ | ||
14 | board-versal-ps-vck190-alt.dts | 58 ++++ | ||
15 | board-versal-ps-virt-alt.dts | 354 +++++++++++++++++++++++++ | ||
16 | versal-pmc-alt.dtsi | 40 +++ | ||
17 | versal-pmc-ppu-alt.dtsi | 252 ++++++++++++++++++ | ||
18 | versal-ps-iou-alt.dtsi | 467 +++++++++++++++++++++++++++++++++ | ||
19 | 6 files changed, 1401 insertions(+) | ||
20 | create mode 100644 board-versal-pmc-virt-alt.dts | ||
21 | create mode 100644 board-versal-ps-vck190-alt.dts | ||
22 | create mode 100644 board-versal-ps-virt-alt.dts | ||
23 | create mode 100644 versal-pmc-alt.dtsi | ||
24 | create mode 100644 versal-pmc-ppu-alt.dtsi | ||
25 | create mode 100644 versal-ps-iou-alt.dtsi | ||
26 | |||
27 | diff --git a/board-versal-pmc-virt-alt.dts b/board-versal-pmc-virt-alt.dts | ||
28 | new file mode 100644 | ||
29 | index 00000000..52d23c83 | ||
30 | --- /dev/null | ||
31 | +++ b/board-versal-pmc-virt-alt.dts | ||
32 | @@ -0,0 +1,230 @@ | ||
33 | +/* | ||
34 | + * Versal Virtual PMC board device tree | ||
35 | + * | ||
36 | + * Copyright (c) 2016, Xilinx Inc | ||
37 | + * All rights reserved. | ||
38 | + * | ||
39 | + * Redistribution and use in source and binary forms, with or without | ||
40 | + * modification, are permitted provided that the following conditions are met: | ||
41 | + * * Redistributions of source code must retain the above copyright | ||
42 | + * notice, this list of conditions and the following disclaimer. | ||
43 | + * * Redistributions in binary form must reproduce the above copyright | ||
44 | + * notice, this list of conditions and the following disclaimer in the | ||
45 | + * documentation and/or other materials provided with the distribution. | ||
46 | + * * Neither the name of the <organization> nor the | ||
47 | + * names of its contributors may be used to endorse or promote products | ||
48 | + * derived from this software without specific prior written permission. | ||
49 | + * | ||
50 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
51 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
52 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
53 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
54 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
55 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
56 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
57 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
58 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
59 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
60 | + */ | ||
61 | + | ||
62 | +/dts-v1/; | ||
63 | + | ||
64 | +#ifndef VERSAL_NPI_OVERRIDE | ||
65 | + #include "versal-npi-memmap.dtsh" | ||
66 | +#endif | ||
67 | + | ||
68 | +#define VERSAL_NPI_GENERIC | ||
69 | + | ||
70 | +#include "versal.dtsh" | ||
71 | + | ||
72 | +#ifndef MULTI_ARCH | ||
73 | +#include "versal-pmc-alt.dtsi" | ||
74 | +#include "versal-psm.dtsi" | ||
75 | +#include "versal-ddrmc.dtsi" | ||
76 | +#include "versal-ps-iou-alt.dtsi" | ||
77 | +#include "versal-pmc-ppu-cpus.dtsi" | ||
78 | +#include "versal-psm-cpu.dtsi" | ||
79 | + | ||
80 | +/ { | ||
81 | + /* FIXME: Once we add the NOC, these should be attached to it. */ | ||
82 | + MEM_REGION(ddr, 0x0, MM_TOP_DDR, 0x00000000, MM_TOP_DDR_SIZE, &ddr_mem) // 2 GB | ||
83 | + MEM_SPEC(ddr_2, MM_TOP_DDR_2_H, MM_TOP_DDR_2_L, MM_TOP_DDR_2, | ||
84 | + MM_TOP_DDR_2_SIZE_H, MM_TOP_DDR_2_SIZE_L, &ddr_2_mem) // 32 GB | ||
85 | + | ||
86 | + /* Dummy APUs. */ | ||
87 | + cpu0: apu@0 { | ||
88 | + }; | ||
89 | + cpu1: apu@1 { | ||
90 | + }; | ||
91 | + rpu_cpu0: rpu_cpu0 { | ||
92 | + }; | ||
93 | + rpu_cpu1: rpu_cpu1 { | ||
94 | + }; | ||
95 | +#ifndef HAVE_DDRMC_CPUS | ||
96 | + ddrmc_ub0: ddrmc_ub@0 { | ||
97 | + #interrupt-cells = <1>; | ||
98 | + interrupt-controller; | ||
99 | + }; | ||
100 | + ddrmc_ub1: ddrmc_ub@1 { | ||
101 | + #interrupt-cells = <1>; | ||
102 | + interrupt-controller; | ||
103 | + }; | ||
104 | +#endif | ||
105 | + /* Dummy GIC. */ | ||
106 | + gic: apu_gic@0 { | ||
107 | + #interrupt-cells = <3>; | ||
108 | + interrupt-controller; | ||
109 | + }; | ||
110 | +}; | ||
111 | + | ||
112 | +&pmc_qspi_0 { | ||
113 | + SPI_FLASH(qspi_flash_lcs_lb,"m25qu02gcbb", 0x02000000, 0x0 0x0) | ||
114 | + SPI_FLASH(qspi_flash_lcs_ub,"m25qu02gcbb", 0x02000000, 0x2 0x1) | ||
115 | + SPI_FLASH(qspi_flash_ucs_lb,"m25qu02gcbb", 0x02000000, 0x1 0x0) | ||
116 | + SPI_FLASH(qspi_flash_ucs_ub,"m25qu02gcbb", 0x02000000, 0x3 0x1) | ||
117 | +}; | ||
118 | + | ||
119 | +&ospi { | ||
120 | + SPI_FLASH(ospi_flash_lcs_lb, "mt35xu01gbba", 0x02000000, 0x0 0x0) | ||
121 | + SPI_FLASH(ospi_flash_lcs_ub, "mt35xu01gbba", 0x02000000, 0x1 0x0) | ||
122 | + SPI_FLASH(ospi_flash_ucs_lb, "mt35xu01gbba", 0x02000000, 0x2 0x0) | ||
123 | + SPI_FLASH(ospi_flash_ucs_ub, "mt35xu01gbba", 0x02000000, 0x3 0x0) | ||
124 | +}; | ||
125 | + | ||
126 | +#else | ||
127 | +#include "versal-icnt.dtsi" | ||
128 | +#include "versal-rams.dtsi" | ||
129 | +#include "versal-pmc-ppu-cpus.dtsi" | ||
130 | +#include "versal-psm-cpu.dtsi" | ||
131 | + | ||
132 | +/ { | ||
133 | + /* FIXME: Once we add the NOC, these should be attached to it. */ | ||
134 | + MEM_REGION(ddr, 0x0, 0x00000000, 0x00000000, 0x80000000, &ddr_mem) | ||
135 | + | ||
136 | + ps_pmc_rp: ps_pmc_rp@0 { | ||
137 | + doc-name = "Remote-port PMC-PS"; | ||
138 | + compatible = "remote-port"; | ||
139 | + chrdev-id = "ps-pmc-rp"; | ||
140 | + }; | ||
141 | + rp_pmc_ppu0: rp_pmc_ppu0@0 { | ||
142 | + compatible = "remote-port-gpio"; | ||
143 | + remote-ports = <&ps_pmc_rp 1>; | ||
144 | + interrupts-extended = < &pmc_ppu0 0 >; | ||
145 | + }; | ||
146 | + rp_pmc_ppu1: rp_pmc_ppu1@0 { | ||
147 | + compatible = "remote-port-gpio"; | ||
148 | + remote-ports = <&ps_pmc_rp 2>; | ||
149 | + interrupts-extended = < &pmc_ppu1 0 >; | ||
150 | + }; | ||
151 | + pmc_global: rp_pmc_global@0 { | ||
152 | + compatible = "remote-port-gpio"; | ||
153 | + remote-ports = <&ps_pmc_rp 3>; | ||
154 | + #gpio-cells = <1>; | ||
155 | + num-gpios = <16>; | ||
156 | + }; | ||
157 | + lmb_pmc_ppu0: lmb_pmc_ppu0@0 { | ||
158 | + rp_lmb_pmc_ppu0@0 { | ||
159 | + compatible = "remote-port-memory-master"; | ||
160 | + remote-ports = <&ps_pmc_rp 4>; | ||
161 | + reg = < 0x0 0x0 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF /* -1 */ >; | ||
162 | + }; | ||
163 | + }; | ||
164 | + lmb_pmc_ppu1: lmb_pmc_ppu1@0 { | ||
165 | + rp_lmb_pmc_ppu1@0 { | ||
166 | + compatible = "remote-port-memory-master"; | ||
167 | + remote-ports = <&ps_pmc_rp 5>; | ||
168 | + reg = < 0x0 0x0 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF /* -1 */ >; | ||
169 | + }; | ||
170 | + }; | ||
171 | + crl: crl@MM_CRL { | ||
172 | + compatible = "remote-port-gpio"; | ||
173 | + remote-ports = <&ps_pmc_rp 6>; | ||
174 | + #gpio-cells = <1>; | ||
175 | + num-gpios = <35>; | ||
176 | + }; | ||
177 | + pmc_clk_rst: pmc_clk_rst@0 { | ||
178 | + compatible = "remote-port-gpio"; | ||
179 | + remote-ports = <&ps_pmc_rp 7>; | ||
180 | + #gpio-cells = <1>; | ||
181 | + num-gpios = <30>; | ||
182 | + }; | ||
183 | + rp_psm0: rp_psm0@0 { | ||
184 | + compatible = "remote-port-gpio"; | ||
185 | + remote-ports = <&ps_pmc_rp 8>; | ||
186 | + interrupts-extended = < &psm0 0 >; | ||
187 | + }; | ||
188 | +#ifdef MM_NPI_DDRMC_MAIN_0 | ||
189 | + rp_ddrmc_ub0: rp_ddrmc_ub@0 { | ||
190 | + compatible = "remote-port-gpio"; | ||
191 | + remote-ports = <&ps_pmc_rp 9>; | ||
192 | +# ifdef HAVE_DDRMC_CPUS | ||
193 | + interrupts-extended = < &ddrmc_ub0 0 >; | ||
194 | +# endif | ||
195 | + }; | ||
196 | + | ||
197 | + npi_ddrmc_ub0: rp_npi_ddrmc_ub@0 { | ||
198 | + compatible = "remote-port-gpio"; | ||
199 | + remote-ports = <&ps_pmc_rp 11>; | ||
200 | + #gpio-cells = <1>; | ||
201 | + }; | ||
202 | +#endif | ||
203 | +#ifdef MM_NPI_DDRMC_MAIN_1 | ||
204 | + rp_ddrmc_ub1: rp_ddrmc_ub@1 { | ||
205 | + compatible = "remote-port-gpio"; | ||
206 | + remote-ports = <&ps_pmc_rp 10>; | ||
207 | + # ifdef HAVE_DDRMC_CPUS | ||
208 | + interrupts-extended = < &ddrmc_ub1 0 >; | ||
209 | + # endif | ||
210 | + }; | ||
211 | + | ||
212 | + npi_ddrmc_ub1: rp_npi_ddrmc_ub@1 { | ||
213 | + compatible = "remote-port-gpio"; | ||
214 | + remote-ports = <&ps_pmc_rp 12>; | ||
215 | + #gpio-cells = <1>; | ||
216 | + }; | ||
217 | +#endif | ||
218 | + lmb_psm: lmb_psm@0 { | ||
219 | + rp_lmb_psm@0 { | ||
220 | + compatible = "remote-port-memory-master"; | ||
221 | + remote-ports = <&ps_pmc_rp 13>; | ||
222 | + reg = < 0x0 0x0 0xFFFFFFFF 0xFFFFFFFF 0xFFFFFFFF /* -1 */ >; | ||
223 | + }; | ||
224 | + }; | ||
225 | + | ||
226 | + /* Dummy stub to avoid ifdefs in the interrupt-map. */ | ||
227 | + pmc_gic_proxy: pmc_gic_proxy { | ||
228 | + doc-ignore = <1>; | ||
229 | + #interrupt-cells = <3>; | ||
230 | + interrupt-controller; | ||
231 | + }; | ||
232 | + psm_gic_proxy: psm_gic_proxy { | ||
233 | + doc-ignore = <1>; | ||
234 | + #interrupt-cells = <3>; | ||
235 | + interrupt-controller; | ||
236 | + }; | ||
237 | + psm0_io_intc: psm0_io_intc { | ||
238 | + doc-ignore = <1>; | ||
239 | + #interrupt-cells = <1>; | ||
240 | + interrupt-controller; | ||
241 | + }; | ||
242 | + pmc_ppu1_io_intc: pmc_ppu1_io_intc { | ||
243 | + doc-ignore = <1>; | ||
244 | + #interrupt-cells = <1>; | ||
245 | + interrupt-controller; | ||
246 | + }; | ||
247 | +}; | ||
248 | +#endif | ||
249 | + | ||
250 | +/ { | ||
251 | + /* | ||
252 | + * FIXME: This legacy hook will reset the entire PMC instance | ||
253 | + * meaning PSM and PMC MicroBlazes for multi-arch and all | ||
254 | + * devices for single-arch. | ||
255 | + * Once the CPU reset infrastructure is improved, we should | ||
256 | + * remove this. | ||
257 | + */ | ||
258 | + pmc_reset: pmc_reset@ { | ||
259 | + compatible = "qemu,reset-device"; | ||
260 | + gpios = <&pmc_clk_rst CRP_RST_PS_PMC_SRST>; | ||
261 | + }; | ||
262 | +}; | ||
263 | diff --git a/board-versal-ps-vck190-alt.dts b/board-versal-ps-vck190-alt.dts | ||
264 | new file mode 100644 | ||
265 | index 00000000..b61d3d5c | ||
266 | --- /dev/null | ||
267 | +++ b/board-versal-ps-vck190-alt.dts | ||
268 | @@ -0,0 +1,58 @@ | ||
269 | +/* | ||
270 | + * Versal Virtual vck190 board device tree | ||
271 | + * | ||
272 | + * Copyright (c) 2020, Xilinx Inc | ||
273 | + * All rights reserved. | ||
274 | + * | ||
275 | + * Redistribution and use in source and binary forms, with or without | ||
276 | + * modification, are permitted provided that the following conditions are met: | ||
277 | + * * Redistributions of source code must retain the above copyright | ||
278 | + * notice, this list of conditions and the following disclaimer. | ||
279 | + * * Redistributions in binary form must reproduce the above copyright | ||
280 | + * notice, this list of conditions and the following disclaimer in the | ||
281 | + * documentation and/or other materials provided with the distribution. | ||
282 | + * * Neither the name of the <organization> nor the | ||
283 | + * names of its contributors may be used to endorse or promote products | ||
284 | + * derived from this software without specific prior written permission. | ||
285 | + * | ||
286 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
287 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
288 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
289 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
290 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
291 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
292 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
293 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
294 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
295 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
296 | + */ | ||
297 | +#include "board-versal-ps-virt-alt.dts" | ||
298 | +#include "versal-silicon-freq.dtsi" | ||
299 | + | ||
300 | +/{ | ||
301 | + MEM_REGION64(ddr_3, MM_TOP_DDR_CH1_H, MM_TOP_DDR_CH1_L, MM_TOP_DDR_CH1, | ||
302 | + 0x2, 0x0, &ddr_3_mem) // 8 GB | ||
303 | +}; | ||
304 | + | ||
305 | +&ps_i2c1 { | ||
306 | + i2cswitch@74 { | ||
307 | + #address-cells = <1>; | ||
308 | + #size-cells = <0>; | ||
309 | + compatible = "nxp,pca9548"; | ||
310 | + reg = <0x74>; | ||
311 | + chip-enable = <0x1>; | ||
312 | + i2c@0 { | ||
313 | + #address-cells = <1>; | ||
314 | + #size-cells = <0>; | ||
315 | + reg = <0>; | ||
316 | + eeprom@54 { | ||
317 | + compatible = "at,24c08"; | ||
318 | + reg = <0x54>; | ||
319 | + }; | ||
320 | + }; | ||
321 | + }; | ||
322 | +}; | ||
323 | + | ||
324 | +&ospi_flash_lcs_lb { | ||
325 | + compatible = "mt35xu02gbba"; | ||
326 | +}; | ||
327 | diff --git a/board-versal-ps-virt-alt.dts b/board-versal-ps-virt-alt.dts | ||
328 | new file mode 100644 | ||
329 | index 00000000..7585d196 | ||
330 | --- /dev/null | ||
331 | +++ b/board-versal-ps-virt-alt.dts | ||
332 | @@ -0,0 +1,354 @@ | ||
333 | +/* | ||
334 | + * Versal Virtual PS board device tree | ||
335 | + * | ||
336 | + * Copyright (c) 2016-2022, Xilinx Inc. | ||
337 | + * Copyright (C) 2022-2024, Advanced Micro Devices, Inc. | ||
338 | + * All rights reserved. | ||
339 | + * | ||
340 | + * Redistribution and use in source and binary forms, with or without | ||
341 | + * modification, are permitted provided that the following conditions are met: | ||
342 | + * * Redistributions of source code must retain the above copyright | ||
343 | + * notice, this list of conditions and the following disclaimer. | ||
344 | + * * Redistributions in binary form must reproduce the above copyright | ||
345 | + * notice, this list of conditions and the following disclaimer in the | ||
346 | + * documentation and/or other materials provided with the distribution. | ||
347 | + * * Neither the name of the <organization> nor the | ||
348 | + * names of its contributors may be used to endorse or promote products | ||
349 | + * derived from this software without specific prior written permission. | ||
350 | + * | ||
351 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
352 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
353 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
354 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
355 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
356 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
357 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
358 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
359 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
360 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
361 | + */ | ||
362 | +#ifndef __BOARD_VERSAL_PS_VIRT__ | ||
363 | +#define __BOARD_VERSAL_PS_VIRT__ | ||
364 | + | ||
365 | +/dts-v1/; | ||
366 | +#ifndef VERSAL_NPI_OVERRIDE | ||
367 | + #include "versal-npi-memmap.dtsh" | ||
368 | +#endif | ||
369 | + | ||
370 | +#ifndef NUM_APUS | ||
371 | +/* Base platform has 2 APUs. */ | ||
372 | +#define NUM_APUS 2 | ||
373 | +#endif | ||
374 | + | ||
375 | +#define HAS_SMMU | ||
376 | +#define HAVE_APU_GIC | ||
377 | + | ||
378 | +#ifndef RPU_GIC_INTERRUPT_TARGET_STEM | ||
379 | +#ifdef MULTI_ARCH | ||
380 | + #define RPU_GIC_INTERRUPT_TARGET_STEM rpu_intc_redirect_ | ||
381 | +#else | ||
382 | + #define RPU_GIC_INTERRUPT_TARGET_STEM rpu_cpu | ||
383 | +#endif | ||
384 | +#endif | ||
385 | + | ||
386 | +#define VERSAL_NPI_GENERIC | ||
387 | + | ||
388 | +#include "versal.dtsh" | ||
389 | + | ||
390 | +#include "versal-pmc.dtsi" | ||
391 | +#include "versal-psm.dtsi" | ||
392 | +#include "versal-ddrmc.dtsi" | ||
393 | +#ifdef VERSAL_PSX | ||
394 | +#include "versal-psx-apu.dtsi" | ||
395 | +#else | ||
396 | +#include "versal-ps-apu.dtsi" | ||
397 | +#include "versal-ps-rpu.dtsi" | ||
398 | +#include "versal-boot-init.dtsi" | ||
399 | +#endif | ||
400 | +#include "versal-ps-iou-alt.dtsi" | ||
401 | +#include "versal-virtio-mmio.dtsi" | ||
402 | +#include "versal-boot-init.dtsi" | ||
403 | +#include "versal-gty.dtsi" | ||
404 | +#include "versal-silicon-freq.dtsi" | ||
405 | + | ||
406 | +/ { | ||
407 | +#ifdef MULTI_ARCH | ||
408 | + ps_pmc_rp: ps_pmc_rp@0 { | ||
409 | + doc-status = "complete"; | ||
410 | + doc-name = "Remote-port PMC"; | ||
411 | + doc-subdtb = "board-versal-pmc-virt.dtb"; | ||
412 | + compatible = "remote-port"; | ||
413 | + chrdev-id = "ps-pmc-rp"; | ||
414 | + }; | ||
415 | + pmc_ppu0: rp_pmc_ppu0@0 { | ||
416 | + compatible = "remote-port-gpio"; | ||
417 | + remote-ports = <&ps_pmc_rp 1>; | ||
418 | + #interrupt-cells = <1>; | ||
419 | + interrupt-controller; | ||
420 | + }; | ||
421 | + pmc_ppu1: rp_pmc_ppu1@0 { | ||
422 | + compatible = "remote-port-gpio"; | ||
423 | + remote-ports = <&ps_pmc_rp 2>; | ||
424 | + #interrupt-cells = <1>; | ||
425 | + interrupt-controller; | ||
426 | + }; | ||
427 | + rp_pmc_global: rp_pmc_global@0 { | ||
428 | + compatible = "remote-port-gpio"; | ||
429 | + remote-ports = <&ps_pmc_rp 3>; | ||
430 | + gpio-controller; | ||
431 | + #gpio-cells = <1>; | ||
432 | + num-gpios = <16>; | ||
433 | + | ||
434 | + /* We only need to proxy GPIO 1 and 2 (PPU1 RST and WAKE). */ | ||
435 | + gpios = < &dummy1 0 | ||
436 | + &pmc_global 1 | ||
437 | + &pmc_global 2 >; | ||
438 | + }; | ||
439 | + rp_lmb_pmc_ppu0: rp_lmb_pmc_ppu0@0 { | ||
440 | + compatible = "remote-port-memory-slave"; | ||
441 | + remote-ports = <&ps_pmc_rp 4>; | ||
442 | + mr = <&lmb_pmc_ppu0>; | ||
443 | + }; | ||
444 | + rp_lmb_pmc_ppu1: rp_lmb_pmc_ppu1@0 { | ||
445 | + compatible = "remote-port-memory-slave"; | ||
446 | + remote-ports = <&ps_pmc_rp 5>; | ||
447 | + mr = <&lmb_pmc_ppu1>; | ||
448 | + }; | ||
449 | + rp_crl: rp_crl@0 { | ||
450 | + compatible = "remote-port-gpio"; | ||
451 | + remote-ports = <&ps_pmc_rp 6>; | ||
452 | + gpio-controller; | ||
453 | + #gpio-cells = <1>; | ||
454 | + num-gpios = <35>; | ||
455 | + | ||
456 | + gpios = < | ||
457 | + &crl 0 | ||
458 | + &crl 1 | ||
459 | + &crl 2 | ||
460 | + &crl 3 | ||
461 | + &crl 4 | ||
462 | + &crl 5 | ||
463 | + &crl 6 | ||
464 | + &crl 7 | ||
465 | + &crl 8 | ||
466 | + &crl 9 | ||
467 | + &crl 10 | ||
468 | + &crl 11 | ||
469 | + &crl 12 | ||
470 | + &crl 13 | ||
471 | + &crl 14 | ||
472 | + &crl 15 | ||
473 | + &crl 16 | ||
474 | + &crl 17 | ||
475 | + &crl 18 | ||
476 | + &crl 19 | ||
477 | + &crl 20 | ||
478 | + &crl 21 | ||
479 | + &crl 22 | ||
480 | + &crl 23 | ||
481 | + &crl 24 | ||
482 | + &crl 25 | ||
483 | + &crl 26 | ||
484 | + &crl 27 | ||
485 | + &crl 28 | ||
486 | + &crl 29 | ||
487 | + &crl 30 | ||
488 | + &crl 31 | ||
489 | + &dummy1 0 | ||
490 | + &dummy1 0 | ||
491 | + &crl 34 >; | ||
492 | + }; | ||
493 | + rp_pmc_clk_rst: rp_pmc_clk_rst@0 { | ||
494 | + compatible = "remote-port-gpio"; | ||
495 | + remote-ports = <&ps_pmc_rp 7>; | ||
496 | + gpio-controller; | ||
497 | + #gpio-cells = <1>; | ||
498 | + num-gpios = <30>; | ||
499 | + | ||
500 | + gpios = < &pmc_clk_rst 0 &pmc_clk_rst 1 | ||
501 | + &pmc_clk_rst 2 &pmc_clk_rst 3 | ||
502 | + &pmc_clk_rst 4 &pmc_clk_rst 5 | ||
503 | + &pmc_clk_rst 6 &pmc_clk_rst 7 | ||
504 | + &pmc_clk_rst 8 &pmc_clk_rst 9 | ||
505 | + &pmc_clk_rst 10 &pmc_clk_rst 11 | ||
506 | + &pmc_clk_rst 12 &pmc_clk_rst 13 | ||
507 | + &pmc_clk_rst 14 &pmc_clk_rst 15 | ||
508 | + &pmc_clk_rst 16 &pmc_clk_rst 17 | ||
509 | + &pmc_clk_rst 18 &pmc_clk_rst 19 | ||
510 | + &pmc_clk_rst 20 &pmc_clk_rst 21 | ||
511 | + &pmc_clk_rst 22 &pmc_clk_rst 23 | ||
512 | + &pmc_clk_rst 24 &pmc_clk_rst 25 | ||
513 | + &pmc_clk_rst 26 &pmc_clk_rst 27 | ||
514 | + &pmc_clk_rst 28 &pmc_clk_rst 29 | ||
515 | + >; | ||
516 | + }; | ||
517 | + psm0: rp_psm0@0 { | ||
518 | + compatible = "remote-port-gpio"; | ||
519 | + remote-ports = <&ps_pmc_rp 8>; | ||
520 | + #interrupt-cells = <1>; | ||
521 | + interrupt-controller; | ||
522 | + }; | ||
523 | +#ifdef MM_NPI_DDRMC_MAIN_0 | ||
524 | + ddrmc_ub0: rp_ddrmc@0 { | ||
525 | + compatible = "remote-port-gpio"; | ||
526 | + remote-ports = <&ps_pmc_rp 9>; | ||
527 | + #interrupt-cells = <1>; | ||
528 | + interrupt-controller; | ||
529 | + }; | ||
530 | + rp_npi_ddrmc_ub0: rp_npi_ddrmc_ub@0 { | ||
531 | + compatible = "remote-port-gpio"; | ||
532 | + remote-ports = <&ps_pmc_rp 11>; | ||
533 | + gpios = < &npi_ddrmc_ub0 0 >; | ||
534 | + }; | ||
535 | +#endif | ||
536 | +#ifdef MM_NPI_DDRMC_MAIN_1 | ||
537 | + ddrmc_ub1: rp_ddrmc@1 { | ||
538 | + compatible = "remote-port-gpio"; | ||
539 | + remote-ports = <&ps_pmc_rp 10>; | ||
540 | + #interrupt-cells = <1>; | ||
541 | + interrupt-controller; | ||
542 | + }; | ||
543 | + rp_npi_ddrmc_ub1: rp_npi_ddrmc_ub@1 { | ||
544 | + compatible = "remote-port-gpio"; | ||
545 | + remote-ports = <&ps_pmc_rp 12>; | ||
546 | + gpios = < &npi_ddrmc_ub1 0 >; | ||
547 | + }; | ||
548 | +#endif | ||
549 | + rp_lmb_psm: rp_lmb_psm@0 { | ||
550 | + compatible = "remote-port-memory-slave"; | ||
551 | + remote-ports = <&ps_pmc_rp 13>; | ||
552 | + mr = <&lmb_psm>; | ||
553 | + }; | ||
554 | + | ||
555 | +#define RPU_INTC_REDIRECT(NCPU, PSMOUT, RPUN) \ | ||
556 | +glue(rpu_intc_redirect_, NCPU): glue(rpu_intc_redirect, NCPU)@NCPU { \ | ||
557 | + #interrupt-cells = <1>; \ | ||
558 | + compatible = "xlnx,zynqmp-intc-redirect"; \ | ||
559 | + interrupt-controller; \ | ||
560 | + interrupts-extended = <glue(&rpu_cpu,NCPU) 0>; \ | ||
561 | + gpios = <&psm_global PSMOUT &rpu_ctrl RPUN>; \ | ||
562 | +}; | ||
563 | + | ||
564 | + amba_rpu: amba_rpu@0 { | ||
565 | + RPU_INTC_REDIRECT(0, 4, 6) | ||
566 | + RPU_INTC_REDIRECT(1, 5, 7) | ||
567 | + }; | ||
568 | + | ||
569 | +#else | ||
570 | + /* Single ARCH PS board has no PPU MicroBlazes. */ | ||
571 | + pmc_ppu0: dummy_ppu0@0 { | ||
572 | + #interrupt-cells = <1>; | ||
573 | + }; | ||
574 | + pmc_ppu1: dummy_ppu1@0 { | ||
575 | + #interrupt-cells = <1>; | ||
576 | + }; | ||
577 | + psm0: dummy_ppu0@0 { | ||
578 | + #interrupt-cells = <1>; | ||
579 | + }; | ||
580 | + ddrmc_ub0: dummy_ddrmc0@0 { | ||
581 | + #interrupt-cells = <1>; | ||
582 | + }; | ||
583 | + ddrmc_ub1: dummy_ddrmc1@0 { | ||
584 | + #interrupt-cells = <1>; | ||
585 | + }; | ||
586 | +#endif | ||
587 | + | ||
588 | + /* FIXME: Once we add the NOC, these should be attached to it. */ | ||
589 | + MEM_REGION(ddr, 0x0, MM_TOP_DDR, 0x00000000, MM_TOP_DDR_SIZE, &ddr_mem) // 2 GB | ||
590 | + MEM_SPEC(ddr_2, MM_TOP_DDR_2_H, MM_TOP_DDR_2_L, MM_TOP_DDR_2, | ||
591 | + MM_TOP_DDR_2_SIZE_H, MM_TOP_DDR_2_SIZE_L, &ddr_2_mem) // 32 GB | ||
592 | + mdio0: mdio { | ||
593 | + #address-cells = <1>; | ||
594 | + #size-cells = <0>; | ||
595 | + #priority-cells = <0>; | ||
596 | + compatible="mdio"; | ||
597 | + phy0: phy@1 { | ||
598 | + compatible = "dp83867"; | ||
599 | + device_type = "ethernet-phy"; | ||
600 | + reg = <1>; | ||
601 | + }; | ||
602 | + phy1: phy@2 { | ||
603 | + compatible = "88e1118r"; | ||
604 | + device_type = "ethernet-phy"; | ||
605 | + reg = <2>; | ||
606 | + }; | ||
607 | + }; | ||
608 | +}; | ||
609 | + | ||
610 | +/* | ||
611 | + * One flash for each SPI-master to match prebuilt system.dtb in BSP | ||
612 | + * xilinx-versal-virt-2019.1 | ||
613 | + */ | ||
614 | +#define BDEV_SPI_FLASH(_NAME, _COMPAT, _SIZEM, _REGVAL) \ | ||
615 | +_NAME: _NAME@0 { \ | ||
616 | + #address-cells = <1>; \ | ||
617 | + #size-cells = <1>; \ | ||
618 | + #priority-cells = <0>; \ | ||
619 | + #bus-cells = <1>; \ | ||
620 | + compatible = _COMPAT, "st,m25p80"; \ | ||
621 | + spi-max-frequency = <50000000>; \ | ||
622 | + reg = <_REGVAL>; \ | ||
623 | + blockdev-node-name = #_NAME; \ | ||
624 | + _NAME@0x00000000 { \ | ||
625 | + label = #_NAME; \ | ||
626 | + reg = <0x00000000 _SIZEM>; \ | ||
627 | + }; \ | ||
628 | +}; | ||
629 | + | ||
630 | +&spi0 { | ||
631 | + BDEV_SPI_FLASH(spi0_flash0, "m25p80", 0x00100000, 0x0 0x0) | ||
632 | +}; | ||
633 | + | ||
634 | +&spi1 { | ||
635 | + BDEV_SPI_FLASH(spi1_flash0, "m25p80", 0x00100000, 0x0 0x0) | ||
636 | +}; | ||
637 | + | ||
638 | +/* | ||
639 | + * Use 2Gbit QSPI flashes to allow verification of Image-searching | ||
640 | + * in ROM upto 256MB. | ||
641 | + */ | ||
642 | +#define DI_SPI_FLASH(_DI, _NAME, _COMPAT, _SIZEM, _REGVAL) \ | ||
643 | +_NAME: _NAME@0 { \ | ||
644 | + #address-cells = <1>; \ | ||
645 | + #size-cells = <1>; \ | ||
646 | + #priority-cells = <0>; \ | ||
647 | + #bus-cells = <1>; \ | ||
648 | + compatible = _COMPAT, "st,m25p80"; \ | ||
649 | + spi-max-frequency = <50000000>; \ | ||
650 | + reg = <_REGVAL>; \ | ||
651 | + drive-index = <_DI>; \ | ||
652 | + _NAME@0x00000000 { \ | ||
653 | + label = #_NAME; \ | ||
654 | + reg = <0x00000000 _SIZEM>; \ | ||
655 | + }; \ | ||
656 | +}; | ||
657 | + | ||
658 | +&pmc_qspi_0 { | ||
659 | + DI_SPI_FLASH(0, qspi_flash_lcs_lb, "m25qu02gcbb", 0x02000000, 0x0 0x0) | ||
660 | + DI_SPI_FLASH(1, qspi_flash_lcs_ub, "m25qu02gcbb", 0x02000000, 0x2 0x1) | ||
661 | + DI_SPI_FLASH(2, qspi_flash_ucs_lb, "m25qu02gcbb", 0x02000000, 0x1 0x0) | ||
662 | + DI_SPI_FLASH(3, qspi_flash_ucs_ub, "m25qu02gcbb", 0x02000000, 0x3 0x1) | ||
663 | +}; | ||
664 | + | ||
665 | +&ospi { | ||
666 | + DI_SPI_FLASH(4, ospi_flash_lcs_lb, "mt35xu01gbba", 0x02000000, 0x0 0x0) | ||
667 | + DI_SPI_FLASH(5, ospi_flash_lcs_ub, "mt35xu01gbba", 0x02000000, 0x1 0x0) | ||
668 | + DI_SPI_FLASH(6, ospi_flash_ucs_lb, "mt35xu01gbba", 0x02000000, 0x2 0x0) | ||
669 | + DI_SPI_FLASH(7, ospi_flash_ucs_ub, "mt35xu01gbba", 0x02000000, 0x3 0x0) | ||
670 | +}; | ||
671 | + | ||
672 | +&gem0 { | ||
673 | + mdio = <&mdio0>; | ||
674 | +}; | ||
675 | + | ||
676 | +&gem1 { | ||
677 | + mdio = <&mdio0>; | ||
678 | +}; | ||
679 | + | ||
680 | +&pmc_tap { | ||
681 | + /* | ||
682 | + * Default device: xcvc1902 | ||
683 | + */ | ||
684 | + idcode = <0x14CA8093>; | ||
685 | +}; | ||
686 | +#endif | ||
687 | diff --git a/versal-pmc-alt.dtsi b/versal-pmc-alt.dtsi | ||
688 | new file mode 100644 | ||
689 | index 00000000..8236911b | ||
690 | --- /dev/null | ||
691 | +++ b/versal-pmc-alt.dtsi | ||
692 | @@ -0,0 +1,40 @@ | ||
693 | +/* | ||
694 | + * Versal PMC | ||
695 | + * | ||
696 | + * Copyright (c) 2016, Xilinx Inc. | ||
697 | + * All rights reserved. | ||
698 | + * | ||
699 | + * Redistribution and use in source and binary forms, with or without | ||
700 | + * modification, are permitted provided that the following conditions are met: | ||
701 | + * * Redistributions of source code must retain the above copyright | ||
702 | + * notice, this list of conditions and the following disclaimer. | ||
703 | + * * Redistributions in binary form must reproduce the above copyright | ||
704 | + * notice, this list of conditions and the following disclaimer in the | ||
705 | + * documentation and/or other materials provided with the distribution. | ||
706 | + * * Neither the name of the <organization> nor the | ||
707 | + * names of its contributors may be used to endorse or promote products | ||
708 | + * derived from this software without specific prior written permission. | ||
709 | + * | ||
710 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
711 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
712 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
713 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
714 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
715 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
716 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
717 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
718 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
719 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
720 | + */ | ||
721 | + | ||
722 | +#include "versal.dtsh" | ||
723 | + | ||
724 | +#include "versal-icnt.dtsi" | ||
725 | +#include "versal-rams.dtsi" | ||
726 | +#include "versal-pmc-ppu-alt.dtsi" | ||
727 | +#include "versal-pmc-iou.dtsi" | ||
728 | +#include "versal-pmc-sys.dtsi" | ||
729 | +#include "versal-pmc-sec.dtsi" | ||
730 | +#include "versal-pmc-npi.dtsi" | ||
731 | +#include "versal-pmc-pl.dtsi" | ||
732 | +#include "versal-pmc-bat.dtsi" | ||
733 | diff --git a/versal-pmc-ppu-alt.dtsi b/versal-pmc-ppu-alt.dtsi | ||
734 | new file mode 100644 | ||
735 | index 00000000..726413f4 | ||
736 | --- /dev/null | ||
737 | +++ b/versal-pmc-ppu-alt.dtsi | ||
738 | @@ -0,0 +1,252 @@ | ||
739 | +/* | ||
740 | + * Versal PMC PPU block | ||
741 | + * | ||
742 | + * Copyright (c) 2016, Xilinx Inc. | ||
743 | + * All rights reserved. | ||
744 | + * | ||
745 | + * Redistribution and use in source and binary forms, with or without | ||
746 | + * modification, are permitted provided that the following conditions are met: | ||
747 | + * * Redistributions of source code must retain the above copyright | ||
748 | + * notice, this list of conditions and the following disclaimer. | ||
749 | + * * Redistributions in binary form must reproduce the above copyright | ||
750 | + * notice, this list of conditions and the following disclaimer in the | ||
751 | + * documentation and/or other materials provided with the distribution. | ||
752 | + * * Neither the name of the <organization> nor the | ||
753 | + * names of its contributors may be used to endorse or promote products | ||
754 | + * derived from this software without specific prior written permission. | ||
755 | + * | ||
756 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
757 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
758 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
759 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
760 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
761 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
762 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
763 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
764 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
765 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
766 | + */ | ||
767 | + | ||
768 | +#include "versal.dtsh" | ||
769 | + | ||
770 | +#define CREATE_PPU_IOMOD(X) \ | ||
771 | + pmc_ppu ## X ## _io_module: io-module@00 { \ | ||
772 | + doc-status = "complete"; \ | ||
773 | + #address-cells = <2>; \ | ||
774 | + #size-cells = <1>; \ | ||
775 | + #priority-cells = <0>; \ | ||
776 | + compatible = "xlnx,iomodule-1.02.a", "syscon", "simple-bus"; \ | ||
777 | + container = <&lmb_pmc_ppu ## X>; \ | ||
778 | + priority = <0xffffffff>; \ | ||
779 | + xlnx,freq = <0x47868c0>; \ | ||
780 | + xlnx,instance = "iomodule_1"; \ | ||
781 | + xlnx,io-mask = <0xfffe0000>; \ | ||
782 | + xlnx,lmb-awidth = <0x20>; \ | ||
783 | + xlnx,lmb-dwidth = <0x20>; \ | ||
784 | + xlnx,mask = <0xffffff80>; \ | ||
785 | + xlnx,use-io-bus = <0x1>; \ | ||
786 | + \ | ||
787 | + pmc_ppu ## X ## _io_intc: pmc_ppu ## X ## _intc@0C { \ | ||
788 | + #interrupt-cells = <1>; \ | ||
789 | + compatible = "xlnx,io-intc-1.02.a", "xlnx,io_intc"; \ | ||
790 | + interrupt-controller ; \ | ||
791 | + interrupts-extended = <&pmc_ppu ## X 0>; \ | ||
792 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(0C) 0x4 0x0 MM_PMC_PPU ## X ## _IOM(30) 0x10 0x0 MM_PMC_PPU ## X ## _IOM(80) 0x7C>; \ | ||
793 | + xlnx,intc-addr-width = <0x20>; \ | ||
794 | + xlnx,intc-base-vectors = <0x0>; \ | ||
795 | + xlnx,intc-has-fast = <0x0>; \ | ||
796 | + xlnx,intc-intr-size = <0x10>; \ | ||
797 | + xlnx,intc-level-edge = <0x0>; \ | ||
798 | + xlnx,intc-positive = <0xffff>; \ | ||
799 | + xlnx,intc-use-ext-intr = <0x1>; \ | ||
800 | + }; \ | ||
801 | + \ | ||
802 | + pmc_ppu ## X ## _io_gpi1: pmc_ppu ## X ## _gpi@20 { \ | ||
803 | + #gpio-cells = <1>; \ | ||
804 | + gpio-controller; \ | ||
805 | + compatible = "xlnx,io-gpi-1.02.a", "xlnx,io_gpi"; \ | ||
806 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
807 | + interrupts = <11>; \ | ||
808 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(20) 0x4>; \ | ||
809 | + xlnx,gpi-interrupt = <0x1>; \ | ||
810 | + xlnx,gpi-size = <0x20>; \ | ||
811 | + xlnx,use-gpi = <0x1>; \ | ||
812 | + }; \ | ||
813 | + pmc_ppu ## X ## _io_gpi2: pmc_ppu ## X ## _gpi@24 { \ | ||
814 | + #gpio-cells = <1>; \ | ||
815 | + gpio-controller; \ | ||
816 | + compatible = "xlnx,io-gpi-1.02.a", "xlnx,io_gpi"; \ | ||
817 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
818 | + interrupts = <12>; \ | ||
819 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(24) 0x4>; \ | ||
820 | + xlnx,gpi-interrupt = <0x1>; \ | ||
821 | + xlnx,gpi-size = <0x20>; \ | ||
822 | + xlnx,use-gpi = <0x1>; \ | ||
823 | + }; \ | ||
824 | + pmc_ppu ## X ## _io_gpi3: pmc_ppu ## X ## _gpi@28 { \ | ||
825 | + #gpio-cells = <1>; \ | ||
826 | + gpio-controller; \ | ||
827 | + compatible = "xlnx,io-gpi-1.02.a", "xlnx,io_gpi"; \ | ||
828 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
829 | + interrupts = <13>; \ | ||
830 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(28) 0x4>; \ | ||
831 | + xlnx,gpi-interrupt = <0x1>; \ | ||
832 | + xlnx,gpi-size = <0x20>; \ | ||
833 | + xlnx,use-gpi = <0x1>; \ | ||
834 | + }; \ | ||
835 | + pmc_ppu ## X ## _io_gpi4: pmc_ppu ## X ## _gpi@2c { \ | ||
836 | + #gpio-cells = <1>; \ | ||
837 | + gpio-controller; \ | ||
838 | + compatible = "xlnx,io-gpi-1.02.a", "xlnx,io_gpi"; \ | ||
839 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
840 | + interrupts = <14>; \ | ||
841 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(2c) 0x4>; \ | ||
842 | + xlnx,gpi-interrupt = <0x1>; \ | ||
843 | + xlnx,gpi-size = <0x20>; \ | ||
844 | + xlnx,use-gpi = <0x1>; \ | ||
845 | + }; \ | ||
846 | + \ | ||
847 | + pmc_ppu ## X ## _io_gpo1: pmc_ppu ## X ## _gpo@10 { \ | ||
848 | + #gpio-cells = <1>; \ | ||
849 | + gpio-controller; \ | ||
850 | + compatible = "xlnx,io-gpo-1.02.a", "xlnx,io_gpo"; \ | ||
851 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(10) 0x4>; \ | ||
852 | + xlnx,gpo-init = <0x0>; \ | ||
853 | + xlnx,gpo-size = <0x9>; \ | ||
854 | + xlnx,use-gpo = <0x1>; \ | ||
855 | + }; \ | ||
856 | + pmc_ppu ## X ## _io_gpo2: pmc_ppu ## X ## _gpo@14 { \ | ||
857 | + #gpio-cells = <1>; \ | ||
858 | + gpio-controller; \ | ||
859 | + compatible = "xlnx,io-gpo-1.02.a", "xlnx,io_gpo"; \ | ||
860 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(14) 0x4>; \ | ||
861 | + xlnx,gpo-init = <0x0>; \ | ||
862 | + xlnx,gpo-size = <0x20>; \ | ||
863 | + xlnx,use-gpo = <0x1>; \ | ||
864 | + }; \ | ||
865 | + pmc_ppu ## X ## _io_gpo3: pmc_ppu ## X ## _gpo@18 { \ | ||
866 | + #gpio-cells = <1>; \ | ||
867 | + gpio-controller; \ | ||
868 | + compatible = "xlnx,io-gpo-1.02.a", "xlnx,io_gpo"; \ | ||
869 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(18) 0x4>; \ | ||
870 | + xlnx,gpo-init = <0x0>; \ | ||
871 | + xlnx,gpo-size = <0x20>; \ | ||
872 | + xlnx,use-gpo = <0x1>; \ | ||
873 | + }; \ | ||
874 | + pmc_ppu ## X ## _io_gpo4: pmc_ppu ## X ## _gpo@1c { \ | ||
875 | + #gpio-cells = <1>; \ | ||
876 | + gpio-controller; \ | ||
877 | + compatible = "xlnx,io-gpo-1.02.a", "xlnx,io_gpo"; \ | ||
878 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(1c) 0x4>; \ | ||
879 | + xlnx,gpo-init = <0x0>; \ | ||
880 | + xlnx,gpo-size = <0x20>; \ | ||
881 | + xlnx,use-gpo = <0x1>; \ | ||
882 | + }; \ | ||
883 | + \ | ||
884 | + pmc_ppu ## X ## _io_pit1: pmc_ppu ## X ## _pit@40 { \ | ||
885 | + compatible = "xlnx,io-pit-1.02.a", "xlnx,io_pit"; \ | ||
886 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
887 | + interrupts = <3>; \ | ||
888 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(40) 0xc>; \ | ||
889 | + xlnx,pit-interrupt = <0x1>; \ | ||
890 | + xlnx,pit-prescaler = <0x9>; \ | ||
891 | + xlnx,pit-readable = <0x1>; \ | ||
892 | + xlnx,pit-size = <0x20>; \ | ||
893 | + xlnx,use-pit = <0x1>; \ | ||
894 | + frequency = <460000000>; \ | ||
895 | + gpios = <&pmc_ppu ## X ## _io_gpo1 1 &pmc_ppu ## X ## _io_pit2 0>; \ | ||
896 | + gpio-names = "ps_config","ps_hit_in"; \ | ||
897 | + gpio-controller; \ | ||
898 | + #gpio-cells = <1>; \ | ||
899 | + }; \ | ||
900 | + pmc_ppu ## X ## _io_pit2: pmc_ppu ## X ## _pit@50 { \ | ||
901 | + compatible = "xlnx,io-pit-1.02.a", "xlnx,io_pit"; \ | ||
902 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
903 | + interrupts = <4>; \ | ||
904 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(50) 0xc>; \ | ||
905 | + xlnx,pit-interrupt = <0x1>; \ | ||
906 | + xlnx,pit-prescaler = <0x9>; \ | ||
907 | + xlnx,pit-readable = <0x1>; \ | ||
908 | + xlnx,pit-size = <0x20>; \ | ||
909 | + xlnx,use-pit = <0x1>; \ | ||
910 | + frequency = <460000000>; \ | ||
911 | + gpio-controller; \ | ||
912 | + #gpio-cells = <1>; \ | ||
913 | + }; \ | ||
914 | + pmc_ppu ## X ## _io_pit3: pmc_ppu ## X ## _pit@60 { \ | ||
915 | + compatible = "xlnx,io-pit-1.02.a", "xlnx,io_pit"; \ | ||
916 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
917 | + interrupts = <5>; \ | ||
918 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(60) 0xc>; \ | ||
919 | + xlnx,pit-interrupt = <0x1>; \ | ||
920 | + xlnx,pit-prescaler = <0x9>; \ | ||
921 | + xlnx,pit-readable = <0x1>; \ | ||
922 | + xlnx,pit-size = <0x20>; \ | ||
923 | + xlnx,use-pit = <0x1>; \ | ||
924 | + frequency = <460000000>; \ | ||
925 | + gpios = <&pmc_ppu ## X ## _io_gpo1 6 &pmc_ppu ## X ## _io_pit4 0>; \ | ||
926 | + gpio-names = "ps_config","ps_hit_in"; \ | ||
927 | + gpio-controller; \ | ||
928 | + #gpio-cells = <1>; \ | ||
929 | + }; \ | ||
930 | + pmc_ppu ## X ## _io_pit4: pmc_ppu ## X ## _pit@70 { \ | ||
931 | + compatible = "xlnx,io-pit-1.02.a", "xlnx,io_pit"; \ | ||
932 | + interrupt-parent = <&pmc_ppu ## X ## _io_intc>; \ | ||
933 | + interrupts = <6>; \ | ||
934 | + reg = <0x0 MM_PMC_PPU ## X ## _IOM(70) 0xc>; \ | ||
935 | + xlnx,pit-interrupt = <0x1>; \ | ||
936 | + xlnx,pit-prescaler = <0x9>; \ | ||
937 | + xlnx,pit-readable = <0x1>; \ | ||
938 | + xlnx,pit-size = <0x20>; \ | ||
939 | + xlnx,use-pit = <0x1>; \ | ||
940 | + frequency = <460000000>; \ | ||
941 | + gpio-controller; \ | ||
942 | + #gpio-cells = <1>; \ | ||
943 | + }; \ | ||
944 | + } | ||
945 | + | ||
946 | +/ { | ||
947 | + /* MDM UARTs. We put them here for instantiation ordering purposes | ||
948 | + * making sure that -serial command line options refer to these | ||
949 | + * first. | ||
950 | + */ | ||
951 | + ppu0_mdm_uart@MM_PMC_PPU0_MDM_HSD { | ||
952 | + doc-status = "complete"; | ||
953 | + compatible = "xlnx,xps-uartlite"; | ||
954 | + reg-extended = <&lmb_pmc_ppu0 0x0 MM_PMC_PPU0_MDM_HSD 0x0 0x10 0x1>; | ||
955 | + chardev = "serial2"; | ||
956 | + }; | ||
957 | + | ||
958 | + ppu1_mdm_uart@MM_PMC_PPU1_MDM_HSD { | ||
959 | + doc-status = "complete"; | ||
960 | + compatible = "xlnx,xps-uartlite"; | ||
961 | + reg-extended = <&lmb_pmc_ppu1 0x0 MM_PMC_PPU1_MDM_HSD 0x0 0x10 0x1>; | ||
962 | + chardev = "serial3"; | ||
963 | + }; | ||
964 | +}; | ||
965 | + | ||
966 | +&lmb_pmc_ppu0 { | ||
967 | + doc-name = "LMB PPU0"; | ||
968 | + doc-status = "complete"; | ||
969 | + CREATE_PPU_IOMOD(0); | ||
970 | +}; | ||
971 | + | ||
972 | +&lmb_pmc_ppu1 { | ||
973 | + doc-name = "LMB PPU1"; | ||
974 | + doc-status = "complete"; | ||
975 | + CREATE_PPU_IOMOD(1); | ||
976 | +}; | ||
977 | + | ||
978 | +&amba_pmc_ppu { | ||
979 | + pmc_gic_proxy: pmc_gic_proxy@0 { | ||
980 | + doc-status = "complete"; | ||
981 | + #interrupt-cells = <3>; | ||
982 | + interrupt-controller; | ||
983 | + | ||
984 | + compatible = "xlnx,zynqmp-gicp"; | ||
985 | + reg = <0x0 MM_PMC_GIC_PROXY 0x0 MM_PMC_GIC_PROXY_SIZE 0x0>; | ||
986 | + interrupt-parent = <&pmc_ppu1_io_intc>; | ||
987 | + interrupts = <IRQ_PPU1_INTC_PMC_GICP>; | ||
988 | + }; | ||
989 | +}; | ||
990 | + | ||
991 | diff --git a/versal-ps-iou-alt.dtsi b/versal-ps-iou-alt.dtsi | ||
992 | new file mode 100644 | ||
993 | index 00000000..a6c22b86 | ||
994 | --- /dev/null | ||
995 | +++ b/versal-ps-iou-alt.dtsi | ||
996 | @@ -0,0 +1,467 @@ | ||
997 | +/* | ||
998 | + * Versal PS IOU | ||
999 | + * | ||
1000 | + * Copyright (C) 2016-2022, Xilinx, Inc. | ||
1001 | + * Copyright (C) 2023, Advanced Micro Devices, Inc. | ||
1002 | + * All rights reserved. | ||
1003 | + * | ||
1004 | + * Redistribution and use in source and binary forms, with or without | ||
1005 | + * modification, are permitted provided that the following conditions are met: | ||
1006 | + * * Redistributions of source code must retain the above copyright | ||
1007 | + * notice, this list of conditions and the following disclaimer. | ||
1008 | + * * Redistributions in binary form must reproduce the above copyright | ||
1009 | + * notice, this list of conditions and the following disclaimer in the | ||
1010 | + * documentation and/or other materials provided with the distribution. | ||
1011 | + * * Neither the name of the <organization> nor the | ||
1012 | + * names of its contributors may be used to endorse or promote products | ||
1013 | + * derived from this software without specific prior written permission. | ||
1014 | + * | ||
1015 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
1016 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
1017 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
1018 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
1019 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
1020 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
1021 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
1022 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
1023 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
1024 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
1025 | + */ | ||
1026 | + | ||
1027 | +#include "versal.dtsh" | ||
1028 | + | ||
1029 | +#define GEM(g_name, g_base, g_size, g_dma, g_irq, rst_idx, pwr_idx) \ | ||
1030 | +g_name: ethernet@g_base { \ | ||
1031 | + #address-cells = <1>; \ | ||
1032 | + #size-cells = <0>; \ | ||
1033 | + #priority-cells = <0>; \ | ||
1034 | + compatible = "cdns,gem"; \ | ||
1035 | + interrupts = <g_irq g_irq>; \ | ||
1036 | + dma = <g_dma>; \ | ||
1037 | + memattr = <& ## g_name ## _memattr_smid>; \ | ||
1038 | + memattr-write = <& ## g_name ## _w_memattr_smid>; \ | ||
1039 | + reg = <0x0 g_base 0x0 g_size 0x0>; \ | ||
1040 | + num-priority-queues = <2>; \ | ||
1041 | + reset-gpios = <&crl rst_idx>; \ | ||
1042 | + power-gpios = <&psm_local pwr_idx>; \ | ||
1043 | +} | ||
1044 | + | ||
1045 | +// FIXME: Add support for SMIDs | ||
1046 | +#define ZDMA_CHANNEL(zname, zdomain, zbase, zirq, zbuswidth, zdma, mid, num) \ | ||
1047 | +zname ## _mattr: zname ## mattr { \ | ||
1048 | + compatible = "qemu:memory-transaction-attr"; \ | ||
1049 | + requester-id = <mid>; \ | ||
1050 | +}; \ | ||
1051 | + \ | ||
1052 | +zname: dma-controller@zbase { \ | ||
1053 | + compatible = "xlnx,zdma"; \ | ||
1054 | + reg = <0x0 zbase 0x0 MM_ADMA_CH0_SIZE 0x0>; \ | ||
1055 | + bus-width = <zbuswidth>; \ | ||
1056 | + has-parity = <1>; \ | ||
1057 | + interrupts = <zirq>; \ | ||
1058 | + #stream-id-cells = <0x1>; \ | ||
1059 | + dma = <zdma>; \ | ||
1060 | + memattr = <& ## zname ## _mattr>; \ | ||
1061 | + reset-gpios = < &crl CRL_RST_ADMA >; \ | ||
1062 | + #gpio-cells = <1>; \ | ||
1063 | + gpio-names = "memattr-secure"; \ | ||
1064 | + gpios = <&lpd_slcr_secure num>; \ | ||
1065 | +} | ||
1066 | + | ||
1067 | +/* | ||
1068 | + * Our XRAM model only has the correctable interrupt line. | ||
1069 | + * All instances connect to a single line in the GIC. | ||
1070 | + * | ||
1071 | + * To support shared memories for co-sim, we provide the | ||
1072 | + * actual RAMs externally and not from the XRAMC model. | ||
1073 | + */ | ||
1074 | +#define XRAM_CTRL(n) xram_ctrl_ ## n { \ | ||
1075 | + compatible = "xlnx,versal-xramc"; \ | ||
1076 | + reg = <0x0 (MM_XRAM + 0x## n ##0000) 0 0x10000 0x0 >; \ | ||
1077 | + interrupts = <XRAM_IRQ_0>; \ | ||
1078 | + alloc-ram = <0>; \ | ||
1079 | +} | ||
1080 | + | ||
1081 | +&amba_fpd { | ||
1082 | +#ifdef MM_FPD_FPD_APU | ||
1083 | + apu_ctrl: apu_ctrl@MM_FPD_FPD_APU { | ||
1084 | + compatible = "xlnx,versal-apu-ctrl"; | ||
1085 | + reg = <0x0 MM_FPD_FPD_APU 0x0 MM_FPD_FPD_APU_SIZE 0x0>; | ||
1086 | + cpu0 = <&cpu0>; | ||
1087 | + cpu1 = <&cpu1>; | ||
1088 | + #gpio-cells = <1>; | ||
1089 | + }; | ||
1090 | +#endif | ||
1091 | + | ||
1092 | + afi_fm@MM_FPD_FPD_AFIFM0 { | ||
1093 | + compatible = "xlnx,versal-afi-fm"; | ||
1094 | + reg = <0x0 MM_FPD_FPD_AFIFM0 0x0 MM_FPD_FPD_AFIFM0_SIZE 0x0>; | ||
1095 | + }; | ||
1096 | + | ||
1097 | + afi_fm@MM_FPD_FPD_AFIFM2 { | ||
1098 | + compatible = "xlnx,versal-afi-fm"; | ||
1099 | + reg = <0x0 MM_FPD_FPD_AFIFM2 0x0 MM_FPD_FPD_AFIFM2_SIZE 0x0>; | ||
1100 | + }; | ||
1101 | + | ||
1102 | +#ifdef MM_FPD_FPD_GPCCI | ||
1103 | + cci_reg@MM_FPD_FPD_GPCCI { | ||
1104 | + compatible = "xlnx,cci_reg"; | ||
1105 | + reg = <0x0 MM_FPD_FPD_GPCCI 0x0 MM_FPD_FPD_MAINCCI_SIZE 0x0>; | ||
1106 | + }; | ||
1107 | +#endif | ||
1108 | + | ||
1109 | +#ifdef MM_FPD_FPD_MAINCCI | ||
1110 | + cci500@MM_FPD_FPD_MAINCCI { | ||
1111 | + compatible = "xlnx,cci500"; | ||
1112 | + reg = <0x0 MM_FPD_FPD_MAINCCI 0x0 MM_FPD_FPD_MAINCCI_SIZE 0x0>; | ||
1113 | + }; | ||
1114 | +#endif | ||
1115 | + | ||
1116 | + cpm_crcpm@MM_CPM_CPM_CRCPM { | ||
1117 | + compatible = "xlnx,versal_cpm_crcpm"; | ||
1118 | + reg = <0x0 MM_CPM_CPM_CRCPM 0x0 MM_CPM_CPM_CRCPM_SIZE 0x0>; | ||
1119 | + }; | ||
1120 | + | ||
1121 | + cpm_pcsr@MM_CPM_CPM_PCSR { | ||
1122 | + compatible = "xlnx,versal_cpm_pcsr"; | ||
1123 | + reg = <0x0 MM_CPM_CPM_PCSR 0x0 MM_CPM_CPM_PCSR_SIZE 0x0>; | ||
1124 | + }; | ||
1125 | + | ||
1126 | + cpm_slcr_secure@MM_CPM_CPM_SLCR_SECURE { | ||
1127 | + compatible = "xlnx.cpm_slcr_secure"; | ||
1128 | + reg = <0x0 MM_CPM_CPM_SLCR_SECURE 0x0 MM_CPM_CPM_SLCR_SECURE_SIZE 0x0>; | ||
1129 | + }; | ||
1130 | + | ||
1131 | + fpd_slcr@MM_FPD_FPD_SLCR { | ||
1132 | + compatible = "xlnx,versal-fpd-slcr"; | ||
1133 | + interrupts = <SLCR_FPD_APB_IRQ_0>; | ||
1134 | + reg = <0x0 MM_FPD_FPD_SLCR 0x0 MM_FPD_FPD_SLCR_SIZE 0x0>; | ||
1135 | + }; | ||
1136 | + | ||
1137 | + fpd_slcr_secure@MM_FPD_FPD_SLCR { | ||
1138 | + compatible = "xlnx,versal-fpd-slcr-secure"; | ||
1139 | + interrupts = <SLCR_SECURE_FPD_APB_IRQ_0>; | ||
1140 | + reg = <0x0 MM_FPD_FPD_SLCR_SECURE 0x0 MM_FPD_FPD_SLCR_SECURE_SIZE 0x0>; | ||
1141 | + }; | ||
1142 | + | ||
1143 | +#ifdef MM_FPD_FPD_WWDT | ||
1144 | + wwdt0: watchdog@MM_FPD_FPD_WWDT { | ||
1145 | + compatible = "xlnx,versal-wwdt"; | ||
1146 | + reg = <0x0 MM_FPD_FPD_WWDT 0x0 MM_FPD_FPD_WWDT_SIZE 0x0>; | ||
1147 | + /* IRQ order must match the QEMU model */ | ||
1148 | + interrupts = <FP_WDT_IRQ_0 | ||
1149 | + FPD_WWDT_RST_PENDING_IRQ_0 | ||
1150 | + FPD_GWDT_WS0_IRQ_0 | ||
1151 | + FPD_GWDT_WS1_IRQ_0>; | ||
1152 | + pclk = <100000000>; | ||
1153 | + reset-gpios = <&crf 27>; | ||
1154 | + }; | ||
1155 | +#endif | ||
1156 | +#ifdef MM_FPD_INTFPD_CONFIG | ||
1157 | + intfpd: intfpd@MM_FPD_INTFPD_CONFIG { | ||
1158 | + compatible = "xlnx-intfpd-config"; | ||
1159 | + reg = <0x0 MM_FPD_INTFPD_CONFIG 0x0 MM_FPD_INTFPD_CONFIG_SIZE 0x0>; | ||
1160 | + interrupts = < | ||
1161 | + #if FPD_APB_INT_IRQ_0 | ||
1162 | + FPD_APB_INT_IRQ_0 | ||
1163 | + #elif INT_FPD_IRQ_0 | ||
1164 | + INT_FPD_IRQ_0 | ||
1165 | + #endif | ||
1166 | + >; | ||
1167 | + }; | ||
1168 | +#endif | ||
1169 | +}; | ||
1170 | + | ||
1171 | +&amba_lpd { | ||
1172 | + GEM(gem0, MM_GEM0, MM_GEM0_SIZE, &smmu_tbu0, GEM0_IRQ_0, CRL_RST_GEM0, PLR_PWR_GEM0); | ||
1173 | + GEM(gem1, MM_GEM1, MM_GEM1_SIZE, &smmu_tbu0, GEM1_IRQ_0, CRL_RST_GEM1, PLR_PWR_GEM1); | ||
1174 | + | ||
1175 | + serial0: serial@MM_UART0 { | ||
1176 | + compatible = "pl011"; | ||
1177 | + interrupts = <UART0_IRQ_0>; | ||
1178 | + reg = <0x0 MM_UART0 0x0 MM_UART0_SIZE 0x0 >; | ||
1179 | + reset-gpios = < &crl CRL_RST_UART0 >; | ||
1180 | + chardev = "serial0"; | ||
1181 | + }; | ||
1182 | + serial1: serial@MM_UART1 { | ||
1183 | + compatible = "pl011"; | ||
1184 | + interrupts = <UART1_IRQ_0>; | ||
1185 | + reg = <0x0 MM_UART1 0x0 MM_UART1_SIZE 0x0 >; | ||
1186 | + reset-gpios = < &crl CRL_RST_UART1 >; | ||
1187 | + chardev = "serial1"; | ||
1188 | + }; | ||
1189 | + | ||
1190 | + canfdbus0: canfdbus@0 { | ||
1191 | + compatible = "can-bus"; | ||
1192 | + }; | ||
1193 | + | ||
1194 | + can0: can@MM_CANFD0 { | ||
1195 | + compatible = "xlnx,versal-canfd"; | ||
1196 | + rx-fifo0 = <0x40>; | ||
1197 | + rx-fifo1 = <0x40>; | ||
1198 | + enable-rx-fifo1 = <0x1>; | ||
1199 | + canfdbus = <&canfdbus0>; | ||
1200 | + interrupts = <CAN0_IRQ_0>; | ||
1201 | + reg = <0x0 MM_CANFD0 0x0 MM_CANFD0_SIZE 0x0>; | ||
1202 | + reset-gpios = <&crl CRL_RST_CAN0>; | ||
1203 | + }; | ||
1204 | + can1: can@MM_CANFD1 { | ||
1205 | + compatible = "xlnx,versal-canfd"; | ||
1206 | + rx-fifo0 = <0x40>; | ||
1207 | + rx-fifo1 = <0x40>; | ||
1208 | + enable-rx-fifo1 = <0x1>; | ||
1209 | + canfdbus = <&canfdbus0>; | ||
1210 | + interrupts = <CAN1_IRQ_0>; | ||
1211 | + reg = <0x0 MM_CANFD1 0x0 MM_CANFD1_SIZE 0x0>; | ||
1212 | + reset-gpios = <&crl CRL_RST_CAN1>; | ||
1213 | + }; | ||
1214 | + | ||
1215 | + crl: crl@MM_CRL { | ||
1216 | + compatible = "xlnx,versal-crl"; | ||
1217 | + reg = <0x0 MM_CRL 0x0 MM_CRL_SIZE 0x0>; | ||
1218 | + gpio-controller; | ||
1219 | + #gpio-cells = <1>; | ||
1220 | + }; | ||
1221 | + | ||
1222 | + lpd_iou_slcr: slcr@MM_LPD_IOU_SLCR { | ||
1223 | + compatible = "xlnx,versal-lpd-iou-slcr"; | ||
1224 | + reg = <0x0 MM_LPD_IOU_SLCR 0x0 MM_LPD_IOU_SLCR_SIZE 0x0>; | ||
1225 | + }; | ||
1226 | + | ||
1227 | +#ifdef MM_RPU | ||
1228 | + rpu_ctrl: rpu_ctrl@MM_RPU { | ||
1229 | + compatible = "xlnx,versal-rpu"; | ||
1230 | + reg-extended = <&amba_lpd 0x0 MM_RPU 0x0 MM_RPU_SIZE 0x0 | ||
1231 | + &amba_r5_0 0x0 0x0 0x0 0x80000 0x0 | ||
1232 | + &amba 0x0 MM_R5_0_ATCM 0x0 0x60000 0x0 | ||
1233 | + &amba_r5_1 0x0 0x0 0x0 0x80000 0x0 | ||
1234 | + &amba 0x0 0xFFE90000 0x0 0x50000 0x0>; | ||
1235 | + rpu0 = <&rpu_cpu0>; | ||
1236 | + rpu1 = <&rpu_cpu1>; | ||
1237 | + | ||
1238 | + gpio-controller; | ||
1239 | + #gpio-cells = <1>; | ||
1240 | + | ||
1241 | + gpios = < &crl CRL_RST_CPU_R5_0 &crl CRL_RST_CPU_R5_1 | ||
1242 | + &psm_local 42 &psm_local 43 | ||
1243 | + >; | ||
1244 | + }; | ||
1245 | +#endif | ||
1246 | + | ||
1247 | + ipi: ipi@MM_IPI { | ||
1248 | + compatible = "xlnx,versal-ipi"; | ||
1249 | + reg = <0x0 MM_IPI 0x0 MM_IPI_SIZE 0x0>; | ||
1250 | + | ||
1251 | + /* Interrupt ordering here needs to match | ||
1252 | + * QEMU's sysbus-irq output order. */ | ||
1253 | + interrupts = <IPI_PSM_IRQ_0 | ||
1254 | + IPI_PMC_IRQ_0 | ||
1255 | + IPI0_IRQ_0 IPI1_IRQ_0 | ||
1256 | + IPI2_IRQ_0 IPI3_IRQ_0 | ||
1257 | + IPI4_IRQ_0 IPI5_IRQ_0 | ||
1258 | + IPI6_IRQ_0 | ||
1259 | + IPI_PMC_NOBUF_IRQ_0 | ||
1260 | + IPI_APB_IRQ_0>; | ||
1261 | + reset-gpios = <&crl CRL_RST_IPI>; | ||
1262 | + }; | ||
1263 | + | ||
1264 | + spi0: spi@MM_SPI0 { | ||
1265 | + compatible = "cdns,spi-r1p6"; | ||
1266 | + interrupts = <SPI0_IRQ_0>; | ||
1267 | + num-ss-bits = <4>; | ||
1268 | + reg = <0x0 MM_SPI0 0x0 MM_SPI0_SIZE 0x0 >; | ||
1269 | + | ||
1270 | + #address-cells = <1>; /* For child; must match SPI_FLASH() */ | ||
1271 | + #size-cells = <0>; | ||
1272 | + #bus-cells = <1>; | ||
1273 | + reset-gpios = <&crl CRL_RST_SPI0>; | ||
1274 | + }; | ||
1275 | + spi1: spi@MM_SPI1 { | ||
1276 | + compatible = "cdns,spi-r1p6"; | ||
1277 | + interrupts = <SPI1_IRQ_0>; | ||
1278 | + num-ss-bits = <4>; | ||
1279 | + reg = <0x0 MM_SPI1 0x0 MM_SPI1_SIZE 0x0 >; | ||
1280 | + | ||
1281 | + #address-cells = <1>; /* For child; must match SPI_FLASH() */ | ||
1282 | + #size-cells = <0>; | ||
1283 | + #bus-cells = <1>; | ||
1284 | + reset-gpios = <&crl CRL_RST_SPI1>; | ||
1285 | + }; | ||
1286 | + | ||
1287 | + dwc3_0: usb2@USB2_0_XHCI { | ||
1288 | + compatible = "usb_dwc3"; | ||
1289 | + reg = <0x0 MM_USB_DWC3_0 0x0 MM_USB_DWC3_0_SIZE 0x0 0x0 MM_USB_XHCI 0x0 MM_USB_XHCI_SIZE 0x0>; | ||
1290 | + interrupts = <USB2_IRQ_0 USB2_IRQ_1 USB2_IRQ_2 USB2_IRQ_3>; | ||
1291 | + dma = <&smmu_tbu0>; | ||
1292 | + memattr = <&usb0_memattr>; | ||
1293 | + reset-gpios = <&crl CRL_RST_USB0>; | ||
1294 | + intrs = <4>; | ||
1295 | + slots = <2>; | ||
1296 | + }; | ||
1297 | + | ||
1298 | + ttc0: timer@MM_TTC0 { | ||
1299 | + compatible = "xlnx,ps7-ttc-1.00.a"; | ||
1300 | + interrupts = <TTC0_IRQ_0 TTC0_IRQ_1 TTC0_IRQ_2>; | ||
1301 | + reg = <0x0 MM_TTC0 0x0 MM_TTC0_SIZE 0x0>; | ||
1302 | + width = <32>; | ||
1303 | + reset-gpios = < &crl CRL_RST_TTC0 >; | ||
1304 | + }; | ||
1305 | + ttc1: timer@MM_TTC1 { | ||
1306 | + compatible = "xlnx,ps7-ttc-1.00.a"; | ||
1307 | + interrupts = <TTC1_IRQ_0 TTC1_IRQ_1 TTC1_IRQ_2>; | ||
1308 | + reg = <0x0 MM_TTC1 0x0 MM_TTC1_SIZE 0x0>; | ||
1309 | + width = <32>; | ||
1310 | + reset-gpios = < &crl CRL_RST_TTC1 >; | ||
1311 | + }; | ||
1312 | + ttc2: timer@MM_TTC2 { | ||
1313 | + compatible = "xlnx,ps7-ttc-1.00.a"; | ||
1314 | + interrupts = <TTC2_IRQ_0 TTC2_IRQ_1 TTC2_IRQ_2>; | ||
1315 | + reg = <0x0 MM_TTC2 0x0 MM_TTC2_SIZE 0x0>; | ||
1316 | + width = <32>; | ||
1317 | + reset-gpios = < &crl CRL_RST_TTC2 >; | ||
1318 | + }; | ||
1319 | + ttc3: timer@MM_TTC3 { | ||
1320 | + compatible = "xlnx,ps7-ttc-1.00.a"; | ||
1321 | + interrupts = <TTC3_IRQ_0 TTC3_IRQ_1 TTC3_IRQ_2>; | ||
1322 | + reg = <0x0 MM_TTC3 0x0 MM_TTC3_SIZE 0x0>; | ||
1323 | + width = <32>; | ||
1324 | + reset-gpios = < &crl CRL_RST_TTC3 >; | ||
1325 | + }; | ||
1326 | + | ||
1327 | + ZDMA_CHANNEL(adma0, adma, MM_ADMA_CH0, ADMA_IRQ_0, 128, &smmu_tbu0, SMID_DMA0_CH0, 0x0); | ||
1328 | + ZDMA_CHANNEL(adma1, adma, MM_ADMA_CH1, ADMA_IRQ_1, 128, &smmu_tbu0, SMID_DMA0_CH1, 0x1); | ||
1329 | + ZDMA_CHANNEL(adma2, adma, MM_ADMA_CH2, ADMA_IRQ_2, 128, &smmu_tbu0, SMID_DMA0_CH2, 0x2); | ||
1330 | + ZDMA_CHANNEL(adma3, adma, MM_ADMA_CH3, ADMA_IRQ_3, 128, &smmu_tbu0, SMID_DMA0_CH3, 0x3); | ||
1331 | + ZDMA_CHANNEL(adma4, adma, MM_ADMA_CH4, ADMA_IRQ_4, 128, &smmu_tbu0, SMID_DMA0_CH4, 0x4); | ||
1332 | + ZDMA_CHANNEL(adma5, adma, MM_ADMA_CH5, ADMA_IRQ_5, 128, &smmu_tbu0, SMID_DMA0_CH5, 0x5); | ||
1333 | + ZDMA_CHANNEL(adma6, adma, MM_ADMA_CH6, ADMA_IRQ_6, 128, &smmu_tbu0, SMID_DMA0_CH6, 0x6); | ||
1334 | + ZDMA_CHANNEL(adma7, adma, MM_ADMA_CH7, ADMA_IRQ_7, 128, &smmu_tbu0, SMID_DMA0_CH7, 0x7); | ||
1335 | + | ||
1336 | + afi_fm@MM_LPD_AFIFM4 { | ||
1337 | + compatible = "xlnx,versal-afi-fm"; | ||
1338 | + reg = <0x0 MM_LPD_AFIFM4 0x0 MM_LPD_AFIFM4_SIZE 0x0>; | ||
1339 | + }; | ||
1340 | + | ||
1341 | + lpd_i2c_wrapper { | ||
1342 | +#ifdef MM_PS_I2C0 | ||
1343 | + ps_i2c0: ps_i2c0@MM_PS_I2C0 { | ||
1344 | + #address-cells = <1>; | ||
1345 | + #size-cells = <0>; | ||
1346 | + compatible = "xlnx,ps7-i2c-1.00.a", "cdns,i2c-r1p10"; | ||
1347 | + interrupts = <I2C0_IRQ_0>; | ||
1348 | + reg-extended = <&amba_lpd 0x0 MM_PS_I2C0 0x0 MM_PS_I2C0_SIZE 0x0>; | ||
1349 | + reset-gpios = <&crl CRL_RST_I2C0>; | ||
1350 | + }; | ||
1351 | + ps_i2c1: ps_i2c0@MM_PS_I2C1 { | ||
1352 | + #address-cells = <1>; | ||
1353 | + #size-cells = <0>; | ||
1354 | + compatible = "xlnx,ps7-i2c-1.00.a", "cdns,i2c-r1p10"; | ||
1355 | + interrupts = <I2C1_IRQ_0>; | ||
1356 | + reg-extended = <&amba_lpd 0x0 MM_PS_I2C1 0x0 MM_PS_I2C1_SIZE 0x0>; | ||
1357 | + reset-gpios = <&crl CRL_RST_I2C1>; | ||
1358 | + }; | ||
1359 | +#endif | ||
1360 | + }; | ||
1361 | + | ||
1362 | + ocm_ctrl0: ocm_ctrl@OCM { | ||
1363 | + compatible = "xlnx,zynqmp-ocmc"; | ||
1364 | + interrupts = <OCMINTR_IRQ_0>; | ||
1365 | + memsize = <MM_OCM_MEM_SIZE>; | ||
1366 | + reg = <0x0 MM_OCM 0x0 MM_OCM_SIZE 0x0>; | ||
1367 | + reset-gpios = <&crl CRL_RST_OCM>; | ||
1368 | + }; | ||
1369 | + | ||
1370 | +#ifdef MM_XRAM_SLCR | ||
1371 | + xram_slcr@MM_XRAM_SLCR { | ||
1372 | + compatible = "xlnx,xram_slcr"; | ||
1373 | + reg = <0x0 MM_XRAM_SLCR 0x0 MM_XRAM_SLCR_SIZE 0x0>; | ||
1374 | + }; | ||
1375 | +#endif | ||
1376 | + | ||
1377 | + lpd_slcr@MM_LPD_SLCR { | ||
1378 | + compatible = "xlnx,versal-lpd-slcr"; | ||
1379 | + reg = <0x0 MM_LPD_SLCR 0x0 MM_LPD_SLCR_SIZE 0x0>; | ||
1380 | + }; | ||
1381 | + | ||
1382 | + lpd_slcr_secure: lpd_slcr_secure@MM_LPD_SLCR_SECURE { | ||
1383 | + compatible = "xlnx,versal-lpd-slcr-secure"; | ||
1384 | + reg = <0x0 MM_LPD_SLCR_SECURE 0x0 MM_LPD_SLCR_SECURE_SIZE 0x0>; | ||
1385 | + gpio-controller; | ||
1386 | + #gpio-cells = <1>; | ||
1387 | + }; | ||
1388 | + | ||
1389 | + lpd_iou_slcr_secure: lpd_iou_slcr_secure@MM_LPD_IOU_SECURE_SLCR { | ||
1390 | + compatible = "xlnx,versal-lpd-iou-slcr-secure"; | ||
1391 | + reg = <0x0 MM_LPD_IOU_SECURE_SLCR 0x0 MM_LPD_IOU_SECURE_SLCR_SIZE 0x0>; | ||
1392 | + memattr-gem0 = <&gem0_memattr_smid>; | ||
1393 | + memattr-write-gem0 = <&gem0_w_memattr_smid>; | ||
1394 | + memattr-gem1 = <&gem1_memattr_smid>; | ||
1395 | + memattr-write-gem1 = <&gem1_w_memattr_smid>; | ||
1396 | + }; | ||
1397 | + | ||
1398 | +#ifdef MM_WWDT | ||
1399 | + lpd_wwdt: wwdt@MM_WWDT { | ||
1400 | + compatible = "xlnx,versal-wwdt"; | ||
1401 | + reg = <0x0 MM_WWDT 0x0 MM_WWDT_SIZE 0x0>; | ||
1402 | + /* IRQ order must match the QEMU model */ | ||
1403 | + interrupts = <WWDT_IRQ_0 | ||
1404 | + WWDT_RST_PENDING_IRQ_0 | ||
1405 | + GWDT_WS0_IRQ_0 | ||
1406 | + GWDT_WS1_IRQ_0>; | ||
1407 | + pclk = <100000000>; | ||
1408 | + reset-gpios = <&crl CRL_RST_SWDT>; | ||
1409 | + }; | ||
1410 | +#endif | ||
1411 | + | ||
1412 | + lpd_gpio: lpd_gpio@MM_PS_GPIO { | ||
1413 | + #gpio-cells = <1>; | ||
1414 | + compatible = "xlnx,zynqmp-gpio"; | ||
1415 | + gpio-controller; | ||
1416 | + interrupts = <GPIO_IRQ_0>; | ||
1417 | + reg = <0x0 MM_PS_GPIO 0x0 MM_PS_GPIO_SIZE 0x0>; | ||
1418 | + reset-gpios = < &crl CRL_RST_GPIO >; | ||
1419 | + }; | ||
1420 | +#ifdef MM_INTLPD_CONFIG | ||
1421 | + intlpd: intlpd@MM_INTLPD_CONFIG { | ||
1422 | + compatible = "xlnx-intlpd-config"; | ||
1423 | + reg = <0x0 MM_INTLPD_CONFIG 0x0 MM_INTLPD_CONFIG_SIZE 0x0>; | ||
1424 | + interrupts = <INT_LPD_IRQ_0>; | ||
1425 | + }; | ||
1426 | +#endif | ||
1427 | +}; | ||
1428 | + | ||
1429 | +&amba_xram { | ||
1430 | + XRAM_CTRL(0); | ||
1431 | + XRAM_CTRL(1); | ||
1432 | + XRAM_CTRL(2); | ||
1433 | + XRAM_CTRL(3); | ||
1434 | +}; | ||
1435 | + | ||
1436 | +&amba_root { | ||
1437 | + /* These devices need to be created before the CPUs. */ | ||
1438 | + crf: crf@MM_FPD_CRF { | ||
1439 | + compatible = "xlnx,versal-crf"; | ||
1440 | + reg-extended = <&amba_fpd 0x0 MM_FPD_CRF 0x0 MM_FPD_CRF_SIZE 0x0>; | ||
1441 | + gpio-controller; | ||
1442 | + #gpio-cells = <1>; | ||
1443 | + }; | ||
1444 | +}; | ||
1445 | + | ||
1446 | +/ { | ||
1447 | + /* Reset domains. */ | ||
1448 | + lpd_reset_domain@0 { | ||
1449 | + compatible = "qemu,reset-domain"; | ||
1450 | + mr0 = <&amba_lpd>; | ||
1451 | + reset-gpios = < &pmc_clk_rst CRP_RST_PS_PS_SRST | ||
1452 | + &pmc_clk_rst CRP_RST_PS_PS_POR >; | ||
1453 | + }; | ||
1454 | + | ||
1455 | + fpd_reset_domain@0 { | ||
1456 | + compatible = "qemu,reset-domain"; | ||
1457 | + mr0 = <&amba_fpd>; | ||
1458 | + reset-gpios = < &pmc_clk_rst CRP_RST_PS_PS_SRST | ||
1459 | + &pmc_clk_rst CRP_RST_PS_PS_POR | ||
1460 | + &crl CRL_RST_FPD_POR | ||
1461 | + &crl CRL_RST_FPD_SRST >; | ||
1462 | + }; | ||
1463 | +}; | ||
1464 | -- | ||
1465 | 2.34.1 | ||
1466 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-net-Reorder-serial-port.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-net-Reorder-serial-port.patch new file mode 100644 index 00000000..97262ae4 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees/0001-versal-net-Reorder-serial-port.patch | |||
@@ -0,0 +1,291 @@ | |||
1 | From 58fdfde013dfabf3a9f2c83525c00a6f057768f1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Hatle <mark.hatle@amd.com> | ||
3 | Date: Fri, 4 Oct 2024 15:49:46 -0600 | ||
4 | Subject: [PATCH] versal-net: Reorder serial port | ||
5 | |||
6 | This commit requires the corresponding "versal: Reorder serial ports" | ||
7 | |||
8 | This change affects the order of the serial ports when calling qemu. | ||
9 | Previously the serial ports 0 & 1 were the PMC (firmware) uartlite, | ||
10 | while the standard serial pors were 2 & 3. Reverse this order to | ||
11 | ensure that the first two serial ports are the ones used by Linux. | ||
12 | |||
13 | Signed-off-by: Mark Hatle <mark.hatle@amd.com> | ||
14 | --- | ||
15 | board-versal-net-psx-spp-1.4-alt.dts | 36 ++++++++ | ||
16 | board-versal-net-psx-virt-alt.dts | 130 +++++++++++++++++++++++++++ | ||
17 | board-versal-pmx-virt-alt.dts | 82 +++++++++++++++++ | ||
18 | 3 files changed, 248 insertions(+) | ||
19 | create mode 100644 board-versal-net-psx-spp-1.4-alt.dts | ||
20 | create mode 100644 board-versal-net-psx-virt-alt.dts | ||
21 | create mode 100644 board-versal-pmx-virt-alt.dts | ||
22 | |||
23 | diff --git a/board-versal-net-psx-spp-1.4-alt.dts b/board-versal-net-psx-spp-1.4-alt.dts | ||
24 | new file mode 100644 | ||
25 | index 00000000..770a388e | ||
26 | --- /dev/null | ||
27 | +++ b/board-versal-net-psx-spp-1.4-alt.dts | ||
28 | @@ -0,0 +1,36 @@ | ||
29 | +/* | ||
30 | + * Versal Net PSX device tree. | ||
31 | + * | ||
32 | + * Copyright (c) 2022, Xilinx Inc | ||
33 | + * All rights reserved. | ||
34 | + * | ||
35 | + * Redistribution and use in source and binary forms, with or without | ||
36 | + * modification, are permitted provided that the following conditions are met: | ||
37 | + * * Redistributions of source code must retain the above copyright | ||
38 | + * notice, this list of conditions and the following disclaimer. | ||
39 | + * * Redistributions in binary form must reproduce the above copyright | ||
40 | + * notice, this list of conditions and the following disclaimer in the | ||
41 | + * documentation and/or other materials provided with the distribution. | ||
42 | + * * Neither the name of the <organization> nor the | ||
43 | + * names of its contributors may be used to endorse or promote products | ||
44 | + * derived from this software without specific prior written permission. | ||
45 | + * | ||
46 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
47 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
48 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
49 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
50 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
51 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
52 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
53 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
54 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
55 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
56 | + */ | ||
57 | + | ||
58 | +#define VERSAL_NET_APU_CPU_FREQ 100000000 | ||
59 | + | ||
60 | +#include "board-versal-net-psx-virt-alt.dts" | ||
61 | + | ||
62 | +&pmc_tap { | ||
63 | + platform-ver = <0x5>; | ||
64 | +}; | ||
65 | diff --git a/board-versal-net-psx-virt-alt.dts b/board-versal-net-psx-virt-alt.dts | ||
66 | new file mode 100644 | ||
67 | index 00000000..7ee4ad9d | ||
68 | --- /dev/null | ||
69 | +++ b/board-versal-net-psx-virt-alt.dts | ||
70 | @@ -0,0 +1,130 @@ | ||
71 | +/* | ||
72 | + * Versal-Net Virtual PSX board device tree. | ||
73 | + * | ||
74 | + * Copyright (c) 2021-2022, Xilinx Inc. | ||
75 | + * Copyright (C) 2022-2024, Advanced Micro Devices, Inc. | ||
76 | + * All rights reserved. | ||
77 | + * | ||
78 | + * Redistribution and use in source and binary forms, with or without | ||
79 | + * modification, are permitted provided that the following conditions are met: | ||
80 | + * * Redistributions of source code must retain the above copyright | ||
81 | + * notice, this list of conditions and the following disclaimer. | ||
82 | + * * Redistributions in binary form must reproduce the above copyright | ||
83 | + * notice, this list of conditions and the following disclaimer in the | ||
84 | + * documentation and/or other materials provided with the distribution. | ||
85 | + * * Neither the name of the <organization> nor the | ||
86 | + * names of its contributors may be used to endorse or promote products | ||
87 | + * derived from this software without specific prior written permission. | ||
88 | + * | ||
89 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
90 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
91 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
92 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
93 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
94 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
95 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
96 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
97 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
98 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
99 | + */ | ||
100 | + | ||
101 | +#ifndef NUM_APUS | ||
102 | +#define NUM_APUS 16 | ||
103 | +#endif | ||
104 | +#define VERSAL_NET_APU_CPU_FREQ 100000000 | ||
105 | + | ||
106 | +#define NUM_APUS_PER_CLUSTER 4 | ||
107 | + | ||
108 | +#define VERSAL_NPI_GENERIC | ||
109 | +#define VERSAL_PSX | ||
110 | +#define VERSAL_NET | ||
111 | +#define VERSAL_NPI_OVERRIDE | ||
112 | + | ||
113 | +/* TODO: Add GIC interrupt redirection support. */ | ||
114 | +#define RPU_GIC_INTERRUPT_TARGET_STEM rpu_cpu | ||
115 | + | ||
116 | +#define APU_CPU_MODEL "cortex-a78-arm-cpu" | ||
117 | +#define RPU_CPU_MODEL "cortex-r52-arm-cpu" | ||
118 | + | ||
119 | +#include "include/versal-net/npi-memmap.dtsh" | ||
120 | +#include "include/versal-net/fpd-memmap.dtsh" | ||
121 | +#include "board-versal-ps-virt-alt.dts" | ||
122 | +#include "versal-psx.dtsi" | ||
123 | +#include "versal-net-psmx.dtsi" | ||
124 | +#include "versal-psx-rpu.dtsi" | ||
125 | +#include "versal-net-boot-init.dtsi" | ||
126 | +#include "versal-net-hnic.dtsi" | ||
127 | +#include "versal-pmx-shared-overlay.dtsi" | ||
128 | +#include "versal-pmx-system-overlay.dtsi" | ||
129 | +#include "versal-psx-shared-overlay.dtsi" | ||
130 | + | ||
131 | +#ifndef VERSAL_NET_APU_CPU_FREQ | ||
132 | + #define VERSAL_NET_APU_CPU_FREQ 2720000 | ||
133 | +#endif | ||
134 | + | ||
135 | +#define SET_CPU_FREQ(n, f) \ | ||
136 | +&cpu ## n { \ | ||
137 | + generic-timer-frequency = <f>; \ | ||
138 | +} | ||
139 | + | ||
140 | +SET_CPU_FREQ(0, VERSAL_NET_APU_CPU_FREQ); | ||
141 | +SET_CPU_FREQ(1, VERSAL_NET_APU_CPU_FREQ); | ||
142 | +SET_CPU_FREQ(2, VERSAL_NET_APU_CPU_FREQ); | ||
143 | +SET_CPU_FREQ(3, VERSAL_NET_APU_CPU_FREQ); | ||
144 | +SET_CPU_FREQ(4, VERSAL_NET_APU_CPU_FREQ); | ||
145 | +SET_CPU_FREQ(5, VERSAL_NET_APU_CPU_FREQ); | ||
146 | +SET_CPU_FREQ(6, VERSAL_NET_APU_CPU_FREQ); | ||
147 | +SET_CPU_FREQ(7, VERSAL_NET_APU_CPU_FREQ); | ||
148 | +#if (NUM_APUS >= 16) | ||
149 | +SET_CPU_FREQ(8, VERSAL_NET_APU_CPU_FREQ); | ||
150 | +SET_CPU_FREQ(9, VERSAL_NET_APU_CPU_FREQ); | ||
151 | +SET_CPU_FREQ(10,VERSAL_NET_APU_CPU_FREQ); | ||
152 | +SET_CPU_FREQ(11,VERSAL_NET_APU_CPU_FREQ); | ||
153 | +SET_CPU_FREQ(12,VERSAL_NET_APU_CPU_FREQ); | ||
154 | +SET_CPU_FREQ(13,VERSAL_NET_APU_CPU_FREQ); | ||
155 | +SET_CPU_FREQ(14,VERSAL_NET_APU_CPU_FREQ); | ||
156 | +SET_CPU_FREQ(15,VERSAL_NET_APU_CPU_FREQ); | ||
157 | +#endif | ||
158 | +#if (NUM_APUS >= 32) | ||
159 | +SET_CPU_FREQ(16, VERSAL_NET_APU_CPU_FREQ); | ||
160 | +SET_CPU_FREQ(17, VERSAL_NET_APU_CPU_FREQ); | ||
161 | +SET_CPU_FREQ(18, VERSAL_NET_APU_CPU_FREQ); | ||
162 | +SET_CPU_FREQ(19, VERSAL_NET_APU_CPU_FREQ); | ||
163 | +SET_CPU_FREQ(20, VERSAL_NET_APU_CPU_FREQ); | ||
164 | +SET_CPU_FREQ(21, VERSAL_NET_APU_CPU_FREQ); | ||
165 | +SET_CPU_FREQ(22, VERSAL_NET_APU_CPU_FREQ); | ||
166 | +SET_CPU_FREQ(23, VERSAL_NET_APU_CPU_FREQ); | ||
167 | +SET_CPU_FREQ(24, VERSAL_NET_APU_CPU_FREQ); | ||
168 | +SET_CPU_FREQ(25, VERSAL_NET_APU_CPU_FREQ); | ||
169 | +SET_CPU_FREQ(26, VERSAL_NET_APU_CPU_FREQ); | ||
170 | +SET_CPU_FREQ(27, VERSAL_NET_APU_CPU_FREQ); | ||
171 | +SET_CPU_FREQ(28, VERSAL_NET_APU_CPU_FREQ); | ||
172 | +SET_CPU_FREQ(29, VERSAL_NET_APU_CPU_FREQ); | ||
173 | +SET_CPU_FREQ(30, VERSAL_NET_APU_CPU_FREQ); | ||
174 | +SET_CPU_FREQ(31, VERSAL_NET_APU_CPU_FREQ); | ||
175 | +#endif | ||
176 | + | ||
177 | +&rpu_ctrl_a { | ||
178 | + tcm-mr = <&s_axi_tcm_a>; | ||
179 | +}; | ||
180 | +&rpu_ctrl_a0 { | ||
181 | + core = <&rpu_cpu0>; | ||
182 | +}; | ||
183 | +&rpu_ctrl_a1 { | ||
184 | + core = <&rpu_cpu1>; | ||
185 | +}; | ||
186 | + | ||
187 | +&rpu_ctrl_b { | ||
188 | + tcm-mr = <&s_axi_tcm_b>; | ||
189 | +}; | ||
190 | +&rpu_ctrl_b0 { | ||
191 | + core = <&rpu_cpu2>; | ||
192 | +}; | ||
193 | +&rpu_ctrl_b1 { | ||
194 | + core = <&rpu_cpu3>; | ||
195 | +}; | ||
196 | + | ||
197 | +&pmc_tap { | ||
198 | + idcode = <0x14D80093>; | ||
199 | + platform-ver = <0x5>; | ||
200 | +}; | ||
201 | diff --git a/board-versal-pmx-virt-alt.dts b/board-versal-pmx-virt-alt.dts | ||
202 | new file mode 100644 | ||
203 | index 00000000..7a4679d0 | ||
204 | --- /dev/null | ||
205 | +++ b/board-versal-pmx-virt-alt.dts | ||
206 | @@ -0,0 +1,82 @@ | ||
207 | +/* | ||
208 | + * Versal Virtual PMC board device tree | ||
209 | + * | ||
210 | + * Copyright (c) 2016, Xilinx Inc | ||
211 | + * All rights reserved. | ||
212 | + * | ||
213 | + * Redistribution and use in source and binary forms, with or without | ||
214 | + * modification, are permitted provided that the following conditions are met: | ||
215 | + * * Redistributions of source code must retain the above copyright | ||
216 | + * notice, this list of conditions and the following disclaimer. | ||
217 | + * * Redistributions in binary form must reproduce the above copyright | ||
218 | + * notice, this list of conditions and the following disclaimer in the | ||
219 | + * documentation and/or other materials provided with the distribution. | ||
220 | + * * Neither the name of the <organization> nor the | ||
221 | + * names of its contributors may be used to endorse or promote products | ||
222 | + * derived from this software without specific prior written permission. | ||
223 | + * | ||
224 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
225 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
226 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
227 | + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY | ||
228 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
229 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
230 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
231 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
232 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
233 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
234 | + */ | ||
235 | + | ||
236 | +#define VERSAL_PMX | ||
237 | +#define VERSAL_NET | ||
238 | +#define NUM_APUS 16 | ||
239 | +#define NUM_APUS_PER_CLUSTER 4 | ||
240 | +#define VERSAL_NPI_OVERRIDE | ||
241 | + | ||
242 | +#include "include/versal-net/npi-memmap.dtsh" | ||
243 | +#include "include/versal-net/fpd-memmap.dtsh" | ||
244 | +#include "board-versal-pmc-virt-alt.dts" | ||
245 | +#include "versal-pmx-shared-overlay.dtsi" | ||
246 | + | ||
247 | +#ifndef MULTI_ARCH | ||
248 | +/* | ||
249 | + * The single-arch setup has the entire system except | ||
250 | + * the ARM cores. So we need to add the missing dummy | ||
251 | + * ARM cores (pmc-virt.dts already has 0 - 1) and include | ||
252 | + * the PSX and PMX system overlays. | ||
253 | + */ | ||
254 | +#include "versal-pmx-system-overlay.dtsi" | ||
255 | +#include "versal-psx.dtsi" | ||
256 | +#include "versal-psx-shared-overlay.dtsi" | ||
257 | +#include "versal-net-psmx.dtsi" | ||
258 | + | ||
259 | +/ { | ||
260 | + /* Dummy APUs. */ | ||
261 | + cpu2: apu@2 { }; | ||
262 | + cpu3: apu@3 { }; | ||
263 | + cpu4: apu@4 { }; | ||
264 | + cpu5: apu@5 { }; | ||
265 | + cpu6: apu@6 { }; | ||
266 | + cpu7: apu@7 { }; | ||
267 | +#if (NUM_APUS >= 16) | ||
268 | + cpu8: apu@8 { }; | ||
269 | + cpu9: apu@9 { }; | ||
270 | + cpu10: apu@10 { }; | ||
271 | + cpu11: apu@11 { }; | ||
272 | + cpu12: apu@12 { }; | ||
273 | + cpu13: apu@13 { }; | ||
274 | + cpu14: apu@14 { }; | ||
275 | + cpu15: apu@15 { }; | ||
276 | +#endif | ||
277 | + /* Dummy GICs. */ | ||
278 | + rpu_gic_a: rpu_gic_a@0 { | ||
279 | + gpio_controller ; | ||
280 | + #gpio-cells = <1>; | ||
281 | + }; | ||
282 | + | ||
283 | + rpu_gic_b: rpu_gic_b@0 { | ||
284 | + gpio_controller ; | ||
285 | + #gpio-cells = <1>; | ||
286 | + }; | ||
287 | +}; | ||
288 | +#endif | ||
289 | -- | ||
290 | 2.34.1 | ||
291 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.1.bb deleted file mode 100644 index d10504d3..00000000 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.1.bb +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | |||
2 | require qemu-devicetrees.inc | ||
3 | |||
4 | BRANCH ?= "xlnx_rel_v2024.1" | ||
5 | SRCREV ?= "b9c88cbfaaa0c8b8be70ea3c74f4cb69fb02a080" | ||
6 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.2.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.2.bb new file mode 100644 index 00000000..5780aed1 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.2.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | |||
2 | require qemu-devicetrees.inc | ||
3 | |||
4 | BRANCH ?= "xlnx_rel_v2024.2" | ||
5 | SRCREV ?= "a6eeb7ec0fdb765ab0057d95eb6201d97359eff9" | ||
6 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc index 179903c5..da62c8b7 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc | |||
@@ -8,8 +8,8 @@ COMPATIBLE_HOST:arm = "null" | |||
8 | # x86_64 is needed to build nativesdks | 8 | # x86_64 is needed to build nativesdks |
9 | QEMU_TARGETS = "aarch64 arm microblaze microblazeel riscv32 x86_64" | 9 | QEMU_TARGETS = "aarch64 arm microblaze microblazeel riscv32 x86_64" |
10 | 10 | ||
11 | BRANCH = "xlnx_rel_v2024.1" | 11 | BRANCH = "xlnx_rel_v2024.2" |
12 | SRCREV = "2319c870e754148ec3b9d40be0d3dbee959c3251" | 12 | SRCREV = "01482fa113dcbfa785feb7d513df50d15ec4c5df" |
13 | 13 | ||
14 | LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ | 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ |
15 | file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f" | 15 | file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f" |
@@ -72,6 +72,13 @@ SRC_URI += "\ | |||
72 | # Patch doesn't apply to 8.1.0 | 72 | # Patch doesn't apply to 8.1.0 |
73 | # file://fixmips.patch | 73 | # file://fixmips.patch |
74 | 74 | ||
75 | # Additional patches to match Scarthgap, which requires a slightly newer qmp interface | ||
76 | SRC_URI += "\ | ||
77 | file://0001-python-rename-QEMUMonitorProtocol.cmd-to-cmd_raw.patch \ | ||
78 | file://0002-python-qemu-rename-command-to-cmd.patch \ | ||
79 | " | ||
80 | |||
81 | |||
75 | S = "${WORKDIR}/git" | 82 | S = "${WORKDIR}/git" |
76 | 83 | ||
77 | # Based on qemu settings in poky/meta/conf/distro/include/no-static-libs.inc | 84 | # Based on qemu settings in poky/meta/conf/distro/include/no-static-libs.inc |