coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ast_drv.h File Reference
#include "aspeed_coreboot.h"
Include dependency graph for ast_drv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ast_private
 
struct  ast_vbios_stdtable
 
struct  ast_vbios_enhtable
 
struct  ast_vbios_dclk_info
 
struct  ast_vbios_mode_info
 
struct  drm_display_mode
 
struct  drm_format
 
struct  drm_framebuffer
 
struct  drm_primary
 
struct  drm_crtc
 
struct  drm_connector
 

Macros

#define PCI_CHIP_AST2000   0x2000
 
#define PCI_CHIP_AST2100   0x2010
 
#define PCI_CHIP_AST1180   0x1180
 
#define AST_DRAM_512Mx16   0
 
#define AST_DRAM_1Gx16   1
 
#define AST_DRAM_512Mx32   2
 
#define AST_DRAM_1Gx32   3
 
#define AST_DRAM_2Gx16   6
 
#define AST_DRAM_4Gx16   7
 
#define AST_DRAM_8Gx16   8
 
#define AST_IO_AR_PORT_WRITE   (0x40)
 
#define AST_IO_MISC_PORT_WRITE   (0x42)
 
#define AST_IO_VGA_ENABLE_PORT   (0x43)
 
#define AST_IO_SEQ_PORT   (0x44)
 
#define AST_IO_DAC_INDEX_READ   (0x47)
 
#define AST_IO_DAC_INDEX_WRITE   (0x48)
 
#define AST_IO_DAC_DATA   (0x49)
 
#define AST_IO_GR_PORT   (0x4E)
 
#define AST_IO_CRTC_PORT   (0x54)
 
#define AST_IO_INPUT_STATUS1_READ   (0x5A)
 
#define AST_IO_MISC_PORT_READ   (0x4C)
 
#define AST_IO_MM_OFFSET   (0x380)
 
#define __ast_read(x)
 
#define __ast_io_read(x)
 
#define __ast_write(x)
 
#define __ast_io_write(x)
 
#define AST_VIDMEM_SIZE_8M   0x00800000
 
#define AST_VIDMEM_SIZE_16M   0x01000000
 
#define AST_VIDMEM_SIZE_32M   0x02000000
 
#define AST_VIDMEM_SIZE_64M   0x04000000
 
#define AST_VIDMEM_SIZE_128M   0x08000000
 
#define AST_VIDMEM_DEFAULT_SIZE   AST_VIDMEM_SIZE_8M
 
#define AST_MAX_HWC_WIDTH   64
 
#define AST_MAX_HWC_HEIGHT   64
 
#define AST_HWC_SIZE   (AST_MAX_HWC_WIDTH*AST_MAX_HWC_HEIGHT*2)
 
#define AST_HWC_SIGNATURE_SIZE   32
 
#define EINVAL   22 /* Invalid argument */
 
#define AST_DEFAULT_HWC_NUM   2
 
#define AST_HWC_SIGNATURE_CHECKSUM   0x00
 
#define AST_HWC_SIGNATURE_SizeX   0x04
 
#define AST_HWC_SIGNATURE_SizeY   0x08
 
#define AST_HWC_SIGNATURE_X   0x0C
 
#define AST_HWC_SIGNATURE_Y   0x10
 
#define AST_HWC_SIGNATURE_HOTSPOTX   0x14
 
#define AST_HWC_SIGNATURE_HOTSPOTY   0x18
 
#define DRM_MODE_FLAG_NVSYNC   1
 
#define DRM_MODE_FLAG_PVSYNC   2
 
#define DRM_MODE_FLAG_NHSYNC   4
 
#define DRM_MODE_FLAG_PHSYNC   8
 
#define AST_MM_ALIGN_SHIFT   4
 
#define AST_MM_ALIGN_MASK   ((1 << AST_MM_ALIGN_SHIFT) - 1)
 
#define DRM_FILE_PAGE_OFFSET   (0x100000000ULL >> PAGE_SHIFT)
 

Enumerations

enum  ast_chip {
  AST2000 , AST2100 , AST1100 , AST2200 ,
  AST2150 , AST2300 , AST2400 , AST2500 ,
  AST1180
}
 
enum  ast_tx_chip { AST_TX_NONE , AST_TX_SIL164 , AST_TX_ITE66121 , AST_TX_DP501 }
 
enum  drm_mode_status { MODE_NOMODE , MODE_OK }
 

Functions

int ast_driver_load (struct drm_device *dev, unsigned long flags)
 
int ast_driver_unload (struct drm_device *dev)
 
 __ast_read (8)
 
 __ast_read (16)
 
 __ast_read (32) __ast_io_read(8)
 
 __ast_io_read (16)
 
 __ast_io_read (32)
 
 __ast_write (8)
 
 __ast_write (16)
 
 __ast_write (32)
 
 __ast_io_write (8)
 
 __ast_io_write (16)
 
static void ast_set_index_reg (struct ast_private *ast, uint32_t base, uint8_t index, uint8_t val)
 
void ast_set_index_reg_mask (struct ast_private *ast, uint32_t base, uint8_t index, uint8_t mask, uint8_t val)
 
uint8_t ast_get_index_reg (struct ast_private *ast, uint32_t base, uint8_t index)
 
uint8_t ast_get_index_reg_mask (struct ast_private *ast, uint32_t base, uint8_t index, uint8_t mask)
 
static void ast_open_key (struct ast_private *ast)
 
void ast_enable_vga (struct drm_device *dev)
 
void ast_enable_mmio (struct drm_device *dev)
 
bool ast_is_vga_enabled (struct drm_device *dev)
 
void ast_post_gpu (struct drm_device *dev)
 
u32 ast_mindwm (struct ast_private *ast, u32 r)
 
void ast_moutdwm (struct ast_private *ast, u32 r, u32 v)
 
void ast_set_dp501_video_output (struct drm_device *dev, u8 mode)
 
bool ast_backup_fw (struct drm_device *dev, u8 *addr, u32 size)
 
bool ast_dp501_read_edid (struct drm_device *dev, u8 *ediddata)
 
u8 ast_get_dp501_max_clk (struct drm_device *dev)
 
void ast_init_3rdtx (struct drm_device *dev)
 
void ast_release_firmware (struct drm_device *dev)
 
int ast_crtc_mode_set (struct drm_crtc *crtc, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode)
 
enum drm_mode_status ast_mode_valid (struct drm_connector *connector, const unsigned int hdisplay, const unsigned int vdisplay)
 
void ast_hide_cursor (struct drm_crtc *crtc)
 
void ast_set_offset_reg (struct drm_crtc *crtc)
 
void ast_set_start_address_crt1 (struct ast_private *ast, u32 offset)
 
int ast_driver_framebuffer_init (struct drm_device *dev, int flags)
 
int ast_crtc_do_set_base (struct drm_crtc *crtc)
 
int ast_software_i2c_read (struct ast_private *ast_priv, uint8_t edid[128])
 

Macro Definition Documentation

◆ __ast_io_read

#define __ast_io_read (   x)
Value:
static inline u##x ast_io_read##x(struct ast_private *ast, u32 reg) { \
u##x val = 0;\
val = ioread##x(ast->regs + reg); \
else \
val = ioread_cbio##x(ast->ioregs + reg); \
return val;\
}
static struct ast_private * ast
Definition: ast_i2c.c:10
int x
Definition: edid.c:994
uint32_t u32
Definition: stdint.h:51
void __iomem * regs
Definition: ast_drv.h:46
bool io_space_uses_mmap
Definition: ast_drv.h:48
void __iomem * ioregs
Definition: ast_drv.h:47
u8 val
Definition: sys.c:300

◆ __ast_io_write

#define __ast_io_write (   x)
Value:
static inline void ast_io_write##x(struct ast_private *ast, u32 reg, u##x val) {\
iowrite##x(val, ast->regs + reg);\
else \
iowrite_cbio##x(val, ast->ioregs + reg);\
}

Definition at line 129 of file ast_drv.h.

◆ __ast_read

#define __ast_read (   x)
Value:
static inline u##x ast_read##x(struct ast_private *ast, u32 reg) { \
u##x val = 0;\
val = ioread##x(ast->regs + reg); \
return val;\
}

Definition at line 95 of file ast_drv.h.

◆ __ast_write

#define __ast_write (   x)
Value:
static inline void ast_write##x(struct ast_private *ast, u32 reg, u##x val) {\
iowrite##x(val, ast->regs + reg);\
}

Definition at line 120 of file ast_drv.h.

◆ AST_DEFAULT_HWC_NUM

#define AST_DEFAULT_HWC_NUM   2

Definition at line 177 of file ast_drv.h.

◆ AST_DRAM_1Gx16

#define AST_DRAM_1Gx16   1

Definition at line 34 of file ast_drv.h.

◆ AST_DRAM_1Gx32

#define AST_DRAM_1Gx32   3

Definition at line 36 of file ast_drv.h.

◆ AST_DRAM_2Gx16

#define AST_DRAM_2Gx16   6

Definition at line 37 of file ast_drv.h.

◆ AST_DRAM_4Gx16

#define AST_DRAM_4Gx16   7

Definition at line 38 of file ast_drv.h.

◆ AST_DRAM_512Mx16

#define AST_DRAM_512Mx16   0

Definition at line 33 of file ast_drv.h.

◆ AST_DRAM_512Mx32

#define AST_DRAM_512Mx32   2

Definition at line 35 of file ast_drv.h.

◆ AST_DRAM_8Gx16

#define AST_DRAM_8Gx16   8

Definition at line 39 of file ast_drv.h.

◆ AST_HWC_SIGNATURE_CHECKSUM

#define AST_HWC_SIGNATURE_CHECKSUM   0x00

Definition at line 179 of file ast_drv.h.

◆ AST_HWC_SIGNATURE_HOTSPOTX

#define AST_HWC_SIGNATURE_HOTSPOTX   0x14

Definition at line 184 of file ast_drv.h.

◆ AST_HWC_SIGNATURE_HOTSPOTY

#define AST_HWC_SIGNATURE_HOTSPOTY   0x18

Definition at line 185 of file ast_drv.h.

◆ AST_HWC_SIGNATURE_SIZE

#define AST_HWC_SIGNATURE_SIZE   32

Definition at line 173 of file ast_drv.h.

◆ AST_HWC_SIGNATURE_SizeX

#define AST_HWC_SIGNATURE_SizeX   0x04

Definition at line 180 of file ast_drv.h.

◆ AST_HWC_SIGNATURE_SizeY

#define AST_HWC_SIGNATURE_SizeY   0x08

Definition at line 181 of file ast_drv.h.

◆ AST_HWC_SIGNATURE_X

#define AST_HWC_SIGNATURE_X   0x0C

Definition at line 182 of file ast_drv.h.

◆ AST_HWC_SIGNATURE_Y

#define AST_HWC_SIGNATURE_Y   0x10

Definition at line 183 of file ast_drv.h.

◆ AST_HWC_SIZE

#define AST_HWC_SIZE   (AST_MAX_HWC_WIDTH*AST_MAX_HWC_HEIGHT*2)

Definition at line 172 of file ast_drv.h.

◆ AST_IO_AR_PORT_WRITE

#define AST_IO_AR_PORT_WRITE   (0x40)

Definition at line 81 of file ast_drv.h.

◆ AST_IO_CRTC_PORT

#define AST_IO_CRTC_PORT   (0x54)

Definition at line 89 of file ast_drv.h.

◆ AST_IO_DAC_DATA

#define AST_IO_DAC_DATA   (0x49)

Definition at line 87 of file ast_drv.h.

◆ AST_IO_DAC_INDEX_READ

#define AST_IO_DAC_INDEX_READ   (0x47)

Definition at line 85 of file ast_drv.h.

◆ AST_IO_DAC_INDEX_WRITE

#define AST_IO_DAC_INDEX_WRITE   (0x48)

Definition at line 86 of file ast_drv.h.

◆ AST_IO_GR_PORT

#define AST_IO_GR_PORT   (0x4E)

Definition at line 88 of file ast_drv.h.

◆ AST_IO_INPUT_STATUS1_READ

#define AST_IO_INPUT_STATUS1_READ   (0x5A)

Definition at line 90 of file ast_drv.h.

◆ AST_IO_MISC_PORT_READ

#define AST_IO_MISC_PORT_READ   (0x4C)

Definition at line 91 of file ast_drv.h.

◆ AST_IO_MISC_PORT_WRITE

#define AST_IO_MISC_PORT_WRITE   (0x42)

Definition at line 82 of file ast_drv.h.

◆ AST_IO_MM_OFFSET

#define AST_IO_MM_OFFSET   (0x380)

Definition at line 93 of file ast_drv.h.

◆ AST_IO_SEQ_PORT

#define AST_IO_SEQ_PORT   (0x44)

Definition at line 84 of file ast_drv.h.

◆ AST_IO_VGA_ENABLE_PORT

#define AST_IO_VGA_ENABLE_PORT   (0x43)

Definition at line 83 of file ast_drv.h.

◆ AST_MAX_HWC_HEIGHT

#define AST_MAX_HWC_HEIGHT   64

Definition at line 170 of file ast_drv.h.

◆ AST_MAX_HWC_WIDTH

#define AST_MAX_HWC_WIDTH   64

Definition at line 169 of file ast_drv.h.

◆ AST_MM_ALIGN_MASK

#define AST_MM_ALIGN_MASK   ((1 << AST_MM_ALIGN_SHIFT) - 1)

Definition at line 281 of file ast_drv.h.

◆ AST_MM_ALIGN_SHIFT

#define AST_MM_ALIGN_SHIFT   4

Definition at line 280 of file ast_drv.h.

◆ AST_VIDMEM_DEFAULT_SIZE

#define AST_VIDMEM_DEFAULT_SIZE   AST_VIDMEM_SIZE_8M

Definition at line 167 of file ast_drv.h.

◆ AST_VIDMEM_SIZE_128M

#define AST_VIDMEM_SIZE_128M   0x08000000

Definition at line 165 of file ast_drv.h.

◆ AST_VIDMEM_SIZE_16M

#define AST_VIDMEM_SIZE_16M   0x01000000

Definition at line 162 of file ast_drv.h.

◆ AST_VIDMEM_SIZE_32M

#define AST_VIDMEM_SIZE_32M   0x02000000

Definition at line 163 of file ast_drv.h.

◆ AST_VIDMEM_SIZE_64M

#define AST_VIDMEM_SIZE_64M   0x04000000

Definition at line 164 of file ast_drv.h.

◆ AST_VIDMEM_SIZE_8M

#define AST_VIDMEM_SIZE_8M   0x00800000

Definition at line 161 of file ast_drv.h.

◆ DRM_FILE_PAGE_OFFSET

#define DRM_FILE_PAGE_OFFSET   (0x100000000ULL >> PAGE_SHIFT)

Definition at line 283 of file ast_drv.h.

◆ DRM_MODE_FLAG_NHSYNC

#define DRM_MODE_FLAG_NHSYNC   4

Definition at line 225 of file ast_drv.h.

◆ DRM_MODE_FLAG_NVSYNC

#define DRM_MODE_FLAG_NVSYNC   1

Definition at line 223 of file ast_drv.h.

◆ DRM_MODE_FLAG_PHSYNC

#define DRM_MODE_FLAG_PHSYNC   8

Definition at line 226 of file ast_drv.h.

◆ DRM_MODE_FLAG_PVSYNC

#define DRM_MODE_FLAG_PVSYNC   2

Definition at line 224 of file ast_drv.h.

◆ EINVAL

#define EINVAL   22 /* Invalid argument */

Definition at line 175 of file ast_drv.h.

◆ PCI_CHIP_AST1180

#define PCI_CHIP_AST1180   0x1180

Definition at line 12 of file ast_drv.h.

◆ PCI_CHIP_AST2000

#define PCI_CHIP_AST2000   0x2000

Definition at line 10 of file ast_drv.h.

◆ PCI_CHIP_AST2100

#define PCI_CHIP_AST2100   0x2010

Definition at line 11 of file ast_drv.h.

Enumeration Type Documentation

◆ ast_chip

enum ast_chip
Enumerator
AST2000 
AST2100 
AST1100 
AST2200 
AST2150 
AST2300 
AST2400 
AST2500 
AST1180 

Definition at line 14 of file ast_drv.h.

◆ ast_tx_chip

Enumerator
AST_TX_NONE 
AST_TX_SIL164 
AST_TX_ITE66121 
AST_TX_DP501 

Definition at line 26 of file ast_drv.h.

◆ drm_mode_status

Enumerator
MODE_NOMODE 
MODE_OK 

Definition at line 275 of file ast_drv.h.

Function Documentation

◆ __ast_io_read() [1/2]

__ast_io_read ( 16  )

◆ __ast_io_read() [2/2]

__ast_io_read ( 32  )

◆ __ast_io_write() [1/2]

__ast_io_write ( 16  )

◆ __ast_io_write() [2/2]

__ast_io_write ( )

◆ __ast_read() [1/3]

__ast_read ( 16  )

◆ __ast_read() [2/3]

__ast_read ( 32  )

◆ __ast_read() [3/3]

__ast_read ( )

◆ __ast_write() [1/3]

__ast_write ( 16  )

◆ __ast_write() [2/3]

__ast_write ( 32  )

◆ __ast_write() [3/3]

__ast_write ( )

◆ ast_backup_fw()

bool ast_backup_fw ( struct drm_device dev,
u8 addr,
u32  size 
)

Definition at line 123 of file ast_dp501.c.

References addr, ast, ast_mindwm(), ast_private::dev, drm_device::dev_private, and get_fw_base().

Referenced by ast_detect_chip().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ast_crtc_do_set_base()

◆ ast_crtc_mode_set()

◆ ast_dp501_read_edid()

bool ast_dp501_read_edid ( struct drm_device dev,
u8 ediddata 
)

Definition at line 233 of file ast_dp501.c.

References ast, ast_mindwm(), ast_private::dev, drm_device::dev_private, get_fw_base(), and offset.

Referenced by ast_select_mode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ast_driver_framebuffer_init()

◆ ast_driver_load()

◆ ast_driver_unload()

int ast_driver_unload ( struct drm_device dev)

◆ ast_enable_mmio()

void ast_enable_mmio ( struct drm_device dev)

Definition at line 22 of file ast_post.c.

References ast, AST_IO_CRTC_PORT, ast_set_index_reg_mask(), ast_private::dev, and drm_device::dev_private.

Referenced by ast_detect_chip(), and ast_post_gpu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ast_enable_vga()

void ast_enable_vga ( struct drm_device dev)

Definition at line 14 of file ast_post.c.

References ast, AST_IO_MISC_PORT_WRITE, AST_IO_VGA_ENABLE_PORT, ast_private::dev, and drm_device::dev_private.

Referenced by ast_detect_chip(), and ast_post_gpu().

Here is the caller graph for this function:

◆ ast_get_dp501_max_clk()

u8 ast_get_dp501_max_clk ( struct drm_device dev)

Definition at line 205 of file ast_dp501.c.

References ast, ast_mindwm(), ast_private::dev, drm_device::dev_private, get_fw_base(), and offset.

Referenced by ast_select_mode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ast_get_index_reg()

uint8_t ast_get_index_reg ( struct ast_private ast,
uint32_t  base,
uint8_t  index 
)

Definition at line 21 of file ast_main.c.

References ast, and base.

◆ ast_get_index_reg_mask()

