aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/ast/ast_drv.h1
-rw-r--r--drivers/gpu/drm/ast/ast_main.c23
-rw-r--r--drivers/gpu/drm/ast/ast_mode.c4
-rw-r--r--drivers/gpu/drm/ast/ast_post.c6
4 files changed, 20 insertions, 14 deletions
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index fab4b173dc49..561742793947 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -61,6 +61,7 @@ enum ast_chip {
61 AST2200, 61 AST2200,
62 AST2150, 62 AST2150,
63 AST2300, 63 AST2300,
64 AST2400,
64 AST1180, 65 AST1180,
65}; 66};
66 67
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
index cd0a791e76c5..01ea4b6d4bf3 100644
--- a/drivers/gpu/drm/ast/ast_main.c
+++ b/drivers/gpu/drm/ast/ast_main.c
@@ -72,7 +72,10 @@ static int ast_detect_chip(struct drm_device *dev)
72 ast->chip = AST1100; 72 ast->chip = AST1100;
73 DRM_INFO("AST 1180 detected\n"); 73 DRM_INFO("AST 1180 detected\n");
74 } else { 74 } else {
75 if (dev->pdev->revision >= 0x20) { 75 if (dev->pdev->revision >= 0x30) {
76 ast->chip = AST2400;
77 DRM_INFO("AST 2400 detected\n");
78 } else if (dev->pdev->revision >= 0x20) {
76 ast->chip = AST2300; 79 ast->chip = AST2300;
77 DRM_INFO("AST 2300 detected\n"); 80 DRM_INFO("AST 2300 detected\n");
78 } else if (dev->pdev->revision >= 0x10) { 81 } else if (dev->pdev->revision >= 0x10) {
@@ -121,13 +124,14 @@ static int ast_detect_chip(struct drm_device *dev)
121 ast->support_wide_screen = true; 124 ast->support_wide_screen = true;
122 else { 125 else {
123 ast->support_wide_screen = false; 126 ast->support_wide_screen = false;
124 if (ast->chip == AST2300) { 127 ast_write32(ast, 0xf004, 0x1e6e0000);
125 ast_write32(ast, 0xf004, 0x1e6e0000); 128 ast_write32(ast, 0xf000, 0x1);
126 ast_write32(ast, 0xf000, 0x1); 129 data = ast_read32(ast, 0x1207c);
127 data = ast_read32(ast, 0x1207c); 130 data &= 0x300;
128 if ((data & 0x300) == 0) /* ast1300 */ 131 if (ast->chip == AST2300 && data == 0x0) /* ast1300 */
129 ast->support_wide_screen = true; 132 ast->support_wide_screen = true;
130 } 133 if (ast->chip == AST2400 && data == 0x100) /* ast1400 */
134 ast->support_wide_screen = true;
131 } 135 }
132 break; 136 break;
133 } 137 }
@@ -157,7 +161,7 @@ static int ast_get_dram_info(struct drm_device *dev)
157 else 161 else
158 ast->dram_bus_width = 32; 162 ast->dram_bus_width = 32;
159 163
160 if (ast->chip == AST2300) { 164 if (ast->chip == AST2300 || ast->chip == AST2400) {
161 switch (data & 0x03) { 165 switch (data & 0x03) {
162 case 0: 166 case 0:
163 ast->dram_type = AST_DRAM_512Mx16; 167 ast->dram_type = AST_DRAM_512Mx16;
@@ -344,6 +348,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
344 if (ast->chip == AST2100 || 348 if (ast->chip == AST2100 ||
345 ast->chip == AST2200 || 349 ast->chip == AST2200 ||
346 ast->chip == AST2300 || 350 ast->chip == AST2300 ||
351 ast->chip == AST2400 ||
347 ast->chip == AST1180) { 352 ast->chip == AST1180) {
348 dev->mode_config.max_width = 1920; 353 dev->mode_config.max_width = 1920;
349 dev->mode_config.max_height = 2048; 354 dev->mode_config.max_height = 2048;
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 72bec23b66f4..e9a14a14a029 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -398,7 +398,7 @@ static void ast_set_ext_reg(struct drm_crtc *crtc, struct drm_display_mode *mode
398 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa8, 0xfd, jregA8); 398 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa8, 0xfd, jregA8);
399 399
400 /* Set Threshold */ 400 /* Set Threshold */
401 if (ast->chip == AST2300) { 401 if (ast->chip == AST2300 || ast->chip == AST2400) {
402 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa7, 0x78); 402 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa7, 0x78);
403 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa6, 0x60); 403 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa6, 0x60);
404 } else if (ast->chip == AST2100 || 404 } else if (ast->chip == AST2100 ||
@@ -771,7 +771,7 @@ static int ast_mode_valid(struct drm_connector *connector,
771 if ((mode->hdisplay == 1600) && (mode->vdisplay == 900)) 771 if ((mode->hdisplay == 1600) && (mode->vdisplay == 900))
772 return MODE_OK; 772 return MODE_OK;
773 773
774 if ((ast->chip == AST2100) || (ast->chip == AST2200) || (ast->chip == AST2300) || (ast->chip == AST1180)) { 774 if ((ast->chip == AST2100) || (ast->chip == AST2200) || (ast->chip == AST2300) || (ast->chip == AST2400) || (ast->chip == AST1180)) {
775 if ((mode->hdisplay == 1920) && (mode->vdisplay == 1080)) 775 if ((mode->hdisplay == 1920) && (mode->vdisplay == 1080))
776 return MODE_OK; 776 return MODE_OK;
777 777
diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c
index 977cfb35837a..4718e76847b0 100644
--- a/drivers/gpu/drm/ast/ast_post.c
+++ b/drivers/gpu/drm/ast/ast_post.c
@@ -78,7 +78,7 @@ ast_set_def_ext_reg(struct drm_device *dev)
78 for (i = 0x81; i <= 0x8f; i++) 78 for (i = 0x81; i <= 0x8f; i++)
79 ast_set_index_reg(ast, AST_IO_CRTC_PORT, i, 0x00); 79 ast_set_index_reg(ast, AST_IO_CRTC_PORT, i, 0x00);
80 80
81 if (ast->chip == AST2300) { 81 if (ast->chip == AST2300 || ast->chip == AST2400) {
82 if (dev->pdev->revision >= 0x20) 82 if (dev->pdev->revision >= 0x20)
83 ext_reg_info = extreginfo_ast2300; 83 ext_reg_info = extreginfo_ast2300;
84 else 84 else
@@ -102,7 +102,7 @@ ast_set_def_ext_reg(struct drm_device *dev)
102 102
103 /* Enable RAMDAC for A1 */ 103 /* Enable RAMDAC for A1 */
104 reg = 0x04; 104 reg = 0x04;
105 if (ast->chip == AST2300) 105 if (ast->chip == AST2300 || ast->chip == AST2400)
106 reg |= 0x20; 106 reg |= 0x20;
107 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb6, 0xff, reg); 107 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb6, 0xff, reg);
108} 108}
@@ -365,7 +365,7 @@ void ast_post_gpu(struct drm_device *dev)
365 ast_open_key(ast); 365 ast_open_key(ast);
366 ast_set_def_ext_reg(dev); 366 ast_set_def_ext_reg(dev);
367 367
368 if (ast->chip == AST2300) 368 if (ast->chip == AST2300 || ast->chip == AST2400)
369 ast_init_dram_2300(dev); 369 ast_init_dram_2300(dev);
370 else 370 else
371 ast_init_dram_reg(dev); 371 ast_init_dram_reg(dev);