All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCHv2 0/2] m48t59: add year offset and sysbus device
@ 2015-02-01 18:39 Mark Cave-Ayland
  2015-02-01 18:39 ` [Qemu-devel] [PATCHv2 1/2] m48t59: introduce new year_offset qdev property Mark Cave-Ayland
  2015-02-01 18:39 ` [Qemu-devel] [PATCHv2 2/2] m48t59: add m48t59 sysbus device Mark Cave-Ayland
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Cave-Ayland @ 2015-02-01 18:39 UTC (permalink / raw)
  To: qemu-devel, hpoussin, atar4qemu

This patch lays the groundwork for switching sun4u over from ioport NVRAM
access to MMIO NVRAM access.

Patch 1 introduces a new year_offset property which is the offset between the
year value stored in hardware and the actual year. In particular, Sun hardware
has a 68 year offset used to extend the date range of the IC. While the
kernel sources I have viewed contain this offset within a #ifdef CONFIG_SPARC
block, I've updated all the callers so that no change in behaviour will be
seen across all platforms. PPC users may wish to alter the callers to change
this behaviour as required.

Patch 2 adds a new m48t59 sysbus device in preparation for use with sun4u in a
subsequent patch.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

v2:
Rebase upon master plus Hervé's isa_mem_base and m48t59 QOM patchsets
Remove addition of mem_base parameter to m48t59_init_isa()


Mark Cave-Ayland (2):
  m48t59: introduce new year_offset qdev property
  m48t59: add m48t59 sysbus device

 hw/ppc/ppc405_boards.c    |    2 +-
 hw/ppc/prep.c             |    2 +-
 hw/sparc/sun4m.c          |    2 +-
 hw/sparc64/sun4u.c        |    2 +-
 hw/timer/m48t59.c         |   31 +++++++++++++++++++------------
 include/hw/timer/m48t59.h |    5 +++--
 6 files changed, 26 insertions(+), 18 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCHv2 1/2] m48t59: introduce new year_offset qdev property
  2015-02-01 18:39 [Qemu-devel] [PATCHv2 0/2] m48t59: add year offset and sysbus device Mark Cave-Ayland
