Patchwork gfxuma memory support for I82830

login
register
about
Submitter Joseph Smith
Date 2010-03-13 21:18:02
Message ID <4B9C010A.3060409@settoplinux.org>
Download mbox | patch
Permalink /patch/1039/
State Rejected
Headers show

Comments

Joseph Smith - 2010-03-13 21:18:02
This patch adds support for gfxuma memory region for i82830 onboard 
graphics.

Signed-off-by: Joseph Smith <joe@settoplinux.org>
ron minnich - 2010-03-13 21:25:58
Maybe I'm missing something. You select GFXUMA but nothing seems to
depend on it?

is there something else out there that uses this variable?

ron
Joseph Smith - 2010-03-13 22:58:32
On Sat, 13 Mar 2010 13:25:58 -0800, ron minnich <rminnich@gmail.com> wrote:
> Maybe I'm missing something. You select GFXUMA but nothing seems to
> depend on it?
> 
> is there something else out there that uses this variable?
> 
Ah, hmm, I will have to look closer......
I just realized the add_northbridge_resources is not working eithor....
 
No one ACK this yet.

Patch

Index: src/northbridge/intel/i82830/raminit.c
===================================================================
--- src/northbridge/intel/i82830/raminit.c	(revision 5205)
+++ src/northbridge/intel/i82830/raminit.c	(working copy)
@@ -48,7 +48,7 @@ 
  * 0x0 for Refresh Disabled (Self Refresh)
  * 0x1 for Refresh interval 15.6 us for 133MHz
  * 0x2 for Refresh interval 7.8 us for 133MHz
- * 0x7 /* Refresh interval 128 Clocks. (Fast Refresh Mode)
+ * 0x7 for Refresh interval 128 Clocks. (Fast Refresh Mode)
  */
 #define RAM_COMMAND_REFRESH		0x1
 
Index: src/northbridge/intel/i82830/northbridge.c
===================================================================
--- src/northbridge/intel/i82830/northbridge.c	(revision 5205)
+++ src/northbridge/intel/i82830/northbridge.c	(working copy)
@@ -28,6 +28,7 @@ 
 #include <stdlib.h>
 #include <string.h>
 #include <bitops.h>
+#include <boot/tables.h>
 #include "chip.h"
 #include "i82830.h"
 
@@ -88,6 +89,18 @@ 
 	return tolm;
 }
 
+/* IDG memory */
+uint64_t uma_memory_base=0, uma_memory_size=0;
+
+int add_northbridge_resources(struct lb_memory *mem)
+{
+	printk_debug("Adding UMA memory area\n");
+	lb_add_memory_range(mem, LB_MEM_RESERVED,
+		uma_memory_base, uma_memory_size);
+
+	return 0;
+}
+
 #if CONFIG_WRITE_HIGH_TABLES==1
 #define HIGH_TABLES_SIZE 64	// maximum size of high tables in KB
 extern uint64_t high_tables_base, high_tables_size;
@@ -115,9 +128,14 @@ 
 		 * i.e. 1 means 32MB.
 		 */
 		tomk = ((unsigned long)pci_read_config8(mc_dev, DRB + 3)) << 15;
+		printk_debug("%dM UMA\n", igd_memory >> 10);
 		tomk -= igd_memory;
-		printk_debug("Memory detected: %ldKB RAM\n", tomk);
 
+		/* For reserving UMA memory in the memory map */
+		uma_memory_base = tomk * 1024ULL;
+		uma_memory_size = igd_memory * 1024ULL;
+		printk_debug("Available memory: %dKB\n", tomk);
+
 		/* Compute the top of low memory. */
 		tolmk = pci_tolm >> 10;
 		if (tolmk >= tomk) {
Index: src/mainboard/thomson/ip1000/Kconfig
===================================================================
--- src/mainboard/thomson/ip1000/Kconfig	(revision 5205)
+++ src/mainboard/thomson/ip1000/Kconfig	(working copy)
@@ -10,6 +10,7 @@ 
 	select UDELAY_TSC
 	select BOARD_ROMSIZE_KB_512
 	select HAVE_SMI_HANDLER
+	select GFXUMA
 
 config MAINBOARD_DIR
 	string
Index: src/mainboard/rca/rm4100/Kconfig
===================================================================
--- src/mainboard/rca/rm4100/Kconfig	(revision 5205)
+++ src/mainboard/rca/rm4100/Kconfig	(working copy)
@@ -10,6 +10,7 @@ 
 	select UDELAY_TSC
 	select BOARD_ROMSIZE_KB_512
 	select HAVE_SMI_HANDLER
+	select GFXUMA
 
 config MAINBOARD_DIR
 	string