Skip to content

Commit

Permalink
WALPAD8G_V2: Initial TWRP device tree
Browse files Browse the repository at this point in the history
Made with SebaUbuntu's TWRP device tree generator
Arch: arm64
Manufacturer: walton
Model: WALPAD_8G
Script version: 3.0.0
  • Loading branch information
SebaUbuntu committed Aug 30, 2024
0 parents commit 47032ed
Show file tree
Hide file tree
Showing 14 changed files with 390 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// Copyright (C) 2024 The Android Open Source Project
// Copyright (C) 2024 SebaUbuntu's TWRP device tree generator
//
// SPDX-License-Identifier: Apache-2.0
//

soong_namespace {
}
12 changes: 12 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (C) 2024 The Android Open Source Project
# Copyright (C) 2024 SebaUbuntu's TWRP device tree generator
#
# SPDX-License-Identifier: Apache-2.0
#

LOCAL_PATH := $(call my-dir)

ifeq ($(TARGET_DEVICE),WALPAD8G_V2)
include $(call all-subdir-makefiles,$(LOCAL_PATH))
endif
14 changes: 14 additions & 0 deletions AndroidProducts.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Copyright (C) 2024 The Android Open Source Project
# Copyright (C) 2024 SebaUbuntu's TWRP device tree generator
#
# SPDX-License-Identifier: Apache-2.0
#

PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/omni_WALPAD8G_V2.mk

COMMON_LUNCH_CHOICES := \
omni_WALPAD8G_V2-user \
omni_WALPAD8G_V2-userdebug \
omni_WALPAD8G_V2-eng
112 changes: 112 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#
# Copyright (C) 2024 The Android Open Source Project
# Copyright (C) 2024 SebaUbuntu's TWRP device tree generator
#
# SPDX-License-Identifier: Apache-2.0
#

DEVICE_PATH := device/walton/WALPAD8G_V2

# For building with minimal manifest
ALLOW_MISSING_DEPENDENCIES := true

# A/B
AB_OTA_UPDATER := true
AB_OTA_PARTITIONS += \
vendor \
system \
boot \
vbmeta_system \
product \
vbmeta_vendor
BOARD_USES_RECOVERY_AS_BOOT := true

# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := generic
TARGET_CPU_VARIANT_RUNTIME := cortex-a53

TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := generic
TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a53

# APEX
DEXPREOPT_GENERATE_APEX_IMAGE := true

# Bootloader
TARGET_BOOTLOADER_BOARD_NAME := t805_e221_v1_hd
TARGET_NO_BOOTLOADER := true

# Display
TARGET_SCREEN_DENSITY := 210

# Kernel
BOARD_BOOTIMG_HEADER_VERSION := 2
BOARD_KERNEL_BASE := 0x40078000
BOARD_KERNEL_CMDLINE := bootopt=64S3,32N2,64N2 buildvariant=user
BOARD_KERNEL_PAGESIZE := 2048
BOARD_RAMDISK_OFFSET := 0x11a88000
BOARD_KERNEL_TAGS_OFFSET := 0x07808000
BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOTIMG_HEADER_VERSION)
BOARD_MKBOOTIMG_ARGS += --ramdisk_offset $(BOARD_RAMDISK_OFFSET)
BOARD_MKBOOTIMG_ARGS += --tags_offset $(BOARD_KERNEL_TAGS_OFFSET)
BOARD_KERNEL_IMAGE_NAME := Image
BOARD_INCLUDE_DTB_IN_BOOTIMG := true
TARGET_KERNEL_CONFIG := WALPAD8G_V2_defconfig
TARGET_KERNEL_SOURCE := kernel/walton/WALPAD8G_V2

# Kernel - prebuilt
TARGET_FORCE_PREBUILT_KERNEL := true
ifeq ($(TARGET_FORCE_PREBUILT_KERNEL),true)
TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/kernel
TARGET_PREBUILT_DTB := $(DEVICE_PATH)/prebuilt/dtb.img
BOARD_MKBOOTIMG_ARGS += --dtb $(TARGET_PREBUILT_DTB)
BOARD_INCLUDE_DTB_IN_BOOTIMG :=
endif

# Partitions
BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64)
BOARD_BOOTIMAGE_PARTITION_SIZE := 33554432
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 33554432
BOARD_HAS_LARGE_FILESYSTEM := true
BOARD_SYSTEMIMAGE_PARTITION_TYPE := ext4
BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
TARGET_COPY_OUT_VENDOR := vendor
BOARD_SUPER_PARTITION_SIZE := 9126805504 # TODO: Fix hardcoded value
BOARD_SUPER_PARTITION_GROUPS := walton_dynamic_partitions
BOARD_WALTON_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor product
BOARD_WALTON_DYNAMIC_PARTITIONS_SIZE := 9122611200 # TODO: Fix hardcoded value

# Platform
TARGET_BOARD_PLATFORM := mt6761

# Recovery
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true

# Security patch level
VENDOR_SECURITY_PATCH := 2021-08-01