@ 2015-02-01 18:39 ` Mark Cave-Ayland
  2015-02-01 19:50   ` Hervé Poussineau
  2015-02-01 18:39 ` [Qemu-devel] [PATCHv2 2/2] m48t59: add m48t59 sysbus device Mark Cave-Ayland
  1 sibling, 1 reply; 6+ messages in thread
From: Mark Cave-Ayland @ 2015-02-01 18:39 UTC (permalink / raw)
  To: qemu-devel, hpoussin, atar4qemu

Currently the m48t59 device uses the hardware model in order to determine
whether the year value is offset from the hardware value. As this will
soon be required by the x59 model, change the year offset to a qdev
property and update the callers appropriately.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/ppc/ppc405_boards.c    |    2 +-
 hw/ppc/prep.c             |    2 +-
 hw/sparc/sun4m.c          |    2 +-
 hw/sparc64/sun4u.c        |    2 +-
 hw/timer/m48t59.c         |   27 +++++++++++++++------------
 include/hw/timer/m48t59.h |    5 +++--
 6 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 1dcea77..c0c154f 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -283,7 +283,7 @@ static void ref405ep_init(MachineState *machine)
 #ifdef DEBUG_BOARD_INIT
     printf("%s: register NVRAM\n", __func__);
 #endif
-    m48t59_init(NULL, 0xF0000000, 0, 8192, 8);
+    m48t59_init(NULL, 0xF0000000, 0, 8192, 0, 8);
     /* Load kernel */
     linux_boot = (kernel_filename != NULL);
     if (linux_boot) {
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 9290846..55e23e3 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -684,7 +684,7 @@ static void ppc_prep_init(MachineState *machine)
         pci_create_simple(pci_bus, -1, "pci-ohci");
     }
 
-    m48t59 = m48t59_init_isa(isa_bus, 0x0074, NVRAM_SIZE, 59);
+    m48t59 = m48t59_init_isa(isa_bus, 0x0074, NVRAM_SIZE, 0, 59);
     if (m48t59 == NULL)
         return;
     sysctrl->nvram = m48t59;
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 5ff7c5b..d5b2966 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -1014,7 +1014,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
 
     lance_init(&nd_table[0], hwdef->le_base, ledma, ledma_irq);
 
-    nvram = m48t59_init(slavio_irq[0], hwdef->nvram_base, 0, 0x2000, 8);
+    nvram = m48t59_init(slavio_irq[0], hwdef->nvram_base, 0, 0x2000, 68, 8);
 
     slavio_timer_init_all(hwdef->counter_base, slavio_irq[19], slavio_cpu_irq, smp_cpus);
 
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 5833484..0dbc654 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -876,7 +876,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
         fd[i] = drive_get(IF_FLOPPY, 0, i);
     }
     fdctrl_init_isa(isa_bus, fd);
-    nvram = m48t59_init_isa(isa_bus, 0x0074, NVRAM_SIZE, 59);
+    nvram = m48t59_init_isa(isa_bus, 0x0074, NVRAM_SIZE, 0, 59);
 
     initrd_size = 0;
     initrd_addr = 0;
diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c
index 08f0d57..ec420bd 100644
--- a/hw/timer/m48t59.c
+++ b/hw/timer/m48t59.c
@@ -79,6 +79,7 @@ typedef struct M48t59State {
     qemu_irq IRQ;
     MemoryRegion iomem;
     uint32_t size;
+    uint32_t year_offset;
     /* RTC management */
     time_t   time_offset;
     time_t   stop_time;
@@ -387,11 +388,7 @@ static void m48t59_write(M48t59State *NVRAM, uint32_t addr, uint32_t val)
 	tmp = from_bcd(val);
 	if (tmp >= 0 && tmp <= 99) {
 	    get_time(NVRAM, &tm);
-            if (NVRAM->model == 8) {
-                tm.tm_year = from_bcd(val) + 68; // Base year is 1968
-            } else {
-                tm.tm_year = from_bcd(val);
-            }
+            tm.tm_year = from_bcd(val) + NVRAM->year_offset;
 	    set_time(NVRAM, &tm);
 	}
         break;
@@ -493,11 +490,7 @@ static uint32_t m48t59_read(M48t59State *NVRAM, uint32_t addr)
     case 0x07FF:
         /* year */
         get_time(NVRAM, &tm);
-        if (NVRAM->model == 8) {
-            retval = to_bcd(tm.tm_year - 68); // Base year is 1968
-        } else {
-            retval = to_bcd(tm.tm_year);
-        }
+        retval = to_bcd(tm.tm_year - NVRAM->year_offset);
         break;
     default:
         /* Check lock registers state */
@@ -680,7 +673,8 @@ static const MemoryRegionOps m48t59_io_ops = {
 
 /* Initialisation routine */
 Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
-                   uint32_t io_base, uint16_t size, int model)
+                   uint32_t io_base, uint16_t size, uint32_t year_offset,
+                   int model)
 {
     DeviceState *dev;
     SysBusDevice *s;
@@ -694,6 +688,7 @@ Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
         }
 
         dev = qdev_create(NULL, m48txx_info[i].sysbus_name);
+        qdev_prop_set_uint32(dev, "year_offset", year_offset);
         qdev_init_nofail(dev);
         s = SYS_BUS_DEVICE(dev);
         sysbus_connect_irq(s, 0, IRQ);
@@ -713,7 +708,7 @@ Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
 }
 
 Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
-                       int model)
+                       uint32_t year_offset, int model)
 {
     DeviceState *dev;
     int i;
@@ -727,6 +722,7 @@ Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
 
         dev = DEVICE(isa_create(bus, m48txx_info[i].isa_name));
         qdev_prop_set_uint32(dev, "iobase", io_base);
+        qdev_prop_set_uint32(dev, "year_offset", year_offset);
         qdev_init_nofail(dev);
         return NVRAM(dev);
     }
@@ -809,6 +805,7 @@ static void m48txx_isa_toggle_lock(Nvram *obj, int lock)
 }
 
 static Property m48t59_isa_properties[] = {
+    DEFINE_PROP_UINT32("year_offset", M48txxISAState, state.year_offset, 0),
     DEFINE_PROP_UINT32("iobase", M48txxISAState, io_base, 0x74),
     DEFINE_PROP_END_OF_LIST(),
 };
@@ -852,6 +849,11 @@ static void m48txx_sysbus_toggle_lock(Nvram *obj, int lock)
     m48t59_toggle_lock(&d->state, lock);
 }
 
+static Property m48t59_sysbus_properties[] = {
+    DEFINE_PROP_UINT32("year_offset", M48txxSysBusState, state.year_offset, 0),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void m48txx_sysbus_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
@@ -860,6 +862,7 @@ static void m48txx_sysbus_class_init(ObjectClass *klass, void *data)
 
     k->init = m48t59_init1;
     dc->reset = m48t59_reset_sysbus;
+    dc->props = m48t59_sysbus_properties;
     nc->read = m48txx_sysbus_read;
     nc->write = m48txx_sysbus_write;
     nc->toggle_lock = m48txx_sysbus_toggle_lock;
diff --git a/include/hw/timer/m48t59.h b/include/hw/timer/m48t59.h
index cf80d20..00277fb 100644
--- a/include/hw/timer/m48t59.h
+++ b/include/hw/timer/m48t59.h
@@ -26,8 +26,9 @@ typedef struct NvramClass {
 } NvramClass;
 
 Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
-                       int type);
+                       uint32_t year_offset, int type);
 Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
-                   uint32_t io_base, uint16_t size, int type);
+                   uint32_t io_base, uint16_t size, uint32_t year_offset,
+                   int type);
 
 #endif /* !NVRAM_H */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCHv2 2/2] m48t59: add m48t59 sysbus device
  2015-02-01 18:39 [Qemu-devel] [PATCHv2 0/2] m48t59: add year offset and sysbus device Mark Cave-Ayland
  2015-02-01 18:39 ` [Qemu-devel] [PATCHv2 1/2] m48t59: introduce new year_offset qdev property Mark Cave-Ayland
