Author: stepan
Date: Tue Apr 20 20:35:33 2010
New Revision: 5467
URL: https://tracker.coreboot.org/trac/coreboot/changeset/5467
Log:
Make VSA code selectable in Kconfig
Signed-off-by: Stefan Reinauer <stepan(a)coresystems.de>
Acked-by: Peter Stuge <peter(a)stuge.se>
Modified:
trunk/src/arch/i386/Makefile.inc
trunk/src/cpu/amd/model_gx2/Kconfig
trunk/src/cpu/amd/model_lx/Kconfig
Modified: trunk/src/arch/i386/Makefile.inc
==============================================================================
--- trunk/src/arch/i386/Makefile.inc Tue Apr 20 20:22:20 2010 (r5466)
+++ trunk/src/arch/i386/Makefile.inc Tue Apr 20 20:35:33 2010 (r5467)
@@ -25,6 +25,9 @@
ifeq ($(CONFIG_AP_CODE_IN_CAR),y)
COREBOOT_ROM_DEPENDENCIES+=$(obj)/coreboot_ap
endif
+ifeq ($(CONFIG_GEODE_VSA),y)
+COREBOOT_ROM_DEPENDENCIES+=$(CONFIG_VSA_FILE)
+endif
$(obj)/coreboot.rom: $(obj)/coreboot.pre $(obj)/coreboot_ram $(CBFSTOOL) $(call strip_quotes,$(COREBOOT_ROM_DEPENDENCIES))
@printf " CBFS $(subst $(obj)/,,$(@))\n"
@@ -52,6 +55,12 @@
@printf " BOOTSPLASH $(CONFIG_FALLBACK_BOOTSPLASH_FILE)\n"
$(CBFSTOOL) $@.tmp add $(CONFIG_FALLBACK_BOOTSPLASH_FILE) bootsplash.jpg bootsplash
endif
+ifeq ($(CONFIG_GEODE_VSA),y)
+ @printf " VSA $(CONFIG_VSA_FILE)\n"
+ $(OBJCOPY) --set-start 0x20 --adjust-vma 0x60000 -I binary -O elf32-i386 -B i386 $(CONFIG_VSA_FILE) $(obj)/vsa.o
+ $(LD) -e 0x60020 --section-start .data=0x60000 $(obj)/vsa.o -o $(obj)/vsa.elf
+ $(CBFSTOOL) $@.tmp add-stage $(obj)/vsa.elf vsa
+endif
mv $@.tmp $@
@printf " CBFSPRINT $(subst $(obj)/,,$(@))\n\n"
$(CBFSTOOL) $@ print
Modified: trunk/src/cpu/amd/model_gx2/Kconfig
==============================================================================
--- trunk/src/cpu/amd/model_gx2/Kconfig Tue Apr 20 20:22:20 2010 (r5466)
+++ trunk/src/cpu/amd/model_gx2/Kconfig Tue Apr 20 20:35:33 2010 (r5467)
@@ -30,3 +30,21 @@
default 0x01000
depends on CPU_AMD_GX2
+config GEODE_VSA
+ bool "Add a VSA image"
+ depends on CPU_AMD_GX2
+ help
+ Select this option if you have an AMD Geode GX2 vsa that you would
+ like to add to your ROM.
+
+ You will be able to specify the location and file name of the
+ image later.
+
+config VSA_FILE
+ string "AMD Geode GX2 VSA path and filename"
+ depends on GEODE_VSA
+ default "gpl_vsa_gx_102.bin"
+ help
+ The path and filename of the file to use as VSA.
+
+
Modified: trunk/src/cpu/amd/model_lx/Kconfig
==============================================================================
--- trunk/src/cpu/amd/model_lx/Kconfig Tue Apr 20 20:22:20 2010 (r5466)
+++ trunk/src/cpu/amd/model_lx/Kconfig Tue Apr 20 20:35:33 2010 (r5467)
@@ -11,3 +11,21 @@
default 0x8000
depends on CPU_AMD_LX
+config GEODE_VSA
+ bool "Add a VSA image"
+ depends on CPU_AMD_LX
+ help
+ Select this option if you have an AMD Geode LX vsa that you would
+ like to add to your ROM.
+
+ You will be able to specify the location and file name of the
+ image later.
+
+config VSA_FILE
+ string "AMD Geode LX VSA path and filename"
+ depends on GEODE_VSA
+ default "gpl_vsa_lx_102.bin"
+ help
+ The path and filename of the file to use as VSA.
+
+
Author: stepan
Date: Tue Apr 20 19:34:16 2010
New Revision: 128
URL: http://tracker.coreboot.org/trac/filo/changeset/128
Log:
enable easy compilation with xcompile for filo
Signed-off-by: Stefan Reinauer <stepan(a)coresystems.de>
Acked-by: Stefan Reinauer <stepan(a)coresystems.de>
Added:
trunk/filo/util/xcompile/
trunk/filo/util/xcompile/xcompile
Modified:
trunk/filo/Makefile
Modified: trunk/filo/Makefile
==============================================================================
--- trunk/filo/Makefile Tue Apr 20 19:32:01 2010 (r127)
+++ trunk/filo/Makefile Tue Apr 20 19:34:16 2010 (r128)
@@ -41,12 +41,15 @@
Q := @
endif
+$(if $(wildcard .xcompile),,$(eval $(shell bash util/xcompile/xcompile > .xcompile)))
+include .xcompile
+
CROSS_PREFIX =
-CC = $(CROSS_PREFIX)gcc -m32
-AS = $(CROSS_PREFIX)as --32
-LD = $(CROSS_PREFIX)ld -belf32-i386
-STRIP = $(CROSS_PREFIX)strip
-NM = $(CROSS_PREFIX)nm
+CC ?= $(CROSS_PREFIX)gcc -m32
+AS ?= $(CROSS_PREFIX)as --32
+LD ?= $(CROSS_PREFIX)ld -belf32-i386
+STRIP ?= $(CROSS_PREFIX)strip
+NM ?= $(CROSS_PREFIX)nm
HOSTCC = gcc
HOSTCXX = g++
HOSTCFLAGS := -I$(srck) -I$(objk) -pipe
Added: trunk/filo/util/xcompile/xcompile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/filo/util/xcompile/xcompile Tue Apr 20 19:34:16 2010 (r128)
@@ -0,0 +1,103 @@
+#!/bin/sh
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2007-2010 coresystems GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+testcc()
+{
+ echo "_start(void) {}" > .$$$$.c
+ $1 -nostdlib $2 .$$$$.c -o .$$$$.tmp 2>/dev/null >/dev/null
+ ret=$?
+ rm -f .$$$$.c .$$$$.tmp
+ return $ret
+}
+
+for make in make gmake gnumake; do
+ if [ "`$make --version 2>/dev/null | grep -c GNU`" -gt 0 ]; then
+ MAKE=$make
+ break
+ fi
+done
+
+GCCPREFIX=invalid
+TMPFILE=`mktemp /tmp/temp.XXXX 2>/dev/null || echo /tmp/temp.78gOIUGz`
+touch $TMPFILE
+
+# This should be a loop over all supported architectures
+TARCH=i386
+TWIDTH=32
+for gccprefixes in `pwd`/util/crossgcc/xgcc/bin/${TARCH}-elf- ${TARCH}-elf- ""; do
+ if ! which ${gccprefixes}as 2>/dev/null >/dev/null; then
+ continue
+ fi
+ rm -f ${TMPFILE}.o
+ if ${gccprefixes}as -o ${TMPFILE}.o ${TMPFILE}; then
+ TYPE=`${gccprefixes}objdump -p ${TMPFILE}.o`
+ if [ ${TYPE##* } == "elf${TWIDTH}-${TARCH}" ]; then
+ GCCPREFIX=$gccprefixes
+ ASFLAGS=
+ CFLAGS=
+ LDFLAGS=
+ break
+ fi
+ fi
+ if ${gccprefixes}as --32 -o ${TMPFILE}.o ${TMPFILE}; then
+ TYPE=`${gccprefixes}objdump -p ${TMPFILE}.o`
+ if [ ${TYPE##* } == "elf${TWIDTH}-${TARCH}" ]; then
+ GCCPREFIX=$gccprefixes
+ ASFLAGS=--32
+ CFLAGS="-m32 "
+ LDFLAGS="-b elf32-i386"
+ break
+ fi
+ fi
+done
+rm -f $TMPFILE ${TMPFILE}.o
+
+if [ "$GCCPREFIX" = "invalid" ]; then
+ echo '$(error no suitable gcc found)'
+ exit 1
+fi
+
+CC="${GCCPREFIX}gcc"
+testcc "$CC" "$CFLAGS-Wa,--divide " && CFLAGS="$CFLAGS-Wa,--divide "
+testcc "$CC" "$CFLAGS-fno-stack-protector " && CFLAGS="$CFLAGS-fno-stack-protector "
+testcc "$CC" "$CFLAGS-Wl,--build-id=none " && CFLAGS="$CFLAGS-Wl,--build-id=none "
+
+if which gcc 2>/dev/null >/dev/null; then
+ HOSTCC=gcc
+else
+ HOSTCC=cc
+fi
+
+cat << EOF
+# elf${TWIDTH}-${TARCH} toolchain
+AS:=${GCCPREFIX}as ${ASFLAGS}
+CC:=${GCCPREFIX}gcc ${CFLAGS}
+CPP:=${GCCPREFIX}cpp
+AR:=${GCCPREFIX}ar
+LD:=${GCCPREFIX}ld ${LDFLAGS}
+STRIP:=${GCCPREFIX}strip
+NM:=${GCCPREFIX}nm
+OBJCOPY:=${GCCPREFIX}objcopy
+OBJDUMP:=${GCCPREFIX}objdump
+
+# native toolchain
+HOSTCC:=${HOSTCC}
+EOF
+
Author: stepan
Date: Tue Apr 20 19:19:20 2010
New Revision: 5465
URL: https://tracker.coreboot.org/trac/coreboot/changeset/5465
Log:
Allow easy libpayload compilation using xcompile.
Signed-off-by: Stefan Reinauer <stepan(a)coresystems.de>
Acked-by: Stefan Reinauer <stepan(a)coresystems.de>
Added:
trunk/payloads/libpayload/util/xcompile/
trunk/payloads/libpayload/util/xcompile/xcompile
Modified:
trunk/payloads/libpayload/Makefile
Modified: trunk/payloads/libpayload/Makefile
==============================================================================
--- trunk/payloads/libpayload/Makefile Tue Apr 20 18:20:48 2010 (r5464)
+++ trunk/payloads/libpayload/Makefile Tue Apr 20 19:19:20 2010 (r5465)
@@ -49,7 +49,10 @@
Q := @
endif
-CC = gcc
+$(if $(wildcard .xcompile),,$(eval $(shell bash util/xcompile/xcompile > .xcompile)))
+include .xcompile
+
+CC ?= gcc
HOSTCC = gcc
HOSTCXX = g++
HOSTCFLAGS := -I$(srck) -I$(objk) -pipe
Added: trunk/payloads/libpayload/util/xcompile/xcompile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/payloads/libpayload/util/xcompile/xcompile Tue Apr 20 19:19:20 2010 (r5465)
@@ -0,0 +1,103 @@
+#!/bin/sh
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2007-2010 coresystems GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+testcc()
+{
+ echo "_start(void) {}" > .$$$$.c
+ $1 -nostdlib $2 .$$$$.c -o .$$$$.tmp 2>/dev/null >/dev/null
+ ret=$?
+ rm -f .$$$$.c .$$$$.tmp
+ return $ret
+}
+
+for make in make gmake gnumake; do
+ if [ "`$make --version 2>/dev/null | grep -c GNU`" -gt 0 ]; then
+ MAKE=$make
+ break
+ fi
+done
+
+GCCPREFIX=invalid
+TMPFILE=`mktemp /tmp/temp.XXXX 2>/dev/null || echo /tmp/temp.78gOIUGz`
+touch $TMPFILE
+
+# This should be a loop over all supported architectures
+TARCH=i386
+TWIDTH=32
+for gccprefixes in `pwd`/util/crossgcc/xgcc/bin/${TARCH}-elf- ${TARCH}-elf- ""; do
+ if ! which ${gccprefixes}as 2>/dev/null >/dev/null; then
+ continue
+ fi
+ rm -f ${TMPFILE}.o
+ if ${gccprefixes}as -o ${TMPFILE}.o ${TMPFILE}; then
+ TYPE=`${gccprefixes}objdump -p ${TMPFILE}.o`
+ if [ ${TYPE##* } == "elf${TWIDTH}-${TARCH}" ]; then
+ GCCPREFIX=$gccprefixes
+ ASFLAGS=
+ CFLAGS=
+ LDFLAGS=
+ break
+ fi
+ fi
+ if ${gccprefixes}as --32 -o ${TMPFILE}.o ${TMPFILE}; then
+ TYPE=`${gccprefixes}objdump -p ${TMPFILE}.o`
+ if [ ${TYPE##* } == "elf${TWIDTH}-${TARCH}" ]; then
+ GCCPREFIX=$gccprefixes
+ ASFLAGS=--32
+ CFLAGS="-m32 "
+ LDFLAGS="-b elf32-i386"
+ break
+ fi
+ fi
+done
+rm -f $TMPFILE ${TMPFILE}.o
+
+if [ "$GCCPREFIX" = "invalid" ]; then
+ echo '$(error no suitable gcc found)'
+ exit 1
+fi
+
+CC="${GCCPREFIX}gcc"
+testcc "$CC" "$CFLAGS-Wa,--divide " && CFLAGS="$CFLAGS-Wa,--divide "
+testcc "$CC" "$CFLAGS-fno-stack-protector " && CFLAGS="$CFLAGS-fno-stack-protector "
+testcc "$CC" "$CFLAGS-Wl,--build-id=none " && CFLAGS="$CFLAGS-Wl,--build-id=none "
+
+if which gcc 2>/dev/null >/dev/null; then
+ HOSTCC=gcc
+else
+ HOSTCC=cc
+fi
+
+cat << EOF
+# elf${TWIDTH}-${TARCH} toolchain
+AS:=${GCCPREFIX}as ${ASFLAGS}
+CC:=${GCCPREFIX}gcc ${CFLAGS}
+CPP:=${GCCPREFIX}cpp
+AR:=${GCCPREFIX}ar
+LD:=${GCCPREFIX}ld ${LDFLAGS}
+STRIP:=${GCCPREFIX}strip
+NM:=${GCCPREFIX}nm
+OBJCOPY:=${GCCPREFIX}objcopy
+OBJDUMP:=${GCCPREFIX}objdump
+
+# native toolchain
+HOSTCC:=${HOSTCC}
+EOF
+