1
(series fully reviewed)
2
3
Since v7:
4
- Corrected commit descriptions
5
- Consider TARGET_BIG_ENDIAN for petalogix-ml605 machine (Thomas)
6
- Remove pointless QAPI description (Markus)
7
1
Since v6:
8
Since v6:
2
- Simplify MemoryRegionOps indexing (Thomas)
9
- Simplify MemoryRegionOps indexing (Thomas)
3
10
4
Since v5:
11
Since v5:
5
- Introduce QAPI EndianMode
12
- Introduce QAPI EndianMode
...
...
17
- Make device endianness configurable (Edgar)
24
- Make device endianness configurable (Edgar)
18
- Convert more Xilinx devices
25
- Convert more Xilinx devices
19
- Avoid preprocessor #if (Richard)
26
- Avoid preprocessor #if (Richard)
20
- Add R-b tags
27
- Add R-b tags
21
28
22
Philippe Mathieu-Daudé (10):
29
Philippe Mathieu-Daudé (6):
23
hw/qdev-properties-system: Introduce EndianMode QAPI enum
30
hw/qdev-properties-system: Introduce EndianMode QAPI enum
24
hw/intc/xilinx_intc: Make device endianness configurable
31
hw/intc/xilinx_intc: Make device endianness configurable
25
hw/net/xilinx_ethlite: Make device endianness configurable
32
hw/net/xilinx_ethlite: Make device endianness configurable
26
hw/timer/xilinx_timer: Make device endianness configurable
33
hw/timer/xilinx_timer: Make device endianness configurable
27
hw/char/xilinx_uartlite: Make device endianness configurable
34
hw/char/xilinx_uartlite: Make device endianness configurable
28
hw/ssi/xilinx_spi: Make device endianness configurable
35
hw/ssi/xilinx_spi: Make device endianness configurable
29
tests/functional: Explicit endianness of microblaze assets
30
tests/functional: Allow microblaze tests to take a machine name
31
argument
32
tests/functional: Remove sleep() kludges from microblaze tests
33
tests/functional: Have microblaze tests inherit common parent class
34
36
35
qapi/common.json | 16 +++++
37
qapi/common.json | 14 ++++++
36
include/hw/qdev-properties-system.h | 7 +++
38
include/hw/qdev-properties-system.h | 7 +++
37
hw/char/xilinx_uartlite.c | 34 +++++++----
39
hw/char/xilinx_uartlite.c | 34 +++++++++-----
38
hw/core/qdev-properties-system.c | 11 ++++
40
hw/core/qdev-properties-system.c | 11 +++++
39
hw/intc/xilinx_intc.c | 59 ++++++++++++++-----
41
hw/intc/xilinx_intc.c | 59 ++++++++++++++++++------
40
hw/microblaze/petalogix_ml605_mmu.c | 3 +
42
hw/microblaze/petalogix_ml605_mmu.c | 5 ++
41
hw/microblaze/petalogix_s3adsp1800_mmu.c | 6 ++
43
hw/microblaze/petalogix_s3adsp1800_mmu.c | 6 +++
42
hw/net/xilinx_ethlite.c | 29 +++++++--
44
hw/net/xilinx_ethlite.c | 29 +++++++++---
43
hw/ppc/virtex_ml507.c | 2 +
45
hw/ppc/virtex_ml507.c | 2 +
44
hw/riscv/microblaze-v-generic.c | 5 ++
46
hw/riscv/microblaze-v-generic.c | 5 ++
45
hw/ssi/xilinx_spi.c | 32 +++++++---
47
hw/ssi/xilinx_spi.c | 32 +++++++++----
46
hw/timer/xilinx_timer.c | 43 ++++++++++----
48
hw/timer/xilinx_timer.c | 43 +++++++++++------
47
.../functional/test_microblaze_s3adsp1800.py | 34 +++++++++--
49
12 files changed, 194 insertions(+), 53 deletions(-)
48
.../test_microblazeel_s3adsp1800.py | 32 ++--------
49
14 files changed, 229 insertions(+), 84 deletions(-)
50
50
51
--
51
--
52
2.47.1
52
2.47.1
53
53
54
54
diff view generated by jsdifflib
1
Introduce the EndianMode type and the DEFINE_PROP_ENDIAN() macros.
1
Introduce the EndianMode type and the DEFINE_PROP_ENDIAN() macros.
2
Endianness can be BIG, LITTLE or unspecified (default).
2
Endianness can be BIG, LITTLE or unspecified (default).
3
3
4
Reviewed-by: Thomas Huth <thuth@redhat.com>
4
Reviewed-by: Thomas Huth <thuth@redhat.com>
5
Acked-by: Markus Armbruster <armbru@redhat.com>
5
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6
---
7
---
7
qapi/common.json | 16 ++++++++++++++++
8
qapi/common.json | 14 ++++++++++++++
8
include/hw/qdev-properties-system.h | 7 +++++++
9
include/hw/qdev-properties-system.h | 7 +++++++
9
hw/core/qdev-properties-system.c | 11 +++++++++++
10
hw/core/qdev-properties-system.c | 11 +++++++++++
10
3 files changed, 34 insertions(+)
11
3 files changed, 32 insertions(+)
11
12
12
diff --git a/qapi/common.json b/qapi/common.json
13
diff --git a/qapi/common.json b/qapi/common.json
13
index XXXXXXX..XXXXXXX 100644
14
index XXXXXXX..XXXXXXX 100644
14
--- a/qapi/common.json
15
--- a/qapi/common.json
15
+++ b/qapi/common.json
16
+++ b/qapi/common.json
...
...
18
{ 'struct': 'HumanReadableText',
19
{ 'struct': 'HumanReadableText',
19
'data': { 'human-readable-text': 'str' } }
20
'data': { 'human-readable-text': 'str' } }
20
+
21
+
21
+##
22
+##
22
+# @EndianMode:
23
+# @EndianMode:
23
+#
24
+# An enumeration of three options: little, big, and unspecified
25
+#
24
+#
26
+# @unspecified: Endianness not specified
25
+# @unspecified: Endianness not specified
27
+#
26
+#
28
+# @little: Little endianness
27
+# @little: Little endianness
29
+#
28
+#
...
...
diff view generated by jsdifflib
1
Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair
1
Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair of
2
of DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN.
2
DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN.
3
Add the "little-endian" property to select the device
3
4
endianness, defaulting to little endian.
4
Add the "endianness" property to select the device endianness.
5
This property is unspecified by default, and machines need to
6
make it explicit.
7
5
Set the proper endianness for each machine using the device.
8
Set the proper endianness for each machine using the device.
6
9
10
Reviewed-by: Thomas Huth <thuth@redhat.com>
7
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
11
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
8
---
12
---
9
hw/intc/xilinx_intc.c | 59 ++++++++++++++++++------
13
hw/intc/xilinx_intc.c | 59 ++++++++++++++++++------
10
hw/microblaze/petalogix_ml605_mmu.c | 1 +
14
hw/microblaze/petalogix_ml605_mmu.c | 3 ++
11
hw/microblaze/petalogix_s3adsp1800_mmu.c | 3 ++
15
hw/microblaze/petalogix_s3adsp1800_mmu.c | 3 ++
12
hw/ppc/virtex_ml507.c | 1 +
16
hw/ppc/virtex_ml507.c | 1 +
13
hw/riscv/microblaze-v-generic.c | 1 +
17
hw/riscv/microblaze-v-generic.c | 1 +
14
5 files changed, 51 insertions(+), 14 deletions(-)
18
5 files changed, 53 insertions(+), 14 deletions(-)
15
19
16
diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c
20
diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c
17
index XXXXXXX..XXXXXXX 100644
21
index XXXXXXX..XXXXXXX 100644
18
--- a/hw/intc/xilinx_intc.c
22
--- a/hw/intc/xilinx_intc.c
19
+++ b/hw/intc/xilinx_intc.c
23
+++ b/hw/intc/xilinx_intc.c
...
...
130
diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c
134
diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c
131
index XXXXXXX..XXXXXXX 100644
135
index XXXXXXX..XXXXXXX 100644
132
--- a/hw/microblaze/petalogix_ml605_mmu.c
136
--- a/hw/microblaze/petalogix_ml605_mmu.c
133
+++ b/hw/microblaze/petalogix_ml605_mmu.c
137
+++ b/hw/microblaze/petalogix_ml605_mmu.c
134
@@ -XXX,XX +XXX,XX @@ petalogix_ml605_init(MachineState *machine)
138
@@ -XXX,XX +XXX,XX @@ petalogix_ml605_init(MachineState *machine)
135
139
MemoryRegion *phys_lmb_bram = g_new(MemoryRegion, 1);
136
140
MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
137
dev = qdev_new("xlnx.xps-intc");
141
qemu_irq irq[32];
138
+ qdev_prop_set_enum(dev, "endianness", ENDIAN_MODE_LITTLE);
142
+ EndianMode endianness = TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG
143
+ : ENDIAN_MODE_LITTLE;
144
145
/* init CPUs */
146
cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
147
@@ -XXX,XX +XXX,XX @@ petalogix_ml605_init(MachineState *machine)
148
149
150
dev = qdev_new("xlnx.xps-intc");
151
+ qdev_prop_set_enum(dev, "endianness", endianness);
139
qdev_prop_set_uint32(dev, "kind-of-intr", 1 << TIMER_IRQ);
152
qdev_prop_set_uint32(dev, "kind-of-intr", 1 << TIMER_IRQ);
140
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
153
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
141
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, INTC_BASEADDR);
154
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, INTC_BASEADDR);
142
diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c
155
diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c
143
index XXXXXXX..XXXXXXX 100644
156
index XXXXXXX..XXXXXXX 100644
...
...
diff view generated by jsdifflib
1
Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair
1
Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair of
2
of DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN.
2
DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN.
3
Add the "little-endian" property to select the device
3
4
endianness, defaulting to little endian.
4
Add the "endianness" property to select the device endianness.
5
Set the proper endianness on the single machine using the
5
This property is unspecified by default, and machines need to
6
device.
6
make it explicit.
7
8
Set the proper endianness for each machine using the device.
7
9
8
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
10
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
11
Reviewed-by: Thomas Huth <thuth@redhat.com>
9
---
12
---
10
hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 +
13
hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 +
11
hw/net/xilinx_ethlite.c | 29 +++++++++++++++++++-----
14
hw/net/xilinx_ethlite.c | 29 +++++++++++++++++++-----
12
hw/riscv/microblaze-v-generic.c | 1 +
15
hw/riscv/microblaze-v-generic.c | 1 +
13
3 files changed, 25 insertions(+), 6 deletions(-)
16
3 files changed, 25 insertions(+), 6 deletions(-)
...
...
diff view generated by jsdifflib
1
Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair
1
Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair of
2
of DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN.
2
DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN.
3
Add the "little-endian" property to select the device
3
4
endianness, defaulting to little endian.
4
Add the "endianness" property to select the device endianness.
5
This property is unspecified by default, and machines need to
6
make it explicit.
7
5
Set the proper endianness for each machine using the device.
8
Set the proper endianness for each machine using the device.
6
9
10
Reviewed-by: Thomas Huth <thuth@redhat.com>
7
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
11
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
8
---
12
---
9
hw/microblaze/petalogix_ml605_mmu.c | 1 +
13
hw/microblaze/petalogix_ml605_mmu.c | 1 +
10
hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 +
14
hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 +
11
hw/ppc/virtex_ml507.c | 1 +
15
hw/ppc/virtex_ml507.c | 1 +
...
...
19
+++ b/hw/microblaze/petalogix_ml605_mmu.c
23
+++ b/hw/microblaze/petalogix_ml605_mmu.c
20
@@ -XXX,XX +XXX,XX @@ petalogix_ml605_init(MachineState *machine)
24
@@ -XXX,XX +XXX,XX @@ petalogix_ml605_init(MachineState *machine)
21
25
22
/* 2 timers at irq 2 @ 100 Mhz. */
26
/* 2 timers at irq 2 @ 100 Mhz. */
23
dev = qdev_new("xlnx.xps-timer");
27
dev = qdev_new("xlnx.xps-timer");
24
+ qdev_prop_set_enum(dev, "endianness", ENDIAN_MODE_LITTLE);
28
+ qdev_prop_set_enum(dev, "endianness", endianness);
25
qdev_prop_set_uint32(dev, "one-timer-only", 0);
29
qdev_prop_set_uint32(dev, "one-timer-only", 0);
26
qdev_prop_set_uint32(dev, "clock-frequency", 100 * 1000000);
30
qdev_prop_set_uint32(dev, "clock-frequency", 100 * 1000000);
27
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
31
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
28
diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c
32
diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c
29
index XXXXXXX..XXXXXXX 100644
33
index XXXXXXX..XXXXXXX 100644
...
...
diff view generated by jsdifflib
1
Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair
1
Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair of
2
of DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN.
2
DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN.
3
Add the "little-endian" property to select the device
3
4
endianness, defaulting to little endian.
4
Add the "endianness" property to select the device endianness.
5
Set the proper endianness on the single machine using the
5
This property is unspecified by default, and machines need to
6
device.
6
make it explicit.
7
8
Set the proper endianness for each machine using the device.
7
9
8
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
10
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
11
Reviewed-by: Thomas Huth <thuth@redhat.com>
9
---
12
---
10
hw/char/xilinx_uartlite.c | 34 ++++++++++++++++--------
13
hw/char/xilinx_uartlite.c | 34 ++++++++++++++++--------
11
hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 +
14
hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 +
12
hw/riscv/microblaze-v-generic.c | 1 +
15
hw/riscv/microblaze-v-generic.c | 1 +
13
3 files changed, 25 insertions(+), 11 deletions(-)
16
3 files changed, 25 insertions(+), 11 deletions(-)
...
...
diff view generated by jsdifflib
1
Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair
1
Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair of
2
of DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN.
2
DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN.
3
Add the "little-endian" property to select the device
3
4
endianness, defaulting to little endian.
4
Add the "endianness" property to select the device endianness.
5
This property is unspecified by default, and machines need to
6
make it explicit.
7
5
Set the proper endianness on the single machine using the
8
Set the proper endianness on the single machine using the
6
device.
9
device.
7
10
11
Reviewed-by: Thomas Huth <thuth@redhat.com>
8
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
12
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
9
---
13
---
10
hw/microblaze/petalogix_ml605_mmu.c | 1 +
14
hw/microblaze/petalogix_ml605_mmu.c | 1 +
11
hw/ssi/xilinx_spi.c | 32 +++++++++++++++++++++--------
15
hw/ssi/xilinx_spi.c | 32 +++++++++++++++++++++--------
12
2 files changed, 24 insertions(+), 9 deletions(-)
16
2 files changed, 24 insertions(+), 9 deletions(-)
...
...
17
+++ b/hw/microblaze/petalogix_ml605_mmu.c
21
+++ b/hw/microblaze/petalogix_ml605_mmu.c
18
@@ -XXX,XX +XXX,XX @@ petalogix_ml605_init(MachineState *machine)
22
@@ -XXX,XX +XXX,XX @@ petalogix_ml605_init(MachineState *machine)
19
SSIBus *spi;
23
SSIBus *spi;
20
24
21
dev = qdev_new("xlnx.xps-spi");
25
dev = qdev_new("xlnx.xps-spi");
22
+ qdev_prop_set_enum(dev, "endianness", ENDIAN_MODE_LITTLE);
26
+ qdev_prop_set_enum(dev, "endianness", endianness);
23
qdev_prop_set_uint8(dev, "num-ss-bits", NUM_SPI_FLASHES);
27
qdev_prop_set_uint8(dev, "num-ss-bits", NUM_SPI_FLASHES);
24
busdev = SYS_BUS_DEVICE(dev);
28
busdev = SYS_BUS_DEVICE(dev);
25
sysbus_realize_and_unref(busdev, &error_fatal);
29
sysbus_realize_and_unref(busdev, &error_fatal);
26
diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
30
diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
27
index XXXXXXX..XXXXXXX 100644
31
index XXXXXXX..XXXXXXX 100644
...
...
diff view generated by jsdifflib
Deleted patch
1
The archive used in test_microblaze_s3adsp1800.py (testing a
2
big-endian target) contains a big-endian kernel. Rename using
3
the _BE suffix.
4
1
5
Similarly, the archive in test_microblazeel_s3adsp1800 (testing
6
a little-endian target) contains a little-endian kernel. Rename
7
using _LE suffix.
8
9
These changes will help when adding cross-endian kernel tests.
10
11
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
12
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
13
Reviewed-by: Thomas Huth <thuth@redhat.com>
14
Message-Id: <20250206131052.30207-13-philmd@linaro.org>
15
---
16
tests/functional/test_microblaze_s3adsp1800.py | 6 +++---
17
tests/functional/test_microblazeel_s3adsp1800.py | 6 +++---
18
2 files changed, 6 insertions(+), 6 deletions(-)
19
20
diff --git a/tests/functional/test_microblaze_s3adsp1800.py b/tests/functional/test_microblaze_s3adsp1800.py
21
index XXXXXXX..XXXXXXX 100755
22
--- a/tests/functional/test_microblaze_s3adsp1800.py
23
+++ b/tests/functional/test_microblaze_s3adsp1800.py
24
@@ -XXX,XX +XXX,XX @@ class MicroblazeMachine(QemuSystemTest):
25
26
timeout = 90
27
28
- ASSET_IMAGE = Asset(
29
+ ASSET_IMAGE_BE = Asset(
30
('https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/'
31
'day17.tar.xz'),
32
'3ba7439dfbea7af4876662c97f8e1f0cdad9231fc166e4861d17042489270057')
33
34
- def test_microblaze_s3adsp1800(self):
35
+ def test_microblaze_s3adsp1800_be(self):
36
self.set_machine('petalogix-s3adsp1800')
37
- self.archive_extract(self.ASSET_IMAGE)
38
+ self.archive_extract(self.ASSET_IMAGE_BE)
39
self.vm.set_console()
40
self.vm.add_args('-kernel',
41
self.scratch_file('day17', 'ballerina.bin'))
42
diff --git a/tests/functional/test_microblazeel_s3adsp1800.py b/tests/functional/test_microblazeel_s3adsp1800.py
43
index XXXXXXX..XXXXXXX 100755
44
--- a/tests/functional/test_microblazeel_s3adsp1800.py
45
+++ b/tests/functional/test_microblazeel_s3adsp1800.py
46
@@ -XXX,XX +XXX,XX @@ class MicroblazeelMachine(QemuSystemTest):
47
48
timeout = 90
49
50
- ASSET_IMAGE = Asset(
51
+ ASSET_IMAGE_LE = Asset(
52
('http://www.qemu-advent-calendar.org/2023/download/day13.tar.gz'),
53
'b9b3d43c5dd79db88ada495cc6e0d1f591153fe41355e925d791fbf44de50c22')
54
55
- def test_microblazeel_s3adsp1800(self):
56
+ def test_microblazeel_s3adsp1800_le(self):
57
self.require_netdev('user')
58
self.set_machine('petalogix-s3adsp1800')
59
- self.archive_extract(self.ASSET_IMAGE)
60
+ self.archive_extract(self.ASSET_IMAGE_LE)
61
self.vm.set_console()
62
self.vm.add_args('-kernel', self.scratch_file('day13', 'xmaton.bin'))
63
tftproot = self.scratch_file('day13')
64
--
65
2.47.1
66
67
diff view generated by jsdifflib
Deleted patch
1
Make microblaze tests a bit more generic.
2
1
3
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
4
Reviewed-by: Thomas Huth <thuth@redhat.com>
5
Message-Id: <20250206131052.30207-14-philmd@linaro.org>
6
---
7
tests/functional/test_microblaze_s3adsp1800.py | 7 +++++--
8
tests/functional/test_microblazeel_s3adsp1800.py | 7 +++++--
9
2 files changed, 10 insertions(+), 4 deletions(-)
10
11
diff --git a/tests/functional/test_microblaze_s3adsp1800.py b/tests/functional/test_microblaze_s3adsp1800.py
12
index XXXXXXX..XXXXXXX 100755
13
--- a/tests/functional/test_microblaze_s3adsp1800.py
14
+++ b/tests/functional/test_microblaze_s3adsp1800.py
15
@@ -XXX,XX +XXX,XX @@ class MicroblazeMachine(QemuSystemTest):
16
'day17.tar.xz'),
17
'3ba7439dfbea7af4876662c97f8e1f0cdad9231fc166e4861d17042489270057')
18
19
- def test_microblaze_s3adsp1800_be(self):
20
- self.set_machine('petalogix-s3adsp1800')
21
+ def do_ballerina_be_test(self, machine):
22
+ self.set_machine(machine)
23
self.archive_extract(self.ASSET_IMAGE_BE)
24
self.vm.set_console()
25
self.vm.add_args('-kernel',
26
@@ -XXX,XX +XXX,XX @@ def test_microblaze_s3adsp1800_be(self):
27
# message, that's why we don't test for a later string here. This
28
# needs some investigation by a microblaze wizard one day...
29
30
+ def test_microblaze_s3adsp1800_legacy_be(self):
31
+ self.do_ballerina_be_test('petalogix-s3adsp1800')
32
+
33
if __name__ == '__main__':
34
QemuSystemTest.main()
35
diff --git a/tests/functional/test_microblazeel_s3adsp1800.py b/tests/functional/test_microblazeel_s3adsp1800.py
36
index XXXXXXX..XXXXXXX 100755
37
--- a/tests/functional/test_microblazeel_s3adsp1800.py
38
+++ b/tests/functional/test_microblazeel_s3adsp1800.py
39
@@ -XXX,XX +XXX,XX @@ class MicroblazeelMachine(QemuSystemTest):
40
('http://www.qemu-advent-calendar.org/2023/download/day13.tar.gz'),
41
'b9b3d43c5dd79db88ada495cc6e0d1f591153fe41355e925d791fbf44de50c22')
42
43
- def test_microblazeel_s3adsp1800_le(self):
44
+ def do_xmaton_le_test(self, machine):
45
self.require_netdev('user')
46
- self.set_machine('petalogix-s3adsp1800')
47
+ self.set_machine(machine)
48
self.archive_extract(self.ASSET_IMAGE_LE)
49
self.vm.set_console()
50
self.vm.add_args('-kernel', self.scratch_file('day13', 'xmaton.bin'))
51
@@ -XXX,XX +XXX,XX @@ def test_microblazeel_s3adsp1800_le(self):
52
'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png',
53
'821cd3cab8efd16ad6ee5acc3642a8ea')
54
55
+ def test_microblaze_s3adsp1800_legacy_le(self):
56
+ self.do_xmaton_le_test('petalogix-s3adsp1800')
57
+
58
if __name__ == '__main__':
59
QemuSystemTest.main()
60
--
61
2.47.1
62
63
diff view generated by jsdifflib
Deleted patch
1
Commit f0ec14c78c4 ("tests/avocado: Fix console data loss") fixed
2
QEMUMachine's problem with console, we don't need to use the sleep()
3
kludges.
4
1
5
Suggested-by: Thomas Huth <thuth@redhat.com>
6
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
7
Reviewed-by: Thomas Huth <thuth@redhat.com>
8
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
9
Message-Id: <20250206131052.30207-15-philmd@linaro.org>
10
---
11
tests/functional/test_microblazeel_s3adsp1800.py | 8 +++-----
12
1 file changed, 3 insertions(+), 5 deletions(-)
13
14
diff --git a/tests/functional/test_microblazeel_s3adsp1800.py b/tests/functional/test_microblazeel_s3adsp1800.py
15
index XXXXXXX..XXXXXXX 100755
16
--- a/tests/functional/test_microblazeel_s3adsp1800.py
17
+++ b/tests/functional/test_microblazeel_s3adsp1800.py
18
@@ -XXX,XX +XXX,XX @@
19
# This work is licensed under the terms of the GNU GPL, version 2 or
20
# later. See the COPYING file in the top-level directory.
21
22
-import time
23
-from qemu_test import exec_command, exec_command_and_wait_for_pattern
24
+from qemu_test import exec_command_and_wait_for_pattern
25
from qemu_test import QemuSystemTest, Asset
26
from qemu_test import wait_for_console_pattern
27
28
@@ -XXX,XX +XXX,XX @@ def do_xmaton_le_test(self, machine):
29
self.vm.add_args('-nic', f'user,tftp={tftproot}')
30
self.vm.launch()
31
wait_for_console_pattern(self, 'QEMU Advent Calendar 2023')
32
- time.sleep(0.1)
33
- exec_command(self, 'root')
34
- time.sleep(0.1)
35
+ wait_for_console_pattern(self, 'buildroot login:')
36
+ exec_command_and_wait_for_pattern(self, 'root', '#')
37
exec_command_and_wait_for_pattern(self,
38
'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png',
39
'821cd3cab8efd16ad6ee5acc3642a8ea')
40
--
41
2.47.1
42
43
diff view generated by jsdifflib
Deleted patch
1
Have the MicroblazeMachine class being common to both
2
MicroblazeBigEndianMachine and MicroblazeLittleEndianMachine
3
classes. Move the xmaton and ballerina tests to the parent class.
4
1
5
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6
Reviewed-by: Thomas Huth <thuth@redhat.com>
7
Message-Id: <20250206131052.30207-16-philmd@linaro.org>
8
---
9
.../functional/test_microblaze_s3adsp1800.py | 23 +++++++++++++++
10
.../test_microblazeel_s3adsp1800.py | 29 ++-----------------
11
2 files changed, 26 insertions(+), 26 deletions(-)
12
13
diff --git a/tests/functional/test_microblaze_s3adsp1800.py b/tests/functional/test_microblaze_s3adsp1800.py
14
index XXXXXXX..XXXXXXX 100755
15
--- a/tests/functional/test_microblaze_s3adsp1800.py
16
+++ b/tests/functional/test_microblaze_s3adsp1800.py
17
@@ -XXX,XX +XXX,XX @@
18
# This work is licensed under the terms of the GNU GPL, version 2 or
19
# later. See the COPYING file in the top-level directory.
20
21
+from qemu_test import exec_command_and_wait_for_pattern
22
from qemu_test import QemuSystemTest, Asset
23
from qemu_test import wait_for_console_pattern
24
25
@@ -XXX,XX +XXX,XX @@ class MicroblazeMachine(QemuSystemTest):
26
'day17.tar.xz'),
27
'3ba7439dfbea7af4876662c97f8e1f0cdad9231fc166e4861d17042489270057')
28
29
+ ASSET_IMAGE_LE = Asset(
30
+ ('http://www.qemu-advent-calendar.org/2023/download/day13.tar.gz'),
31
+ 'b9b3d43c5dd79db88ada495cc6e0d1f591153fe41355e925d791fbf44de50c22')
32
+
33
def do_ballerina_be_test(self, machine):
34
self.set_machine(machine)
35
self.archive_extract(self.ASSET_IMAGE_BE)
36
@@ -XXX,XX +XXX,XX @@ def do_ballerina_be_test(self, machine):
37
# message, that's why we don't test for a later string here. This
38
# needs some investigation by a microblaze wizard one day...
39
40
+ def do_xmaton_le_test(self, machine):
41
+ self.require_netdev('user')
42
+ self.set_machine(machine)
43
+ self.archive_extract(self.ASSET_IMAGE_LE)
44
+ self.vm.set_console()
45
+ self.vm.add_args('-kernel', self.scratch_file('day13', 'xmaton.bin'))
46
+ tftproot = self.scratch_file('day13')
47
+ self.vm.add_args('-nic', f'user,tftp={tftproot}')
48
+ self.vm.launch()
49
+ wait_for_console_pattern(self, 'QEMU Advent Calendar 2023')
50
+ wait_for_console_pattern(self, 'buildroot login:')
51
+ exec_command_and_wait_for_pattern(self, 'root', '#')
52
+ exec_command_and_wait_for_pattern(self,
53
+ 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png',
54
+ '821cd3cab8efd16ad6ee5acc3642a8ea')
55
+
56
+class MicroblazeBigEndianMachine(MicroblazeMachine):
57
+
58
def test_microblaze_s3adsp1800_legacy_be(self):
59
self.do_ballerina_be_test('petalogix-s3adsp1800')
60
61
diff --git a/tests/functional/test_microblazeel_s3adsp1800.py b/tests/functional/test_microblazeel_s3adsp1800.py
62
index XXXXXXX..XXXXXXX 100755
63
--- a/tests/functional/test_microblazeel_s3adsp1800.py
64
+++ b/tests/functional/test_microblazeel_s3adsp1800.py
65
@@ -XXX,XX +XXX,XX @@
66
# This work is licensed under the terms of the GNU GPL, version 2 or
67
# later. See the COPYING file in the top-level directory.
68
69
-from qemu_test import exec_command_and_wait_for_pattern
70
-from qemu_test import QemuSystemTest, Asset
71
-from qemu_test import wait_for_console_pattern
72
+from qemu_test import QemuSystemTest
73
74
+from test_microblaze_s3adsp1800 import MicroblazeMachine
75
76
-class MicroblazeelMachine(QemuSystemTest):
77
-
78
- timeout = 90
79
-
80
- ASSET_IMAGE_LE = Asset(
81
- ('http://www.qemu-advent-calendar.org/2023/download/day13.tar.gz'),
82
- 'b9b3d43c5dd79db88ada495cc6e0d1f591153fe41355e925d791fbf44de50c22')
83
-
84
- def do_xmaton_le_test(self, machine):
85
- self.require_netdev('user')
86
- self.set_machine(machine)
87
- self.archive_extract(self.ASSET_IMAGE_LE)
88
- self.vm.set_console()
89
- self.vm.add_args('-kernel', self.scratch_file('day13', 'xmaton.bin'))
90
- tftproot = self.scratch_file('day13')
91
- self.vm.add_args('-nic', f'user,tftp={tftproot}')
92
- self.vm.launch()
93
- wait_for_console_pattern(self, 'QEMU Advent Calendar 2023')
94
- wait_for_console_pattern(self, 'buildroot login:')
95
- exec_command_and_wait_for_pattern(self, 'root', '#')
96
- exec_command_and_wait_for_pattern(self,
97
- 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png',
98
- '821cd3cab8efd16ad6ee5acc3642a8ea')
99
+class MicroblazeLittleEndianMachine(MicroblazeMachine):
100
101
def test_microblaze_s3adsp1800_legacy_le(self):
102
self.do_xmaton_le_test('petalogix-s3adsp1800')
103
--
104
2.47.1
105
106
diff view generated by jsdifflib