aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.1/0146-bcm2708-vcio-Remove-module.patch
blob: f36c2d9dcb2da61cc1bb5d489ffaf38abcf70829 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
From 764892688e000751cdebf8fe20564b5fb1862ac1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 24 Jul 2015 19:34:31 +0200
Subject: [PATCH 146/148] bcm2708-vcio: Remove module
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

All drivers have been converted to the new firmware API, so this
module is not needed anymore.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/mailbox/Kconfig                       |   6 --
 drivers/mailbox/Makefile                      |   2 -
 drivers/mailbox/bcm2708-vcio.c                |  86 -----------------
 include/linux/platform_data/mailbox-bcm2708.h | 127 --------------------------
 4 files changed, 221 deletions(-)
 delete mode 100644 drivers/mailbox/bcm2708-vcio.c
 delete mode 100644 include/linux/platform_data/mailbox-bcm2708.h

--- a/drivers/mailbox/Kconfig
+++ b/drivers/mailbox/Kconfig
@@ -7,12 +7,6 @@ menuconfig MAILBOX
 
 if MAILBOX
 
-config BCM2708_MBOX
-	bool "Broadcom BCM2708 Mailbox (vcio)"
-	depends on BCM2835_MBOX
-	help
-	  Broadcom BCM2708 Mailbox (vcio)
-
 config ARM_MHU
 	tristate "ARM MHU Mailbox"
 	depends on ARM_AMBA
--- a/drivers/mailbox/Makefile
+++ b/drivers/mailbox/Makefile
@@ -2,8 +2,6 @@
 
 obj-$(CONFIG_MAILBOX)		+= mailbox.o
 
-obj-$(CONFIG_BCM2708_MBOX)	+= bcm2708-vcio.o
-
 obj-$(CONFIG_ARM_MHU)	+= arm_mhu.o
 
 obj-$(CONFIG_PL320_MBOX)	+= pl320-ipc.o
