devlml.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. // Lml 22 driver
  2. #define MJPG_VERSION "LML33 v0.2"
  3. #define NLML 2
  4. // The following values can be modified to tune/set default behaviour of the
  5. // driver.
  6. // The number of uS delay in I2C state transitions (probably >= 10)
  7. #define I2C_DELAY 50
  8. // The amount of spinning to do before the I2C bus is timed out
  9. #define I2C_TIMEOUT 10000000
  10. // The amount of spinning to do before the guest bus is timed out
  11. #define GUEST_TIMEOUT 10000000
  12. // The amount of spinning to do before the polling of the still
  13. // transfer port is aborted.
  14. #define STILL_TIMEOUT 1000000
  15. // The following number is the maximum number of cards permited. Each
  16. // card found is mapped to a device minor number starting from 0.
  17. #define MAX_CARDS 1
  18. // The following are the datastructures needed by the device.
  19. #define I2C_BUS 0x044
  20. // which bit of I2C_BUS is which
  21. #define I2C_SCL 1
  22. #define I2C_SDA 2
  23. #define INTR_JPEGREP 0x08000000
  24. #define INTR_GIRQ0 0x20000000
  25. #define INTR_STAT 0x03c
  26. // A Device records the properties of the various card types supported.
  27. typedef struct {
  28. int number; // The H33_CARDTYPE_ assigned
  29. char *card_name; // A string name
  30. int zr060addr; // Which guest bus address for the ZR36060
  31. } Device;
  32. // The remainder of the #defs are constants which should not need changing.
  33. // The PCI vendor and device ids of the zoran chipset on the dc30
  34. // these really belong in pci.h
  35. #define VENDOR_ZORAN 0x11de
  36. #define ZORAN_36057 0x6057
  37. #define ZORAN_36067 ZORAN_36057
  38. #define BT819Addr 0x8a
  39. #define BT856Addr 0x88
  40. #define NBUF 4
  41. #define FRAGM_FINAL_B 1
  42. #define STAT_BIT 1
  43. typedef struct HdrFragment HdrFragment;
  44. typedef struct FrameHeader FrameHeader;
  45. typedef union Fragment Fragment;
  46. typedef struct FragmentTable FragmentTable;
  47. typedef struct CodeData CodeData;
  48. //If we're on the little endian architecture, then 0xFF, 0xD8 byte sequence is
  49. #define MRK_SOI 0xD8FF
  50. #define MRK_APP3 0xE3FF
  51. #define APP_NAME "LML"
  52. struct FrameHeader { // Don't modify this struct, used by h/w
  53. ushort mrkSOI;
  54. ushort mrkAPP3;
  55. ushort lenAPP3;
  56. char nm[4];
  57. ushort frameNo;
  58. vlong ftime;
  59. ulong frameSize;
  60. ushort frameSeqNo;
  61. ushort SOIfiller;
  62. };
  63. #define FRAGSIZE (128*1024)
  64. union Fragment {
  65. FrameHeader fh;
  66. char fb[FRAGSIZE];
  67. };
  68. struct HdrFragment {
  69. uchar hdr[sizeof(FrameHeader)];
  70. Fragment;
  71. };
  72. struct FragmentTable { // Don't modify this struct, used by h/w
  73. ulong addr; // Physical address
  74. ulong leng;
  75. };
  76. struct CodeData { // Don't modify this struct, used by h/w
  77. ulong pamjpg; // Physical addr of statCom[0]
  78. ulong pagrab; // Physical addr of grab buffer
  79. ulong statCom[4]; // Physical addresses of fragdescs
  80. FragmentTable fragdesc[4];
  81. HdrFragment frag[4];
  82. };
  83. enum{
  84. Codedatasize = (sizeof(CodeData) + BY2PG - 1) & ~(BY2PG - 1),
  85. Grabdatasize = (730 * 568 * 2 * 2 + BY2PG - 1) & ~(BY2PG - 1),
  86. };
  87. #define POST_OFFICE 0x200
  88. #define POST_PEND 0x02000000
  89. #define POST_TIME 0x01000000
  90. #define POST_DIR 0x00800000
  91. #define GID060 0