drivers/aspeed: Add AST2500 support

Tested on AST2500.
Code for AST2400 still works.

Copy code from GNU/Linux kernel to coreboot to add AST2500 support.

Change-Id: I25bd34dd52a0acd3e04fc5818e011215ef907fad
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34793
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
This commit is contained in:
Patrick Rudolph
2019-08-05 10:43:09 +02:00
committed by Philipp Deppenwiese
parent f1a4ae0a48
commit 9fe3d692c7
5 changed files with 553 additions and 84 deletions

View File

@@ -75,8 +75,10 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)
} else {
pci_read_config_dword(ast->dev->pdev, 0x08, &data);
uint8_t revision = data & 0xff;
if (revision >= 0x30) {
if (revision >= 0x40) {
ast->chip = AST2500;
DRM_INFO("AST 2500 detected\n");
} else if (revision >= 0x30) {
ast->chip = AST2400;
DRM_INFO("AST 2400 detected\n");
} else if (revision >= 0x20) {
@@ -151,6 +153,8 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)
ast->support_wide_screen = true;
if (ast->chip == AST2400 && data == 0x100) /* ast1400 */
ast->support_wide_screen = true;
if (ast->chip == AST2500 && data == 0x100) /* ast2510 */
ast->support_wide_screen = true;
}
break;
}
@@ -241,7 +245,23 @@ static int ast_get_dram_info(struct drm_device *dev)
else
ast->dram_bus_width = 32;
if (ast->chip == AST2300 || ast->chip == AST2400) {
if (ast->chip == AST2500) {
switch (data & 0x03) {
case 0:
ast->dram_type = AST_DRAM_1Gx16;
break;
default:
case 1:
ast->dram_type = AST_DRAM_2Gx16;
break;
case 2:
ast->dram_type = AST_DRAM_4Gx16;
break;
case 3:
ast->dram_type = AST_DRAM_8Gx16;
break;
}
} else if (ast->chip == AST2300 || ast->chip == AST2400) {
switch (data & 0x03) {
case 0:
ast->dram_type = AST_DRAM_512Mx16;