summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaesar Wang <wxt@rock-chips.com>2016-01-13 10:54:56 +0800
committerCaesar Wang <wxt@rock-chips.com>2016-01-13 10:57:12 +0800
commitf97b034cc958c5b5e384e14f6b2c906125f3dba8 (patch)
tree82c99082162bc0e3840eef569b15311bb97657d6
parent22bada970fa7470fe9f1565274c4f7a77cb075bf (diff)
downloadkylin-f97b034cc958c5b5e384e14f6b2c906125f3dba8.tar.gz
Seperate BoardConfig.mk and product makefiles.
Bug: 26522963 Also move all init.rc files in device folder. Signed-off-by: leozhang <leozwang@google.com> Signed-off-by: Caesar Wang <wxt@rock-chips.com> Change-Id: I730cacafd65ed86307c9ce6cc8e40d6716595f38
-rw-r--r--BoardConfig.mk38
-rw-r--r--base_product/kylin.mk16
-rw-r--r--init.rk3036.rc22
-rw-r--r--sepolicy/file_contexts2
-rw-r--r--soc/soc.kconf25
-rw-r--r--soc/soc.mk56
6 files changed, 145 insertions, 14 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 57532d5..5eb50df 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -14,21 +14,33 @@
# limitations under the License.
#
-# Select the SoC
-$(call set_soc, rockchip, rk3036)
+# Arm32 device.
+TARGET_ARCH := arm
+TARGET_ARCH_VARIANT := armv7-a
+TARGET_CPU_VARIANT := generic
+TARGET_CPU_ABI := armeabi-v7a
+TARGET_CPU_ABI2 := armeabi
-BOARD_SYSTEMIMAGE_PARTITION_SIZE := 268435456
-BOARD_USERDATAIMAGE_PARTITION_SIZE := 134217728
-BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456
+TARGET_NO_BOOTLOADER := false
+TARGET_NO_KERNEL := false
-TARGET_BOARD_INFO_FILE := device/rockchip/kylin/board-info.txt
+BOARD_KERNEL_CMDLINE := console=ttyS2,115200n8 androidboot.console=ttyS2 androidboot.hardware=rk3036 earlyprintk selinux=enforcing
-PRODUCT_COPY_FILES += \
- device/rockchip/kylin/fstab:root/fstab.${soc_name} \
- device/rockchip/kylin/provision-device:provision-device
+# Set up the local kernel.
+TARGET_KERNEL_ARCH := $(TARGET_ARCH)
+TARGET_KERNEL_SRC := hardware/bsp/kernel/common/v4.1
+TARGET_KERNEL_DEFCONFIG := rk3036_kylin_defconfig
+TARGET_KERNEL_CONFIGS := device/rockchip/kylin/soc/soc.kconf
+TARGET_KERNEL_DTB := rk3036-kylin.dtb
+TARGET_KERNEL_DTB_APPEND := true
-BOARD_SEPOLICY_DIRS += \
- device/rockchip/kylin/sepolicy
+TARGET_BOARD_INFO_FILE := device/rockchip/kylin/board-info.txt
+
+TARGET_USERIMAGES_USE_EXT4 := true
+BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_FLASH_BLOCK_SIZE := 131072
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 268435456
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 134217728
+BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456
-# Must be defined at the end of the file
-$(call add_device_packages)
+BOARD_SEPOLICY_DIRS += device/rockchip/kylin/sepolicy
diff --git a/base_product/kylin.mk b/base_product/kylin.mk
index 272790d..6339757 100644
--- a/base_product/kylin.mk
+++ b/base_product/kylin.mk
@@ -18,9 +18,23 @@ $(call inherit-product, device/generic/brillo/brillo_base.mk)
PRODUCT_NAME := kylin
PRODUCT_BRAND := Brillo
-
PRODUCT_DEVICE := kylin
+# Clean up this.
+soc_name := rk3036
+
+PRODUCT_COPY_FILES += \
+ device/rockchip/kylin/init.rk3036.rc:root/init.rk3036.rc \
+ system/core/rootdir/init.usb.rc:root/init.usb.rc \
+ system/core/rootdir/ueventd.rc:root/ueventd.rc \
+
+PRODUCT_COPY_FILES += \
+ device/rockchip/kylin/fstab:root/fstab.${soc_name} \
+ device/rockchip/kylin/provision-device:provision-device
+
+# Must be defined at the end of the file
+$(call add_device_packages)
+
# TODO: Install kylin-specific config file for weaved.
# PRODUCT_COPY_FILES += \
# device/rockchip/kylin/base_product/weaved.conf:system/etc/weaved/weaved.conf
diff --git a/init.rk3036.rc b/init.rk3036.rc
new file mode 100644
index 0000000..acd83ab
--- /dev/null
+++ b/init.rk3036.rc
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+on fs
+ mount_all /fstab.${ro.hardware}
+ mkdir /dev/usb-ffs 0770 shell shell
+ mkdir /dev/usb-ffs/adb 0770 shell shell
+ mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
+ write /sys/class/android_usb/android0/f_ffs/aliases adb
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index e69de29..0f72891 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -0,0 +1,2 @@
+# Serial console
+/dev/ttyS2 u:object_r:console_device:s0
diff --git a/soc/soc.kconf b/soc/soc.kconf
new file mode 100644
index 0000000..571b06d
--- /dev/null
+++ b/soc/soc.kconf
@@ -0,0 +1,25 @@
+#
+# 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.
+#
+
+CONFIG_BCMDHD=y
+CONFIG_BCMDHD_FW_PATH="/system/vendor/firmware/fw_bcm43438a0_apsta.bin"
+CONFIG_BCMDHD_NVRAM_PATH="/system/vendor/firmware/nvram_ap6212.txt"
+CONFIG_BCMDHD_SDIO=y
+CONFIG_EMAC_ROCKCHIP=y
+CONFIG_SND_SOC_RT5616=y
+CONFIG_REBOOT_MODE=y
+CONFIG_SYSCON_REBOOT_MODE=y
+
diff --git a/soc/soc.mk b/soc/soc.mk
new file mode 100644
index 0000000..2efe077
--- /dev/null
+++ b/soc/soc.mk
@@ -0,0 +1,56 @@
+#
+# 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.
+#
+
+# TODO(leecam): Make this automatic.
+LOCAL_PATH := hardware/bsp/rockchip/soc/rk3036
+
+# Arm32 device.
+TARGET_ARCH := arm
+TARGET_ARCH_VARIANT := armv7-a
+TARGET_CPU_VARIANT := generic
+TARGET_CPU_ABI := armeabi-v7a
+TARGET_CPU_ABI2 := armeabi
+TARGET_KERNEL_ARCH := $(TARGET_ARCH)
+
+TARGET_NO_BOOTLOADER := false
+TARGET_NO_KERNEL := false
+
+BOARD_KERNEL_CMDLINE := console=ttyS2,115200n8 androidboot.console=ttyS2 androidboot.hardware=rk3036 earlyprintk selinux=enforcing
+
+TARGET_USERIMAGES_USE_EXT4 := true
+BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_FLASH_BLOCK_SIZE := 131072
+
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/init.rk3036.rc:root/init.rk3036.rc \
+ system/core/rootdir/init.usb.rc:root/init.usb.rc \
+ system/core/rootdir/ueventd.rc:root/ueventd.rc \
+
+# TODO: Move common/prebuilts/sepolicy include to audio_prebuilts.mk
+BOARD_SEPOLICY_DIRS += \
+ $(LOCAL_PATH)/sepolicy \
+
+# Set up the local kernel.
+TARGET_KERNEL_SRC := hardware/bsp/kernel/common/v4.1
+TARGET_KERNEL_DEFCONFIG := rk3036_kylin_defconfig
+TARGET_KERNEL_CONFIGS := $(realpath $(LOCAL_PATH)/soc.kconf)
+TARGET_KERNEL_DTB := rk3036-kylin.dtb
+TARGET_KERNEL_DTB_APPEND := true
+
+# Default Keystore HAL
+DEVICE_PACKAGES += \
+ keystore.default \
+ bootctrl.default