aosp_beryllium: Add initial support for AOSP on Xiaomi Poco F1
Boots Xiaomi Poco F1 device to console. ADB is working.
Display is broken due to missing drm and panel drivers
and firmware files.
Signed-off-by: Amit Pundir <pundiramit@gmail.com>
diff --git a/aosp_beryllium/BoardConfig.mk b/aosp_beryllium/BoardConfig.mk
new file mode 100644
index 0000000..ee9b2d1
--- /dev/null
+++ b/aosp_beryllium/BoardConfig.mk
@@ -0,0 +1,21 @@
+include device/xiaomi/beryllium/BoardConfigCommon.mk
+
+# Copied from https://github.com/LineageOS/android_device_xiaomi_sdm845-common/blob/lineage-16.0/BoardConfigCommon.mk
+# Board Information
+TARGET_BOOTLOADER_BOARD_NAME := aosp_beryllium
+TARGET_BOARD_PLATFORM := aosp_beryllium
+
+# Bootloader/Kernel Configuration
+BOARD_KERNEL_BASE := 0x00000000
+BOARD_KERNEL_PAGESIZE := 4096
+BOARD_KERNEL_TAGS_OFFSET := 0x00000100
+BOARD_RAMDISK_OFFSET := 0x01000000
+BOARD_KERNEL_CMDLINE := firmware_class.path=/vendor/firmware/ androidboot.hardware=aosp_beryllium efi=noruntime
+BOARD_KERNEL_CMDLINE += init=/init androidboot.boot_devices=soc/1d84000.ufshc printk.devkmsg=on
+
+# 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/aosp_beryllium/device.mk b/aosp_beryllium/device.mk
new file mode 100644
index 0000000..0a59285
--- /dev/null
+++ b/aosp_beryllium/device.mk
@@ -0,0 +1,51 @@
+#
+# 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.
+#
+
+# Copied from crosshatch
+# Set lmkd options
+PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+ ro.lmk.low=1001 \
+ ro.lmk.medium=800 \
+ ro.lmk.critical=0 \
+ ro.lmk.critical_upgrade=false \
+ ro.lmk.upgrade_pressure=100 \
+ ro.lmk.downgrade_pressure=100 \
+ ro.lmk.kill_heaviest_task=true \
+ ro.lmk.kill_timeout_ms=100 \
+ ro.lmk.use_minfree_levels=true \
+
+$(call inherit-product-if-exists, frameworks/native/build/tablet-10in-xhdpi-2048-dalvik-heap.mk)
+
+PRODUCT_COPY_FILES := \
+ device/xiaomi/beryllium/prebuilt-kernel/$(TARGET_PREBUILT_KERNEL):kernel \
+ $(LOCAL_PATH)/fstab.aosp_beryllium:$(TARGET_COPY_OUT_VENDOR)/etc/init/fstab.aosp_beryllium \
+ $(LOCAL_PATH)/fstab.ramdisk:$(TARGET_COPY_OUT_RAMDISK)/fstab.aosp_beryllium \
+ device/xiaomi/beryllium/init.common.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.aosp_beryllium.rc \
+ device/xiaomi/beryllium/init.common.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.aosp_beryllium.usb.rc \
+ device/xiaomi/beryllium/ueventd.common.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.aosp_beryllium.rc \
+ device/xiaomi/beryllium/common.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/aosp_beryllium.kl
+
+# Build generic Audio HAL
+PRODUCT_PACKAGES := audio.primary.aosp_beryllium
+
+# Software Gatekeeper
+PRODUCT_PACKAGES += \
+ gatekeeper.aosp_beryllium \
+ android.hardware.gatekeeper@1.0-impl \
+ android.hardware.gatekeeper@1.0-service
+
+# Copy firmware files
+$(call inherit-product-if-exists, device/xiaomi/beryllium/firmware/device.mk)
diff --git a/aosp_beryllium/fstab.aosp_beryllium b/aosp_beryllium/fstab.aosp_beryllium
new file mode 100644
index 0000000..b2865c3
--- /dev/null
+++ b/aosp_beryllium/fstab.aosp_beryllium
@@ -0,0 +1,5 @@
+# Android fstab file.
+#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
+# The filesystem that contains the filesystem checker binary (typically /system) cannot
+# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
+LABEL=data /data ext4 discard,noauto_da_alloc,data=ordered,user_xattr,barrier=1 wait
diff --git a/aosp_beryllium/fstab.ramdisk b/aosp_beryllium/fstab.ramdisk
new file mode 100644
index 0000000..e0ed2d3
--- /dev/null
+++ b/aosp_beryllium/fstab.ramdisk
@@ -0,0 +1,2 @@
+/dev/block/platform/soc/1d84000.ufshc/by-name/system /system ext4 ro,errors=panic wait,first_stage_mount
+/dev/block/platform/soc/1d84000.ufshc/by-name/vendor /vendor ext4 ro,errors=panic wait,first_stage_mount