linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/12] drm/ast: Fix AST2400 POST failure without BMC FW or VBIOS
@ 2017-02-23 22:53 Benjamin Herrenschmidt
  2017-02-23 22:53 ` [PATCH 02/12] drm/ast: Handle configuration without P2A bridge Benjamin Herrenschmidt
                   ` (13 more replies)
  0 siblings, 14 replies; 39+ messages in thread
From: Benjamin Herrenschmidt @ 2017-02-23 22:53 UTC (permalink / raw)
  To: dri-devel; +Cc: Y . C . Chen, airlied, eich, linuxppc-dev

From: "Y.C. Chen" <yc_chen@aspeedtech.com>

The current POST code for the AST2300/2400 family doesn't work properly
if the chip hasn't been initialized previously by either the BMC own FW
or the VBIOS. This fixes it.

Signed-off-by: Y.C. Chen <yc_chen@aspeedtech.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 drivers/gpu/drm/ast/ast_post.c | 38 +++++++++++++++++++++++++++++++++++---
 1 file changed, 35 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c
index 5331ee1..6c5391c 100644
--- a/drivers/gpu/drm/ast/ast_post.c
+++ b/drivers/gpu/drm/ast/ast_post.c
@@ -1638,12 +1638,44 @@ static void ast_init_dram_2300(struct drm_device *dev)
 		temp |= 0x73;
 		ast_write32(ast, 0x12008, temp);
 
+		param.dram_freq = 396;
 		param.dram_type = AST_DDR3;
+		temp = ast_mindwm(ast, 0x1e6e2070);
 		if (temp & 0x01000000)
 			param.dram_type = AST_DDR2;
-		param.dram_chipid = ast->dram_type;
-		param.dram_freq = ast->mclk;
-		param.vram_size = ast->vram_size;
+                switch (temp & 0x18000000) {
+		case 0:
+			param.dram_chipid = AST_DRAM_512Mx16;
+			break;
+		default:
+		case 0x08000000:
+			param.dram_chipid = AST_DRAM_1Gx16;
+			break;
+		case 0x10000000:
+			param.dram_chipid = AST_DRAM_2Gx16;
+			break;
+		case 0x18000000:
+			param.dram_chipid = AST_DRAM_4Gx16;
+			break;
+		}
+                switch (temp & 0x0c) {
+                default:
+		case 0x00:
+			param.vram_size = AST_VIDMEM_SIZE_8M;
+			break;
+
+		case 0x04:
+			param.vram_size = AST_VIDMEM_SIZE_16M;
+			break;
+
+		case 0x08:
+			param.vram_size = AST_VIDMEM_SIZE_32M;
+			break;
+
+		case 0x0c:
+			param.vram_size = AST_VIDMEM_SIZE_64M;
+			break;
+		}
 
 		if (param.dram_type == AST_DDR3) {
 			get_ddr3_info(ast, &param);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2017-02-24  7:27 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-23 22:53 [PATCH 01/12] drm/ast: Fix AST2400 POST failure without BMC FW or VBIOS Benjamin Herrenschmidt
2017-02-23 22:53 ` [PATCH 02/12] drm/ast: Handle configuration without P2A bridge Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-24  2:26     ` Benjamin Herrenschmidt
2017-02-24  2:32     ` Benjamin Herrenschmidt
2017-02-24  2:41     ` [PATCH v5 2/12] " Benjamin Herrenschmidt
2017-02-24  2:43       ` Joel Stanley
2017-02-24  7:06   ` [PATCH 02/12] " YC Chen
2017-02-23 22:53 ` [PATCH 03/12] drm/ast: const'ify mode setting tables Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-23 22:53 ` [PATCH 04/12] drm/ast: Remove spurrious include Benjamin Herrenschmidt
2017-02-24  2:24   ` Joel Stanley
2017-02-23 22:53 ` [PATCH 05/12] drm/ast: Fix calculation of MCLK Benjamin Herrenschmidt
2017-02-24  2:24   ` Joel Stanley
2017-02-24  2:38     ` Benjamin Herrenschmidt
2017-02-24  3:12       ` Joel Stanley
2017-02-24  7:06   ` YC Chen
2017-02-23 22:53 ` [PATCH 06/12] drm/ast: Base support for AST2500 Benjamin Herrenschmidt
2017-02-24  2:22   ` Joel Stanley
2017-02-23 22:53 ` [PATCH 07/12] drm/ast: Fixed vram size incorrect issue on POWER Benjamin Herrenschmidt
2017-02-24  2:24   ` Joel Stanley
2017-02-24  7:07   ` YC Chen
2017-02-23 22:53 ` [PATCH 08/12] drm/ast: Factor mmc_test code in POST code Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-24  7:07   ` YC Chen
2017-02-23 22:53 ` [PATCH 09/12] drm/ast: Rename ast_init_dram_2300 to ast_post_chip_2300 Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-24  7:08   ` YC Chen
2017-02-23 22:53 ` [PATCH 10/12] drm/ast: POST code for the new AST2500 Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-23 22:53 ` [PATCH 11/12] drm/ast: Fix test for VGA enabled Benjamin Herrenschmidt
2017-02-23 23:24   ` Benjamin Herrenschmidt
2017-02-24  7:09   ` YC Chen
2017-02-23 22:53 ` [PATCH 12/12] drm/ast: Call open_key before enable_mmio in POST code Benjamin Herrenschmidt
2017-02-24  2:21   ` Joel Stanley
2017-02-24  7:09   ` YC Chen
2017-02-23 23:07 ` [PATCH 01/12] drm/ast: Fix AST2400 POST failure without BMC FW or VBIOS Benjamin Herrenschmidt
2017-02-24  2:23 ` Joel Stanley
2017-02-24  7:04 ` YC Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).