|
| 1 | +From 3f6489554b75d55cd20443f3202bbda8096499b4 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Guillaume Tucker < [email protected]> |
| 3 | +Date: Mon, 23 Feb 2015 11:52:29 +0000 |
| 4 | +Subject: [PATCH 02/10] drivers/gpu/arm/utgard: add option for custom device |
| 5 | + tree |
| 6 | + |
| 7 | +Some Mali 450 Utgard GPU platform integration files like |
| 8 | +the HiKey need a custom Device Tree entry. This config |
| 9 | +option is to disable the standard driver code that expects |
| 10 | +things in the device tree which conflict with what the |
| 11 | +platform files need. |
| 12 | + |
| 13 | +This is only an interim solution, tne platform files should |
| 14 | +really be tidied-up to enable the standard device tree |
| 15 | +instead (would require adding more IRQ and other resources). |
| 16 | + |
| 17 | +Signed-off-by: Guillaume Tucker < [email protected]> |
| 18 | +--- |
| 19 | + drivers/gpu/arm/utgard/Kconfig | 12 ++++++++++++ |
| 20 | + drivers/gpu/arm/utgard/common/mali_kernel_core.c | 2 +- |
| 21 | + drivers/gpu/arm/utgard/common/mali_osk_mali.h | 2 +- |
| 22 | + drivers/gpu/arm/utgard/linux/mali_osk_mali.c | 4 ++-- |
| 23 | + 4 files changed, 16 insertions(+), 4 deletions(-) |
| 24 | + |
| 25 | +--- a/drivers/gpu/arm/utgard/Kconfig |
| 26 | ++++ b/drivers/gpu/arm/utgard/Kconfig |
| 27 | +@@ -96,6 +96,18 @@ config MALI_DT |
| 28 | + device tree is enabled in kernel and corresponding hardware description is implemented |
| 29 | + properly in device DTS file. |
| 30 | + |
| 31 | ++config MALI_PLAT_SPECIFIC_DT |
| 32 | ++ bool "Platform specific Device Tree is being used" |
| 33 | ++ depends on MALI_DT |
| 34 | ++ default n |
| 35 | ++ ---help--- |
| 36 | ++ This is a pragmatic approach for some platforms which make |
| 37 | ++ use of a device tree entry that does not strictly comply to |
| 38 | ++ what the standard Utgard driver expects to find, but have |
| 39 | ++ their platform data implemented the old way. Such platforms |
| 40 | ++ should be converted to using the Device Tree so this |
| 41 | ++ configuration option can be removed. |
| 42 | ++ |
| 43 | + config MALI_QUIET |
| 44 | + bool "Make Mali driver very quiet" |
| 45 | + depends on MALI400 && !MALI400_DEBUG |
| 46 | +--- a/drivers/gpu/arm/utgard/common/mali_kernel_core.c |
| 47 | ++++ b/drivers/gpu/arm/utgard/common/mali_kernel_core.c |
| 48 | +@@ -738,7 +738,7 @@ _mali_osk_errcode_t mali_initialize_subs |
| 49 | + { |
| 50 | + _mali_osk_errcode_t err; |
| 51 | + |
| 52 | +-#ifdef CONFIG_MALI_DT |
| 53 | ++#if defined(CONFIG_MALI_DT) && !defined(CONFIG_MALI_PLAT_SPECIFIC_DT) |
| 54 | + err = _mali_osk_resource_initialize(); |
| 55 | + if (_MALI_OSK_ERR_OK != err) { |
| 56 | + mali_terminate_subsystems(); |
| 57 | +--- a/drivers/gpu/arm/utgard/common/mali_osk_mali.h |
| 58 | ++++ b/drivers/gpu/arm/utgard/common/mali_osk_mali.h |
| 59 | +@@ -30,7 +30,7 @@ extern "C" { |
| 60 | + */ |
| 61 | + typedef struct mali_gpu_device_data _mali_osk_device_data; |
| 62 | + |
| 63 | +-#ifdef CONFIG_MALI_DT |
| 64 | ++#if defined(CONFIG_MALI_DT) && !defined(CONFIG_MALI_PLAT_SPECIFIC_DT) |
| 65 | + /** @brief Initialize those device resources when we use device tree |
| 66 | + * |
| 67 | + * @return _MALI_OSK_ERR_OK on success, otherwise failure. |
| 68 | +--- a/drivers/gpu/arm/utgard/linux/mali_osk_mali.c |
| 69 | ++++ b/drivers/gpu/arm/utgard/linux/mali_osk_mali.c |
| 70 | +@@ -25,7 +25,7 @@ |
| 71 | + #include "mali_kernel_linux.h" |
| 72 | + |
| 73 | + |
| 74 | +-#ifdef CONFIG_MALI_DT |
| 75 | ++#if defined(CONFIG_MALI_DT) && !defined(CONFIG_MALI_PLAT_SPECIFIC_DT) |
| 76 | + |
| 77 | + #define MALI_OSK_INVALID_RESOURCE_ADDRESS 0xFFFFFFFF |
| 78 | + |
| 79 | +@@ -248,7 +248,7 @@ u32 _mali_osk_get_pmu_switch_delay(void) |
| 80 | + return 0; |
| 81 | + } |
| 82 | + |
| 83 | +-#else /* CONFIG_MALI_DT */ |
| 84 | ++#else /* CONFIG_MALI_DT && !CONFIG_MALI_PLAT_SPECIFIC_DT */ |
| 85 | + |
| 86 | + _mali_osk_errcode_t _mali_osk_resource_find(u32 addr, _mali_osk_resource_t *res) |
| 87 | + { |
0 commit comments