On 06.08.2008 16:13, ron minnich wrote:
oh yeah. Be aware that on v3 we return from car to the main code, so
the stack has to be preserved. We may want to move the CAR area to a
real memory area as we did on V3. But is this possible?
In theory, it should work. In practice, at least some SimNow version
choked on the patches I had which moved the CAR area. I shall dig them
up again and have someone check them on real hardware. Of course it is
possible that my patches were faulty. To be honest, I have the feeling I
forgot to change some other code which references the old location.
We also need to get disable_car() working.
Yes, definitely.
Hmmm... found the patch. Attached.
Regards,
Carl-Daniel
--
http://www.hailfinger.org/
Index: LinuxBIOSv2-myCAR/src/cpu/amd/car/cache_as_ram.inc
===================================================================
--- LinuxBIOSv2-myCAR/src/cpu/amd/car/cache_as_ram.inc (Revision 3044)
+++ LinuxBIOSv2-myCAR/src/cpu/amd/car/cache_as_ram.inc (Arbeitskopie)
@@ -19,7 +19,7 @@
*/
#define CacheSize DCACHE_RAM_SIZE
-#define CacheBase (0xd0000 - CacheSize)
+#define CacheBase (0x90000 - CacheSize)
/* leave some space for global variable to pass to RAM stage */
#define GlobalVarSize DCACHE_RAM_GLOBAL_VAR_SIZE
@@ -181,6 +181,7 @@
#error Invalid CAR size, is not a multiple of 4k. This is a processor limitation.
#endif
+#if 0
#if CacheSize > 0x8000
/* enable caching for 32K-64K using fixed mtrr */
movl $0x268, %ecx /* fix4k_c0000*/
@@ -191,6 +192,14 @@
/* enable caching for 0-32K using fixed mtrr */
movl $0x269, %ecx /* fix4k_c8000*/
simplemask CacheSize, 0
+#endif
+#if CacheSize != 0x8000
+#error The new code wants CacheSize to be exactly 32k for now.
+#endif
+ /* Enable caching from 0x88000-0x8FFFF */
+ movl $0x06060000, %eax
+ xorl %edx, %edx
+ movl $0x258, %ecx
wrmsr
/* enable memory access for first MBs using top_mem */