1
From: Alistair Francis <alistair.francis@wdc.com>
1
The following changes since commit 53f3a13ac1069975ad47cf8bd05cc96b4ac09962:
2
2
3
The following changes since commit c5fbdd60cf1fb52f01bdfe342b6fa65d5343e1b1:
3
Merge tag 'pull-tcg-20250403' of https://gitlab.com/rth7680/qemu into staging (2025-04-04 10:23:17 -0400)
4
5
Merge tag 'qemu-sparc-20211121' of git://github.com/mcayland/qemu into staging (2021-11-21 14:12:25 +0100)
6
4
7
are available in the Git repository at:
5
are available in the Git repository at:
8
6
9
git@github.com:alistair23/qemu.git tags/pull-riscv-to-apply-20211122
7
https://github.com/alistair23/qemu.git tags/pull-riscv-to-apply-20250407-1
10
8
11
for you to fetch changes up to 526e7443027c71fe7b04c29df529e1f9f425f9e3:
9
for you to fetch changes up to d31d37fded414959713678d2e9e6bc1afab5f376:
12
10
13
hw/misc/sifive_u_otp: Do not reset OTP content on hardware reset (2021-11-22 10:46:22 +1000)
11
docs: deprecate RISC-V default machine option (2025-04-07 10:12:40 +1000)
14
12
15
----------------------------------------------------------------
13
----------------------------------------------------------------
16
Seventh RISC-V PR for QEMU 6.2
14
Sixth RISC-V PR for 10.0
17
15
18
- Deprecate IF_NONE for SiFive OTP
16
* Deprecate the default RISC-V machine
19
- Don't reset SiFive OTP content
20
17
21
----------------------------------------------------------------
18
----------------------------------------------------------------
22
Philippe Mathieu-Daudé (1):
19
Daniel Henrique Barboza (1):
23
hw/misc/sifive_u_otp: Do not reset OTP content on hardware reset
20
docs: deprecate RISC-V default machine option
24
21
25
Thomas Huth (1):
22
docs/about/deprecated.rst | 17 +++++++++++++++++
26
hw/misc/sifive_u_otp: Use IF_PFLASH for the OTP device instead of IF_NONE
23
1 file changed, 17 insertions(+)
27
28
docs/about/deprecated.rst | 6 ++++++
29
hw/misc/sifive_u_otp.c | 22 +++++++++++++---------
30
2 files changed, 19 insertions(+), 9 deletions(-)
31
diff view generated by jsdifflib
1
From: Thomas Huth <thuth@redhat.com>
1
From: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
2
2
3
Configuring a drive with "if=none" is meant for creation of a backend
3
Commit 5b4beba124 ("RISC-V Spike Machines") added the Spike machine and
4
only, it should not get automatically assigned to a device frontend.
4
made it default for qemu-system-riscv32/64. It was the first RISC-V
5
Use "if=pflash" for the One-Time-Programmable device instead (like
5
machine added in QEMU so setting it as default was sensible.
6
it is e.g. also done for the efuse device in hw/arm/xlnx-zcu102.c).
7
6
8
Since the old way of configuring the device has already been published
7
Today we have 7 riscv64 and 6 riscv32 machines and having 'spike' as
9
with the previous QEMU versions, we cannot remove this immediately, but
8
default machine is not intuitive. For example, [1] is a bug that was
10
have to deprecate it and support it for at least two more releases.
9
opened with the 'virt' board in mind, but given that the user didn't
10
pass a '-machine' option, the user was using 'spike' without knowing.
11
11
12
Signed-off-by: Thomas Huth <thuth@redhat.com>
12
Being explicit in the command line is desirable when we have a handful
13
Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
13
of boards available, so deprecate the default machine setting from
14
Reviewed-by: Markus Armbruster <armbru@redhat.com>
14
RISC-V.
15
16
[1] https://gitlab.com/qemu-project/qemu/-/issues/2467
17
18
Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
19
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
15
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
20
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
16
Message-id: 20211119102549.217755-1-thuth@redhat.com
21
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
22
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
23
Message-ID: <20250404122858.241598-1-dbarboza@ventanamicro.com>
17
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
24
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
18
---
25
---
19
docs/about/deprecated.rst | 6 ++++++
26
docs/about/deprecated.rst | 17 +++++++++++++++++
20
hw/misc/sifive_u_otp.c | 9 ++++++++-
27
1 file changed, 17 insertions(+)
21
2 files changed, 14 insertions(+), 1 deletion(-)
22
28
23
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
29
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
24
index XXXXXXX..XXXXXXX 100644
30
index XXXXXXX..XXXXXXX 100644
25
--- a/docs/about/deprecated.rst
31
--- a/docs/about/deprecated.rst
26
+++ b/docs/about/deprecated.rst
32
+++ b/docs/about/deprecated.rst
27
@@ -XXX,XX +XXX,XX @@ as short-form boolean values, and passed to plugins as ``arg_name=on``.
33
@@ -XXX,XX +XXX,XX @@ online to check that this board did not completely bitrot yet). It is
28
However, short-form booleans are deprecated and full explicit ``arg_name=on``
34
recommended to use another MIPS machine for future MIPS code development
29
form is preferred.
35
instead.
30
36
31
+``-drive if=none`` for the sifive_u OTP device (since 6.2)
37
+RISC-V default machine option (since 10.0)
32
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
38
+''''''''''''''''''''''''''''''''''''''''''
33
+
39
+
34
+Using ``-drive if=none`` to configure the OTP device of the sifive_u
40
+RISC-V defines ``spike`` as the default machine if no machine option is
35
+RISC-V machine is deprecated. Use ``-drive if=pflash`` instead.
41
+given in the command line. This happens because ``spike`` is the first
42
+RISC-V machine implemented in QEMU and setting it as default was
43
+convenient at that time. Now we have 7 riscv64 and 6 riscv32 machines
44
+and having ``spike`` as a default is no longer justified. This default
45
+will also promote situations where users think they're running ``virt``
46
+(the most used RISC-V machine type in 10.0) when in fact they're
47
+running ``spike``.
36
+
48
+
37
49
+Removing the default machine option forces users to always set the machine
38
QEMU Machine Protocol (QMP) commands
50
+they want to use and avoids confusion. Existing users of the ``spike``
39
------------------------------------
51
+machine must ensure that they're setting the ``spike`` machine in the
40
diff --git a/hw/misc/sifive_u_otp.c b/hw/misc/sifive_u_otp.c
52
+command line (``-M spike``).
41
index XXXXXXX..XXXXXXX 100644
53
+
42
--- a/hw/misc/sifive_u_otp.c
54
43
+++ b/hw/misc/sifive_u_otp.c
55
Backend options
44
@@ -XXX,XX +XXX,XX @@ static void sifive_u_otp_realize(DeviceState *dev, Error **errp)
56
---------------
45
TYPE_SIFIVE_U_OTP, SIFIVE_U_OTP_REG_SIZE);
46
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mmio);
47
48
- dinfo = drive_get_next(IF_NONE);
49
+ dinfo = drive_get_next(IF_PFLASH);
50
+ if (!dinfo) {
51
+ dinfo = drive_get_next(IF_NONE);
52
+ if (dinfo) {
53
+ warn_report("using \"-drive if=none\" for the OTP is deprecated, "
54
+ "use \"-drive if=pflash\" instead.");
55
+ }
56
+ }
57
if (dinfo) {
58
int ret;
59
uint64_t perm;
60
--
57
--
61
2.31.1
58
2.48.1
62
59
63
60
diff view generated by jsdifflib
Deleted patch
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
1
3
Once a "One Time Programmable" is programmed, it shouldn't be reset.
4
5
Do not re-initialize the OTP content in the DeviceReset handler,
6
initialize it once in the DeviceRealize one.
7
8
Fixes: 9fb45c62ae8 ("riscv: sifive: Implement a model for SiFive FU540 OTP")
9
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
10
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
11
Message-Id: <20211119104757.331579-1-f4bug@amsat.org>
12
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
13
---
14
hw/misc/sifive_u_otp.c | 13 +++++--------
15
1 file changed, 5 insertions(+), 8 deletions(-)
16
17
diff --git a/hw/misc/sifive_u_otp.c b/hw/misc/sifive_u_otp.c
18
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/misc/sifive_u_otp.c
20
+++ b/hw/misc/sifive_u_otp.c
21
@@ -XXX,XX +XXX,XX @@ static void sifive_u_otp_realize(DeviceState *dev, Error **errp)
22
23
if (blk_pread(s->blk, 0, s->fuse, filesize) != filesize) {
24
error_setg(errp, "failed to read the initial flash content");
25
+ return;
26
}
27
}
28
}
29
-}
30
-
31
-static void sifive_u_otp_reset(DeviceState *dev)
32
-{
33
- SiFiveUOTPState *s = SIFIVE_U_OTP(dev);
34
35
/* Initialize all fuses' initial value to 0xFFs */
36
memset(s->fuse, 0xff, sizeof(s->fuse));
37
@@ -XXX,XX +XXX,XX @@ static void sifive_u_otp_reset(DeviceState *dev)
38
serial_data = s->serial;
39
if (blk_pwrite(s->blk, index * SIFIVE_U_OTP_FUSE_WORD,
40
&serial_data, SIFIVE_U_OTP_FUSE_WORD, 0) < 0) {
41
- error_report("write error index<%d>", index);
42
+ error_setg(errp, "failed to write index<%d>", index);
43
+ return;
44
}
45
46
serial_data = ~(s->serial);
47
if (blk_pwrite(s->blk, (index + 1) * SIFIVE_U_OTP_FUSE_WORD,
48
&serial_data, SIFIVE_U_OTP_FUSE_WORD, 0) < 0) {
49
- error_report("write error index<%d>", index + 1);
50
+ error_setg(errp, "failed to write index<%d>", index + 1);
51
+ return;
52
}
53
}
54
55
@@ -XXX,XX +XXX,XX @@ static void sifive_u_otp_class_init(ObjectClass *klass, void *data)
56
57
device_class_set_props(dc, sifive_u_otp_properties);
58
dc->realize = sifive_u_otp_realize;
59
- dc->reset = sifive_u_otp_reset;
60
}
61
62
static const TypeInfo sifive_u_otp_info = {
63
--
64
2.31.1
65
66
diff view generated by jsdifflib