[mali] update gpu integration

This commit is contained in:
Mauro (mdrjr) Ribeiro
2017-04-06 09:33:00 -03:00
parent b67bca1ecc
commit 66a3c19c9e
6 changed files with 122 additions and 13 deletions

View File

@@ -92,6 +92,11 @@
clock-names = "fout_vpll", "dout_aclk_g3d", "clk_mali";
gpu-supply = <&buck4_reg>;
operating-points = <
/* KHz uV */
600000 1150000
177000 812500
>;
status = "disabled";
};

View File

@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.9.13 Kernel Configuration
# Linux/arm 4.9.20 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
@@ -3602,16 +3602,15 @@ CONFIG_DRM_PARADE_PS8622=y
#
CONFIG_MALI_MIDGARD=y
# CONFIG_MALI_GATOR_SUPPORT is not set
# CONFIG_MALI_MIDGARD_DVFS is not set
# CONFIG_MALI_MIDGARD_ENABLE_TRACE is not set
# CONFIG_MALI_DEVFREQ is not set
CONFIG_MALI_DEVFREQ=y
CONFIG_MALI_DMA_FENCE=y
CONFIG_MALI_EXPERT=y
# CONFIG_MALI_PRFCNT_SET_SECONDARY is not set
# CONFIG_MALI_PLATFORM_FAKE is not set
# CONFIG_MALI_PLATFORM_DEVICETREE is not set
CONFIG_MALI_PLATFORM_THIRDPARTY=y
CONFIG_MALI_PLATFORM_THIRDPARTY_NAME="odroid5422"
CONFIG_MALI_PLATFORM_THIRDPARTY_NAME="exynos5422"
# CONFIG_MALI_DEBUG is not set
# CONFIG_MALI_NO_MALI is not set
# CONFIG_MALI_TRACE_TIMELINE is not set
@@ -4571,6 +4570,7 @@ CONFIG_PRISM2_USB=m
CONFIG_STAGING_MEDIA=y
# CONFIG_I2C_BCM2048 is not set
# CONFIG_MEDIA_CEC is not set
# CONFIG_LIRC_STAGING is not set
#
# Android

View File

@@ -53,6 +53,8 @@ kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags)
unsigned long freq = 0;
unsigned long voltage;
int err;
struct clk *fout_vpll;
struct clk *dout_aclk_g3d;
freq = *target_freq;
@@ -65,14 +67,6 @@ kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags)
return PTR_ERR(opp);
}
/*
* Only update if there is a change of frequency
*/
if (kbdev->current_freq == freq) {
*target_freq = freq;
return 0;
}
#ifdef CONFIG_REGULATOR
if (kbdev->regulator && kbdev->current_voltage != voltage
&& kbdev->current_freq < freq) {
@@ -84,12 +78,47 @@ kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags)
}
#endif
/*
* Only update if there is a change of frequency
*/
if (kbdev->current_freq == freq) {
*target_freq = freq;
return 0;
}
fout_vpll = clk_get(NULL, "fout_vpll");
if (IS_ERR_OR_NULL(fout_vpll)) {
dev_err(dev, "Failed to get clock [fout_vpll]\n");
return PTR_ERR(fout_vpll);
}
dout_aclk_g3d = clk_get(kbdev->dev, "dout_aclk_g3d");
if (IS_ERR_OR_NULL(dout_aclk_g3d)) {
dev_err(dev, "Failed to get clock [dout_aclk_g3d]\n");
return PTR_ERR(dout_aclk_g3d);
}
if (freq != clk_get_rate(fout_vpll)) {
err = clk_set_rate(fout_vpll, freq);
if (err < 0) {
dev_err(dev, "Failed to set clock [fout_vpll] to %lu (%d)\n", freq, err);
return err;
}
}
err = clk_set_rate(dout_aclk_g3d, freq);
if (err < 0) {
dev_err(dev, "Failed to set clock [dout_aclk_g3d] to %lu (%d)\n", freq, err);
return err;
}
/*
err = clk_set_rate(kbdev->clock, freq);
if (err) {
dev_err(dev, "Failed to set clock %lu (target %lu)\n",
freq, *target_freq);
return err;
}
*/
#ifdef CONFIG_REGULATOR
if (kbdev->regulator && kbdev->current_voltage != voltage
@@ -223,7 +252,7 @@ int kbase_devfreq_init(struct kbase_device *kbdev)
return -EFAULT;
kbdev->devfreq = devfreq_add_device(kbdev->dev, dp,
"simple_ondemand", NULL);
"performance", NULL);
if (IS_ERR(kbdev->devfreq)) {
kbase_devfreq_term_freq_table(kbdev);
return PTR_ERR(kbdev->devfreq);

View File

@@ -0,0 +1 @@
obj-y += exynos5422.o

View File

@@ -0,0 +1,54 @@
/*
* Copyright (C) 2015 Samsung Electronics Co.Ltd
*
* 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.
*/
#include <mali_kbase.h>
#include <mali_kbase_defs.h>
#include <mali_kbase_config.h>
#include <linux/pm_runtime.h>
#include <linux/suspend.h>
static int exynos5422_platform_init(struct kbase_device *kbdev)
{
return 0;
}
static void exynos5422_platform_term(struct kbase_device *kbdev)
{
}
struct kbase_platform_funcs_conf platform_funcs = {
.platform_init_func = exynos5422_platform_init,
.platform_term_func = exynos5422_platform_term,
};
static struct kbase_platform_config exynos5422_platform_config = {
};
struct kbase_platform_config *kbase_get_platform_config(void)
{
return &exynos5422_platform_config;
}
struct kbase_pm_callback_conf pm_callbacks = {
.power_on_callback = exynos5422_platform_init,
.power_off_callback = exynos5422_platform_term,
.power_suspend_callback = NULL,
.power_resume_callback = NULL,
.power_runtime_init_callback = NULL,
.power_runtime_term_callback = NULL,
.power_runtime_on_callback = NULL,
.power_runtime_off_callback = NULL,
};
int kbase_platform_early_init(void)
{
/* Nothing needed at this stage */
return 0;
}

View File

@@ -0,0 +1,20 @@
/*
* Copyright (C) 2015 Samsung Electronics Co.Ltd
*
* 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.
*/
#define GPU_FREQ_KHZ_MAX 600000
#define GPU_FREQ_KHZ_MIN 600000
#define CPU_SPEED_FUNC (NULL)
#define GPU_SPEED_FUNC (NULL)
#define PLATFORM_FUNCS (&platform_funcs)
extern struct kbase_platform_funcs_conf platform_funcs;
#define POWER_MANAGEMENT_CALLBACKS (&pm_callbacks)
extern struct kbase_pm_callback_conf pm_callbacks;