@ 2015-02-01 18:39 ` Mark Cave-Ayland
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Cave-Ayland @ 2015-02-01 18:39 UTC (permalink / raw)
  To: qemu-devel, hpoussin, atar4qemu

This is for subsequent use by the sun4u machine.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/timer/m48t59.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c
index ec420bd..84701ec 100644
--- a/hw/timer/m48t59.c
+++ b/hw/timer/m48t59.c
@@ -129,6 +129,10 @@ static M48txxInfo m48txx_info[] = {
         .model = 8,
         .size = 0x2000,
     },{
+        .sysbus_name = "sysbus-m48t59",
+        .model = 59,
+        .size = 0x2000,
+    },{
         .isa_name = "isa-m48t59",
         .model = 59,
         .size = 0x2000,
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCHv2 1/2] m48t59: introduce new year_offset qdev property
  2015-02-01 18:39 ` [Qemu-devel] [PATCHv2 1/2] m48t59: introduce new year_offset qdev property Mark Cave-Ayland
@ 2015-02-01 19:50   ` Hervé Poussineau
  2015-02-03 21:24     ` Mark Cave-Ayland
  2015-02-14  8:48     ` Mark Cave-Ayland
  0 siblings, 2 replies; 6+ messages in thread
From: Hervé Poussineau @ 2015-02-01 19:50 UTC (permalink / raw)
  To: Mark Cave-Ayland, qemu-devel, atar4qemu

Le 01/02/2015 19:39, Mark Cave-Ayland a écrit :
> Currently the m48t59 device uses the hardware model in order to determine
> whether the year value is offset from the hardware value. As this will
> soon be required by the x59 model, change the year offset to a qdev
> property and update the callers appropriately.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Hi,

Is it possible to use a 'base_year' property, like in the mc146818rtc device?
Usual values will be 0 (for year 2000) and 1968 (for sun4m).

Regards,

Hervé


> ---
>   hw/ppc/ppc405_boards.c    |    2 +-
>   hw/ppc/prep.c             |    2 +-
>   hw/sparc/sun4m.c          |    2 +-
>   hw/sparc64/sun4u.c        |    2 +-
>   hw/timer/m48t59.c         |   27 +++++++++++++++------------
>   include/hw/timer/m48t59.h |    5 +++--
>   6 files changed, 22 insertions(+), 18 deletions(-)
>
> diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
> index 1dcea77..c0c154f 100644
> --- a/hw/ppc/ppc405_boards.c
> +++ b/hw/ppc/ppc405_boards.c
> @@ -283,7 +283,7 @@ static void ref405ep_init(MachineState *machine)
>   #ifdef DEBUG_BOARD_INIT
>       printf("%s: register NVRAM\n", __func__);
>   #endif
> -    m48t59_init(NULL, 0xF0000000, 0, 8192, 8);
> +    m48t59_init(NULL, 0xF0000000, 0, 8192, 0, 8);
>       /* Load kernel */
>       linux_boot = (kernel_filename != NULL);
>       if (linux_boot) {
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 9290846..55e23e3 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -684,7 +684,7 @@ static void ppc_prep_init(MachineState *machine)
>           pci_create_simple(pci_bus, -1, "pci-ohci");
>       }
>
> -    m48t59 = m48t59_init_isa(isa_bus, 0x0074, NVRAM_SIZE, 59);
> +    m48t59 = m48t59_init_isa(isa_bus, 0x0074, NVRAM_SIZE, 0, 59);
>       if (m48t59 == NULL)
>           return;
>       sysctrl->nvram = m48t59;
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index 5ff7c5b..d5b2966 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -1014,7 +1014,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
>
>       lance_init(&nd_table[0], hwdef->le_base, ledma, ledma_irq);
>
> -    nvram = m48t59_init(slavio_irq[0], hwdef->nvram_base, 0, 0x2000, 8);
> +    nvram = m48t59_init(slavio_irq[0], hwdef->nvram_base, 0, 0x2000, 68, 8);
>
>       slavio_timer_init_all(hwdef->counter_base, slavio_irq[19], slavio_cpu_irq, smp_cpus);
>
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index 5833484..0dbc654 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -876,7 +876,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
>           fd[i] = drive_get(IF_FLOPPY, 0, i);
>       }
>       fdctrl_init_isa(isa_bus, fd);
> -    nvram = m48t59_init_isa(isa_bus, 0x0074, NVRAM_SIZE, 59);
> +    nvram = m48t59_init_isa(isa_bus, 0x0074, NVRAM_SIZE, 0, 59);
>
>       initrd_size = 0;
>       initrd_addr = 0;
> diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c
> index 08f0d57..ec420bd 100644
> --- a/hw/timer/m48t59.c
> +++ b/hw/timer/m48t59.c
> @@ -79,6 +79,7 @@ typedef struct M48t59State {
>       qemu_irq IRQ;
>       MemoryRegion iomem;
>       uint32_t size;
> +    uint32_t year_offset;
>       /* RTC management */
>       time_t   time_offset;
>       time_t   stop_time;
> @@ -387,11 +388,7 @@ static void m48t59_write(M48t59State *NVRAM, uint32_t addr, uint32_t val)
>   	tmp = from_bcd(val);
>   	if (tmp >= 0 && tmp <= 99) {
>   	    get_time(NVRAM, &tm);
> -            if (NVRAM->model == 8) {
> -                tm.tm_year = from_bcd(val) + 68; // Base year is 1968
> -            } else {
> -                tm.tm_year = from_bcd(val);
> -            }
> +            tm.tm_year = from_bcd(val) + NVRAM->year_offset;
>   	    set_time(NVRAM, &tm);
>   	}
>           break;
> @@ -493,11 +490,7 @@ static uint32_t m48t59_read(M48t59State *NVRAM, uint32_t addr)
>       case 0x07FF:
>           /* year */
>           get_time(NVRAM, &tm);
> -        if (NVRAM->model == 8) {
> -            retval = to_bcd(tm.tm_year - 68); // Base year is 1968
> -        } else {
> -            retval = to_bcd(tm.tm_year);
> -        }
> +        retval = to_bcd(tm.tm_year - NVRAM->year_offset);
>           break;
>       default:
>           /* Check lock registers state */
> @@ -680,7 +673,8 @@ static const MemoryRegionOps m48t59_io_ops = {
>
>   /* Initialisation routine */
>   Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
> -                   uint32_t io_base, uint16_t size, int model)
> +                   uint32_t io_base, uint16_t size, uint32_t year_offset,
> +                   int model)
>   {
>       DeviceState *dev;
>       SysBusDevice *s;
> @@ -694,6 +688,7 @@ Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
>           }
>
>           dev = qdev_create(NULL, m48txx_info[i].sysbus_name);
> +        qdev_prop_set_uint32(dev, "year_offset", year_offset);
>           qdev_init_nofail(dev);
>           s = SYS_BUS_DEVICE(dev);
>           sysbus_connect_irq(s, 0, IRQ);
> @@ -713,7 +708,7 @@ Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
>   }
>
>   Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
> -                       int model)
> +                       uint32_t year_offset, int model)
>   {
>       DeviceState *dev;
>       int i;
> @@ -727,6 +722,7 @@ Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
>
>           dev = DEVICE(isa_create(bus, m48txx_info[i].isa_name));
>           qdev_prop_set_uint32(dev, "iobase", io_base);
> +        qdev_prop_set_uint32(dev, "year_offset", year_offset);
>           qdev_init_nofail(dev);
>           return NVRAM(dev);
>       }
> @@ -809,6 +805,7 @@ static void m48txx_isa_toggle_lock(Nvram *obj, int lock)
>   }
>
>   static Property m48t59_isa_properties[] = {
> +    DEFINE_PROP_UINT32("year_offset", M48txxISAState, state.year_offset, 0),
>       DEFINE_PROP_UINT32("iobase", M48txxISAState, io_base, 0x74),
>       DEFINE_PROP_END_OF_LIST(),
>   };
> @@ -852,6 +849,11 @@ static void m48txx_sysbus_toggle_lock(Nvram *obj, int lock)
>       m48t59_toggle_lock(&d->state, lock);
>   }
>
> +static Property m48t59_sysbus_properties[] = {
> +    DEFINE_PROP_UINT32("year_offset", M48txxSysBusState, state.year_offset, 0),
> +    DEFINE_PROP_END_OF_LIST(),
> +};
> +
>   static void m48txx_sysbus_class_init(ObjectClass *klass, void *data)
>   {
>       DeviceClass *dc = DEVICE_CLASS(klass);
> @@ -860,6 +862,7 @@ static void m48txx_sysbus_class_init(ObjectClass *klass, void *data)
>
>       k->init = m48t59_init1;
>       dc->reset = m48t59_reset_sysbus;
> +    dc->props = m48t59_sysbus_properties;
>       nc->read = m48txx_sysbus_read;
>       nc->write = m48txx_sysbus_write;
>       nc->toggle_lock = m48txx_sysbus_toggle_lock;
> diff --git a/include/hw/timer/m48t59.h b/include/hw/timer/m48t59.h
> index cf80d20..00277fb 100644
> --- a/include/hw/timer/m48t59.h
> +++ b/include/hw/timer/m48t59.h
> @@ -26,8 +26,9 @@ typedef struct NvramClass {
>   } NvramClass;
>
>   Nvram *m48t59_init_isa(ISABus *bus, uint32_t io_base, uint16_t size,
> -                       int type);
> +                       uint32_t year_offset, int type);
>   Nvram *m48t59_init(qemu_irq IRQ, hwaddr mem_base,
> -                   uint32_t io_base, uint16_t size, int type);
> +                   uint32_t io_base, uint16_t size, uint32_t year_offset,
> +                   int type);
>
>   #endif /* !NVRAM_H */
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCHv2 1/2] m48t59: introduce new year_offset qdev property
  2015-02-01 19:50   ` Hervé Poussineau
