summaryrefslogtreecommitdiff
path: root/hw/omap1.c
diff options
context:
space:
mode:
authorJuha Riihimäki <juha.riihimaki@nokia.com>2012-03-14 15:37:53 +0000
committerPeter Maydell <peter.maydell@linaro.org>2012-03-15 16:54:21 +0000
commit54e17933bf78cdbbeb0f12b2db38f210c2a992d4 (patch)
treea078e79ad74c55b492c6a8080d6eeefc49f84a69 /hw/omap1.c
parentae7d54d489540b49b7c13a7df7ddc220588a2ced (diff)
downloadqemu-54e17933bf78cdbbeb0f12b2db38f210c2a992d4.tar.gz
qemu-54e17933bf78cdbbeb0f12b2db38f210c2a992d4.tar.bz2
qemu-54e17933bf78cdbbeb0f12b2db38f210c2a992d4.zip
hw/omap_i2c: Convert to qdev
Convert the omap_i2c device to qdev. Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> [Riku Voipio: Fixes and restructuring patchset] Signed-off-by: Riku Voipio <riku.voipio@iki.fi> [Peter Maydell: More fixes and cleanups for upstream submission] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/omap1.c')
-rw-r--r--hw/omap1.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/hw/omap1.c b/hw/omap1.c
index 5317b9be2b..2a341bfe7f 100644
--- a/hw/omap1.c
+++ b/hw/omap1.c
@@ -3694,7 +3694,6 @@ static void omap1_mpu_reset(void *opaque)
omap_uwire_reset(mpu->microwire);
omap_pwl_reset(mpu->pwl);
omap_pwt_reset(mpu->pwt);
- omap_i2c_reset(mpu->i2c[0]);
omap_rtc_reset(mpu->rtc);
omap_mcbsp_reset(mpu->mcbsp1);
omap_mcbsp_reset(mpu->mcbsp2);
@@ -3993,9 +3992,15 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory,
s->pwt = omap_pwt_init(system_memory, 0xfffb6000,
omap_findclk(s, "armxor_ck"));
- s->i2c[0] = omap_i2c_init(system_memory, 0xfffb3800,
- qdev_get_gpio_in(s->ih[1], OMAP_INT_I2C),
- &s->drq[OMAP_DMA_I2C_RX], omap_findclk(s, "mpuper_ck"));
+ s->i2c[0] = qdev_create(NULL, "omap_i2c");
+ qdev_prop_set_uint8(s->i2c[0], "revision", 0x11);
+ qdev_prop_set_ptr(s->i2c[0], "fclk", omap_findclk(s, "mpuper_ck"));
+ qdev_init_nofail(s->i2c[0]);
+ busdev = sysbus_from_qdev(s->i2c[0]);
+ sysbus_connect_irq(busdev, 0, qdev_get_gpio_in(s->ih[1], OMAP_INT_I2C));
+ sysbus_connect_irq(busdev, 1, s->drq[OMAP_DMA_I2C_TX]);
+ sysbus_connect_irq(busdev, 2, s->drq[OMAP_DMA_I2C_RX]);
+ sysbus_mmio_map(busdev, 0, 0xfffb3800);
s->rtc = omap_rtc_init(system_memory, 0xfffb4800,
qdev_get_gpio_in(s->ih[1], OMAP_INT_RTC_TIMER),