~ubuntu-branches/ubuntu/saucy/qemu/saucy-proposed

« back to all changes in this revision

Viewing changes to debian/patches/patches-arm-1.4.0/0036-hw-omap_uart.c-Unconditionally-enable-non-16550-exte.patch

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-05-28 08:18:30 UTC
  • mfrom: (1.8.2) (10.1.37 sid)
  • Revision ID: package-import@ubuntu.com-20130528081830-87xl2z9fq516a814
Tags: 1.5.0+dfsg-2ubuntu1
* Merge 1.5.0+dfs-2 from debian unstable.  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
    * 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.
  - Dropped patches:
    * 0001-fix-wrong-output-with-info-chardev-for-tcp-socket.patch
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * gridcentric patch - updated
    * linaro arm patches from qemu-linaro rebasing branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 317bcb4caa1757114db37a61e7eef50e9dc0c096 Mon Sep 17 00:00:00 2001
2
 
From: Peter Maydell <peter.maydell@linaro.org>
3
 
Date: Mon, 18 Feb 2013 16:58:29 +0000
4
 
Subject: [PATCH 36/77] hw/omap_uart.c: Unconditionally enable non-16550
5
 
 extensions
6
 
 
7
 
Uncondionally enable the OMAP UART modelling of the extensions
8
 
over plain 16550A, instead of having them guarded by #ifdefs
9
 
and disabled by default. Newer Linux kernels have an OMAP
10
 
specific serial driver which relies on these being implemented.
11
 
 
12
 
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
 
---
14
 
 hw/omap_uart.c | 49 +++++++++++++++++++------------------------------
15
 
 1 file changed, 19 insertions(+), 30 deletions(-)
16
 
 
17
 
diff --git a/hw/omap_uart.c b/hw/omap_uart.c
18
 
index 1c1edb5..9283c2e 100644
19
 
--- a/hw/omap_uart.c
20
 
+++ b/hw/omap_uart.c
21
 
@@ -24,13 +24,18 @@
22
 
 #include "exec/address-spaces.h"
23
 
 #include "sysbus.h"
24
 
 
25
 
-/* The OMAP UART functionality is similar to the TI16C752 rather than
26
 
- * the 16550A. When the flag below is enabled, the code will however
27
 
- * offer 'only' the basic 16550A emulation. */
28
 
-/* TODO: real functionality for the TI16C752 enhanced features. Note
29
 
- * QEMU's SerialState emulation internally always uses a 16-byte FIFO
30
 
- * whereas we would need a 64-byte FIFO for OMAP. */
31
 
-#define OMAP_UART_16550A
32
 
+/* The OMAP UART functionality is similar to the TI16C752; it is
33
 
+ * an enhanced version of the 16550A and we piggy-back on the 16550
34
 
+ * model.
35
 
+ *
36
 
+ * Currently unmodelled functionality:
37
 
+ *  + We should have a 64 byte FIFO but QEMU's SerialState emulation
38
 
+ *    always uses a 16 byte FIFO
39
 
+ *  + DMA
40
 
+ *  + interrupts based on TCR/TLR values
41
 
+ *  + XON/XOFF flow control
42
 
+ *  + UASR auto-baudrate-detection
43
 
+ */
44
 
 
45
 
 struct omap_uart_s {
46
 
     SysBusDevice busdev;
47
 
@@ -54,13 +59,11 @@ struct omap_uart_s {
48
 
     uint8_t blr;
49
 
     uint8_t acreg;
50
 
 
51
 
-#ifndef OMAP_UART_16550A
52
 
     uint8_t mcr_cache;
53
 
     uint8_t efr;
54
 
     uint8_t tcr;
55
 
     uint8_t tlr;
56
 
     uint8_t xon[2], xoff[2];
57
 
-#endif
58
 
 };
59
 
 
60
 
 static void omap_uart_reset(DeviceState *qdev)
61
 
@@ -76,14 +79,12 @@ static void omap_uart_reset(DeviceState *qdev)
62
 
     s->acreg = 0;
63
 
     s->lcr_cache = 0;
64
 
 
65
 
-#ifndef OMAP_UART_16550A
66
 
     s->mcr_cache = 0;
67
 
     s->tcr = 0x0f;
68
 
     s->tlr = 0;
69
 
     s->efr = 0;
70
 
     s->xon[0] = s->xon[1] = 0;
71
 
     s->xoff[0] = s->xoff[1] = 0;
72
 
-#endif
73
 
 }
