* [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs
@ 2019-05-05 15:28 Philippe Mathieu-Daudé
2019-05-05 15:28 ` Philippe Mathieu-Daudé
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-05-05 15:28 UTC (permalink / raw)
To: Artyom Tarasenko, qemu-devel, Mark Cave-Ayland
Cc: qemu-ppc, Michael S. Tsirkin, Paolo Bonzini, David Gibson,
Hervé Poussineau, Philippe Mathieu-Daudé
Hi,
This series is to properly do the fix sent by Artyom here:
https://lists.gnu.org/archive/html/qemu-devel/2019-04/msg02264.html
There is no RTC on the i82378, move it to the board code,
set the base year there.
Regards,
Phil.
Artyom Tarasenko (1):
hw/ppc/40p: use 1900 as a base year
Philippe Mathieu-Daudé (2):
hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string
hw/ppc/40p: Move the MC146818 RTC to the board where it belongs
hw/isa/i82378.c | 4 ----
hw/ppc/prep.c | 7 ++++++-
2 files changed, 6 insertions(+), 5 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs
2019-05-05 15:28 [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs Philippe Mathieu-Daudé
@ 2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-05 15:28 ` [Qemu-devel] [PATCH 1/3] hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string Philippe Mathieu-Daudé
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-05-05 15:28 UTC (permalink / raw)
To: Artyom Tarasenko, qemu-devel, Mark Cave-Ayland
Cc: qemu-ppc, Michael S. Tsirkin, Hervé Poussineau,
Paolo Bonzini, Philippe Mathieu-Daudé, David Gibson
Hi,
This series is to properly do the fix sent by Artyom here:
https://lists.gnu.org/archive/html/qemu-devel/2019-04/msg02264.html
There is no RTC on the i82378, move it to the board code,
set the base year there.
Regards,
Phil.
Artyom Tarasenko (1):
hw/ppc/40p: use 1900 as a base year
Philippe Mathieu-Daudé (2):
hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string
hw/ppc/40p: Move the MC146818 RTC to the board where it belongs
hw/isa/i82378.c | 4 ----
hw/ppc/prep.c | 7 ++++++-
2 files changed, 6 insertions(+), 5 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 1/3] hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string
2019-05-05 15:28 [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs Philippe Mathieu-Daudé
2019-05-05 15:28 ` Philippe Mathieu-Daudé
@ 2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-06 3:25 ` David Gibson
2019-05-05 15:28 ` [Qemu-devel] [PATCH 2/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs Philippe Mathieu-Daudé
` (2 subsequent siblings)
4 siblings, 2 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-05-05 15:28 UTC (permalink / raw)
To: Artyom Tarasenko, qemu-devel, Mark Cave-Ayland
Cc: qemu-ppc, Michael S. Tsirkin, Paolo Bonzini, David Gibson,
Hervé Poussineau, Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/ppc/prep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index b7f459d4754..ebee3211480 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -601,7 +601,7 @@ static int prep_set_cmos_checksum(DeviceState *dev, void *opaque)
uint16_t checksum = *(uint16_t *)opaque;
ISADevice *rtc;
- if (object_dynamic_cast(OBJECT(dev), "mc146818rtc")) {
+ if (object_dynamic_cast(OBJECT(dev), TYPE_MC146818_RTC)) {
rtc = ISA_DEVICE(dev);
rtc_set_memory(rtc, 0x2e, checksum & 0xff);
rtc_set_memory(rtc, 0x3e, checksum & 0xff);
--
2.20.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 1/3] hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string
2019-05-05 15:28 ` [Qemu-devel] [PATCH 1/3] hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string Philippe Mathieu-Daudé
@ 2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-06 3:25 ` David Gibson
1 sibling, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-05-05 15:28 UTC (permalink / raw)
To: Artyom Tarasenko, qemu-devel, Mark Cave-Ayland
Cc: qemu-ppc, Michael S. Tsirkin, Hervé Poussineau,
Paolo Bonzini, Philippe Mathieu-Daudé, David Gibson
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/ppc/prep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index b7f459d4754..ebee3211480 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -601,7 +601,7 @@ static int prep_set_cmos_checksum(DeviceState *dev, void *opaque)
uint16_t checksum = *(uint16_t *)opaque;
ISADevice *rtc;
- if (object_dynamic_cast(OBJECT(dev), "mc146818rtc")) {
+ if (object_dynamic_cast(OBJECT(dev), TYPE_MC146818_RTC)) {
rtc = ISA_DEVICE(dev);
rtc_set_memory(rtc, 0x2e, checksum & 0xff);
rtc_set_memory(rtc, 0x3e, checksum & 0xff);
--
2.20.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 2/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs
2019-05-05 15:28 [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs Philippe Mathieu-Daudé
2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-05 15:28 ` [Qemu-devel] [PATCH 1/3] hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string Philippe Mathieu-Daudé
@ 2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-05 15:28 ` [Qemu-devel] [PATCH 3/3] hw/ppc/40p: use 1900 as a base year Philippe Mathieu-Daudé
2019-05-06 3:25 ` [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs David Gibson
4 siblings, 1 reply; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-05-05 15:28 UTC (permalink / raw)
To: Artyom Tarasenko, qemu-devel, Mark Cave-Ayland
Cc: qemu-ppc, Michael S. Tsirkin, Paolo Bonzini, David Gibson,
Hervé Poussineau, Philippe Mathieu-Daudé
The MC146818 RTC was incorrectly added to the i82378 chipset in
commit a04ff940974a. In the next commit (506b7ddf8893) the PReP
machine use the i82378.
Since the MC146818 is specific to the PReP machine, move its use
there.
Fixes: a04ff940974a
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/isa/i82378.c | 4 ----
hw/ppc/prep.c | 3 +++
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
index a5d67bc6d7a..c08970b24a2 100644
--- a/hw/isa/i82378.c
+++ b/hw/isa/i82378.c
@@ -21,7 +21,6 @@
#include "hw/pci/pci.h"
#include "hw/i386/pc.h"
#include "hw/timer/i8254.h"
-#include "hw/timer/mc146818rtc.h"
#include "hw/audio/pcspk.h"
#define TYPE_I82378 "i82378"
@@ -105,9 +104,6 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
/* 2 82C37 (dma) */
isa = isa_create_simple(isabus, "i82374");
-
- /* timer */
- isa_create_simple(isabus, TYPE_MC146818_RTC);
}
static void i82378_init(Object *obj)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index ebee3211480..7a0d311d43c 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -675,6 +675,9 @@ static void ibm_40p_init(MachineState *machine)
qdev_prop_set_uint32(dev, "ram-size", machine->ram_size);
qdev_init_nofail(dev);
+ /* RTC */
+ isa_create_simple(isa_bus, TYPE_MC146818_RTC);
+
/* initialize CMOS checksums */
cmos_checksum = 0x6aa9;
qbus_walk_children(BUS(isa_bus), prep_set_cmos_checksum, NULL, NULL, NULL,
--
2.20.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 2/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs
2019-05-05 15:28 ` [Qemu-devel] [PATCH 2/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs Philippe Mathieu-Daudé
@ 2019-05-05 15:28 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-05-05 15:28 UTC (permalink / raw)
To: Artyom Tarasenko, qemu-devel, Mark Cave-Ayland
Cc: qemu-ppc, Michael S. Tsirkin, Hervé Poussineau,
Paolo Bonzini, Philippe Mathieu-Daudé, David Gibson
The MC146818 RTC was incorrectly added to the i82378 chipset in
commit a04ff940974a. In the next commit (506b7ddf8893) the PReP
machine use the i82378.
Since the MC146818 is specific to the PReP machine, move its use
there.
Fixes: a04ff940974a
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/isa/i82378.c | 4 ----
hw/ppc/prep.c | 3 +++
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
index a5d67bc6d7a..c08970b24a2 100644
--- a/hw/isa/i82378.c
+++ b/hw/isa/i82378.c
@@ -21,7 +21,6 @@
#include "hw/pci/pci.h"
#include "hw/i386/pc.h"
#include "hw/timer/i8254.h"
-#include "hw/timer/mc146818rtc.h"
#include "hw/audio/pcspk.h"
#define TYPE_I82378 "i82378"
@@ -105,9 +104,6 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
/* 2 82C37 (dma) */
isa = isa_create_simple(isabus, "i82374");
-
- /* timer */
- isa_create_simple(isabus, TYPE_MC146818_RTC);
}
static void i82378_init(Object *obj)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index ebee3211480..7a0d311d43c 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -675,6 +675,9 @@ static void ibm_40p_init(MachineState *machine)
qdev_prop_set_uint32(dev, "ram-size", machine->ram_size);
qdev_init_nofail(dev);
+ /* RTC */
+ isa_create_simple(isa_bus, TYPE_MC146818_RTC);
+
/* initialize CMOS checksums */
cmos_checksum = 0x6aa9;
qbus_walk_children(BUS(isa_bus), prep_set_cmos_checksum, NULL, NULL, NULL,
--
2.20.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 3/3] hw/ppc/40p: use 1900 as a base year
2019-05-05 15:28 [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2019-05-05 15:28 ` [Qemu-devel] [PATCH 2/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs Philippe Mathieu-Daudé
@ 2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-06 3:25 ` [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs David Gibson
4 siblings, 1 reply; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-05-05 15:28 UTC (permalink / raw)
To: Artyom Tarasenko, qemu-devel, Mark Cave-Ayland
Cc: qemu-ppc, Michael S. Tsirkin, Paolo Bonzini, David Gibson,
Hervé Poussineau, Philippe Mathieu-Daudé
From: Artyom Tarasenko <atar4qemu@gmail.com>
AIX 5.1 expects the base year to be 1900. Adjust accordingly.
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/ppc/prep.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 7a0d311d43c..2a8009e20b4 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -676,7 +676,9 @@ static void ibm_40p_init(MachineState *machine)
qdev_init_nofail(dev);
/* RTC */
- isa_create_simple(isa_bus, TYPE_MC146818_RTC);
+ dev = DEVICE(isa_create(isa_bus, TYPE_MC146818_RTC));
+ qdev_prop_set_int32(dev, "base_year", 1900);
+ qdev_init_nofail(dev);
/* initialize CMOS checksums */
cmos_checksum = 0x6aa9;
--
2.20.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH 3/3] hw/ppc/40p: use 1900 as a base year
2019-05-05 15:28 ` [Qemu-devel] [PATCH 3/3] hw/ppc/40p: use 1900 as a base year Philippe Mathieu-Daudé
@ 2019-05-05 15:28 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 10+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-05-05 15:28 UTC (permalink / raw)
To: Artyom Tarasenko, qemu-devel, Mark Cave-Ayland
Cc: qemu-ppc, Michael S. Tsirkin, Hervé Poussineau,
Paolo Bonzini, Philippe Mathieu-Daudé, David Gibson
From: Artyom Tarasenko <atar4qemu@gmail.com>
AIX 5.1 expects the base year to be 1900. Adjust accordingly.
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/ppc/prep.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 7a0d311d43c..2a8009e20b4 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -676,7 +676,9 @@ static void ibm_40p_init(MachineState *machine)
qdev_init_nofail(dev);
/* RTC */
- isa_create_simple(isa_bus, TYPE_MC146818_RTC);
+ dev = DEVICE(isa_create(isa_bus, TYPE_MC146818_RTC));
+ qdev_prop_set_int32(dev, "base_year", 1900);
+ qdev_init_nofail(dev);
/* initialize CMOS checksums */
cmos_checksum = 0x6aa9;
--
2.20.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs
2019-05-05 15:28 [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2019-05-05 15:28 ` [Qemu-devel] [PATCH 3/3] hw/ppc/40p: use 1900 as a base year Philippe Mathieu-Daudé
@ 2019-05-06 3:25 ` David Gibson
4 siblings, 0 replies; 10+ messages in thread
From: David Gibson @ 2019-05-06 3:25 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Michael S. Tsirkin, Mark Cave-Ayland, qemu-devel, qemu-ppc,
Paolo Bonzini, Artyom Tarasenko, Hervé Poussineau
[-- Attachment #1: Type: text/plain, Size: 976 bytes --]
On Sun, May 05, 2019 at 05:28:36PM +0200, Philippe Mathieu-Daudé wrote:
> Hi,
>
> This series is to properly do the fix sent by Artyom here:
> https://lists.gnu.org/archive/html/qemu-devel/2019-04/msg02264.html
>
> There is no RTC on the i82378, move it to the board code,
> set the base year there.
Applied to ppc-for-4.1, although see comment for a possible followup.
>
> Regards,
>
> Phil.
>
> Artyom Tarasenko (1):
> hw/ppc/40p: use 1900 as a base year
>
> Philippe Mathieu-Daudé (2):
> hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string
> hw/ppc/40p: Move the MC146818 RTC to the board where it belongs
>
> hw/isa/i82378.c | 4 ----
> hw/ppc/prep.c | 7 ++++++-
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string
2019-05-05 15:28 ` [Qemu-devel] [PATCH 1/3] hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string Philippe Mathieu-Daudé
2019-05-05 15:28 ` Philippe Mathieu-Daudé
@ 2019-05-06 3:25 ` David Gibson
1 sibling, 0 replies; 10+ messages in thread
From: David Gibson @ 2019-05-06 3:25 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Michael S. Tsirkin, Mark Cave-Ayland, qemu-devel, qemu-ppc,
Paolo Bonzini, Artyom Tarasenko, Hervé Poussineau
[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]
On Sun, May 05, 2019 at 05:28:37PM +0200, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Certainly a good fix, but looks like there's places in
hw/timer/mc146818rtc.c itself and in vl.c which could also do with
this.
> ---
> hw/ppc/prep.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index b7f459d4754..ebee3211480 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -601,7 +601,7 @@ static int prep_set_cmos_checksum(DeviceState *dev, void *opaque)
> uint16_t checksum = *(uint16_t *)opaque;
> ISADevice *rtc;
>
> - if (object_dynamic_cast(OBJECT(dev), "mc146818rtc")) {
> + if (object_dynamic_cast(OBJECT(dev), TYPE_MC146818_RTC)) {
> rtc = ISA_DEVICE(dev);
> rtc_set_memory(rtc, 0x2e, checksum & 0xff);
> rtc_set_memory(rtc, 0x3e, checksum & 0xff);
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-05-06 3:39 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-05 15:28 [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs Philippe Mathieu-Daudé
2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-05 15:28 ` [Qemu-devel] [PATCH 1/3] hw/ppc/prep: use TYPE_MC146818_RTC instead of a hardcoded string Philippe Mathieu-Daudé
2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-06 3:25 ` David Gibson
2019-05-05 15:28 ` [Qemu-devel] [PATCH 2/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs Philippe Mathieu-Daudé
2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-05 15:28 ` [Qemu-devel] [PATCH 3/3] hw/ppc/40p: use 1900 as a base year Philippe Mathieu-Daudé
2019-05-05 15:28 ` Philippe Mathieu-Daudé
2019-05-06 3:25 ` [Qemu-devel] [PATCH 0/3] hw/ppc/40p: Move the MC146818 RTC to the board where it belongs David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).