Remove U-Boot build support from beagle_x15

This reverts commit 848da4f1318cc12619512f4e66c6b281155c5f8a.

Bug: 147296060
Change-Id: I57912cb7d1a9aebecd27a61f9d3d1394994fb094
diff --git a/AndroidBoard.mk b/AndroidBoard.mk
deleted file mode 100644
index 03d3c7a..0000000
--- a/AndroidBoard.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright 2018 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-include device/ti/beagle_x15/uboot.mk
diff --git a/BoardConfig.mk b/BoardConfig.mk
index ba5bd05..181d2b6 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -79,14 +79,6 @@
 
 BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
 
-# U-Boot configuration.
-TARGET_UBOOT_ARCH := $(TARGET_ARCH)
-TARGET_UBOOT_SRC := external/u-boot
-TARGET_UBOOT_DEFCONFIG := am57xx_evm_defconfig
-TARGET_UBOOT_CONFIGS += device/ti/beagle_x15/beagle_x15_uboot.conf
-TARGET_UBOOT_MAKE_TARGET := u-boot-img.bin
-TARGET_UBOOT_COPY_TARGETS := u-boot.img MLO
-
 # Copy kernel modules (including pvrsrvkm.ko) into /vendor/lib/modules
 BOARD_ALL_MODULES := $(shell find $(LOCAL_KERNEL_HOME) -type f -iname '*.ko')
 BOARD_VENDOR_KERNEL_MODULES += $(BOARD_ALL_MODULES)
