Search
SailfishOS Open Build Service
>
Projects
>
home:mike7b4
:
bbb
>
kernel-adaptation-bbb-v3.12
> 0092-Changes-according-to-TI-for-SGX-support.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0092-Changes-according-to-TI-for-SGX-support.patch of Package kernel-adaptation-bbb-v3.12
From 3f7345f4c23861f99d8f85b64bcde0cf0b31e2ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20R=C3=B6ssler?= <mail.aroessler@gmail.com> Date: Fri, 1 Nov 2013 15:35:26 +0100 Subject: [PATCH 92/96] Changes according to TI for SGX support --- arch/arm/mach-omap2/Makefile | 2 +- arch/arm/mach-omap2/board-generic.c | 4 ++++ arch/arm/mach-omap2/common.h | 1 + arch/arm/mach-omap2/gpu.c | 47 +++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-omap2/gpu.c diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 0afee42..42c1192 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -8,7 +8,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ # Common support obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \ common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \ - omap_device.o sram.o + omap_device.o sram.o gpu.o omap-2-3-common = irq.o hwmod-common = omap_hwmod.o omap_hwmod_reset.o \ diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index c0b0848..33d0136 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c @@ -22,6 +22,7 @@ #include "common.h" #include "common-board-devices.h" #include "dss-common.h" +#include "soc.h" #if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)) #define intc_of_init NULL @@ -70,6 +71,9 @@ static void __init omap_generic_init(void) omap_4430sdp_display_init_of(); else if (of_machine_is_compatible("ti,omap5-uevm")) legacy_init_ehci_clk("auxclk1_ck"); + + if (omap3_has_sgx()) + omap_sgx_init_of(); } #ifdef CONFIG_SOC_OMAP2420 diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 352fa9d..a41653f 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -301,6 +301,7 @@ extern void omap_reserve(void); struct omap_hwmod; extern int omap_dss_reset(struct omap_hwmod *); +void __init omap_sgx_init_of(void); /* SoC specific clock initializer */ extern int (*omap_clk_init)(void); diff --git a/arch/arm/mach-omap2/gpu.c b/arch/arm/mach-omap2/gpu.c new file mode 100644 index 0000000..eebb1bd --- /dev/null +++ b/arch/arm/mach-omap2/gpu.c @@ -0,0 +1,47 @@ +/* + * Deassert reset for AM33xx graphics device(SGX) hwmod + * + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ + * Prathap MS <msprathap@ti.com> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#include <linux/of_platform.h> +#include "omap_device.h" + +void __init omap_sgx_init_of(void) +{ + struct device_node *node; + struct platform_device *pdev; + int ret = 0; + node = of_find_compatible_node(NULL, NULL, "ti,sgx"); + if (!node) + return; + pdev = of_find_device_by_node(node); + if (!pdev) { + pr_warn("of_find_device_by_node() failed for sgx\n"); + return; + } + ret = omap_device_deassert_hardreset(pdev, "gfx"); + if (ret != 0) + pr_warn("omap_device_deassert_hardreset() failed for sgx(gfx hwmod)\n"); + + node = of_find_compatible_node(NULL, NULL, "ti,am335x-timer"); + if (!node) + return; + pdev = of_find_device_by_node(node); + if (!pdev) { + pr_warn("of_find_device_by_node() failed for sgx\n"); + return; + } + ret = omap_device_deassert_hardreset(pdev, "timer7"); + if (ret != 0) + pr_warn("omap_device_deassert_hardreset() failed for sgx(gfx hwmod)\n"); +} -- 1.9.1