build.sh: add --uart
authorBigfootACA <bigfoot@classfun.cn>
星期一, 7 Feb 2022 14:08:37 +0000 (22:08 +0800)
committerBigfootACA <bigfoot@classfun.cn>
星期三, 9 Feb 2022 18:33:11 +0000 (02:33 +0800)
build.sh
sdm845Pkg/sdm845Pkg.dsc

index 9cdd382e34602f7e3ffe8b049026e2c4a31e22a2..1d71de72690a6013bb0df417a147afa3b0f4ef97 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -41,6 +41,7 @@ function _help(){
        echo "  --chinese, -c:           use github.com.cnpmjs.org for submodule cloning."
        echo "  --release MODE, -r MODE: Release mode for building, default is 'RELEASE', 'DEBUG' alternatively."
        echo "  --toolchain TOOLCHAIN:   Set toolchain, default is 'GCC5'."
+       echo "  --uart, -u:              compile with UART support, print debug messages to uart debug port."
        echo "  --acpi, -A:              compile DSDT using MS asl with wine"
        echo "  --clean, -C:             clean workspace and output."
        echo "  --distclean, -D:         clean up all files that are not in repo."
@@ -77,6 +78,7 @@ function _build(){
                -p "sdm845Pkg/Devices/${DEVICE}.dsc" \
                -b "${_MODE}" \
                -D FIRMWARE_VER="${GITCOMMIT}" \
+               -D USE_UART="${USE_UART}" \
                ||return "$?"
        gzip -c \
                < "workspace/Build/sdm845Pkg/${_MODE}_${TOOLCHAIN}/FV/SDM845PKG_UEFI.fd" \
@@ -110,9 +112,10 @@ CHINESE=false
 CLEAN=false
 DISTCLEAN=false
 TOOLCHAIN=GCC5
+USE_UART=0
 export OUTDIR="${PWD}"
 export GEN_ACPI=false
-OPTS="$(getopt -o t:d:hacACDO:r: -l toolchain:,device:,help,all,chinese,acpi,clean,distclean,outputdir:,release: -n 'build.sh' -- "$@")"||exit 1
+OPTS="$(getopt -o t:d:hacACDO:r:u -l toolchain:,device:,help,all,chinese,acpi,uart,clean,distclean,outputdir:,release: -n 'build.sh' -- "$@")"||exit 1
 eval set -- "${OPTS}"
 while true
 do     case "${1}" in
@@ -125,6 +128,7 @@ do  case "${1}" in
                -O|--outputdir)OUTDIR="${2}";shift 2;;
                -r|--release)MODE="${2}";shift 2;;
                -t|--toolchain)TOOLCHAIN="${2}";shift 2;;
+               -u|--uart)USE_UART=1;shift;;
                -h|--help)_help 0;shift;;
                --)shift;break;;
                *)_help 1;;
index dfb2316d632d34fe2369f58b8e97e557a472e152..2150c150c7ce3c103fe50d612fbcf0012f9e2d97 100644 (file)
   DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
   BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
 
-!if $(TARGET) != RELEASE
+!if $(USE_UART) == 1
   SerialPortLib|sdm845Pkg/Library/QcomGeniSerialPortLib/QcomGeniSerialPortLib.inf
 !else
-  SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
+  SerialPortLib|sdm845Pkg/Library/FrameBufferSerialPortLib/FrameBufferSerialPortLib.inf
 !endif
 
   RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf
@@ -61,7 +61,7 @@
   #
   # Secure Boot dependencies
   #
-  
+
   # Cryptographic libraries
   RngLib|MdePkg/Library/DxeRngLib/DxeRngLib.inf
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
   # Make VariableRuntimeDxe work at emulated non-volatile variable mode.
   #
   gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE
-  
+
   gsdm845PkgTokenSpaceGuid.PcdMipiFrameBufferAddress|0x9d400000
 
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
   MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
   MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
   MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
-  
-!if $(TARGET) != RELEASE  
+
+!if $(TARGET) != RELEASE
   MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
 !endif
 
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
-  
+
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf