SGX: Kernel side DDK source code for OMAP5
authorRoman Shaposhnikov <x0166637@ti.com>
Thu, 17 Jan 2013 12:55:09 +0000 (14:55 +0200)
committerVishal Mahaveer <vishalm@ti.com>
Mon, 11 Feb 2013 15:33:27 +0000 (09:33 -0600)
Kernel side source code for release 1.9IMG2166536_TI.0004

Change-Id: Ic84f2ac388a243d209f5395c21b8cf191ea5a775
Signed-off-by: Roman Shaposhnikov <x0166637@ti.com>
omap5/sgx/Android.mk
omap5/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile
omap5/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c
omap5/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxutils.c
omap5/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_userspace.c
omap5/sgx_src/eurasia_km/services4/system/omap4/sysconfig.c
omap5/sgx_src/eurasia_km/services4/system/omap4/sysutils_linux.c

index 867c3b8e7c879e0cd426951424991d916c071659..3cf4f5947e600a76a11c0b30730caddfc8cfc1a4 100644 (file)
@@ -94,28 +94,28 @@ $$(LOCAL_BUILT_MODULE) : $$(img-sgx.untarred_timestamp) | $$(ACP)
 endef
 
 prebuilt_sgx_vendor_libs := \
-       lib/libIMGegl_SGX544_105.so \
-       lib/libglslcompiler_SGX544_105.so \
-       lib/libusc_SGX544_105.so \
-       lib/libPVRScopeServices_SGX544_105.so \
-       lib/libsrv_um_SGX544_105.so \
+       lib/libIMGegl_SGX544_116.so \
+       lib/libglslcompiler_SGX544_116.so \
+       lib/libusc_SGX544_116.so \
+       lib/libPVRScopeServices_SGX544_116.so \
+       lib/libsrv_um_SGX544_116.so \
        lib/hw/gralloc.omap5.so \
-       lib/libpvrANDROID_WSEGL_SGX544_105.so \
-       lib/libpvr2d_SGX544_105.so \
-       lib/libsrv_init_SGX544_105.so \
-       lib/egl/libGLESv1_CM_POWERVR_SGX544_105.so \
-       lib/egl/libGLESv2_POWERVR_SGX544_105.so \
-       lib/egl/libEGL_POWERVR_SGX544_105.so
+       lib/libpvrANDROID_WSEGL_SGX544_116.so \
+       lib/libpvr2d_SGX544_116.so \
+       lib/libsrv_init_SGX544_116.so \
+       lib/egl/libGLESv1_CM_POWERVR_SGX544_116.so \
+       lib/egl/libGLESv2_POWERVR_SGX544_116.so \
+       lib/egl/libEGL_POWERVR_SGX544_116.so
 
 prebuilt_sgx_vendor_bins := \
        bin/pvrsrvinit \
-       bin/pvrsrvctl_SGX544_105
+       bin/pvrsrvctl_SGX544_116
 
 prebuilt_sgx_vendor_etc := \
        etc/powervr.ini
 
 prebuilt_sgx_vendor_km := \
-       modules/pvrsrvkm_sgx544_105.ko
+       modules/pvrsrvkm_sgx544_116.ko
 
 prebuilt_sgx_modules := \
   $(foreach _file,$(prebuilt_sgx_vendor_libs) $(prebuilt_sgx_vendor_bins) $(prebuilt_sgx_vendor_etc) $(prebuilt_sgx_vendor_km),\
index b034ea0907d997f066c78d6738794e6ed50e9707..2b37cb3a0a9aedad5b1eb8eaf576f333ff31779b 100644 (file)
@@ -52,6 +52,13 @@ else ifeq ($(TARGET_SGX),544)
  SGX_FEATURE_MP := 1
  SGX_FEATURE_SYSTEM_CACHE := 1
  SGX_FEATURE_MP_CORE_COUNT := 2
+else ifeq ($(TARGET_SGX),544es2)
+ SGXCORE := 544
+ SGX_CORE_REV := 116
+ HAL_VARIANT := omap5
+ SGX_FEATURE_MP := 1
+ SGX_FEATURE_SYSTEM_CACHE := 1
+ SGX_FEATURE_MP_CORE_COUNT := 2
 else
  #default config
  SGXCORE := 540
index 2acd28d4481b8eaff94afce500446679960dd980..dae49462737a16df156e4638ae9d945b7cee22e8 100644 (file)
@@ -359,7 +359,11 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE                          hDevHandle,
                }
                #endif /* NO_HARDWARE */
 
-               psDevInfo->bSGXIdle = IMG_TRUE;
+               if (psDevInfo->bSGXIdle == IMG_FALSE)
+               {
+                       psDevInfo->bSGXIdle = IMG_TRUE;
+                       SysSGXIdleEntered();
+               }
 
                #if defined(PDUMP)
                PDUMPCOMMENT("TA/3D CCB Control - Wait for power event on uKernel.");
index 227675d15456cf4d8922958b4d212b46e000e816..d5cb3c1dc9824d20b68bbb52077bfe964634b1dc 100644 (file)
@@ -172,9 +172,11 @@ IMG_VOID SGXTestActivePowerEvent (PVRSRV_DEVICE_NODE       *psDeviceNode,
                        ((psSGXHostCtl->ui32InterruptFlags & PVRSRV_USSE_EDM_INTERRUPT_IDLE) != 0))
                {
                        psSGXHostCtl->ui32InterruptClearFlags |= PVRSRV_USSE_EDM_INTERRUPT_IDLE;
-                       psDevInfo->bSGXIdle = IMG_TRUE;
-
-                       SysSGXIdleEntered();
+                       if (psDevInfo->bSGXIdle == IMG_FALSE)
+                       {
+                               psDevInfo->bSGXIdle = IMG_TRUE;
+                               SysSGXIdleEntered();
+                       }
                }
 
                /*
@@ -709,9 +711,6 @@ PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE             *psDeviceNode,
        /* Note that a power-up has been dumped in the init phase. */
        PDUMPSUSPEND();
 
-       SysSGXCommandPending(psDevInfo->bSGXIdle);
-       psDevInfo->bSGXIdle = IMG_FALSE;
-
        /* Ensure that SGX is powered up before kicking the ukernel. */
        eError = PVRSRVSetDevicePowerStateKM(psDeviceNode->sDevId.ui32DeviceIndex,
                                                                                 PVRSRV_DEV_POWER_STATE_ON);
@@ -729,6 +728,9 @@ PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE             *psDeviceNode,
                return eError;
        }
 
+       SysSGXCommandPending(psDevInfo->bSGXIdle);
+       psDevInfo->bSGXIdle = IMG_FALSE;
+
        eError = SGXScheduleCCBCommand(psDeviceNode, eCmdType, psCommandData, ui32CallerID, ui32PDumpFlags, hDevMemContext, bLastInScene);
 
        PVRSRVPowerUnlock(ui32CallerID);
index 5ff0dd07d8a3b93aebe7e974b10255d88f510c0f..aff6087411f25eb0fe1fd9d32d827af7c47b58e4 100644 (file)
 
 static int userspace_start(struct sgxfreq_sgx_data *data);
 static void userspace_stop(void);
-static void userspace_sgx_clk_on(void);
-static void userspace_sgx_clk_off(void);
-static void userspace_sgx_active(void);
-static void userspace_sgx_idle(void);
 
 
 static struct sgxfreq_governor userspace_gov = {
        .name = "userspace",
        .gov_start = userspace_start,
        .gov_stop = userspace_stop,
-       .sgx_clk_on = userspace_sgx_clk_on,
-       .sgx_clk_off = userspace_sgx_clk_off,
-       .sgx_active = userspace_sgx_active,
-       .sgx_idle = userspace_sgx_idle,
 };
 
 
 static struct userspace_data {
-       unsigned long freq_user; /* in KHz */
-       struct mutex mutex;
+       unsigned long freq_user; /* in Hz */
 } usd;
 
 
@@ -65,15 +56,11 @@ static ssize_t store_frequency_set(struct device *dev,
        if (ret != 1)
                return -EINVAL;
 
-       mutex_lock(&odd.mutex);
-
        if (freq > sgxfreq_get_freq_max())
                freq = sgxfreq_get_freq_max();
        usd.freq_user = sgxfreq_set_freq_request(freq);
        trace_printk("USERSPACE: new freq=%luHz.\n", usd.freq_user);
 
-       mutex_unlock(&odd.mutex);
-
        return count;
 }
 
@@ -100,8 +87,6 @@ int userspace_init(void)
 {
        int ret;
 
-       mutex_init(&odd.mutex);
-
        ret = sgxfreq_register_governor(&userspace_gov);
        if (ret)
                return ret;
@@ -133,48 +118,7 @@ static int userspace_start(struct sgxfreq_sgx_data *data)
 
 static void userspace_stop(void)
 {
-       usd.freq_user = sgxfreq_set_freq_request(sgxfreq_get_freq_min());
        sysfs_remove_group(sgxfreq_kobj, &userspace_attr_group);
 
        trace_printk("USERSPACE: stopped.\n");
 }
-
-
-static void userspace_sgx_clk_on(void)
-{
-       mutex_lock(&ood.mutex);
-
-       sgxfreq_set_freq_request(usd.freq_user);
-
-       mutex_unlock(&ood.mutex);
-}
-
-
-static void userspace_sgx_clk_off(void)
-{
-       mutex_lock(&ood.mutex);
-
-       sgxfreq_set_freq_request(sgxfreq_get_freq_min());
-
-       mutex_unlock(&ood.mutex);
-}
-
-
-static void userspace_sgx_active(void)
-{
-       mutex_lock(&aid.mutex);
-
-       sgxfreq_set_freq_request(usd.freq_user);
-
-       mutex_unlock(&aid.mutex);
-}
-
-
-static void userspace_sgx_idle(void)
-{
-       mutex_lock(&aid.mutex);
-
-       sgxfreq_set_freq_request(sgxfreq_get_freq_min());
-
-       mutex_unlock(&aid.mutex);
-}
index e9fd0694e3c73e206f870aadd23324d9af3e9b74..175252d035ba027b710b9bcbc74ecef06ad1fd94 100644 (file)
@@ -50,7 +50,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "ocpdefs.h"
 
+#if (SGX_CORE_REV == 105)
 #define OMAP5430_CORE_REV      0x10005
+#elif (SGX_CORE_REV == 116)
+#define OMAP5430_CORE_REV      0x10106
+#endif
 
 /* top level system data anchor point*/
 SYS_DATA* gpsSysData = (SYS_DATA*)IMG_NULL;
index 1bef2ee8e0b472135e70da2b4c54ab9741ced6fb..bae104812e8e7c03d62483f160938e61ff784f11 100644 (file)
@@ -738,6 +738,7 @@ IMG_VOID SysSGXIdleEntered(IMG_VOID)
 IMG_VOID SysSGXCommandPending(IMG_BOOL bSGXIdle)
 {
 #if defined(SYS_OMAP4_HAS_DVFS_FRAMEWORK)
+       if (bSGXIdle)
                sgxfreq_notif_sgx_active();
 #else
        PVR_UNREFERENCED_PARAMETER(bSGXIdle);