From 39838a52c8d525b74038ec31f76657694ca80ec6 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Mon, 11 Feb 2013 00:49:58 +0200 Subject: [PATCH] support all OMAP3s with single build --- Makefile | 2 ++ services4/system/omap3/sysconfig.c | 2 +- services4/system/omap3/sysconfig.h | 2 +- services4/system/omap3/sysutils_linux.c | 16 ++++++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ba1ce41..899e158 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ export KERNEL_SRC=$(KERNELDIR) export KDIR=$(KERNELDIR) export BUILD = release +export TI_PLATFORM ?= omap3 +export OMAPES ?= 3.x export KBUILD_EXTRA_SYMBOLS = `pwd`/services4/srvkm/env/linux/kbuild/Module.symvers diff --git a/services4/system/omap3/sysconfig.c b/services4/system/omap3/sysconfig.c index 1513950..7de860b 100644 --- a/services4/system/omap3/sysconfig.c +++ b/services4/system/omap3/sysconfig.c @@ -326,7 +326,7 @@ PVRSRV_ERROR SysInitialise(IMG_VOID) #if !defined(SGX_DYNAMIC_TIMING_INFO) psTimingInfo = &gsSGXDeviceMap.sTimingInfo; - psTimingInfo->ui32CoreClockSpeed = SYS_SGX_CLOCK_SPEED; + psTimingInfo->ui32CoreClockSpeed = cpu_is_omap3630() ? 200000000 : 110666666; psTimingInfo->ui32HWRecoveryFreq = SYS_SGX_HWRECOVERY_TIMEOUT_FREQ; #if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT) psTimingInfo->bEnableActivePM = IMG_TRUE; diff --git a/services4/system/omap3/sysconfig.h b/services4/system/omap3/sysconfig.h index 8dd1efe..e04857c 100644 --- a/services4/system/omap3/sysconfig.h +++ b/services4/system/omap3/sysconfig.h @@ -42,7 +42,7 @@ #define SYS_OMAP3430_SGX_REGS_SYS_PHYS_BASE 0x50000000 -#define SYS_OMAP3430_SGX_REGS_SIZE 0x4000 +#define SYS_OMAP3430_SGX_REGS_SIZE 0x10000 #define SYS_OMAP3430_SGX_IRQ 21 diff --git a/services4/system/omap3/sysutils_linux.c b/services4/system/omap3/sysutils_linux.c index e6b0644..df7cbf1 100644 --- a/services4/system/omap3/sysutils_linux.c +++ b/services4/system/omap3/sysutils_linux.c @@ -55,6 +55,10 @@ extern struct platform_device *gpsPVRLDMDev; #endif +#undef SYS_SGX_CLOCK_SPEED +#define SYS_SGX_CLOCK_SPEED sgx_clock_speed +static int sgx_clock_speed; + static PVRSRV_ERROR PowerLockWrap(SYS_SPECIFIC_DATA *psSysSpecData, IMG_BOOL bTryLock) { if (!in_interrupt()) @@ -208,6 +212,16 @@ PVRSRV_ERROR EnableSGXClocks(SYS_DATA *psSysData) PVR_DPF((PVR_DBG_MESSAGE, "EnableSGXClocks: SGX Functional Clock is %dMhz", HZ_TO_MHZ(rate))); } #endif +#if 1 + { + static int logged; + IMG_UINT32 rate = clk_get_rate(psSysSpecData->psSGX_FCK); + if (!logged) { + printk(KERN_INFO "SGX clock rate: %u\n", rate); + logged = 1; + } + } +#endif @@ -521,6 +535,8 @@ PVRSRV_ERROR EnableSystemClocks(SYS_DATA *psSysData) atomic_set(&psSysSpecData->sSGXClocksEnabled, 0); + SYS_SGX_CLOCK_SPEED = cpu_is_omap3630() ? 200000000 : 110666666; + psCLK = clk_get(NULL, SGX_PARENT_CLOCK); if (IS_ERR(psCLK)) { -- 2.39.5