mb862xxfb.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #ifndef __MB862XX_H__
  2. #define __MB862XX_H__
  3. struct mb862xx_l1_cfg {
  4. unsigned short sx;
  5. unsigned short sy;
  6. unsigned short sw;
  7. unsigned short sh;
  8. unsigned short dx;
  9. unsigned short dy;
  10. unsigned short dw;
  11. unsigned short dh;
  12. int mirror;
  13. };
  14. #define MB862XX_BASE 'M'
  15. #define MB862XX_L1_GET_CFG _IOR(MB862XX_BASE, 0, struct mb862xx_l1_cfg*)
  16. #define MB862XX_L1_SET_CFG _IOW(MB862XX_BASE, 1, struct mb862xx_l1_cfg*)
  17. #define MB862XX_L1_ENABLE _IOW(MB862XX_BASE, 2, int)
  18. #define MB862XX_L1_CAP_CTL _IOW(MB862XX_BASE, 3, int)
  19. #ifdef __KERNEL__
  20. #define PCI_VENDOR_ID_FUJITSU_LIMITED 0x10cf
  21. #define PCI_DEVICE_ID_FUJITSU_CORALP 0x2019
  22. #define PCI_DEVICE_ID_FUJITSU_CORALPA 0x201e
  23. #define PCI_DEVICE_ID_FUJITSU_CARMINE 0x202b
  24. #define GC_MMR_CORALP_EVB_VAL 0x11d7fa13
  25. enum gdctype {
  26. BT_NONE,
  27. BT_LIME,
  28. BT_MINT,
  29. BT_CORAL,
  30. BT_CORALP,
  31. BT_CARMINE,
  32. };
  33. struct mb862xx_gc_mode {
  34. struct fb_videomode def_mode; /* mode of connected display */
  35. unsigned int def_bpp; /* default depth */
  36. unsigned long max_vram; /* connected SDRAM size */
  37. unsigned long ccf; /* gdc clk */
  38. unsigned long mmr; /* memory mode for SDRAM */
  39. };
  40. /* private data */
  41. struct mb862xxfb_par {
  42. struct fb_info *info; /* fb info head */
  43. struct device *dev;
  44. struct pci_dev *pdev;
  45. struct resource *res; /* framebuffer/mmio resource */
  46. resource_size_t fb_base_phys; /* fb base, 36-bit PPC440EPx */
  47. resource_size_t mmio_base_phys; /* io base addr */
  48. void __iomem *fb_base; /* remapped framebuffer */
  49. void __iomem *mmio_base; /* remapped registers */
  50. size_t mapped_vram; /* length of remapped vram */
  51. size_t mmio_len; /* length of register region */
  52. unsigned long cap_buf; /* capture buffers offset */
  53. size_t cap_len; /* length of capture buffers */
  54. void __iomem *host; /* relocatable reg. bases */
  55. void __iomem *i2c;
  56. void __iomem *disp;
  57. void __iomem *disp1;
  58. void __iomem *cap;
  59. void __iomem *cap1;
  60. void __iomem *draw;
  61. void __iomem *geo;
  62. void __iomem *pio;
  63. void __iomem *ctrl;
  64. void __iomem *dram_ctrl;
  65. void __iomem *wrback;
  66. unsigned int irq;
  67. unsigned int type; /* GDC type */
  68. unsigned int refclk; /* disp. reference clock */
  69. struct mb862xx_gc_mode *gc_mode; /* GDC mode init data */
  70. int pre_init; /* don't init display if 1 */
  71. struct i2c_adapter *adap; /* GDC I2C bus adapter */
  72. int i2c_rs;
  73. struct mb862xx_l1_cfg l1_cfg;
  74. int l1_stride;
  75. u32 pseudo_palette[16];
  76. };
  77. extern void mb862xxfb_init_accel(struct fb_info *info, int xres);
  78. #ifdef CONFIG_FB_MB862XX_I2C
  79. extern int mb862xx_i2c_init(struct mb862xxfb_par *par);
  80. extern void mb862xx_i2c_exit(struct mb862xxfb_par *par);
  81. #else
  82. static inline int mb862xx_i2c_init(struct mb862xxfb_par *par) { return 0; }
  83. static inline void mb862xx_i2c_exit(struct mb862xxfb_par *par) { }
  84. #endif
  85. #if defined(CONFIG_FB_MB862XX_LIME) && defined(CONFIG_FB_MB862XX_PCI_GDC)
  86. #error "Select Lime GDC or CoralP/Carmine support, but not both together"
  87. #endif
  88. #if defined(CONFIG_FB_MB862XX_LIME)
  89. #define gdc_read __raw_readl
  90. #define gdc_write __raw_writel
  91. #else
  92. #define gdc_read readl
  93. #define gdc_write writel
  94. #endif
  95. #define inreg(type, off) \
  96. gdc_read((par->type + (off)))
  97. #define outreg(type, off, val) \
  98. gdc_write((val), (par->type + (off)))
  99. #define pack(a, b) (((a) << 16) | (b))
  100. #endif /* __KERNEL__ */
  101. #endif