Yh Lu's patches

2003-08-04 Thread ron minnich

Can Eric and Stefan and others interested please take a quick look at
this, it is the non-tyan mods from Yh Lu.

I am going to commit the tyan mods in a few minutes.

thanks

ron
diff -uNr ./freebios2/src/cpu/k8/cpufixup.c ../freebios2/src/cpu/k8/cpufixup.c
--- ./freebios2/src/cpu/k8/cpufixup.c   2003-08-04 17:57:43.0 -0400
+++ ../freebios2/src/cpu/k8/cpufixup.c  2003-08-04 19:41:18.0 -0400
@@ -29,15 +29,28 @@
mmio_basek = tomk;
}
 
-   /* Setup TOP_MEM */
-   msr.hi = mmio_basek >> 22;
-   msr.lo = mmio_basek << 10;
-   wrmsr(TOP_MEM, msr);
+#if 1
+/* Report the amount of memory. */
+print_debug("cpufixup RAM: 0x");
+print_debug_hex32(tomk);
+print_debug(" KB\r\n");
+#endif
+
+/* Now set top of memory */
+msr.lo = (tomk & 0x003f) << 10;
+msr.hi = (tomk & 0xffc0) >> 22;
+wrmsr(TOP_MEM2, msr);
+
+/* Leave a 64M hole between TOP_MEM and TOP_MEM2
+ * so I can see my rom chip and other I/O devices.
+ */
+if (tomk >= 0x003f) {
+tomk = 0x3f;
+} //tom_k = 0x3c;
+msr.lo = (tomk & 0x003f) << 10;
+msr.hi = (tomk & 0xffc0) >> 22;
+wrmsr(TOP_MEM, msr);
 
-   /* Setup TOP_MEM2 */
-   msr.hi = tomk >> 22;
-   msr.lo = tomk << 10;
-   wrmsr(TOP_MEM2, msr);
 
