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

« back to all changes in this revision

Viewing changes to debian/patches/linaro-patches-1.5.0/0051-hw-nseries.c-Add-support-for-n900-MIPID.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 9e5920386bda1cd713a391421d62924387769ef2 Mon Sep 17 00:00:00 2001
2
 
From: Peter Maydell <peter.maydell@linaro.org>
3
 
Date: Mon, 18 Feb 2013 16:58:32 +0000
4
 
Subject: [PATCH 51/69] hw/nseries.c: Add support for n900 MIPID
5
 
 
6
 
NB: a few of these change the not-n900 behaviour slightly,
7
 
need examination.
8
 
---
9
 
 hw/arm/nseries.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
10
 
 1 file changed, 93 insertions(+), 5 deletions(-)
11
 
 
12
 
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
13
 
index 2c9cfa5..306cb30 100644
14
 
--- a/hw/arm/nseries.c
15
 
+++ b/hw/arm/nseries.c
16
 
@@ -427,6 +427,11 @@ struct mipid_s {
17
 
     int onoff;
18
 
     int gamma;
19
 
     uint32_t id;
20
 
+    
21
 
+    uint8_t n900;
22
 
+    int cabc;
23
 
+    int brightness;
24
 
+    int ctrl;
25
 
 };
26
 
 
27
 
 static void mipid_reset(DeviceState *qdev)
28
 
@@ -457,6 +462,11 @@ static uint32_t mipid_txrx(SPIDevice *spidev, uint32_t cmd, int len)
29
 
     struct mipid_s *s = FROM_SPI_DEVICE(struct mipid_s, spidev);
30
 
     uint8_t ret;
31
 
 
32
 
+    if (s->n900 && len == 10) {
33
 
+        cmd >>= 1;
34
 
+        len--;
35
 
+    }
36
 
+    
37
 
     if (len > 9)
38
 
         hw_error("%s: FIXME: bad SPI word width %i\n", __FUNCTION__, len);
39
 
 
40
 
@@ -648,13 +658,87 @@ static uint32_t mipid_txrx(SPIDevice *spidev, uint32_t cmd, int len)
41
 
 
42
 
     case 0x38: /* IDMOFF */
43
 
     case 0x39: /* IDMON */
44
 
-    case 0x3a: /* COLMOD */
45
 
+        TRACE_MIPID("IDMON/OFF");
46
 
         goto bad_cmd;
47
 
-
48
 
+    case 0x3a: /* COLMOD */
49
 
+        if (!s->pm) {
50
 
+            TRACE_MIPID("COLMOD 0x%02x", s->param[0] & 0xff);
51
 
+        } else if (s->pm < 0) {
52
 
+            s->pm = 1;
53
 
+        }
54
 
+        break;
55
 
+    
56
 
+    case 0x51: /* WRITE_BRIGHTNESS */
57
 
+        if (s->n900) {
58
 
+            if (!s->pm) {
59
 
+                s->brightness = s->param[0] & 0xff;
60
 
+                TRACE_MIPID("WRITE_BRIGHTNESS 0x%02x", s->brightness);
61
 
+            } else if (s->pm < 0) {
62
 
+                s->pm = 1;
63
 
+            }
64
 
+        } else {
65
 
+            goto bad_cmd;
66
 
+        }
67
 
+        break;
68
 
+    case 0x52: /* READ_BRIGHTNESS */
69
 
+        if (s->n900) {
70
 
+            s->p = 0;
71
 
+            s->resp[0] = s->brightness;
72
 
+            TRACE_MIPID("READ_BRIGHTNESS 0x%02x", s->resp[0]);
73
 
+        } else {
74
 
+            goto bad_cmd;
75
 
+        }
76
 
+        break;
77
 
+    case 0x53: /* WRITE_CTRL */
78
 
+        if (s->n900) {
79
 
+            if (!s->pm) {
80
 
+                s->ctrl = s->param[0] & 0xff;
81
 
+                TRACE_MIPID("WRITE_CTRL 0x%02x", s->ctrl);
82
 
+            } else if (s->pm < 0) {
83
 
+                s->pm = 1;
84
 
+            }
85
 
+        } else {
86
 
+            goto bad_cmd;
87
 
+        }
88
 
+        break;
89
 
+    case 0x54: /* READ_CTRL */
90
 
+        if (s->n900) {
91
 
+            s->p = 0;
92
 
+            s->resp[0] = s->ctrl;
93
 
+            TRACE_MIPID("READ_CTRL 0x%02x", s->resp[0]);
94
 
+        } else {
95
 
+            goto bad_cmd;
96
 
+        }
97
 
+        break;
98
 
+    case 0x55: /* WRITE_CABC */
99
 
+        if (s->n900) {
100
 
+            if (!s->pm) {
101
 
+                s->cabc = s->param[0] & 0xff;
102
 
+                TRACE_MIPID("WRITE_CABC 0x%02x", s->cabc);
103
 
+            } else if (s->pm < 0) {
104
 
+                s->pm = 1;
105
 
+            }
106
 
+        } else {
107
 
+            goto bad_cmd;
108
 
+        }
109
 
+        break;
110
 
+    case 0x56: /* READ_CABC */
111
 
+        if (s->n900) {
112
 
+            s->p = 0;
113
 
+            s->resp[0] = s->cabc;
114
 
+            TRACE_MIPID("READ_CABC 0x%02x", s->resp[0]);
115
 
+        } else {
116
 
+            goto bad_cmd;
117
 
+        }
118
 
+        break;
119
 
+            
120
 
     case 0xb0: /* CLKINT / DISCTL */
121
 
     case 0xb1: /* CLKEXT */
122
 
-        if (s->pm < 0)
123
 
+        if (!s->pm) {
124
 
+            TRACE_MIPID("CLKINT/EXT");
125
 
+        } else if (s->pm < 0) {
126
 
             s->pm = 2;
127
 
+        }
128
 
         break;
129
 
 
130
 
     case 0xb4: /* FRMSEL */
131
 
@@ -677,8 +761,11 @@ static uint32_t mipid_txrx(SPIDevice *spidev, uint32_t cmd, int len)
132
 
         break;
133
 
 
134
 
     case 0xc2: /* IFMOD */
135
 
-        if (s->pm < 0)
136
 
-            s->pm = 2;
137
 
+        if (!s->pm) {
138
 
+            TRACE_MIPID("IFMOD");
139
 
+        } else if (s->pm < 0) {
140
 
+            s->pm = (s->n900) ? 3 : 2;
141
 
+        }
142
 
         break;
143
 
 
144
 
     case 0xc6: /* PWRCTL */
145
 
@@ -722,6 +809,7 @@ static int mipid_init(SPIDevice *spidev)
146
 
 
147
 
 static Property mipid_properties[] = {
148
 
     DEFINE_PROP_UINT32("id", struct mipid_s, id, 0),
149
 
+    DEFINE_PROP_UINT8("n900", struct mipid_s, n900, 0),
150
 
     DEFINE_PROP_END_OF_LIST()
151
 
 };
152
 
 
153
 
1.8.1.2
154