# Verified Boot
BOARD_AVB_ENABLE := true
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3

# Hack: prevent anti rollback
PLATFORM_SECURITY_PATCH := 2099-12-31
VENDOR_SECURITY_PATCH := 2099-12-31
PLATFORM_VERSION := 16.1.0

# TWRP Configuration
TW_THEME := portrait_hdpi
TW_EXTRA_LANGUAGES := true
TW_SCREEN_BLANK_ON_BOOT := true
TW_INPUT_BLACKLIST := "hbtp_vm"
TW_USE_TOOLBOX := true
TW_INCLUDE_REPACKTOOLS := true
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Android device tree for WALTON WALPAD_8G (WALPAD8G_V2)

```
#
# Copyright (C) 2024 The Android Open Source Project
# Copyright (C) 2024 SebaUbuntu's TWRP device tree generator
#
# SPDX-License-Identifier: Apache-2.0
#
```
35 changes: 35 additions & 0 deletions device.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# Copyright (C) 2024 The Android Open Source Project
# Copyright (C) 2024 SebaUbuntu's TWRP device tree generator
#
# SPDX-License-Identifier: Apache-2.0
#

LOCAL_PATH := device/walton/WALPAD8G_V2
# A/B
AB_OTA_POSTINSTALL_CONFIG += \
RUN_POSTINSTALL_system=true \
POSTINSTALL_PATH_system=system/bin/otapreopt_script \
FILESYSTEM_TYPE_system=ext4 \
POSTINSTALL_OPTIONAL_system=true

# Boot control HAL
PRODUCT_PACKAGES += \
[email protected] \
[email protected]

PRODUCT_PACKAGES += \
bootctrl.mt6761

PRODUCT_STATIC_BOOT_CONTROL_HAL := \
bootctrl.mt6761 \
libgptutils \
libz \
libcutils

PRODUCT_PACKAGES += \
otapreopt_script \
cppreopts.sh \
update_engine \
update_verifier \
update_engine_sideload
61 changes: 61 additions & 0 deletions extract-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#

set -e

DEVICE=WALPAD8G_V2
VENDOR=walton

# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi

ANDROID_ROOT="${MY_DIR}/../../.."

HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"
exit 1
fi
source "${HELPER}"

# Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true

KANG=
SECTION=

while [ "${#}" -gt 0 ]; do
case "${1}" in
-n | --no-cleanup )
CLEAN_VENDOR=false
;;
-k | --kang )
KANG="--kang"
;;
-s | --section )
SECTION="${2}"; shift
CLEAN_VENDOR=false
;;
* )
SRC="${1}"
;;
esac
shift
done

if [ -z "${SRC}" ]; then
SRC="adb"
fi

# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"

extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"

"${MY_DIR}/setup-makefiles.sh"
29 changes: 29 additions & 0 deletions omni_WALPAD8G_V2.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Copyright (C) 2024 The Android Open Source Project
# Copyright (C) 2024 SebaUbuntu's TWRP device tree generator
#
# SPDX-License-Identifier: Apache-2.0
#

# Inherit from those products. Most specific first.
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)

# Inherit some common Omni stuff.
$(call inherit-product, vendor/omni/config/common.mk)

# Inherit from WALPAD8G_V2 device
$(call inherit-product, device/walton/WALPAD8G_V2/device.mk)

PRODUCT_DEVICE := WALPAD8G_V2
PRODUCT_NAME := omni_WALPAD8G_V2
PRODUCT_BRAND := WALTON
PRODUCT_MODEL := WALPAD_8G
PRODUCT_MANUFACTURER := walton

PRODUCT_GMS_CLIENTID_BASE := android-walton

PRODUCT_BUILD_PROP_OVERRIDES += \
PRIVATE_BUILD_DESC="full_t805_e221_v1_hd-user 11 RP1A.200720.011 mp1V8465 release-keys"

