From e865d0554a9ceb6bbb62ba3330e204e4f32e0512 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 | 4 ++-- services4/system/omap3/sysconfig.h | 3 ++- services4/system/omap3/sysutils_linux.c | 23 +++++++++++++++++++++-- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 77ea3d0..17d28ec 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 650e01a..0715ec3 100644 --- a/services4/system/omap3/sysconfig.c +++ b/services4/system/omap3/sysconfig.c @@ -286,7 +286,7 @@ static IMG_CHAR *SysCreateVersionString(void) SysAcquireData(&psSysData); - ui32SGXRevision = SGX_CORE_REV; + ui32SGXRevision = cpu_is_omap3630() ? 125 : 121; ui32MaxStrLen = 99; i32Count = OSSNPrintf(aszVersionString, ui32MaxStrLen + 1, @@ -364,7 +364,7 @@ PVRSRV_ERROR SysInitialise(IMG_VOID) #if !defined(SGX_DYNAMIC_TIMING_INFO) /* Set up timing information*/ 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 234d707..322873c 100644 --- a/services4/system/omap3/sysconfig.h +++ b/services4/system/omap3/sysconfig.h @@ -56,7 +56,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #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 /* OMAP4 IRQ's are offset by 32 */ diff --git a/services4/system/omap3/sysutils_linux.c b/services4/system/omap3/sysutils_linux.c index 9f395e0..0862e0b 100644 --- a/services4/system/omap3/sysutils_linux.c +++ b/services4/system/omap3/sysutils_linux.c @@ -83,6 +83,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 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()) @@ -231,6 +236,18 @@ PVRSRV_ERROR EnableSGXClocks(SYS_DATA *psSysData) } #endif #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 + #if defined(LDM_PLATFORM) && !defined(PVR_DRI_DRM_NOT_PCI) #if defined(SYS_OMAP_HAS_DVFS_FRAMEWORK) { @@ -708,8 +725,10 @@ PVRSRV_ERROR EnableSystemClocks(SYS_DATA *psSysData) mutex_init(&psSysSpecData->sPowerLock); atomic_set(&psSysSpecData->sSGXClocksEnabled, 0); - - psCLK = clk_get(NULL, SGX_PARENT_CLOCK); + + SYS_SGX_CLOCK_SPEED = cpu_is_omap3630() ? 200000000 : 110666666; + + psCLK = clk_get(NULL, SGX_PARENT_CLOCK); if (IS_ERR(psCLK)) { PVR_DPF((PVR_DBG_ERROR, "EnableSsystemClocks: Couldn't get Core Clock")); -- 2.39.5