Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 1 | This README escorted the skystar2-driver rewriting procedure. It describes the |
| 2 | state of the new flexcop-driver set and some internals are written down here |
| 3 | too. |
| 4 | |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 5 | This document hopefully describes things about the flexcop and its |
Johannes Stezenbach | c6ee197 | 2005-05-16 21:54:17 -0700 | [diff] [blame] | 6 | device-offsprings. Goal was to write an easy-to-write and easy-to-read set of |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 7 | drivers based on the skystar2.c and other information. |
| 8 | |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 9 | Remark: flexcop-pci.c was a copy of skystar2.c, but every line has been |
| 10 | touched and rewritten. |
| 11 | |
Johannes Stezenbach | c6ee197 | 2005-05-16 21:54:17 -0700 | [diff] [blame] | 12 | History & News |
| 13 | ============== |
| 14 | 2005-04-01 - correct USB ISOC transfers (thanks to Vadim Catana) |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 19 | General coding processing |
| 20 | ========================= |
| 21 | |
| 22 | We should proceed as follows (as long as no one complains): |
| 23 | |
| 24 | 0) Think before start writing code! |
| 25 | |
| 26 | 1) rewriting the skystar2.c with the help of the flexcop register descriptions |
| 27 | and splitting up the files to a pci-bus-part and a flexcop-part. |
| 28 | The new driver will be called b2c2-flexcop-pci.ko/b2c2-flexcop-usb.ko for the |
| 29 | device-specific part and b2c2-flexcop.ko for the common flexcop-functions. |
| 30 | |
| 31 | 2) Search for errors in the leftover of flexcop-pci.c (compare with pluto2.c |
| 32 | and other pci drivers) |
| 33 | |
| 34 | 3) make some beautification (see 'Improvements when rewriting (refactoring) is |
| 35 | done') |
| 36 | |
| 37 | 4) Testing the new driver and maybe substitute the skystar2.c with it, to reach |
| 38 | a wider tester audience. |
| 39 | |
| 40 | 5) creating an usb-bus-part using the already written flexcop code for the pci |
| 41 | card. |
| 42 | |
| 43 | Idea: create a kernel-object for the flexcop and export all important |
| 44 | functions. This option saves kernel-memory, but maybe a lot of functions have |
| 45 | to be exported to kernel namespace. |
| 46 | |
| 47 | |
| 48 | Current situation |
| 49 | ================= |
| 50 | |
| 51 | 0) Done :) |
| 52 | 1) Done (some minor issues left) |
| 53 | 2) Done |
| 54 | 3) Not ready yet, more information is necessary |
| 55 | 4) next to be done (see the table below) |
| 56 | 5) USB driver is working (yes, there are some minor issues) |
| 57 | |
| 58 | What seems to be ready? |
| 59 | ----------------------- |
| 60 | |
| 61 | 1) Rewriting |
| 62 | 1a) i2c is cut off from the flexcop-pci.c and seems to work |
| 63 | 1b) moved tuner and demod stuff from flexcop-pci.c to flexcop-tuner-fe.c |
| 64 | 1c) moved lnb and diseqc stuff from flexcop-pci.c to flexcop-tuner-fe.c |
| 65 | 1e) eeprom (reading MAC address) |
| 66 | 1d) sram (no dynamic sll size detection (commented out) (using default as JJ told me)) |
| 67 | 1f) misc. register accesses for reading parameters (e.g. resetting, revision) |
| 68 | 1g) pid/mac filter (flexcop-hw-filter.c) |
| 69 | 1i) dvb-stuff initialization in flexcop.c (done) |
| 70 | 1h) dma stuff (now just using the size-irq, instead of all-together, to be done) |
| 71 | 1j) remove flexcop initialization from flexcop-pci.c completely (done) |
| 72 | 1l) use a well working dma IRQ method (done, see 'Known bugs and problems and TODO') |
| 73 | 1k) cleanup flexcop-files (remove unused EXPORT_SYMBOLs, make static from |
| 74 | non-static where possible, moved code to proper places) |
| 75 | |
| 76 | 2) Search for errors in the leftover of flexcop-pci.c (partially done) |
| 77 | 5a) add MAC address reading |
Johannes Stezenbach | c6ee197 | 2005-05-16 21:54:17 -0700 | [diff] [blame] | 78 | 5c) feeding of ISOC data to the software demux (format of the isochronous data |
| 79 | and speed optimization, no real error) (thanks to Vadim Catana) |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 80 | |
| 81 | What to do in the near future? |
| 82 | -------------------------------------- |
| 83 | (no special order here) |
| 84 | |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 85 | 5) USB driver |
| 86 | 5b) optimize isoc-transfer (submitting/killing isoc URBs when transfer is starting) |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 87 | |
| 88 | Testing changes |
| 89 | --------------- |
| 90 | |
| 91 | O = item is working |
| 92 | P = item is partially working |
| 93 | X = item is not working |
| 94 | N = item does not apply here |
| 95 | <empty field> = item need to be examined |
| 96 | |
| 97 | | PCI | USB |
| 98 | item | mt352 | nxt2002 | stv0299 | mt312 | mt352 | nxt2002 | stv0299 | mt312 |
| 99 | -------+-------+---------+---------+-------+-------+---------+---------+------- |
| 100 | 1a) | O | | | | N | N | N | N |
| 101 | 1b) | O | | | | | | O | |
| 102 | 1c) | N | N | | | N | N | O | |
| 103 | 1d) | O | O |
| 104 | 1e) | O | O |
| 105 | 1f) | P |
| 106 | 1g) | O |
| 107 | 1h) | P | |
| 108 | 1i) | O | N |
| 109 | 1j) | O | N |
| 110 | 1l) | O | N |
| 111 | 2) | O | N |
| 112 | 5a) | N | O |
| 113 | 5b)* | N | |
Johannes Stezenbach | c6ee197 | 2005-05-16 21:54:17 -0700 | [diff] [blame] | 114 | 5c) | N | O |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 115 | |
| 116 | * - not done yet |
| 117 | |
| 118 | Known bugs and problems and TODO |
| 119 | -------------------------------- |
| 120 | |
| 121 | 1g/h/l) when pid filtering is enabled on the pci card |
| 122 | |
| 123 | DMA usage currently: |
| 124 | The DMA is splitted in 2 equal-sized subbuffers. The Flexcop writes to first |
| 125 | address and triggers an IRQ when it's full and starts writing to the second |
| 126 | address. When the second address is full, the IRQ is triggered again, and |
| 127 | the flexcop writes to first address again, and so on. |
| 128 | The buffersize of each address is currently 640*188 bytes. |
| 129 | |
| 130 | Problem is, when using hw-pid-filtering and doing some low-bandwidth |
| 131 | operation (like scanning) the buffers won't be filled enough to trigger |
| 132 | the IRQ. That's why: |
| 133 | |
| 134 | When PID filtering is activated, the timer IRQ is used. Every 1.97 ms the IRQ |
| 135 | is triggered. Is the current write address of DMA1 different to the one |
| 136 | during the last IRQ, then the data is passed to the demuxer. |
| 137 | |
| 138 | There is an additional DMA-IRQ-method: packet count IRQ. This isn't |
| 139 | implemented correctly yet. |
| 140 | |
| 141 | The solution is to disable HW PID filtering, but I don't know how the DVB |
| 142 | API software demux behaves on slow systems with 45MBit/s TS. |
| 143 | |
| 144 | Solved bugs :) |
| 145 | -------------- |
| 146 | 1g) pid-filtering (somehow pid index 4 and 5 (EMM_PID and ECM_PID) aren't |
| 147 | working) |
| 148 | SOLUTION: also index 0 was affected, because net_translation is done for |
| 149 | these indexes by default |
| 150 | |
Johannes Stezenbach | c6ee197 | 2005-05-16 21:54:17 -0700 | [diff] [blame] | 151 | 5b) isochronous transfer does only work in the first attempt (for the Sky2PC |
| 152 | USB, Air2PC is working) SOLUTION: the flexcop was going asleep and never really |
| 153 | woke up again (don't know if this need fixes, see |
| 154 | flexcop-fe-tuner.c:flexcop_sleep) |
| 155 | |
| 156 | NEWS: when the driver is loaded and unloaded and loaded again (w/o doing |
| 157 | anything in the while the driver is loaded the first time), no transfers take |
| 158 | place anymore. |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 159 | |
| 160 | Improvements when rewriting (refactoring) is done |
| 161 | ================================================= |
| 162 | |
| 163 | - split sleeping of the flexcop (misc_204.ACPI3_sig = 1;) from lnb_control |
| 164 | (enable sleeping for other demods than dvb-s) |
Johannes Stezenbach | c6ee197 | 2005-05-16 21:54:17 -0700 | [diff] [blame] | 165 | - add support for CableStar (stv0297 Microtune 203x/ALPS) (almost done, incompatibilities with the Nexus-CA) |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 166 | |
| 167 | Debugging |
| 168 | --------- |
| 169 | - add verbose debugging to skystar2.c (dump the reg_dw_data) and compare it |
| 170 | with this flexcop, this is important, because i2c is now using the |
| 171 | flexcop_ibi_value union from flexcop-reg.h (do you have a better idea for |
| 172 | that, please tell us so). |
| 173 | |
| 174 | Everything which is identical in the following table, can be put into a common |
| 175 | flexcop-module. |
| 176 | |
Mauro Carvalho Chehab | 674434c | 2005-12-12 00:37:28 -0800 | [diff] [blame] | 177 | PCI USB |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 178 | ------------------------------------------------------------------------------- |
| 179 | Different: |
| 180 | Register access: accessing IO memory USB control message |
| 181 | I2C bus: I2C bus of the FC USB control message |
| 182 | Data transfer: DMA isochronous transfer |
| 183 | EEPROM transfer: through i2c bus not clear yet |
| 184 | |
| 185 | Identical: |
| 186 | Streaming: accessing registers |
| 187 | PID Filtering: accessing registers |
| 188 | Sram destinations: accessing registers |
| 189 | Tuner/Demod: I2C bus |
| 190 | DVB-stuff: can be written for common use |
| 191 | |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 192 | Acknowledgements (just for the rewriting part) |
| 193 | ================ |
| 194 | |
| 195 | Bjarne Steinsbo thought a lot in the first place of the pci part for this code |
| 196 | sharing idea. |
| 197 | |
Johannes Stezenbach | 3ed8a31 | 2005-05-16 21:54:13 -0700 | [diff] [blame] | 198 | Andreas Oberritter for providing a recent PCI initialization template |
| 199 | (pluto2.c). |
| 200 | |
| 201 | Boleslaw Ciesielski for pointing out a problem with firmware loader. |
| 202 | |
| 203 | Vadim Catana for correcting the USB transfer. |
Johannes Stezenbach | 2add87a | 2005-05-16 21:54:10 -0700 | [diff] [blame] | 204 | |
Johannes Stezenbach | c6ee197 | 2005-05-16 21:54:17 -0700 | [diff] [blame] | 205 | comments, critics and ideas to linux-dvb@linuxtv.org. |