@ 2015-02-03 21:24     ` Mark Cave-Ayland
  2015-02-14  8:48     ` Mark Cave-Ayland
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Cave-Ayland @ 2015-02-03 21:24 UTC (permalink / raw)
  To: Hervé Poussineau, qemu-devel, atar4qemu

On 01/02/15 19:50, Hervé Poussineau wrote:

> Le 01/02/2015 19:39, Mark Cave-Ayland a écrit :
>> Currently the m48t59 device uses the hardware model in order to determine
>> whether the year value is offset from the hardware value. As this will
>> soon be required by the x59 model, change the year offset to a qdev
>> property and update the callers appropriately.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> Hi,
> 
> Is it possible to use a 'base_year' property, like in the mc146818rtc
> device?
> Usual values will be 0 (for year 2000) and 1968 (for sun4m).
> 
> Regards,
> 
> Hervé

Hi Hervé,

Yes I could do this to match the mc146818rtc if that help makes
everything consistent. Can you clarify exactly how the base_year
wraparound works in the above example? (e.g. what happens for base_year
2001, and what are the maximum/minimum values that should be accepted
for the wraparound logic).

Also how should these patches get merged? According to get_maintainer.pl
this part of the tree feels particularly unloved, or would you now
consider yourself to be a reviewer/maintainer?


