cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

i2c-parport.rst (7711B)


      1=========================
      2Kernel driver i2c-parport
      3=========================
      4
      5Author: Jean Delvare <jdelvare@suse.de>
      6
      7This is a unified driver for several i2c-over-parallel-port adapters,
      8such as the ones made by Philips, Velleman or ELV. This driver is
      9meant as a replacement for the older, individual drivers:
     10
     11 * i2c-philips-par
     12 * i2c-elv
     13 * i2c-velleman
     14 * video/i2c-parport
     15   (NOT the same as this one, dedicated to home brew teletext adapters)
     16
     17It currently supports the following devices:
     18
     19 * (type=0) Philips adapter
     20 * (type=1) home brew teletext adapter
     21 * (type=2) Velleman K8000 adapter
     22 * (type=3) ELV adapter
     23 * (type=4) Analog Devices ADM1032 evaluation board
     24 * (type=5) Analog Devices evaluation boards: ADM1025, ADM1030, ADM1031
     25 * (type=6) Barco LPT->DVI (K5800236) adapter
     26 * (type=7) One For All JP1 parallel port adapter
     27 * (type=8) VCT-jig
     28
     29These devices use different pinout configurations, so you have to tell
     30the driver what you have, using the type module parameter. There is no
     31way to autodetect the devices. Support for different pinout configurations
     32can be easily added when needed.
     33
     34Earlier kernels defaulted to type=0 (Philips).  But now, if the type
     35parameter is missing, the driver will simply fail to initialize.
     36
     37SMBus alert support is available on adapters which have this line properly
     38connected to the parallel port's interrupt pin.
     39
     40
     41Building your own adapter
     42-------------------------
     43
     44If you want to build you own i2c-over-parallel-port adapter, here is
     45a sample electronics schema (credits go to Sylvain Munaut)::
     46
     47  Device                                                      PC
     48  Side          ___________________Vdd (+)                    Side
     49                 |    |         |
     50                ---  ---       ---
     51                | |  | |       | |
     52                |R|  |R|       |R|
     53                | |  | |       | |
     54                ---  ---       ---
     55                 |    |         |
     56                 |    |    /|   |
     57  SCL  ----------x--------o |-----------x-------------------  pin 2
     58                      |    \|   |       |
     59                      |         |       |
     60                      |   |\    |       |
     61  SDA  ----------x----x---| o---x---------------------------  pin 13
     62                 |        |/            |
     63                 |                      |
     64                 |         /|           |
     65                 ---------o |----------------x--------------  pin 3
     66                           \|           |    |
     67                                        |    |
     68                                       ---  ---
     69                                       | |  | |
     70                                       |R|  |R|
     71                                       | |  | |
     72                                       ---  ---
     73                                        |    |
     74                                       ###  ###
     75                                       GND  GND
     76
     77Remarks:
     78 - This is the exact pinout and electronics used on the Analog Devices
     79   evaluation boards.
     80 - All inverters::
     81
     82                   /|
     83                 -o |-
     84                   \|
     85
     86   must be 74HC05, they must be open collector output.
     87 - All resitors are 10k.
     88 - Pins 18-25 of the parallel port connected to GND.
     89 - Pins 4-9 (D2-D7) could be used as VDD is the driver drives them high.
     90   The ADM1032 evaluation board uses D4-D7. Beware that the amount of
     91   current you can draw from the parallel port is limited. Also note that
     92   all connected lines MUST BE driven at the same state, else you'll short
     93   circuit the output buffers! So plugging the I2C adapter after loading
     94   the i2c-parport module might be a good safety since data line state
     95   prior to init may be unknown.
     96 - This is 5V!
     97 - Obviously you cannot read SCL (so it's not really standard-compliant).
     98   Pretty easy to add, just copy the SDA part and use another input pin.
     99   That would give (ELV compatible pinout)::
    100
    101
    102      Device                                                      PC
    103      Side          ______________________________Vdd (+)         Side
    104                     |    |            |    |
    105                    ---  ---          ---  ---
    106                    | |  | |          | |  | |
    107                    |R|  |R|          |R|  |R|
    108                    | |  | |          | |  | |
    109                    ---  ---          ---  ---
    110                     |    |            |    |
    111                     |    |      |\    |    |
    112      SCL  ----------x--------x--| o---x------------------------  pin 15
    113                          |   |  |/         |
    114                          |   |             |
    115                          |   |   /|        |
    116                          |   ---o |-------------x--------------  pin 2
    117                          |       \|        |    |
    118                          |                 |    |
    119                          |                 |    |
    120                          |      |\         |    |
    121      SDA  ---------------x---x--| o--------x-------------------  pin 10
    122                              |  |/              |
    123                              |                  |
    124                              |   /|             |
    125                              ---o |------------------x---------  pin 3
    126                                  \|             |    |
    127                                                 |    |
    128                                                ---  ---
    129                                                | |  | |
    130                                                |R|  |R|
    131                                                | |  | |
    132                                                ---  ---
    133                                                 |    |
    134                                                ###  ###
    135                                                GND  GND
    136
    137
    138If possible, you should use the same pinout configuration as existing
    139adapters do, so you won't even have to change the code.
    140
    141
    142Similar (but different) drivers
    143-------------------------------
    144
    145This driver is NOT the same as the i2c-pport driver found in the i2c
    146package. The i2c-pport driver makes use of modern parallel port features so
    147that you don't need additional electronics. It has other restrictions
    148however, and was not ported to Linux 2.6 (yet).
    149
    150This driver is also NOT the same as the i2c-pcf-epp driver found in the
    151lm_sensors package. The i2c-pcf-epp driver doesn't use the parallel port as
    152an I2C bus directly. Instead, it uses it to control an external I2C bus
    153master. That driver was not ported to Linux 2.6 (yet) either.
    154
    155
    156Legacy documentation for Velleman adapter
    157-----------------------------------------
    158
    159Useful links:
    160
    161- Velleman                http://www.velleman.be/
    162- Velleman K8000 Howto    http://howto.htlw16.ac.at/k8000-howto.html
    163
    164The project has lead to new libs for the Velleman K8000 and K8005:
    165
    166  LIBK8000 v1.99.1 and LIBK8005 v0.21
    167
    168With these libs, you can control the K8000 interface card and the K8005
    169stepper motor card with the simple commands which are in the original
    170Velleman software, like SetIOchannel, ReadADchannel, SendStepCCWFull and
    171many more, using /dev/velleman.
    172
    173  - http://home.wanadoo.nl/hihihi/libk8000.htm
    174  - http://home.wanadoo.nl/hihihi/libk8005.htm
    175  - http://struyve.mine.nu:8080/index.php?block=k8000
    176  - http://sourceforge.net/projects/libk8005/
    177
    178
    179One For All JP1 parallel port adapter
    180-------------------------------------
    181
    182The JP1 project revolves around a set of remote controls which expose
    183the I2C bus their internal configuration EEPROM lives on via a 6 pin
    184jumper in the battery compartment. More details can be found at:
    185
    186http://www.hifi-remote.com/jp1/
    187
    188Details of the simple parallel port hardware can be found at:
    189
    190http://www.hifi-remote.com/jp1/hardware.shtml