diff --git a/beagle_x15_uboot.conf b/beagle_x15_uboot.conf
deleted file mode 100644
index 29138b1..0000000
--- a/beagle_x15_uboot.conf
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open-Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Put options here which are needed for a particular configuration of
-# Android but which might not be suitable to upstream
-
-# Override the 'recommended.config' back, otherwise U-Boot fails to link
-CONFIG_NET=y
diff --git a/hostcc/ar b/hostcc/ar
deleted file mode 120000
index c68f23f..0000000
--- a/hostcc/ar
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/bin/x86_64-linux-ar
\ No newline at end of file
diff --git a/hostcc/bison b/hostcc/bison
deleted file mode 120000
index 08c2205..0000000
--- a/hostcc/bison
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/bison
\ No newline at end of file
diff --git a/hostcc/cc b/hostcc/cc
deleted file mode 120000
index 201b6f9..0000000
--- a/hostcc/cc
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/clang/host/linux-x86/clang-r370808/bin/clang.real
\ No newline at end of file
diff --git a/hostcc/flex b/hostcc/flex
deleted file mode 120000
index 7c4992c..0000000
--- a/hostcc/flex
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/build-tools/linux-x86/bin/flex
\ No newline at end of file
diff --git a/hostcc/ld b/hostcc/ld
deleted file mode 120000
index d306630..0000000
--- a/hostcc/ld
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/bin/x86_64-linux-ld
\ No newline at end of file
diff --git a/hostcc/ld.bfd b/hostcc/ld.bfd
deleted file mode 120000
index 6998a55..0000000
--- a/hostcc/ld.bfd
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/bin/x86_64-linux-ld.bfd
\ No newline at end of file
diff --git a/hostcc/strings b/hostcc/strings
deleted file mode 120000
index 49cf48b..0000000
--- a/hostcc/strings
+++ /dev/null
@@ -1 +0,0 @@
-../../../../prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/bin/x86_64-linux-strings
\ No newline at end of file
diff --git a/mergeconfig.sh b/mergeconfig.sh
deleted file mode 100755
index 70f0d1f..0000000
--- a/mergeconfig.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/bash
-
-#
-# Copyright 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-args=( "$@" )
-confs=( )
-
-KERNEL_PATH=${args[0]}
-OUTPUT=${args[1]}
-TARGET_ARCH=${args[2]}
-TARGET_CROSS_COMPILE=${args[3]}
-
-unset "args[0]"
-unset "args[1]"
-unset "args[2]"
-unset "args[3]"
-
-curdir=$(pwd)
-
-# Explicitly record the list of config files used to build .config, and
-# canonicalize the path since we have to have our current directory in
-# the kernel source tree.
-for conf in ${args[*]} ; do
-	fullpath=$conf
-	if [ ${fullpath:0:1} != "/" ] ; then
-		fullpath=$curdir/$fullpath
-	fi
-	confs+=($fullpath)
-	echo $conf
-done > $OUTPUT/config.list
-
-cd $KERNEL_PATH
-
-ARCH=$TARGET_ARCH CROSS_COMPILE=$TARGET_CROSS_COMPILE ./scripts/kconfig/merge_config.sh -O $OUTPUT ${confs[*]} > $OUTPUT/merge_config.log
diff --git a/uboot.mk b/uboot.mk
deleted file mode 100644
index 1a2d3d3..0000000
--- a/uboot.mk
+++ /dev/null
@@ -1,173 +0,0 @@
-#
-# Copyright 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Targets for building U-Boot
-#
-# The following must be set before including this file:
-# TARGET_UBOOT_SRC must be set the base of a U-Boot tree.
-# TARGET_UBOOT_DEFCONFIG must name a base U-Boot config.
-# TARGET_UBOOT_ARCH must be set to match U-Boot arch.
-#
-# The following may be set:
-# TARGET_UBOOT_CROSS_COMPILE_PREFIX to override toolchain.
-# TARGET_UBOOT_CONFIGS to specify a set of additional U-Boot config files.
-# TARGET_UBOOT_ENV to specify an environment to be compiled into uboot.env.
-# TARGET_UBOOT_ENV_SIZE to specify the size reserved in U-Boot for the env.
-
-ifeq ($(TARGET_UBOOT_SRC),)
-$(error TARGET_UBOOT_SRC not defined but uboot.mk included)
-endif
-
-ifeq ($(TARGET_UBOOT_DEFCONFIG),)
-$(error TARGET_UBOOT_DEFCONFIG not defined)
-endif
-
-ifeq ($(TARGET_UBOOT_ARCH),)
-$(error TARGET_UBOOT_ARCH not defined)
-endif
-
-ifeq ($(TARGET_UBOOT_ENV_SIZE),)
-ifneq ($(TARGET_UBOOT_ENV),)
-$(error If TARGET_UBOOT_ENV is set TARGET_UBOOT_ENV_SIZE must also be set. See\
- CONFIG_ENV_SIZE in the selected U-Boot board config file.)
-endif
-endif
-
-# These may be assigned in target BoardConfig.mk.
-TARGET_UBOOT_MAKE_TARGET ?= u-boot.bin
-TARGET_UBOOT_COPY_TARGETS ?= $(TARGET_UBOOT_MAKE_TARGET)
-
-# Check target arch.
-TARGET_UBOOT_ARCH := $(strip $(TARGET_UBOOT_ARCH))
-UBOOT_ARCH := $(TARGET_UBOOT_ARCH)
-UBOOT_CC_WRAPPER := $(CC_WRAPPER)
-UBOOT_AFLAGS :=
-
-ifeq ($(TARGET_UBOOT_ARCH), arm)
-UBOOT_TOOLCHAIN_ABS := $(realpath prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.9/bin)
-UBOOT_CROSS_COMPILE := $(UBOOT_TOOLCHAIN_ABS)/arm-linux-androidkernel-
-UBOOT_SRC_ARCH := arm
-UBOOT_CFLAGS :=
-else ifeq ($(TARGET_UBOOT_ARCH), arm64)
-UBOOT_TOOLCHAIN_ABS := $(realpath prebuilts/gcc/$(HOST_PREBUILT_TAG)/aarch64/aarch64-linux-android-4.9/bin)
-UBOOT_CROSS_COMPILE := $(UBOOT_TOOLCHAIN_ABS)/aarch64-linux-androidkernel-
-UBOOT_SRC_ARCH := arm64
-UBOOT_CFLAGS :=
-else ifeq ($(TARGET_UBOOT_ARCH), i386)
-UBOOT_TOOLCHAIN_ABS := $(realpath prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/x86_64-linux-android-4.9/bin)
-UBOOT_CROSS_COMPILE := $(UBOOT_TOOLCHAIN_ABS)/x86_64-linux-androidkernel-
-UBOOT_SRC_ARCH := x86
-UBOOT_CFLAGS := -mstack-protector-guard=tls
-else ifeq ($(TARGET_UBOOT_ARCH), x86_64)
-UBOOT_TOOLCHAIN_ABS := $(realpath prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/x86_64-linux-android-4.9/bin)
-UBOOT_CROSS_COMPILE := $(UBOOT_TOOLCHAIN_ABS)/x86_64-linux-androidkernel-
-UBOOT_SRC_ARCH := x86
-UBOOT_CFLAGS := -mstack-protector-guard=tls
-else ifeq ($(TARGET_UBOOT_ARCH), mips)
-UBOOT_TOOLCHAIN_ABS := $(realpath prebuilts/gcc/$(HOST_PREBUILT_TAG)/mips/mips64el-linux-android-4.9/bin)
-UBOOT_CROSS_COMPILE := $(UBOOT_TOOLCHAIN_ABS)/mips64el-linux-androidkernel-
-UBOOT_SRC_ARCH := mips
-UBOOT_CFLAGS :=
-else
-$(error U-Boot arch not supported at present)
-endif
-
-# Allow caller to override toolchain.
-TARGET_UBOOT_CROSS_COMPILE_PREFIX := $(strip $(TARGET_UBOOT_CROSS_COMPILE_PREFIX))
-ifneq ($(TARGET_UBOOT_CROSS_COMPILE_PREFIX),)
-UBOOT_CROSS_COMPILE := $(TARGET_UBOOT_CROSS_COMPILE_PREFIX)
-endif
-
-# Use ccache if requested by USE_CCACHE variable
-UBOOT_CROSS_COMPILE_WRAPPER := $(realpath $(UBOOT_CC_WRAPPER)) $(UBOOT_CROSS_COMPILE)
-
-UBOOT_GCC_NOANDROID_CHK := $(shell (echo "int main() {return 0;}" | $(UBOOT_CROSS_COMPILE)gcc -E -mno-android - > /dev/null 2>&1 ; echo $$?))
-ifeq ($(strip $(UBOOT_GCC_NOANDROID_CHK)),0)
-UBOOT_CFLAGS += -mno-android
-UBOOT_AFLAGS += -mno-android
-endif
-
-# Set the output for the U-Boot build products.
-UBOOT_OUT := $(TARGET_OUT_INTERMEDIATES)/UBOOT_OBJ
-UBOOT_ENV_OUT := $(PRODUCT_OUT)/uboot.env
-
-# Merge all U-Boot config file sources.
-UBOOT_CONFIG_DIR := device/ti/beagle_x15/uboot_config
-UBOOT_CONFIG_DEFAULT := $(TARGET_UBOOT_SRC)/configs/$(TARGET_UBOOT_DEFCONFIG)
-UBOOT_CONFIG_RECOMMENDED := $(UBOOT_CONFIG_DIR)/recommended.config
-UBOOT_CONFIG_REQUIRED_SRC := $(UBOOT_CONFIG_DIR)/common.config
-UBOOT_CONFIG_REQUIRED := $(UBOOT_OUT)/.config.required
-UBOOT_CONFIG_SRC := $(UBOOT_CONFIG_DEFAULT) \
-  $(UBOOT_CONFIG_RECOMMENDED) \
-  $(TARGET_UBOOT_CONFIGS) \
-  $(UBOOT_CONFIG_REQUIRED)
-UBOOT_CONFIG := $(UBOOT_OUT)/.config
-UBOOT_MERGE_CONFIG := device/ti/beagle_x15/mergeconfig.sh
-# List of all the Kconfig files from the source code. Changing the Kconfig files
-# requires to reassemble the .config, so we add them as dependencies.
-UBOOT_SRC_KCONFIGS := \
-  $(call find-files-in-subdirs,.,Kconfig,$(TARGET_UBOOT_SRC))
-
-$(UBOOT_OUT):
-	mkdir -p $@
-
-define build_uboot
-	# We don't support bundling a device tree with U-Boot yet.
-	CCACHE_NODIRECT="true" PATH=$$(cd device/ti/beagle_x15/hostcc; pwd):$$PATH \
-		BISON_PKGDATADIR=$$(cd prebuilts/build-tools/common/bison; pwd) \
-		$(MAKE) -C $(TARGET_UBOOT_SRC) \
-		O=$(realpath $(UBOOT_OUT)) \
-		CROSS_COMPILE="$(UBOOT_CROSS_COMPILE_WRAPPER)" \
-		KCFLAGS="$(UBOOT_CFLAGS)" \
-		KAFLAGS="$(UBOOT_AFLAGS)" \
-		SOURCE_DATE_EPOCH="$(BUILD_DATETIME_FROM_FILE)" \
-		$(1)
-endef
-
-# Merge the required U-Boot config elements into a single file.
-$(UBOOT_CONFIG_REQUIRED): $(UBOOT_CONFIG_REQUIRED_SRC) | $(UBOOT_OUT)
-	$(hide) cat $^ > $@
-
-# Merge the final target U-Boot config.
-$(UBOOT_CONFIG): $(UBOOT_CONFIG_SRC) $(UBOOT_SRC_KCONFIGS) | $(UBOOT_OUT)
-	$(hide) echo Merging U-Boot config
-	$(call build_uboot,mrproper)
-	PATH=$$(cd device/ti/beagle_x15/hostcc; pwd):$$PATH \
-		BISON_PKGDATADIR=$$(cd prebuilts/build-tools/common/bison; pwd) \
-		$(UBOOT_MERGE_CONFIG) \
-		$(TARGET_UBOOT_SRC) $(realpath $(UBOOT_OUT)) \
-		$(UBOOT_ARCH) $(UBOOT_CROSS_COMPILE) \
-		$(UBOOT_CONFIG_SRC)
-
-$(UBOOT_OUT)/$(TARGET_UBOOT_MAKE_TARGET): $(UBOOT_CONFIG) | $(UBOOT_OUT)
-	$(hide) echo "Building $(UBOOT_ARCH) U-Boot ..."
-	$(call build_uboot,$(TARGET_UBOOT_MAKE_TARGET))
-
-$(addprefix $(UBOOT_OUT)/,$(TARGET_UBOOT_COPY_TARGETS)): $(UBOOT_OUT)/$(TARGET_UBOOT_MAKE_TARGET)
-
-ifneq ($(TARGET_UBOOT_ENV),)
-$(UBOOT_ENV_OUT): $(TARGET_UBOOT_ENV) | $(addprefix $(UBOOT_OUT)/,$(TARGET_UBOOT_COPY_TARGETS))
-	$(UBOOT_OUT)/tools/mkenvimage -s $(TARGET_UBOOT_ENV_SIZE) -o $@ $<
-endif
-
-ALL_DEFAULT_INSTALLED_MODULES += $(addprefix $(PRODUCT_OUT)/,$(TARGET_UBOOT_COPY_TARGETS))
-
-# Produces the actual U-Boot image!
-define copy_uboot
-$$(PRODUCT_OUT)/$(1): $$(UBOOT_OUT)/$(1) | $$(ACP)
-	$$(ACP) -fp $$< $$@
-endef
-$(foreach _t,$(TARGET_UBOOT_COPY_TARGETS),$(eval $(call copy_uboot,$(_t))))
diff --git a/uboot_config/common.config b/uboot_config/common.config
deleted file mode 100644
index 4cc1d3a..0000000
--- a/uboot_config/common.config
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open-Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#
-# The following are the U-Boot configurations that are required for all builds.
-# These cannot be overridden in the board.
-#
-
-CONFIG_AUTOBOOT=y
-
-# Add support for Android Images.
-CONFIG_ANDROID_BOOT_IMAGE=y
-
-# Support for Android Bootloader is required.
-CONFIG_ANDROID_BOOTLOADER=y
-CONFIG_CMD_BOOT_ANDROID=y
-
-# Support for selecting the A/B slot.
-CONFIG_ANDROID_AB=y
-
-# FIXME: Turn off A/B select until we update the device project for A/B
-#        and figure out an efficient partitioing scheme
-#CONFIG_CMD_AB_SELECT=y
-
-# Fastboot and Android image support should be enabled.
-CONFIG_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
diff --git a/uboot_config/recommended.config b/uboot_config/recommended.config
deleted file mode 100644
index e5626bc..0000000
--- a/uboot_config/recommended.config
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Copyright (C) 2016 The Android Open-Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#
-# The following are the U-Boot configurations that are recommended (though not
-# strictly required) for all builds. These can be overridden by setting
-# TARGET_UBOOT_CONFIGS.
-#
-
-# Disable most other ways of booting by default.
-# CONFIG_NET is not set