K8 RAM init debug messages are pretty short and sometimes cryptic. Make them a bit more verbose and hopefully more understandable.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: LinuxBIOSv2-k8_raminit_debugmessages/src/northbridge/amd/amdk8/raminit.c =================================================================== --- LinuxBIOSv2-k8_raminit_debugmessages/src/northbridge/amd/amdk8/raminit.c (Revision 4339) +++ LinuxBIOSv2-k8_raminit_debugmessages/src/northbridge/amd/amdk8/raminit.c (Arbeitskopie) @@ -850,14 +850,18 @@ }
/* Report the amount of memory. */ - printk_spew("RAM: 0x%08x kB\n", tom_k); + printk_debug("RAM end at 0x%08x kB, hole starts at 0x%08x kB\n", + tom_k, hole_startk);
/* Now set top of memory */ msr_t msr; if (tom_k > (4*1024*1024)) { + printk_raminit("Handling memory mapped above 4 GB\n"); + printk_raminit("Upper RAM end at 0x%08x kB\n", tom_k); msr.lo = (tom_k & 0x003fffff) << 10; msr.hi = (tom_k & 0xffc00000) >> 22; wrmsr(TOP_MEM2, msr); + printk_raminit("Correcting memory amount mapped below 4 GB\n"); }
/* Leave a 64M hole between TOP_MEM and TOP_MEM2 @@ -871,6 +875,7 @@ #endif tom_k = 0x3f0000; } + printk_raminit("Lower RAM end at 0x%08x kB\n", tom_k); msr.lo = (tom_k & 0x003fffff) << 10; msr.hi = (tom_k & 0xffc00000) >> 22; wrmsr(TOP_MEM, msr); @@ -2167,6 +2172,7 @@
hole_startk = 4*1024*1024 - HW_MEM_HOLE_SIZEK;
+ printk_raminit("Handling memory hole at 0x%08x (default)\n", hole_startk); #if HW_MEM_HOLE_SIZE_AUTO_INC == 1 /* We need to double check if hole_startk is valid. * If it is equal to the dram base address in K (base_k), @@ -2191,6 +2197,7 @@ basek_pri = base_k; }
+ printk_raminit("Handling memory hole at 0x%08x (adjusted)\n", hole_startk); #endif /* Find node number that needs the memory hole configured */ for (i=0; i<controllers; i++) { Index: LinuxBIOSv2-k8_raminit_debugmessages/src/northbridge/amd/amdk8/raminit_f.c =================================================================== --- LinuxBIOSv2-k8_raminit_debugmessages/src/northbridge/amd/amdk8/raminit_f.c (Revision 4339) +++ LinuxBIOSv2-k8_raminit_debugmessages/src/northbridge/amd/amdk8/raminit_f.c (Arbeitskopie) @@ -1049,14 +1049,18 @@ }
/* Report the amount of memory. */ - printk_debug("RAM: 0x%08x kB\n", tom_k); + printk_debug("RAM end at 0x%08x kB, hole starts at 0x%08x kB\n", + tom_k, hole_startk);
/* Now set top of memory */ msr_t msr; if (tom_k > (4*1024*1024)) { + printk_raminit("Handling memory mapped above 4 GB\n"); + printk_raminit("Upper RAM end at 0x%08x kB\n", tom_k); msr.lo = (tom_k & 0x003fffff) << 10; msr.hi = (tom_k & 0xffc00000) >> 22; wrmsr(TOP_MEM2, msr); + printk_raminit("Correcting memory amount mapped below 4 GB\n"); }
/* Leave a 64M hole between TOP_MEM and TOP_MEM2 @@ -1070,6 +1074,7 @@ #endif tom_k = 0x3f0000; } + printk_raminit("Lower RAM end at 0x%08x kB\n", tom_k); msr.lo = (tom_k & 0x003fffff) << 10; msr.hi = (tom_k & 0xffc00000) >> 22; wrmsr(TOP_MEM, msr); @@ -2938,6 +2943,7 @@
hole_startk = 4*1024*1024 - HW_MEM_HOLE_SIZEK;
+ printk_raminit("Handling memory hole at 0x%08x (default)\n", hole_startk); #if HW_MEM_HOLE_SIZE_AUTO_INC == 1 /* We need to double check if the hole_startk is valid, if it is equal to basek, we need to decrease it some */ @@ -2958,6 +2964,7 @@ } basek_pri = base_k; } + printk_raminit("Handling memory hole at 0x%08x (adjusted)\n", hole_startk); #endif /* find node index that need do set hole */ for (i=0; i < controllers; i++) {
On 05.06.2009 12:43 Uhr, Carl-Daniel Hailfinger wrote:
/* Report the amount of memory. */
- printk_spew("RAM: 0x%08x kB\n", tom_k);
printk_debug("RAM end at 0x%08x kB, hole starts at 0x%08x kB\n",
tom_k, hole_startk);
/* Now set top of memory */ msr_t msr; if (tom_k > (4*1024*1024)) {
printk_raminit("Handling memory mapped above 4 GB\n");
printk_raminit("Upper RAM end at 0x%08x kB\n", tom_k);
I'm not sure it gets any easier to understand or less cryptic by calling the amount of RAM end of RAM and printing it twice?
On 05.06.2009 13:44, Stefan Reinauer wrote:
On 05.06.2009 12:43 Uhr, Carl-Daniel Hailfinger wrote:
/* Report the amount of memory. */
- printk_spew("RAM: 0x%08x kB\n", tom_k);
printk_debug("RAM end at 0x%08x kB, hole starts at 0x%08x kB\n",
tom_k, hole_startk);
/* Now set top of memory */ msr_t msr; if (tom_k > (4*1024*1024)) {
printk_raminit("Handling memory mapped above 4 GB\n");
printk_raminit("Upper RAM end at 0x%08x kB\n", tom_k);
I'm not sure it gets any easier to understand or less cryptic by calling the amount of RAM end of RAM and printing it twice?
Actually, it's the end of RAM. On my 4 GB machine, tom_k is 0x00500000 which is 5*1024*1024. The hole starts at 3 GB in that configuration. However, printing it twice serves no purpose. I'll fix and resend.
Regards, Carl-Daniel
I'm not sure it gets any easier to understand or less cryptic by calling the amount of RAM end of RAM and printing it twice?
Actually, it's the end of RAM. On my 4 GB machine, tom_k is 0x00500000 which is 5*1024*1024. The hole starts at 3 GB in that configuration. However, printing it twice serves no purpose. I'll fix and resend.
I think it makes it easier to review patches like this (that only change debugging output) if you include before and after log snippets.
Thanks, Myles
On 05.06.2009 17:09, Myles Watson wrote:
I'm not sure it gets any easier to understand or less cryptic by calling the amount of RAM end of RAM and printing it twice?
Actually, it's the end of RAM. On my 4 GB machine, tom_k is 0x00500000 which is 5*1024*1024. The hole starts at 3 GB in that configuration. However, printing it twice serves no purpose. I'll fix and resend.
Turns out it once prints the unadjusted RAM end and once the adjusted RAM end, so killing off either of the prinks is not advisable.
I think it makes it easier to review patches like this (that only change debugging output) if you include before and after log snippets.
Old messages for my machine with 5 GB: RAM: 0x00400000 kB Ram3 [...] Initializing memory: done RAM: 0x00500000 kB
New messages: RAM end at 0x00400000 kB, hole starts at 0x00000000 kB Adjusting lower RAM end Lower RAM end at 0x003f0000 kB Ram3 [...] Initializing memory: done Handling memory hole at 0x00300000 (default) RAM end at 0x00500000 kB, hole starts at 0x00300000 kB Handling memory mapped above 4 GB Upper RAM end at 0x00500000 kB Correcting memory amount mapped below 4 GB Adjusting lower RAM end Lower RAM end at 0x00300000 kB
I hope this helps understand my patch better.
Regards, Carl-Daniel
Old messages for my machine with 5 GB: RAM: 0x00400000 kB Ram3 [...] Initializing memory: done RAM: 0x00500000 kB
New messages: RAM end at 0x00400000 kB, hole starts at 0x00000000 kB
I liked this one better before. Here it really means there is 4 GB of RAM. The "hole at 0x0" part is not helpful.
Handling memory hole at 0x00300000 (default) RAM end at 0x00500000 kB, hole starts at 0x00300000 kB
Here the new message makes sense. Do we need to print out the hole start again?
I hope this helps understand my patch better.
Yes. There's nothing like the real output for succinctness.
Acked-by: Myles Watson mylesgw@gmail.com
Thanks, Myles
On 05.06.2009 22:06, Myles Watson wrote:
Old messages for my machine with 5 GB: RAM: 0x00400000 kB Ram3 [...] Initializing memory: done RAM: 0x00500000 kB
New messages: RAM end at 0x00400000 kB, hole starts at 0x00000000 kB
I liked this one better before. Here it really means there is 4 GB of RAM. The "hole at 0x0" part is not helpful.
Since we already print hole location in a separate function, I'll kill it here.
Handling memory hole at 0x00300000 (default) RAM end at 0x00500000 kB, hole starts at 0x00300000 kB
Here the new message makes sense. Do we need to print out the hole start again?
Good question. The "Handling memory hole" message is in a separate function. I'll kill the "hole starts at" message.
I hope this helps understand my patch better.
Yes. There's nothing like the real output for succinctness.
I'll to do that in the future. Thanks for the hint.
Acked-by: Myles Watson mylesgw@gmail.com
Thanks, committed in r4341.
Regards, Carl-Daniel