Skip to contentSkip to conversation

ast: Replace DRAM info code

PATCH Superseded Thomas Zimmermann 2 participants 9 messages Aug 22, 2025 – Aug 25, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

cover ast: Replace DRAM info code

The ast driver's ast_get_dram_info() helper is supposed to return information about the hardware's memory setup. It depends on the various types of configurations and the chipset model. The problem is that most of this is not needed or outright wrong.

Really needed is only the bank layout of the memory for posting Gen2 and Gen3 systems with P2A configuration.

This series removes ast_gem_dram_info(). The code for retrieving the bank layout goes into the Gen2 source code and runs when required.

Tested on AST2100 and AST2600 hardware.

Thomas Zimmermann (6):
drm/ast: Do not print DRAM info
drm/ast: Remove unused dram_bus_width field drm/ast: Remove unused mclk field
drm/ast: Remove unused SCU-MPLL and SCU-STRAP values drm/ast: Move DRAM info next to its only user drm/ast: Put AST_DRAM_ constants into enum ast_dram_layout

 drivers/gpu/drm/ast/ast_2100.c |  45 +++++++++++-
 drivers/gpu/drm/ast/ast_drv.h  |  20 +++---
 drivers/gpu/drm/ast/ast_main.c | 126 ---------------------------------
 3 files changed, 51 insertions(+), 140 deletions(-)
Signature · 1 line
2.50.1
author maintainer
#1 lore raw

PATCH 1/6 drm/ast: Do not print DRAM info

Most of the information in the DRAM status output is irrelevant; some is even wrong. Only the DRAM type is used on some older models. Drop the output entirely.

---
 drivers/gpu/drm/ast/ast_main.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/ast/ast_main.c +0 -2
