Various typos, output beautifications and cosmetic fixes (trivial).

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@125 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Uwe Hermann 2007-02-26 01:38:12 +00:00
commit 0322a3b582
3 changed files with 53 additions and 56 deletions

View file

@ -18,12 +18,13 @@
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
INITCFLAGS := $(CFLAGS) -I$(src)/include/cpu/generic/x86 -I$(src)/include \
-fno-builtin
INITCFLAGS := $(CFLAGS) -I$(src)/include/cpu/generic/x86 -I$(src)/include \
-fno-builtin
SILENT := &> /dev/null
# Build the final ROM image
#
# Build the final ROM image.
#
# These are the main LinuxBIOS components. Do not change the order unless you
# know exactly what you are doing.
@ -32,18 +33,18 @@ SILENT := &> /dev/null
LINUXBIOS_COMPONENTS := linuxbios.lar linuxbios.vpd stage0.init
$(obj)/linuxbios.rom: $(patsubst %,$(obj)/%,$(LINUXBIOS_COMPONENTS))
$(Q)cat $^ > $@
$(Q)cat $^ > $@
#
# Build the LAR archive.
#
# LinuxBIOS v3 is completely modular and based on a very small startup
# code (stage0) plus a LAR archive. The LAR archive may contain any number
# of stages, payloads and option roms.
#
# Build the LAR archive:
# of stages, payloads and option ROMs.
#
$(obj)/linuxbios.lar: $(obj)/util/lar/lar lzma $(obj)/linuxbios.initram $(obj)/linuxbios.stage2 payload
$(Q)echo "Building LinuxBIOS archive..."
$(Q)echo "Building LinuxBIOS archive... "
$(Q)rm -rf $(obj)/lar.tmp
$(Q)mkdir $(obj)/lar.tmp
$(Q)mkdir $(obj)/lar.tmp/normal
@ -51,12 +52,11 @@ $(obj)/linuxbios.lar: $(obj)/util/lar/lar lzma $(obj)/linuxbios.initram $(obj)/l
$(Q)cp $(obj)/linuxbios.stage2 $(obj)/lar.tmp/normal/stage2
$(Q)cp $(PAYLOAD) $(obj)/lar.tmp/normal/payload
$(Q)cd $(obj)/lar.tmp && ../util/lar/lar c ../linuxbios.lar.pre normal/initram normal/stage2 normal/payload
# TODO: dynamically pad the lar archive. bs is image size - bootblock size (8k)
# 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=245760 count=1 conv=sync $(SILENT)
#
# LinuxBIOS stage0. This is the LinuxBIOS "boot block code".
# It enables Cache-as-RAM and parses the LAR archive for an
@ -64,12 +64,15 @@ $(obj)/linuxbios.lar: $(obj)/util/lar/lar lzma $(obj)/linuxbios.initram $(obj)/l
#
$(obj)/stage0.init:
$(Q)echo "Building stage0.init"
$(Q)echo "Building stage0.init... "
$(Q)# Building asm stub
$(Q)$(CC) -E $(LINUXBIOSINCLUDE) $(src)/arch/x86/stage0_i586.S -o $(obj)/stage0_i586.s -DBOOTBLK=0x1f00 -DRESRVED=0xf0 -DDATE=\"`date +%Y/%m/%d`\"
$(Q)$(CC) -E $(LINUXBIOSINCLUDE) $(src)/arch/x86/stage0_i586.S \
-o $(obj)/stage0_i586.s -DBOOTBLK=0x1f00 -DRESRVED=0xf0 \
-DDATE=\"`date +%Y/%m/%d`\"
$(Q)$(AS) $(obj)/stage0_i586.s -o $(obj)/stage0_i586.o
$(Q)# Building cachemain
$(Q)$(CC) $(INITCFLAGS) -c $(src)/arch/x86/cachemain.c -o $(obj)/cachemain.o
$(Q)$(CC) $(INITCFLAGS) -c $(src)/arch/x86/cachemain.c \
-o $(obj)/cachemain.o
$(Q)$(CC) $(INITCFLAGS) -c $(src)/lib/lar.c -o $(obj)/lar.o
@ -84,36 +87,34 @@ $(obj)/stage0.init:
$(Q)$(CC) $(INITCFLAGS) -c $(src)/lib/mem.c -o $(obj)/mem.o
$(Q)$(CC) $(INITCFLAGS) -c $(src)/lib/elfboot.c -o $(obj)/elfboot.o
$(Q)cd $(obj); $(CC) -m32 -nostdlib -static \
$(Q)cd $(obj); $(CC) -m32 -nostdlib -static \
-T $(src)/arch/x86/ldscript.ld cachemain.o \
console.o uart8250.o serial.o archelfboot.o vtxprintf.o \
console.o uart8250.o serial.o archelfboot.o vtxprintf.o \
vsprintf.o lar.o elfboot.o mem.o stage0_i586.o -o stage0.o
$(Q)objcopy -O binary $(obj)/stage0.o $(obj)/stage0.init.pre
$(Q)objcopy -O binary $(obj)/stage0.o $(obj)/stage0.init.pre
# Pad boot block to 0x4000 - 0x100
# we will probably remove this step -- not needed if we continue with ldscript.ld
# Pad boot block to 0x4000 - 0x100.
# We will probably remove this step -- not needed if we continue
# with ldscript.ld.
$(Q)dd if=$(obj)/stage0.init.pre of=$(obj)/stage0.init \
bs=16128 conv=sync $(SILENT)
$(Q)echo "Len: `wc -c < $(obj)/stage0.init.pre`"
$(Q)test `wc -c < $(obj)/stage0.init.pre` -gt 16128 && echo "Error. Bootblock got too big" || true
$(Q)test `wc -c < $(obj)/stage0.init.pre` -gt 16128 && echo "Error. Bootblock got too big" || true
#
# This is the rest of LinuxBIOS (v2: linuxbios_ram.rom)
# Is this maybe platform independent, except for the "drivers"?
# Where should it be built, maybe in device/ ?
# This is the rest of LinuxBIOS (v2: linuxbios_ram.rom).
# Is this maybe platform independent, except for the "drivers"?
# Where should it be built, maybe in device/?
#
# TODO: This should be compressed with the default compressor
# TODO: This should be compressed with the default compressor.
#
$(obj)/linuxbios.stage2: $(obj)/stage0.init $(obj)/statictree.o
$(Q)echo "Building linuxbios.stage2"
$(Q)echo "Building linuxbios.stage2... "
$(Q)# main
$(Q)$(CC) $(INITCFLAGS) -c $(src)/lib/stage2.c -o $(obj)/stage2.o
$(Q)$(CC) $(INITCFLAGS) -c $(src)/device/device.c -o $(obj)/device.o
@ -128,8 +129,8 @@ $(obj)/linuxbios.stage2: $(obj)/stage0.init $(obj)/statictree.o
$(Q)# leave a .o with full symbols in it for debugging.
$(Q)cd $(obj); $(LD) -R $(obj)/stage0.o -Ttext 0x1000 \
--entry=stage2 -o $(obj)/linuxbios.stage2.o \
stage2.o device.o device_util.o root_device.o \
mem.o malloc.o clog2.o mainboard.o \
stage2.o device.o device_util.o root_device.o \
mem.o malloc.o clog2.o mainboard.o \
statictree.o
$(Q)objcopy -O binary $(obj)/linuxbios.stage2.o $(obj)/linuxbios.stage2
@ -138,14 +139,11 @@ $(obj)/linuxbios.stage2: $(obj)/stage0.init $(obj)/statictree.o
#
# The payload as we love it. Get it from somewhere.
# Is this a place to incorporate buildrom?
#
# TODO: This is not implemented yet.
# TODO: This needs to be compressed with the default compressor
#
# TODO: This is not implemented yet.
# TODO: This needs to be compressed with the default compressor.
#
payload:
$(Q)echo "Building payload... skipped"

View file

@ -19,44 +19,43 @@
##
#
# VPD or SIP ROM or ... how does nvidia call it?
# Some space to cope with dirty southbridge tricks.
# VPD or SIP ROM or ... how does NVIDIA call it?
# Some space to cope with dirty southbridge tricks.
# Do we want to put our own stuff there, too?
#
$(obj)/linuxbios.vpd:
$(Q)printf "Building dummy VPD ..."
$(Q)printf "Building dummy VPD... "
$(Q)dd if=/dev/zero of=$(obj)/linuxbios.vpd bs=256 count=1 $(SILENT)
$(Q)printf "ok.\n"
$(Q)printf "done\n"
#
# this is going to be the init ram code:
# 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
# Initram is always uncompressed. It belongs into the mainboard directory
# and is built from what was auto.c in v2.
#
$(obj)/linuxbios.initram: $(obj)/stage0.init $(obj)/stage0.o
$(Q)echo Building linuxbios.initram
$(obj)/linuxbios.initram: $(obj)/stage0.init $(obj)/stage0.o
$(Q)echo "Building linuxbios.initram... "
# initram links against stage0
$(Q)$(CC) $(INITCFLAGS) -c $(src)/mainboard/$(MAINBOARDDIR)/initram.c -o $(obj)/initram.o
$(Q)$(CC) $(INITCFLAGS) -c $(src)/mainboard/$(MAINBOARDDIR)/initram.c \
-o $(obj)/initram.o
$(Q)$(LD) -R $(obj)/stage0.o -Ttext 0x80000 $(obj)/initram.o \
--entry=main -o $(obj)/linuxbios.initram.o
$(Q)objcopy -O binary $(obj)/linuxbios.initram.o $(obj)/linuxbios.initram
$(Q)objcopy -O binary $(obj)/linuxbios.initram.o \
$(obj)/linuxbios.initram
$(Q)chmod 644 $(obj)/linuxbios.initram
#
# Miscellaneous important targets.
#
# miscellaneous important targets.
$(obj)/mainboard.o: $(obj)/statictree.o
$(obj)/statictree.o: $(obj)/statictree.c
$(obj)/statictree.o: $(obj)/statictree.c
$(Q)$(CC) $(CFLAGS) $(LINUXBIOSINCLUDE) -c -o $(obj)/statictree.o $(obj)/statictree.c
$(obj)/statictree.c: mainboard/$(MAINBOARDDIR)/dts $(obj)/util/dtc/dtc
$(Q)$(obj)/util/dtc/dtc -O lb mainboard/$(MAINBOARDDIR)/dts >$(obj)/statictree.c

View file

@ -21,14 +21,14 @@
SOURCE := lar.c create.c extract.c list.c lib.c
$(obj)/util/lar/lar: $(patsubst %,$(src)/util/lar/%,$(SOURCE))
$(Q)printf "Building LAR utility..."
$(Q)printf "Building LAR utility... "
$(Q)mkdir -p $(obj)/util/lar
$(Q)$(HOSTCC) $(HOSTCFLAGS) -o $@ $^
$(Q)printf "done.\n"
$(Q)printf "done\n"
## --------------------------------------------------------------------
## stuff below this line is for debugging purposes only.
## Stuff below this line is for debugging purposes only.
ifdef DEBUG_LAR
example: example.c