summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishal Mahaveer2013-07-19 16:52:33 -0500
committerVishal Mahaveer2013-07-19 17:35:02 -0500
commitba006b660ca16c864fcfe041805ddb5e65e8f3d8 (patch)
treef86f92ecd65ec67b5abda0d578aea993426c9e8e
parent6c58e520dc17fb08fa66b4e116f9c822c57e1bb3 (diff)
downloaddevice-ti-proprietary-open-ba006b660ca16c864fcfe041805ddb5e65e8f3d8.tar.gz
device-ti-proprietary-open-ba006b660ca16c864fcfe041805ddb5e65e8f3d8.tar.xz
device-ti-proprietary-open-ba006b660ca16c864fcfe041805ddb5e65e8f3d8.zip
proprietary-open: jacinto6: add graphics binaries and kernel module sources
Adding graphics kernel module sources and DDK binaries. Branch: origin/1.9/2291151_k3.8 Commit: e38b375eaf17d8eee431e5962a8c772d4a86bc3c Change-Id: I946263ae1cd0205805d3ce6d345d240530f49e02 Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
-rw-r--r--jacinto6/README.SGX2
-rw-r--r--jacinto6/sgx.tgzbin2623656 -> 2649848 bytes
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile7
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c6
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxinit.c25
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c6
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c10
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mm.c10
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mmap.c3
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c19
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c4
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.c172
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/omap4/syslocal.h4
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils_linux.c7
14 files changed, 228 insertions, 47 deletions
diff --git a/jacinto6/README.SGX b/jacinto6/README.SGX
index ead7052..839ab3a 100644
--- a/jacinto6/README.SGX
+++ b/jacinto6/README.SGX
@@ -21,7 +21,7 @@ core specific pvrsrvinit.
21[DDK commit ID] 21[DDK commit ID]
22 6708c05 build: Add jacinto6 gralloc binary 22 6708c05 build: Add jacinto6 gralloc binary
23[Branch] 23[Branch]
24 origin/1.9/j6-wip 24 origin/1.9/2291151_k3.8
25[Kernel modules built against] 25[Kernel modules built against]
26 Kernel Version: 3.8.y with CONFIG_MODVERSIONS=y 26 Kernel Version: 3.8.y with CONFIG_MODVERSIONS=y
27 27
diff --git a/jacinto6/sgx.tgz b/jacinto6/sgx.tgz
index e4f613f..42da719 100644
--- a/jacinto6/sgx.tgz
+++ b/jacinto6/sgx.tgz
Binary files differ
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile
index cf143fe..0d9ba11 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile
@@ -67,9 +67,10 @@ endif
67export SGXCORE 67export SGXCORE
68export SGX_CORE_REV 68export SGX_CORE_REV
69 69
70SGX_DYNAMIC_TIMING_INFO := 1
71SUPPORT_ACTIVE_POWER_MANAGEMENT := 0 70SUPPORT_ACTIVE_POWER_MANAGEMENT := 0
72 71
72SGX_DYNAMIC_TIMING_INFO := 1
73
73SUPPORT_LINUX_USING_WORKQUEUES := 1 74SUPPORT_LINUX_USING_WORKQUEUES := 1
74 75
75DISPLAY_CONTROLLER := omaplfb 76DISPLAY_CONTROLLER := omaplfb
@@ -101,7 +102,7 @@ ifneq ($(strip $(KERNELDIR)),)
101 ifeq ($(call kernel-version-at-least,3,0),true) 102 ifeq ($(call kernel-version-at-least,3,0),true)
102 SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 1 103 SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 1
103 PVR_ANDROID_NEEDS_ACCUM_SYNC_WORKAROUND := 1 104 PVR_ANDROID_NEEDS_ACCUM_SYNC_WORKAROUND := 1
104 SYS_OMAP4_HAS_DVFS_FRAMEWORK := 0 105 SYS_OMAP4_HAS_DVFS_FRAMEWORK := 1
105 endif 106 endif
106 endif 107 endif
107else 108else
@@ -110,7 +111,7 @@ else
110 $(warning "Assuming we want DVFS and dsscomp support.") 111 $(warning "Assuming we want DVFS and dsscomp support.")
111 SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 1 112 SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 1
112 PVR_ANDROID_NEEDS_ACCUM_SYNC_WORKAROUND := 1 113 PVR_ANDROID_NEEDS_ACCUM_SYNC_WORKAROUND := 1
113 SYS_OMAP4_HAS_DVFS_FRAMEWORK := 0 114 SYS_OMAP4_HAS_DVFS_FRAMEWORK := 1
114 endif 115 endif
115endif 116endif
116 117
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c
index 1b5312c..ecad67d 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c
@@ -61,7 +61,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
61#include "lists.h" 61#include "lists.h"
62 62
63IMG_UINT32 g_ui32InitFlags; 63IMG_UINT32 g_ui32InitFlags;
64extern int powering_down;
65 64
66/* mark which parts of Services were initialised */ 65/* mark which parts of Services were initialised */
67#define INIT_DATA_ENABLE_PDUMPINIT 0x1U 66#define INIT_DATA_ENABLE_PDUMPINIT 0x1U
@@ -1486,9 +1485,8 @@ IMG_BOOL IMG_CALLCONV PVRSRVDeviceLISR(PVRSRV_DEVICE_NODE *psDeviceNode)
1486 { 1485 {
1487 bStatus = (*psDeviceNode->pfnDeviceISR)(psDeviceNode->pvISRData); 1486 bStatus = (*psDeviceNode->pfnDeviceISR)(psDeviceNode->pvISRData);
1488 } 1487 }
1489 if(!powering_down) { 1488
1490 SysClearInterrupts(psSysData, psDeviceNode->ui32SOCInterruptBit); 1489 SysClearInterrupts(psSysData, psDeviceNode->ui32SOCInterruptBit);
1491 }
1492 } 1490 }
1493 1491
1494out: 1492out:
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxinit.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxinit.c
index cc86c4f..3162978 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxinit.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxinit.c
@@ -69,7 +69,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
69#include "ttrace.h" 69#include "ttrace.h"
70 70
71IMG_UINT32 g_ui32HostIRQCountSample = 0; 71IMG_UINT32 g_ui32HostIRQCountSample = 0;
72extern int powering_down;
73 72
74#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG) 73#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
75 74
@@ -1252,7 +1251,9 @@ static INLINE IMG_UINT32 GetDirListBaseReg(IMG_UINT32 ui32Index)
1252} 1251}
1253#endif 1252#endif
1254 1253
1254#if defined(CONFIG_DSSCOMP)
1255void dsscomp_kdump(void); 1255void dsscomp_kdump(void);
1256#endif
1256/*! 1257/*!
1257******************************************************************************* 1258*******************************************************************************
1258 1259
@@ -1274,7 +1275,9 @@ IMG_VOID SGXDumpDebugInfo (PVRSRV_SGXDEV_INFO *psDevInfo,
1274{ 1275{
1275 IMG_UINT32 ui32CoreNum; 1276 IMG_UINT32 ui32CoreNum;
1276 1277
1278#if defined(CONFIG_DSSCOMP)
1277 dsscomp_kdump(); 1279 dsscomp_kdump();
1280#endif
1278 1281
1279 PVR_LOG(("SGX debug (%s)", PVRVERSION_STRING)); 1282 PVR_LOG(("SGX debug (%s)", PVRVERSION_STRING));
1280 1283
@@ -1816,7 +1819,7 @@ IMG_BOOL SGX_ISRHandler (IMG_VOID *pvData)
1816 1819
1817 /* Real Hardware */ 1820 /* Real Hardware */
1818 { 1821 {
1819 IMG_UINT32 ui32EventStatus = 0, ui32EventEnable = 0; 1822 IMG_UINT32 ui32EventStatus, ui32EventEnable;
1820 IMG_UINT32 ui32EventClear = 0; 1823 IMG_UINT32 ui32EventClear = 0;
1821#if defined(SGX_FEATURE_DATA_BREAKPOINTS) 1824#if defined(SGX_FEATURE_DATA_BREAKPOINTS)
1822 IMG_UINT32 ui32EventStatus2, ui32EventEnable2; 1825 IMG_UINT32 ui32EventStatus2, ui32EventEnable2;
@@ -1835,19 +1838,15 @@ IMG_BOOL SGX_ISRHandler (IMG_VOID *pvData)
1835 psDeviceNode = (PVRSRV_DEVICE_NODE *)pvData; 1838 psDeviceNode = (PVRSRV_DEVICE_NODE *)pvData;
1836 psDevInfo = (PVRSRV_SGXDEV_INFO *)psDeviceNode->pvDevice; 1839 psDevInfo = (PVRSRV_SGXDEV_INFO *)psDeviceNode->pvDevice;
1837 1840
1838 if(!powering_down) { 1841 ui32EventStatus = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS);
1839 ui32EventStatus = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS); 1842 ui32EventEnable = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_ENABLE);
1840 ui32EventEnable = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_ENABLE);
1841 }
1842 1843
1843 /* test only the unmasked bits */ 1844 /* test only the unmasked bits */
1844 ui32EventStatus &= ui32EventEnable; 1845 ui32EventStatus &= ui32EventEnable;
1845 1846
1846#if defined(SGX_FEATURE_DATA_BREAKPOINTS) 1847#if defined(SGX_FEATURE_DATA_BREAKPOINTS)
1847 if(!powering_down) { 1848 ui32EventStatus2 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS2);
1848 ui32EventStatus2 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_STATUS2); 1849 ui32EventEnable2 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_ENABLE2);
1849 ui32EventEnable2 = OSReadHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_ENABLE2);
1850 }
1851 1850
1852 /* test only the unmasked bits */ 1851 /* test only the unmasked bits */
1853 ui32EventStatus2 &= ui32EventEnable2; 1852 ui32EventStatus2 &= ui32EventEnable2;
@@ -1882,10 +1881,8 @@ IMG_BOOL SGX_ISRHandler (IMG_VOID *pvData)
1882 ui32EventClear |= EUR_CR_EVENT_HOST_CLEAR_MASTER_INTERRUPT_MASK; 1881 ui32EventClear |= EUR_CR_EVENT_HOST_CLEAR_MASTER_INTERRUPT_MASK;
1883 1882
1884 /* clear the events */ 1883 /* clear the events */
1885 if(!powering_down) { 1884 OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR, ui32EventClear);
1886 OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR, ui32EventClear); 1885 OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR2, ui32EventClear2);
1887 OSWriteHWReg(psDevInfo->pvRegsBaseKM, EUR_CR_EVENT_HOST_CLEAR2, ui32EventClear2);
1888 }
1889 1886
1890 /* 1887 /*
1891 Sample the current count from the uKernel _after_ we've cleared the 1888 Sample the current count from the uKernel _after_ we've cleared the
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c
index 47f3f48..03647a0 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c
@@ -49,7 +49,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49#include "pdump_km.h" 49#include "pdump_km.h"
50 50
51extern IMG_UINT32 g_ui32HostIRQCountSample; 51extern IMG_UINT32 g_ui32HostIRQCountSample;
52int powering_down = 0;
53 52
54#if defined(SUPPORT_HW_RECOVERY) 53#if defined(SUPPORT_HW_RECOVERY)
55static PVRSRV_ERROR SGXAddTimer(PVRSRV_DEVICE_NODE *psDeviceNode, 54static PVRSRV_ERROR SGXAddTimer(PVRSRV_DEVICE_NODE *psDeviceNode,
@@ -333,8 +332,6 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE hDevHandle,
333 PDUMPCOMMENT("SGX idle request"); 332 PDUMPCOMMENT("SGX idle request");
334 } 333 }
335 334
336 powering_down = 1;
337
338 sCommand.ui32Data[1] = ui32PowerCmd; 335 sCommand.ui32Data[1] = ui32PowerCmd;
339 336
340 eError = SGXScheduleCCBCommand(psDeviceNode, SGXMKIF_CMD_POWER, &sCommand, KERNEL_ID, 0, IMG_NULL, IMG_FALSE); 337 eError = SGXScheduleCCBCommand(psDeviceNode, SGXMKIF_CMD_POWER, &sCommand, KERNEL_ID, 0, IMG_NULL, IMG_FALSE);
@@ -377,7 +374,7 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE hDevHandle,
377 #endif /* PDUMP */ 374 #endif /* PDUMP */
378 375
379 /* Wait for the pending ukernel to host interrupts to come back. */ 376 /* Wait for the pending ukernel to host interrupts to come back. */
380 #if 0//!defined(NO_HARDWARE) 377 #if !defined(NO_HARDWARE)
381 if (PollForValueKM(&g_ui32HostIRQCountSample, 378 if (PollForValueKM(&g_ui32HostIRQCountSample,
382 psDevInfo->psSGXHostCtl->ui32InterruptCount, 379 psDevInfo->psSGXHostCtl->ui32InterruptCount,
383 0xffffffff, 380 0xffffffff,
@@ -497,7 +494,6 @@ PVRSRV_ERROR SGXPostPowerState (IMG_HANDLE hDevHandle,
497 PVR_DPF((PVR_DBG_ERROR,"SGXPostPowerState: SGXInitialise failed")); 494 PVR_DPF((PVR_DBG_ERROR,"SGXPostPowerState: SGXInitialise failed"));
498 return eError; 495 return eError;
499 } 496 }
500 powering_down = 0;
501 } 497 }
502 else 498 else
503 { 499 {
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c
index e84fdc4..5cb1521 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c
@@ -254,7 +254,7 @@ PVRSRV_ERROR IonImportBufferAndAquirePhysAddr(IMG_HANDLE hIonDev,
254{ 254{
255 struct ion_client *psIonClient = hIonDev; 255 struct ion_client *psIonClient = hIonDev;
256 struct ion_handle *psIonHandle; 256 struct ion_handle *psIonHandle;
257 struct scatterlist *psScatterList; 257 struct sg_table *psSgTable;
258 struct scatterlist *psTemp; 258 struct scatterlist *psTemp;
259 IMG_SYS_PHYADDR *pasSysPhysAddr = NULL; 259 IMG_SYS_PHYADDR *pasSysPhysAddr = NULL;
260 ION_IMPORT_DATA *psImportData; 260 ION_IMPORT_DATA *psImportData;
@@ -282,8 +282,8 @@ PVRSRV_ERROR IonImportBufferAndAquirePhysAddr(IMG_HANDLE hIonDev,
282 psImportData->psIonClient = psIonClient; 282 psImportData->psIonClient = psIonClient;
283 psImportData->psIonHandle = psIonHandle; 283 psImportData->psIonHandle = psIonHandle;
284 284
285 psScatterList = ion_map_dma(psIonClient, psIonHandle); 285 psSgTable = ion_sg_table(psIonClient, psIonHandle);
286 if (psScatterList == NULL) 286 if (psSgTable == NULL)
287 { 287 {
288 eError = PVRSRV_ERROR_INVALID_PARAMS; 288 eError = PVRSRV_ERROR_INVALID_PARAMS;
289 goto exitFailMap; 289 goto exitFailMap;
@@ -295,7 +295,7 @@ PVRSRV_ERROR IonImportBufferAndAquirePhysAddr(IMG_HANDLE hIonDev,
295 */ 295 */
296 for (i=0;i<2;i++) 296 for (i=0;i<2;i++)
297 { 297 {
298 psTemp = psScatterList; 298 psTemp = psSgTable->sgl;
299 if (i == 1) 299 if (i == 1)
300 { 300 {
301 pasSysPhysAddr = kmalloc(sizeof(IMG_SYS_PHYADDR) * ui32PageCount, GFP_KERNEL); 301 pasSysPhysAddr = kmalloc(sizeof(IMG_SYS_PHYADDR) * ui32PageCount, GFP_KERNEL);
@@ -339,7 +339,6 @@ PVRSRV_ERROR IonImportBufferAndAquirePhysAddr(IMG_HANDLE hIonDev,
339 return PVRSRV_OK; 339 return PVRSRV_OK;
340 340
341exitFailAlloc: 341exitFailAlloc:
342 ion_unmap_dma(psIonClient, psIonHandle);
343exitFailMap: 342exitFailMap:
344 ion_free(psIonClient, psIonHandle); 343 ion_free(psIonClient, psIonHandle);
345exitFailImport: 344exitFailImport:
@@ -352,7 +351,6 @@ IMG_VOID IonUnimportBufferAndReleasePhysAddr(IMG_HANDLE hPriv)
352{ 351{
353 ION_IMPORT_DATA *psImportData = hPriv; 352 ION_IMPORT_DATA *psImportData = hPriv;
354 353
355 ion_unmap_dma(psImportData->psIonClient, psImportData->psIonHandle);
356 if (psImportData->pvKernAddr) 354 if (psImportData->pvKernAddr)
357 { 355 {
358 ion_unmap_kernel(psImportData->psIonClient, psImportData->psIonHandle); 356 ion_unmap_kernel(psImportData->psIonClient, psImportData->psIonHandle);
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mm.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mm.c
index af8a721..b194794 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mm.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mm.c
@@ -1566,7 +1566,7 @@ NewIONLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags,
1566 1566
1567 asAllocData[i].handle = ion_alloc (gpsIONClient, 1567 asAllocData[i].handle = ion_alloc (gpsIONClient,
1568 ui32Bytes, 1568 ui32Bytes,
1569 PAGE_SIZE, (1 << OMAP_ION_HEAP_SYSTEM),0); 1569 PAGE_SIZE, (1 << OMAP_ION_HEAP_SYSTEM), 0);
1570 1570
1571 if (asAllocData[i].handle == NULL) 1571 if (asAllocData[i].handle == NULL)
1572 { 1572 {
@@ -1575,7 +1575,7 @@ NewIONLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags,
1575 goto err_free; 1575 goto err_free;
1576 } 1576 }
1577 1577
1578 sgtable = ion_sg_table (gpsIONClient, asAllocData[i].handle); 1578 sgtable = ion_sg_table(gpsIONClient, asAllocData[i].handle);
1579 if (sgtable == NULL) 1579 if (sgtable == NULL)
1580 { 1580 {
1581 PVR_DPF((PVR_DBG_ERROR, "%s: Failed to compute pages", 1581 PVR_DPF((PVR_DBG_ERROR, "%s: Failed to compute pages",
@@ -1598,9 +1598,9 @@ NewIONLinuxMemArea(IMG_UINT32 ui32Bytes, IMG_UINT32 ui32AreaFlags,
1598 } 1598 }
1599 1599
1600 iNumPages[i] = ui32Num1dPages; 1600 iNumPages[i] = ui32Num1dPages;
1601 } 1601 }
1602 else /* 2D DMM Buffers */ 1602 else /* 2D DMM Buffers */
1603 { 1603 {
1604 if (omap_ion_tiler_alloc(gpsIONClient, &asAllocData[i]) < 0) 1604 if (omap_ion_tiler_alloc(gpsIONClient, &asAllocData[i]) < 0)
1605 { 1605 {
1606 PVR_DPF((PVR_DBG_ERROR, "%s: Failed to allocate via ion_tiler", 1606 PVR_DPF((PVR_DBG_ERROR, "%s: Failed to allocate via ion_tiler",
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mmap.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mmap.c
index f6cbc3f..e1a0c21 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mmap.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mmap.c
@@ -1077,6 +1077,9 @@ PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma)
1077 PVR_DPF((PVR_DBG_MESSAGE, "%s: Mapped psLinuxMemArea 0x%p\n", 1077 PVR_DPF((PVR_DBG_MESSAGE, "%s: Mapped psLinuxMemArea 0x%p\n",
1078 __FUNCTION__, psOffsetStruct->psLinuxMemArea)); 1078 __FUNCTION__, psOffsetStruct->psLinuxMemArea));
1079 1079
1080#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
1081 ps_vma->vm_flags |= VM_RESERVED;
1082#endif
1080 ps_vma->vm_flags |= VM_IO; 1083 ps_vma->vm_flags |= VM_IO;
1081 1084
1082 /* 1085 /*
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c
index 714668f..e7b161f 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c
@@ -85,6 +85,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
85#include <linux/fs.h> 85#include <linux/fs.h>
86#include <linux/proc_fs.h> 86#include <linux/proc_fs.h>
87 87
88#ifdef CONFIG_OF
89#include <linux/of.h>
90#endif
91
88#if defined(SUPPORT_DRI_DRM) 92#if defined(SUPPORT_DRI_DRM)
89#include <drm/drmP.h> 93#include <drm/drmP.h>
90#if defined(PVR_SECURE_DRM_AUTH_EXPORT) 94#if defined(PVR_SECURE_DRM_AUTH_EXPORT)
@@ -256,16 +260,31 @@ MODULE_DEVICE_TABLE(pci, powervr_id_table);
256#endif 260#endif
257 261
258#if defined(PVR_USE_PRE_REGISTERED_PLATFORM_DEV) 262#if defined(PVR_USE_PRE_REGISTERED_PLATFORM_DEV)
263#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
264static struct platform_device_id powervr_id_table[] __devinitdata = {
265#else
259static struct platform_device_id powervr_id_table[] = { 266static struct platform_device_id powervr_id_table[] = {
267#endif
260 {SYS_SGX_DEV_NAME, 0}, 268 {SYS_SGX_DEV_NAME, 0},
261 {} 269 {}
262}; 270};
263#endif 271#endif
264 272
273#ifdef CONFIG_OF
274static const struct of_device_id omap_gpu_id_table[] = {
275 { .compatible = "ti,omap4-gpu" },
276 {}
277};
278MODULE_DEVICE_TABLE(of, omap_gpu_id_table);
279#endif
280
265static LDM_DRV powervr_driver = { 281static LDM_DRV powervr_driver = {
266#if defined(PVR_LDM_PLATFORM_MODULE) 282#if defined(PVR_LDM_PLATFORM_MODULE)
267 .driver = { 283 .driver = {
268 .name = DRVNAME, 284 .name = DRVNAME,
285#ifdef CONFIG_OF
286 .of_match_table = of_match_ptr(omap_gpu_id_table),
287#endif
269 }, 288 },
270#endif 289#endif
271#if defined(PVR_LDM_PCI_MODULE) 290#if defined(PVR_LDM_PCI_MODULE)
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c
index 6cc9ec1..c508b09 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c
@@ -3781,7 +3781,11 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
3781 } 3781 }
3782 3782
3783 /* Does the region represent memory mapped I/O? */ 3783 /* Does the region represent memory mapped I/O? */
3784#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38))
3785 if ((psVMArea->vm_flags & (VM_IO | VM_RESERVED)) != (VM_IO | VM_RESERVED))
3786#else
3784 if ((psVMArea->vm_flags & (VM_IO)) != (VM_IO)) 3787 if ((psVMArea->vm_flags & (VM_IO)) != (VM_IO))
3788#endif
3785 { 3789 {
3786 PVR_DPF((PVR_DBG_ERROR, 3790 PVR_DPF((PVR_DBG_ERROR,
3787 "OSAcquirePhysPageAddr: Memory region does not represent memory mapped I/O (VMA flags: 0x%lx)", psVMArea->vm_flags)); 3791 "OSAcquirePhysPageAddr: Memory region does not represent memory mapped I/O (VMA flags: 0x%lx)", psVMArea->vm_flags));
diff --git a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.c b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.c
index 7e8e8fd..11e1238 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.c
@@ -15,7 +15,8 @@
15 */ 15 */
16 16
17#include <linux/opp.h> 17#include <linux/opp.h>
18#include <plat/gpu.h> 18#include <linux/regulator/consumer.h>
19
19#include "sgxfreq.h" 20#include "sgxfreq.h"
20 21
21static struct sgxfreq_data { 22static struct sgxfreq_data {
@@ -32,7 +33,14 @@ static struct sgxfreq_data {
32 struct mutex gov_mutex; 33 struct mutex gov_mutex;
33 struct sgxfreq_sgx_data sgx_data; 34 struct sgxfreq_sgx_data sgx_data;
34 struct device *dev; 35 struct device *dev;
35 struct gpu_platform_data *pdata; 36#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
37 struct clk *core_clk;
38 struct clk *gpu_clk;
39 struct clk *per_clk;
40 struct clk *gpu_core_clk;
41 struct clk *gpu_hyd_clk;
42 struct regulator *gpu_reg;
43#endif
36} sfd; 44} sfd;
37 45
38/* Governor init/deinit functions */ 46/* Governor init/deinit functions */
@@ -187,19 +195,101 @@ static const struct attribute *sgxfreq_attributes[] = {
187}; 195};
188 196
189/************************ end sysfs interface ************************/ 197/************************ end sysfs interface ************************/
198static int set_volt_for_freq(unsigned long freq)
199{
200 struct opp *opp;
201 unsigned long volt = 0;
202 int ret;
203
204 if (sfd.gpu_reg) {
205 opp = opp_find_freq_exact(sfd.dev, freq, true);
206 if(IS_ERR(opp))
207 {
208 int r = PTR_ERR(opp);
209 pr_err("sgxfreq: Couldn't find opp matching freq: %lu. Err: %d",
210 freq, r);
211 return -1;
212 }
213
214 volt = opp_get_voltage(opp);
215 if (!volt)
216 {
217 pr_err("sgxfreq: Could find volt corresponding to freq: %lu\n",
218 freq);
219 return -1;
220 }
221
222 ret = regulator_set_voltage_tol(sfd.gpu_reg, volt , 6000);
223 if (ret) {
224 pr_err("sgxfreq: Error(%d) setting volt: %lu for freq:%lu\n",
225 ret, volt, freq);
226 return ret;
227 }
228 }
229
230 return 0;
231
232}
190 233
191static void __set_freq(void) 234static void __set_freq(void)
192{ 235{
193 unsigned long freq; 236 unsigned long freq;
237 int ret = 0;
194 238
195 freq = min(sfd.freq_request, sfd.freq_limit); 239 freq = min(sfd.freq_request, sfd.freq_limit);
196 if (freq != sfd.freq) { 240 if (freq != sfd.freq) {
197#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) 241#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
242 if (freq > sfd.freq) {
243 /* Going up - must scale voltage before clocks */
244 if (set_volt_for_freq(freq) != 0) {
245 pr_err("sgxfreq: Error setting voltage for freq: %lu\n",
246 freq);
247 goto err1;
248 }
249 }
250
251 ret = clk_set_rate(sfd.gpu_core_clk, freq);
252 if (ret) {
253 pr_err("sgxfreq: Error(%d) setting gpu core clock rate: %lu\n",
254 ret, freq);
255 goto err2;
256 }
257
258 ret = clk_set_rate(sfd.gpu_hyd_clk, freq);
259 if (ret) {
260 pr_err("sgxfreq: Error(%d) setting gpu hyd clock rate: %lu\n",
261 ret, freq);
262 goto err3;
263 }
264
265 if (freq < sfd.freq) {
266 /* Going down - must scale voltage after clocks */
267 if(set_volt_for_freq(freq) != 0) {
268 pr_err("sgxfreq: Error setting voltage for freq: %lu\n",
269 freq);
270 goto err4;
271 }
272 }
273
274#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
198 sfd.pdata->device_scale(sfd.dev, sfd.dev, freq); 275 sfd.pdata->device_scale(sfd.dev, sfd.dev, freq);
199#else 276#else
200 sfd.pdata->device_scale(sfd.dev, freq); 277 sfd.pdata->device_scale(sfd.dev, freq);
201#endif 278#endif
202 sfd.freq = freq; 279 sfd.freq = freq;
280
281 goto noerr;
282err4:
283 ret |= clk_set_rate(sfd.gpu_hyd_clk, sfd.freq);
284
285err3:
286 ret |= clk_set_rate(sfd.gpu_core_clk, sfd.freq);
287err2:
288 if(freq > sfd.freq)
289 ret |= set_volt_for_freq(sfd.freq);
290err1:
291noerr:
292 return;
203 } 293 }
204} 294}
205 295
@@ -278,17 +368,28 @@ int sgxfreq_init(struct device *dev)
278 sfd.dev = dev; 368 sfd.dev = dev;
279 if (!sfd.dev) 369 if (!sfd.dev)
280 return -EINVAL; 370 return -EINVAL;
281 371#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
282 sfd.pdata = (struct gpu_platform_data *)dev->platform_data; 372 sfd.pdata = (struct gpu_platform_data *)dev->platform_data;
283 if (!sfd.pdata || 373 if (!sfd.pdata ||
284 !sfd.pdata->opp_get_opp_count || 374 !sfd.pdata->opp_get_opp_count ||
285 !sfd.pdata->opp_find_freq_ceil || 375 !sfd.pdata->opp_find_freq_ceil ||
286 !sfd.pdata->device_scale) 376 !sfd.pdata->device_scale)
287 return -EINVAL; 377 return -EINVAL;
378#endif
288 379
289 rcu_read_lock(); 380 rcu_read_lock();
290 381
382#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
291 sfd.freq_cnt = sfd.pdata->opp_get_opp_count(dev); 383 sfd.freq_cnt = sfd.pdata->opp_get_opp_count(dev);
384#else
385 ret = of_init_opp_table(dev);
386 if (ret) {
387 pr_err("sgxfreq: failed to init OPP table: %d\n", ret);
388 return -EINVAL;
389 }
390
391 sfd.freq_cnt = opp_get_opp_count(dev);
392#endif
292 if (sfd.freq_cnt < 1) { 393 if (sfd.freq_cnt < 1) {
293 rcu_read_unlock(); 394 rcu_read_unlock();
294 return -ENODEV; 395 return -ENODEV;
@@ -302,7 +403,11 @@ int sgxfreq_init(struct device *dev)
302 403
303 freq = 0; 404 freq = 0;
304 for (i = 0; i < sfd.freq_cnt; i++) { 405 for (i = 0; i < sfd.freq_cnt; i++) {
406#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
305 opp = sfd.pdata->opp_find_freq_ceil(dev, &freq); 407 opp = sfd.pdata->opp_find_freq_ceil(dev, &freq);
408#else
409 opp = opp_find_freq_ceil(dev, &freq);
410#endif
306 if (IS_ERR_OR_NULL(opp)) { 411 if (IS_ERR_OR_NULL(opp)) {
307 rcu_read_unlock(); 412 rcu_read_unlock();
308 kfree(sfd.freq_list); 413 kfree(sfd.freq_list);
@@ -313,6 +418,63 @@ int sgxfreq_init(struct device *dev)
313 } 418 }
314 rcu_read_unlock(); 419 rcu_read_unlock();
315 420
421#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
422 sfd.core_clk = devm_clk_get(dev, "dpll_core_h14x2_ck");
423 if (IS_ERR(sfd.core_clk)) {
424 ret = PTR_ERR(sfd.core_clk);
425 pr_err("sgxfreq: failed to get core clock: %d\n", ret);
426 return ret;
427 }
428
429 sfd.gpu_clk = devm_clk_get(dev, "dpll_gpu_m2_ck");
430 if (IS_ERR(sfd.gpu_clk)) {
431 ret = PTR_ERR(sfd.gpu_clk);
432 pr_err("sgxfreq: failed to get gpu clock: %d\n", ret);
433 return ret;
434 }
435
436 sfd.per_clk = devm_clk_get(dev, "dpll_per_h14x2_ck");
437 if (IS_ERR(sfd.per_clk)) {
438 ret = PTR_ERR(sfd.per_clk);
439 pr_err("sgxfreq: failed to get per clock: %d\n", ret);
440 return ret;
441 }
442
443 sfd.gpu_core_clk = devm_clk_get(dev, "gpu_core_gclk_mux");
444 if (IS_ERR(sfd.gpu_core_clk)) {
445 ret = PTR_ERR(sfd.gpu_core_clk);
446 pr_err("sgxfreq: failed to get gpu core clock: %d\n", ret);
447 return ret;
448 }
449
450 sfd.gpu_hyd_clk = devm_clk_get(dev, "gpu_core_gclk_mux");
451 if (IS_ERR(sfd.gpu_hyd_clk)) {
452 ret = PTR_ERR(sfd.gpu_hyd_clk);
453 pr_err("sgxfreq: failed to get gpu hyd clock: %d\n", ret);
454 return ret;
455 }
456
457 sfd.gpu_reg = devm_regulator_get(dev, "gpu");
458 if (IS_ERR(sfd.gpu_reg)) {
459 if (PTR_ERR(sfd.gpu_reg) == -EPROBE_DEFER) {
460 dev_err(dev, "gpu regulator not ready, retry\n");
461 return -EPROBE_DEFER;
462 }
463 pr_err("sgxfreq: failed to get gpu regulator: %ld\n", PTR_ERR(sfd.gpu_reg));
464 sfd.gpu_reg = NULL;
465 }
466
467 ret = clk_set_parent(sfd.gpu_hyd_clk, sfd.core_clk);
468 if (ret != 0) {
469 pr_err("sgxfreq: failed to set gpu_hyd_clk parent: %d\n", ret);
470 }
471
472 ret = clk_set_parent(sfd.gpu_core_clk, sfd.core_clk);
473 if (ret != 0) {
474 pr_err("sgxfreq: failed to set gpu_core_clk parent: %d\n", ret);
475 }
476#endif
477
316 mutex_init(&sfd.freq_mutex); 478 mutex_init(&sfd.freq_mutex);
317 sfd.freq_limit = sfd.freq_list[sfd.freq_cnt - 1]; 479 sfd.freq_limit = sfd.freq_list[sfd.freq_cnt - 1];
318 sgxfreq_set_freq_request(sfd.freq_list[sfd.freq_cnt - 1]); 480 sgxfreq_set_freq_request(sfd.freq_list[sfd.freq_cnt - 1]);
@@ -330,7 +492,7 @@ int sgxfreq_init(struct device *dev)
330 } 492 }
331 493
332#if defined(CONFIG_THERMAL_FRAMEWORK) 494#if defined(CONFIG_THERMAL_FRAMEWORK)
333 cool_init(); 495 //cool_init();
334#endif 496#endif
335 497
336 for (i = 0; sgxfreq_gov_init[i] != NULL; i++) 498 for (i = 0; sgxfreq_gov_init[i] != NULL; i++)
diff --git a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/syslocal.h b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/syslocal.h
index dc4d0d2..da1bade 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/syslocal.h
+++ b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/syslocal.h
@@ -84,7 +84,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
84#endif 84#endif
85 85
86#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) 86#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
87#include <linux/platform_data/omap-gpu.h> 87#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
88#include <plat/gpu.h>
89#endif
88#if !defined(PVR_NO_OMAP_TIMER) 90#if !defined(PVR_NO_OMAP_TIMER)
89#define PVR_OMAP_USE_DM_TIMER_API 91#define PVR_OMAP_USE_DM_TIMER_API
90#include <plat/dmtimer.h> 92#include <plat/dmtimer.h>
diff --git a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils_linux.c b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils_linux.c
index 2817f8b..358e9f8 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils_linux.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils_linux.c
@@ -721,14 +721,15 @@ SysDRMUnregisterPlugin(PVRSRV_DRM_PLUGIN *psDRMPlugin)
721 721
722int pvr_access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write) 722int pvr_access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write)
723{ 723{
724 724#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
725return -1;
726#if 0
727 struct gpu_platform_data *pdata; 725 struct gpu_platform_data *pdata;
728 pdata = (struct gpu_platform_data *)gpsPVRLDMDev->dev.platform_data; 726 pdata = (struct gpu_platform_data *)gpsPVRLDMDev->dev.platform_data;
729 if(!pdata || !pdata->access_process_vm) 727 if(!pdata || !pdata->access_process_vm)
730 return -1; 728 return -1;
731 return pdata->access_process_vm(tsk, addr, buf, len, write); 729 return pdata->access_process_vm(tsk, addr, buf, len, write);
730#else
731 /* FIXME: platform data not supported in 3.8 kernel */
732 return -1;
732#endif 733#endif
733} 734}
734 735