1 /* SPDX-License-Identifier: GPL-2.0 */
5 struct mb862xx_l1_cfg
{
17 #define MB862XX_BASE 'M'
18 #define MB862XX_L1_GET_CFG _IOR(MB862XX_BASE, 0, struct mb862xx_l1_cfg*)
19 #define MB862XX_L1_SET_CFG _IOW(MB862XX_BASE, 1, struct mb862xx_l1_cfg*)
20 #define MB862XX_L1_ENABLE _IOW(MB862XX_BASE, 2, int)
21 #define MB862XX_L1_CAP_CTL _IOW(MB862XX_BASE, 3, int)
25 #define PCI_VENDOR_ID_FUJITSU_LIMITED 0x10cf
26 #define PCI_DEVICE_ID_FUJITSU_CORALP 0x2019
27 #define PCI_DEVICE_ID_FUJITSU_CORALPA 0x201e
28 #define PCI_DEVICE_ID_FUJITSU_CARMINE 0x202b
30 #define GC_MMR_CORALP_EVB_VAL 0x11d7fa13
41 struct mb862xx_gc_mode
{
42 struct fb_videomode def_mode
; /* mode of connected display */
43 unsigned int def_bpp
; /* default depth */
44 unsigned long max_vram
; /* connected SDRAM size */
45 unsigned long ccf
; /* gdc clk */
46 unsigned long mmr
; /* memory mode for SDRAM */
50 struct mb862xxfb_par
{
51 struct fb_info
*info
; /* fb info head */
54 struct resource
*res
; /* framebuffer/mmio resource */
56 resource_size_t fb_base_phys
; /* fb base, 36-bit PPC440EPx */
57 resource_size_t mmio_base_phys
; /* io base addr */
58 void __iomem
*fb_base
; /* remapped framebuffer */
59 void __iomem
*mmio_base
; /* remapped registers */
60 size_t mapped_vram
; /* length of remapped vram */
61 size_t mmio_len
; /* length of register region */
62 unsigned long cap_buf
; /* capture buffers offset */
63 size_t cap_len
; /* length of capture buffers */
65 void __iomem
*host
; /* relocatable reg. bases */
75 void __iomem
*dram_ctrl
;
79 unsigned int type
; /* GDC type */
80 unsigned int refclk
; /* disp. reference clock */
81 struct mb862xx_gc_mode
*gc_mode
; /* GDC mode init data */
82 int pre_init
; /* don't init display if 1 */
83 struct i2c_adapter
*adap
; /* GDC I2C bus adapter */
86 struct mb862xx_l1_cfg l1_cfg
;
89 u32 pseudo_palette
[16];
92 extern void mb862xxfb_init_accel(struct fb_info
*info
, int xres
);
93 #ifdef CONFIG_FB_MB862XX_I2C
94 extern int mb862xx_i2c_init(struct mb862xxfb_par
*par
);
95 extern void mb862xx_i2c_exit(struct mb862xxfb_par
*par
);
97 static inline int mb862xx_i2c_init(struct mb862xxfb_par
*par
) { return 0; }
98 static inline void mb862xx_i2c_exit(struct mb862xxfb_par
*par
) { }
101 #if defined(CONFIG_FB_MB862XX_LIME) && defined(CONFIG_FB_MB862XX_PCI_GDC)
102 #error "Select Lime GDC or CoralP/Carmine support, but not both together"
104 #if defined(CONFIG_FB_MB862XX_LIME)
105 #define gdc_read __raw_readl
106 #define gdc_write __raw_writel
108 #define gdc_read readl
109 #define gdc_write writel
112 #define inreg(type, off) \
113 gdc_read((par->type + (off)))
115 #define outreg(type, off, val) \
116 gdc_write((val), (par->type + (off)))
118 #define pack(a, b) (((a) << 16) | (b))
120 #endif /* __KERNEL__ */