BUILD_FINGERPRINT := WALTON/WALPAD8G_V2/WALPAD8G_V2:11/RP1A.200720.011/mp2V989:user/release-keys
Binary file added prebuilt/dtb.img
Binary file not shown.
Binary file added prebuilt/kernel
Binary file not shown.
42 changes: 42 additions & 0 deletions recovery.fstab
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/system ext4 system flags=display=system;logical;slotselect
/vendor ext4 vendor flags=display=vendor;logical;slotselect
/product ext4 product flags=display=product;logical;slotselect
/metadata ext4 /dev/block/platform/bootdevice/by-name/md_udc flags=display=metadata
/data ext4 /dev/block/platform/bootdevice/by-name/userdata flags=display=data
/mnt/vendor/protect_f ext4 /dev/block/platform/bootdevice/by-name/protect1 flags=display=protect_f
/mnt/vendor/protect_s ext4 /dev/block/platform/bootdevice/by-name/protect2 flags=display=protect_s
/mnt/vendor/nvdata ext4 /dev/block/platform/bootdevice/by-name/nvdata flags=display=nvdata
/mnt/vendor/nvcfg ext4 /dev/block/platform/bootdevice/by-name/nvcfg flags=display=nvcfg
/mnt/vendor/persist ext4 /dev/block/platform/bootdevice/by-name/persist flags=display=persist
auto auto /devices/platform/externdevice* flags=display=auto
auto vfat /devices/platform/mt_usb* flags=display=auto
/persistent emmc /dev/block/platform/bootdevice/by-name/frp flags=display=persistent
/nvram emmc /dev/block/platform/bootdevice/by-name/nvram flags=display=nvram
/proinfo emmc /dev/block/platform/bootdevice/by-name/proinfo flags=display=proinfo
/bootloader emmc /dev/block/platform/bootdevice/by-name/lk flags=display=bootloader
/bootloader2 emmc /dev/block/platform/bootdevice/by-name/lk2 flags=display=bootloader2
/misc emmc /dev/block/platform/bootdevice/by-name/para flags=display=misc
/boot emmc /dev/block/platform/bootdevice/by-name/boot flags=display=boot;slotselect
/vbmeta_vendor emmc /dev/block/platform/bootdevice/by-name/vbmeta_vendor flags=display=vbmeta_vendor;slotselect
/vbmeta_system emmc /dev/block/platform/bootdevice/by-name/vbmeta_system flags=display=vbmeta_system;slotselect
/logo emmc /dev/block/platform/bootdevice/by-name/logo flags=display=logo
/expdb emmc /dev/block/platform/bootdevice/by-name/expdb flags=display=expdb
/seccfg emmc /dev/block/platform/bootdevice/by-name/seccfg flags=display=seccfg
/tee1 emmc /dev/block/platform/bootdevice/by-name/tee1 flags=display=tee1
/tee2 emmc /dev/block/platform/bootdevice/by-name/tee2 flags=display=tee2
/scp1 emmc /dev/block/platform/bootdevice/by-name/scp1 flags=display=scp1
/scp2 emmc /dev/block/platform/bootdevice/by-name/scp2 flags=display=scp2
/sspm_1 emmc /dev/block/platform/bootdevice/by-name/sspm_1 flags=display=sspm_1
/sspm_2 emmc /dev/block/platform/bootdevice/by-name/sspm_2 flags=display=sspm_2
/md1img emmc /dev/block/platform/bootdevice/by-name/md1img flags=display=md1img
/md1dsp emmc /dev/block/platform/bootdevice/by-name/md1dsp flags=display=md1dsp
/md1arm7 emmc /dev/block/platform/bootdevice/by-name/md1arm7 flags=display=md1arm7
/md3img emmc /dev/block/platform/bootdevice/by-name/md3img flags=display=md3img
/gz1 emmc /dev/block/platform/bootdevice/by-name/gz1 flags=display=gz1
/gz2 emmc /dev/block/platform/bootdevice/by-name/gz2 flags=display=gz2
/spmfw emmc /dev/block/platform/bootdevice/by-name/spmfw flags=display=spmfw
/boot_para emmc /dev/block/platform/bootdevice/by-name/boot_para flags=display=boot_para
/dtbo1 emmc /dev/block/platform/bootdevice/by-name/dtbo1 flags=display=dtbo1
/dtbo2 emmc /dev/block/platform/bootdevice/by-name/dtbo2 flags=display=dtbo2
/dtbo emmc /dev/block/platform/bootdevice/by-name/dtbo flags=display=dtbo
/vbmeta emmc /dev/block/platform/bootdevice/by-name/vbmeta flags=display=vbmeta
20 changes: 20 additions & 0 deletions recovery/root/init.recovery.mt6761.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on init
setprop sys.usb.configfs 1
setprop sys.usb.ffs.aio_compat 0

on fs && property:ro.debuggable=0
# distinguish USB shoulde connect or not, i.e. CDP vs SDP
write /sys/class/udc/musb-hdrc/device/cmode 2
# set charging free due to it wait for USB activation
start adbd

on post-fs
# Support A/B feature for emmc boot region
symlink /dev/block/sda /dev/block/mmcblk0boot0
symlink /dev/block/sdb /dev/block/mmcblk0boot1
symlink /dev/block/mmcblk0boot0 /dev/block/platform/bootdevice/by-name/preloader_a
symlink /dev/block/mmcblk0boot1 /dev/block/platform/bootdevice/by-name/preloader_b
symlink /dev/block/mmcblk0boot0 /dev/block/by-name/preloader_a
symlink /dev/block/mmcblk0boot1 /dev/block/by-name/preloader_b

exec u:r:update_engine:s0 root root -- /system/bin/mtk_plpath_utils
36 changes: 36 additions & 0 deletions setup-makefiles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#

set -e

DEVICE=WALPAD8G_V2
VENDOR=walton

# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi

ANDROID_ROOT="${MY_DIR}/../../.."

HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"
exit 1
fi
source "${HELPER}"

# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"

# Warning headers and guards
write_headers

write_makefiles "${MY_DIR}/proprietary-files.txt" true

# Finish
write_footers
Loading

0 comments on commit 47032ed

Please sign in to comment.