ATB,

Mark.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCHv2 1/2] m48t59: introduce new year_offset qdev property
  2015-02-01 19:50   ` Hervé Poussineau
  2015-02-03 21:24     ` Mark Cave-Ayland
@ 2015-02-14  8:48     ` Mark Cave-Ayland
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Cave-Ayland @ 2015-02-14  8:48 UTC (permalink / raw)
  To: Hervé Poussineau, qemu-devel, atar4qemu

On 01/02/15 19:50, Hervé Poussineau wrote:

> Le 01/02/2015 19:39, Mark Cave-Ayland a écrit :
>> Currently the m48t59 device uses the hardware model in order to determine
>> whether the year value is offset from the hardware value. As this will
>> soon be required by the x59 model, change the year offset to a qdev
>> property and update the callers appropriately.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> Hi,
> 
> Is it possible to use a 'base_year' property, like in the mc146818rtc
> device?
> Usual values will be 0 (for year 2000) and 1968 (for sun4m).
> 
> Regards,
> 
> Hervé

Hi Hervé,

I've just rebased and updated the patchset to use a "base_year" property
similar to mc146818rtc. AFAICT the hack for 0 representing year 2000
isn't relevant here since QEMU doesn't currently implement the century
bit and so the year is limited to 0-99. I'll send the new version out
shortly.


ATB,

Mark.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-02-14  8:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-01 18:39 [Qemu-devel] [PATCHv2 0/2] m48t59: add year offset and sysbus device Mark Cave-Ayland
2015-02-01 18:39 ` [Qemu-devel] [PATCHv2 1/2] m48t59: introduce new year_offset qdev property Mark Cave-Ayland
2015-02-01 19:50   ` Hervé Poussineau
2015-02-03 21:24     ` Mark Cave-Ayland
2015-02-14  8:48     ` Mark Cave-Ayland
2015-02-01 18:39 ` [Qemu-devel] [PATCHv2 2/2] m48t59: add m48t59 sysbus device Mark Cave-Ayland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.