diff options
Diffstat (limited to 'drivers/media/dvb/ttpci')
-rw-r--r-- | drivers/media/dvb/ttpci/Kconfig | 23 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/Makefile | 9 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/av7110.c | 16 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/av7110_hw.c | 35 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/av7110_hw.h | 3 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/fdump.c | 44 |
6 files changed, 19 insertions, 111 deletions
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig index 772990415f99..68eb4493f991 100644 --- a/drivers/media/dvb/ttpci/Kconfig +++ b/drivers/media/dvb/ttpci/Kconfig | |||
@@ -28,25 +28,12 @@ config DVB_AV7110 | |||
28 | download/extract it, and then copy it to /usr/lib/hotplug/firmware | 28 | download/extract it, and then copy it to /usr/lib/hotplug/firmware |
29 | or /lib/firmware (depending on configuration of firmware hotplug). | 29 | or /lib/firmware (depending on configuration of firmware hotplug). |
30 | 30 | ||
31 | Say Y if you own such a card and want to use it. | 31 | Alternatively, you can download the file and use the kernel's |
32 | 32 | EXTRA_FIRMWARE configuration option to build it into your | |
33 | config DVB_AV7110_FIRMWARE | 33 | kernel image by adding the filename to the EXTRA_FIRMWARE |
34 | bool "Compile AV7110 firmware into the driver" | 34 | configuration option string. |
35 | depends on DVB_AV7110 && !STANDALONE | ||
36 | default y if DVB_AV7110=y | ||
37 | help | ||
38 | The AV7110 firmware is normally loaded by the firmware hotplug manager. | ||
39 | If you want to compile the firmware into the driver you need to say | ||
40 | Y here and provide the correct path of the firmware. You need this | ||
41 | option if you want to compile the whole driver statically into the | ||
42 | kernel. | ||
43 | 35 | ||
44 | All other people say N. | 36 | Say Y if you own such a card and want to use it. |
45 | |||
46 | config DVB_AV7110_FIRMWARE_FILE | ||
47 | string "Full pathname of av7110 firmware file" | ||
48 | depends on DVB_AV7110_FIRMWARE | ||
49 | default "/usr/lib/hotplug/firmware/dvb-ttpci-01.fw" | ||
50 | 37 | ||
51 | config DVB_AV7110_OSD | 38 | config DVB_AV7110_OSD |
52 | bool "AV7110 OSD support" | 39 | bool "AV7110 OSD support" |
diff --git a/drivers/media/dvb/ttpci/Makefile b/drivers/media/dvb/ttpci/Makefile index 71451237294c..8a4d5bb20a5b 100644 --- a/drivers/media/dvb/ttpci/Makefile +++ b/drivers/media/dvb/ttpci/Makefile | |||
@@ -19,12 +19,3 @@ obj-$(CONFIG_DVB_AV7110) += dvb-ttpci.o | |||
19 | 19 | ||
20 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ | 20 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ |
21 | EXTRA_CFLAGS += -Idrivers/media/common/tuners | 21 | EXTRA_CFLAGS += -Idrivers/media/common/tuners |
22 | |||
23 | hostprogs-y := fdump | ||
24 | |||
25 | ifeq ($(CONFIG_DVB_AV7110_FIRMWARE),y) | ||
26 | $(obj)/av7110.o: $(obj)/av7110_firm.h | ||
27 | |||
28 | $(obj)/av7110_firm.h: $(obj)/fdump | ||
29 | $(obj)/fdump $(CONFIG_DVB_AV7110_FIRMWARE_FILE) dvb_ttpci_fw $@ | ||
30 | endif | ||
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index 4624cee93e74..d1d959ed37b7 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c | |||
@@ -1518,20 +1518,6 @@ static int check_firmware(struct av7110* av7110) | |||
1518 | return 0; | 1518 | return 0; |
1519 | } | 1519 | } |
1520 | 1520 | ||
1521 | #ifdef CONFIG_DVB_AV7110_FIRMWARE_FILE | ||
1522 | #include "av7110_firm.h" | ||
1523 | static void put_firmware(struct av7110* av7110) | ||
1524 | { | ||
1525 | av7110->bin_fw = NULL; | ||
1526 | } | ||
1527 | |||
1528 | static inline int get_firmware(struct av7110* av7110) | ||
1529 | { | ||
1530 | av7110->bin_fw = dvb_ttpci_fw; | ||
1531 | av7110->size_fw = sizeof(dvb_ttpci_fw); | ||
1532 | return check_firmware(av7110); | ||
1533 | } | ||
1534 | #else | ||
1535 | static void put_firmware(struct av7110* av7110) | 1521 | static void put_firmware(struct av7110* av7110) |
1536 | { | 1522 | { |
1537 | vfree(av7110->bin_fw); | 1523 | vfree(av7110->bin_fw); |
@@ -1580,8 +1566,6 @@ static int get_firmware(struct av7110* av7110) | |||
1580 | release_firmware(fw); | 1566 | release_firmware(fw); |
1581 | return ret; | 1567 | return ret; |
1582 | } | 1568 | } |
1583 | #endif | ||
1584 | |||
1585 | 1569 | ||
1586 | static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params) | 1570 | static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params) |
1587 | { | 1571 | { |
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 */ |
201 | static 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 | |||
222 | int av7110_bootarm(struct av7110 *av7110) | 201 | int 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 | 294 | MODULE_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 */ |
393 | static inline void mwdebi(struct av7110 *av7110, u32 config, int addr, u8 *val, int count) | 393 | static 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); |
diff --git a/drivers/media/dvb/ttpci/fdump.c b/drivers/media/dvb/ttpci/fdump.c deleted file mode 100644 index c90001d35e7d..000000000000 --- a/drivers/media/dvb/ttpci/fdump.c +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <sys/types.h> | ||
3 | #include <sys/stat.h> | ||
4 | #include <fcntl.h> | ||
5 | #include <unistd.h> | ||
6 | |||
7 | int main(int argc, char **argv) | ||
8 | { | ||
9 | unsigned char buf[8]; | ||
10 | unsigned int i, count, bytes = 0; | ||
11 | FILE *fd_in, *fd_out; | ||
12 | |||
13 | if (argc != 4) { | ||
14 | fprintf(stderr, "\n\tusage: %s <ucode.bin> <array_name> <output_name>\n\n", argv[0]); | ||
15 | return -1; | ||
16 | } | ||
17 | |||
18 | fd_in = fopen(argv[1], "rb"); | ||
19 | if (fd_in == NULL) { | ||
20 | fprintf(stderr, "firmware file '%s' not found\n", argv[1]); | ||
21 | return -1; | ||
22 | } | ||
23 | |||
24 | fd_out = fopen(argv[3], "w+"); | ||
25 | if (fd_out == NULL) { | ||
26 | fprintf(stderr, "cannot create output file '%s'\n", argv[3]); | ||
27 | return -1; | ||
28 | } | ||
29 | |||
30 | fprintf(fd_out, "\n#include <asm/types.h>\n\nu8 %s [] = {", argv[2]); | ||
31 | |||
32 | while ((count = fread(buf, 1, 8, fd_in)) > 0) { | ||
33 | fprintf(fd_out, "\n\t"); | ||
34 | for (i = 0; i < count; i++, bytes++) | ||
35 | fprintf(fd_out, "0x%02x, ", buf[i]); | ||
36 | } | ||
37 | |||
38 | fprintf(fd_out, "\n};\n\n"); | ||
39 | |||
40 | fclose(fd_in); | ||
41 | fclose(fd_out); | ||
42 | |||
43 | return 0; | ||
44 | } | ||