From 0c11caa5e0061df6f78b28a95fd402ce883e1f02 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 23 Feb 2007 11:51:32 +0000 Subject: [PATCH] fix a warning, clean up code and makefiles Signed-off-by: Stefan Reinauer Acked-by: Ronald G. Minnich git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@94 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- Makefile | 2 +- arch/x86/Makefile | 18 ++++------- lib/stage2.c | 42 +++++++++++++------------- mainboard/emulation/qemu-i386/Makefile | 5 ++- 4 files changed, 32 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index 93fd4cbf63..e369edbde8 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ else include $(src)/.config all: prepare prepare2 $(obj)/linuxbios.rom - $(Q)echo "build process finished." + $(Q)echo "Build process finished." MAINBOARDDIR=$(shell echo $(CONFIG_MAINBOARD_NAME)) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 15a3e7513e..8f9c5405d4 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -18,6 +18,8 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## +SILENT := &> /dev/null + $(obj)/linuxbios.rom: $(obj)/linuxbios.lar $(obj)/stage0.init $(obj)/linuxbios.vpd $(Q)cat $(obj)/linuxbios.lar \ $(obj)/linuxbios.vpd \ @@ -30,16 +32,7 @@ $(obj)/linuxbios.rom: $(obj)/linuxbios.lar $(obj)/stage0.init $(obj)/linuxbios.v # lzma: - $(Q)echo "building lzma" - - -# -# initram is always uncompressed. It belongs into the mainboard directory -# and is build from what was auto.c in v2 -# - -initram: - $(Q)echo "building initram" + $(Q)echo "Building lzma... skipped" # # this is the rest of linuxbios (v2: linuxbios_ram.rom) @@ -80,7 +73,7 @@ $(obj)/linuxbios.stage2: $(obj)/stage0.init $(obj)/statictree.o # payload: - $(Q)echo "building payload" + $(Q)echo "Building payload... skipped" # @@ -96,7 +89,8 @@ $(obj)/linuxbios.lar: $(obj)/util/lar/lar lzma $(obj)/linuxbios.initram $(obj)/l $(Q)cp $(obj)/linuxbios.stage2 $(obj)/lar.tmp/normal/stage2 $(Q)cd $(obj)/lar.tmp && ../util/lar/lar c ../linuxbios.lar.pre normal/initram normal/stage2 # TODO: dynamically pad the lar archive. bs is image size - bootblock size (8k) - $(Q)dd if=$(obj)/linuxbios.lar.pre of=$(obj)/linuxbios.lar bs=253952 count=1 conv=sync + $(Q)dd if=$(obj)/linuxbios.lar.pre of=$(obj)/linuxbios.lar \ + bs=253952 count=1 conv=sync $(SILENT) # diff --git a/lib/stage2.c b/lib/stage2.c index e2ff9d8eaf..95a8e35371 100644 --- a/lib/stage2.c +++ b/lib/stage2.c @@ -57,52 +57,52 @@ it with the version available from LANL. * LinuxBIOS is divided into Pre-DRAM part and DRAM part. * The phases before this part are phase 0 and phase 1. * This part contains phases x through y. - * * * Device Enumeration: * In the dev_enumerate() phase, */ int stage2(void) { - struct lb_memory *lb_mem; - post_code(0x20); dev_init(); - dev_phase1(); /* console init, also ANYTHING that has to be done before printk can be used */ - + /* console init, also ANYTHING that has to be done + * before printk can be used + */ post_code(0x30); + dev_phase1(); + +// printk_notice("LinuxBIOS-%s%s %s booting...\n", +// linuxbios_version, linuxbios_extra_version, linuxbios_build); -// printk_notice("LinuxBIOS-%s%s %s booting...\n", linuxbios_version, linuxbios_extra_version, linuxbios_build); + /* here is where weird stuff like init_timer handling should be + * done. This is for ANYTHING that might have to happen before + * device enumeration but that needs a printk + */ post_code(0x40); - - /* here is where weird stuff like init_timer handling should be done. This is for ANYTHING - * that might have to happen before device enumeration but that needs a printk - */ dev_phase2(); - /* walk physical devices and add any dynamic devices to the device tree */ + + /* walk physical devices and add any dynamic devices to the + * device tree + */ post_code(0x30); dev_root_phase3(); - post_code(0x40); + /* Compute and assign the bus resources. */ + post_code(0x40); dev_phase4(); - post_code(0x50); + /* Now actually enable devices on the bus */ + post_code(0x50); dev_root_phase5(); - post_code(0x60); + /*initialize devices on the bus */ + post_code(0x60); dev_phase6(); post_code(0x70); -#ifdef NOT - /* Now that we have collected all of our information - * write our configuration tables. - */ - phase8(); /* all devices up, prepare for elfboot */ - elfboot(lb_mem); -#endif return 0; } diff --git a/mainboard/emulation/qemu-i386/Makefile b/mainboard/emulation/qemu-i386/Makefile index 8560c3c83f..1cca0f45d7 100644 --- a/mainboard/emulation/qemu-i386/Makefile +++ b/mainboard/emulation/qemu-i386/Makefile @@ -26,13 +26,16 @@ $(obj)/linuxbios.vpd: $(Q)printf "Building dummy VPD ..." - $(Q)dd if=/dev/zero of=$(obj)/linuxbios.vpd bs=256 count=1 + $(Q)dd if=/dev/zero of=$(obj)/linuxbios.vpd bs=256 count=1 $(SILENT) $(Q)printf "ok.\n" # # this is going to be the init ram code: # +# initram is always uncompressed. It belongs into the mainboard directory +# and is build from what was auto.c in v2 +# $(obj)/linuxbios.initram: $(obj)/stage0.init $(obj)/stage0.o $(Q)echo Building linuxbios.initram