Add OpenVSA as an option for Geode platform rather the AMD 
or "classic" VSA. 

Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Index: buildrom-devel/packages/geodevsa/geodevsa.mk
===================================================================
--- buildrom-devel.orig/packages/geodevsa/geodevsa.mk	2008-02-20 16:10:05.000000000 -0700
+++ buildrom-devel/packages/geodevsa/geodevsa.mk	2008-02-20 16:12:15.000000000 -0700
@@ -12,7 +12,17 @@
 VSA_BUILD_TARGET = $(GEODE_UNCOMPRESSED_VSA)
 endif
 
+VSA_CLEAN_TARGET=
+VSA_DISTCLEAN_TARGET=
+
+ifeq ($(CONFIG_VSA_LEGACY),y)
 include $(PACKAGE_DIR)/geodevsa/amdvsa.inc
+else
+include $(PACKAGE_DIR)/geodevsa/openvsa.inc
+
+VSA_CLEAN_TARGET=openvsa-clean
+VSA_DISTCLEAN_TARGET=openvsa-distclean
+endif
 
 $(GEODE_COMPRESSED_VSA): $(GEODE_UNCOMPRESSED_VSA)
 	@ $(STAGING_DIR)/bin/nrv2b e $(GEODE_UNCOMPRESSED_VSA) $@ \
@@ -25,9 +35,9 @@
 
 geodevsa: $(VSA_BUILD_TARGET)
 
-geodevsa-clean:
+geodevsa-clean: $(VSA_CLEAN_TARGET)
 	@ rm -f $(GEODE_UNCOMPRESSED_VSA) $(GEODE_COMPRESSED_VSA)
 	@ rm -f $(GEODE_PADDED_VSA)
 
-geodevsa-distclean:
+geodevsa-distclean: $(VSA_DISTCLEAN_TARGET)
 	@ rm -rf $(OUTPUT_DIR)/vsa
Index: buildrom-devel/packages/geodevsa/openvsa.inc
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ buildrom-devel/packages/geodevsa/openvsa.inc	2008-02-20 16:12:15.000000000 -0700
@@ -0,0 +1,53 @@
+# Build target for openVSA - included from geodevsa.mk
+
+OPENVSA_URL=svn://openbios.org/openvsa/trunk/openvsa
+OPENVSA_TAG=6
+
+OPENVSA_DIR=$(BUILD_DIR)/openvsa
+OPENVSA_SRC_DIR=$(OPENVSA_DIR)/svn
+OPENVSA_STAMP_DIR=$(OPENVSA_DIR)/stamps
+OPENVSA_LOG_DIR=$(OPENVSA_DIR)/logs
+OPENVSA_TARBALL=openvsa-svn-$(OPENVSA_TAG).tar.gz
+
+ifeq ($(CONFIG_VERBOSE),y)
+OPENVSA_BUILD_LOG=/dev/stdout
+OPENVSA_FETCH_LOG=/dev/stdout
+else
+OPENVSA_BUILD_LOG=$(OPENVSA_LOG_DIR)/build.log
+OPENVSA_FETCH_LOG=$(OPENVSA_LOG_DIR)/fetch.log
+endif
+
+$(SOURCE_DIR)/$(OPENVSA_TARBALL):
+	@ mkdir -p $(SOURCE_DIR)/openvsa
+	@ mkdir -p $(OPENVSA_LOG_DIR)
+	@ echo "Fetching openvsa..."
+	@ $(BIN_DIR)/fetchsvn.sh $(OPENVSA_URL) $(SOURCE_DIR)/openvsa \
+	$(OPENVSA_TAG) $@ > $(OPENVSA_FETCH_LOG) 2>&1
+
+$(OPENVSA_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(OPENVSA_TARBALL)
+	@ mkdir -p $(OPENVSA_DIR)
+	@ tar -C $(OPENVSA_DIR) -zxf $(SOURCE_DIR)/$(OPENVSA_TARBALL)
+	@ mkdir -p $(OPENVSA_STAMP_DIR)
+	@ touch $@
+
+$(OPENVSA_SRC_DIR)/vsa_lx.bin: $(OPENVSA_STAMP_DIR)/.unpacked
+	@ mkdir -p $(OPENVSA_LOG_DIR)
+	@ echo "Building openvsa..."
+	@(unset LDFLAGS; $(MAKE) -C $(OPENVSA_SRC_DIR) \
+	> $(OPENVSA_BUILD_LOG) 2>&1)
+
+$(GEODE_UNCOMPRESSED_VSA): $(OPENVSA_SRC_DIR)/vsa_lx.bin
+	@ mkdir -p $(shell dirname $(GEODE_UNCOMPRESSED_VSA))
+	@ cp $< $@
+
+openvsa: $(OPENVSA_SRC_DIR)/vsa_lx.bin
+
+openvsa-clean:
+	@ if [ -d $(OPENVSA_SRC_DIR) ]; then \
+	echo "Cleaning openvsa..."; \
+	$(MAKE) -C $(OPENVSA_SRC_DIR) clean > /dev/null 2>&1; \
+	fi
+
+openvsa-distclean:
+	@ rm -rf $(OPENVSA_DIR)
+
Index: buildrom-devel/config/platforms/Config.in
===================================================================
--- buildrom-devel.orig/config/platforms/Config.in	2008-02-20 16:11:52.000000000 -0700
+++ buildrom-devel/config/platforms/Config.in	2008-02-20 16:12:34.000000000 -0700
@@ -125,6 +125,23 @@
 	select PLATFORM_SUPPORT_64BIT
 endchoice
 
+choice
+	prompt "Geode VSA SMM handler"
+	depends PLATFORM_GEODE
+	default VSA_LEGACY
+	help
+	  Select the SMM handler source to use with Geode platforms
+
+config VSA_LEGACY
+	bool "Legacy VSA binary from AMD"
+
+config VSA_OPENVSA
+	bool "OpenVSA"
+	depends EXPERIMENTAL
+
+endchoice
+
+
 config BUILD_QEMU
 	bool "Build QEMU with patches for LinuxBIOS"
 	depends PLATFORM_QEMU-X86

-- 
Jordan Crouse
Systems Software Development Engineer 
Advanced Micro Devices, Inc.




