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

« back to all changes in this revision

Viewing changes to debian/patches/linaro-patches/0036-hw-omap_uart.c-Unconditionally-enable-non-16550-exte.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 bbec7553a7623c85d1e79edbb23e23aff50f25e5 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/71] 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/char/omap_uart.c | 49 +++++++++++++++++++------------------------------
 
15
 1 file changed, 19 insertions(+), 30 deletions(-)
 
16
 
 
17
diff --git a/hw/char/omap_uart.c b/hw/char/omap_uart.c
 
18
index 2bffed4..746b635 100644
 
19
--- a/hw/char/omap_uart.c
 
20
+++ b/hw/char/omap_uart.c
 
21
@@ -27,13 +27,18 @@
 
22
 #define TYPE_OMAP_UART "omap_uart"
 
23
 #define OMAP_UART(obj) OBJECT_CHECK(omap_uart_s, (obj), TYPE_OMAP_UART)
 
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
 typedef struct omap_uart_s {
 
46
     SysBusDevice busdev;
 
47
@@ -57,13 +62,11 @@ typedef 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
 } omap_uart_s;
 
59
 
 
60
 static void omap_uart_reset(DeviceState *qdev)
 
61
@@ -79,14 +82,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
@@ -100,33 +101,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
@@ -182,12 +177,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
@@ -195,22 +189,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
@@ -219,9 +208,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
-- 
 
164
1.8.3.2
 
165