enchilada: Add oneplus enchilada device bits
diff --git a/Android.mk b/Android.mk
index dcd9bc5..7b824bf 100644
--- a/Android.mk
+++ b/Android.mk
@@ -20,7 +20,7 @@
 # to only building on ARM if they include assembly. Individual makefiles
 # are responsible for having their own logic, for fine-grained control.
 
-ifneq ($(filter beryllium, $(TARGET_BOARD_PLATFORM)),)
+ifneq ($(filter enchilada, $(TARGET_BOARD_PLATFORM)),)
 
 LOCAL_PATH := $(call my-dir)
 
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index 486b002..7c0b530 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -10,7 +10,9 @@
 #
 
 PRODUCT_MAKEFILES := \
-    $(LOCAL_DIR)/beryllium.mk
+    $(LOCAL_DIR)/beryllium.mk \
+    $(LOCAL_DIR)/enchilada.mk
 
 COMMON_LUNCH_CHOICES := \
-    beryllium-userdebug
+    beryllium-userdebug \
+    enchilada-userdebug
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index a93ae2c..a1bdf27 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -57,11 +57,11 @@
 BOARD_HAVE_BLUETOOTH := true
 
 BOARD_SEPOLICY_DIRS += \
-    device/xiaomi/beryllium/sepolicy \
+    device/oneplus/enchilada/sepolicy \
     system/bt/vendor_libs/linux/sepolicy
 
-DEVICE_MANIFEST_FILE := device/xiaomi/beryllium/manifest.xml
-DEVICE_MATRIX_FILE := device/xiaomi/beryllium/compatibility_matrix.xml
+DEVICE_MANIFEST_FILE := device/oneplus/enchilada/manifest.xml
+DEVICE_MATRIX_FILE := device/oneplus/enchilada/compatibility_matrix.xml
 
 # Enable dex pre-opt to speed up initial boot
 ifeq ($(HOST_OS),linux)
diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk
index 1f79732..ff47cc5 100644
--- a/build/tasks/kernel.mk
+++ b/build/tasks/kernel.mk
@@ -1,7 +1,7 @@
-ifneq ($(filter beryllium, $(TARGET_DEVICE)),)
+ifneq ($(filter enchilada, $(TARGET_DEVICE)),)
 
-IMAGE_GZ := device/xiaomi/beryllium/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/Image.gz
-DTB := device/xiaomi/beryllium/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/sdm845-xiaomi-beryllium.dtb
+IMAGE_GZ := device/oneplus/enchilada/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/Image.gz
+DTB := device/oneplus/enchilada/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/sdm845-oneplus-enchilada.dtb
 
 $(PRODUCT_OUT)/kernel: $(IMAGE_GZ) $(DTB)
 	cat $(IMAGE_GZ) $(DTB) > $@
