qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels
@ 2011-02-11 20:57 Dmitry Eremin-Solenikov
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 2/7] Drop unnecessary inclusions of pxa.h header Dmitry Eremin-Solenikov
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-02-11 20:57 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 hw/zaurus.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/hw/zaurus.c b/hw/zaurus.c
index fca11a5..fb5e228 100644
--- a/hw/zaurus.c
+++ b/hw/zaurus.c
@@ -181,17 +181,34 @@ static int scoop_init(SysBusDevice *dev)
     return 0;
 }
 
+static int scoop_post_load(void *opaque, int version_id)
+{
+    ScoopInfo *s = (ScoopInfo *) opaque;
+    int i;
+    uint32_t level;
+
+    level = s->gpio_level & s->gpio_dir;
+
+    for (i = 0; i < 16; i++) {
+        qemu_set_irq(s->handler[i], (level >> i) & 1);
+    }
+
+    s->prev_level = level;
+
+    return 0;
+}
+
 static bool is_version_0 (void *opaque, int version_id)
 {
     return version_id == 0;
 }
 
-
 static const VMStateDescription vmstate_scoop_regs = {
     .name = "scoop",
     .version_id = 1,
     .minimum_version_id = 0,
     .minimum_version_id_old = 0,
+    .post_load = scoop_post_load,
     .fields = (VMStateField []) {
         VMSTATE_UINT16(status, ScoopInfo),
         VMSTATE_UINT16(power, ScoopInfo),
-- 
1.7.2.3

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

* [Qemu-devel] [PATCH 2/7] Drop unnecessary inclusions of pxa.h header
  2011-02-11 20:57 [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels Dmitry Eremin-Solenikov
@ 2011-02-11 20:57 ` Dmitry Eremin-Solenikov
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 3/7] mainstone: pass one irq to the mst_fpga instead of the whole PIC Dmitry Eremin-Solenikov
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-02-11 20:57 UTC (permalink / raw)
  To: qemu-devel

Seceral files contained onnecessary dependencies on hw/pxa.h header.
Drop unused references.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 hw/tc6393xb.c |    1 -
 hw/zaurus.c   |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/hw/tc6393xb.c b/hw/tc6393xb.c
index c3fbe4e..2104d4e 100644
--- a/hw/tc6393xb.c
+++ b/hw/tc6393xb.c
@@ -8,7 +8,6 @@
  * This code is licensed under the GNU GPL v2.
  */
 #include "hw.h"
-#include "pxa.h"
 #include "devices.h"
 #include "flash.h"
 #include "console.h"
diff --git a/hw/zaurus.c b/hw/zaurus.c
index fb5e228..c24aeb5 100644
--- a/hw/zaurus.c
+++ b/hw/zaurus.c
@@ -16,7 +16,6 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "hw.h"
-#include "pxa.h"
 #include "sharpsl.h"
 #include "sysbus.h"
 
-- 
1.7.2.3

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

* [Qemu-devel] [PATCH 3/7] mainstone: pass one irq to the mst_fpga instead of the whole PIC
  2011-02-11 20:57 [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels Dmitry Eremin-Solenikov
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 2/7] Drop unnecessary inclusions of pxa.h header Dmitry Eremin-Solenikov
@ 2011-02-11 20:57 ` Dmitry Eremin-Solenikov
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 4/7] tc6393xb: correct NAND isr assertion Dmitry Eremin-Solenikov
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-02-11 20:57 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 hw/mainstone.c |    2 +-
 hw/mainstone.h |    2 +-
 hw/mst_fpga.c  |   12 ++++++------
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/mainstone.c b/hw/mainstone.c
index 58e3f86..18d1415 100644
--- a/hw/mainstone.c
+++ b/hw/mainstone.c
@@ -117,7 +117,7 @@ static void mainstone_common_init(ram_addr_t ram_size,
         }
     }
 
-    mst_irq = mst_irq_init(cpu, MST_FPGA_PHYS, PXA2XX_PIC_GPIO_0);
+    mst_irq = mst_irq_init(MST_FPGA_PHYS, cpu->pic[PXA2XX_PIC_GPIO_0]);
 
     /* setup keypad */
     printf("map addr %p\n", &map);
diff --git a/hw/mainstone.h b/hw/mainstone.h
index 9618c06..35329f1 100644
--- a/hw/mainstone.h
+++ b/hw/mainstone.h
@@ -33,6 +33,6 @@
 #define S1_IRQ        15
 
 extern qemu_irq
-*mst_irq_init(PXA2xxState *cpu, uint32_t base, int irq);
+*mst_irq_init(uint32_t base, qemu_irq irq);
 
 #endif /* __MAINSTONE_H__ */
diff --git a/hw/mst_fpga.c b/hw/mst_fpga.c
index 5252fc5..b59352b 100644
--- a/hw/mst_fpga.c
+++ b/hw/mst_fpga.c
@@ -28,7 +28,7 @@
 #define MST_PCMCIA1		0xe4
 
 typedef struct mst_irq_state{
-	qemu_irq *parent;
+	qemu_irq parent;
 	qemu_irq *pins;
 
 	uint32_t prev_level;
@@ -72,7 +72,7 @@ mst_fpga_set_irq(void *opaque, int irq, int level)
 
 	if(s->intmskena & (1u << irq)) {
 		s->intsetclr = 1u << irq;
-		qemu_set_irq(s->parent[0], level);
+		qemu_set_irq(s->parent, level);
 	}
 }
 
@@ -109,7 +109,7 @@ mst_fpga_readb(void *opaque, target_phys_addr_t addr)
 		return s->pcmcia1;
 	default:
 		printf("Mainstone - mst_fpga_readb: Bad register offset "
-			REG_FMT " \n", addr);
+			"0x" TARGET_FMT_plx " \n", addr);
 	}
 	return 0;
 }
@@ -160,7 +160,7 @@ mst_fpga_writeb(void *opaque, target_phys_addr_t addr, uint32_t value)
 		break;
 	default:
 		printf("Mainstone - mst_fpga_writeb: Bad register offset "
-			REG_FMT " \n", addr);
+			"0x" TARGET_FMT_plx " \n", addr);
 	}
 }
 
@@ -216,7 +216,7 @@ mst_fpga_load(QEMUFile *f, void *opaque, int version_id)
 	return 0;
 }
 
-qemu_irq *mst_irq_init(PXA2xxState *cpu, uint32_t base, int irq)
+qemu_irq *mst_irq_init(uint32_t base, qemu_irq irq)
 {
 	mst_irq_state *s;
 	int iomemtype;
@@ -225,7 +225,7 @@ qemu_irq *mst_irq_init(PXA2xxState *cpu, uint32_t base, int irq)
 	s = (mst_irq_state  *)
 		qemu_mallocz(sizeof(mst_irq_state));
 
-	s->parent = &cpu->pic[irq];
+	s->parent = irq;
 
 	/* alloc the external 16 irqs */
 	qi  = qemu_allocate_irqs(mst_fpga_set_irq, s, MST_NUM_IRQS);
-- 
1.7.2.3

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

* [Qemu-devel] [PATCH 4/7] tc6393xb: correct NAND isr assertion
  2011-02-11 20:57 [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels Dmitry Eremin-Solenikov
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 2/7] Drop unnecessary inclusions of pxa.h header Dmitry Eremin-Solenikov
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 3/7] mainstone: pass one irq to the mst_fpga instead of the whole PIC Dmitry Eremin-Solenikov
@ 2011-02-11 20:57 ` Dmitry Eremin-Solenikov
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 5/7] tosa: we aren't connected to VBus, pass this info to Linux kernel Dmitry Eremin-Solenikov
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-02-11 20:57 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 hw/tc6393xb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/tc6393xb.c b/hw/tc6393xb.c
index 2104d4e..ed49e94 100644
--- a/hw/tc6393xb.c
+++ b/hw/tc6393xb.c
@@ -380,7 +380,7 @@ static void tc6393xb_nand_writeb(TC6393xbState *s, target_phys_addr_t addr, uint
         case NAND_DATA + 2:
         case NAND_DATA + 3:
             nand_setio(s->flash, value);
-            s->nand.isr &= 1;
+            s->nand.isr |= 1;
             tc6393xb_nand_irq(s);
             return;
         case NAND_MODE:
-- 
1.7.2.3

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

* [Qemu-devel] [PATCH 5/7] tosa: we aren't connected to VBus, pass this info to Linux kernel
  2011-02-11 20:57 [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels Dmitry Eremin-Solenikov
                   ` (2 preceding siblings ...)
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 4/7] tc6393xb: correct NAND isr assertion Dmitry Eremin-Solenikov
@ 2011-02-11 20:57 ` Dmitry Eremin-Solenikov
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 6/7] max7310: finish qdev'ication Dmitry Eremin-Solenikov
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-02-11 20:57 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 hw/tosa.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/tosa.c b/hw/tosa.c
index 0bfab16..b8b6c4f 100644
--- a/hw/tosa.c
+++ b/hw/tosa.c
@@ -25,6 +25,7 @@
 #define TOSA_RAM    0x04000000
 #define TOSA_ROM	0x00800000
 
+#define TOSA_GPIO_USB_IN		(5)
 #define TOSA_GPIO_nSD_DETECT	(9)
 #define TOSA_GPIO_ON_RESET		(19)
 #define TOSA_GPIO_CF_IRQ		(21)	/* CF slot0 Ready */
@@ -115,6 +116,9 @@ static void tosa_gpio_setup(PXA2xxState *cpu,
     qdev_connect_gpio_out(scp1, TOSA_GPIO_WLAN_LED, outsignals[3]);
 
     qdev_connect_gpio_out(scp1, TOSA_GPIO_TC6393XB_L3V_ON, tc6393xb_l3v_get(tmio));
+
+    /* UDC Vbus */
+    qemu_irq_raise(qdev_get_gpio_in(cpu->gpio, TOSA_GPIO_USB_IN));
 }
 
 static uint32_t tosa_ssp_tansfer(SSISlave *dev, uint32_t value)
-- 
1.7.2.3

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

* [Qemu-devel] [PATCH 6/7] max7310: finish qdev'ication
  2011-02-11 20:57 [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels Dmitry Eremin-Solenikov
                   ` (3 preceding siblings ...)
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 5/7] tosa: we aren't connected to VBus, pass this info to Linux kernel Dmitry Eremin-Solenikov
@ 2011-02-11 20:57 ` Dmitry Eremin-Solenikov
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 7/7] pxa2xx: convert i2c master to use qdev/vmsd Dmitry Eremin-Solenikov
  2011-02-11 22:37 ` [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels andrzej zaborowski
  6 siblings, 0 replies; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-02-11 20:57 UTC (permalink / raw)
  To: qemu-devel

1) Move GPIO-related functionality to qdev. Now one can use directly
qdev_get_gpio_in()/qdev_connect_gpio_out() on max7310 devices.

2) Make reset to be called through qdev.reset callback.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 hw/i2c.h     |    5 -----
 hw/max7310.c |   26 +++++---------------------
 2 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/hw/i2c.h b/hw/i2c.h
index 83fd917..5514402 100644
--- a/hw/i2c.h
+++ b/hw/i2c.h
@@ -59,11 +59,6 @@ void i2c_register_slave(I2CSlaveInfo *type);
 
 DeviceState *i2c_create_slave(i2c_bus *bus, const char *name, uint8_t addr);
 
-/* max7310.c */
-void max7310_reset(i2c_slave *i2c);
-qemu_irq *max7310_gpio_in_get(i2c_slave *i2c);
-void max7310_gpio_out_set(i2c_slave *i2c, int line, qemu_irq handler);
-
 /* wm8750.c */
 void wm8750_data_req_set(DeviceState *dev,
                 void (*data_req)(void *, int, int), void *opaque);
diff --git a/hw/max7310.c b/hw/max7310.c
index c302eb6..c1bdb2e 100644
--- a/hw/max7310.c
+++ b/hw/max7310.c
@@ -23,9 +23,9 @@ typedef struct {
     qemu_irq *gpio_in;
 } MAX7310State;
 
-void max7310_reset(i2c_slave *i2c)
+static void max7310_reset(DeviceState *dev)
 {
-    MAX7310State *s = (MAX7310State *) i2c;
+    MAX7310State *s = FROM_I2C_SLAVE(MAX7310State, I2C_SLAVE_FROM_QDEV(dev));
     s->level &= s->direction;
     s->direction = 0xff;
     s->polarity = 0xf0;
@@ -179,33 +179,17 @@ static int max7310_init(i2c_slave *i2c)
 {
     MAX7310State *s = FROM_I2C_SLAVE(MAX7310State, i2c);
 
-    s->gpio_in = qemu_allocate_irqs(max7310_gpio_set, s,
-                    ARRAY_SIZE(s->handler));
-
-    max7310_reset(&s->i2c);
+    qdev_init_gpio_in(&i2c->qdev, max7310_gpio_set, 8);
+    qdev_init_gpio_out(&i2c->qdev, s->handler, 8);
 
     return 0;
 }
 
-qemu_irq *max7310_gpio_in_get(i2c_slave *i2c)
-{
-    MAX7310State *s = (MAX7310State *) i2c;
-    return s->gpio_in;
-}
-
-void max7310_gpio_out_set(i2c_slave *i2c, int line, qemu_irq handler)
-{
-    MAX7310State *s = (MAX7310State *) i2c;
-    if (line >= ARRAY_SIZE(s->handler) || line  < 0)
-        hw_error("bad GPIO line");
-
-    s->handler[line] = handler;
-}
-
 static I2CSlaveInfo max7310_info = {
     .qdev.name = "max7310",
     .qdev.size = sizeof(MAX7310State),
     .qdev.vmsd = &vmstate_max7310,
+    .qdev.reset = max7310_reset,
     .init = max7310_init,
     .event = max7310_event,
     .recv = max7310_rx,
-- 
1.7.2.3

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

* [Qemu-devel] [PATCH 7/7] pxa2xx: convert i2c master to use qdev/vmsd
  2011-02-11 20:57 [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels Dmitry Eremin-Solenikov
                   ` (4 preceding siblings ...)
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 6/7] max7310: finish qdev'ication Dmitry Eremin-Solenikov
@ 2011-02-11 20:57 ` Dmitry Eremin-Solenikov
  2011-02-11 22:37 ` [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels andrzej zaborowski
  6 siblings, 0 replies; 8+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-02-11 20:57 UTC (permalink / raw)
  To: qemu-devel

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 hw/pxa2xx.c |   53 ++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 42 insertions(+), 11 deletions(-)

diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index d966846..9ebbce6 100644
--- a/hw/pxa2xx.c
+++ b/hw/pxa2xx.c
@@ -1262,10 +1262,12 @@ typedef struct {
 } PXA2xxI2CSlaveState;
 
 struct PXA2xxI2CState {
+    SysBusDevice busdev;
     PXA2xxI2CSlaveState *slave;
     i2c_bus *bus;
     qemu_irq irq;
-    target_phys_addr_t offset;
+    uint32_t offset;
+    uint32_t region_size;
 
     uint16_t control;
     uint16_t status;
@@ -1499,27 +1501,42 @@ static I2CSlaveInfo pxa2xx_i2c_slave_info = {
 PXA2xxI2CState *pxa2xx_i2c_init(target_phys_addr_t base,
                 qemu_irq irq, uint32_t region_size)
 {
-    int iomemtype;
     DeviceState *dev;
-    PXA2xxI2CState *s = qemu_mallocz(sizeof(PXA2xxI2CState));
+    SysBusDevice *i2c_dev;
+    PXA2xxI2CState *s;
+
+    i2c_dev = sysbus_from_qdev(qdev_create(NULL, "pxa2xx_i2c"));
+    qdev_prop_set_uint32(&i2c_dev->qdev, "size", region_size + 1);
+    qdev_prop_set_uint32(&i2c_dev->qdev, "offset",
+            base - (base & (~region_size) & TARGET_PAGE_MASK));
+
+    qdev_init_nofail(&i2c_dev->qdev);
+
+    sysbus_mmio_map(i2c_dev, 0, base & ~region_size);
+    sysbus_connect_irq(i2c_dev, 0, irq);
 
+    s = FROM_SYSBUS(PXA2xxI2CState, i2c_dev);
     /* FIXME: Should the slave device really be on a separate bus?  */
     dev = i2c_create_slave(i2c_init_bus(NULL, "dummy"), "pxa2xx-i2c-slave", 0);
     s->slave = FROM_I2C_SLAVE(PXA2xxI2CSlaveState, I2C_SLAVE_FROM_QDEV(dev));
     s->slave->host = s;
 
-    s->irq = irq;
-    s->bus = i2c_init_bus(NULL, "i2c");
-    s->offset = base - (base & (~region_size) & TARGET_PAGE_MASK);
+    return s;
+}
+
+static int pxa2xx_i2c_initfn(SysBusDevice *dev)
+{
+    PXA2xxI2CState *s = FROM_SYSBUS(PXA2xxI2CState, dev);
+    int iomemtype;
+
+    s->bus = i2c_init_bus(&dev->qdev, "i2c");
 
     iomemtype = cpu_register_io_memory(pxa2xx_i2c_readfn,
                     pxa2xx_i2c_writefn, s, DEVICE_NATIVE_ENDIAN);
-    cpu_register_physical_memory(base & ~region_size,
-                    region_size + 1, iomemtype);
-
-    vmstate_register(NULL, base, &vmstate_pxa2xx_i2c, s);
+    sysbus_init_mmio(dev, s->region_size, iomemtype);
+    sysbus_init_irq(dev, &s->irq);
 
-    return s;
+    return 0;
 }
 
 i2c_bus *pxa2xx_i2c_bus(PXA2xxI2CState *s)
@@ -1527,6 +1544,19 @@ i2c_bus *pxa2xx_i2c_bus(PXA2xxI2CState *s)
     return s->bus;
 }
 
+static SysBusDeviceInfo pxa2xx_i2c_info = {
+    .init       = pxa2xx_i2c_initfn,
+    .qdev.name  = "pxa2xx_i2c",
+    .qdev.desc  = "PXA2xx I2C Bus Controller",
+    .qdev.size  = sizeof(PXA2xxI2CState),
+    .qdev.vmsd  = &vmstate_pxa2xx_i2c,
+    .qdev.props = (Property[]) {
+        DEFINE_PROP_UINT32("size", PXA2xxI2CState, region_size, 0x10000),
+        DEFINE_PROP_UINT32("offset", PXA2xxI2CState, offset, 0),
+        DEFINE_PROP_END_OF_LIST(),
+    },
+};
+
 /* PXA Inter-IC Sound Controller */
 static void pxa2xx_i2s_reset(PXA2xxI2SState *i2s)
 {
@@ -2287,6 +2317,7 @@ static void pxa2xx_register_devices(void)
 {
     i2c_register_slave(&pxa2xx_i2c_slave_info);
     sysbus_register_dev("pxa2xx-ssp", sizeof(PXA2xxSSPState), pxa2xx_ssp_init);
+    sysbus_register_withprop(&pxa2xx_i2c_info);
 }
 
 device_init(pxa2xx_register_devices)
-- 
1.7.2.3

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

* Re: [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels
  2011-02-11 20:57 [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels Dmitry Eremin-Solenikov
                   ` (5 preceding siblings ...)
  2011-02-11 20:57 ` [Qemu-devel] [PATCH 7/7] pxa2xx: convert i2c master to use qdev/vmsd Dmitry Eremin-Solenikov
@ 2011-02-11 22:37 ` andrzej zaborowski
  6 siblings, 0 replies; 8+ messages in thread
From: andrzej zaborowski @ 2011-02-11 22:37 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: qemu-devel

On 11 February 2011 21:57, Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  hw/zaurus.c |   19 ++++++++++++++++++-
>  1 files changed, 18 insertions(+), 1 deletions(-)
>
> diff --git a/hw/zaurus.c b/hw/zaurus.c
> index fca11a5..fb5e228 100644
> --- a/hw/zaurus.c
> +++ b/hw/zaurus.c
> @@ -181,17 +181,34 @@ static int scoop_init(SysBusDevice *dev)
>     return 0;
>  }
>
> +static int scoop_post_load(void *opaque, int version_id)
> +{
> +    ScoopInfo *s = (ScoopInfo *) opaque;
> +    int i;
> +    uint32_t level;
> +
> +    level = s->gpio_level & s->gpio_dir;
> +
> +    for (i = 0; i < 16; i++) {
> +        qemu_set_irq(s->handler[i], (level >> i) & 1);
> +    }
> +
> +    s->prev_level = level;
> +
> +    return 0;
> +}
> +
>  static bool is_version_0 (void *opaque, int version_id)
>  {
>     return version_id == 0;
>  }
>
> -
>  static const VMStateDescription vmstate_scoop_regs = {
>     .name = "scoop",
>     .version_id = 1,
>     .minimum_version_id = 0,
>     .minimum_version_id_old = 0,
> +    .post_load = scoop_post_load,
>     .fields = (VMStateField []) {
>         VMSTATE_UINT16(status, ScoopInfo),
>         VMSTATE_UINT16(power, ScoopInfo),
> --
> 1.7.2.3

Thanks, pushed all 7 changes and also dropped the pxa.h #include in
hw/mst_fpga.c

Cheers

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

end of thread, other threads:[~2011-02-11 22:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-11 20:57 [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels Dmitry Eremin-Solenikov
2011-02-11 20:57 ` [Qemu-devel] [PATCH 2/7] Drop unnecessary inclusions of pxa.h header Dmitry Eremin-Solenikov
2011-02-11 20:57 ` [Qemu-devel] [PATCH 3/7] mainstone: pass one irq to the mst_fpga instead of the whole PIC Dmitry Eremin-Solenikov
2011-02-11 20:57 ` [Qemu-devel] [PATCH 4/7] tc6393xb: correct NAND isr assertion Dmitry Eremin-Solenikov
2011-02-11 20:57 ` [Qemu-devel] [PATCH 5/7] tosa: we aren't connected to VBus, pass this info to Linux kernel Dmitry Eremin-Solenikov
2011-02-11 20:57 ` [Qemu-devel] [PATCH 6/7] max7310: finish qdev'ication Dmitry Eremin-Solenikov
2011-02-11 20:57 ` [Qemu-devel] [PATCH 7/7] pxa2xx: convert i2c master to use qdev/vmsd Dmitry Eremin-Solenikov
2011-02-11 22:37 ` [Qemu-devel] [PATCH 1/7] Add scoop post_load callback that sets IRQs to loaded levels andrzej zaborowski

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).