Skip to content

Commit

Permalink
nikel: N
Browse files Browse the repository at this point in the history
  • Loading branch information
SamarV-121 authored May 14, 2017
1 parent db572dc commit 1e29b00
Show file tree
Hide file tree
Showing 84 changed files with 19,040 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
LOCAL_PATH := $(call my-dir)

ifeq ($(TARGET_DEVICE),nikel)

include $(call all-makefiles-under,$(LOCAL_PATH))

endif
7 changes: 7 additions & 0 deletions AndroidBoard.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET)

# include the non-open-source counterpart to this file
2 changes: 2 additions & 0 deletions AndroidProducts.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/cm_nikel.mk
101 changes: 101 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# mt6797 platform boardconfig
LOCAL_PATH := device/xiaomi/nikel

include device/xiaomi/nikel/board.mk

# Platform
ARCH_ARM_HAVE_TLS_REGISTER := true
TARGET_BOARD_PLATFORM := mt6797
TARGET_NO_BOOTLOADER := true
TARGET_NO_FACTORYIMAGE := true

# CPU
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := cortex-a53
TARGET_CPU_SMP := true

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 := cortex-a53
TARGET_BOARD_SUFFIX := _64
TARGET_USES_64_BIT_BINDER := true

TARGET_CPU_CORTEX_A53 := true

TARGET_BOOTLOADER_BOARD_NAME := mt6797

# Ashmem
DISABLE_ASHMEM_TRACKING := true
BOARD_NO_SECURE_DISCARD := true

# Kernel
TARGET_USES_64_BIT_BINDER := true
TARGET_IS_64_BIT := true
BOARD_KERNEL_CMDLINE := bootopt=64S3,32N2,64N2 androidboot.selinux=permissive
BOARD_KERNEL_BASE := 0x40078000
BOARD_KERNEL_PAGESIZE := 2048
BOARD_MKBOOTIMG_ARGS := \
--base 0x40078000 \
--pagesize 2048 \
--kernel_offset 0x00008000 \
--ramdisk_offset 0x04f88000 \
--second_offset 0x00000000 \
--tags_offset 0x03f88000 \
--board nikel

# Hack for building without kernel sources
ifeq ($(TARGET_DEVICE),nikel)
$(shell mkdir -p $(OUT)/obj/KERNEL_OBJ/usr)
endif

# Partitions
BOARD_SYSTEMIMAGE_PARTITION_SIZE:=3221225472
BOARD_CACHEIMAGE_PARTITION_SIZE:=452984832
BOARD_USERDATAIMAGE_PARTITION_SIZE:=3221225472
BOARD_RECOVERYIMAGE_PARTITION_SIZE:=16777216
BOARD_BOOTIMAGE_PARTITION_SIZE:=16777216
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_FLASH_BLOCK_SIZE := 131072

BOARD_HAS_LARGE_FILESYSTEM := true
TARGET_USERIMAGES_USE_EXT4 := true
BOARD_SUPPRESS_SECURE_ERASE := true

# Display
TARGET_SCREEN_HEIGHT := 1920
TARGET_SCREEN_WIDTH := 1080

# Camera
TARGET_HAS_LEGACY_CAMERA_HAL1 := true

# Bluetooth
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(LOCAL_PATH)/bluetooth

# LightHAL
TARGET_PROVIDES_LIBLIGHT := true

# Recovery
BOARD_HAS_NO_SELECT_BUTTON := true
TARGET_RECOVERY_FSTAB := $(LOCAL_PATH)/rootdir/recovery.fstab
# TWRP-specific
ifeq ($(RECOVERY_VARIANT), twrp)
DEVICE_RESOLUTION := 1080x1920
DEVICE_SCREEN_WIDTH := 1080
DEVICE_SCREEN_HEIGHT := 1920
RECOVERY_SDCARD_ON_DATA := true
TW_INTERNAL_STORAGE_PATH := "/data/media"
TW_INTERNAL_STORAGE_MOUNT_POINT := "data"
TW_EXTERNAL_STORAGE_PATH := "/external_sd"
TW_EXTERNAL_STORAGE_MOUNT_POINT := "external_sd"
TW_DEFAULT_EXTERNAL_STORAGE := true
endif

TARGET_SYSTEM_PROP := $(LOCAL_PATH)/system.prop

# Seccomp filter
BOARD_SECCOMP_POLICY := $(LOCAL_PATH)/seccomp
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,46 @@
# android_device_xiaomi-nikel-lineage-14.1
# Device Tree for Xiaomi Redmi Note 4 (Nikel)

# Spec Sheet

| Feature | Specification |
| :---------------------- | :-------------------------------- |
| CPU | Deca-core 2.1 GHz |
| Chipset | Mediatek MT6797 Helio X20 |
| GPU | Mali-T880 MP4 |
| Memory | 2/3/4 GB |
| Shipped Android Version | 6.0.1 |
| Storage | 32/64 GB |
| MicroSD | Up to 256 GB |
| Battery | 4100 mAh (non-removable) |
| Dimensions | 151 x 76 x 8.5 mm |
| Display | 1920x1080 pixels, 5.5 (~401 PPI) |
| Rear Camera | 13 MP, LED flash |
| Front Camera | 5 MP |
| Release Date | January 2017 |

# Device Picture

![Redmi Note 4](http://i01.appmifile.com/webfile/globalimg/7/537557F3-A4F1-2490-E9D3-138B2A11DBF6.png "Redmi Note 4")

# Build
* repo init -u git://github.com/LineageOS/android.git -b cm-14.1
* repo sync
* git clone https://github.com/SamarV-121/android_device_xiaomi-nikel-lineage-14.1.git -b master device/xiaomi/nikel
* git clone https://github.com/SamarV-121/android_vendor_xiaomi-nikel-lineage-14.1.git -b master vendor/xiaomi/nikel
* cd device/xiaomi/nikel/patches
* . apply.sh
* source build/envsetup.sh
* breakfast nikel
* brunch nikel
* Done :)

# Known Issue:-
* FP Scanner
* Camera

# Credits:-
* AdrianoMartins
* divis1969
* xen0n
* & Me :)

40 changes: 40 additions & 0 deletions android_filesystem_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (C) 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.
*/

/* This file is used to define the properties of the filesystem
** images generated by build tools (mkbootfs and mkyaffs2image) and
** by the device side of adb.
*/

#include <private/android_filesystem_config.h>

#define NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS
/* static const struct fs_path_config android_device_dirs[] = { }; */

#ifdef TARGET_HAS_LEGACY_CAMERA_HAL1
#define AID_CAMERASERVER AID_MEDIA /* cameraserver process */
#else
#define AID_CAMERASERVER 1047 /* cameraserver process */
#endif

/* Rules for files.
** These rules are applied based on "first match", so they
** should start with the most specific path and work their
** way up to the root. Prefixes ending in * denotes wildcard
** and will allow partial matches.
*/
static const struct fs_path_config android_device_files[] = {
};
6 changes: 6 additions & 0 deletions bluetooth/bdroid_buildcfg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef _BDROID_BUILDCFG_H
#define _BDROID_BUILDCFG_H

#define BTM_DEF_LOCAL_NAME "Xiaomi Redmi Note 4"

#endif
62 changes: 62 additions & 0 deletions board.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# MTK Hardware
BOARD_HAS_MTK_HARDWARE := true

# Display
USE_OPENGL_RENDERER := true
TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true
NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK := true
BOARD_EGL_CFG := device/xiaomi/nikel/configs/etc/egl.cfg

# Boot animation
TARGET_BOOTANIMATION_MULTITHREAD_DECODE := true

# Audio
# USE_XML_AUDIO_POLICY_CONF := 1

# Wifi
WPA_SUPPLICANT_VERSION := VER_0_8_X
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_mt66xx
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_mt66xx
WIFI_DRIVER_FW_PATH_PARAM := "/dev/wmtWifi"
WIFI_DRIVER_FW_PATH_STA := STA
WIFI_DRIVER_FW_PATH_AP := AP
WIFI_DRIVER_FW_PATH_P2P := P2P

