blob: 92339e9947b66203eb47997d610bfb968e03c479 [file] [log] [blame]
Stephen Boyd12332572011-12-06 16:00:51 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Stephen Boyd322a9922011-09-20 01:05:54 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <linux/kernel.h>
14#include <linux/err.h>
15#include <linux/io.h>
16#include <linux/elf.h>
17#include <linux/delay.h>
18#include <linux/module.h>
19#include <linux/slab.h>
20#include <linux/platform_device.h>
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -080021#include <linux/regulator/consumer.h>
Stephen Boyd86f2e652012-01-11 18:25:44 -080022#include <linux/clk.h>
Stephen Boyd322a9922011-09-20 01:05:54 -070023
24#include <mach/msm_iomap.h>
25
26#include "peripheral-loader.h"
27#include "scm-pas.h"
28
29#define RIVA_PMU_A2XB_CFG 0xB8
30#define RIVA_PMU_A2XB_CFG_EN BIT(0)
31
32#define RIVA_PMU_CFG 0x28
33#define RIVA_PMU_CFG_WARM_BOOT BIT(0)
34#define RIVA_PMU_CFG_IRIS_XO_MODE 0x6
35#define RIVA_PMU_CFG_IRIS_XO_MODE_48 (3 << 1)
36
Stephen Boyd12332572011-12-06 16:00:51 -080037#define RIVA_PMU_OVRD_EN 0x2C
38#define RIVA_PMU_OVRD_EN_CCPU_RESET BIT(0)
39#define RIVA_PMU_OVRD_EN_CCPU_CLK BIT(1)
40
Stephen Boyd322a9922011-09-20 01:05:54 -070041#define RIVA_PMU_OVRD_VAL 0x30
42#define RIVA_PMU_OVRD_VAL_CCPU_RESET BIT(0)
43#define RIVA_PMU_OVRD_VAL_CCPU_CLK BIT(1)
44
45#define RIVA_PMU_CCPU_CTL 0x9C
46#define RIVA_PMU_CCPU_CTL_HIGH_IVT BIT(0)
47#define RIVA_PMU_CCPU_CTL_REMAP_EN BIT(2)
48
49#define RIVA_PMU_CCPU_BOOT_REMAP_ADDR 0xA0
50
51#define RIVA_PLL_MODE (MSM_CLK_CTL_BASE + 0x31A0)
52#define PLL_MODE_OUTCTRL BIT(0)
53#define PLL_MODE_BYPASSNL BIT(1)
54#define PLL_MODE_RESET_N BIT(2)
55#define PLL_MODE_REF_XO_SEL 0x30
56#define PLL_MODE_REF_XO_SEL_CXO (2 << 4)
57#define PLL_MODE_REF_XO_SEL_RF (3 << 4)
58#define RIVA_PLL_L_VAL (MSM_CLK_CTL_BASE + 0x31A4)
59#define RIVA_PLL_M_VAL (MSM_CLK_CTL_BASE + 0x31A8)
60#define RIVA_PLL_N_VAL (MSM_CLK_CTL_BASE + 0x31Ac)
61#define RIVA_PLL_CONFIG (MSM_CLK_CTL_BASE + 0x31B4)
62#define RIVA_PLL_STATUS (MSM_CLK_CTL_BASE + 0x31B8)
Stephen Boyd12332572011-12-06 16:00:51 -080063#define RIVA_RESET (MSM_CLK_CTL_BASE + 0x35E0)
Stephen Boyd322a9922011-09-20 01:05:54 -070064
65#define RIVA_PMU_ROOT_CLK_SEL 0xC8
66#define RIVA_PMU_ROOT_CLK_SEL_3 BIT(2)
67
68#define RIVA_PMU_CLK_ROOT3 0x78
69#define RIVA_PMU_CLK_ROOT3_ENA BIT(0)
70#define RIVA_PMU_CLK_ROOT3_SRC0_DIV 0x3C
71#define RIVA_PMU_CLK_ROOT3_SRC0_DIV_2 (1 << 2)
72#define RIVA_PMU_CLK_ROOT3_SRC0_SEL 0x1C0
73#define RIVA_PMU_CLK_ROOT3_SRC0_SEL_RIVA (1 << 6)
74#define RIVA_PMU_CLK_ROOT3_SRC1_DIV 0x1E00
75#define RIVA_PMU_CLK_ROOT3_SRC1_DIV_2 (1 << 9)
76#define RIVA_PMU_CLK_ROOT3_SRC1_SEL 0xE000
77#define RIVA_PMU_CLK_ROOT3_SRC1_SEL_RIVA (1 << 13)
78
79struct riva_data {
80 void __iomem *base;
81 unsigned long start_addr;
Stephen Boyd86f2e652012-01-11 18:25:44 -080082 struct clk *xo;
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -080083 bool use_cxo;
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -080084 struct regulator *pll_supply;
Stephen Boyd6d67d252011-09-27 11:50:05 -070085 struct pil_device *pil;
Stephen Boyd322a9922011-09-20 01:05:54 -070086};
87
Stephen Boyd86f4a092012-03-22 10:59:22 -070088static bool cxo_is_needed(struct riva_data *drv)
Matt Wagantall04b7cc72011-12-09 18:52:26 -080089{
Stephen Boyd86f4a092012-03-22 10:59:22 -070090 u32 reg = readl_relaxed(drv->base + RIVA_PMU_CFG);
91 return (reg & RIVA_PMU_CFG_IRIS_XO_MODE)
92 != RIVA_PMU_CFG_IRIS_XO_MODE_48;
93}
94
95static int pil_riva_make_proxy_vote(struct pil_desc *pil)
96{
97 struct riva_data *drv = dev_get_drvdata(pil->dev);
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -080098 int ret;
Matt Wagantall04b7cc72011-12-09 18:52:26 -080099
Stephen Boyd86f4a092012-03-22 10:59:22 -0700100 drv->use_cxo = cxo_is_needed(drv);
Stephen Boydd0b993a2012-01-30 11:59:31 -0800101 ret = regulator_enable(drv->pll_supply);
102 if (ret) {
Stephen Boyd86f4a092012-03-22 10:59:22 -0700103 dev_err(pil->dev, "failed to enable pll supply\n");
Stephen Boydd0b993a2012-01-30 11:59:31 -0800104 goto err;
105 }
Stephen Boyd86f2e652012-01-11 18:25:44 -0800106 if (drv->use_cxo) {
107 ret = clk_prepare_enable(drv->xo);
Stephen Boydd0b993a2012-01-30 11:59:31 -0800108 if (ret) {
Stephen Boyd86f4a092012-03-22 10:59:22 -0700109 dev_err(pil->dev, "failed to enable xo\n");
Stephen Boydd0b993a2012-01-30 11:59:31 -0800110 goto err_clk;
111 }
Stephen Boyd86f2e652012-01-11 18:25:44 -0800112 }
Stephen Boydd0b993a2012-01-30 11:59:31 -0800113 return 0;
114err_clk:
115 regulator_disable(drv->pll_supply);
116err:
117 return ret;
Matt Wagantall04b7cc72011-12-09 18:52:26 -0800118}
119
Stephen Boyd86f4a092012-03-22 10:59:22 -0700120static void pil_riva_remove_proxy_vote(struct pil_desc *pil)
Matt Wagantall04b7cc72011-12-09 18:52:26 -0800121{
Stephen Boyd86f4a092012-03-22 10:59:22 -0700122 struct riva_data *drv = dev_get_drvdata(pil->dev);
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800123 regulator_disable(drv->pll_supply);
124 if (drv->use_cxo)
Stephen Boyd86f2e652012-01-11 18:25:44 -0800125 clk_disable_unprepare(drv->xo);
Matt Wagantall04b7cc72011-12-09 18:52:26 -0800126}
127
Stephen Boyd322a9922011-09-20 01:05:54 -0700128static int pil_riva_init_image(struct pil_desc *pil, const u8 *metadata,
129 size_t size)
130{
131 const struct elf32_hdr *ehdr = (struct elf32_hdr *)metadata;
132 struct riva_data *drv = dev_get_drvdata(pil->dev);
133 drv->start_addr = ehdr->e_entry;
134 return 0;
135}
136
137static int pil_riva_reset(struct pil_desc *pil)
138{
139 u32 reg, sel;
Stephen Boyd322a9922011-09-20 01:05:54 -0700140 struct riva_data *drv = dev_get_drvdata(pil->dev);
141 void __iomem *base = drv->base;
142 unsigned long start_addr = drv->start_addr;
Stephen Boyd86f2e652012-01-11 18:25:44 -0800143 int ret;
Stephen Boyd322a9922011-09-20 01:05:54 -0700144
Stephen Boyd86f2e652012-01-11 18:25:44 -0800145 ret = clk_prepare_enable(drv->xo);
146 if (ret)
147 return ret;
Stephen Boyd322a9922011-09-20 01:05:54 -0700148 /* Enable A2XB bridge */
149 reg = readl_relaxed(base + RIVA_PMU_A2XB_CFG);
150 reg |= RIVA_PMU_A2XB_CFG_EN;
151 writel_relaxed(reg, base + RIVA_PMU_A2XB_CFG);
152
Stephen Boyd322a9922011-09-20 01:05:54 -0700153 /* Program PLL 13 to 960 MHz */
154 reg = readl_relaxed(RIVA_PLL_MODE);
155 reg &= ~(PLL_MODE_BYPASSNL | PLL_MODE_OUTCTRL | PLL_MODE_RESET_N);
156 writel_relaxed(reg, RIVA_PLL_MODE);
157
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800158 if (drv->use_cxo)
Stephen Boyd322a9922011-09-20 01:05:54 -0700159 writel_relaxed(0x40000C00 | 50, RIVA_PLL_L_VAL);
Matt Wagantall04b7cc72011-12-09 18:52:26 -0800160 else
161 writel_relaxed(0x40000C00 | 40, RIVA_PLL_L_VAL);
Stephen Boyd322a9922011-09-20 01:05:54 -0700162 writel_relaxed(0, RIVA_PLL_M_VAL);
163 writel_relaxed(1, RIVA_PLL_N_VAL);
164 writel_relaxed(0x01495227, RIVA_PLL_CONFIG);
165
166 reg = readl_relaxed(RIVA_PLL_MODE);
167 reg &= ~(PLL_MODE_REF_XO_SEL);
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800168 reg |= drv->use_cxo ? PLL_MODE_REF_XO_SEL_CXO : PLL_MODE_REF_XO_SEL_RF;
Stephen Boyd322a9922011-09-20 01:05:54 -0700169 writel_relaxed(reg, RIVA_PLL_MODE);
170
171 /* Enable PLL 13 */
172 reg |= PLL_MODE_BYPASSNL;
173 writel_relaxed(reg, RIVA_PLL_MODE);
174
175 /*
176 * H/W requires a 5us delay between disabling the bypass and
177 * de-asserting the reset. Delay 10us just to be safe.
178 */
179 mb();
180 usleep_range(10, 20);
181
182 reg |= PLL_MODE_RESET_N;
183 writel_relaxed(reg, RIVA_PLL_MODE);
184 reg |= PLL_MODE_OUTCTRL;
185 writel_relaxed(reg, RIVA_PLL_MODE);
186
187 /* Wait for PLL to settle */
188 mb();
189 usleep_range(50, 100);
190
191 /* Configure cCPU for 240 MHz */
192 sel = readl_relaxed(base + RIVA_PMU_ROOT_CLK_SEL);
193 reg = readl_relaxed(base + RIVA_PMU_CLK_ROOT3);
194 if (sel & RIVA_PMU_ROOT_CLK_SEL_3) {
195 reg &= ~(RIVA_PMU_CLK_ROOT3_SRC0_SEL |
196 RIVA_PMU_CLK_ROOT3_SRC0_DIV);
197 reg |= RIVA_PMU_CLK_ROOT3_SRC0_SEL_RIVA |
198 RIVA_PMU_CLK_ROOT3_SRC0_DIV_2;
199 } else {
200 reg &= ~(RIVA_PMU_CLK_ROOT3_SRC1_SEL |
201 RIVA_PMU_CLK_ROOT3_SRC1_DIV);
202 reg |= RIVA_PMU_CLK_ROOT3_SRC1_SEL_RIVA |
203 RIVA_PMU_CLK_ROOT3_SRC1_DIV_2;
204 }
205 writel_relaxed(reg, base + RIVA_PMU_CLK_ROOT3);
206 reg |= RIVA_PMU_CLK_ROOT3_ENA;
207 writel_relaxed(reg, base + RIVA_PMU_CLK_ROOT3);
208 reg = readl_relaxed(base + RIVA_PMU_ROOT_CLK_SEL);
209 reg ^= RIVA_PMU_ROOT_CLK_SEL_3;
210 writel_relaxed(reg, base + RIVA_PMU_ROOT_CLK_SEL);
211
212 /* Use the high vector table */
213 reg = readl_relaxed(base + RIVA_PMU_CCPU_CTL);
214 reg |= RIVA_PMU_CCPU_CTL_HIGH_IVT | RIVA_PMU_CCPU_CTL_REMAP_EN;
215 writel_relaxed(reg, base + RIVA_PMU_CCPU_CTL);
216
217 /* Set base memory address */
218 writel_relaxed(start_addr >> 16, base + RIVA_PMU_CCPU_BOOT_REMAP_ADDR);
219
220 /* Clear warmboot bit indicating this is a cold boot */
221 reg = readl_relaxed(base + RIVA_PMU_CFG);
222 reg &= ~(RIVA_PMU_CFG_WARM_BOOT);
223 writel_relaxed(reg, base + RIVA_PMU_CFG);
224
225 /* Enable the cCPU clock */
226 reg = readl_relaxed(base + RIVA_PMU_OVRD_VAL);
227 reg |= RIVA_PMU_OVRD_VAL_CCPU_CLK;
228 writel_relaxed(reg, base + RIVA_PMU_OVRD_VAL);
229
230 /* Take cCPU out of reset */
231 reg |= RIVA_PMU_OVRD_VAL_CCPU_RESET;
232 writel_relaxed(reg, base + RIVA_PMU_OVRD_VAL);
Stephen Boyd86f2e652012-01-11 18:25:44 -0800233 clk_disable_unprepare(drv->xo);
Stephen Boyd322a9922011-09-20 01:05:54 -0700234
235 return 0;
236}
237
238static int pil_riva_shutdown(struct pil_desc *pil)
239{
240 struct riva_data *drv = dev_get_drvdata(pil->dev);
241 u32 reg;
Stephen Boyd86f2e652012-01-11 18:25:44 -0800242 int ret;
Stephen Boyd322a9922011-09-20 01:05:54 -0700243
Stephen Boyd86f2e652012-01-11 18:25:44 -0800244 ret = clk_prepare_enable(drv->xo);
245 if (ret)
246 return ret;
Stephen Boyd12332572011-12-06 16:00:51 -0800247 /* Put cCPU and cCPU clock into reset */
Stephen Boyd322a9922011-09-20 01:05:54 -0700248 reg = readl_relaxed(drv->base + RIVA_PMU_OVRD_VAL);
249 reg &= ~(RIVA_PMU_OVRD_VAL_CCPU_RESET | RIVA_PMU_OVRD_VAL_CCPU_CLK);
250 writel_relaxed(reg, drv->base + RIVA_PMU_OVRD_VAL);
Stephen Boyd12332572011-12-06 16:00:51 -0800251 reg = readl_relaxed(drv->base + RIVA_PMU_OVRD_EN);
252 reg |= RIVA_PMU_OVRD_EN_CCPU_RESET | RIVA_PMU_OVRD_EN_CCPU_CLK;
253 writel_relaxed(reg, drv->base + RIVA_PMU_OVRD_EN);
254 mb();
255
256 /* Assert reset to Riva */
257 writel_relaxed(1, RIVA_RESET);
258 mb();
259 usleep_range(1000, 2000);
260
261 /* Deassert reset to Riva */
262 writel_relaxed(0, RIVA_RESET);
263 mb();
Stephen Boyd322a9922011-09-20 01:05:54 -0700264
Stephen Boyd86f2e652012-01-11 18:25:44 -0800265 clk_disable_unprepare(drv->xo);
Matt Wagantall04b7cc72011-12-09 18:52:26 -0800266
Stephen Boyd322a9922011-09-20 01:05:54 -0700267 return 0;
268}
269
270static struct pil_reset_ops pil_riva_ops = {
271 .init_image = pil_riva_init_image,
Stephen Boyd322a9922011-09-20 01:05:54 -0700272 .auth_and_reset = pil_riva_reset,
273 .shutdown = pil_riva_shutdown,
Stephen Boyd86f4a092012-03-22 10:59:22 -0700274 .proxy_vote = pil_riva_make_proxy_vote,
275 .proxy_unvote = pil_riva_remove_proxy_vote,
Stephen Boyd322a9922011-09-20 01:05:54 -0700276};
277
278static int pil_riva_init_image_trusted(struct pil_desc *pil,
279 const u8 *metadata, size_t size)
280{
281 return pas_init_image(PAS_RIVA, metadata, size);
282}
283
284static int pil_riva_reset_trusted(struct pil_desc *pil)
285{
Stephen Boyd86f2e652012-01-11 18:25:44 -0800286 struct riva_data *drv = dev_get_drvdata(pil->dev);
287 int ret;
288
289 ret = clk_prepare_enable(drv->xo);
290 if (ret)
291 return ret;
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800292 /* Proxy-vote for resources RIVA needs */
Stephen Boyd86f4a092012-03-22 10:59:22 -0700293 ret = pas_auth_and_reset(PAS_RIVA);
Stephen Boyd86f2e652012-01-11 18:25:44 -0800294 clk_disable_unprepare(drv->xo);
295 return ret;
Stephen Boyd322a9922011-09-20 01:05:54 -0700296}
297
298static int pil_riva_shutdown_trusted(struct pil_desc *pil)
299{
Stephen Boyd86f2e652012-01-11 18:25:44 -0800300 int ret;
301 struct riva_data *drv = dev_get_drvdata(pil->dev);
Matt Wagantall04b7cc72011-12-09 18:52:26 -0800302
Stephen Boyd86f2e652012-01-11 18:25:44 -0800303 ret = clk_prepare_enable(drv->xo);
304 if (ret)
305 return ret;
306 ret = pas_shutdown(PAS_RIVA);
Stephen Boyd86f2e652012-01-11 18:25:44 -0800307 clk_disable_unprepare(drv->xo);
Matt Wagantall04b7cc72011-12-09 18:52:26 -0800308
309 return ret;
Stephen Boyd322a9922011-09-20 01:05:54 -0700310}
311
312static struct pil_reset_ops pil_riva_ops_trusted = {
313 .init_image = pil_riva_init_image_trusted,
Stephen Boyd322a9922011-09-20 01:05:54 -0700314 .auth_and_reset = pil_riva_reset_trusted,
315 .shutdown = pil_riva_shutdown_trusted,
Stephen Boyd86f4a092012-03-22 10:59:22 -0700316 .proxy_vote = pil_riva_make_proxy_vote,
317 .proxy_unvote = pil_riva_remove_proxy_vote,
Stephen Boyd322a9922011-09-20 01:05:54 -0700318};
319
320static int __devinit pil_riva_probe(struct platform_device *pdev)
321{
322 struct riva_data *drv;
323 struct resource *res;
324 struct pil_desc *desc;
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800325 int ret;
Stephen Boyd322a9922011-09-20 01:05:54 -0700326
327 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
328 if (!res)
329 return -EINVAL;
330
331 drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);
332 if (!drv)
333 return -ENOMEM;
334 platform_set_drvdata(pdev, drv);
335
336 drv->base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
337 if (!drv->base)
338 return -ENOMEM;
339
340 desc = devm_kzalloc(&pdev->dev, sizeof(*desc), GFP_KERNEL);
341 if (!desc)
342 return -ENOMEM;
343
Stephen Boyd83e5eae2012-03-23 15:04:46 -0700344 drv->pll_supply = devm_regulator_get(&pdev->dev, "pll_vdd");
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800345 if (IS_ERR(drv->pll_supply)) {
346 dev_err(&pdev->dev, "failed to get pll supply\n");
347 return PTR_ERR(drv->pll_supply);
348 }
Matt Wagantall52dd0622012-02-02 18:26:16 -0800349 if (regulator_count_voltages(drv->pll_supply) > 0) {
350 ret = regulator_set_voltage(drv->pll_supply, 1800000, 1800000);
351 if (ret) {
352 dev_err(&pdev->dev,
353 "failed to set pll supply voltage\n");
354 goto err;
355 }
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800356
Matt Wagantall52dd0622012-02-02 18:26:16 -0800357 ret = regulator_set_optimum_mode(drv->pll_supply, 100000);
358 if (ret < 0) {
359 dev_err(&pdev->dev,
360 "failed to set pll supply optimum mode\n");
361 goto err;
362 }
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800363 }
364
Stephen Boyd322a9922011-09-20 01:05:54 -0700365 desc->name = "wcnss";
366 desc->dev = &pdev->dev;
Stephen Boyd6d67d252011-09-27 11:50:05 -0700367 desc->owner = THIS_MODULE;
Stephen Boyd86f4a092012-03-22 10:59:22 -0700368 desc->proxy_timeout = 10000;
Stephen Boyd322a9922011-09-20 01:05:54 -0700369
370 if (pas_supported(PAS_RIVA) > 0) {
371 desc->ops = &pil_riva_ops_trusted;
372 dev_info(&pdev->dev, "using secure boot\n");
373 } else {
374 desc->ops = &pil_riva_ops;
375 dev_info(&pdev->dev, "using non-secure boot\n");
376 }
Matt Wagantall04b7cc72011-12-09 18:52:26 -0800377
Stephen Boyd86f2e652012-01-11 18:25:44 -0800378 drv->xo = clk_get(&pdev->dev, "cxo");
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800379 if (IS_ERR(drv->xo)) {
380 ret = PTR_ERR(drv->xo);
381 goto err;
382 }
Matt Wagantall04b7cc72011-12-09 18:52:26 -0800383
Stephen Boyd6d67d252011-09-27 11:50:05 -0700384 drv->pil = msm_pil_register(desc);
385 if (IS_ERR(drv->pil)) {
386 ret = PTR_ERR(drv->pil);
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800387 goto err_register;
Stephen Boyd6d67d252011-09-27 11:50:05 -0700388 }
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800389 return 0;
390err_register:
Stephen Boyd86f2e652012-01-11 18:25:44 -0800391 clk_put(drv->xo);
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800392err:
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800393 return ret;
Stephen Boyd322a9922011-09-20 01:05:54 -0700394}
395
396static int __devexit pil_riva_remove(struct platform_device *pdev)
397{
Stephen Boyd3bbdf6c2011-12-21 16:02:26 -0800398 struct riva_data *drv = platform_get_drvdata(pdev);
Stephen Boyd6d67d252011-09-27 11:50:05 -0700399 msm_pil_unregister(drv->pil);
Stephen Boyd86f2e652012-01-11 18:25:44 -0800400 clk_put(drv->xo);
Stephen Boyd322a9922011-09-20 01:05:54 -0700401 return 0;
402}
403
404static struct platform_driver pil_riva_driver = {
405 .probe = pil_riva_probe,
406 .remove = __devexit_p(pil_riva_remove),
407 .driver = {
408 .name = "pil_riva",
409 .owner = THIS_MODULE,
410 },
411};
412
413static int __init pil_riva_init(void)
414{
415 return platform_driver_register(&pil_riva_driver);
416}
417module_init(pil_riva_init);
418
419static void __exit pil_riva_exit(void)
420{
421 platform_driver_unregister(&pil_riva_driver);
422}
423module_exit(pil_riva_exit);
424
425MODULE_DESCRIPTION("Support for booting RIVA (WCNSS) processors");
426MODULE_LICENSE("GPL v2");