Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fddc0542 authored by Kshitij's avatar Kshitij
Browse files

linux-4.9: Import MediaTek kernel-4.9 alps-release-q0.mp1

Change-Id: Ifff8ba5ab313e2dce1cd78acc43b1ab77b7a7252
parent 9595aa87
Loading
Loading
Loading
Loading

Android.mk

0 → 100644
+96 −0
Original line number Diff line number Diff line
# Copyright (C) 2017 MediaTek Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See http://www.gnu.org/licenses/gpl-2.0.html for more details.

LOCAL_PATH := $(call my-dir)

ifeq ($(notdir $(LOCAL_PATH)),$(strip $(LINUX_KERNEL_VERSION)))
ifneq ($(strip $(TARGET_NO_KERNEL)),true)
include $(LOCAL_PATH)/kenv.mk

ifeq ($(wildcard $(TARGET_PREBUILT_KERNEL)),)
KERNEL_MAKE_DEPENDENCIES := $(shell find $(KERNEL_DIR) -name .git -prune -o -type f | sort)
KERNEL_MAKE_DEPENDENCIES := $(filter-out %/.git %/.gitignore %/.gitattributes,$(KERNEL_MAKE_DEPENDENCIES))

$(TARGET_KERNEL_CONFIG): PRIVATE_DIR := $(KERNEL_DIR)
$(TARGET_KERNEL_CONFIG): $(KERNEL_CONFIG_FILE) $(LOCAL_PATH)/Android.mk
$(TARGET_KERNEL_CONFIG): $(KERNEL_MAKE_DEPENDENCIES)
	$(hide) mkdir -p $(dir $@)
	$(PREBUILT_MAKE_PREFIX)$(MAKE) -C $(PRIVATE_DIR) $(KERNEL_MAKE_OPTION) $(KERNEL_DEFCONFIG)

$(BUILT_DTB_OVERLAY_TARGET): $(KERNEL_ZIMAGE_OUT)

.KATI_RESTAT: $(KERNEL_ZIMAGE_OUT)
$(KERNEL_ZIMAGE_OUT): PRIVATE_DIR := $(KERNEL_DIR)
$(KERNEL_ZIMAGE_OUT): $(TARGET_KERNEL_CONFIG) $(KERNEL_MAKE_DEPENDENCIES)
	$(hide) mkdir -p $(dir $@)
	$(PREBUILT_MAKE_PREFIX)$(MAKE) -C $(PRIVATE_DIR) $(KERNEL_MAKE_OPTION)
	$(hide) $(call fixup-kernel-cmd-file,$(KERNEL_OUT)/arch/$(KERNEL_TARGET_ARCH)/boot/compressed/.piggy.xzkern.cmd)
	# check the kernel image size
	python device/mediatek/build/build/tools/check_kernel_size.py $(KERNEL_OUT) $(KERNEL_DIR)

ifeq ($(strip $(MTK_HEADER_SUPPORT)), yes)
$(BUILT_KERNEL_TARGET): $(KERNEL_ZIMAGE_OUT) $(TARGET_KERNEL_CONFIG) $(LOCAL_PATH)/Android.mk | $(HOST_OUT_EXECUTABLES)/mkimage$(HOST_EXECUTABLE_SUFFIX)
	$(hide) $(HOST_OUT_EXECUTABLES)/mkimage$(HOST_EXECUTABLE_SUFFIX) $< KERNEL 0xffffffff > $@
else
$(BUILT_KERNEL_TARGET): $(KERNEL_ZIMAGE_OUT) $(TARGET_KERNEL_CONFIG) $(LOCAL_PATH)/Android.mk | $(ACP)
	$(copy-file-to-target)
endif

$(TARGET_PREBUILT_KERNEL): $(BUILT_KERNEL_TARGET) $(LOCAL_PATH)/Android.mk | $(ACP)
	$(copy-file-to-new-target)

endif#TARGET_PREBUILT_KERNEL is empty

$(INSTALLED_KERNEL_TARGET): $(BUILT_KERNEL_TARGET) $(LOCAL_PATH)/Android.mk | $(ACP)
	$(copy-file-to-target)

.PHONY: kernel save-kernel kernel-savedefconfig kernel-menuconfig menuconfig-kernel savedefconfig-kernel clean-kernel
kernel: $(INSTALLED_KERNEL_TARGET)
save-kernel: $(TARGET_PREBUILT_KERNEL)