diff --git a/enchilada.mk b/enchilada.mk
new file mode 100644
index 0000000..2a0ad36
--- /dev/null
+++ b/enchilada.mk
@@ -0,0 +1,24 @@
+ifndef TARGET_KERNEL_USE
+TARGET_KERNEL_USE := mainline
+endif
+
+KERNEL_MODS := $(wildcard device/oneplus/enchilada/prebuilt-kernel/android-$(TARGET_KERNEL_USE)/*.ko)
+
+# Following modules go to vendor partition
+# msm.ko is too big (31M) for ramdisk
+VENDOR_KERN_MODS := %/msm.ko
+BOARD_VENDOR_KERNEL_MODULES := $(filter $(VENDOR_KERN_MODS),$(KERNEL_MODS))
+
+# All other modules go to ramdisk
+BOARD_GENERIC_RAMDISK_KERNEL_MODULES := $(filter-out $(VENDOR_KERN_MODS),$(KERNEL_MODS))
+
+# Inherit the full_base and device configurations
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
+$(call inherit-product, device/oneplus/enchilada/enchilada/device.mk)
+$(call inherit-product, device/oneplus/enchilada/device-common.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
+
+# Product overrides
+PRODUCT_NAME := enchilada
+PRODUCT_DEVICE := enchilada
+PRODUCT_BRAND := AOSP
diff --git a/enchilada/BoardConfig.mk b/enchilada/BoardConfig.mk
new file mode 100644
index 0000000..abb34db
--- /dev/null
+++ b/enchilada/BoardConfig.mk
@@ -0,0 +1,24 @@
+include device/oneplus/enchilada/BoardConfigCommon.mk
+
+# Copied from https://github.com/LineageOS/android_device_oneplus_sdm845-common/blob/lineage-16.0/BoardConfigCommon.mk
+# Board Information
+TARGET_BOOTLOADER_BOARD_NAME := enchilada
+TARGET_BOARD_PLATFORM := enchilada
+
+# Kernel/boot.img Configuration
+BOARD_KERNEL_BASE        := 0x00000000
+BOARD_KERNEL_PAGESIZE    := 4096
+BOARD_KERNEL_TAGS_OFFSET := 0x00000100
+BOARD_RAMDISK_OFFSET     := 0x01000000
+BOARD_KERNEL_CMDLINE     := console=ttyMSM0,115200n8 androidboot.console=ttyMSM0
+BOARD_KERNEL_CMDLINE     += androidboot.hardware=enchilada androidboot.boot_devices=soc@0/1d84000.ufshc
+BOARD_KERNEL_CMDLINE     += firmware_class.path=/vendor/firmware/ init=/init printk.devkmsg=on
+BOARD_KERNEL_CMDLINE     += deferred_probe_timeout=30
+BOARD_KERNEL_CMDLINE     += fw_devlink=permissive
+ 
+# Image Configuration
+BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864 #64M
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 57453555712
+BOARD_VENDORIMAGE_PARTITION_SIZE := 536870912
+BOARD_FLASH_BLOCK_SIZE := 262144
diff --git a/enchilada/device.mk b/enchilada/device.mk
new file mode 100644
index 0000000..5df8346
--- /dev/null
+++ b/enchilada/device.mk
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2011 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.
+#
+
+PRODUCT_SOONG_NAMESPACES += \
+    device/oneplus/enchilada
+
+# copied from crosshatch
+# setup dalvik vm configs
+$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
+
+
+PRODUCT_COPY_FILES := \
+    $(LOCAL_PATH)/fstab.ramdisk:$(TARGET_COPY_OUT_RAMDISK)/fstab.enchilada \
+    $(LOCAL_PATH)/fstab.ramdisk:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.enchilada \
+    device/oneplus/enchilada/init.common.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.enchilada.rc \
+    device/oneplus/enchilada/init.common.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.enchilada.usb.rc \
+    device/oneplus/enchilada/common.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/enchilada.kl
+
+# Build generic Audio HAL
+PRODUCT_PACKAGES := audio.primary.enchilada
+
+# Build generic lights HAL
+PRODUCT_PACKAGES += lights.enchilada
+
+PRODUCT_PACKAGES += \
+    pd-mapper \
+    qrtr-ns \
+    qrtr-cfg \
+    qrtr-lookup \
+    rmtfs \
+    tqftpserv
+
+PRODUCT_COPY_FILES += \
+    device/oneplus/enchilada/qcom/init.qcom.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.qcom.rc
diff --git a/enchilada/fstab.ramdisk b/enchilada/fstab.ramdisk
new file mode 100644
index 0000000..5addab9
--- /dev/null
+++ b/enchilada/fstab.ramdisk
@@ -0,0 +1,4 @@
+/dev/block/platform/soc@0/1d84000.ufshc/by-name/system /system ext4 noatime,ro,errors=panic wait,first_stage_mount
+/dev/block/platform/soc@0/1d84000.ufshc/by-name/vendor /vendor ext4 noatime,ro,errors=panic wait,first_stage_mount
+/dev/block/platform/soc@0/1d84000.ufshc/by-name/userdata /data		ext4	discard,noatime,noauto_da_alloc,data=ordered,user_xattr,barrier=1,inlinecrypt	wait,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,quota
+/devices/platform/soc@0/8804000.sdhci/mmc_host/mmc*	auto	auto	defaults	voldmanaged=sdcard1:auto