74
 
 
75
 
 static uint64_t omap_uart_read(void *opaque, hwaddr addr,
76
 
@@ -97,33 +98,27 @@ static uint64_t omap_uart_read(void *opaque, hwaddr addr,
77
 
     case 0x0c:
78
 
         return s->serial_ops->read(s->serial, addr, size);
79
 
     case 0x08:
80
 
-#ifndef OMAP_UART_16550A
81
 
         if (s->lcr_cache == 0xbf) {
82
 
             return s->efr;
83
 
         }
84
 
-#endif
85
 
         return s->serial_ops->read(s->serial, addr, size);
86
 
     case 0x10:
87
 
     case 0x14:
88
 
-#ifndef OMAP_UART_16550A
89
 
         if (s->lcr_cache == 0xbf) {
90
 
             return s->xon[(addr & 7) >> 2];
91
 
         } else if (addr == 0x10) {
92
 
             return s->serial_ops->read(s->serial, addr, size)
93
 
                    | (s->mcr_cache & 0xe0);
94
 
         }
95
 
-#endif
96
 
         return s->serial_ops->read(s->serial, addr, size);
97
 
     case 0x18:
98
 
     case 0x1c:
99
 
-#ifndef OMAP_UART_16550A
100
 
         if ((s->efr & 0x10) && (s->mcr_cache & 0x40)) {
101
 
             return (addr == 0x18) ? s->tcr : s->tlr;
102
 
         }
103
 
         if (s->lcr_cache == 0xbf) {
104
 
             return s->xoff[(addr & 7) >> 2];
105
 
         }
106
 
-#endif
107
 
         return s->serial_ops->read(s->serial, addr, size);
108
 
     case 0x20: /* MDR1 */
109
 
         return s->mdr[0];
110
 
@@ -179,12 +174,11 @@ static void omap_uart_write(void *opaque, hwaddr addr,
111
 
         s->serial_ops->write(s->serial, addr, value, size);
112
 
         break;
113
 
     case 0x08:
114
 
-#ifndef OMAP_UART_16550A
115
 
         if (s->lcr_cache == 0xbf) {
116
 
             s->efr = value;
117
 
-        } else
118
 
-#endif
119
 
-        s->serial_ops->write(s->serial, addr, value, size);
120
 
+        } else {
121
 
+            s->serial_ops->write(s->serial, addr, value, size);
122
 
+        }
123
 
         break;
124
 
     case 0x0c:
125
 
         s->lcr_cache = value;
126
 
@@ -192,22 +186,17 @@ static void omap_uart_write(void *opaque, hwaddr addr,
127
 
         break;
128
 
     case 0x10:
129
 
     case 0x14:
130
 
-#ifndef OMAP_UART_16550A
131
 
         if (s->lcr_cache == 0xbf) {
132
 
             s->xon[(addr & 7) >> 2] = value;
133
 
         } else {
134
 
             if (addr == 0x10) {
135
 
                 s->mcr_cache = value & 0x7f;
136
 
             }
137
 
-#endif
138
 
-        s->serial_ops->write(s->serial, addr, value, size);
139
 
-#ifndef OMAP_UART_16550A
140
 
+            s->serial_ops->write(s->serial, addr, value, size);
141
 
         }
142
 
-#endif
143
 
         break;
144
 
     case 0x18:
145
 
     case 0x1c:
146
 
-#ifndef OMAP_UART_16550A
147
 
         if ((s->efr & 0x10) && (s->mcr_cache & 0x40)) {
148
 
             if (addr == 0x18) {
149
 
                 s->tcr = value & 0xff;
150
 
@@ -216,9 +205,9 @@ static void omap_uart_write(void *opaque, hwaddr addr,
151
 
             }
152
 
         } else if (s->lcr_cache == 0xbf) {
153
 
             s->xoff[(addr & 7) >> 2] = value;
154
 
-        } else
155
 
-#endif
156
 
-        s->serial_ops->write(s->serial, addr, value, size);
157
 
+        } else {
158
 
+            s->serial_ops->write(s->serial, addr, value, size);
159
 
+        }
160
 
         break;
161
 
     case 0x20: /* MDR1 */
162
 
         s->mdr[0] = value & 0x7f;
163
 
1.8.1.2
164