summaryrefslogtreecommitdiff
path: root/drivers/gpu/arm/midgard/platform/vexpress
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/arm/midgard/platform/vexpress')
-rw-r--r--drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_config_platform.h21
-rw-r--r--drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_config_vexpress.c2
-rw-r--r--drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_cpu_vexpress.c77
-rw-r--r--drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_cpu_vexpress.h26
4 files changed, 38 insertions, 88 deletions
diff --git a/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_config_platform.h b/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_config_platform.h
index dc4471beae67..6384586371d0 100644
--- a/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_config_platform.h
+++ b/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_config_platform.h
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2014-2016 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2014-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
@@ -24,7 +24,7 @@
* Attached value: number in kHz
* Default value: NA
*/
-#define GPU_FREQ_KHZ_MAX kbase_get_platform_max_freq()
+#define GPU_FREQ_KHZ_MAX (5000)
/**
* Minimum frequency GPU will be clocked at. Given in kHz.
* This must be specified as there is no default value.
@@ -32,7 +32,16 @@
* Attached value: number in kHz
* Default value: NA
*/
-#define GPU_FREQ_KHZ_MIN kbase_get_platform_min_freq()
+#define GPU_FREQ_KHZ_MIN (5000)
+
+/**
+ * Values used for determining the GPU frequency based on the LogicTile type
+ * Used by the function kbase_get_platform_logic_tile_type
+ */
+#define VE_VIRTEX6_GPU_FREQ_MIN 5000
+#define VE_VIRTEX6_GPU_FREQ_MAX 5000
+#define VE_VIRTEX7_GPU_FREQ_MIN 40000
+#define VE_VIRTEX7_GPU_FREQ_MAX 40000
/**
* CPU_SPEED_FUNC - A pointer to a function that calculates the CPU clock
@@ -73,10 +82,10 @@
#define PLATFORM_FUNCS (NULL)
/**
- * Protected mode switch
+ * Secure mode switch
*
- * Attached value: pointer to @ref kbase_protected_ops
+ * Attached value: pointer to @ref kbase_secure_ops
*/
-#define PROTECTED_CALLBACKS (NULL)
+#define SECURE_CALLBACKS (NULL)
extern struct kbase_pm_callback_conf pm_callbacks;
diff --git a/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_config_vexpress.c b/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_config_vexpress.c
index 15ce2bc5eea5..687b1a8c0431 100644
--- a/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_config_vexpress.c
+++ b/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_config_vexpress.c
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2011-2016 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2011-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
diff --git a/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_cpu_vexpress.c b/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_cpu_vexpress.c
index 4665f98cbbe4..9bc51f1e2da8 100644
--- a/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_cpu_vexpress.c
+++ b/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_cpu_vexpress.c
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2011-2016 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2011-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
@@ -52,18 +52,6 @@
#define IS_SINGLE_BIT_SET(val, pos) (val&(1<<pos))
-/**
- * Values used for determining the GPU frequency based on the LogicTile type
- * Used by the function kbase_get_platform_logic_tile_type
- */
-#define VE_VIRTEX6_GPU_FREQ_MIN 5000
-#define VE_VIRTEX6_GPU_FREQ_MAX 5000
-#define VE_VIRTEX7_GPU_FREQ_MIN 40000
-#define VE_VIRTEX7_GPU_FREQ_MAX 40000
-#define VE_DEFAULT_GPU_FREQ_MIN 5000
-#define VE_DEFAULT_GPU_FREQ_MAX 5000
-
-
#define CPU_CLOCK_SPEED_UNDEFINED (0)
static u32 cpu_clock_speed = CPU_CLOCK_SPEED_UNDEFINED;
@@ -209,71 +197,14 @@ syscfg_reg_map_failed:
return err;
}
-/**
- * kbase_get_platform_logic_tile_type - determines which LogicTile type
- * is used by Versatile Express
- *
- * When platform_config build parameter is specified as vexpress, i.e.,
- * platform_config=vexpress, GPU frequency may vary dependent on the
- * particular platform. The GPU frequency depends on the LogicTile type.
- *
- * This function determines which LogicTile type is used by the platform by
- * reading the HBI value of the daughterboard which holds the LogicTile:
- *
- * 0x217 HBI0217 Virtex-6
- * 0x192 HBI0192 Virtex-5
- * 0x247 HBI0247 Virtex-7
- *
- * Return: HBI value of the logic tile daughterboard, zero if not accessible
- */
-static u32 kbase_get_platform_logic_tile_type(void)
+u32 kbase_get_platform_logic_tile_type(void)
{
void __iomem *syscfg_reg = NULL;
u32 sys_procid1 = 0;
syscfg_reg = ioremap(VE_MOTHERBOARD_PERIPHERALS_SMB_CS7 + VE_SYS_PROC_ID1_OFFSET, 4);
- if (NULL != syscfg_reg) {
- sys_procid1 = readl(syscfg_reg);
- iounmap(syscfg_reg);
- }
- return sys_procid1 & VE_LOGIC_TILE_HBI_MASK;
-}
-
-u32 kbase_get_platform_min_freq(void)
-{
- u32 ve_logic_tile = kbase_get_platform_logic_tile_type();
-
- switch (ve_logic_tile) {
- case 0x217:
- /* Virtex 6, HBI0217 */
- return VE_VIRTEX6_GPU_FREQ_MIN;
- case 0x247:
- /* Virtex 7, HBI0247 */
- return VE_VIRTEX7_GPU_FREQ_MIN;
- default:
- /* all other logic tiles, i.e., Virtex 5 HBI0192
- * or unsuccessful reading from the platform -
- * fall back to some default value */
- return VE_DEFAULT_GPU_FREQ_MIN;
- }
-}
+ sys_procid1 = (NULL != syscfg_reg) ? readl(syscfg_reg) : 0;
-u32 kbase_get_platform_max_freq(void)
-{
- u32 ve_logic_tile = kbase_get_platform_logic_tile_type();
-
- switch (ve_logic_tile) {
- case 0x217:
- /* Virtex 6, HBI0217 */
- return VE_VIRTEX6_GPU_FREQ_MAX;
- case 0x247:
- /* Virtex 7, HBI0247 */
- return VE_VIRTEX7_GPU_FREQ_MAX;
- default:
- /* all other logic tiles, i.e., Virtex 5 HBI0192
- * or unsuccessful reading from the platform -
- * fall back to some default value */
- return VE_DEFAULT_GPU_FREQ_MAX;
- }
+ return sys_procid1 & VE_LOGIC_TILE_HBI_MASK;
}
diff --git a/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_cpu_vexpress.h b/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_cpu_vexpress.h
index da865698133a..ef9bfd721618 100644
--- a/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_cpu_vexpress.h
+++ b/drivers/gpu/arm/midgard/platform/vexpress/mali_kbase_cpu_vexpress.h
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2012-2013, 2015-2016 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2012-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
@@ -26,13 +26,23 @@
int kbase_get_vexpress_cpu_clock_speed(u32 *cpu_clock);
/**
- * Get the minimum GPU frequency for the attached logic tile
- */
-u32 kbase_get_platform_min_freq(void);
-
-/**
- * Get the maximum GPU frequency for the attached logic tile
+ * kbase_get_platform_logic_tile_type - determines which LogicTile type
+ * is used by Versatile Express
+ *
+ * When platform_config build parameter is specified as vexpress, i.e.,
+ * platform_config=vexpress, GPU frequency may vary dependent on the
+ * particular platform. The GPU frequency depends on the LogicTile type.
+ *
+ * This function is called by kbase_common_device_init to determine
+ * which LogicTile type is used by the platform by reading the HBI value
+ * of the daughterboard which holds the LogicTile:
+ *
+ * 0x192 HBI0192 Virtex-5
+ * 0x217 HBI0217 Virtex-6
+ * 0x247 HBI0247 Virtex-7
+ *
+ * Return: HBI value of the logic tile daughterboard, zero if not accessible
*/
-u32 kbase_get_platform_max_freq(void);
+u32 kbase_get_platform_logic_tile_type(void);
#endif /* _KBASE_CPU_VEXPRESS_H_ */