summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoran Wang <Haoran.Wang@freescale.com>2016-05-17 14:38:52 +0800
committerHaoran Wang <Haoran.Wang@freescale.com>2016-05-24 10:31:29 +0800
commit52adfed59f8419620178e4038440257fddfc0acc (patch)
tree3aca1bb81eee6cd32cf55d8cde3c852efed888a7
parent760f38923c7de0241a653a21163ad314b8a80f7f (diff)
downloadpicoimx-52adfed59f8419620178e4038440257fddfc0acc.tar.gz
Use Brillo kernel.mk by default
Use Brillo kernel.mk to generate boot.img. Change-Id: I3eb074c79c08f122bbb1aee6b5a2fc8dd9ddd51b Signed-off-by: Haoran Wang <Haoran.Wang@freescale.com>
-rw-r--r--AndroidBoard.mk2
-rw-r--r--BoardConfig.mk5
-rw-r--r--kernel-fsl.mk111
3 files changed, 5 insertions, 113 deletions
diff --git a/AndroidBoard.mk b/AndroidBoard.mk
index 3f62092..fd1948e 100644
--- a/AndroidBoard.mk
+++ b/AndroidBoard.mk
@@ -16,5 +16,5 @@
# This has to live here for now as the variables it requires are
# not read when BoardConfig.mk is parsed.
-include device/freescale/picoimx/kernel-fsl.mk
+include device/generic/brillo/kernel.mk
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 8610bf8..9d8ceb2 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -43,8 +43,11 @@ BOARD_SEPOLICY_DIRS += device/freescale/picoimx/sepolicy
# Set up the local kernel.
TARGET_KERNEL_SRC := hardware/bsp/kernel/freescale/kernel_imx
TARGET_KERNEL_DEFCONFIG := imx_v7_android_defconfig
-TARGET_KERNEL_CROSS_COMPILE_PREFIX := $(PWD)/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-
+TARGET_KERNEL_CONFIGS := hardware/bsp/freescale/soc/picoimx/soc.kconf
# WIFI
WIFI_DRIVER_HAL_MODULE := wifi_driver.$(soc_name)
WIFI_DRIVER_HAL_PERIPHERAL := bcm4339
+
+BOARD_MKBOOTIMG_ARGS := --second $(ANDROID_PRODUCT_OUT)/kernel.dtb \
+ --base $(BOARD_KERNEL_BASE)
diff --git a/kernel-fsl.mk b/kernel-fsl.mk
deleted file mode 100644
index 0356094..0000000
--- a/kernel-fsl.mk
+++ /dev/null
@@ -1,111 +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 builing kernels
-# The following must be set before including this file.
-# TARGET_KERNEL_SRC must be set the base of a kernel tree.
-# TARGET_KERNEL_DEFCONFIG must name a base kernel config.
-# TARGET_KERNEL_ARCH must be set to match kernel arch.
-
-# The following maybe set.
-# TARGET_KERNEL_CROSS_COMPILE_PREFIX to override toolchain
-# TARGET_PREBUILT_KERNEL to use a pre-built kernel
-
-# Only build kernel if caller has not defined a prebuild
-ifeq ($(TARGET_PREBUILT_KERNEL),)
-
-ifeq ($(TARGET_KERNEL_SRC),)
-$(error TARGET_KERNEL_SRC not defined)
-endif
-
-ifeq ($(TARGET_KERNEL_DEFCONFIG),)
-$(error TARGET_KERNEL_DEFCONFIG not defined)
-endif
-
-ifeq ($(TARGET_KERNEL_ARCH),)
-$(error TARGET_KERNEL_ARCH not defined)
-endif
-
-# Check target arch.
-KERNEL_TOOLCHAIN_ABS := $(shell readlink -f $(TARGET_TOOLCHAIN_ROOT)/bin)
-TARGET_KERNEL_ARCH := $(strip $(TARGET_KERNEL_ARCH))
-KERNEL_ARCH := $(TARGET_KERNEL_ARCH)
-HOST_PROCESSOR := $(shell cat /proc/cpuinfo | grep processor | wc -l)
-
-ifeq ($(TARGET_KERNEL_ARCH), arm)
-KERNEL_CROSS_COMPILE := $(KERNEL_TOOLCHAIN_ABS)/arm-linux-androideabi-
-ifdef TARGET_KERNEL_DTB
-KERNEL_NAME := zImage
-else
-KERNEL_NAME := zImage-dtb
-endif
-else ifeq ($(TARGET_KERNEL_ARCH), arm64)
-KERNEL_CROSS_COMPILE := $(KERNEL_TOOLCHAIN_ABS)/aarch64-linux-android-
-KERNEL_NAME := Image
-else
-$(error kernel arch not supported at present)
-endif
-
-# Allow caller to override toolchain.
-TARGET_KERNEL_CROSS_COMPILE_PREFIX := $(strip $(TARGET_KERNEL_CROSS_COMPILE_PREFIX))
-ifneq ($(TARGET_KERNEL_CROSS_COMPILE_PREFIX),)
-KERNEL_CROSS_COMPILE := $(TARGET_KERNEL_CROSS_COMPILE_PREFIX)
-endif
-
-KERNEL_GCC_NOANDROID_CHK := $(shell (echo "int main() {return 0;}" | $(KERNEL_CROSS_COMPILE)gcc -E -mno-android - > /dev/null 2>&1 ; echo $$?))
-ifeq ($(strip $(KERNEL_GCC_NOANDROID_CHK)),0)
-KERNEL_CFLAGS := KCFLAGS=-mno-android
-endif
-
-ifeq ($(TARGET_KERNEL_DTB),)
-$(error TARGET_KERNEL_DTB not defined)
-endif
-
-# Set the output for the kernel build products.
-KERNEL_OUT := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
-
-KERNEL_CONFIG := $(KERNEL_OUT)/.config
-
-KERNEL_BIN := $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/$(KERNEL_NAME)
-
-KERNEL_MERGE_CONFIG := device/generic/brillo/mergeconfig.sh
-
-KERNEL_ZIMAGE := $(TARGET_KERNEL_SRC)/arch/$(KERNEL_ARCH)/boot/zImage
-KERNEL_DTB_FILE := $(TARGET_KERNEL_SRC)/arch/$(KERNEL_ARCH)/boot/dts/$(TARGET_KERNEL_DTB)
-BOARD_MKBOOTIMG_ARGS += --second $(PRODUCT_OUT)/$(TARGET_KERNEL_DTB)
-
-$(KERNEL_OUT):
- mkdir -p $(KERNEL_OUT)
-
-# Build the kernel config
-#$(KERNEL_CONFIG): $(KERNEL_OUT)
-# $(KERNEL_MERGE_CONFIG) $(TARGET_KERNEL_SRC) `readlink -f $(KERNEL_OUT)` $(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) arch/$(KERNEL_ARCH)/configs/$(TARGET_KERNEL_DEFCONFIG) $(TARGET_KERNEL_CONFIGS)
-
-KERNEL_ENV := ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) $(KERNEL_CFLAGS)
-
-.PHONY: kernelimage
-kernelimage:
- $(hide) echo " Building kernel... "
- $(hide) rm -rf $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts
- $(MAKE) $(TARGET_KERNEL_DEFCONFIG) -C $(TARGET_KERNEL_SRC) $(KERNEL_ENV)
- $(MAKE) -j$(HOST_PROCESSOR) -C $(TARGET_KERNEL_SRC) $(KERNEL_ENV)
-
-$(PRODUCT_OUT)/kernel: kernelimage
- install -D $(KERNEL_ZIMAGE) $(PRODUCT_OUT)/kernel
- install -D $(KERNEL_DTB_FILE) $(PRODUCT_OUT)/$(TARGET_KERNEL_DTB)
-
-endif
-