Author: hailfinger Date: 2007-11-16 12:17:57 +0100 (Fri, 16 Nov 2007) New Revision: 510
Modified: LinuxBIOSv3/arch/x86/stage1.c LinuxBIOSv3/lib/stage2.c LinuxBIOSv3/mainboard/adl/msm800sev/stage1.c LinuxBIOSv3/mainboard/emulation/qemu-x86/stage1.c Log: Improve printk documentation to match code realities.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net Acked-by: Corey Osgood corey.osgood@gmail.com
Modified: LinuxBIOSv3/arch/x86/stage1.c =================================================================== --- LinuxBIOSv3/arch/x86/stage1.c 2007-10-31 02:40:17 UTC (rev 509) +++ LinuxBIOSv3/arch/x86/stage1.c 2007-11-16 11:17:57 UTC (rev 510) @@ -102,14 +102,17 @@ }
// We have cache as ram running and can start executing code in C. - //
hardware_stage1();
// uart_init(); // initialize serial port - console_init(); // print banner
+ /* Exactly from now on we can use printk to the serial port. + * Celebrate this by printing a LB banner. + */ + console_init(); + if (bist!=0) { printk(BIOS_INFO, "BIST FAILED: %08x", bist); die("");
Modified: LinuxBIOSv3/lib/stage2.c =================================================================== --- LinuxBIOSv3/lib/stage2.c 2007-10-31 02:40:17 UTC (rev 509) +++ LinuxBIOSv3/lib/stage2.c 2007-11-16 11:17:57 UTC (rev 510) @@ -37,7 +37,8 @@ * * Device Enumeration: in the dev_enumerate() phase. * - * TODO: Check whether this documentation is still correct. Improve it. + * TODO: + * - Check whether this documentation is still correct. Improve it. */ int stage2(void) { @@ -54,7 +55,13 @@
post_code(0x20);
- /* TODO: Explain why we use printk here although it is impossible */ + /* TODO: Explain why we use printk here although it is claimed to be + * impossible according to the documentation. The "has to be done + * before printk can be used" comment below seems to suggest the same. + * However, we already enable serial in arch/x86/stage1.c:stage1_main() + * when we call hardware_stage1(); uart_init(); console_init(); + * Why test the console again if it already is tested in stage 1? + */ printk(BIOS_NOTICE, console_test);
dev_init();
Modified: LinuxBIOSv3/mainboard/adl/msm800sev/stage1.c =================================================================== --- LinuxBIOSv3/mainboard/adl/msm800sev/stage1.c 2007-10-31 02:40:17 UTC (rev 509) +++ LinuxBIOSv3/mainboard/adl/msm800sev/stage1.c 2007-11-16 11:17:57 UTC (rev 510) @@ -36,6 +36,8 @@ #define SERIAL_DEV W83627HF_SP1 #define SERIAL_IOBASE 0x3f8
+/* printk will not yet output anything */ + void hardware_stage1(void) { void w83627hf_enable_serial(u8 dev, u8 serial, u16 iobase); @@ -51,5 +53,4 @@ */ cs5536_disable_internal_uart(); w83627hf_enable_serial(0x2e, SERIAL_DEV, SERIAL_IOBASE); - printk(BIOS_DEBUG, "Done %s\n", __FUNCTION__); }
Modified: LinuxBIOSv3/mainboard/emulation/qemu-x86/stage1.c =================================================================== --- LinuxBIOSv3/mainboard/emulation/qemu-x86/stage1.c 2007-10-31 02:40:17 UTC (rev 509) +++ LinuxBIOSv3/mainboard/emulation/qemu-x86/stage1.c 2007-11-16 11:17:57 UTC (rev 510) @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-/* no printk allowed until hardware is ready; hardware is ready */ +/* printk will not yet output anything */
/** * start up hardware needed for stage1