/* zero the IORR's before we enable to prevent
 * undefined side effects.
diff -uNr ./freebios2/src/include/console/console.h 
../freebios2/src/include/console/console.h
--- ./freebios2/src/include/console/console.h   2003-07-19 00:28:21.0 -0400
+++ ../freebios2/src/include/console/console.h  2003-08-02 01:40:57.0 -0400
@@ -92,34 +92,34 @@
 #define print_debug_char(CH)   printk_debug  ("%c", (CH))
 #define print_spew_char(CH)printk_spew   ("%c", (CH))
 
-#define print_emerg_hex8(HEX)   printk_emerg  ("%08x",  (HEX))
-#define print_alert_hex8(HEX)   printk_alert  ("%08x",  (HEX))
-#define print_crit_hex8(HEX)printk_crit   ("%08x",  (HEX))
-#define print_err_hex8(HEX) printk_err("%08x",  (HEX))
-#define print_warning_hex8(HEX) printk_warning("%08x",  (HEX))
-#define print_notice_hex8(HEX)  printk_notice ("%08x",  (HEX))
-#define print_info_hex8(HEX)printk_info   ("%08x",  (HEX))
-#define print_debug_hex8(HEX)   printk_debug  ("%08x",  (HEX))
-#define print_spew_hex8(HEX)printk_spew   ("%08x",  (HEX))
+#define print_emerg_hex8(HEX)   printk_emerg  ("%02x",  (HEX))
+#define print_alert_hex8(HEX)   printk_alert  ("%02x",  (HEX))
+#define print_crit_hex8(HEX)printk_crit   ("%02x",  (HEX))
+#define print_err_hex8(HEX) printk_err("%02x",  (HEX))
+#define print_warning_hex8(HEX) printk_warning("%02x",  (HEX))
+#define print_notice_hex8(HEX)  printk_notice ("%02x",  (HEX))
+#define print_info_hex8(HEX)printk_info   ("%02x",  (HEX))
+#define print_debug_hex8(HEX)   printk_debug  ("%02x",  (HEX))
+#define print_spew_hex8(HEX)printk_spew   ("%02x",  (HEX))
 
-#define print_emerg_hex16(HEX)   printk_emerg  ("%016x", (HEX))
-#define print_alert_hex16(HEX)   printk_alert  ("%016x", (HEX))
-#define print_crit_hex16(HEX)printk_crit   ("%016x", (HEX))
-#define print_err_hex16(HEX) printk_err("%016x", (HEX))
-#define print_warning_hex16(HEX) printk_warning("%016x", (HEX))
-#define print_notice_hex16(HEX)  printk_notice ("%016x", (HEX))
-#define print_info_hex16(HEX)printk_info   ("%016x", (HEX))
-#define print_debug_hex16(HEX)   printk_debug  ("%016x", (HEX))
-#define print_spew_hex16(HEX)printk_spew   ("%016x", (HEX))
+#define print_emerg_hex16(HEX)   printk_emerg  ("%04x", (HEX))
+#define print_alert_hex16(HEX)   printk_alert  ("%04x", (HEX))
+#define print_crit_hex16(HEX)printk_crit   ("%04x", (HEX))
+#define print_err_hex16(HEX) printk_err("%04x", (HEX))
+#define print_warning_hex16(HEX) printk_warning("%04x", (HEX))
+#define print_notice_hex16(HEX)  printk_notice ("%04x", (HEX))
+#define print_info_hex16(HEX)printk_info   ("%04x", (HEX))
+#define print_debug_hex16(HEX)   printk_debug  ("%04x", (HEX))
+#define print_spew_hex16(HEX)printk_spew   ("%04x", (HEX))
 
-#define print_emerg_hex32(HEX)   printk_emerg  ("%032x", (HEX))
-#define print_alert_hex32(HEX)   printk_alert  ("%032x", (HEX))
-#define print_crit_hex32(HEX)printk_crit   ("%032x", (HEX))
-#define print_err_hex32(HEX) printk_err("%032x", (HEX))
-#define print_warning_hex32(HEX) printk_warning("%032x", (HEX))
-#define print_notice_hex32(HEX)  printk_notice ("%032x", (HEX))
-#define print_info_hex32(HEX)printk_info   ("%032x", (HEX))
-#define print_debug_hex32(HEX)   printk_debug  ("%032x", (HEX))
-#define print_spew_hex32(HEX)printk_spew   ("%032x", (HEX))
+#define print_emerg_hex32(HEX)   printk_emerg  ("%08x", (HEX))
+#define print_alert_hex32(HEX)   printk_alert  ("%08x", (HEX))
+#define print_crit_hex32(HEX)printk_crit   ("%08x", (HEX))

Re: Yh Lu's patches

2003-08-04 Thread Eric W. Biederman
ron minnich <[EMAIL PROTECTED]> writes:

> Can Eric and Stefan and others interested please take a quick look at
> this, it is the non-tyan mods from Yh Lu.
> 
> I am going to commit the tyan mods in a few minutes.
> 
> thanks
> 
> ron
> diff -uNr ./freebios2/src/cpu/k8/cpufixup.c ../freebios2/src/cpu/k8/cpufixup.c
> --- ./freebios2/src/cpu/k8/cpufixup.c 2003-08-04 17:57:43.0 -0400
> +++ ../freebios2/src/cpu/k8/cpufixup.c2003-08-04 19:41:18.0 -0400
> @@ -29,15 +29,28 @@
>   mmio_basek = tomk;
>   }
>  
> - /* Setup TOP_MEM */
> - msr.hi = mmio_basek >> 22;
> - msr.lo = mmio_basek << 10;
> - wrmsr(TOP_MEM, msr);
> +#if 1
> +/* Report the amount of memory. */
> +print_debug("cpufixup RAM: 0x");
> +print_debug_hex32(tomk);
> +print_debug(" KB\r\n");
> +#endif
> +
> +/* Now set top of memory */
> +msr.lo = (tomk & 0x003f) << 10;
> +msr.hi = (tomk & 0xffc0) >> 22;
> +wrmsr(TOP_MEM2, msr);
> +
> +/* Leave a 64M hole between TOP_MEM and TOP_MEM2
> + * so I can see my rom chip and other I/O devices.
> + */
> +if (tomk >= 0x003f) {
> +tomk = 0x3f;
> +} //tom_k = 0x3c;
> +msr.lo = (tomk & 0x003f) << 10;
> +msr.hi = (tomk & 0xffc0) >> 22;
> +wrmsr(TOP_MEM, msr);
>  
> - /* Setup TOP_MEM2 */
> - msr.hi = tomk >> 22;
> - msr.lo = tomk << 10;
> - wrmsr(TOP_MEM2, msr);
>  
>   /* zero the IORR's before we enable to prevent
>* undefined side effects.

This bit is redundant. 
I described the change to Yinghai Lu and he made is own version of it.

And in fact it is actively wrong. mmio_basek does a much better job
of leaving an I/O hole there, then simply subtracting 64MB from 4GB.


> diff -uNr ./freebios2/src/include/console/console.h
> ../freebios2/src/include/console/console.h
> 
> --- ./freebios2/src/include/console/console.h 2003-07-19 00:28:21.0
> -0400
> 
> +++ ../freebios2/src/include/console/console.h 2003-08-02 01:40:57.0
> -0400
> 
> @@ -92,34 +92,34 @@
>  #define print_debug_char(CH)   printk_debug  ("%c", (CH))
>  #define print_spew_char(CH)printk_spew   ("%c", (CH))
>  
> -#define print_emerg_hex8(HEX)   printk_emerg  ("%08x",  (HEX))
> -#define print_alert_hex8(HEX)   printk_alert  ("%08x",  (HEX))
> -#define print_crit_hex8(HEX)printk_crit   ("%08x",  (HEX))
> -#define print_err_hex8(HEX) printk_err("%08x",  (HEX))
> -#define print_warning_hex8(HEX) printk_warning("%08x",  (HEX))
> -#define print_notice_hex8(HEX)  printk_notice ("%08x",  (HEX))
> -#define print_info_hex8(HEX)printk_info   ("%08x",  (HEX))
> -#define print_debug_hex8(HEX)   printk_debug  ("%08x",  (HEX))
> -#define print_spew_hex8(HEX)printk_spew   ("%08x",  (HEX))
> +#define print_emerg_hex8(HEX)   printk_emerg  ("%02x",  (HEX))
> +#define print_alert_hex8(HEX)   printk_alert  ("%02x",  (HEX))
> +#define print_crit_hex8(HEX)printk_crit   ("%02x",  (HEX))
> +#define print_err_hex8(HEX) printk_err("%02x",  (HEX))
> +#define print_warning_hex8(HEX) printk_warning("%02x",  (HEX))
> +#define print_notice_hex8(HEX)  printk_notice ("%02x",  (HEX))
> +#define print_info_hex8(HEX)printk_info   ("%02x",  (HEX))
> +#define print_debug_hex8(HEX)   printk_debug  ("%02x",  (HEX))
> +#define print_spew_hex8(HEX)printk_spew   ("%02x",  (HEX))
>  
> -#define print_emerg_hex16(HEX)   printk_emerg  ("%016x", (HEX))
> -#define print_alert_hex16(HEX)   printk_alert  ("%016x", (HEX))
> -#define print_crit_hex16(HEX)printk_crit   ("%016x", (HEX))
> -#define print_err_hex16(HEX) printk_err("%016x", (HEX))
> -#define print_warning_hex16(HEX) printk_warning("%016x", (HEX))
> -#define print_notice_hex16(HEX)  printk_notice ("%016x", (HEX))
> -#define print_info_hex16(HEX)printk_info   ("%016x", (HEX))
> -#define print_debug_hex16(HEX)   printk_debug  ("%016x", (HEX))
> -#define print_spew_hex16(HEX)printk_spew   ("%016x", (HEX))
> +#define print_emerg_hex16(HEX)   printk_emerg  ("%04x", (HEX))
> +#define print_alert_hex16(HEX)   printk_alert  ("%04x", (HEX))
> +#define print_crit_hex16(HEX)printk_crit   ("%04x", (HEX))
> +#define print_err_hex16(HEX) printk_err("%04x", (HEX))
> +#define print_warning_hex16(HEX) printk_warning("%04x", (HEX))
> +#define print_notice_hex16(HEX)  printk_notice ("%04x", (HEX))
> +#define print_info_hex16(HEX)printk_info   ("%04x", (HEX))
> +#define print_debug_hex16(HEX)   printk_debug  ("%04x", (HEX))
> +#define print_spew_hex16(HEX)printk_spew   ("%04x", (HEX))
>  
> -#define print_emerg_hex32(HEX)   printk_emerg  ("%032x", (HEX))
> -#define print_alert_hex32(HEX)   printk_alert  ("%032x", (HEX))
> -#define print_crit_hex32(HEX)printk_crit   ("%032x", (HEX))
> -#define print_err_hex32(HEX) printk_err("%032x", (HEX))
> -#define print_warning_hex32(HEX) printk_warning("%032

Re: Yh Lu's patches

2003-08-04 Thread YhLu
Eric,

As for cpufixup.c, actually I grab the fragment from raminit.c's
set_top_ram.
I don't want to make my own, because I can not access the most update code
because of 24 hours delay.

Fill_last:
Can someone raise the bug to LinuxKernel developer team?


There are Config.lb and config.lb in the southbridge/amd/amd8111.
We should get rid of config.lb.

Regards

Yinghai Lu

-邮件原件-
发件人: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
发送时间: 2003年8月4日 16:35
收件人: ron minnich
抄送: [EMAIL PROTECTED]
主题: Re: Yh Lu's patches

ron minnich <[EMAIL PROTECTED]> writes:

> Can Eric and Stefan and others interested please take a quick look at
> this, it is the non-tyan mods from Yh Lu.
> 
> I am going to commit the tyan mods in a few minutes.
> 
> thanks
> 
> ron
> diff -uNr ./freebios2/src/cpu/k8/cpufixup.c
../freebios2/src/cpu/k8/cpufixup.c
> --- ./freebios2/src/cpu/k8/cpufixup.c 2003-08-04 17:57:43.0 -0400
> +++ ../freebios2/src/cpu/k8/cpufixup.c2003-08-04
19:41:18.0 -0400
> @@ -29,15 +29,28 @@
>   mmio_basek = tomk;
>   }
>  
> - /* Setup TOP_MEM */
> - msr.hi = mmio_basek >> 22;
> - msr.lo = mmio_basek << 10;
> - wrmsr(TOP_MEM, msr);
> +#if 1
> +/* Report the amount of memory. */
> +print_debug("cpufixup RAM: 0x");
> +print_debug_hex32(tomk);
> +print_debug(" KB\r\n");
> +#endif
> +
> +/* Now set top of memory */
> +msr.lo = (tomk & 0x003f) << 10;
> +msr.hi = (tomk & 0xffc0) >> 22;
> +wrmsr(TOP_MEM2, msr);
> +
> +/* Leave a 64M hole between TOP_MEM and TOP_MEM2
> + * so I can see my rom chip and other I/O devices.
> + */
> +if (tomk >= 0x003f) {
> +tomk = 0x3f;
> +} //tom_k = 0x3c;
> +msr.lo = (tomk & 0x003f) << 10;
> +msr.hi = (tomk & 0xffc0) >> 22;
> +wrmsr(TOP_MEM, msr);
>  
> - /* Setup TOP_MEM2 */
> - msr.hi = tomk >> 22;
> - msr.lo = tomk << 10;
> - wrmsr(TOP_MEM2, msr);
>  
>   /* zero the IORR's before we enable to prevent
>* undefined side effects.

This bit is redundant. 
I described the change to Yinghai Lu and he made is own version of it.

And in fact it is actively wrong. mmio_basek does a much better job
of leaving an I/O hole there, then simply subtracting 64MB from 4GB.


> diff -uNr ./freebios2/src/include/console/console.h
> ../freebios2/src/include/console/console.h
> 
> --- ./freebios2/src/include/console/console.h 2003-07-19
00:28:21.0
> -0400
> 
> +++ ../freebios2/src/include/console/console.h 2003-08-02
01:40:57.0
> -0400
> 
> @@ -92,34 +92,34 @@
>  #define print_debug_char(CH)   printk_debug  ("%c", (CH))
>  #define print_spew_char(CH)printk_spew   ("%c", (CH))
>  
> -#define print_emerg_hex8(HEX)   printk_emerg  ("%08x",  (HEX))
> -#define print_alert_hex8(HEX)   printk_alert  ("%08x",  (HEX))
> -#define print_crit_hex8(HEX)printk_crit   ("%08x",  (HEX))
> -#define print_err_hex8(HEX) printk_err("%08x",  (HEX))
> -#define print_warning_hex8(HEX) printk_warning("%08x",  (HEX))
> -#define print_notice_hex8(HEX)  printk_notice ("%08x",  (HEX))
> -#define print_info_hex8(HEX)printk_info   ("%08x",  (HEX))
> -#define print_debug_hex8(HEX)   printk_debug  ("%08x",  (HEX))
> -#define print_spew_hex8(HEX)printk_spew   ("%08x",  (HEX))
> +#define print_emerg_hex8(HEX)   printk_emerg  ("%02x",  (HEX))
> +#define print_alert_hex8(HEX)   printk_alert  ("%02x",  (HEX))
> +#define print_crit_hex8(HEX)printk_crit   ("%02x",  (HEX))
> +#define print_err_hex8(HEX) printk_err("%02x",  (HEX))
> +#define print_warning_hex8(HEX) printk_warning("%02x",  (HEX))
> +#define print_notice_hex8(HEX)  printk_notice ("%02x",  (HEX))
> +#define print_info_hex8(HEX)printk_info   ("%02x",  (HEX))
> +#define print_debug_hex8(HEX)   printk_debug  ("%02x",  (HEX))
> +#define print_spew_hex8(HEX)printk_spew   ("%02x",  (HEX))
>  
> -#define print_emerg_hex16(HEX)   printk_emerg  ("%016x", (HEX))
> -#define print_alert_hex16(HEX)   printk_alert  ("%016x", (HEX))
> -#define print_crit_hex16(HEX)printk_crit   ("%016x", (HEX))
> -#define print_err_hex16(HEX) printk_err("%016x", (HEX))
> -#define print_warning_hex16(HEX) printk_warning("%016x", (HEX))
> -#define print_notice_hex16(HEX

Re: Yh Lu's patches

2003-08-06 Thread Eric W. Biederman
YhLu <[EMAIL PROTECTED]> writes:

> Eric,
> 
> As for cpufixup.c, actually I grab the fragment from raminit.c's
> set_top_ram.
> I don't want to make my own, because I can not access the most update code
> because of 24 hours delay.

Not a problem with what you did.  Just a problem with inclusion of the code.
The only real problem was the one line where I shifted by 12 instead of 10.
Otherwise the original is fine.

> Fill_last:
> Can someone raise the bug to LinuxKernel developer team?

Done.  Hmm.  The Linux kernel developer team is an interesting concept...

> There are Config.lb and config.lb in the southbridge/amd/amd8111.
> We should get rid of config.lb.

Agreed.  ... That is why you deleted all of the driver statements.
That makes sense now.

Eric



___
Linuxbios mailing list
[EMAIL PROTECTED]
http://www.clustermatic.org/mailman/listinfo/linuxbios


Re: Yh Lu's patches

2003-08-14 Thread ron minnich
On 4 Aug 2003, Eric W. Biederman wrote:

> > diff -uNr ./freebios2/src/southbridge/amd/amd8111/config.lb
> > ../freebios2/src/southbridge/amd/amd8111/config.lb
> > 
> > --- ./freebios2/src/southbridge/amd/amd8111/config.lb 2003-06-17
> > 12:51:05.0 -0400
> > 
> > +++ ../freebios2/src/southbridge/amd/amd8111/config.lb 1969-12-31
> > 19:00:00.0 -0500
> > 
> > @@ -1,4 +0,0 @@
> > -driver amd8111_usb.o
> > -driver amd8111_lpc.o
> > -driver amd8111_ide.o
> > -driver amd8111_acpi.o
> 
> Hmm.  Removing all of those driver statements looks wrong...

what's really happening is deletion of the mis-named config.lb file, as we 
replaced it with Config.lb.

Thanks very much for looking at this, and also for trying out the new 
config tool.

ron

___
Linuxbios mailing list
[EMAIL PROTECTED]
http://www.clustermatic.org/mailman/listinfo/linuxbios


Re: Yh Lu's patches

2003-08-14 Thread ron minnich
On Mon, 4 Aug 2003, YhLu wrote:

> There are Config.lb and config.lb in the southbridge/amd/amd8111.
> We should get rid of config.lb.

done and comitted.

ron

___
Linuxbios mailing list
[EMAIL PROTECTED]
http://www.clustermatic.org/mailman/listinfo/linuxbios