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

« back to all changes in this revision

Viewing changes to debian/patches/linaro/0012-hw-omap_l4.c-Add-OMAP3-support.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 cd1ca5d102477c4d9706ad21e682ab22df8eb164 Mon Sep 17 00:00:00 2001
2
 
From: Riku Voipio <riku.voipio@nokia.com>
3
 
Date: Mon, 18 Feb 2013 16:58:25 +0000
4
 
Subject: [PATCH 12/70] hw/omap_l4.c: Add OMAP3 support
5
 
 
6
 
TODO: definitely need to look more closely at what's going on here.
7
 
 
8
 
Drop omap3_l4ta save/load support?
9
 
---
10
 
 hw/arm/omap2.c        |  8 ++++----
11
 
 hw/misc/omap_l4.c     | 54 +++++++++++++++++++++++++++++++++++++++++++++++----
12
 
 include/hw/arm/omap.h | 39 ++++++++++++++++++++++++++-----------
13
 
 3 files changed, 82 insertions(+), 19 deletions(-)
14
 
 
15
 
diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c
16
 
index 36efde0..2a0b45f 100644
17
 
--- a/hw/arm/omap2.c
18
 
+++ b/hw/arm/omap2.c
19
 
@@ -934,7 +934,7 @@ static const struct omap_l4_region_s omap_l4_region[125] = {
20
 
     [124] = { 0xb3000, 0x1000, 32 | 16 | 8 }, /* L4TA39 */
21
 
 };
22
 
 
23
 
-static const struct omap_l4_agent_info_s omap_l4_agent_info[54] = {
24
 
+static const struct omap2_l4_agent_info_s omap2_l4_agent_info[54] = {
25
 
     { 0,           0, 3, 2 }, /* L4IA initiatior agent */
26
 
     { L4TAO(1),    3, 2, 1 }, /* Control and pinout module */
27
 
     { L4TAO(2),    5, 2, 1 }, /* 32K timer */
28
 
@@ -992,9 +992,9 @@ static const struct omap_l4_agent_info_s omap_l4_agent_info[54] = {
29
 
 };
30
 
 
31
 
 #define omap_l4ta(bus, cs)     \
32
 
-    omap_l4ta_get(bus, omap_l4_region, omap_l4_agent_info, L4TA(cs))
33
 
+    omap2_l4ta_init(bus, omap_l4_region, omap2_l4_agent_info, L4TA(cs))
34
 
 #define omap_l4tao(bus, cs)    \
35
 
-    omap_l4ta_get(bus, omap_l4_region, omap_l4_agent_info, L4TAO(cs))
36
 
+    omap2_l4ta_init(bus, omap_l4_region, omap2_l4_agent_info, L4TAO(cs))
37
 
 
38
 
 /* Power, Reset, and Clock Management */
39
 
 struct omap_prcm_s {
40
 
@@ -2273,7 +2273,7 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem,
41
 
     vmstate_register_ram_global(&s->sram);
42
 
     memory_region_add_subregion(sysmem, OMAP2_SRAM_BASE, &s->sram);
43
 
 
44
 
-    s->l4 = omap_l4_init(sysmem, OMAP2_L4_BASE, 54);
45
 
+    s->l4 = omap_l4_init(sysmem, OMAP2_L4_BASE, 54, 125);
46
 
 
47
 
     /* Actually mapped at any 2K boundary in the ARM11 private-peripheral if */
48
 
     s->ih[0] = qdev_create(NULL, "omap2-intc");
49
 
diff --git a/hw/misc/omap_l4.c b/hw/misc/omap_l4.c
50
 
index f237250..67fac43 100644
51
 
--- a/hw/misc/omap_l4.c
52
 
+++ b/hw/misc/omap_l4.c
53
 
@@ -28,7 +28,8 @@ struct omap_l4_s {
54
 
 };
55
 
 
56
 
 struct omap_l4_s *omap_l4_init(MemoryRegion *address_space,
57
 
-                               hwaddr base, int ta_num)
58
 
+                               hwaddr base, int ta_num,
59
 
+                               int region_count)
60
 
 {
61
 
     struct omap_l4_s *bus = g_malloc0(
62
 
                     sizeof(*bus) + ta_num * sizeof(*bus->ta));
63
 
@@ -108,14 +109,14 @@ static const MemoryRegionOps omap_l4ta_ops = {
64
 
     .endianness = DEVICE_NATIVE_ENDIAN,
65
 
 };
66
 
 
67
 
-struct omap_target_agent_s *omap_l4ta_get(struct omap_l4_s *bus,
68
 
+struct omap_target_agent_s *omap2_l4ta_init(struct omap_l4_s *bus,
69
 
         const struct omap_l4_region_s *regions,
70
 
-       const struct omap_l4_agent_info_s *agents,
71
 
+        const struct omap2_l4_agent_info_s *agents,
72
 
        int cs)
73
 
 {
74
 
     int i;
75
 
     struct omap_target_agent_s *ta = NULL;
76
 
-    const struct omap_l4_agent_info_s *info = NULL;
77
 
+    const struct omap2_l4_agent_info_s *info = NULL;
78
 
 
79
 
     for (i = 0; i < bus->ta_num; i ++)
80
 
         if (agents[i].ta == cs) {
81
 
@@ -160,3 +161,48 @@ hwaddr omap_l4_attach(struct omap_target_agent_s *ta,
82
 
 
83
 
     return base;
84
 
 }
85
 
+
86
 
+struct omap_target_agent_s *omap3_l4ta_init(
87
 
+    struct omap_l4_s *bus,
88
 
+    const struct omap_l4_region_s *regions,
89
 
+    const struct omap3_l4_agent_info_s *agents,
90
 
+    int cs)
91
 
+{
92
 
+    int i;
93
 
+    struct omap_target_agent_s *ta = NULL;
94
 
+    const struct omap3_l4_agent_info_s *info = NULL;
95
 
+
96
 
+    for (i = 0; i < bus->ta_num; i++)
97
 
+        if (agents[i].agent_id == cs) {
98
 
+            ta = &bus->ta[i];
99
 
+            info = &agents[i];
100
 
+            break;
101
 
+        }
102
 
+    if (!ta) {
103
 
+        hw_error("%s: invalid agent id (%i)", __func__, cs);
104
 
+    }
105
 
+    if (ta->bus) {
106
 
+        hw_error("%s: target agent (%d) already initialized", __func__, cs);
107
 
+    }
108
 
+
109
 
+    ta->bus = bus;
110
 
+    ta->start = &regions[info->first_region_id];
111
 
+    ta->regions = info->region_count;
112
 
+
113
 
+    ta->component = ('Q' << 24) | ('E' << 16) | ('M' << 8) | ('U' << 0);
114
 
+    ta->status = 0x00000000;
115
 
+    ta->control = 0x00000200;
116
 
+
117
 
+    for (i = 0; i < info->region_count; i++) {
118
 
+        if (regions[info->first_region_id + i].access == L4TYPE_TA) {
119
 
+            break;
120
 
+        }
121
 
+    }
122
 
+    if (i >= info->region_count) {
123
 
+        hw_error("%s: specified agent (%d) has no TA region", __func__, cs);
124
 
+    }
125
 
+
126
 
+    ta->base = ta->bus->base + ta->start[i].offset;
127
 
+
128
 
+    return ta;
129
 
+}
130
 
diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h
131
 
index 5e9d41d..161a217 100644
132
 
--- a/include/hw/arm/omap.h
133
 
+++ b/include/hw/arm/omap.h
134
 
@@ -73,17 +73,25 @@ void omap_clk_reparent(omap_clk clk, omap_clk parent);
135
 
 
136
 
 /* OMAP2 l4 Interconnect */
137
 
 struct omap_l4_s;
138
 
-struct omap_l4_region_s {
139
 
-    hwaddr offset;
140
 
-    size_t size;
141
 
-    int access;
142
 
-};
143
 
-struct omap_l4_agent_info_s {
144
 
+struct omap_l4_region_s;
145
 
+typedef enum {
146
 
+    L4TYPE_GENERIC = 0, /* not mapped by default, must be mapped separately */
147
 
+    L4TYPE_IA,          /* initiator agent */
148
 
+    L4TYPE_TA,          /* target agent */
149
 
+    L4TYPE_LA,          /* link register agent */
150
 
+    L4TYPE_AP           /* address protection */
151
 
+} omap3_l4_region_type_t;
152
 
+struct omap2_l4_agent_info_s {
153
 
     int ta;
154
 
     int region;
155
 
     int regions;
156
 
     int ta_region;
157
 
 };
158
 
+struct omap3_l4_agent_info_s {
159
 
+    int agent_id;
160
 
+    int first_region_id;
161
 
+    int region_count;
162
 
+};
163
 
 struct omap_target_agent_s {
164
 
     MemoryRegion iomem;
165
 
     struct omap_l4_s *bus;
166
 
@@ -94,14 +102,23 @@ struct omap_target_agent_s {
167
 
     uint32_t control;
168
 
     uint32_t status;
169
 
 };
170
 
+struct omap_l4_region_s {
171
 
+    hwaddr offset;
172
 
+    size_t size;
173
 
+    int access; /* omap3_l4_region_type_t for OMAP3 */
174
 
+};
175
 
 struct omap_l4_s *omap_l4_init(MemoryRegion *address_space,
176
 
-                               hwaddr base, int ta_num);
177
 
-
178
 
-struct omap_target_agent_s;
179
 
-struct omap_target_agent_s *omap_l4ta_get(
180
 
+                               hwaddr base, int ta_num,
181
 
+                               int region_count);
182
 
+struct omap_target_agent_s *omap2_l4ta_init(
183
 
+    struct omap_l4_s *bus,
184
 
+    const struct omap_l4_region_s *regions,
185
 
+    const struct omap2_l4_agent_info_s *agents,
186
 
+    int cs);
187
 
+struct omap_target_agent_s *omap3_l4ta_init(
188
 
     struct omap_l4_s *bus,
189
 
     const struct omap_l4_region_s *regions,
190
 
-    const struct omap_l4_agent_info_s *agents,
191
 
+    const struct omap3_l4_agent_info_s *agents,
192
 
     int cs);
193
 
 hwaddr omap_l4_attach(struct omap_target_agent_s *ta,
194
 
                                          int region, MemoryRegion *mr);
195
 
1.8.5.2
196