# Consumerir
MTK_IRTX_SUPPORT := true

# Bluetooth
BOARD_HAVE_BLUETOOTH := true

# Recovery
#RECOVERY_VARIANT := twrp

# TWRP
ifeq ($(RECOVERY_VARIANT), twrp)
TARGET_RECOVERY_PIXEL_FORMAT := "RGBA_8888"
TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/mt_usb/musb-hdrc.0.auto/gadget/lun%d/file
TARGET_RECOVERY_LCD_BACKLIGHT_PATH := \"/sys/class/leds/lcd-backlight/brightness\"
TW_NO_REBOOT_BOOTLOADER := true
TW_THEME := portrait_hdpi
TW_CUSTOM_CPU_TEMP_PATH := /sys/devices/virtual/thermal/thermal_zone1/temp
TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID := true
RECOVERY_GRAPHICS_USE_LINELENGTH := true
TW_MAX_BRIGHTNESS := 255
BOARD_SUPPRESS_SECURE_ERASE := true
TW_INCLUDE_CRYPTO := true
TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness
TW_MAX_BRIGHTNESS := 255
TW_NO_USB_STORAGE := true
BOARD_USE_FRAMEBUFFER_ALPHA_CHANNEL := true
TARGET_DISABLE_TRIPLE_BUFFERING := false
TW_USE_TOOLBOX := true
else
# CWM
BOARD_RECOVERY_SWIPE := true
BOARD_SUPPRESS_EMMC_WIPE := true
BOARD_USE_CUSTOM_RECOVERY_FONT := \"roboto_15x24.h\"
TARGET_RECOVERY_PIXEL_FORMAT := "RGBA_8888"
endif
63 changes: 63 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Common overlays
DEVICE_PACKAGE_OVERLAYS += device/xiaomi/nikel/overlay

# Display
PRODUCT_PACKAGES += \
libion

# GPS
PRODUCT_COPY_FILES += \
device/xiaomi/nikel/configs/etc/agps_profiles_conf2.xml:system/etc/agps_profiles_conf2.xml

# Gello
# PRODUCT_PACKAGES += \
# Gello

# Snap
PRODUCT_PACKAGES += \
Snap

# FMRadio
PRODUCT_PACKAGES += \
libfmjni \
FMRadio

# Filesystem management tools
PRODUCT_PACKAGES += \
e2fsck \
fsck.f2fs \
mkfs.f2fs \
make_ext4fs

# exFAT
PRODUCT_PACKAGES += \
mount.exfat \
fsck.exfat \
mkfs.exfat

# NTFS
PRODUCT_PACKAGES += \
fsck.ntfs \
mkfs.ntfs \
mount.ntfs

# USB
PRODUCT_PACKAGES += \
com.android.future.usb.accessory

# WallpaperPicker
PRODUCT_PACKAGES += \
WallpaperPicker

# Sensor Calibration
PRODUCT_PACKAGES += \
libem_sensor_jni

# Date
PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0

# include other configs
include device/xiaomi/nikel/permissions.mk
include device/xiaomi/nikel/media.mk
include device/xiaomi/nikel/wifi.mk
include device/xiaomi/nikel/telephony.mk
8 changes: 8 additions & 0 deletions configs/ACCDET.kl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

key 122 ENDCALL
key 163 MEDIA_NEXT
key 164 HEADSETHOOK
key 165 MEDIA_PREVIOUS
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 582 VOICE_ASSIST
23 changes: 23 additions & 0 deletions configs/AVRCP.kl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2010 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.

# Key layout used for Bluetooth AVRCP support.

key 200 MEDIA_PLAY
key 201 MEDIA_PAUSE
key 166 MEDIA_STOP
key 163 MEDIA_NEXT
key 165 MEDIA_PREVIOUS
key 168 MEDIA_REWIND
key 208 MEDIA_FAST_FORWARD
Loading

0 comments on commit 1e29b00

Please sign in to comment.