[PATCH]On PMC Yosemite, get the memory size from PMON

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Ralf

Attached untested patch implements support for getting the memory size
from PMON.PMON stores the memory size in MB in an env variable called
memsize. This patch follows the previous hypertransport patch

Thanks
Manish Lachwani

--- arch/mips/pmc-sierra/yosemite/setup.c.orig	2004-10-20
19:09:17.000000000 -0700
+++ arch/mips/pmc-sierra/yosemite/setup.c	2004-10-20 19:11:09.000000000
-0700
@@ -59,6 +59,7 @@
 
 unsigned long cpu_clock;
 unsigned long yosemite_base;
+unsigned long memory_size;
 
 void __init bus_error_init(void)
 {
@@ -197,8 +198,12 @@
 	board_time_init = yosemite_time_init;
 	late_time_init = py_map_ocd;
 
-	/* Add memory regions */
-	add_memory_region(0x00000000, 0x10000000, BOOT_MEM_RAM);
+	/* 
+	 * Add memory regions. Check what PMON as for us and 
+	 * then config memory. PMON reports the memory config
+	 * in MB
+	 */
+	add_memory_region(0x00000000, memory_size*1024*1024, BOOT_MEM_RAM);
 
 	if (val & 0x00000020) {
 		/*
--- arch/mips/pmc-sierra/yosemite/prom.c.orig	2004-10-20
18:55:06.000000000 -0700
+++ arch/mips/pmc-sierra/yosemite/prom.c	2004-10-20 19:08:40.000000000
-0700
@@ -27,6 +27,7 @@
 
 extern unsigned long yosemite_base;
 extern unsigned long cpu_clock;
+extern unsigned long memory_size; /* Get the memory size from PMON */
 
 const char *get_system_type(void)
 {
@@ -112,6 +113,11 @@
 			    simple_strtol(*env + strlen("cpuclock="), NULL,
 					  10);
 
+		if (strncmp("memsize", *env, strlen("memsize")) == 0)
+			memory_size =
+			    simple_strtol(*env + strlen("memsize="), NULL,
+					  4);
+
 		env++;
 	}
 #endif /* CONFIG_MIPS32 */



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux