~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to debian/patches/linaro-patches/0022-omap_i2c.c-Support-byte-reads-to-registers.patch

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 85a3c08c68ee94afd0b1cdc515d8f145a58db0d7 Mon Sep 17 00:00:00 2001
 
2
From: Matt Waddel <matt.waddel@ubuntu.com>
 
3
Date: Mon, 18 Feb 2013 16:58:26 +0000
 
4
Subject: [PATCH 22/71] omap_i2c.c: Support byte reads to registers
 
5
 
 
6
Added support for the byte read of the omap i2c system.
 
7
Handling is similar to the way i2c_write and i2c_writeb work.
 
8
---
 
9
 hw/i2c/omap_i2c.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 
10
 1 file changed, 56 insertions(+), 1 deletion(-)
 
11
 
 
12
diff --git a/hw/i2c/omap_i2c.c b/hw/i2c/omap_i2c.c
 
13
index 9a1b0d2..0278390 100644
 
14
--- a/hw/i2c/omap_i2c.c
 
15
+++ b/hw/i2c/omap_i2c.c
 
16
@@ -326,6 +326,61 @@ static uint32_t omap_i2c_read(void *opaque, hwaddr addr)
 
17
     return 0;
 
18
 }
 
19
 
 
20
+static uint32_t omap_i2c_readb(void *opaque, hwaddr addr)
 
21
+{
 
22
+    OMAPI2CState *s = opaque;
 
23
+    int offset = addr & OMAP_MPUI_REG_MASK;
 
24
+    uint8_t ret;
 
25
+
 
26
+    switch (offset) {
 
27
+    case 0x1c: /* I2C_DATA */
 
28
+        ret = 0;
 
29
+        if (s->fifolen) {
 
30
+            if (s->revision < OMAP3_INTR_REV) {
 
31
+                if (s->control & (1 << 14)) /* BE */
 
32
+                    ret = (((uint8_t)s->fifo[s->fifostart]) << 8)
 
33
+                        | s->fifo[(s->fifostart + 1) & I2C_FIFO_SIZE_MASK];
 
34
+                else
 
35
+                    ret = (((uint8_t)s->fifo[(s->fifostart + 1) & I2C_FIFO_SIZE_MASK]) << 8)
 
36
+                        | s->fifo[s->fifostart];
 
37
+                s->fifostart = (s->fifostart + 2) & I2C_FIFO_SIZE_MASK;
 
38
+                if (s->fifolen == 1) {
 
39
+                    s->stat |= 1 << 15; /* SBD */
 
40
+                    s->fifolen = 0;
 
41
+                } else
 
42
+                    s->fifolen -= 2;
 
43
+                if (!s->fifolen) {
 
44
+                    s->stat &= ~(1 << 3); /* RRDY */
 
45
+                    s->stat |= 1 << 2;    /* ARDY */
 
46
+                }
 
47
+            } else {
 
48
+                s->stat &= ~(1 << 7); /* AERR */
 
49
+                ret = (uint8_t)s->fifo[s->fifostart++];
 
50
+                s->fifostart &= I2C_FIFO_SIZE_MASK;
 
51
+                if (--s->fifolen) {
 
52
+                    if (s->fifolen <= ((s->dma >> 8) & 0x3f)) {
 
53
+                        s->stat &= ~(1 << 3); /* RRDY */
 
54
+                        s->stat |= 1 << 13;   /* RDR */
 
55
+                    }
 
56
+                } else {
 
57
+                    s->stat &= ~((1 << 3) | (1 << 13)); /* RRDY | RDR */
 
58
+                    s->stat |= 1 << 2;                  /* ARDY */
 
59
+                }
 
60
+            }
 
61
+            s->stat &= ~(1 << 11); /* ROVR */
 
62
+        } else if (s->revision >= OMAP3_INTR_REV)
 
63
+            s->stat |= (1 << 7); /* AERR */
 
64
+        omap_i2c_fifo_run(s);
 
65
+        omap_i2c_interrupts_update(s);
 
66
+        return ret;
 
67
+    default:
 
68
+        break;
 
69
+    }
 
70
+
 
71
+    OMAP_BAD_REG(addr);
 
72
+    return 0;
 
73
+}
 
74
+
 
75
 static void omap_i2c_write(void *opaque, hwaddr addr,
 
76
                 uint32_t value)
 
77
 {
 
78
@@ -589,7 +644,7 @@ static void omap_i2c_writeb(void *opaque, hwaddr addr,
 
79
 static const MemoryRegionOps omap_i2c_ops = {
 
80
     .old_mmio = {
 
81
         .read = {
 
82
-            omap_badwidth_read16,
 
83
+            omap_i2c_readb,
 
84
             omap_i2c_read,
 
85
             omap_badwidth_read16,
 
86
         },
 
87
-- 
 
88
1.8.3.2
 
89