0fc2cca370b3da9dc09e9976d4d03d8cd5d91f52
[openwrt.git] / target / linux / brcm2708 / patches-4.1 / 0146-bcm2708-vcio-Remove-module.patch
1 From a9b8c66f63005e9d3f4cbd6591874e618492898c Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
3 Date: Fri, 24 Jul 2015 19:34:31 +0200
4 Subject: [PATCH 146/203] bcm2708-vcio: Remove module
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 All drivers have been converted to the new firmware API, so this
10 module is not needed anymore.
11
12 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
13 ---
14  drivers/mailbox/Kconfig                       |   6 --
15  drivers/mailbox/Makefile                      |   2 -
16  drivers/mailbox/bcm2708-vcio.c                |  86 -----------------
17  include/linux/platform_data/mailbox-bcm2708.h | 127 --------------------------
18  4 files changed, 221 deletions(-)
19  delete mode 100644 drivers/mailbox/bcm2708-vcio.c
20  delete mode 100644 include/linux/platform_data/mailbox-bcm2708.h
21
22 --- a/drivers/mailbox/Kconfig
23 +++ b/drivers/mailbox/Kconfig
24 @@ -7,12 +7,6 @@ menuconfig MAILBOX
25  
26  if MAILBOX
27  
28 -config BCM2708_MBOX
29 -       bool "Broadcom BCM2708 Mailbox (vcio)"
30 -       depends on BCM2835_MBOX
31 -       help
32 -         Broadcom BCM2708 Mailbox (vcio)
33 -
34  config ARM_MHU
35         tristate "ARM MHU Mailbox"
36         depends on ARM_AMBA
37 --- a/drivers/mailbox/Makefile
38 +++ b/drivers/mailbox/Makefile
39 @@ -2,8 +2,6 @@
40  
41  obj-$(CONFIG_MAILBOX)          += mailbox.o
42  
43 -obj-$(CONFIG_BCM2708_MBOX)     += bcm2708-vcio.o
44 -
45  obj-$(CONFIG_ARM_MHU)  += arm_mhu.o
46  
47  obj-$(CONFIG_PL320_MBOX)       += pl320-ipc.o
48 --- a/drivers/mailbox/bcm2708-vcio.c
49 +++ /dev/null
50 @@ -1,86 +0,0 @@
51 -/*
52 - *  Copyright (C) 2010 Broadcom
53 - *
54 - * This program is free software; you can redistribute it and/or modify
55 - * it under the terms of the GNU General Public License version 2 as
56 - * published by the Free Software Foundation.
57 - *
58 - * This device provides a shared mechanism for writing to the mailboxes,
59 - * semaphores, doorbells etc. that are shared between the ARM and the
60 - * VideoCore processor
61 - */
62 -
63 -#include <linux/dma-mapping.h>
64 -#include <linux/init.h>
65 -#include <linux/module.h>
66 -#include <linux/platform_data/mailbox-bcm2708.h>
67 -#include <linux/uaccess.h>
68 -#include <soc/bcm2835/raspberrypi-firmware.h>
69 -
70 -#define DRIVER_NAME "bcm2708_vcio"
71 -
72 -extern int bcm_mailbox_write(unsigned chan, uint32_t data28)
73 -{
74 -       struct rpi_firmware *fw = rpi_firmware_get(NULL);
75 -
76 -       if (!fw)
77 -               return -ENODEV;
78 -
79 -       return rpi_firmware_transaction(fw, chan, data28);
80 -}
81 -EXPORT_SYMBOL_GPL(bcm_mailbox_write);
82 -
83 -extern int bcm_mailbox_read(unsigned chan, uint32_t *data28)
84 -{
85 -       struct rpi_firmware *fw = rpi_firmware_get(NULL);
86 -
87 -       if (!fw)
88 -               return -ENODEV;
89 -
90 -       *data28 = rpi_firmware_transaction_received(fw);
91 -
92 -       return 0;
93 -}
94 -EXPORT_SYMBOL_GPL(bcm_mailbox_read);
95 -
96 -static DEFINE_MUTEX(mailbox_lock);
97 -extern int bcm_mailbox_property(void *data, int size)
98 -{
99 -       uint32_t success;
100 -       dma_addr_t mem_bus; /* the memory address accessed from videocore */
101 -       void *mem_kern;     /* the memory address accessed from driver */
102 -       int s = 0;
103 -
104 -       mutex_lock(&mailbox_lock);
105 -       /* allocate some memory for the messages communicating with GPU */
106 -       mem_kern = dma_alloc_coherent(NULL, PAGE_ALIGN(size), &mem_bus,
107 -                                     GFP_KERNEL);
108 -       if (mem_kern) {
109 -               /* create the message */
110 -               memcpy(mem_kern, data, size);
111 -
112 -               /* send the message */
113 -               wmb();
114 -               s = bcm_mailbox_write(MBOX_CHAN_PROPERTY, (uint32_t)mem_bus);
115 -               if (s == 0)
116 -                       s = bcm_mailbox_read(MBOX_CHAN_PROPERTY, &success);
117 -               if (s == 0) {
118 -                       /* copy the response */
119 -                       rmb();
120 -                       memcpy(data, mem_kern, size);
121 -               }
122 -               dma_free_coherent(NULL, PAGE_ALIGN(size), mem_kern, mem_bus);
123 -       } else {
124 -               s = -ENOMEM;
125 -       }
126 -       if (s != 0)
127 -               pr_err(DRIVER_NAME ": %s failed (%d)\n", __func__, s);
128 -
129 -       mutex_unlock(&mailbox_lock);
130 -       return s;
131 -}
132 -EXPORT_SYMBOL_GPL(bcm_mailbox_property);
133 -
134 -MODULE_AUTHOR("Gray Girling");
135 -MODULE_DESCRIPTION("ARM I/O to VideoCore processor");
136 -MODULE_LICENSE("GPL");
137 --- a/include/linux/platform_data/mailbox-bcm2708.h
138 +++ /dev/null
139 @@ -1,127 +0,0 @@
140 -/*
141 - *  Copyright (C) 2010 Broadcom
142 - *
143 - * This program is free software; you can redistribute it and/or modify
144 - * it under the terms of the GNU General Public License as published by
145 - * the Free Software Foundation; either version 2 of the License, or
146 - * (at your option) any later version.
147 - *
148 - * This program is distributed in the hope that it will be useful,
149 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
150 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151 - * GNU General Public License for more details.
152 - */
153 -#ifndef _PLAT_MAILBOX_BCM2708_H
154 -#define _PLAT_MAILBOX_BCM2708_H
155 -
156 -/* Routines to handle I/O via the VideoCore "ARM control" registers
157 - * (semaphores, doorbells, mailboxes)
158 - */
159 -
160 -/* Constants shared with the ARM identifying separate mailbox channels */
161 -#define MBOX_CHAN_POWER    0 /* for use by the power management interface */
162 -#define MBOX_CHAN_FB       1 /* for use by the frame buffer */
163 -#define MBOX_CHAN_VCHIQ    3 /* for use by the VCHIQ interface */
164 -#define MBOX_CHAN_PROPERTY 8 /* for use by the property channel */
165 -#define MBOX_CHAN_COUNT    9
166 -
167 -enum {
168 -       VCMSG_PROCESS_REQUEST           = 0x00000000
169 -};
170 -
171 -enum {
172 -       VCMSG_REQUEST_SUCCESSFUL        = 0x80000000,
173 -       VCMSG_REQUEST_FAILED            = 0x80000001
174 -};
175 -
176 -/* Mailbox property tags */
177 -enum {
178 -       VCMSG_PROPERTY_END               = 0x00000000,
179 -       VCMSG_GET_FIRMWARE_REVISION      = 0x00000001,
180 -       VCMSG_GET_BOARD_MODEL            = 0x00010001,
181 -       VCMSG_GET_BOARD_REVISION         = 0x00010002,
182 -       VCMSG_GET_BOARD_MAC_ADDRESS      = 0x00010003,
183 -       VCMSG_GET_BOARD_SERIAL           = 0x00010004,
184 -       VCMSG_GET_ARM_MEMORY             = 0x00010005,
185 -       VCMSG_GET_VC_MEMORY              = 0x00010006,
186 -       VCMSG_GET_CLOCKS                 = 0x00010007,
187 -       VCMSG_GET_COMMAND_LINE           = 0x00050001,
188 -       VCMSG_GET_DMA_CHANNELS           = 0x00060001,
189 -       VCMSG_GET_POWER_STATE            = 0x00020001,
190 -       VCMSG_GET_TIMING                 = 0x00020002,
191 -       VCMSG_SET_POWER_STATE            = 0x00028001,
192 -       VCMSG_GET_CLOCK_STATE            = 0x00030001,
193 -       VCMSG_SET_CLOCK_STATE            = 0x00038001,
194 -       VCMSG_GET_CLOCK_RATE             = 0x00030002,
195 -       VCMSG_SET_CLOCK_RATE             = 0x00038002,
196 -       VCMSG_GET_VOLTAGE                = 0x00030003,
197 -       VCMSG_SET_VOLTAGE                = 0x00038003,
198 -       VCMSG_GET_MAX_CLOCK              = 0x00030004,
199 -       VCMSG_GET_MAX_VOLTAGE            = 0x00030005,
200 -       VCMSG_GET_TEMPERATURE            = 0x00030006,
201 -       VCMSG_GET_MIN_CLOCK              = 0x00030007,
202 -       VCMSG_GET_MIN_VOLTAGE            = 0x00030008,
203 -       VCMSG_GET_TURBO                  = 0x00030009,
204 -       VCMSG_GET_MAX_TEMPERATURE        = 0x0003000a,
205 -       VCMSG_GET_STC                    = 0x0003000b,
206 -       VCMSG_SET_TURBO                  = 0x00038009,
207 -       VCMSG_SET_ALLOCATE_MEM           = 0x0003000c,
208 -       VCMSG_SET_LOCK_MEM               = 0x0003000d,
209 -       VCMSG_SET_UNLOCK_MEM             = 0x0003000e,
210 -       VCMSG_SET_RELEASE_MEM            = 0x0003000f,
211 -       VCMSG_SET_EXECUTE_CODE           = 0x00030010,
212 -       VCMSG_SET_EXECUTE_QPU            = 0x00030011,
213 -       VCMSG_SET_ENABLE_QPU             = 0x00030012,
214 -       VCMSG_GET_RESOURCE_HANDLE        = 0x00030014,
215 -       VCMSG_GET_EDID_BLOCK             = 0x00030020,
216 -       VCMSG_GET_CUSTOMER_OTP           = 0x00030021,
217 -       VCMSG_SET_CUSTOMER_OTP           = 0x00038021,
218 -       VCMSG_SET_ALLOCATE_BUFFER        = 0x00040001,
219 -       VCMSG_SET_RELEASE_BUFFER         = 0x00048001,
220 -       VCMSG_SET_BLANK_SCREEN           = 0x00040002,
221 -       VCMSG_TST_BLANK_SCREEN           = 0x00044002,
222 -       VCMSG_GET_PHYSICAL_WIDTH_HEIGHT  = 0x00040003,
223 -       VCMSG_TST_PHYSICAL_WIDTH_HEIGHT  = 0x00044003,
224 -       VCMSG_SET_PHYSICAL_WIDTH_HEIGHT  = 0x00048003,
225 -       VCMSG_GET_VIRTUAL_WIDTH_HEIGHT   = 0x00040004,
226 -       VCMSG_TST_VIRTUAL_WIDTH_HEIGHT   = 0x00044004,
227 -       VCMSG_SET_VIRTUAL_WIDTH_HEIGHT   = 0x00048004,
228 -       VCMSG_GET_DEPTH                  = 0x00040005,
229 -       VCMSG_TST_DEPTH                  = 0x00044005,
230 -       VCMSG_SET_DEPTH                  = 0x00048005,
231 -       VCMSG_GET_PIXEL_ORDER            = 0x00040006,
232 -       VCMSG_TST_PIXEL_ORDER            = 0x00044006,
233 -       VCMSG_SET_PIXEL_ORDER            = 0x00048006,
234 -       VCMSG_GET_ALPHA_MODE             = 0x00040007,
235 -       VCMSG_TST_ALPHA_MODE             = 0x00044007,
236 -       VCMSG_SET_ALPHA_MODE             = 0x00048007,
237 -       VCMSG_GET_PITCH                  = 0x00040008,
238 -       VCMSG_TST_PITCH                  = 0x00044008,
239 -       VCMSG_SET_PITCH                  = 0x00048008,
240 -       VCMSG_GET_VIRTUAL_OFFSET         = 0x00040009,
241 -       VCMSG_TST_VIRTUAL_OFFSET         = 0x00044009,
242 -       VCMSG_SET_VIRTUAL_OFFSET         = 0x00048009,
243 -       VCMSG_GET_OVERSCAN               = 0x0004000a,
244 -       VCMSG_TST_OVERSCAN               = 0x0004400a,
245 -       VCMSG_SET_OVERSCAN               = 0x0004800a,
246 -       VCMSG_GET_PALETTE                = 0x0004000b,
247 -       VCMSG_TST_PALETTE                = 0x0004400b,
248 -       VCMSG_SET_PALETTE                = 0x0004800b,
249 -       VCMSG_GET_LAYER                  = 0x0004000c,
250 -       VCMSG_TST_LAYER                  = 0x0004400c,
251 -       VCMSG_SET_LAYER                  = 0x0004800c,
252 -       VCMSG_GET_TRANSFORM              = 0x0004000d,
253 -       VCMSG_TST_TRANSFORM              = 0x0004400d,
254 -       VCMSG_SET_TRANSFORM              = 0x0004800d,
255 -       VCMSG_TST_VSYNC                  = 0x0004400e,
256 -       VCMSG_SET_VSYNC                  = 0x0004800e,
257 -       VCMSG_GET_TOUCHBUF               = 0x0004000f,
258 -       VCMSG_SET_CURSOR_INFO            = 0x00008010,
259 -       VCMSG_SET_CURSOR_STATE           = 0x00008011,
260 -};
261 -
262 -int bcm_mailbox_read(unsigned chan, uint32_t *data28);
263 -int bcm_mailbox_write(unsigned chan, uint32_t data28);
264 -int bcm_mailbox_property(void *data, int size);
265 -
266 -#endif