--- a/drivers/mailbox/bcm2708-vcio.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- *  Copyright (C) 2010 Broadcom
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This device provides a shared mechanism for writing to the mailboxes,
- * semaphores, doorbells etc. that are shared between the ARM and the
- * VideoCore processor
- */
-
-#include <linux/dma-mapping.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/platform_data/mailbox-bcm2708.h>
-#include <linux/uaccess.h>
-#include <soc/bcm2835/raspberrypi-firmware.h>
-
-#define DRIVER_NAME "bcm2708_vcio"
-
-extern int bcm_mailbox_write(unsigned chan, uint32_t data28)
-{
-	struct rpi_firmware *fw = rpi_firmware_get(NULL);
-
-	if (!fw)
-		return -ENODEV;
-
-	return rpi_firmware_transaction(fw, chan, data28);
-}
-EXPORT_SYMBOL_GPL(bcm_mailbox_write);
-
-extern int bcm_mailbox_read(unsigned chan, uint32_t *data28)
-{
-	struct rpi_firmware *fw = rpi_firmware_get(NULL);
-
-	if (!fw)
-		return -ENODEV;
-
-	*data28 = rpi_firmware_transaction_received(fw);
-
-	return 0;
-}
-EXPORT_SYMBOL_GPL(bcm_mailbox_read);
-
-static DEFINE_MUTEX(mailbox_lock);
-extern int bcm_mailbox_property(void *data, int size)
-{
-	uint32_t success;
-	dma_addr_t mem_bus; /* the memory address accessed from videocore */
-	void *mem_kern;     /* the memory address accessed from driver */
-	int s = 0;
-
-	mutex_lock(&mailbox_lock);
-	/* allocate some memory for the messages communicating with GPU */
-	mem_kern = dma_alloc_coherent(NULL, PAGE_ALIGN(size), &mem_bus,
-				      GFP_KERNEL);
-	if (mem_kern) {
-		/* create the message */
-		memcpy(mem_kern, data, size);
-
-		/* send the message */
-		wmb();
-		s = bcm_mailbox_write(MBOX_CHAN_PROPERTY, (uint32_t)mem_bus);
-		if (s == 0)
-			s = bcm_mailbox_read(MBOX_CHAN_PROPERTY, &success);
-		if (s == 0) {
-			/* copy the response */
-			rmb();
-			memcpy(data, mem_kern, size);
-		}
-		dma_free_coherent(NULL, PAGE_ALIGN(size), mem_kern, mem_bus);
-	} else {
-		s = -ENOMEM;
-	}
-	if (s != 0)
-		pr_err(DRIVER_NAME ": %s failed (%d)\n", __func__, s);
-
-	mutex_unlock(&mailbox_lock);
-	return s;
-}
-EXPORT_SYMBOL_GPL(bcm_mailbox_property);
-
-MODULE_AUTHOR("Gray Girling");
-MODULE_DESCRIPTION("ARM I/O to VideoCore processor");
-MODULE_LICENSE("GPL");
--- a/include/linux/platform_data/mailbox-bcm2708.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *  Copyright (C) 2010 Broadcom
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-#ifndef _PLAT_MAILBOX_BCM2708_H
-#define _PLAT_MAILBOX_BCM2708_H
-
-/* Routines to handle I/O via the VideoCore "ARM control" registers
- * (semaphores, doorbells, mailboxes)
- */
-
-/* Constants shared with the ARM identifying separate mailbox channels */
-#define MBOX_CHAN_POWER    0 /* for use by the power management interface */
-#define MBOX_CHAN_FB       1 /* for use by the frame buffer */
-#define MBOX_CHAN_VCHIQ    3 /* for use by the VCHIQ interface */
-#define MBOX_CHAN_PROPERTY 8 /* for use by the property channel */
-#define MBOX_CHAN_COUNT    9
-
-enum {
-	VCMSG_PROCESS_REQUEST		= 0x00000000
-};
-
-enum {
-	VCMSG_REQUEST_SUCCESSFUL	= 0x80000000,
-	VCMSG_REQUEST_FAILED		= 0x80000001
-};
-
-/* Mailbox property tags */
-enum {
-	VCMSG_PROPERTY_END               = 0x00000000,
-	VCMSG_GET_FIRMWARE_REVISION      = 0x00000001,
-	VCMSG_GET_BOARD_MODEL            = 0x00010001,
-	VCMSG_GET_BOARD_REVISION	 = 0x00010002,
-	VCMSG_GET_BOARD_MAC_ADDRESS	 = 0x00010003,
-	VCMSG_GET_BOARD_SERIAL		 = 0x00010004,
-	VCMSG_GET_ARM_MEMORY		 = 0x00010005,
-	VCMSG_GET_VC_MEMORY		 = 0x00010006,
-	VCMSG_GET_CLOCKS		 = 0x00010007,
-	VCMSG_GET_COMMAND_LINE           = 0x00050001,
-	VCMSG_GET_DMA_CHANNELS           = 0x00060001,
-	VCMSG_GET_POWER_STATE            = 0x00020001,
-	VCMSG_GET_TIMING		 = 0x00020002,
-	VCMSG_SET_POWER_STATE            = 0x00028001,
-	VCMSG_GET_CLOCK_STATE            = 0x00030001,
-	VCMSG_SET_CLOCK_STATE            = 0x00038001,
-	VCMSG_GET_CLOCK_RATE             = 0x00030002,
-	VCMSG_SET_CLOCK_RATE             = 0x00038002,
-	VCMSG_GET_VOLTAGE                = 0x00030003,
-	VCMSG_SET_VOLTAGE                = 0x00038003,
-	VCMSG_GET_MAX_CLOCK              = 0x00030004,
-	VCMSG_GET_MAX_VOLTAGE            = 0x00030005,
-	VCMSG_GET_TEMPERATURE            = 0x00030006,
-	VCMSG_GET_MIN_CLOCK              = 0x00030007,
-	VCMSG_GET_MIN_VOLTAGE            = 0x00030008,
-	VCMSG_GET_TURBO                  = 0x00030009,
-	VCMSG_GET_MAX_TEMPERATURE        = 0x0003000a,
-	VCMSG_GET_STC                    = 0x0003000b,
-	VCMSG_SET_TURBO                  = 0x00038009,
-	VCMSG_SET_ALLOCATE_MEM           = 0x0003000c,
-	VCMSG_SET_LOCK_MEM               = 0x0003000d,
-	VCMSG_SET_UNLOCK_MEM             = 0x0003000e,
-	VCMSG_SET_RELEASE_MEM            = 0x0003000f,
-	VCMSG_SET_EXECUTE_CODE           = 0x00030010,
-	VCMSG_SET_EXECUTE_QPU            = 0x00030011,
-	VCMSG_SET_ENABLE_QPU             = 0x00030012,
-	VCMSG_GET_RESOURCE_HANDLE        = 0x00030014,
-	VCMSG_GET_EDID_BLOCK             = 0x00030020,
-	VCMSG_GET_CUSTOMER_OTP           = 0x00030021,
-	VCMSG_SET_CUSTOMER_OTP           = 0x00038021,
-	VCMSG_SET_ALLOCATE_BUFFER        = 0x00040001,
-	VCMSG_SET_RELEASE_BUFFER         = 0x00048001,
-	VCMSG_SET_BLANK_SCREEN           = 0x00040002,
-	VCMSG_TST_BLANK_SCREEN           = 0x00044002,
-	VCMSG_GET_PHYSICAL_WIDTH_HEIGHT  = 0x00040003,
-	VCMSG_TST_PHYSICAL_WIDTH_HEIGHT  = 0x00044003,
-	VCMSG_SET_PHYSICAL_WIDTH_HEIGHT  = 0x00048003,
-	VCMSG_GET_VIRTUAL_WIDTH_HEIGHT   = 0x00040004,
-	VCMSG_TST_VIRTUAL_WIDTH_HEIGHT   = 0x00044004,
-	VCMSG_SET_VIRTUAL_WIDTH_HEIGHT   = 0x00048004,
-	VCMSG_GET_DEPTH                  = 0x00040005,
-	VCMSG_TST_DEPTH                  = 0x00044005,
-	VCMSG_SET_DEPTH                  = 0x00048005,
-	VCMSG_GET_PIXEL_ORDER            = 0x00040006,
-	VCMSG_TST_PIXEL_ORDER            = 0x00044006,
-	VCMSG_SET_PIXEL_ORDER            = 0x00048006,
-	VCMSG_GET_ALPHA_MODE             = 0x00040007,
-	VCMSG_TST_ALPHA_MODE             = 0x00044007,
-	VCMSG_SET_ALPHA_MODE             = 0x00048007,
-	VCMSG_GET_PITCH                  = 0x00040008,
-	VCMSG_TST_PITCH                  = 0x00044008,
-	VCMSG_SET_PITCH                  = 0x00048008,
-	VCMSG_GET_VIRTUAL_OFFSET         = 0x00040009,
-	VCMSG_TST_VIRTUAL_OFFSET         = 0x00044009,
-	VCMSG_SET_VIRTUAL_OFFSET         = 0x00048009,
-	VCMSG_GET_OVERSCAN               = 0x0004000a,
-	VCMSG_TST_OVERSCAN               = 0x0004400a,
-	VCMSG_SET_OVERSCAN               = 0x0004800a,
-	VCMSG_GET_PALETTE                = 0x0004000b,
-	VCMSG_TST_PALETTE                = 0x0004400b,
-	VCMSG_SET_PALETTE                = 0x0004800b,
-	VCMSG_GET_LAYER                  = 0x0004000c,
-	VCMSG_TST_LAYER                  = 0x0004400c,
-	VCMSG_SET_LAYER                  = 0x0004800c,
-	VCMSG_GET_TRANSFORM              = 0x0004000d,
-	VCMSG_TST_TRANSFORM              = 0x0004400d,
-	VCMSG_SET_TRANSFORM              = 0x0004800d,
-	VCMSG_TST_VSYNC                  = 0x0004400e,
-	VCMSG_SET_VSYNC                  = 0x0004800e,
-	VCMSG_GET_TOUCHBUF               = 0x0004000f,
-	VCMSG_SET_CURSOR_INFO            = 0x00008010,
-	VCMSG_SET_CURSOR_STATE           = 0x00008011,
-};
-
-int bcm_mailbox_read(unsigned chan, uint32_t *data28);
-int bcm_mailbox_write(unsigned chan, uint32_t data28);
-int bcm_mailbox_property(void *data, int size);
-
-#endif