index 44b9b5f659fc..830f1c5fe893 100644
@@ -355,8 +355,6 @@ struct drm_device *ast_device_create(struct pci_dev *pdev,
 	ret = ast_get_dram_info(ast);
 	if (ret)
 		return ERR_PTR(ret);
-	drm_info(dev, "dram MCLK=%u Mhz type=%d bus_width=%d\n",
-		 ast->mclk, ast->dram_type, ast->dram_bus_width);
 
 	ast_detect_tx_chip(ast, need_post);
 	switch (ast->tx_chip) {
Signature · 1 line
2.50.1
author maintainer
#2 lore raw

PATCH 2/6 drm/ast: Remove unused dram_bus_width field

In reply to Thomas Zimmermann

The DRAM bus width is not necessary for the driver. Remove it.

---
 drivers/gpu/drm/ast/ast_drv.h  | 1 -
 drivers/gpu/drm/ast/ast_main.c | 6 ------
 2 files changed, 7 deletions(-)
drivers/gpu/drm/ast/ast_drv.h +0 -1
index e37a55295ed7..403b86f00a54 100644
@@ -172,7 +172,6 @@ struct ast_device {
 	enum ast_config_mode config_mode;
 	enum ast_chip chip;
 
-	uint32_t dram_bus_width;
 	uint32_t dram_type;
 	uint32_t mclk;
 
drivers/gpu/drm/ast/ast_main.c +0 -6
index 830f1c5fe893..0b3fb6856db7 100644
@@ -242,7 +242,6 @@ static int ast_get_dram_info(struct ast_device *ast)
 		break;
 	case ast_use_defaults:
 	default:
-		ast->dram_bus_width = 16;
 		ast->dram_type = AST_DRAM_1Gx16;
 		if (IS_AST_GEN6(ast))
 			ast->mclk = 800;
@@ -251,11 +250,6 @@ static int ast_get_dram_info(struct ast_device *ast)
 		return 0;
 	}
 
-	if (mcr_cfg & 0x40)
-		ast->dram_bus_width = 16;
-	else
-		ast->dram_bus_width = 32;
-
 	if (IS_AST_GEN6(ast)) {
 		switch (mcr_cfg & 0x03) {
 		case 0:
Signature · 1 line
2.50.1
author maintainer
#3 lore raw

PATCH 3/6 drm/ast: Remove unused mclk field

In reply to Thomas Zimmermann

The memory clock is not necessary for the driver. In default for AST2600 is event incorrect; should be 800 MHz. Remove it.

---
 drivers/gpu/drm/ast/ast_drv.h  |  1 -
 drivers/gpu/drm/ast/ast_main.c | 26 --------------------------
 2 files changed, 27 deletions(-)
drivers/gpu/drm/ast/ast_drv.h +0 -1
index 403b86f00a54..c9c933b5a70d 100644
@@ -173,7 +173,6 @@ struct ast_device {
 	enum ast_chip chip;
 
 	uint32_t dram_type;
-	uint32_t mclk;
 
 	void __iomem	*vram;
 	unsigned long	vram_base;
drivers/gpu/drm/ast/ast_main.c +0 -26
index 0b3fb6856db7..492cc8461eb0 100644
@@ -215,7 +215,6 @@ static int ast_get_dram_info(struct ast_device *ast)
 	struct drm_device *dev = &ast->base;
 	struct device_node *np = dev->dev->of_node;
 	uint32_t mcr_cfg, mcr_scu_mpll, mcr_scu_strap;
-	uint32_t denum, num, div, ref_pll, dsel;
 
 	switch (ast->config_mode) {
 	case ast_use_dt:
@@ -243,10 +242,6 @@ static int ast_get_dram_info(struct ast_device *ast)
 	case ast_use_defaults:
 	default:
 		ast->dram_type = AST_DRAM_1Gx16;
-		if (IS_AST_GEN6(ast))
-			ast->mclk = 800;
-		else
-			ast->mclk = 396;
 		return 0;
 	}
 
@@ -300,27 +295,6 @@ static int ast_get_dram_info(struct ast_device *ast)
 		}
 	}
 
-	if (mcr_scu_strap & 0x2000)
-		ref_pll = 14318;
-	else
-		ref_pll = 12000;
-
-	denum = mcr_scu_mpll & 0x1f;
-	num = (mcr_scu_mpll & 0x3fe0) >> 5;
-	dsel = (mcr_scu_mpll & 0xc000) >> 14;
-	switch (dsel) {
-	case 3:
-		div = 0x4;
-		break;
-	case 2:
-	case 1:
-		div = 0x2;
-		break;
-	default:
-		div = 0x1;
-		break;
-	}
-	ast->mclk = ref_pll * (num + 2) / ((denum + 2) * (div * 1000));
 	return 0;
 }
 
Signature · 1 line
2.50.1
author maintainer
#4 lore raw

PATCH 4/6 drm/ast: Remove unused SCU-MPLL and SCU-STRAP values

In reply to Thomas Zimmermann

The ast driver used SCU-MPLL and SCU-STRAP to compute the memory clock. Remove the now unused values.

---
 drivers/gpu/drm/ast/ast_main.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
drivers/gpu/drm/ast/ast_main.c +2 -11
index 492cc8461eb0..41ff880cfdec 100644
@@ -214,7 +214,7 @@ static int ast_get_dram_info(struct ast_device *ast)
 {
 	struct drm_device *dev = &ast->base;
 	struct device_node *np = dev->dev->of_node;
-	uint32_t mcr_cfg, mcr_scu_mpll, mcr_scu_strap;
+	uint32_t mcr_cfg;
 
 	switch (ast->config_mode) {
 	case ast_use_dt:
@@ -222,22 +222,13 @@ static int ast_get_dram_info(struct ast_device *ast)
 		 * If some properties are missing, use reasonable
 		 * defaults for GEN5
 		 */
-		if (of_property_read_u32(np, "aspeed,mcr-configuration",
-					 &mcr_cfg))
+		if (of_property_read_u32(np, "aspeed,mcr-configuration", &mcr_cfg))
 			mcr_cfg = 0x00000577;
-		if (of_property_read_u32(np, "aspeed,mcr-scu-mpll",
-					 &mcr_scu_mpll))
-			mcr_scu_mpll = 0x000050C0;
-		if (of_property_read_u32(np, "aspeed,mcr-scu-strap",
-					 &mcr_scu_strap))
-			mcr_scu_strap = 0;
 		break;
 	case ast_use_p2a:
 		ast_write32(ast, 0xf004, 0x1e6e0000);
 		ast_write32(ast, 0xf000, 0x1);
 		mcr_cfg = ast_read32(ast, 0x10004);
-		mcr_scu_mpll = ast_read32(ast, 0x10120);
-		mcr_scu_strap = ast_read32(ast, 0x10170);
 		break;
 	case ast_use_defaults:
 	default:
Signature · 1 line
2.50.1
author maintainer
#5 lore raw

PATCH 5/6 drm/ast: Move DRAM info next to its only user

In reply to Thomas Zimmermann

The only place in the ast driver that uses the DRAM type is the P2A DRAM initialization for Gen2 and Gen3 of the chip. Condense the code in ast_get_dram_info() to exactly this use case and move it into the Gen's custom source file. Remove the field dram_type from struct ast_device.

The AST_DRAM_ constants are also used in Gen4 POST helpers, but independently from the dram_type field. No changes there.

---
 drivers/gpu/drm/ast/ast_2100.c | 47 +++++++++++++++++--
 drivers/gpu/drm/ast/ast_drv.h  |  2 -
 drivers/gpu/drm/ast/ast_main.c | 83 ----------------------------------
 3 files changed, 44 insertions(+), 88 deletions(-)
drivers/gpu/drm/ast/ast_2100.c +44 -3
index 477ee15eff5d..44c33dd050eb 100644
@@ -31,6 +31,38 @@
 #include "ast_drv.h"
 #include "ast_post.h"
 
+/*
+ * DRAM type
+ */
+
+static int ast_2100_get_dram_type_p2a(struct ast_device *ast)
+{
+	u32 mcr_cfg;
+	int dram_type;
+
+	ast_write32(ast, 0xf004, 0x1e6e0000);
+	ast_write32(ast, 0xf000, 0x1);
+	mcr_cfg = ast_read32(ast, 0x10004);
+
+	switch (mcr_cfg & 0x0c) {
+	case 0:
+	case 4:
+		dram_type = AST_DRAM_512Mx16;
+		break;
+	case 8:
+		if (mcr_cfg & 0x40)
+			dram_type = AST_DRAM_1Gx16;
+		else
+			dram_type = AST_DRAM_512Mx32;
+		break;
+	case 0xc:
+		dram_type = AST_DRAM_1Gx32;
+		break;
+	}
+
+	return dram_type;
+}
+
 /*
  * POST
  */
@@ -266,6 +298,9 @@ static void ast_post_chip_2100(struct ast_device *ast)
 	u8 j;
 	u32 data, temp, i;
 	const struct ast_dramstruct *dram_reg_info;
+	int dram_type;
+
+	dram_type = ast_2100_get_dram_type_p2a(ast);
 
 	j = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xd0, 0xff);
 
@@ -292,11 +327,17 @@ static void ast_post_chip_2100(struct ast_device *ast)
 				for (i = 0; i < 15; i++)
 					udelay(dram_reg_info->data);
 			} else if (AST_DRAMSTRUCT_IS(dram_reg_info, DRAM_TYPE)) {
-				data = dram_reg_info->data;
-				if (ast->dram_type == AST_DRAM_1Gx16)
+				switch (dram_type) {
+				case AST_DRAM_1Gx16:
 					data = 0x00000d89;
-				else if (ast->dram_type == AST_DRAM_1Gx32)
+					break;
+				case AST_DRAM_1Gx32:
 					data = 0x00000c8d;
+					break;
+				default:
+					data = dram_reg_info->data;
+					break;
+				};
 
 				temp = ast_read32(ast, 0x12070);
 				temp &= 0xc;
drivers/gpu/drm/ast/ast_drv.h +0 -2
index c9c933b5a70d..4c29ae9fb511 100644
@@ -172,8 +172,6 @@ struct ast_device {
 	enum ast_config_mode config_mode;
 	enum ast_chip chip;
 
-	uint32_t dram_type;
-
 	void __iomem	*vram;
 	unsigned long	vram_base;
 	unsigned long	vram_size;
drivers/gpu/drm/ast/ast_main.c +0 -83

95 lines not on this page · raw message

Signature · 1 line
2.50.1
author maintainer
#6 lore raw

PATCH 6/6 drm/ast: Put AST_DRAM_ constants into enum ast_dram_layout

In reply to Thomas Zimmermann

The AST_DRAM_ constants belong together, so put them in an enum type. Rename type and variables to 'drm_layout', as there's already another DRAM type in the ast driver (AST_DDR2, AST_DDR3).

---
 drivers/gpu/drm/ast/ast_2100.c | 20 +++++++++-----------
 drivers/gpu/drm/ast/ast_drv.h  | 16 +++++++++-------
 2 files changed, 18 insertions(+), 18 deletions(-)
drivers/gpu/drm/ast/ast_2100.c +9 -11
index 44c33dd050eb..736866763349 100644
@@ -35,10 +35,10 @@
  * DRAM type
  */
 
-static int ast_2100_get_dram_type_p2a(struct ast_device *ast)
+static enum ast_dram_layout ast_2100_get_dram_layout_p2a(struct ast_device *ast)
 {
 	u32 mcr_cfg;
-	int dram_type;
+	enum ast_dram_layout dram_layout;
 
 	ast_write32(ast, 0xf004, 0x1e6e0000);
 	ast_write32(ast, 0xf000, 0x1);
@@ -47,20 +47,20 @@ static int ast_2100_get_dram_type_p2a(struct ast_device *ast)
 	switch (mcr_cfg & 0x0c) {
 	case 0:
 	case 4:
-		dram_type = AST_DRAM_512Mx16;
+		dram_layout = AST_DRAM_512Mx16;
 		break;
 	case 8:
 		if (mcr_cfg & 0x40)
-			dram_type = AST_DRAM_1Gx16;
+			dram_layout = AST_DRAM_1Gx16;
 		else
-			dram_type = AST_DRAM_512Mx32;
+			dram_layout = AST_DRAM_512Mx32;
 		break;
 	case 0xc:
-		dram_type = AST_DRAM_1Gx32;
+		dram_layout = AST_DRAM_1Gx32;
 		break;
 	}
 
-	return dram_type;
+	return dram_layout;
 }
 
 /*
@@ -298,9 +298,7 @@ static void ast_post_chip_2100(struct ast_device *ast)
 	u8 j;
 	u32 data, temp, i;
 	const struct ast_dramstruct *dram_reg_info;
-	int dram_type;
-
-	dram_type = ast_2100_get_dram_type_p2a(ast);
+	enum ast_dram_layout dram_layout  = ast_2100_get_dram_layout_p2a(ast);
 
 	j = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xd0, 0xff);
 
@@ -327,7 +325,7 @@ static void ast_post_chip_2100(struct ast_device *ast)
 				for (i = 0; i < 15; i++)
 					udelay(dram_reg_info->data);
 			} else if (AST_DRAMSTRUCT_IS(dram_reg_info, DRAM_TYPE)) {
-				switch (dram_type) {
+				switch (dram_layout) {
 				case AST_DRAM_1Gx16:
 					data = 0x00000d89;
 					break;
drivers/gpu/drm/ast/ast_drv.h +9 -7
index 4c29ae9fb511..c15aef014f69 100644
@@ -98,13 +98,15 @@ enum ast_config_mode {
 	ast_use_defaults
 };
 
-#define AST_DRAM_512Mx16 0
-#define AST_DRAM_1Gx16   1
-#define AST_DRAM_512Mx32 2
-#define AST_DRAM_1Gx32   3
-#define AST_DRAM_2Gx16   6
-#define AST_DRAM_4Gx16   7
-#define AST_DRAM_8Gx16   8
+enum ast_dram_layout {
+	AST_DRAM_512Mx16 = 0,
+	AST_DRAM_1Gx16 = 1,
+	AST_DRAM_512Mx32 = 2,
+	AST_DRAM_1Gx32 = 3,
+	AST_DRAM_2Gx16 = 6,
+	AST_DRAM_4Gx16 = 7,
+	AST_DRAM_8Gx16 = 8,
+};
 
 /*
  * Hardware cursor
Signature · 1 line
2.50.1
build bot
#7 lore raw

Re: [PATCH 6/6] drm/ast: Put AST_DRAM_ constants into enum ast_dram_layout

BCC: [email protected] CC: [email protected] In-Reply-To: <[email protected]> References: <[email protected]> TO: Thomas Zimmermann…

BCC: [email protected]
CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Thomas Zimmermann <[email protected]>
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
CC: [email protected]
CC: Thomas Zimmermann <[email protected]>

Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-exynos/exynos-drm-next] [also build test WARNING on linus/master v6.17-rc2 next-20250822] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Zimmermann/drm-ast-Do-not-print-DRAM-info/20250822-213333
base:   https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git exynos-drm-next
patch link:    https://lore.kernel.org/r/20250822132846.25376-7-tzimmermann%40suse.de
patch subject: [PATCH 6/6] drm/ast: Put AST_DRAM_ constants into enum ast_dram_layout

:::::: branch date: 34 hours ago
:::::: commit date: 34 hours ago
config: i386-randconfig-141-20250823 (https://download.01.org/0day-ci/archive/20250824/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags

| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

smatch warnings:
drivers/gpu/drm/ast/ast_2100.c:63 ast_2100_get_dram_layout_p2a() error: uninitialized symbol 'dram_layout'.

vim +/dram_layout +63 drivers/gpu/drm/ast/ast_2100.c

1be08550e6e72e Thomas Zimmermann 2025-07-06  33  
b59465efc7cb88 Thomas Zimmermann 2025-08-22  34  /*
b59465efc7cb88 Thomas Zimmermann 2025-08-22  35   * DRAM type
b59465efc7cb88 Thomas Zimmermann 2025-08-22  36   */
b59465efc7cb88 Thomas Zimmermann 2025-08-22  37  
334d62edac4c5b Thomas Zimmermann 2025-08-22  38  static enum ast_dram_layout ast_2100_get_dram_layout_p2a(struct ast_device *ast)
b59465efc7cb88 Thomas Zimmermann 2025-08-22  39  {
b59465efc7cb88 Thomas Zimmermann 2025-08-22  40  	u32 mcr_cfg;
334d62edac4c5b Thomas Zimmermann 2025-08-22  41  	enum ast_dram_layout dram_layout;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  42  
b59465efc7cb88 Thomas Zimmermann 2025-08-22  43  	ast_write32(ast, 0xf004, 0x1e6e0000);
b59465efc7cb88 Thomas Zimmermann 2025-08-22  44  	ast_write32(ast, 0xf000, 0x1);
b59465efc7cb88 Thomas Zimmermann 2025-08-22  45  	mcr_cfg = ast_read32(ast, 0x10004);
b59465efc7cb88 Thomas Zimmermann 2025-08-22  46  
b59465efc7cb88 Thomas Zimmermann 2025-08-22  47  	switch (mcr_cfg & 0x0c) {
b59465efc7cb88 Thomas Zimmermann 2025-08-22  48  	case 0:
b59465efc7cb88 Thomas Zimmermann 2025-08-22  49  	case 4:
334d62edac4c5b Thomas Zimmermann 2025-08-22  50  		dram_layout = AST_DRAM_512Mx16;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  51  		break;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  52  	case 8:
b59465efc7cb88 Thomas Zimmermann 2025-08-22  53  		if (mcr_cfg & 0x40)
334d62edac4c5b Thomas Zimmermann 2025-08-22  54  			dram_layout = AST_DRAM_1Gx16;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  55  		else
334d62edac4c5b Thomas Zimmermann 2025-08-22  56  			dram_layout = AST_DRAM_512Mx32;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  57  		break;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  58  	case 0xc:
334d62edac4c5b Thomas Zimmermann 2025-08-22  59  		dram_layout = AST_DRAM_1Gx32;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  60  		break;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  61  	}
b59465efc7cb88 Thomas Zimmermann 2025-08-22  62  

334d62edac4c5b Thomas Zimmermann 2025-08-22 @63 return dram_layout;
b59465efc7cb88 Thomas Zimmermann 2025-08-22 64 } b59465efc7cb88 Thomas Zimmermann 2025-08-22 65

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
author maintainer
#8 lore raw

Re: [PATCH 6/6] drm/ast: Put AST_DRAM_ constants into enum ast_dram_layout

Hi

Am 25.08.25 um 09:26 schrieb Dan Carpenter:

Quoted 48 lines

Hi Thomas,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Zimmermann/drm-ast-Do-not-print-DRAM-info/20250822-213333
base:   https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git exynos-drm-next
patch link:    https://lore.kernel.org/r/20250822132846.25376-7-tzimmermann%40suse.de
patch subject: [PATCH 6/6] drm/ast: Put AST_DRAM_ constants into enum ast_dram_layout
config: i386-randconfig-141-20250823 (https://download.01.org/0day-ci/archive/20250824/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags

| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

smatch warnings:
drivers/gpu/drm/ast/ast_2100.c:63 ast_2100_get_dram_layout_p2a() error: uninitialized symbol 'dram_layout'.

vim +/dram_layout +63 drivers/gpu/drm/ast/ast_2100.c

334d62edac4c5b Thomas Zimmermann 2025-08-22  38  static enum ast_dram_layout ast_2100_get_dram_layout_p2a(struct ast_device *ast)
b59465efc7cb88 Thomas Zimmermann 2025-08-22  39  {
b59465efc7cb88 Thomas Zimmermann 2025-08-22  40  	u32 mcr_cfg;
334d62edac4c5b Thomas Zimmermann 2025-08-22  41  	enum ast_dram_layout dram_layout;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  42
b59465efc7cb88 Thomas Zimmermann 2025-08-22  43  	ast_write32(ast, 0xf004, 0x1e6e0000);
b59465efc7cb88 Thomas Zimmermann 2025-08-22  44  	ast_write32(ast, 0xf000, 0x1);
b59465efc7cb88 Thomas Zimmermann 2025-08-22  45  	mcr_cfg = ast_read32(ast, 0x10004);
b59465efc7cb88 Thomas Zimmermann 2025-08-22  46
b59465efc7cb88 Thomas Zimmermann 2025-08-22  47  	switch (mcr_cfg & 0x0c) {
b59465efc7cb88 Thomas Zimmermann 2025-08-22  48  	case 0:
b59465efc7cb88 Thomas Zimmermann 2025-08-22  49  	case 4:
334d62edac4c5b Thomas Zimmermann 2025-08-22  50  		dram_layout = AST_DRAM_512Mx16;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  51  		break;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  52  	case 8:
b59465efc7cb88 Thomas Zimmermann 2025-08-22  53  		if (mcr_cfg & 0x40)
334d62edac4c5b Thomas Zimmermann 2025-08-22  54  			dram_layout = AST_DRAM_1Gx16;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  55  		else
334d62edac4c5b Thomas Zimmermann 2025-08-22  56  			dram_layout = AST_DRAM_512Mx32;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  57  		break;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  58  	case 0xc:
334d62edac4c5b Thomas Zimmermann 2025-08-22  59  		dram_layout = AST_DRAM_1Gx32;
b59465efc7cb88 Thomas Zimmermann 2025-08-22  60  		break;
Quoted 1 line

Should there be a default case?

Thanks for reporting. That only happens now with the values being an enum type. The first case (512Mx16) would be the default. Will be fixed in the next iteration.

Best regards
Thomas

Quoted 6 lines

b59465efc7cb88 Thomas Zimmermann 2025-08-22 61 }
b59465efc7cb88 Thomas Zimmermann 2025-08-22 62
334d62edac4c5b Thomas Zimmermann 2025-08-22 @63 return dram_layout;
b59465efc7cb88 Thomas Zimmermann 2025-08-22 64 }

Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)