aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJaswinder Singh <jaswinder@infradead.org>2009-04-06 17:34:12 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-04-06 17:34:12 -0400
commit9137f05f7e72517d44b6b0c15b11b419ecb5d201 (patch)
tree63e1589e6dcf0a83d45e95420fd942c8821a7ae8 /drivers/media
parent4528e429009325790d94cd4f816b386bea8e8291 (diff)
firmware: convert av7110 driver to request_firmware()
Signed-off-by: Jaswinder Singh <jaswinder@infradead.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/ttpci/av7110_hw.c35
-rw-r--r--drivers/media/dvb/ttpci/av7110_hw.h3
2 files changed, 14 insertions, 24 deletions
diff --git a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c
index 3a3f5279e927..5e3f88911a1d 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/drivers/media/dvb/ttpci/av7110_hw.c
@@ -198,29 +198,10 @@ static int load_dram(struct av7110 *av7110, u32 *data, int len)
198 198
199/* we cannot write av7110 DRAM directly, so load a bootloader into 199/* we cannot write av7110 DRAM directly, so load a bootloader into
200 * the DPRAM which implements a simple boot protocol */ 200 * the DPRAM which implements a simple boot protocol */
201static u8 bootcode[] = {
202 0xea, 0x00, 0x00, 0x0e, 0xe1, 0xb0, 0xf0, 0x0e, 0xe2, 0x5e, 0xf0, 0x04,
203 0xe2, 0x5e, 0xf0, 0x04, 0xe2, 0x5e, 0xf0, 0x08, 0xe2, 0x5e, 0xf0, 0x04,
204 0xe2, 0x5e, 0xf0, 0x04, 0xe2, 0x5e, 0xf0, 0x04, 0x2c, 0x00, 0x00, 0x24,
205 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x34,
206 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa5, 0x5a, 0x5a, 0x00, 0x1f, 0x15, 0x55,
207 0x00, 0x00, 0x00, 0x09, 0xe5, 0x9f, 0xd0, 0x7c, 0xe5, 0x9f, 0x40, 0x74,
208 0xe3, 0xa0, 0x00, 0x00, 0xe5, 0x84, 0x00, 0x00, 0xe5, 0x84, 0x00, 0x04,
209 0xe5, 0x9f, 0x10, 0x70, 0xe5, 0x9f, 0x20, 0x70, 0xe5, 0x9f, 0x30, 0x64,
210 0xe8, 0xb1, 0x1f, 0xe0, 0xe8, 0xa3, 0x1f, 0xe0, 0xe1, 0x51, 0x00, 0x02,
211 0xda, 0xff, 0xff, 0xfb, 0xe5, 0x9f, 0xf0, 0x50, 0xe1, 0xd4, 0x10, 0xb0,
212 0xe3, 0x51, 0x00, 0x00, 0x0a, 0xff, 0xff, 0xfc, 0xe1, 0xa0, 0x10, 0x0d,
213 0xe5, 0x94, 0x30, 0x04, 0xe1, 0xd4, 0x20, 0xb2, 0xe2, 0x82, 0x20, 0x3f,
214 0xe1, 0xb0, 0x23, 0x22, 0x03, 0xa0, 0x00, 0x02, 0xe1, 0xc4, 0x00, 0xb0,
215 0x0a, 0xff, 0xff, 0xf4, 0xe8, 0xb1, 0x1f, 0xe0, 0xe8, 0xa3, 0x1f, 0xe0,
216 0xe8, 0xb1, 0x1f, 0xe0, 0xe8, 0xa3, 0x1f, 0xe0, 0xe2, 0x52, 0x20, 0x01,
217 0x1a, 0xff, 0xff, 0xf9, 0xe2, 0x2d, 0xdb, 0x05, 0xea, 0xff, 0xff, 0xec,
218 0x2c, 0x00, 0x03, 0xf8, 0x2c, 0x00, 0x04, 0x00, 0x9e, 0x00, 0x08, 0x00,
219 0x2c, 0x00, 0x00, 0x74, 0x2c, 0x00, 0x00, 0xc0
220};
221
222int av7110_bootarm(struct av7110 *av7110) 201int av7110_bootarm(struct av7110 *av7110)
223{ 202{
203 const struct firmware *fw;
204 const char *fw_name = "av7110/bootcode.bin";
224 struct saa7146_dev *dev = av7110->dev; 205 struct saa7146_dev *dev = av7110->dev;
225 u32 ret; 206 u32 ret;
226 int i; 207 int i;
@@ -261,7 +242,15 @@ int av7110_bootarm(struct av7110 *av7110)
261 //saa7146_setgpio(dev, DEBI_DONE_LINE, SAA7146_GPIO_INPUT); 242 //saa7146_setgpio(dev, DEBI_DONE_LINE, SAA7146_GPIO_INPUT);
262 //saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT); 243 //saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT);
263 244
264 mwdebi(av7110, DEBISWAB, DPRAM_BASE, bootcode, sizeof(bootcode)); 245 ret = request_firmware(&fw, fw_name, &dev->pci->dev);
246 if (ret) {
247 printk(KERN_ERR "dvb-ttpci: Failed to load firmware \"%s\"\n",
248 fw_name);
249 return ret;
250 }
251
252 mwdebi(av7110, DEBISWAB, DPRAM_BASE, fw->data, fw->size);
253 release_firmware(fw);
265 iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 254 iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
266 255
267 if (saa7146_wait_for_debi_done(av7110->dev, 1)) { 256 if (saa7146_wait_for_debi_done(av7110->dev, 1)) {
@@ -302,7 +291,7 @@ int av7110_bootarm(struct av7110 *av7110)
302 av7110->arm_ready = 1; 291 av7110->arm_ready = 1;
303 return 0; 292 return 0;
304} 293}
305 294MODULE_FIRMWARE("av7110/bootcode.bin");
306 295
307/**************************************************************************** 296/****************************************************************************
308 * DEBI command polling 297 * DEBI command polling
diff --git a/drivers/media/dvb/ttpci/av7110_hw.h b/drivers/media/dvb/ttpci/av7110_hw.h
index ca99e5c1fc8a..1634aba5cb84 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.h
+++ b/drivers/media/dvb/ttpci/av7110_hw.h
@@ -390,7 +390,8 @@ static inline void iwdebi(struct av7110 *av7110, u32 config, int addr, u32 val,
390} 390}
391 391
392/* buffer writes */ 392/* buffer writes */
393static inline void mwdebi(struct av7110 *av7110, u32 config, int addr, u8 *val, int count) 393static inline void mwdebi(struct av7110 *av7110, u32 config, int addr,
394 const u8 *val, int count)
394{ 395{
395 memcpy(av7110->debi_virt, val, count); 396 memcpy(av7110->debi_virt, val, count);
396 av7110_debiwrite(av7110, config, addr, 0, count); 397 av7110_debiwrite(av7110, config, addr, 0, count);