kernel-savedefconfig: $(TARGET_KERNEL_CONFIG)
	cp $(TARGET_KERNEL_CONFIG) $(KERNEL_CONFIG_FILE)

kernel-menuconfig:
	$(hide) mkdir -p $(KERNEL_OUT)
	$(MAKE) -C $(KERNEL_DIR) $(KERNEL_MAKE_OPTION) menuconfig

menuconfig-kernel savedefconfig-kernel:
	$(hide) mkdir -p $(KERNEL_OUT)
	$(MAKE) -C $(KERNEL_DIR) $(KERNEL_MAKE_OPTION) $(patsubst %config-kernel,%config,$@)

clean-kernel:
	$(hide) rm -rf $(KERNEL_OUT) $(KERNEL_MODULES_OUT) $(INSTALLED_KERNEL_TARGET)
	$(hide) rm -f $(INSTALLED_DTB_OVERLAY_TARGET)


.PHONY: check-kernel-config check-kernel-dotconfig check-mtk-config
droid: check-kernel-config check-kernel-dotconfig
check-mtk-config: check-kernel-config check-kernel-dotconfig
check-kernel-config: PRIVATE_COMMAND := $(if $(wildcard device/mediatek/build/build/tools/check_kernel_config.py),$(if $(filter yes,$(DISABLE_MTK_CONFIG_CHECK)),-)python device/mediatek/build/build/tools/check_kernel_config.py -c $(MTK_TARGET_PROJECT_FOLDER)/ProjectConfig.mk -k $(KERNEL_CONFIG_FILE) -p $(MTK_PROJECT_NAME))
check-kernel-config:
	$(PRIVATE_COMMAND)

check-kernel-dotconfig: PRIVATE_COMMAND := $(if $(wildcard device/mediatek/build/build/tools/check_kernel_config.py),$(if $(filter yes,$(DISABLE_MTK_CONFIG_CHECK)),-)python device/mediatek/build/build/tools/check_kernel_config.py -c $(MTK_TARGET_PROJECT_FOLDER)/ProjectConfig.mk -k $(TARGET_KERNEL_CONFIG) -p $(MTK_PROJECT_NAME))
check-kernel-dotconfig: $(TARGET_KERNEL_CONFIG)
	$(PRIVATE_COMMAND)

### DTB
ifdef BOARD_PREBUILT_DTBIMAGE_DIR
INSTALLED_MTK_DTB_TARGET := $(BOARD_PREBUILT_DTBIMAGE_DIR)/mtk_dtb
$(shell if [ ! -f $(INSTALLED_MTK_DTB_TARGET) ]; then mkdir -p $(dir $(INSTALLED_MTK_DTB_TARGET)); touch $(INSTALLED_MTK_DTB_TARGET);fi)
$(INSTALLED_MTK_DTB_TARGET): $(INSTALLED_KERNEL_TARGET)
	@mkdir -p $(dir $@)
	@cp -f $(KERNEL_DTB_FILE) $@
endif

endif#TARGET_NO_KERNEL
endif#LINUX_KERNEL_VERSION

CleanSpec.mk

0 → 100644
+16 −0
Original line number Diff line number Diff line
# Copyright (c) 2015 MediaTek Inc.
#
# 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.

# dummy file
# To avoid scanning kernel when using findleaves.py to search CleanSpec.mk
+90 −0
Original line number Diff line number Diff line
#
# (C) COPYRIGHT 2013-2015 ARM Limited. All rights reserved.
#
# This program is free software and is provided to you under the terms of the
# GNU General Public License version 2 as published by the Free Software
# Foundation, and any use by you of this program is subject to the terms
# of such GNU licence.
#
# A copy of the licence is included with the program.
#
#


* ARM Mali Midgard devices


Required properties:

- compatible : Should be mali<chip>, replacing digits with x from the back,
until malit<Major>xx, ending with arm,mali-midgard, the latter not optional.
- reg : Physical base address of the device and length of the register area.
- interrupts : Contains the three IRQ lines required by T-6xx devices
- interrupt-names : Contains the names of IRQ resources in the order they were
provided in the interrupts property. Must contain: "JOB, "MMU", "GPU".

Optional:

- clocks : Phandle to clock for the Mali T-6xx device.
- clock-names : Shall be "clk_mali".
- mali-supply : Phandle to regulator for the Mali device. Refer to
Documentation/devicetree/bindings/regulator/regulator.txt for details.
- operating-points : Refer to Documentation/devicetree/bindings/power/opp.txt
for details.
- snoop_enable_smc : SMC function ID to enable CCI snooping on the GPU port(s).
- snoop_disable_smc : SMC function ID to disable CCI snooping on the GPU port(s).
- jm_config : For T860/T880. Sets job manager configuration. An array containing:
	- 1 to override the TIMESTAMP value, 0 otherwise.
	- 1 to override clock gate, forcing them to be always on, 0 otherwise.
	- 1 to enable job throttle, limiting the number of cores that can be started
	  simultaneously, 0 otherwise.
	- Value between 0 and 63 (including). If job throttle is enabled, this is one
	  less than the number of cores that can be started simultaneously.
- power_model : Sets power model parameters. Note that this model was designed for the Juno
	        platform, and may not be suitable for other platforms. A structure containing :
	- compatible: Should be arm,mali-simple-power-model
	- voltage: Voltage at reference point. Specified in mV.
	- frequency: Frequency at reference point. Specified in MHz.
	- dynamic-power: Dynamic power at reference frequency and voltage. Specified in mW.
	- static-power: Static power at reference frequency. Specified in mW.
	- ts: An array containing coefficients for the temperature scaling factor.
	  Used as : tsf = ts[3]*T^3 + ts[2]*T^2 + ts[1]*T + ts[0], where T = temperature
	- thermal-zone: A string identifying the thermal zone used for the GPU
- system-coherency : Sets the coherency protocol to be used for coherent
		     accesses made from the GPU.
		     If not set then no coherency is used.
	- 0  : ACE-Lite
	- 1  : ACE
	- 31 : No coherency

Example for a Mali-T602:

gpu@0xfc010000 {
	compatible = "arm,malit602", "arm,malit60x", "arm,malit6xx", "arm,mali-midgard";
	reg = <0xfc010000 0x4000>;
	interrupts = <0 36 4>, <0 37 4>, <0 38 4>;
	interrupt-names = "JOB", "MMU", "GPU";

	clocks = <&pclk_mali>;
	clock-names = "clk_mali";
	mali-supply = <&vdd_mali>;
	operating-points = <
		/* KHz   uV */
		533000 1250000,
		450000 1150000,
		400000 1125000,
		350000 1075000,
		266000 1025000,
		160000  925000,
		100000  912500,
	>;
	power_model {
		compatible = "arm,mali-simple-power-model";
		voltage = <800>;
		frequency = <500>;
		static-power = <500>;
		dynamic-power = <1500>;
		ts = <20000 2000 (-20) 2>;
		thermal-zone = "gpu";
	};
};
+24 −0
Original line number Diff line number Diff line
MediaTek GCE
===============

The Global Command Engine (GCE) is used to help read/write registers with
critical time limitation, such as updating display configuration during the
vblank. The GCE can be used to implement the Command Queue (CMDQ) driver.

Required properties:
- compatible: Must be "mediatek,gce"
- reg: Address range of the GCE unit
- interrupts: The interrupt signal from the GCE block
- clock: Clocks according to the common clock binding
- clock-names: Must be "GCE" to stand for GCE clock

Example:

	gce: gce@10212000 {
		compatible = "mediatek,gce";
		reg = <0 0x10212000 0 0x1000>;
		interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_LOW>;
		clocks = <&infracfg_ao INFRACFG_AO_GCE_CG>;
		clock-names = "GCE";
	};
+25 −0
Original line number Diff line number Diff line
MediaTek GCE Secure Video Path Support Driver
===============

The Global Command Engine (GCE) is used to help read/write registers with
critical time limitation, such as updating display configuration during the
vblank. The GCE can be used to implement the Command Queue (CMDQ) driver.
Secure Video Path driver can protect premium video content leakage

Required properties:
- compatible: Must be "mediatek,mailbox-gce-svp"
- reg: Address range of the GCE unit
- interrupts: The interrupt signal from the GCE block
- clock: Clocks according to the common clock binding
- clock-names: Must be "gce" to stand for GCE clock

Example:

	gce_mbox_svp: gce_mbox_svp@10238000 {
		compatible = "mediatek,mailbox-gce-svp";
		reg = <0 0x10238000 0 0x1000>;
		interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_LOW>;
		clocks = <&infracfg_ao INFRACFG_AO_GCE_CG>;
		clock-names = "gce";
	};
Loading