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

« back to all changes in this revision

Viewing changes to debian/patches/ubuntu/linaro/0020-i2c-fixes-pull-out-omap-3-rev-fixes.patch

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-04 12:13:08 UTC
  • mfrom: (10.1.45 sid)
  • Revision ID: package-import@ubuntu.com-20140204121308-1xq92lrfs75agw2g
Tags: 1.7.0+dfsg-3ubuntu1~ppa1
* Merge 1.7.0+dfsg-3 from debian.  Remaining changes:
  - debian/patches/ubuntu:
    * expose-vmx_qemu64cpu.patch
    * linaro (omap3) and arm64 patches
    * ubuntu/target-ppc-add-stubs-for-kvm-breakpoints: fix FTBFS
      on ppc
    * ubuntu/CVE-2013-4377.patch: fix denial of service via virtio
  - debian/qemu-system-x86.modprobe: set kvm_intel nested=1 options
  - debian/control:
    * add arm64 to Architectures
    * add qemu-common and qemu-system-aarch64 packages
  - debian/qemu-system-common.install: add debian/tmp/usr/lib
  - debian/qemu-system-common.preinst: add kvm group
  - debian/qemu-system-common.postinst: remove acl placed by udev,
    and add udevadm trigger.
  - qemu-system-x86.links: add eepro100.rom, remove pxe-virtio,
    pxe-e1000 and pxe-rtl8139.
  - add qemu-system-x86.qemu-kvm.upstart and .default
  - qemu-user-static.postinst-in: remove arm64 binfmt
  - debian/rules:
    * allow parallel build
    * add aarch64 to system_targets and sys_systems
    * add qemu-kvm-spice links
    * install qemu-system-x86.modprobe
  - add debian/qemu-system-common.links for OVMF.fd link
* Remove kvm-img, kvm-nbd, kvm-ifup and kvm-ifdown symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 18e42b1fb4897fbecf7627d01b3c29e41fc39a3a Mon Sep 17 00:00:00 2001
 
2
From: Peter Maydell <peter.maydell@linaro.org>
 
3
Date: Mon, 18 Feb 2013 16:58:26 +0000
 
4
Subject: [PATCH 20/70] i2c-fixes: pull out omap-3-rev fixes
 
5
 
 
6
---
 
7
 hw/i2c/omap_i2c.c | 52 ++++++++++++++++++++++++++++++++++++++++------------
 
8
 1 file changed, 40 insertions(+), 12 deletions(-)
 
9
 
 
10
diff --git a/hw/i2c/omap_i2c.c b/hw/i2c/omap_i2c.c
 
11
index 521bd5c..9a1b0d2 100644
 
12
--- a/hw/i2c/omap_i2c.c
 
13
+++ b/hw/i2c/omap_i2c.c
 
14
@@ -341,10 +341,15 @@ static void omap_i2c_write(void *opaque, hwaddr addr,
 
15
         OMAP_RO_REG(addr);
 
16
         break;
 
17
     case 0x04: /* I2C_IE */
 
18
-        if (s->revision >= OMAP3_INTR_REV)
 
19
+        if (s->revision < OMAP2_INTR_REV) {
 
20
+            s->mask = value & 0x1f;
 
21
+        } else if (s->revision < OMAP3_INTR_REV) {
 
22
+            s->mask = value & 0x3f;
 
23
+        } else if (s->revision == OMAP3_INTR_REV) {
 
24
             s->mask = value & 0x63ff;
 
25
-        else
 
26
-            s->mask = value & (s->revision < OMAP2_INTR_REV ? 0x1f : 0x3f);
 
27
+        } else { /* omap3630 */
 
28
+            s->mask = value & 0x6fff;
 
29
+        }
 
30
         omap_i2c_interrupts_update(s);
 
31
         break;
 
32
     case 0x08: /* I2C_STAT */
 
33
@@ -352,16 +357,26 @@ static void omap_i2c_write(void *opaque, hwaddr addr,
 
34
             OMAP_RO_REG(addr);
 
35
         else {
 
36
             /* RRDY and XRDY are reset by hardware. (in all versions???) */
 
37
-            s->stat &= ~(value & (s->revision < OMAP3_INTR_REV ? 0x27 : 0x63e7));
 
38
+            if (s->revision < OMAP3_INTR_REV) {
 
39
+                value &= 0x27;
 
40
+            } else if (s->revision == OMAP3_INTR_REV) {
 
41
+                value &= 0x63e7;
 
42
+            } else { /* omap3630 */
 
43
+                value &= 0x6ee7;
 
44
+            }
 
45
+            s->stat &= ~value;
 
46
             omap_i2c_interrupts_update(s);
 
47
         }
 
48
         break;
 
49
 
 
50
     case 0x0c: /* I2C_IV / I2C_WE */
 
51
-        if (s->revision < OMAP3_INTR_REV)
 
52
+        if (s->revision < OMAP3_INTR_REV) {
 
53
             OMAP_RO_REG(addr);
 
54
-        else
 
55
+        } else if (s->revision == OMAP3_INTR_REV) {
 
56
             s->we = value & 0x636f;
 
57
+        } else { /* omap3630 */
 
58
+            s->we = value & 0x6f6f;
 
59
+        }
 
60
         break;
 
61
 
 
62
     case 0x14: /* I2C_BUF */
 
63
@@ -487,20 +502,33 @@ static void omap_i2c_write(void *opaque, hwaddr addr,
 
64
         break;
 
65
 
 
66
     case 0x3c: /* I2C_SYSTEST */
 
67
-        value &= s->revision < OMAP3_INTR_REV ? 0xf805 : 0xf815;
 
68
+        if (s->revision < OMAP3_INTR_REV) {
 
69
+            value &= 0xf805;
 
70
+        } else if (s->revision == OMAP3_INTR_REV) {
 
71
+            value &= 0xf815;
 
72
+        } else { /* omap3630 */
 
73
+            value = (value & 0xf835) | 0x1c00;
 
74
+        }
 
75
         if ((value & (1 << 15))) { /* ST_EN */
 
76
             fprintf(stderr, "%s: System Test not supported\n",
 
77
                     __FUNCTION__);
 
78
             s->test = (s->test & 0x0a) | value;
 
79
-        } else
 
80
-            s->test = (s->test & 0x1f) | (value & 0xf800);
 
81
-        if (value & (1 << 11))                                 /* SBB */
 
82
+        } else {
 
83
+            value &= ~0xff;
 
84
+            s->test = (s->test & 0x1f) | value;
 
85
+        }
 
86
+        if (value & (1 << 11)) { /* SBB */
 
87
             if (s->revision >= OMAP2_INTR_REV) {
 
88
                 s->stat |= 0x3f;
 
89
-                if (s->revision >= OMAP3_INTR_REV)
 
90
-                    s->stat |= 0x600;
 
91
+                if (s->revision >= OMAP3_INTR_REV) {
 
92
+                    s->stat |= 0x6300;
 
93
+                    if (s->revision > OMAP3_INTR_REV) {
 
94
+                        s->stat |= 0x0c00;
 
95
+                    }
 
96
+                }
 
97
                 omap_i2c_interrupts_update(s);
 
98
             }
 
99
+        }
 
100
         break;
 
101
 
 
102
     case 0x44: /* I2C_OA1 */
 
103
-- 
 
104
1.8.5.2
 
105