Commit e8b120e2 authored by Y.C. Chen's avatar Y.C. Chen Committed by Sasha Levin

drm/ast: Fix AST2400 POST failure without BMC FW or VBIOS

[ Upstream commit 3856081e ]

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: default avatarY.C. Chen <yc_chen@aspeedtech.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: default avatarY.C. Chen <yc_chen@aspeedtech.com>
Acked-by: default avatarJoel Stanley <joel@jms.id.au>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent c9cf9833
...@@ -1630,12 +1630,44 @@ static void ast_init_dram_2300(struct drm_device *dev) ...@@ -1630,12 +1630,44 @@ static void ast_init_dram_2300(struct drm_device *dev)
temp |= 0x73; temp |= 0x73;
ast_write32(ast, 0x12008, temp); ast_write32(ast, 0x12008, temp);
param.dram_freq = 396;
param.dram_type = AST_DDR3; param.dram_type = AST_DDR3;
temp = ast_mindwm(ast, 0x1e6e2070);
if (temp & 0x01000000) if (temp & 0x01000000)
param.dram_type = AST_DDR2; param.dram_type = AST_DDR2;
param.dram_chipid = ast->dram_type; switch (temp & 0x18000000) {
param.dram_freq = ast->mclk; case 0:
param.vram_size = ast->vram_size; 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) { if (param.dram_type == AST_DDR3) {
get_ddr3_info(ast, &param); get_ddr3_info(ast, &param);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment