summaryrefslogtreecommitdiff
path: root/BeagleBoardPkg/build.sh
diff options
context:
space:
mode:
authorAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-06 01:57:05 +0000
committerAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-06 01:57:05 +0000
commit2ef2b01e07c02db339f34004445734a2dbdd80e1 (patch)
tree19532a6be8d8bdb0aef04bd00c1efb582f6dc841 /BeagleBoardPkg/build.sh
parentf7753a96ba1653ddd31b01c198a352f6332ac404 (diff)
downloadedk2-2ef2b01e07c02db339f34004445734a2dbdd80e1.tar.gz
Adding support for BeagleBoard.
ArmPkg - Supoprt for ARM specific things that can change as the architecture changes. Plus semihosting JTAG drivers. EmbeddedPkg - Generic support for an embeddded platform. Including a light weight command line shell. BeagleBoardPkg - Platform specifics for BeagleBoard. SD Card works, but USB has issues. Looks like a bug in the open source USB stack (Our internal stack works fine). git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9518 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BeagleBoardPkg/build.sh')
-rwxr-xr-xBeagleBoardPkg/build.sh127
1 files changed, 127 insertions, 0 deletions
diff --git a/BeagleBoardPkg/build.sh b/BeagleBoardPkg/build.sh
new file mode 100755
index 000000000..94cabbe62
--- /dev/null
+++ b/BeagleBoardPkg/build.sh
@@ -0,0 +1,127 @@
+#!/bin/bash
+# Copyright (c) 2008 - 2009, Apple, Inc. All rights reserved.
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+
+set -e
+shopt -s nocasematch
+
+function process_debug_scripts {
+ if [[ -d $1 ]]; then
+ for filename in `ls $1`
+ do
+ sed -e "s@ZZZZZZ@$BUILD_ROOT@g" -e "s@WWWWWW@$WORKSPACE@g" \
+ "$1/$filename" \
+ > "$BUILD_ROOT/$filename"
+
+ #For ARMCYGWIN, we have to change /cygdrive/c to c:
+ if [[ $TARGET_TOOLS == RVCT31CYGWIN ]]
+ then
+ mv "$BUILD_ROOT/$filename" "$BUILD_ROOT/$filename"_temp
+ sed -e "s@/cygdrive/\(.\)@\1:@g" \
+ "$BUILD_ROOT/$filename"_temp \
+ > "$BUILD_ROOT/$filename"
+ rm -f "$BUILD_ROOT/$filename"_temp
+ fi
+ done
+ fi
+}
+
+
+#
+# Setup workspace if it is not set
+#
+if [ -z "$WORKSPACE" ]
+then
+ echo Initializing workspace
+ cd ..
+ export EDK_TOOLS_PATH=`pwd`/BaseTools
+ source edksetup.sh BaseTools
+else
+ echo Building from: $WORKSPACE
+fi
+
+#
+# Pick a default tool type for a given OS
+#
+case `uname` in
+ CYGWIN*)
+ TARGET_TOOLS=RVCT31CYGWIN
+ ;;
+ Linux*)
+ # Not tested
+ TARGET_TOOLS=ELFGCC
+ ;;
+ Darwin*)
+ Major=$(uname -r | cut -f 1 -d '.')
+ if [[ $Major == 9 ]]
+ then
+ # Not supported by this open source project
+ TARGET_TOOLS=XCODE31
+ else
+ TARGET_TOOLS=XCODE32
+ fi
+ ;;
+esac
+
+BUILD_ROOT=$WORKSPACE/Build/BeagleBoard/DEBUG_"$TARGET_TOOLS"
+GENERATE_IMAGE=$WORKSPACE/BeagleBoardPkg/Tools/generate_image
+FLASH_BOOT=$BUILD_ROOT/FV/BeagleBoard_EFI_flashboot.fd
+
+if [[ ! -f `which build` || ! -f `which GenFv` ]];
+then
+ # build the tools if they don't yet exist
+ echo Building tools
+ make -C $WORKSPACE/BaseTools
+else
+ echo using prebuilt tools
+fi
+
+#
+# Build the edk2 BeagleBoard code
+#
+build -p $WORKSPACE/BeagleBoardPkg/BeagleBoardPkg.dsc -a ARM -t $TARGET_TOOLS $1 $2 $3 $4 $5 $6 $7 $8
+
+for arg in "$@"
+do
+ if [[ $arg == clean ]]; then
+ # no need to post process if we are doing a clean
+ exit
+ elif [[ $arg == cleanall ]]; then
+ make -C BaseTools/ clean
+ make -C $WORKSPACE/BeagleBoardPkg/Tools clean
+ exit
+
+ fi
+done
+
+
+#
+# Build the tool used to patch the FLASH image to work with the Beagle board ROM
+#
+if [[ ! -e $GENERATE_IMAGE ]];
+then
+ make -C $WORKSPACE/BeagleBoardPkg/Tools
+fi
+
+echo Patching FD to work with BeagleBoard ROM
+rm -f $FLASH_BOOT
+
+#
+# Ram starts at 0x80000000
+# OMAP 3530 TRM defines 0x80008208 as the entry point
+# The reset vector is caught by the mask ROM in the OMAP 3530 so that is why this entry
+# point looks so strange.
+# OMAP 3430 TRM section 26.4.8 has Image header information. (missing in OMAP 3530 TRM)
+#
+$GENERATE_IMAGE -D $WORKSPACE/BeagleBoardPkg/ConfigurationHeader.dat -E 0x80008208 -I $BUILD_ROOT/FV/BEAGLEBOARD_EFI.fd -O $FLASH_BOOT
+
+echo Creating debugger scripts
+process_debug_scripts $WORKSPACE/BeagleBoardPkg/Debugger_scripts
+