aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 11:34:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-03 11:34:00 -0400
commit5142c33ed86acbcef5c63a63d2b7384b9210d39f (patch)
tree6a0a36207ab436e1ef03bfefa7dac8f3a0cdfae5 /drivers/platform
parent5da77761e6fd51f633b4f31051c4f839e01c29c0 (diff)
parent7eb843aa5050a395bc922db1b41b7237f238d2ba (diff)
Merge tag 'staging-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging into next
Pull staging driver updates from Greg KH: "Here is the big staging driver pull request for 3.16-rc1. Lots of stuff here, tons of cleanup patches, a few new drivers, and some removed as well, but I think we are still adding a few thousand more lines than we remove, due to the new drivers being bigger than the ones deleted. One notible bit of work did stand out, Jes Sorensen has gone on a tear, fixing up a wireless driver to be "more sane" than it originally was from the vendor, with over 500 patches merged here. Good stuff, and a number of users laptops are better off for it. All of this has been in linux-next for a while" * tag 'staging-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1703 commits) staging: skein: fix sparse warning for static declarations staging/mt29f_spinand: coding style fixes staging: silicom: fix sparse warning for static variable staging: lustre: Fix coding style staging: android: binder.c: Use more appropriate functions for euid retrieval staging: lustre: fix integer as NULL pointer warnings Revert "staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()" Staging: rtl8192u: r8192U_wx.c Fixed a misplaced brace staging: ion: shrink highmem pages on kswapd staging: ion: use compound pages on high order pages for system heap staging: ion: remove struct ion_page_pool_item staging: ion: simplify ion_page_pool_total() staging: ion: tidy up a bit staging: rtl8723au: Remove redundant casting in usb_ops_linux.c staging: rtl8723au: Remove redundant casting in rtl8723a_hal_init.c staging: rtl8723au: Remove redundant casting in rtw_xmit.c staging: rtl8723au: Remove redundant casting in rtw_wlan_util.c staging: rtl8723au: Remove redundant casting in rtw_sta_mgt.c staging: rtl8723au: Remove redundant casting in rtw_recv.c staging: rtl8723au: Remove redundant casting in rtw_mlme.c ...
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/goldfish/goldfish_pipe.c34
-rw-r--r--drivers/platform/goldfish/pdev_bus.c11
2 files changed, 30 insertions, 15 deletions
diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
index 4f5aa831f549..d9a09d9637d9 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
@@ -56,6 +56,7 @@
56#include <linux/bitops.h> 56#include <linux/bitops.h>
57#include <linux/slab.h> 57#include <linux/slab.h>
58#include <linux/io.h> 58#include <linux/io.h>
59#include <linux/goldfish.h>
59 60
60/* 61/*
61 * IMPORTANT: The following constants must match the ones used and defined 62 * IMPORTANT: The following constants must match the ones used and defined
@@ -66,8 +67,10 @@
66#define PIPE_REG_COMMAND 0x00 /* write: value = command */ 67#define PIPE_REG_COMMAND 0x00 /* write: value = command */
67#define PIPE_REG_STATUS 0x04 /* read */ 68#define PIPE_REG_STATUS 0x04 /* read */
68#define PIPE_REG_CHANNEL 0x08 /* read/write: channel id */ 69#define PIPE_REG_CHANNEL 0x08 /* read/write: channel id */
70#define PIPE_REG_CHANNEL_HIGH 0x30 /* read/write: channel id */
69#define PIPE_REG_SIZE 0x0c /* read/write: buffer size */ 71#define PIPE_REG_SIZE 0x0c /* read/write: buffer size */
70#define PIPE_REG_ADDRESS 0x10 /* write: physical address */ 72#define PIPE_REG_ADDRESS 0x10 /* write: physical address */
73#define PIPE_REG_ADDRESS_HIGH 0x34 /* write: physical address */
71#define PIPE_REG_WAKES 0x14 /* read: wake flags */ 74#define PIPE_REG_WAKES 0x14 /* read: wake flags */
72#define PIPE_REG_PARAMS_ADDR_LOW 0x18 /* read/write: batch data address */ 75#define PIPE_REG_PARAMS_ADDR_LOW 0x18 /* read/write: batch data address */
73#define PIPE_REG_PARAMS_ADDR_HIGH 0x1c /* read/write: batch data address */ 76#define PIPE_REG_PARAMS_ADDR_HIGH 0x1c /* read/write: batch data address */
@@ -109,9 +112,9 @@
109#define PIPE_WAKE_WRITE (1 << 2) /* pipe can now be written to */ 112#define PIPE_WAKE_WRITE (1 << 2) /* pipe can now be written to */
110 113
111struct access_params { 114struct access_params {
112 u32 channel; 115 unsigned long channel;
113 u32 size; 116 u32 size;
114 u32 address; 117 unsigned long address;
115 u32 cmd; 118 u32 cmd;
116 u32 result; 119 u32 result;
117 /* reserved for future extension */ 120 /* reserved for future extension */
@@ -149,13 +152,14 @@ enum {
149 152
150 153
151static u32 goldfish_cmd_status(struct goldfish_pipe *pipe, u32 cmd) 154static u32 goldfish_cmd_status(struct goldfish_pipe *pipe, u32 cmd)
152{ 155{
153 unsigned long flags; 156 unsigned long flags;
154 u32 status; 157 u32 status;
155 struct goldfish_pipe_dev *dev = pipe->dev; 158 struct goldfish_pipe_dev *dev = pipe->dev;
156 159
157 spin_lock_irqsave(&dev->lock, flags); 160 spin_lock_irqsave(&dev->lock, flags);
158 writel((u32)pipe, dev->base + PIPE_REG_CHANNEL); 161 gf_write64((u64)(unsigned long)pipe, dev->base + PIPE_REG_CHANNEL,
162 dev->base + PIPE_REG_CHANNEL_HIGH);
159 writel(cmd, dev->base + PIPE_REG_COMMAND); 163 writel(cmd, dev->base + PIPE_REG_COMMAND);
160 status = readl(dev->base + PIPE_REG_STATUS); 164 status = readl(dev->base + PIPE_REG_STATUS);
161 spin_unlock_irqrestore(&dev->lock, flags); 165 spin_unlock_irqrestore(&dev->lock, flags);
@@ -163,12 +167,13 @@ static u32 goldfish_cmd_status(struct goldfish_pipe *pipe, u32 cmd)
163} 167}
164 168
165static void goldfish_cmd(struct goldfish_pipe *pipe, u32 cmd) 169static void goldfish_cmd(struct goldfish_pipe *pipe, u32 cmd)
166{ 170{
167 unsigned long flags; 171 unsigned long flags;
168 struct goldfish_pipe_dev *dev = pipe->dev; 172 struct goldfish_pipe_dev *dev = pipe->dev;
169 173
170 spin_lock_irqsave(&dev->lock, flags); 174 spin_lock_irqsave(&dev->lock, flags);
171 writel((u32)pipe, dev->base + PIPE_REG_CHANNEL); 175 gf_write64((u64)(unsigned long)pipe, dev->base + PIPE_REG_CHANNEL,
176 dev->base + PIPE_REG_CHANNEL_HIGH);
172 writel(cmd, dev->base + PIPE_REG_COMMAND); 177 writel(cmd, dev->base + PIPE_REG_COMMAND);
173 spin_unlock_irqrestore(&dev->lock, flags); 178 spin_unlock_irqrestore(&dev->lock, flags);
174} 179}
@@ -322,9 +327,12 @@ static ssize_t goldfish_pipe_read_write(struct file *filp, char __user *buffer,
322 spin_lock_irqsave(&dev->lock, irq_flags); 327 spin_lock_irqsave(&dev->lock, irq_flags);
323 if (access_with_param(dev, CMD_WRITE_BUFFER + cmd_offset, 328 if (access_with_param(dev, CMD_WRITE_BUFFER + cmd_offset,
324 address, avail, pipe, &status)) { 329 address, avail, pipe, &status)) {
325 writel((u32)pipe, dev->base + PIPE_REG_CHANNEL); 330 gf_write64((u64)(unsigned long)pipe,
331 dev->base + PIPE_REG_CHANNEL,
332 dev->base + PIPE_REG_CHANNEL_HIGH);
326 writel(avail, dev->base + PIPE_REG_SIZE); 333 writel(avail, dev->base + PIPE_REG_SIZE);
327 writel(address, dev->base + PIPE_REG_ADDRESS); 334 gf_write64(address, dev->base + PIPE_REG_ADDRESS,
335 dev->base + PIPE_REG_ADDRESS_HIGH);
328 writel(CMD_WRITE_BUFFER + cmd_offset, 336 writel(CMD_WRITE_BUFFER + cmd_offset,
329 dev->base + PIPE_REG_COMMAND); 337 dev->base + PIPE_REG_COMMAND);
330 status = readl(dev->base + PIPE_REG_STATUS); 338 status = readl(dev->base + PIPE_REG_STATUS);
@@ -447,7 +455,15 @@ static irqreturn_t goldfish_pipe_interrupt(int irq, void *dev_id)
447 /* First read the channel, 0 means the end of the list */ 455 /* First read the channel, 0 means the end of the list */
448 struct goldfish_pipe *pipe; 456 struct goldfish_pipe *pipe;
449 unsigned long wakes; 457 unsigned long wakes;
450 unsigned long channel = readl(dev->base + PIPE_REG_CHANNEL); 458 unsigned long channel = 0;
459
460#ifdef CONFIG_64BIT
461 channel = (u64)readl(dev->base + PIPE_REG_CHANNEL_HIGH) << 32;
462
463 if (channel == 0)
464 break;
465#endif
466 channel |= readl(dev->base + PIPE_REG_CHANNEL);
451 467
452 if (channel == 0) 468 if (channel == 0)
453 break; 469 break;
diff --git a/drivers/platform/goldfish/pdev_bus.c b/drivers/platform/goldfish/pdev_bus.c
index 92cc4cfafde5..8c43589c3edb 100644
--- a/drivers/platform/goldfish/pdev_bus.c
+++ b/drivers/platform/goldfish/pdev_bus.c
@@ -36,6 +36,7 @@
36#define PDEV_BUS_IO_SIZE (0x14) 36#define PDEV_BUS_IO_SIZE (0x14)
37#define PDEV_BUS_IRQ (0x18) 37#define PDEV_BUS_IRQ (0x18)
38#define PDEV_BUS_IRQ_COUNT (0x1c) 38#define PDEV_BUS_IRQ_COUNT (0x1c)
39#define PDEV_BUS_GET_NAME_HIGH (0x20)
39 40
40struct pdev_bus_dev { 41struct pdev_bus_dev {
41 struct list_head list; 42 struct list_head list;
@@ -129,7 +130,10 @@ static int goldfish_new_pdev(void)
129 dev->pdev.dev.dma_mask = (void *)(dev->pdev.name + name_len + 1); 130 dev->pdev.dev.dma_mask = (void *)(dev->pdev.name + name_len + 1);
130 *dev->pdev.dev.dma_mask = ~0; 131 *dev->pdev.dev.dma_mask = ~0;
131 132
132 writel((unsigned long)name, pdev_bus_base + PDEV_BUS_GET_NAME); 133#ifdef CONFIG_64BIT
134 writel((u32)((u64)name>>32), pdev_bus_base + PDEV_BUS_GET_NAME_HIGH);
135#endif
136 writel((u32)(unsigned long)name, pdev_bus_base + PDEV_BUS_GET_NAME);
133 name[name_len] = '\0'; 137 name[name_len] = '\0';
134 dev->pdev.id = readl(pdev_bus_base + PDEV_BUS_ID); 138 dev->pdev.id = readl(pdev_bus_base + PDEV_BUS_ID);
135 dev->pdev.resource[0].start = base; 139 dev->pdev.resource[0].start = base;
@@ -184,11 +188,6 @@ static int goldfish_pdev_bus_probe(struct platform_device *pdev)
184 pdev_bus_addr = r->start; 188 pdev_bus_addr = r->start;
185 pdev_bus_len = resource_size(r); 189 pdev_bus_len = resource_size(r);
186 190
187 if (request_mem_region(pdev_bus_addr, pdev_bus_len, "goldfish")) {
188 dev_err(&pdev->dev, "unable to reserve Goldfish MMIO.\n");
189 return -EBUSY;
190 }
191
192 pdev_bus_base = ioremap(pdev_bus_addr, pdev_bus_len); 191 pdev_bus_base = ioremap(pdev_bus_addr, pdev_bus_len);
193 if (pdev_bus_base == NULL) { 192 if (pdev_bus_base == NULL) {
194 ret = -ENOMEM; 193 ret = -ENOMEM;