Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84425?usp=email )
Change subject: drivers/aspeed/common: Add AST2600 support ......................................................................
drivers/aspeed/common: Add AST2600 support
Add support for AST2600 as found on Intel ArcherCity CRB.
TEST: Booted on Intel/ArcherCity CRB and used the UEFI firmware menu over KVM using native graphics init.
Change-Id: I3d2d58d493706673c1b2ba4953967b1641bd6395 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/drivers/aspeed/common/ast_drv.h M src/drivers/aspeed/common/ast_main.c M src/drivers/aspeed/common/ast_mode.c 3 files changed, 23 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/84425/1
diff --git a/src/drivers/aspeed/common/ast_drv.h b/src/drivers/aspeed/common/ast_drv.h index 423ba37..90fd165 100644 --- a/src/drivers/aspeed/common/ast_drv.h +++ b/src/drivers/aspeed/common/ast_drv.h @@ -20,6 +20,7 @@ AST2300, AST2400, AST2500, + AST2600, AST1180, };
diff --git a/src/drivers/aspeed/common/ast_main.c b/src/drivers/aspeed/common/ast_main.c index b28f6a6..101cfb4 100644 --- a/src/drivers/aspeed/common/ast_main.c +++ b/src/drivers/aspeed/common/ast_main.c @@ -111,7 +111,10 @@ uint32_t data; pci_read_config_dword(ast->dev->pdev, 0x08, &data); uint8_t revision = data & 0xff; - if (revision >= 0x40) { + if (revision >= 0x50) { + ast->chip = AST2600; + DRM_INFO("AST 2600 detected\n"); + } else if (revision >= 0x40) { ast->chip = AST2500; DRM_INFO("AST 2500 detected\n"); } else if (revision >= 0x30) { @@ -171,6 +174,8 @@ if (ast->chip == AST2500 && scu_rev == 0x100) /* ast2510 */ ast->support_wide_screen = true; + if (ast->chip == AST2600) + ast->support_wide_screen = true; } break; } @@ -192,7 +197,7 @@ ast->tx_chip_type = AST_TX_SIL164; }
- if ((ast->chip == AST2300) || (ast->chip == AST2400)) { + if ((ast->chip == AST2300) || (ast->chip == AST2400) || (ast->chip == AST2500)) { /* * On AST2300 and 2400, look the configuration set by the SoC in * the SOC scratch register #1 bits 11:8 (interestingly marked diff --git a/src/drivers/aspeed/common/ast_mode.c b/src/drivers/aspeed/common/ast_mode.c index 3ab91c2..9650457 100644 --- a/src/drivers/aspeed/common/ast_mode.c +++ b/src/drivers/aspeed/common/ast_mode.c @@ -247,7 +247,7 @@ u8 jreg05 = 0, jreg07 = 0, jreg09 = 0, jregAC = 0, jregAD = 0, jregAE = 0; u16 temp, precache = 0;
- if ((ast->chip == AST2500) && + if ((ast->chip == AST2500 || ast->chip == AST2600) && (vbios_mode->enh_table->flags & AST2500PreCatchCRT)) precache = 40;
@@ -288,6 +288,12 @@ ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAC, 0x00, jregAC); ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xAD, 0x00, jregAD);
+ // Workaround for HSync Time non octave pixels (1920x1080@60Hz HSync 44 pixels); + if ((ast->chip == AST2600) && (mode->crtc_vdisplay == 1080)) + ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 0x02); + else + ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xFC, 0xFD, 0x00); + /* vert timings */ temp = (mode->crtc_vtotal) - 2; if (temp & 0x100) @@ -367,7 +373,7 @@ struct ast_private *ast = dev->dev_private; const struct ast_vbios_dclk_info *clk_info;
- if (ast->chip == AST2500) + if ((ast->chip == AST2500) || (ast->chip == AST2600)) clk_info = &dclk_table_ast2500[vbios_mode->enh_table->dclk_index]; else clk_info = &dclk_table[vbios_mode->enh_table->dclk_index]; @@ -411,8 +417,11 @@ ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa8, 0xfd, jregA8);
/* Set Threshold */ - if (ast->chip == AST2300 || ast->chip == AST2400 || - ast->chip == AST2500) { + if (ast->chip == AST2600) { + ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa7, 0xe0); + ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa6, 0xa0); + } else if (ast->chip == AST2300 || ast->chip == AST2400 || + ast->chip == AST2500) { ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa7, 0x78); ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa6, 0x60); } else if (ast->chip == AST2100 || @@ -529,7 +538,8 @@
if ((ast->chip == AST2100) || (ast->chip == AST2200) || (ast->chip == AST2300) || (ast->chip == AST2400) || - (ast->chip == AST2500) || (ast->chip == AST1180)) { + (ast->chip == AST2500) || (ast->chip == AST1180) || + (ast->chip == AST2600)) { if ((hdisplay == 1920) && (vdisplay == 1080)) return MODE_OK;