qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Benoit Canet <benoit.canet@gmail.com>
To: qemu-devel@nongnu.org
Cc: Benoit Canet <benoit.canet@gmail.com>
Subject: [Qemu-devel] [PATCH 6/9] Add the Versatile I2C device to versatilepb.c
Date: Fri, 14 Aug 2009 22:23:17 +0200	[thread overview]
Message-ID: <1250281397-7660-7-git-send-email-benoit.canet@gmail.com> (raw)
In-Reply-To: <1250281397-7660-6-git-send-email-benoit.canet@gmail.com>


Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
---
 hw/versatilepb.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/versatilepb.c b/hw/versatilepb.c
index 3371121..afc473d 100644
--- a/hw/versatilepb.c
+++ b/hw/versatilepb.c
@@ -9,6 +9,7 @@
 
 #include "sysbus.h"
 #include "arm-misc.h"
+#include "i2c.h"
 #include "primecell.h"
 #include "devices.h"
 #include "net.h"
@@ -170,6 +171,9 @@ static void versatile_init(ram_addr_t ram_size,
     NICInfo *nd;
     int n;
     int done_smc = 0;
+    DeviceState *bitbang_i2c_dev;
+    DeviceState *i2c_dev;
+    i2c_bus *i2c;
 
     if (!cpu_model)
         cpu_model = "arm926";
@@ -224,6 +228,15 @@ static void versatile_init(ram_addr_t ram_size,
         n--;
     }
 
+    bitbang_i2c_dev = sysbus_create_varargs("bitbang_i2c", 0, NULL);
+    i2c = (i2c_bus *)qdev_get_child_bus(bitbang_i2c_dev, "i2c");
+
+    i2c_dev = sysbus_create_varargs("versatile,i2c", 0x10002000, NULL);
+
+    qdev_connect_gpio_out(bitbang_i2c_dev, 0, qdev_get_gpio_in(i2c_dev, 0));
+    qdev_connect_gpio_out(i2c_dev, 0, qdev_get_gpio_in(bitbang_i2c_dev, 0));
+    qdev_connect_gpio_out(i2c_dev, 1, qdev_get_gpio_in(bitbang_i2c_dev, 1));
+
     sysbus_create_simple("pl011", 0x101f1000, pic[12]);
     sysbus_create_simple("pl011", 0x101f2000, pic[13]);
     sysbus_create_simple("pl011", 0x101f3000, pic[14]);
@@ -243,6 +256,9 @@ static void versatile_init(ram_addr_t ram_size,
     /* Add PL031 Real Time Clock. */
     sysbus_create_simple("pl031", 0x101e8000, pic[10]);
 
+    dev = sysbus_create_simple("bitbang_i2c", 0, NULL);
+    i2c = (i2c_bus *)qdev_get_child_bus(i2c_dev, "i2c");
+
     /* Memory map for Versatile/PB:  */
     /* 0x10000000 System registers.  */
     /* 0x10001000 PCI controller config registers.  */
-- 
1.6.0.4

      reply	other threads:[~2009-08-14 20:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-14 20:23 [Qemu-devel] [Fix] Musicpal I2C bitbanging extraction and Versatile I2C device creation Benoit Canet
2009-08-14 20:23 ` [Qemu-devel] [PATCH 1/9] Musicpal qdev conversion : gpio (except I2C part), keyboard and lcd Benoit Canet
2009-08-14 20:23   ` [Qemu-devel] [PATCH 2/9] Extract musicpal.c I2C bitbanging code and make it gpio aware Benoit Canet
2009-08-14 20:23     ` [Qemu-devel] [PATCH 3/9] Extract the Marvell 88w8618 audio device from musicpal.c Benoit Canet
2009-08-14 20:23       ` [Qemu-devel] [PATCH 4/9] Make musicpal.c use the I2C device and the Marvell 88w8618 audio device Benoit Canet
2009-08-14 20:23         ` [Qemu-devel] [PATCH 5/9] Create a Versatile I2C device using the I2C bitbanging module Benoit Canet
2009-08-14 20:23           ` Benoit Canet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1250281397-7660-7-git-send-email-benoit.canet@gmail.com \
    --to=benoit.canet@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).