uint8_t ast_get_index_reg_mask ( struct ast_private ast,
uint32_t  base,
uint8_t  index,
uint8_t  mask 
)

◆ ast_hide_cursor()

void ast_hide_cursor ( struct drm_crtc crtc)

Definition at line 456 of file ast_mode.c.

References ast, AST_IO_CRTC_PORT, ast_set_index_reg_mask(), drm_crtc::dev, and drm_device::dev_private.

Referenced by ast_driver_framebuffer_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ast_init_3rdtx()

void ast_init_3rdtx ( struct drm_device dev)

Definition at line 361 of file ast_dp501.c.

References ast, AST2300, AST2400, ast_get_index_reg_mask(), ast_init_analog(), ast_init_dvo(), AST_IO_CRTC_PORT, ast_launch_m68k(), AST_TX_SIL164, ast_private::chip, ast_private::dev, drm_device::dev_private, and ast_private::tx_chip_type.

Referenced by ast_post_gpu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ast_is_vga_enabled()

bool ast_is_vga_enabled ( struct drm_device dev)

Definition at line 29 of file ast_post.c.

References ast, AST1180, AST_IO_VGA_ENABLE_PORT, ch, ast_private::chip, ast_private::dev, and drm_device::dev_private.

Referenced by ast_detect_chip().

Here is the caller graph for this function:

◆ ast_mindwm()

◆ ast_mode_valid()

enum drm_mode_status ast_mode_valid ( struct drm_connector connector,
const unsigned int  hdisplay,
const unsigned int  vdisplay 
)

Definition at line 462 of file ast_mode.c.

Referenced by ast_select_mode().

Here is the caller graph for this function:

◆ ast_moutdwm()

◆ ast_open_key()

static void ast_open_key ( struct ast_private ast)
inlinestatic

Definition at line 156 of file ast_drv.h.

References ast, AST_IO_CRTC_PORT, and ast_set_index_reg().

Referenced by ast_crtc_mode_set(), ast_detect_chip(), ast_get_vram_info(), and ast_post_gpu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ast_post_gpu()

◆ ast_release_firmware()

void ast_release_firmware ( struct drm_device dev)

◆ ast_set_dp501_video_output()

void ast_set_dp501_video_output ( struct drm_device dev,
u8  mode 
)

Definition at line 110 of file ast_dp501.c.

References ast_write_cmd(), ast_write_data(), ast_private::dev, and msleep().

Referenced by ast_crtc_mode_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ast_set_index_reg()

static void ast_set_index_reg ( struct ast_private ast,
uint32_t  base,
uint8_t  index,
uint8_t  val 
)
inlinestatic

◆ ast_set_index_reg_mask()

void ast_set_index_reg_mask ( struct ast_private ast,
uint32_t  base,
uint8_t  index,
uint8_t  mask,
uint8_t  val 
)

◆ ast_set_offset_reg()

void ast_set_offset_reg ( struct drm_crtc crtc)

Definition at line 353 of file ast_mode.c.

References ast, AST_IO_CRTC_PORT, ast_set_index_reg(), drm_crtc::dev, drm_device::dev_private, drm_primary::fb, offset, drm_framebuffer::pitches, and drm_crtc::primary.

Referenced by ast_crtc_do_set_base(), and ast_crtc_mode_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ast_set_start_address_crt1()

void ast_set_start_address_crt1 ( struct ast_private ast,
u32  offset 
)

Definition at line 446 of file ast_mode.c.

References addr, ast, AST_IO_CRTC_PORT, ast_set_index_reg(), and offset.

Referenced by ast_crtc_do_set_base().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ast_software_i2c_read()

int ast_software_i2c_read ( struct ast_private ast_priv,
uint8_t  edid[128] 
)

Definition at line 90 of file ast_i2c.c.

References ASPEED_BUS, ast, ast_ops, i2c_read_bytes(), set_clock(), set_data(), software_i2c, and udelay().

Referenced by ast_select_mode().

Here is the call graph for this function:
Here is the caller graph for this function: