summaryrefslogtreecommitdiff
path: root/drivers/mxc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mxc')
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_memmgr.c97
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_mmu.c18
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_ringbuffer.c2
-rw-r--r--drivers/mxc/amd-gpu/common/pm4_microcode.inl358
-rw-r--r--drivers/mxc/amd-gpu/include/gsl_buildconfig.h4
-rw-r--r--drivers/mxc/amd-gpu/include/gsl_halconfig.h4
-rw-r--r--drivers/mxc/amd-gpu/platform/hal/linux/gsl_hal.c10
-rw-r--r--drivers/mxc/amd-gpu/platform/hal/linux/gsl_hwaccess.h24
-rw-r--r--drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c42
-rw-r--r--drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.c11
-rw-r--r--drivers/mxc/amd-gpu/platform/hal/linux/gsl_linux_map.c2
-rw-r--r--drivers/mxc/amd-gpu/platform/hal/linux/misc.c19
-rw-r--r--drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_context.c2
-rw-r--r--drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c7
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c53
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c5
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c178
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c3
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h13
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h25
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h35
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c2
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h6
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c82
-rw-r--r--drivers/mxc/ipu3/ipu_common.c7
-rw-r--r--drivers/mxc/pmic/core/pmic_core_i2c.c4
-rw-r--r--drivers/mxc/pmic/core/pmic_core_spi.c4
29 files changed, 610 insertions, 411 deletions
diff --git a/drivers/mxc/amd-gpu/common/gsl_memmgr.c b/drivers/mxc/amd-gpu/common/gsl_memmgr.c
index 75f250ae59b1..3248f6d46554 100644
--- a/drivers/mxc/amd-gpu/common/gsl_memmgr.c
+++ b/drivers/mxc/amd-gpu/common/gsl_memmgr.c
@@ -479,6 +479,8 @@ kgsl_memarena_alloc(gsl_memarena_t *memarena, gsl_flags_t flags, int size, gsl_m
unsigned int blksize;
unsigned int baseaddr, alignedbaseaddr, alignfragment;
int freeblk, alignmentshift;
+ memblk_t *ptrbest = NULL;
+ unsigned int fitsize = ~0UL;
kgsl_log_write( KGSL_LOG_GROUP_MEMORY | KGSL_LOG_LEVEL_TRACE,
"--> int kgsl_memarena_alloc(gsl_memarena_t *memarena=0x%08x, gsl_flags_t flags=0x%08x, int size=%d, gsl_memdesc_t *memdesc=%M)\n", memarena, flags, size, memdesc );
@@ -542,17 +544,33 @@ kgsl_memarena_alloc(gsl_memarena_t *memarena, gsl_flags_t flags, int size, gsl_m
do
{
+ int aba;
// align base address
- baseaddr = ptrfree->blkaddr + memarena->gpubaseaddr;
- alignedbaseaddr = gsl_memarena_alignaddr(baseaddr, alignmentshift);
+ baseaddr = ptrfree->blkaddr + memarena->gpubaseaddr;
+ aba = gsl_memarena_alignaddr(baseaddr, alignmentshift);
- alignfragment = alignedbaseaddr - baseaddr;
-
- if (ptrfree->blksize >= blksize + alignfragment)
- {
- result = GSL_SUCCESS;
- freeblk = 1;
-
+ if (aba - baseaddr == 0 && ptrfree->blksize == blksize) {
+ ptrbest = ptrfree;
+ alignfragment = aba - baseaddr;
+ alignedbaseaddr = aba;
+ result = GSL_SUCCESS;
+ break;
+ }
+
+ if ((ptrfree->blksize >= blksize + aba - baseaddr) &&
+ (fitsize > ptrfree->blksize)) {
+ fitsize = ptrfree->blksize;
+ alignfragment = aba - baseaddr;
+ alignedbaseaddr = aba;
+ result = GSL_SUCCESS;
+ ptrbest = ptrfree;
+ }
+
+ ptrfree = ptrfree->next;
+
+ } while (ptrfree != memarena->freelist.allocrover);
+
+ if (ptrbest) {
memdesc->gpuaddr = alignedbaseaddr;
memdesc->hostptr = kgsl_memarena_gethostptr(memarena, memdesc->gpuaddr);
memdesc->size = blksize;
@@ -561,50 +579,41 @@ kgsl_memarena_alloc(gsl_memarena_t *memarena, gsl_flags_t flags, int size, gsl_m
{
// insert new node to handle newly created (small) fragment
p = kgsl_memarena_getmemblknode(memarena);
- p->blkaddr = ptrfree->blkaddr;
+ p->blkaddr = ptrbest->blkaddr;
p->blksize = alignfragment;
- p->next = ptrfree;
- p->prev = ptrfree->prev;
- ptrfree->prev->next = p;
- ptrfree->prev = p;
+ p->next = ptrbest;
+ p->prev = ptrbest->prev;
+ ptrbest->prev->next = p;
+ ptrbest->prev = p;
- if (ptrfree == memarena->freelist.head)
- {
- memarena->freelist.head = p;
- }
+ if (ptrbest == memarena->freelist.head)
+ memarena->freelist.head = p;
}
- ptrfree->blkaddr += alignfragment + blksize;
- ptrfree->blksize -= alignfragment + blksize;
+ ptrbest->blkaddr += alignfragment + blksize;
+ ptrbest->blksize -= alignfragment + blksize;
- memarena->freelist.allocrover = ptrfree;
+ memarena->freelist.allocrover = ptrbest;
- if (ptrfree->blksize == 0 && ptrfree != ptrlast)
- {
- ptrfree->prev->next = ptrfree->next;
- ptrfree->next->prev = ptrfree->prev;
- if (ptrfree == memarena->freelist.head)
- {
- memarena->freelist.head = ptrfree->next;
- }
- if (ptrfree == memarena->freelist.allocrover)
- {
- memarena->freelist.allocrover = ptrfree->next;
- }
- if (ptrfree == memarena->freelist.freerover)
- {
- memarena->freelist.freerover = ptrfree->prev;
- }
- p = ptrfree;
- ptrfree = ptrfree->prev;
- kgsl_memarena_releasememblknode(memarena, p);
- }
- }
+ if (ptrbest->blksize == 0 && ptrbest != ptrlast) {
+ ptrbest->prev->next = ptrbest->next;
+ ptrbest->next->prev = ptrbest->prev;
- ptrfree = ptrfree->next;
+ if (ptrbest == memarena->freelist.head)
+ memarena->freelist.head = ptrbest->next;
+
+ if (ptrbest == memarena->freelist.allocrover)
+ memarena->freelist.allocrover = ptrbest->next;
+
+ if (ptrbest == memarena->freelist.freerover)
+ memarena->freelist.freerover = ptrbest->prev;
- } while (!freeblk && ptrfree != memarena->freelist.allocrover);
+ p = ptrbest;
+ ptrbest = ptrbest->prev;
+ kgsl_memarena_releasememblknode(memarena, p);
+ }
+ }
GSL_MEMARENA_UNLOCK();
diff --git a/drivers/mxc/amd-gpu/common/gsl_mmu.c b/drivers/mxc/amd-gpu/common/gsl_mmu.c
index 810a058a515d..8259896775b6 100644
--- a/drivers/mxc/amd-gpu/common/gsl_mmu.c
+++ b/drivers/mxc/amd-gpu/common/gsl_mmu.c
@@ -89,7 +89,8 @@ const unsigned int GSL_PT_PAGE_AP[4] = {(GSL_PT_PAGE_READ | GSL_PT_PAGE_WRITE),
#define GSL_PT_MAP_SETBITS(pte, bits) (GSL_PT_MAP_GET(pte) |= (((unsigned int) bits) & GSL_PT_PAGE_AP_MASK))
#define GSL_PT_MAP_SETADDR(pte, pageaddr) (GSL_PT_MAP_GET(pte) = (GSL_PT_MAP_GET(pte) & ~GSL_PT_PAGE_ADDR_MASK) | (((unsigned int) pageaddr) & GSL_PT_PAGE_ADDR_MASK))
-#define GSL_PT_MAP_RESET(pte) (GSL_PT_MAP_GET(pte) = 0)
+/* reserve RV and WV bits to work around READ_PROTECTION_ERROR in some cases */
+#define GSL_PT_MAP_RESET(pte) (GSL_PT_MAP_GET(pte) &= ~GSL_PT_PAGE_ADDR_MASK)
#define GSL_PT_MAP_RESETBITS(pte, bits) (GSL_PT_MAP_GET(pte) &= ~(((unsigned int) bits) & GSL_PT_PAGE_AP_MASK))
#define GSL_MMU_VIRT_TO_PAGE(va) *((unsigned int *)(pagetable->base.gpuaddr + (GSL_PT_ENTRY_GET(va) * GSL_PT_ENTRY_SIZEBYTES)))
@@ -708,6 +709,16 @@ kgsl_mmu_map(gsl_mmu_t *mmu, gpuaddr_t gpubaseaddr, const gsl_scatterlist_t *sca
//----------------------------------------------------------------------------
+static bool is_superpte_empty(gsl_pagetable_t *pagetable, unsigned int superpte)
+{
+ int i;
+ for (i = 0; i < GSL_PT_SUPER_PTE; i++) {
+ if (GSL_PT_MAP_GET(superpte+i))
+ return false;
+ }
+ return true;
+}
+
int
kgsl_mmu_unmap(gsl_mmu_t *mmu, gpuaddr_t gpubaseaddr, int range, unsigned int pid)
{
@@ -777,7 +788,10 @@ kgsl_mmu_unmap(gsl_mmu_t *mmu, gpuaddr_t gpubaseaddr, int range, unsigned int pi
{
do
{
- pagetable->last_superpte -= GSL_PT_SUPER_PTE;
+ if (is_superpte_empty(pagetable, superpte))
+ pagetable->last_superpte -= GSL_PT_SUPER_PTE;
+ else
+ break;
} while (!GSL_PT_MAP_GETADDR(pagetable->last_superpte) && pagetable->last_superpte >= GSL_PT_SUPER_PTE);
}
diff --git a/drivers/mxc/amd-gpu/common/gsl_ringbuffer.c b/drivers/mxc/amd-gpu/common/gsl_ringbuffer.c
index fb05ff3cbe14..112fd086cf81 100644
--- a/drivers/mxc/amd-gpu/common/gsl_ringbuffer.c
+++ b/drivers/mxc/amd-gpu/common/gsl_ringbuffer.c
@@ -342,8 +342,6 @@ kgsl_ringbuffer_checkpm4(unsigned int* cmds, unsigned int sizedwords, int pmodeo
static void
kgsl_ringbuffer_submit(gsl_ringbuffer_t *rb)
{
- unsigned int value;
-
kgsl_log_write( KGSL_LOG_GROUP_COMMAND | KGSL_LOG_LEVEL_TRACE,
"--> static void kgsl_ringbuffer_submit(gsl_ringbuffer_t *rb=0x%08x)\n", rb );
diff --git a/drivers/mxc/amd-gpu/common/pm4_microcode.inl b/drivers/mxc/amd-gpu/common/pm4_microcode.inl
index 03f6f4cd35e4..058548b41522 100644
--- a/drivers/mxc/amd-gpu/common/pm4_microcode.inl
+++ b/drivers/mxc/amd-gpu/common/pm4_microcode.inl
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2010, QUALCOMM Incorporated. All rights reserved.
+/* Copyright (c) 2008-2011, QUALCOMM Incorporated. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -26,12 +26,14 @@
*
*/
+// Microcode Source Version 20111020.a
+
#ifndef PM4_MICROCODE_H
#define PM4_MICROCODE_H
-#define PM4_MICROCODE_VERSION 300684
+#define PM4_MICROCODE_VERSION 422468
-#define PM4_MICROCODE_SIZE 768
+#define PM4_MICROCODE_SIZE 768 // Size of PM4 microcode in QWORD
#ifdef _PRIMLIB_INCLUDE
@@ -47,20 +49,20 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0xd9004800, 0x000 },
{ 0x00000000, 0x00400000, 0x000 },
{ 0x00000000, 0x34e00000, 0x000 },
- { 0x00000000, 0x00600000, 0x28c },
+ { 0x00000000, 0x00600000, 0x287 },
{ 0x0000ffff, 0xc0280a20, 0x000 },
{ 0x00000000, 0x00294582, 0x000 },
{ 0x00000000, 0xd9004800, 0x000 },
{ 0x00000000, 0x00400000, 0x000 },
- { 0x00000000, 0x00600000, 0x28c },
+ { 0x00000000, 0x00600000, 0x287 },
{ 0x0000ffff, 0xc0284620, 0x000 },
{ 0x00000000, 0xd9004800, 0x000 },
{ 0x00000000, 0x00400000, 0x000 },
- { 0x00000000, 0x00600000, 0x2a8 },
+ { 0x00000000, 0x00600000, 0x2ac },
{ 0x00000000, 0xc0200c00, 0x000 },
{ 0x000021fc, 0x0029462c, 0x000 },
{ 0x00000000, 0x00404803, 0x021 },
- { 0x00000000, 0x00600000, 0x2a8 },
+ { 0x00000000, 0x00600000, 0x2ac },
{ 0x00000000, 0xc0200000, 0x000 },
{ 0x00000000, 0xc0200c00, 0x000 },
{ 0x000021fc, 0x0029462c, 0x000 },
@@ -78,7 +80,7 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x0000000e, 0x00404811, 0x000 },
{ 0x00000394, 0x00204411, 0x000 },
{ 0x00000001, 0xc0404811, 0x000 },
- { 0x00000000, 0x00600000, 0x2a8 },
+ { 0x00000000, 0x00600000, 0x2ac },
{ 0x000021f9, 0x0029462c, 0x000 },
{ 0x00000008, 0xc0210a20, 0x000 },
{ 0x00000000, 0x14e00000, 0x02d },
@@ -88,53 +90,48 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x0000001b, 0x002f0222, 0x000 },
{ 0x00000000, 0x0ce00000, 0x043 },
{ 0x00000002, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ce00000, 0x04a },
+ { 0x00000000, 0x0ce00000, 0x045 },
{ 0x00000003, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ce00000, 0x051 },
+ { 0x00000000, 0x0ce00000, 0x047 },
{ 0x00000004, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ce00000, 0x058 },
+ { 0x00000000, 0x0ce00000, 0x049 },
{ 0x00000014, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ce00000, 0x058 },
+ { 0x00000000, 0x0ce00000, 0x049 },
{ 0x00000015, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ce00000, 0x060 },
+ { 0x00000000, 0x0ce00000, 0x05b },
{ 0x000021f9, 0x0029462c, 0x000 },
{ 0x00000000, 0xc0404802, 0x000 },
{ 0x0000001f, 0x40280a20, 0x000 },
{ 0x0000001b, 0x002f0222, 0x000 },
{ 0x00000000, 0x0ce00000, 0x043 },
{ 0x00000002, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ce00000, 0x04a },
- { 0x00000000, 0x00400000, 0x051 },
+ { 0x00000000, 0x0ce00000, 0x045 },
+ { 0x00000000, 0x00400000, 0x047 },
{ 0x0000001f, 0xc0210e20, 0x000 },
- { 0x00000612, 0x00204411, 0x000 },
- { 0x00000000, 0x00204803, 0x000 },
- { 0x00000000, 0xc0204800, 0x000 },
- { 0x00000000, 0xc0204800, 0x000 },
- { 0x000021f9, 0x0029462c, 0x000 },
- { 0x00000000, 0x00404802, 0x000 },
+ { 0x00000612, 0x00404411, 0x04c },
{ 0x0000001e, 0xc0210e20, 0x000 },
- { 0x00000600, 0x00204411, 0x000 },
- { 0x00000000, 0x00204803, 0x000 },
- { 0x00000000, 0xc0204800, 0x000 },
- { 0x00000000, 0xc0204800, 0x000 },
- { 0x000021f9, 0x0029462c, 0x000 },
- { 0x00000000, 0x00404802, 0x000 },
+ { 0x00000600, 0x00404411, 0x04c },
{ 0x0000001e, 0xc0210e20, 0x000 },
- { 0x00000605, 0x00204411, 0x000 },
- { 0x00000000, 0x00204803, 0x000 },
- { 0x00000000, 0xc0204800, 0x000 },
- { 0x00000000, 0xc0204800, 0x000 },
- { 0x000021f9, 0x0029462c, 0x000 },
- { 0x00000000, 0x00404802, 0x000 },
+ { 0x00000605, 0x00404411, 0x04c },
{ 0x0000001f, 0x40280a20, 0x000 },
{ 0x0000001f, 0xc0210e20, 0x000 },
{ 0x0000060a, 0x00204411, 0x000 },
{ 0x00000000, 0x00204803, 0x000 },
- { 0x00000000, 0xc0204800, 0x000 },
- { 0x00000000, 0xc0204800, 0x000 },
+ { 0x00000000, 0xc0201000, 0x000 },
+ { 0x00000000, 0x00204804, 0x000 },
+ { 0x00000000, 0xc0200c00, 0x000 },
+ { 0x00000000, 0x00204803, 0x000 },
+ { 0x00000080, 0x00201c11, 0x000 },
{ 0x000021f9, 0x0029462c, 0x000 },
- { 0x00000000, 0x00404802, 0x000 },
- { 0x0000001f, 0xc0680a20, 0x2a8 },
+ { 0x00000000, 0x00204802, 0x000 },
+ { 0x00000000, 0x00600000, 0x130 },
+ { 0x00000000, 0x002f0070, 0x000 },
+ { 0x00000000, 0x0ce00000, 0x000 },
+ { 0x00000001, 0x00331e27, 0x000 },
+ { 0x00000000, 0x002f0227, 0x000 },
+ { 0x00000000, 0x0ae00000, 0x054 },
+ { 0x00000000, 0x00400000, 0x051 },
+ { 0x0000001f, 0xc0680a20, 0x2ac },
{ 0x000021f9, 0x0029462c, 0x000 },
{ 0x00000000, 0x00404802, 0x000 },
{ 0x8100ffff, 0x00204411, 0x000 },
@@ -142,24 +139,24 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00001fff, 0x40280a20, 0x000 },
{ 0x80000000, 0x40280e20, 0x000 },
{ 0x40000000, 0xc0281220, 0x000 },
- { 0x00040000, 0x00694622, 0x2b2 },
+ { 0x00040000, 0x00694622, 0x2b4 },
{ 0x00000000, 0x00201410, 0x000 },
{ 0x00000000, 0x002f0223, 0x000 },
- { 0x00000000, 0x0ae00000, 0x06d },
- { 0x00000000, 0xc0401800, 0x070 },
+ { 0x00000000, 0x0ae00000, 0x068 },
+ { 0x00000000, 0xc0401800, 0x06b },
{ 0x00001fff, 0xc0281a20, 0x000 },
- { 0x00040000, 0x00694626, 0x2b2 },
+ { 0x00040000, 0x00694626, 0x2b4 },
{ 0x00000000, 0x00201810, 0x000 },
{ 0x00000000, 0x002f0224, 0x000 },
- { 0x00000000, 0x0ae00000, 0x073 },
- { 0x00000000, 0xc0401c00, 0x076 },
+ { 0x00000000, 0x0ae00000, 0x06e },
+ { 0x00000000, 0xc0401c00, 0x071 },
{ 0x00001fff, 0xc0281e20, 0x000 },
- { 0x00040000, 0x00694627, 0x2b2 },
+ { 0x00040000, 0x00694627, 0x2b4 },
{ 0x00000000, 0x00201c10, 0x000 },
{ 0x00000000, 0x00204402, 0x000 },
{ 0x00000000, 0x002820c5, 0x000 },
{ 0x00000000, 0x004948e8, 0x000 },
- { 0x00000000, 0x00600000, 0x28c },
+ { 0x00000000, 0x00600000, 0x287 },
{ 0x00000010, 0x40210a20, 0x000 },
{ 0x000000ff, 0x00280a22, 0x000 },
{ 0x000007ff, 0x40280e20, 0x000 },
@@ -167,25 +164,25 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000005, 0xc0211220, 0x000 },
{ 0x00080000, 0x00281224, 0x000 },
{ 0x00000013, 0x00210224, 0x000 },
- { 0x00000000, 0x14c00000, 0x084 },
+ { 0x00000000, 0x14c00000, 0x07f },
{ 0xa100ffff, 0x00204411, 0x000 },
{ 0x00000000, 0x00204811, 0x000 },
{ 0x00000000, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x088 },
+ { 0x00000000, 0x0ae00000, 0x083 },
{ 0x00000000, 0x0020162d, 0x000 },
- { 0x00004000, 0x00500e23, 0x097 },
+ { 0x00004000, 0x00500e23, 0x092 },
{ 0x00000001, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x08c },
+ { 0x00000000, 0x0ae00000, 0x087 },
{ 0x00000001, 0x0020162d, 0x000 },
- { 0x00004800, 0x00500e23, 0x097 },
+ { 0x00004800, 0x00500e23, 0x092 },
{ 0x00000002, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x090 },
+ { 0x00000000, 0x0ae00000, 0x08b },
{ 0x00000003, 0x0020162d, 0x000 },
- { 0x00004900, 0x00500e23, 0x097 },
+ { 0x00004900, 0x00500e23, 0x092 },
{ 0x00000003, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x094 },
+ { 0x00000000, 0x0ae00000, 0x08f },
{ 0x00000002, 0x0020162d, 0x000 },
- { 0x00004908, 0x00500e23, 0x097 },
+ { 0x00004908, 0x00500e23, 0x092 },
{ 0x00000012, 0x0020162d, 0x000 },
{ 0x00002000, 0x00300e23, 0x000 },
{ 0x00000000, 0x00290d83, 0x000 },
@@ -200,7 +197,7 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0x002948e5, 0x000 },
{ 0x9300ffff, 0x00204411, 0x000 },
{ 0x00000000, 0x00404806, 0x000 },
- { 0x00000000, 0x00600000, 0x28c },
+ { 0x00000000, 0x00600000, 0x287 },
{ 0x00000000, 0xc0200800, 0x000 },
{ 0x00000000, 0xc0201400, 0x000 },
{ 0x0000001f, 0x00211a25, 0x000 },
@@ -209,31 +206,31 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000010, 0x00211225, 0x000 },
{ 0x8300ffff, 0x00204411, 0x000 },
{ 0x00000000, 0x002f0224, 0x000 },
- { 0x00000000, 0x0ae00000, 0x0ae },
+ { 0x00000000, 0x0ae00000, 0x0a9 },
{ 0x00000000, 0x00203622, 0x000 },
- { 0x00004000, 0x00504a23, 0x0bd },
+ { 0x00004000, 0x00504a23, 0x0b8 },
{ 0x00000001, 0x002f0224, 0x000 },
- { 0x00000000, 0x0ae00000, 0x0b2 },
+ { 0x00000000, 0x0ae00000, 0x0ad },
{ 0x00000001, 0x00203622, 0x000 },
- { 0x00004800, 0x00504a23, 0x0bd },
+ { 0x00004800, 0x00504a23, 0x0b8 },
{ 0x00000002, 0x002f0224, 0x000 },
- { 0x00000000, 0x0ae00000, 0x0b6 },
+ { 0x00000000, 0x0ae00000, 0x0b1 },
{ 0x00000003, 0x00203622, 0x000 },
- { 0x00004900, 0x00504a23, 0x0bd },
+ { 0x00004900, 0x00504a23, 0x0b8 },
{ 0x00000003, 0x002f0224, 0x000 },
- { 0x00000000, 0x0ae00000, 0x0ba },
+ { 0x00000000, 0x0ae00000, 0x0b5 },
{ 0x00000002, 0x00203622, 0x000 },
- { 0x00004908, 0x00504a23, 0x0bd },
+ { 0x00004908, 0x00504a23, 0x0b8 },
{ 0x00000012, 0x00203622, 0x000 },
{ 0x00000000, 0x00290d83, 0x000 },
{ 0x00002000, 0x00304a23, 0x000 },
{ 0x8400ffff, 0x00204411, 0x000 },
{ 0x00000000, 0xc0204800, 0x000 },
{ 0x00000000, 0x21000000, 0x000 },
- { 0x00000000, 0x00400000, 0x0a4 },
+ { 0x00000000, 0x00400000, 0x09f },
{ 0x8100ffff, 0x00204411, 0x000 },
{ 0x00000001, 0x00204811, 0x000 },
- { 0x00040578, 0x00604411, 0x2b2 },
+ { 0x00040578, 0x00604411, 0x2b4 },
{ 0x00000000, 0xc0400000, 0x000 },
{ 0x00000000, 0xc0200c00, 0x000 },
{ 0x00000000, 0xc0201000, 0x000 },
@@ -241,62 +238,62 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0xc0201800, 0x000 },
{ 0x00007f00, 0x00280a21, 0x000 },
{ 0x00004500, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ce00000, 0x0cd },
+ { 0x00000000, 0x0ce00000, 0x0c8 },
{ 0x00000000, 0xc0201c00, 0x000 },
{ 0x00000000, 0x17000000, 0x000 },
{ 0x00000010, 0x00280a23, 0x000 },
{ 0x00000010, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ce00000, 0x0d5 },
+ { 0x00000000, 0x0ce00000, 0x0d0 },
{ 0x8100ffff, 0x00204411, 0x000 },
{ 0x00000001, 0x00204811, 0x000 },
- { 0x00040000, 0x00694624, 0x2b2 },
- { 0x00000000, 0x00400000, 0x0d6 },
- { 0x00000000, 0x00600000, 0x135 },
+ { 0x00040000, 0x00694624, 0x2b4 },
+ { 0x00000000, 0x00400000, 0x0d1 },
+ { 0x00000000, 0x00600000, 0x130 },
{ 0x00000000, 0x002820d0, 0x000 },
{ 0x00000007, 0x00280a23, 0x000 },
{ 0x00000001, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x0dd },
+ { 0x00000000, 0x0ae00000, 0x0d8 },
{ 0x00000000, 0x002f00a8, 0x000 },
- { 0x00000000, 0x04e00000, 0x0f6 },
- { 0x00000000, 0x00400000, 0x0fd },
+ { 0x00000000, 0x04e00000, 0x0f1 },
+ { 0x00000000, 0x00400000, 0x0f8 },
{ 0x00000002, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x0e2 },
+ { 0x00000000, 0x0ae00000, 0x0dd },
{ 0x00000000, 0x002f00a8, 0x000 },
- { 0x00000000, 0x02e00000, 0x0f6 },
- { 0x00000000, 0x00400000, 0x0fd },
+ { 0x00000000, 0x02e00000, 0x0f1 },
+ { 0x00000000, 0x00400000, 0x0f8 },
{ 0x00000003, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x0e7 },
+ { 0x00000000, 0x0ae00000, 0x0e2 },
{ 0x00000000, 0x002f00a8, 0x000 },
- { 0x00000000, 0x0ce00000, 0x0f6 },
- { 0x00000000, 0x00400000, 0x0fd },
+ { 0x00000000, 0x0ce00000, 0x0f1 },
+ { 0x00000000, 0x00400000, 0x0f8 },
{ 0x00000004, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x0ec },
+ { 0x00000000, 0x0ae00000, 0x0e7 },
{ 0x00000000, 0x002f00a8, 0x000 },
- { 0x00000000, 0x0ae00000, 0x0f6 },
- { 0x00000000, 0x00400000, 0x0fd },
- { 0x00000005, 0x002f0222, 0x000 },
{ 0x00000000, 0x0ae00000, 0x0f1 },
+ { 0x00000000, 0x00400000, 0x0f8 },
+ { 0x00000005, 0x002f0222, 0x000 },
+ { 0x00000000, 0x0ae00000, 0x0ec },
{ 0x00000000, 0x002f00a8, 0x000 },
- { 0x00000000, 0x06e00000, 0x0f6 },
- { 0x00000000, 0x00400000, 0x0fd },
+ { 0x00000000, 0x06e00000, 0x0f1 },
+ { 0x00000000, 0x00400000, 0x0f8 },
{ 0x00000006, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x0f6 },
+ { 0x00000000, 0x0ae00000, 0x0f1 },
{ 0x00000000, 0x002f00a8, 0x000 },
- { 0x00000000, 0x08e00000, 0x0f6 },
- { 0x00000000, 0x00400000, 0x0fd },
+ { 0x00000000, 0x08e00000, 0x0f1 },
+ { 0x00000000, 0x00400000, 0x0f8 },
{ 0x00007f00, 0x00280a21, 0x000 },
{ 0x00004500, 0x002f0222, 0x000 },
{ 0x00000000, 0x0ae00000, 0x000 },
{ 0x00000008, 0x00210a23, 0x000 },
- { 0x00000000, 0x14e00000, 0x11b },
+ { 0x00000000, 0x14e00000, 0x116 },
{ 0x00000000, 0xc0204400, 0x000 },
{ 0x00000000, 0xc0404800, 0x000 },
{ 0x00007f00, 0x00280a21, 0x000 },
{ 0x00004500, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x102 },
+ { 0x00000000, 0x0ae00000, 0x0fd },
{ 0x00000000, 0xc0200000, 0x000 },
{ 0x00000000, 0xc0400000, 0x000 },
- { 0x00000000, 0x00404c07, 0x0cd },
+ { 0x00000000, 0x00404c07, 0x0c8 },
{ 0x00000000, 0xc0201000, 0x000 },
{ 0x00000000, 0xc0201400, 0x000 },
{ 0x00000000, 0xc0201800, 0x000 },
@@ -304,11 +301,11 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0x17000000, 0x000 },
{ 0x8100ffff, 0x00204411, 0x000 },
{ 0x00000001, 0x00204811, 0x000 },
- { 0x00040000, 0x00694624, 0x2b2 },
+ { 0x00040000, 0x00694624, 0x2b4 },
{ 0x00000000, 0x002820d0, 0x000 },
{ 0x00000000, 0x002f00a8, 0x000 },
{ 0x00000000, 0x0ce00000, 0x000 },
- { 0x00000000, 0x00404c07, 0x107 },
+ { 0x00000000, 0x00404c07, 0x102 },
{ 0x00000000, 0xc0201000, 0x000 },
{ 0x00000000, 0xc0201400, 0x000 },
{ 0x00000000, 0xc0201800, 0x000 },
@@ -316,11 +313,11 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0x17000000, 0x000 },
{ 0x8100ffff, 0x00204411, 0x000 },
{ 0x00000001, 0x00204811, 0x000 },
- { 0x00040000, 0x00694624, 0x2b2 },
+ { 0x00040000, 0x00694624, 0x2b4 },
{ 0x00000000, 0x002820d0, 0x000 },
{ 0x00000000, 0x002f00a8, 0x000 },
{ 0x00000000, 0x06e00000, 0x000 },
- { 0x00000000, 0x00404c07, 0x113 },
+ { 0x00000000, 0x00404c07, 0x10e },
{ 0x0000060d, 0x00204411, 0x000 },
{ 0x00000000, 0xc0204800, 0x000 },
{ 0x0000860e, 0x00204411, 0x000 },
@@ -335,13 +332,13 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000001, 0x00204811, 0x000 },
{ 0x00000000, 0xc0200800, 0x000 },
{ 0x00007fff, 0x00281a22, 0x000 },
- { 0x00040000, 0x00694626, 0x2b2 },
+ { 0x00040000, 0x00694626, 0x2b4 },
{ 0x00000000, 0x00200c10, 0x000 },
{ 0x00000000, 0xc0201000, 0x000 },
{ 0x80000000, 0x00281a22, 0x000 },
{ 0x00000000, 0x002f0226, 0x000 },
- { 0x00000000, 0x0ce00000, 0x132 },
- { 0x00000000, 0x00600000, 0x135 },
+ { 0x00000000, 0x0ce00000, 0x12d },
+ { 0x00000000, 0x00600000, 0x130 },
{ 0x00000000, 0x00201c10, 0x000 },
{ 0x00000000, 0x00300c67, 0x000 },
{ 0x0000060d, 0x00204411, 0x000 },
@@ -353,10 +350,10 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0x00204811, 0x000 },
{ 0x000001ea, 0x00204411, 0x000 },
{ 0x00000000, 0x00204804, 0x000 },
- { 0x00000000, 0x1ac00000, 0x13b },
+ { 0x00000000, 0x1ac00000, 0x136 },
{ 0x9e00ffff, 0x00204411, 0x000 },
{ 0xdeadbeef, 0x00204811, 0x000 },
- { 0x00000000, 0x1ae00000, 0x13e },
+ { 0x00000000, 0x1ae00000, 0x139 },
{ 0xa400ffff, 0x00204411, 0x000 },
{ 0x00000000, 0x0080480b, 0x000 },
{ 0x000001f3, 0x00204411, 0x000 },
@@ -405,28 +402,28 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000001, 0x00303e2f, 0x000 },
{ 0x00000000, 0xc0200800, 0x000 },
{ 0x00000000, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ce00000, 0x172 },
+ { 0x00000000, 0x0ce00000, 0x16d },
{ 0x00000000, 0xd9000000, 0x000 },
{ 0x00000000, 0x00400000, 0x000 },
- { 0x00000000, 0x00600000, 0x28c },
+ { 0x00000000, 0x00600000, 0x287 },
{ 0x8100ffff, 0x00204411, 0x000 },
{ 0x00000002, 0x00204811, 0x000 },
{ 0x00000000, 0x002f0230, 0x000 },
- { 0x00000000, 0x0ae00000, 0x175 },
+ { 0x00000000, 0x0ae00000, 0x170 },
{ 0x00000000, 0xc0200800, 0x000 },
{ 0x00000009, 0x00210222, 0x000 },
- { 0x00000000, 0x14c00000, 0x17d },
- { 0x00000000, 0x00600000, 0x2af },
+ { 0x00000000, 0x14c00000, 0x178 },
+ { 0x00000000, 0x00600000, 0x2aa },
{ 0x00000000, 0x00200c11, 0x000 },
{ 0x00000016, 0x00203623, 0x000 },
{ 0x00000000, 0x00210222, 0x000 },
- { 0x00000000, 0x14c00000, 0x180 },
+ { 0x00000000, 0x14c00000, 0x17b },
{ 0x00000000, 0xc0200000, 0x000 },
{ 0x00000001, 0x00210222, 0x000 },
- { 0x00000000, 0x14c00000, 0x183 },
+ { 0x00000000, 0x14c00000, 0x17e },
{ 0x00000000, 0xc0200000, 0x000 },
{ 0x00000002, 0x00210222, 0x000 },
- { 0x00000000, 0x14c00000, 0x18d },
+ { 0x00000000, 0x14c00000, 0x188 },
{ 0x00000004, 0xc0203620, 0x000 },
{ 0x00000005, 0xc0203620, 0x000 },
{ 0x00000006, 0xc0203620, 0x000 },
@@ -436,7 +433,7 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x0000000a, 0xc0203620, 0x000 },
{ 0x0000000b, 0xc0203620, 0x000 },
{ 0x00000003, 0x00210222, 0x000 },
- { 0x00000000, 0x14c00000, 0x1b5 },
+ { 0x00000000, 0x14c00000, 0x1b0 },
{ 0x00000000, 0xc0200c00, 0x000 },
{ 0x8c00ffff, 0x00204411, 0x000 },
{ 0x00000000, 0x00204803, 0x000 },
@@ -476,24 +473,24 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000003, 0x00384a27, 0x000 },
{ 0x00300000, 0x00293a2e, 0x000 },
{ 0x00000004, 0x00210222, 0x000 },
- { 0x00000000, 0x14c00000, 0x1bd },
+ { 0x00000000, 0x14c00000, 0x1b8 },
{ 0xa300ffff, 0x00204411, 0x000 },
{ 0x00000000, 0x40204800, 0x000 },
{ 0x0000000a, 0xc0220e20, 0x000 },
{ 0x00000011, 0x00203623, 0x000 },
{ 0x000021f4, 0x00204411, 0x000 },
- { 0x0000000a, 0x00614a2c, 0x2af },
+ { 0x0000000a, 0x00614a2c, 0x2aa },
{ 0x00000005, 0x00210222, 0x000 },
- { 0x00000000, 0x14c00000, 0x1c0 },
+ { 0x00000000, 0x14c00000, 0x1bb },
{ 0x00000000, 0xc0200000, 0x000 },
{ 0x00000006, 0x00210222, 0x000 },
- { 0x00000000, 0x14c00000, 0x1c6 },
+ { 0x00000000, 0x14c00000, 0x1c1 },
{ 0x9c00ffff, 0x00204411, 0x000 },
{ 0x0000001f, 0x40214a20, 0x000 },
{ 0x9600ffff, 0x00204411, 0x000 },
{ 0x00000000, 0xc0204800, 0x000 },
{ 0x00000007, 0x00210222, 0x000 },
- { 0x00000000, 0x14c00000, 0x1d0 },
+ { 0x00000000, 0x14c00000, 0x1cb },
{ 0x3fffffff, 0x00283a2e, 0x000 },
{ 0xc0000000, 0x40280e20, 0x000 },
{ 0x00000000, 0x0029386e, 0x000 },
@@ -503,7 +500,7 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0xc0202c00, 0x000 },
{ 0x00000000, 0x0020480b, 0x000 },
{ 0x00000008, 0x00210222, 0x000 },
- { 0x00000000, 0x14c00000, 0x1dc },
+ { 0x00000000, 0x14c00000, 0x1d7 },
{ 0x00000000, 0xc0200c00, 0x000 },
{ 0x00000013, 0x00203623, 0x000 },
{ 0x00000015, 0x00203623, 0x000 },
@@ -515,7 +512,7 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0xefffffff, 0x00283a2e, 0x000 },
{ 0x00000000, 0x0029386e, 0x000 },
{ 0x00000000, 0x00400000, 0x000 },
- { 0x00000000, 0x00600000, 0x28c },
+ { 0x00000000, 0x00600000, 0x287 },
{ 0x00000000, 0xc0200800, 0x000 },
{ 0x0000001f, 0x00210e22, 0x000 },
{ 0x00000000, 0x14e00000, 0x000 },
@@ -529,46 +526,46 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x8400ffff, 0x00204411, 0x000 },
{ 0x00000000, 0x00204803, 0x000 },
{ 0x00000000, 0x21000000, 0x000 },
- { 0x00000000, 0x00400000, 0x1de },
+ { 0x00000000, 0x00400000, 0x1d9 },
{ 0x8200ffff, 0x00204411, 0x000 },
{ 0x00000001, 0x00204811, 0x000 },
{ 0x00000000, 0xc0200800, 0x000 },
{ 0x00003fff, 0x40280e20, 0x000 },
{ 0x00000010, 0xc0211220, 0x000 },
{ 0x00000000, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x1fb },
- { 0x00000000, 0x2ae00000, 0x205 },
+ { 0x00000000, 0x0ae00000, 0x1f6 },
+ { 0x00000000, 0x2ae00000, 0x200 },
{ 0x20000080, 0x00281e2e, 0x000 },
{ 0x00000080, 0x002f0227, 0x000 },
- { 0x00000000, 0x0ce00000, 0x1f8 },
- { 0x00000000, 0x00401c0c, 0x1f9 },
+ { 0x00000000, 0x0ce00000, 0x1f3 },
+ { 0x00000000, 0x00401c0c, 0x1f4 },
{ 0x00000010, 0x00201e2d, 0x000 },
{ 0x000021f9, 0x00294627, 0x000 },
- { 0x00000000, 0x00404811, 0x205 },
+ { 0x00000000, 0x00404811, 0x200 },
{ 0x00000001, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x23a },
- { 0x00000000, 0x28e00000, 0x205 },
+ { 0x00000000, 0x0ae00000, 0x235 },
+ { 0x00000000, 0x28e00000, 0x200 },
{ 0x00800080, 0x00281e2e, 0x000 },
{ 0x00000080, 0x002f0227, 0x000 },
- { 0x00000000, 0x0ce00000, 0x202 },
- { 0x00000000, 0x00401c0c, 0x203 },
+ { 0x00000000, 0x0ce00000, 0x1fd },
+ { 0x00000000, 0x00401c0c, 0x1fe },
{ 0x00000010, 0x00201e2d, 0x000 },
{ 0x000021f9, 0x00294627, 0x000 },
{ 0x00000001, 0x00204811, 0x000 },
{ 0x8100ffff, 0x00204411, 0x000 },
{ 0x00000000, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x20c },
+ { 0x00000000, 0x0ae00000, 0x207 },
{ 0x00000003, 0x00204811, 0x000 },
{ 0x0000000c, 0x0020162d, 0x000 },
{ 0x0000000d, 0x00201a2d, 0x000 },
- { 0xffdfffff, 0x00483a2e, 0x210 },
+ { 0xffdfffff, 0x00483a2e, 0x20b },
{ 0x00000004, 0x00204811, 0x000 },
{ 0x0000000e, 0x0020162d, 0x000 },
{ 0x0000000f, 0x00201a2d, 0x000 },
{ 0xffefffff, 0x00283a2e, 0x000 },
{ 0x00000000, 0x00201c10, 0x000 },
{ 0x00000000, 0x002f0067, 0x000 },
- { 0x00000000, 0x04e00000, 0x205 },
+ { 0x00000000, 0x04e00000, 0x200 },
{ 0x8100ffff, 0x00204411, 0x000 },
{ 0x00000006, 0x00204811, 0x000 },
{ 0x8300ffff, 0x00204411, 0x000 },
@@ -578,10 +575,10 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x8400ffff, 0x00204411, 0x000 },
{ 0x00000000, 0x00204803, 0x000 },
{ 0x00000000, 0x21000000, 0x000 },
- { 0x00000000, 0x00601010, 0x28c },
+ { 0x00000000, 0x00601010, 0x287 },
{ 0x0000000c, 0x00221e24, 0x000 },
{ 0x00000000, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x22d },
+ { 0x00000000, 0x0ae00000, 0x228 },
{ 0x20000000, 0x00293a2e, 0x000 },
{ 0x000021f7, 0x0029462c, 0x000 },
{ 0x00000000, 0x002948c7, 0x000 },
@@ -594,7 +591,7 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0x00204803, 0x000 },
{ 0x00000000, 0x23000000, 0x000 },
{ 0x8d00ffff, 0x00204411, 0x000 },
- { 0x00000000, 0x00404803, 0x240 },
+ { 0x00000000, 0x00404803, 0x23b },
{ 0x00800000, 0x00293a2e, 0x000 },
{ 0x000021f6, 0x0029462c, 0x000 },
{ 0x00000000, 0x002948c7, 0x000 },
@@ -607,7 +604,7 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0x00204803, 0x000 },
{ 0x00000000, 0x25000000, 0x000 },
{ 0x8e00ffff, 0x00204411, 0x000 },
- { 0x00000000, 0x00404803, 0x240 },
+ { 0x00000000, 0x00404803, 0x23b },
{ 0x8300ffff, 0x00204411, 0x000 },
{ 0x00000003, 0x00381224, 0x000 },
{ 0x00005000, 0x00304a24, 0x000 },
@@ -621,37 +618,37 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x8100ffff, 0x00204411, 0x000 },
{ 0x00000001, 0x00204811, 0x000 },
{ 0x00000001, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x24a },
+ { 0x00000000, 0x0ae00000, 0x245 },
{ 0x000021f6, 0x0029122c, 0x000 },
- { 0x00040000, 0x00494624, 0x24c },
+ { 0x00040000, 0x00494624, 0x247 },
{ 0x000021f7, 0x0029122c, 0x000 },
{ 0x00040000, 0x00294624, 0x000 },
- { 0x00000000, 0x00600000, 0x2b2 },
+ { 0x00000000, 0x00600000, 0x2b4 },
{ 0x00000000, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ce00000, 0x252 },
+ { 0x00000000, 0x0ce00000, 0x24d },
{ 0x00000001, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ce00000, 0x252 },
- { 0x00000000, 0x00481630, 0x258 },
+ { 0x00000000, 0x0ce00000, 0x24d },
+ { 0x00000000, 0x00481630, 0x253 },
{ 0x00000fff, 0x00281630, 0x000 },
{ 0x0000000c, 0x00211a30, 0x000 },
{ 0x00000fff, 0x00281a26, 0x000 },
{ 0x00000000, 0x002f0226, 0x000 },
- { 0x00000000, 0x0ae00000, 0x258 },
+ { 0x00000000, 0x0ae00000, 0x253 },
{ 0x00000000, 0xc0400000, 0x000 },
- { 0x00040d02, 0x00604411, 0x2b2 },
+ { 0x00040d02, 0x00604411, 0x2b4 },
{ 0x00000000, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x25d },
+ { 0x00000000, 0x0ae00000, 0x258 },
{ 0x00000010, 0x00211e30, 0x000 },
- { 0x00000fff, 0x00482630, 0x267 },
+ { 0x00000fff, 0x00482630, 0x262 },
{ 0x00000001, 0x002f0222, 0x000 },
- { 0x00000000, 0x0ae00000, 0x261 },
+ { 0x00000000, 0x0ae00000, 0x25c },
{ 0x00000fff, 0x00281e30, 0x000 },
- { 0x00000200, 0x00402411, 0x267 },
+ { 0x00000200, 0x00402411, 0x262 },
{ 0x00000000, 0x00281e30, 0x000 },
{ 0x00000010, 0x00212630, 0x000 },
{ 0x00000010, 0x00211a30, 0x000 },
{ 0x00000000, 0x002f0226, 0x000 },
- { 0x00000000, 0x0ae00000, 0x258 },
+ { 0x00000000, 0x0ae00000, 0x253 },
{ 0x00000000, 0xc0400000, 0x000 },
{ 0x00000003, 0x00381625, 0x000 },
{ 0x00000003, 0x00381a26, 0x000 },
@@ -662,13 +659,13 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0xc0204800, 0x000 },
{ 0x00000000, 0x00204806, 0x000 },
{ 0x00005000, 0x00302225, 0x000 },
- { 0x00040000, 0x00694628, 0x2b2 },
+ { 0x00040000, 0x00694628, 0x2b4 },
{ 0x00000001, 0x00302228, 0x000 },
{ 0x00000000, 0x00202810, 0x000 },
- { 0x00040000, 0x00694628, 0x2b2 },
+ { 0x00040000, 0x00694628, 0x2b4 },
{ 0x00000001, 0x00302228, 0x000 },
{ 0x00000000, 0x00200810, 0x000 },
- { 0x00040000, 0x00694628, 0x2b2 },
+ { 0x00040000, 0x00694628, 0x2b4 },
{ 0x00000001, 0x00302228, 0x000 },
{ 0x00000000, 0x00201410, 0x000 },
{ 0x0000060d, 0x00204411, 0x000 },
@@ -678,35 +675,42 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0x00204802, 0x000 },
{ 0x00000000, 0x00204805, 0x000 },
{ 0x00000000, 0x002f0128, 0x000 },
- { 0x00000000, 0x0ae00000, 0x282 },
+ { 0x00000000, 0x0ae00000, 0x27d },
{ 0x00005000, 0x00302227, 0x000 },
{ 0x0000000c, 0x00300e23, 0x000 },
{ 0x00000003, 0x00331a26, 0x000 },
{ 0x00000000, 0x002f0226, 0x000 },
- { 0x00000000, 0x0ae00000, 0x270 },
+ { 0x00000000, 0x0ae00000, 0x26b },
{ 0x00000000, 0x00400000, 0x000 },
{ 0x000001f3, 0x00204411, 0x000 },
{ 0x04000000, 0x00204811, 0x000 },
- { 0x00000000, 0x00400000, 0x289 },
- { 0x00000000, 0xc0600000, 0x28c },
+ { 0x00000000, 0x00400000, 0x284 },
+ { 0x00000000, 0xc0600000, 0x287 },
{ 0x00000000, 0x00400000, 0x000 },
- { 0x00000000, 0x0ec00000, 0x28e },
+ { 0x00000000, 0x0ec00000, 0x289 },
{ 0x00000000, 0x00800000, 0x000 },
{ 0x000021f9, 0x0029462c, 0x000 },
{ 0x00000005, 0x00204811, 0x000 },
+ { 0x8100ffff, 0x00204411, 0x000 },
+ { 0x00000002, 0x00204811, 0x000 },
+ { 0x0000000a, 0x0021262c, 0x000 },
+ { 0x00000000, 0x00210130, 0x000 },
+ { 0x00000000, 0x14c00000, 0x292 },
+ { 0xa500ffff, 0x00204411, 0x000 },
+ { 0x00000001, 0x00404811, 0x28e },
{ 0x00000000, 0x0020280c, 0x000 },
{ 0x00000011, 0x0020262d, 0x000 },
{ 0x00000000, 0x002f012c, 0x000 },
- { 0x00000000, 0x0ae00000, 0x295 },
- { 0x00000000, 0x00403011, 0x296 },
+ { 0x00000000, 0x0ae00000, 0x297 },
+ { 0x00000000, 0x00403011, 0x298 },
{ 0x00000400, 0x0030322c, 0x000 },
{ 0x8100ffff, 0x00204411, 0x000 },
{ 0x00000002, 0x00204811, 0x000 },
{ 0x0000000a, 0x0021262c, 0x000 },
{ 0x00000000, 0x00210130, 0x000 },
- { 0x00000000, 0x14c00000, 0x29d },
+ { 0x00000000, 0x14c00000, 0x29f },
{ 0xa500ffff, 0x00204411, 0x000 },
- { 0x00000001, 0x00404811, 0x299 },
+ { 0x00000001, 0x00404811, 0x29b },
{ 0xa500ffff, 0x00204411, 0x000 },
{ 0x00000000, 0x00204811, 0x000 },
{ 0x000021f4, 0x0029462c, 0x000 },
@@ -718,6 +722,8 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0x00210130, 0x000 },
{ 0xdf7fffff, 0x00283a2e, 0x000 },
{ 0x00000010, 0x0080362a, 0x000 },
+ { 0x00000000, 0x00203011, 0x000 },
+ { 0x00000010, 0x0080362c, 0x000 },
{ 0x9700ffff, 0x00204411, 0x000 },
{ 0x00000000, 0x0020480c, 0x000 },
{ 0xa200ffff, 0x00204411, 0x000 },
@@ -725,13 +731,11 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x8100ffff, 0x00204411, 0x000 },
{ 0x00000002, 0x00204811, 0x000 },
{ 0x00000000, 0x00810130, 0x000 },
- { 0x00000000, 0x00203011, 0x000 },
- { 0x00000010, 0x0080362c, 0x000 },
{ 0x00000000, 0xc0400000, 0x000 },
- { 0x00000000, 0x1ac00000, 0x2b2 },
+ { 0x00000000, 0x1ac00000, 0x2b4 },
{ 0x9f00ffff, 0x00204411, 0x000 },
{ 0xdeadbeef, 0x00204811, 0x000 },
- { 0x00000000, 0x1ae00000, 0x2b5 },
+ { 0x00000000, 0x1ae00000, 0x2b7 },
{ 0x00000000, 0x00800000, 0x000 },
{ 0x00000000, 0x00000000, 0x000 },
{ 0x00000000, 0x00000000, 0x000 },
@@ -776,28 +780,26 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00000000, 0x00000000, 0x000 },
{ 0x00000000, 0x00000000, 0x000 },
{ 0x00000000, 0x00000000, 0x000 },
- { 0x00000000, 0x00000000, 0x000 },
- { 0x00000000, 0x00000000, 0x000 },
- { 0x00020143, 0x00020002, 0x000 },
+ { 0x0002013e, 0x00020002, 0x000 },
{ 0x00020002, 0x00020002, 0x000 },
{ 0x00020002, 0x00020002, 0x000 },
- { 0x00020002, 0x01dd0002, 0x000 },
- { 0x006301ee, 0x00280012, 0x000 },
+ { 0x00020002, 0x01d80002, 0x000 },
+ { 0x005e01e9, 0x00280012, 0x000 },
{ 0x00020002, 0x00020026, 0x000 },
- { 0x00020002, 0x01ec0002, 0x000 },
- { 0x00790242, 0x00020002, 0x000 },
+ { 0x00020002, 0x01e70002, 0x000 },
+ { 0x0074023d, 0x00020002, 0x000 },
{ 0x00020002, 0x00020002, 0x000 },
{ 0x00200012, 0x00020016, 0x000 },
{ 0x00020002, 0x00020002, 0x000 },
- { 0x011b00c5, 0x00020125, 0x000 },
- { 0x00020141, 0x00020002, 0x000 },
- { 0x00c50002, 0x0143002e, 0x000 },
- { 0x00a2016b, 0x00020145, 0x000 },
- { 0x00020002, 0x01200002, 0x000 },
- { 0x00020002, 0x010f0103, 0x000 },
+ { 0x011600c0, 0x00020120, 0x000 },
+ { 0x0002013c, 0x00020002, 0x000 },
+ { 0x00c00002, 0x013e002e, 0x000 },
+ { 0x009d0166, 0x00020140, 0x000 },
+ { 0x00020002, 0x011b0002, 0x000 },
+ { 0x00020002, 0x010a00fe, 0x000 },
{ 0x00090002, 0x000e000e, 0x000 },
- { 0x0058003d, 0x00600002, 0x000 },
- { 0x000200c1, 0x0002028a, 0x000 },
+ { 0x0049003d, 0x005b0002, 0x000 },
+ { 0x000200bc, 0x00020285, 0x000 },
{ 0x00020002, 0x00020002, 0x000 },
{ 0x00020002, 0x00020002, 0x000 },
{ 0x00020002, 0x00020002, 0x000 },
@@ -805,7 +807,7 @@ uint32 aPM4_Microcode[PM4_MICROCODE_SIZE][3]={
{ 0x00020002, 0x00020002, 0x000 },
{ 0x00020002, 0x00020002, 0x000 },
{ 0x00020002, 0x00020002, 0x000 },
- { 0x000502b1, 0x00020008, 0x000 },
+ { 0x000502b3, 0x00020008, 0x000 },
};
#endif
diff --git a/drivers/mxc/amd-gpu/include/gsl_buildconfig.h b/drivers/mxc/amd-gpu/include/gsl_buildconfig.h
index 4e6be4da7dc4..b5f852951103 100644
--- a/drivers/mxc/amd-gpu/include/gsl_buildconfig.h
+++ b/drivers/mxc/amd-gpu/include/gsl_buildconfig.h
@@ -27,7 +27,7 @@
*/
/*
- * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2010-2012 Freescale Semiconductor, Inc.
*/
#ifndef __GSL__BUILDCONFIG_H
@@ -49,7 +49,7 @@
/* #define GSL_MMU_PAGETABLE_PERPROCESS */
-#define GSL_CALLER_PROCESS_MAX 10
+#define GSL_CALLER_PROCESS_MAX 64
#define GSL_SHMEM_MAX_APERTURES 3
#endif /* __GSL__BUILDCONFIG_H */
diff --git a/drivers/mxc/amd-gpu/include/gsl_halconfig.h b/drivers/mxc/amd-gpu/include/gsl_halconfig.h
index 363474b7a6bb..a023a9409dac 100644
--- a/drivers/mxc/amd-gpu/include/gsl_halconfig.h
+++ b/drivers/mxc/amd-gpu/include/gsl_halconfig.h
@@ -27,7 +27,7 @@
*/
/*
- * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2010-2012 Freescale Semiconductor, Inc.
*/
#ifndef __GSL_HALCONFIG_H
@@ -38,7 +38,7 @@
#define GSL_HAL_SIZE_REG_G12 0x00001000 /* 4KB */
-#define GSL_HAL_SHMEM_SIZE_EMEM1_MMU 0x01800000 /* 24MB */
+#define GSL_HAL_SHMEM_SIZE_EMEM1_MMU 0x08000000 /* 128MB */
#define GSL_HAL_SHMEM_SIZE_EMEM2_MMU 0x00400000 /* 4MB */
#define GSL_HAL_SHMEM_SIZE_PHYS_MMU 0x00400000 /* 4MB */
diff --git a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hal.c b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hal.c
index 51270ada4d36..45740b53d9b7 100644
--- a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hal.c
+++ b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hal.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2008-2010, Advanced Micro Devices. All rights reserved.
- * Copyright (C) 2008-2011 Freescale Semiconductor, Inc.
+ * Copyright (C) 2008-2012 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -17,10 +17,6 @@
*
*/
-/*
- * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
- */
-
#include "gsl_hal.h"
#include "gsl_halconfig.h"
#include "gsl_linux_map.h"
@@ -49,6 +45,7 @@ extern int gmem_size;
extern phys_addr_t gpu_reserved_mem;
extern int gpu_reserved_mem_size;
extern int gpu_2d_irq, gpu_3d_irq;
+extern int enable_mmu;
KGSLHAL_API int
@@ -121,8 +118,7 @@ kgsl_hal_init(void)
hal->has_z160 = 0;
}
- /* there is still some problem to enable mmu currently */
- gsl_driver.enable_mmu = 0;
+ gsl_driver.enable_mmu = enable_mmu;
/* setup register space */
if (hal->has_z430) {
diff --git a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hwaccess.h b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hwaccess.h
index 305b2ee9066d..96abace9b736 100644
--- a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hwaccess.h
+++ b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_hwaccess.h
@@ -43,8 +43,6 @@ kgsl_hwaccess_memread(void *dst, unsigned int gpubase, unsigned int gpuoffset, u
if (gsl_driver.enable_mmu && (gpubase >= GSL_LINUX_MAP_RANGE_START) && (gpubase < GSL_LINUX_MAP_RANGE_END)) {
gsl_linux_map_read(dst, gpubase+gpuoffset, sizebytes, touserspace);
} else {
- mb();
- dsb();
if (touserspace)
{
if (copy_to_user(dst, (void *)(gpubase + gpuoffset), sizebytes))
@@ -56,8 +54,6 @@ kgsl_hwaccess_memread(void *dst, unsigned int gpubase, unsigned int gpuoffset, u
{
kos_memcpy(dst, (void *) (gpubase + gpuoffset), sizebytes);
}
- mb();
- dsb();
}
}
@@ -69,8 +65,6 @@ kgsl_hwaccess_memwrite(unsigned int gpubase, unsigned int gpuoffset, void *src,
if (gsl_driver.enable_mmu && (gpubase >= GSL_LINUX_MAP_RANGE_START) && (gpubase < GSL_LINUX_MAP_RANGE_END)) {
gsl_linux_map_write(src, gpubase+gpuoffset, sizebytes, fromuserspace);
} else {
- mb();
- dsb();
if (fromuserspace)
{
if (copy_from_user((void *)(gpubase + gpuoffset), src, sizebytes))
@@ -82,8 +76,6 @@ kgsl_hwaccess_memwrite(unsigned int gpubase, unsigned int gpuoffset, void *src,
{
kos_memcpy((void *)(gpubase + gpuoffset), src, sizebytes);
}
- mb();
- dsb();
}
}
@@ -95,11 +87,7 @@ kgsl_hwaccess_memset(unsigned int gpubase, unsigned int gpuoffset, unsigned int
if (gsl_driver.enable_mmu && (gpubase >= GSL_LINUX_MAP_RANGE_START) && (gpubase < GSL_LINUX_MAP_RANGE_END)) {
gsl_linux_map_set(gpuoffset+gpubase, value, sizebytes);
} else {
- mb();
- dsb();
kos_memset((void *)(gpubase + gpuoffset), value, sizebytes);
- mb();
- dsb();
}
}
@@ -115,11 +103,7 @@ kgsl_hwaccess_regread(gsl_deviceid_t device_id, unsigned int gpubase, unsigned i
reg = (unsigned int *)(gpubase + (offsetwords << 2));
- mb();
- dsb();
- *data = __raw_readl(reg);
- mb();
- dsb();
+ *data = readl(reg);
}
//----------------------------------------------------------------------------
@@ -133,10 +117,6 @@ kgsl_hwaccess_regwrite(gsl_deviceid_t device_id, unsigned int gpubase, unsigned
(void) device_id;
reg = (unsigned int *)(gpubase + (offsetwords << 2));
- mb();
- dsb();
- __raw_writel(data, reg);
- mb();
- dsb();
+ writel(data, reg);
}
#endif // __GSL_HWACCESS_WINCE_MX51_H
diff --git a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c
index b67404150e10..2e6bc55e88fe 100644
--- a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c
+++ b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2008-2010, Advanced Micro Devices. All rights reserved.
- * Copyright (C) 2008-2011 Freescale Semiconductor, Inc.
+ * Copyright (C) 2008-2012 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -40,6 +40,7 @@
#include <linux/uaccess.h>
#include <mach/mxc_gpu.h>
+#include <linux/fsl_devices.h>
int gpu_2d_irq, gpu_3d_irq;
@@ -51,6 +52,7 @@ int gmem_size;
phys_addr_t gpu_reserved_mem;
int gpu_reserved_mem_size;
int z160_version;
+int enable_mmu;
static ssize_t gsl_kmod_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr);
static ssize_t gsl_kmod_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr);
@@ -769,14 +771,15 @@ static int gpu_probe(struct platform_device *pdev)
int i;
struct resource *res;
struct device *dev;
- struct mxc_gpu_platform_data *pdata;
+ struct mxc_gpu_platform_data *gpu_data = NULL;
- pdata = pdev->dev.platform_data;
- if (pdata) {
- z160_version = pdata->z160_revision;
- gpu_reserved_mem = pdata->reserved_mem_base;
- gpu_reserved_mem_size = pdata->reserved_mem_size;
- }
+ gpu_data = (struct mxc_gpu_platform_data *)pdev->dev.platform_data;
+
+ if (gpu_data == NULL)
+ return 0;
+
+ z160_version = gpu_data->z160_revision;
+ enable_mmu = gpu_data->enable_mmu;
for(i = 0; i < 2; i++){
res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
@@ -795,8 +798,8 @@ static int gpu_probe(struct platform_device *pdev)
}
}
- for (i = 0; i < 3; i++) {
- res = platform_get_resource(pdev, IORESOURCE_MEM, i);
+ for (i = 0; i < 4; i++) {
+ res = platform_get_resource(pdev, IORESOURCE_MEM, i);
if (!res) {
gpu_2d_regbase = 0;
gpu_2d_regsize = 0;
@@ -807,14 +810,17 @@ static int gpu_probe(struct platform_device *pdev)
gpu_reserved_mem_size = 0;
break;
}else{
- if(strcmp(res->name, "gpu_2d_registers") == 0){
- gpu_2d_regbase = res->start;
- gpu_2d_regsize = res->end - res->start + 1;
- }else if(strcmp(res->name, "gpu_3d_registers") == 0){
- gpu_3d_regbase = res->start;
- gpu_3d_regsize = res->end - res->start + 1;
- }else if(strcmp(res->name, "gpu_graphics_mem") == 0){
- gmem_size = res->end - res->start + 1;
+ if (strcmp(res->name, "gpu_2d_registers") == 0) {
+ gpu_2d_regbase = res->start;
+ gpu_2d_regsize = res->end - res->start + 1;
+ } else if (strcmp(res->name, "gpu_3d_registers") == 0) {
+ gpu_3d_regbase = res->start;
+ gpu_3d_regsize = res->end - res->start + 1;
+ } else if (strcmp(res->name, "gpu_graphics_mem") == 0) {
+ gmem_size = res->end - res->start + 1;
+ } else if (strcmp(res->name, "gpu_reserved_mem") == 0) {
+ gpu_reserved_mem = res->start;
+ gpu_reserved_mem_size = res->end - res->start + 1;
}
}
}
diff --git a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.c b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.c
index 3685a5756baf..911469b720d7 100644
--- a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.c
+++ b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.c
@@ -173,10 +173,13 @@ int del_all_memblocks_from_allocated_list(struct file *fd)
printk(KERN_INFO "Not all allocated memory blocks were freed. Doing it now.\n");
list_for_each_entry_safe(cursor, next, head, node)
{
- printk(KERN_INFO "Freeing list entry #%u, gpuaddr=%x\n", (u32)cursor->allocation_number, cursor->allocated_block.gpuaddr);
- kgsl_sharedmem_free(&cursor->allocated_block);
- list_del(&cursor->node);
- kfree(cursor);
+ printk(KERN_DEBUG "Freeing list entry #%u, gpuaddr=%x\n",
+ (u32)cursor->allocation_number,
+ cursor->allocated_block.gpuaddr);
+
+ kgsl_sharedmem_free(&cursor->allocated_block);
+ list_del(&cursor->node);
+ kfree(cursor);
}
}
diff --git a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_linux_map.c b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_linux_map.c
index 7fee7b814411..3c1e02e5bc42 100644
--- a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_linux_map.c
+++ b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_linux_map.c
@@ -61,7 +61,7 @@ void *gsl_linux_map_alloc(unsigned int gpu_addr, unsigned int size)
}
}
- va = __vmalloc(size, GFP_KERNEL, pgprot_noncached(pgprot_kernel));
+ va = __vmalloc(size, GFP_KERNEL, pgprot_writecombine(pgprot_kernel));
if(va == NULL){
mutex_unlock(&gsl_linux_map_mutex);
return NULL;
diff --git a/drivers/mxc/amd-gpu/platform/hal/linux/misc.c b/drivers/mxc/amd-gpu/platform/hal/linux/misc.c
index b3a4582bb156..db7b8cf3a2d1 100644
--- a/drivers/mxc/amd-gpu/platform/hal/linux/misc.c
+++ b/drivers/mxc/amd-gpu/platform/hal/linux/misc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -38,9 +38,9 @@ typedef struct _gsl_autogate_t {
} gsl_autogate_t;
static gsl_autogate_t *g_autogate[2];
-static DEFINE_SEMAPHORE(sem_dev);
+static DEFINE_MUTEX(sem_dev);
-#define KGSL_DEVICE_IDLE_TIMEOUT 5000 /* unit ms */
+#define KGSL_DEVICE_IDLE_TIMEOUT 2000 /* unit ms */
static void clk_disable_task(struct work_struct *work)
{
@@ -79,10 +79,10 @@ static int _kgsl_device_active(gsl_device_t *dev, int all)
int index;
index = autogate->dev->id == GSL_DEVICE_G12 ? GSL_DEVICE_YAMATO - 1 :
GSL_DEVICE_G12 - 1;
- down(&sem_dev);
+ mutex_lock(&sem_dev);
if (g_autogate[index])
_kgsl_device_active(g_autogate[index]->dev, 0);
- up(&sem_dev);
+ mutex_unlock(&sem_dev);
}
return 0;
}
@@ -99,7 +99,6 @@ static void kgsl_device_inactive(unsigned long data)
// printk(KERN_ERR "%s:%d id %d active %d\n", __func__, __LINE__, autogate->dev->id, autogate->active);
del_timer(&autogate->timer);
spin_lock_irqsave(&autogate->lock, flags);
- WARN(!autogate->active, "GPU Device %d is already inactive\n", autogate->dev->id);
if (autogate->active) {
autogate->active = 0;
autogate->pending = 1;
@@ -137,7 +136,7 @@ int kgsl_device_autogate_init(gsl_device_t *dev)
printk(KERN_ERR "%s: out of memory!\n", __func__);
return -ENOMEM;
}
- down(&sem_dev);
+ mutex_lock(&sem_dev);
autogate->dev = dev;
autogate->active = 1;
spin_lock_init(&autogate->lock);
@@ -150,7 +149,7 @@ int kgsl_device_autogate_init(gsl_device_t *dev)
INIT_WORK(&autogate->dis_task, clk_disable_task);
dev->autogate = autogate;
g_autogate[dev->id - 1] = autogate;
- up(&sem_dev);
+ mutex_unlock(&sem_dev);
return 0;
}
@@ -159,13 +158,13 @@ void kgsl_device_autogate_exit(gsl_device_t *dev)
gsl_autogate_t *autogate = dev->autogate;
// printk(KERN_ERR "%s:%d id %d active %d\n", __func__, __LINE__, dev->id, autogate->active);
- down(&sem_dev);
+ mutex_lock(&sem_dev);
del_timer_sync(&autogate->timer);
if (!autogate->active)
kgsl_clock(autogate->dev->id, 1);
flush_work(&autogate->dis_task);
g_autogate[dev->id - 1] = NULL;
- up(&sem_dev);
+ mutex_unlock(&sem_dev);
kfree(autogate);
dev->autogate = NULL;
}
diff --git a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_context.c b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_context.c
index 22e1f27a5b5d..24003e7843ce 100644
--- a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_context.c
+++ b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_context.c
@@ -471,7 +471,7 @@ _InitializeContextBuffer(
index += _SwitchPipe(Context, index, gcvPIPE_3D);
/* Current context pointer. */
-#if gcdDEBUG
+#if gcdDEBUG
index += _State(Context, index, 0x03850 >> 2, 0x00000000, 1, gcvFALSE, gcvFALSE);
#endif
diff --git a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c
index a87259ea7e72..3829999b51be 100644
--- a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c
+++ b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c
@@ -232,7 +232,8 @@ _IdentifyHardware(
}
/* Exception for GC1000, revision 5035 & GC800, revision 4612 */
- if (((Identity->chipModel == gcv1000) && (Identity->chipRevision == 0x5035))
+ if (((Identity->chipModel == gcv1000) && ((Identity->chipRevision == 0x5035)
+ || (Identity->chipRevision == 0x5036)))
|| ((Identity->chipModel == gcv800) && (Identity->chipRevision == 0x4612)))
{
Identity->superTileMode = 1;
@@ -751,7 +752,7 @@ gckHARDWARE_Construct(
/* Initialize the fast clear. */
gcmkONERROR(gckHARDWARE_SetFastClear(hardware, -1, -1));
-#if !gcdENABLE_128B_MERGE
+#if !gcdENABLE_128B_MERGE
if (((((gctUINT32) (hardware->identity.chipMinorFeatures2)) >> (0 ? 21:21) & ((gctUINT32) ((((1 ? 21:21) - (0 ? 21:21) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 21:21) - (0 ? 21:21) + 1)))))) == (0x1 & ((gctUINT32) ((((1 ? 21:21) - (0 ? 21:21) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 21:21) - (0 ? 21:21) + 1))))))))
{
@@ -1027,7 +1028,7 @@ gckHARDWARE_InitializeHardware(
0x00424,
baseAddress));
-#if !VIVANTE_PROFILER
+#if !VIVANTE_PROFILER
{
gctUINT32 data;
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
index 1da80b7cc57f..5896e93f5c34 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
@@ -186,7 +186,7 @@ typedef struct _gcsDATABASE
gctUINT64 idle;
/* Pointer to database. */
- gcsDATABASE_RECORD_PTR list;
+ gcsDATABASE_RECORD_PTR list[48];
#if gcdSECURE_USER
/* Secure cache. */
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
index 1fb18fbb87e2..bc5f0830a37b 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
@@ -26,6 +26,9 @@
/*******************************************************************************
***** Private fuctions ********************************************************/
+#define _GetSlot(database, x) \
+ (gctUINT32)(((gcmPTR_TO_UINT64(x) >> 7) % gcmCOUNTOF(database->list)))
+
/*******************************************************************************
** gckKERNEL_NewDatabase
**
@@ -56,6 +59,7 @@ gckKERNEL_NewDatabase(
gcsDATABASE_PTR database;
gctBOOL acquired = gcvFALSE;
gctSIZE_T slot;
+ gcsDATABASE_PTR existingDatabase;
gcmkHEADER_ARG("Kernel=0x%x ProcessID=%d", Kernel, ProcessID);
@@ -63,6 +67,21 @@ gckKERNEL_NewDatabase(
gcmkONERROR(gckOS_AcquireMutex(Kernel->os, Kernel->db->dbMutex, gcvINFINITE));
acquired = gcvTRUE;
+ /* Compute the hash for the database. */
+ slot = ProcessID % gcmCOUNTOF(Kernel->db->db);
+
+ /* Walk the hash list. */
+ for (existingDatabase = Kernel->db->db[slot];
+ existingDatabase != gcvNULL;
+ existingDatabase = existingDatabase->next)
+ {
+ if (existingDatabase->processID == ProcessID)
+ {
+ /* One process can't be added twice. */
+ gcmkONERROR(gcvSTATUS_NOT_SUPPORTED);
+ }
+ }
+
if (Kernel->db->freeDatabase != gcvNULL)
{
/* Allocate a database from the free list. */
@@ -81,9 +100,6 @@ gckKERNEL_NewDatabase(
database = pointer;
}
- /* Compute the hash for the database. */
- slot = ProcessID % gcmCOUNTOF(Kernel->db->db);
-
/* Insert the database into the hash. */
database->next = Kernel->db->db[slot];
Kernel->db->db[slot] = database;
@@ -350,6 +366,7 @@ static gceSTATUS
gckKERNEL_NewRecord(
IN gckKERNEL Kernel,
IN gcsDATABASE_PTR Database,
+ IN gctUINT32 Slot,
OUT gcsDATABASE_RECORD_PTR * Record
)
{
@@ -383,8 +400,8 @@ gckKERNEL_NewRecord(
}
/* Insert the record in the database. */
- record->next = Database->list;
- Database->list = record;
+ record->next = Database->list[Slot];
+ Database->list[Slot] = record;
/* Release the database mutex. */
gcmkONERROR(gckOS_ReleaseMutex(Kernel->os, Kernel->db->dbMutex));
@@ -449,6 +466,7 @@ gckKERNEL_DeleteRecord(
gceSTATUS status;
gctBOOL acquired = gcvFALSE;
gcsDATABASE_RECORD_PTR record, previous;
+ gctUINT32 slot = _GetSlot(Database, Data);
gcmkHEADER_ARG("Kernel=0x%x Database=0x%x Type=%d Data=0x%x",
Kernel, Database, Type, Data);
@@ -458,8 +476,9 @@ gckKERNEL_DeleteRecord(
gckOS_AcquireMutex(Kernel->os, Kernel->db->dbMutex, gcvINFINITE));
acquired = gcvTRUE;
+
/* Scan the database for this record. */
- for (record = Database->list, previous = gcvNULL;
+ for (record = Database->list[slot], previous = gcvNULL;
record != gcvNULL;
record = record->next
)
@@ -490,7 +509,7 @@ gckKERNEL_DeleteRecord(
/* Remove record from database. */
if (previous == gcvNULL)
{
- Database->list = record->next;
+ Database->list[slot] = record->next;
}
else
{
@@ -557,6 +576,7 @@ gckKERNEL_FindRecord(
gceSTATUS status;
gctBOOL acquired = gcvFALSE;
gcsDATABASE_RECORD_PTR record;
+ gctUINT32 slot = _GetSlot(Database, Data);
gcmkHEADER_ARG("Kernel=0x%x Database=0x%x Type=%d Data=0x%x",
Kernel, Database, Type, Data);
@@ -567,7 +587,7 @@ gckKERNEL_FindRecord(
acquired = gcvTRUE;
/* Scan the database for this record. */
- for (record = Database->list;
+ for (record = Database->list[slot];
record != gcvNULL;
record = record->next
)
@@ -642,6 +662,7 @@ gckKERNEL_CreateProcessDB(
{
gceSTATUS status;
gcsDATABASE_PTR database = gcvNULL;
+ gctUINT32 i;
gcmkHEADER_ARG("Kernel=0x%x ProcessID=%d", Kernel, ProcessID);
@@ -668,7 +689,11 @@ gckKERNEL_CreateProcessDB(
database->mapUserMemory.bytes = 0;
database->mapUserMemory.maxBytes = 0;
database->mapUserMemory.totalBytes = 0;
- database->list = gcvNULL;
+
+ for (i = 0; i < gcmCOUNTOF(database->list); i++)
+ {
+ database->list[i] = gcvNULL;
+ }
#if gcdSECURE_USER
{
@@ -848,7 +873,7 @@ gckKERNEL_AddProcessDB(
gcmkONERROR(gckKERNEL_FindDatabase(Kernel, ProcessID, gcvFALSE, &database));
/* Create a new record in the database. */
- gcmkONERROR(gckKERNEL_NewRecord(Kernel, database, &record));
+ gcmkONERROR(gckKERNEL_NewRecord(Kernel, database, _GetSlot(database, Pointer), &record));
/* Initialize the record. */
record->kernel = Kernel;
@@ -1086,6 +1111,7 @@ gckKERNEL_DestroyProcessDB(
gctPHYS_ADDR physical;
gcuVIDMEM_NODE_PTR node;
gckKERNEL kernel = Kernel;
+ gctUINT32 i;
gcmkHEADER_ARG("Kernel=0x%x ProcessID=%d", Kernel, ProcessID);
@@ -1126,8 +1152,11 @@ gckKERNEL_DestroyProcessDB(
ProcessID);
}
+ for(i = 0; i < gcmCOUNTOF(database->list); i++)
+ {
+
/* Walk all records. */
- for (record = database->list; record != gcvNULL; record = next)
+ for (record = database->list[i]; record != gcvNULL; record = next)
{
/* Next next record. */
next = record->next;
@@ -1293,6 +1322,8 @@ gckKERNEL_DestroyProcessDB(
gcvNULL));
}
+ }
+
/* Delete the database. */
gcmkONERROR(gckKERNEL_DeleteDatabase(Kernel, database));
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
index f78d0967a233..217f7f18c2f2 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
@@ -959,6 +959,8 @@ gckEVENT_AddList(
record->kernel = Event->kernel;
#endif
+ gcmkONERROR(__RemoveRecordFromProcessDB(Event, record));
+
/* Acquire the mutex. */
gcmkONERROR(gckOS_AcquireMutex(Event->os, Event->eventListMutex, gcvINFINITE));
acquired = gcvTRUE;
@@ -1539,9 +1541,6 @@ gckEVENT_Submit(
gcmkONERROR(gckOS_ReleaseMutex(Event->os, Event->eventListMutex));
acquired = gcvFALSE;
- gcmkONERROR(__RemoveRecordFromProcessDB(Event,
- Event->queues[id].head));
-
#if gcdNULL_DRIVER
/* Notify immediately on infinite hardware. */
gcmkONERROR(gckEVENT_Interrupt(Event, 1 << id));
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c
index 0c71e28e868c..43c9297f6c3d 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c
@@ -97,6 +97,43 @@ static gcsMirrorPageTable_PTR mirrorPageTable = gcvNULL;
static gctPOINTER mirrorPageTableMutex = gcvNULL;
#endif
+static void
+_WritePageEntry(
+ IN gctUINT32_PTR PageEntry,
+ IN gctUINT32 EntryValue
+ )
+{
+ static gctUINT16 data = 0xff00;
+
+ if (*(gctUINT8 *)&data == 0xff)
+ {
+ *PageEntry = gcmSWAB32(EntryValue);
+ }
+ else
+ {
+ *PageEntry = EntryValue;
+ }
+}
+
+static gctUINT32
+_ReadPageEntry(
+ IN gctUINT32_PTR PageEntry
+ )
+{
+ static gctUINT16 data = 0xff00;
+ gctUINT32 entryValue;
+
+ if (*(gctUINT8 *)&data == 0xff)
+ {
+ entryValue = *PageEntry;
+ return gcmSWAB32(entryValue);
+ }
+ else
+ {
+ return *PageEntry;
+ }
+}
+
static gceSTATUS
_FillPageTable(
IN gctUINT32_PTR PageTable,
@@ -108,7 +145,7 @@ _FillPageTable(
for (i = 0; i < PageCount; i++)
{
- PageTable[i] = EntryValue;
+ _WritePageEntry(PageTable + i, EntryValue);
}
return gcvSTATUS_OK;
@@ -132,16 +169,16 @@ _Link(
gctUINT32_PTR pageTable = Mmu->pageTableLogical;
/* Dispatch on node type. */
- switch (gcmENTRY_TYPE(pageTable[Index]))
+ switch (gcmENTRY_TYPE(_ReadPageEntry(&pageTable[Index])))
{
case gcvMMU_SINGLE:
/* Set single index. */
- pageTable[Index] = (Next << 8) | gcvMMU_SINGLE;
+ _WritePageEntry(&pageTable[Index], (Next << 8) | gcvMMU_SINGLE);
break;
case gcvMMU_FREE:
/* Set index. */
- pageTable[Index + 1] = Next;
+ _WritePageEntry(&pageTable[Index + 1], Next);
break;
default:
@@ -167,13 +204,13 @@ _AddFree(
if (Count == 1)
{
/* Initialize a single page node. */
- pageTable[Node] = (~((1U<<8)-1)) | gcvMMU_SINGLE;
+ _WritePageEntry(pageTable + Node, (~((1U<<8)-1)) | gcvMMU_SINGLE);
}
else
{
/* Initialize the node. */
- pageTable[Node + 0] = (Count << 8) | gcvMMU_FREE;
- pageTable[Node + 1] = ~0U;
+ _WritePageEntry(pageTable + Node + 0, (Count << 8) | gcvMMU_FREE);
+ _WritePageEntry(pageTable + Node + 1, ~0U);
}
/* Append the node. */
@@ -196,7 +233,7 @@ _Collect(
for (i = 0; i < Mmu->pageTableEntries; ++i)
{
/* Dispatch based on type of page. */
- switch (gcmENTRY_TYPE(pageTable[i]))
+ switch (gcmENTRY_TYPE(_ReadPageEntry(&pageTable[i])))
{
case gcvMMU_USED:
/* Used page, so close any open node. */
@@ -229,10 +266,10 @@ _Collect(
}
/* Advance the count. */
- count += pageTable[i] >> 8;
+ count += _ReadPageEntry(&pageTable[i]) >> 8;
/* Advance the index into the page table. */
- i += (pageTable[i] >> 8) - 1;
+ i += (_ReadPageEntry(&pageTable[i]) >> 8) - 1;
break;
default:
@@ -341,19 +378,20 @@ _FillFlatMapping(
gcmkONERROR(gcvSTATUS_NOT_ALIGNED);
}
- *(Mmu->mtlbLogical + mStart)
- = stlb->physBase
- /* 64KB page size */
- | (1 << 2)
- /* Ignore exception */
- | (0 << 1)
- /* Present */
- | (1 << 0);
+ _WritePageEntry(Mmu->mtlbLogical + mStart,
+ stlb->physBase
+ /* 64KB page size */
+ | (1 << 2)
+ /* Ignore exception */
+ | (0 << 1)
+ /* Present */
+ | (1 << 0)
+ );
#if gcdMMU_TABLE_DUMP
gckOS_Print("%s(%d): insert MTLB[%d]: %08x\n",
__FUNCTION__, __LINE__,
mStart,
- *(Mmu->mtlbLogical + mStart));
+ _ReadPageEntry(Mmu->mtlbLogical + mStart));
#endif
stlb->mtlbIndex = mStart;
@@ -368,12 +406,12 @@ _FillFlatMapping(
while (sStart <= last)
{
gcmkASSERT(!(start & gcdMMU_PAGE_64K_MASK));
- *(stlb->logical + sStart) = _SetPage(start);
+ _WritePageEntry(stlb->logical + sStart, _SetPage(start));
#if gcdMMU_TABLE_DUMP
gckOS_Print("%s(%d): insert STLB[%d]: %08x\n",
__FUNCTION__, __LINE__,
sStart,
- *(stlb->logical + sStart));
+ _ReadPageEntry(stlb->logical + sStart));
#endif
/* next page. */
start += gcdMMU_PAGE_64K_SIZE;
@@ -428,7 +466,7 @@ OnError:
if (pre->mtlbEntryNum != 0)
{
gcmkASSERT(pre->mtlbEntryNum == 1);
- *(Mmu->mtlbLogical + pre->mtlbIndex) = 0;
+ _WritePageEntry(Mmu->mtlbLogical + pre->mtlbIndex, 0);
}
gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Mmu->os, pre));
@@ -493,8 +531,8 @@ _SetupDynamicSpace(
/* Initilization. */
pageTable = Mmu->pageTableLogical;
- pageTable[0] = (Mmu->pageTableEntries << 8) | gcvMMU_FREE;
- pageTable[1] = ~0U;
+ _WritePageEntry(pageTable, (Mmu->pageTableEntries << 8) | gcvMMU_FREE);
+ _WritePageEntry(pageTable + 1, ~0U);
Mmu->heapList = 0;
Mmu->freeNodes = gcvFALSE;
@@ -509,18 +547,20 @@ _SetupDynamicSpace(
/* Map to Master TLB. */
for (; i < gcdMMU_MTLB_ENTRY_NUM; i++)
{
- Mmu->mtlbLogical[i] = physical
- /* 4KB page size */
- | (0 << 2)
- /* Ignore exception */
- | (0 << 1)
- /* Present */
- | (1 << 0);
+ _WritePageEntry(Mmu->mtlbLogical + i,
+ physical
+ /* 4KB page size */
+ | (0 << 2)
+ /* Ignore exception */
+ | (0 << 1)
+ /* Present */
+ | (1 << 0)
+ );
#if gcdMMU_TABLE_DUMP
gckOS_Print("%s(%d): insert MTLB[%d]: %08x\n",
__FUNCTION__, __LINE__,
i,
- *(Mmu->mtlbLogical + i));
+ _ReadPageEntry(Mmu->mtlbLogical + i));
#endif
physical += gcdMMU_STLB_4K_SIZE;
}
@@ -645,18 +685,11 @@ _Construct(
pageTable = mmu->pageTableLogical;
#if gcdMMU_CLEAR_VALUE
- {
- gctUINT32 i;
-
- for (i = 0; i < mmu->pageTableEntries; ++i)
- {
- pageTable[i] = gcdMMU_CLEAR_VALUE;
- }
- }
+ _FillPageTable(pageTable, mmu->pageTableEntries, gcdMMU_CLEAR_VALUE);
#endif
- pageTable[0] = (mmu->pageTableEntries << 8) | gcvMMU_FREE;
- pageTable[1] = ~0U;
+ _WritePageEntry(pageTable, (mmu->pageTableEntries << 8) | gcvMMU_FREE);
+ _WritePageEntry(pageTable + 1, ~0U);
mmu->heapList = 0;
mmu->freeNodes = gcvFALSE;
@@ -797,7 +830,7 @@ _Destroy(
if (pre->mtlbEntryNum != 0)
{
gcmkASSERT(pre->mtlbEntryNum == 1);
- *(Mmu->mtlbLogical + pre->mtlbIndex) = 0;
+ _WritePageEntry(Mmu->mtlbLogical + pre->mtlbIndex, 0);
#if gcdMMU_TABLE_DUMP
gckOS_Print("%s(%d): clean MTLB[%d]\n",
__FUNCTION__, __LINE__,
@@ -1044,7 +1077,7 @@ _AllocatePages(
for (index = Mmu->heapList; !gotIt && (index < Mmu->pageTableEntries);)
{
/* Check the node type. */
- switch (gcmENTRY_TYPE(pageTable[index]))
+ switch (gcmENTRY_TYPE(_ReadPageEntry(&pageTable[index])))
{
case gcvMMU_SINGLE:
/* Single odes are valid if we only need 1 page. */
@@ -1056,13 +1089,13 @@ _AllocatePages(
{
/* Move to next node. */
previous = index;
- index = pageTable[index] >> 8;
+ index = _ReadPageEntry(&pageTable[index]) >> 8;
}
break;
case gcvMMU_FREE:
/* Test if the node has enough space. */
- if (PageCount <= (pageTable[index] >> 8))
+ if (PageCount <= (_ReadPageEntry(&pageTable[index]) >> 8))
{
gotIt = gcvTRUE;
}
@@ -1070,7 +1103,7 @@ _AllocatePages(
{
/* Move to next node. */
previous = index;
- index = pageTable[index + 1];
+ index = _ReadPageEntry(&pageTable[index + 1]);
}
break;
@@ -1099,36 +1132,36 @@ _AllocatePages(
}
}
- switch (gcmENTRY_TYPE(pageTable[index]))
+ switch (gcmENTRY_TYPE(_ReadPageEntry(&pageTable[index])))
{
case gcvMMU_SINGLE:
/* Unlink single node from free list. */
gcmkONERROR(
- _Link(Mmu, previous, pageTable[index] >> 8));
+ _Link(Mmu, previous, _ReadPageEntry(&pageTable[index]) >> 8));
break;
case gcvMMU_FREE:
/* Check how many pages will be left. */
- left = (pageTable[index] >> 8) - PageCount;
+ left = (_ReadPageEntry(&pageTable[index]) >> 8) - PageCount;
switch (left)
{
case 0:
/* The entire node is consumed, just unlink it. */
gcmkONERROR(
- _Link(Mmu, previous, pageTable[index + 1]));
+ _Link(Mmu, previous, _ReadPageEntry(&pageTable[index + 1])));
break;
case 1:
/* One page will remain. Convert the node to a single node and
** advance the index. */
- pageTable[index] = (pageTable[index + 1] << 8) | gcvMMU_SINGLE;
+ _WritePageEntry(&pageTable[index], (_ReadPageEntry(&pageTable[index + 1]) << 8) | gcvMMU_SINGLE);
index ++;
break;
default:
/* Enough pages remain for a new node. However, we will just adjust
** the size of the current node and advance the index. */
- pageTable[index] = (left << 8) | gcvMMU_FREE;
+ _WritePageEntry(&pageTable[index], (left << 8) | gcvMMU_FREE);
index += left;
break;
}
@@ -1232,35 +1265,32 @@ _FreePages(
#if gcdMMU_CLEAR_VALUE
if (Mmu->hardware->mmuVersion == 0)
{
- gctUINT32 i;
-
- for (i = 0; i < PageCount; ++i)
- {
- pageTable[i] = gcdMMU_CLEAR_VALUE;
- }
+ _FillPageTable(pageTable, PageCount, gcdMMU_CLEAR_VALUE);
}
#endif
if (PageCount == 1)
{
/* Single page node. */
- pageTable[0] = (~((1U<<8)-1)) | gcvMMU_SINGLE
+ _WritePageEntry(pageTable,
+ (~((1U<<8)-1)) | gcvMMU_SINGLE
#if gcdUSE_MMU_EXCEPTION
- /* Enable exception */
- | (1 << 1)
+ /* Enable exception */
+ | 1 << 1
#endif
- ;
+ );
}
else
{
/* Mark the node as free. */
- pageTable[0] = (PageCount << 8) | gcvMMU_FREE
+ _WritePageEntry(pageTable,
+ (PageCount << 8) | gcvMMU_FREE
#if gcdUSE_MMU_EXCEPTION
- /* Enable exception */
- | (1 << 1)
+ /* Enable exception */
+ | 1 << 1
#endif
- ;
- pageTable[1] = ~0U;
+ );
+ _WritePageEntry(pageTable + 1, ~0U);
#if gcdUSE_MMU_EXCEPTION
/* Enable exception */
@@ -1509,12 +1539,8 @@ gckMMU_SetPage(
data = _SetPage(PageAddress);
}
- if (Mmu->hardware->bigEndian)
- {
- data = gcmSWAB32(data);
- }
+ _WritePageEntry(PageEntry, data);
- *PageEntry = data;
#if gcdMIRROR_PAGETABLE
for (i = 0; i < mirrorPageTable->reference; i++)
{
@@ -1526,11 +1552,11 @@ gckMMU_SetPage(
if (mmu->hardware->mmuVersion == 0)
{
- *pageEntry = PageAddress;
+ _WritePageEntry(pageEntry, PageAddress);
}
else
{
- *pageEntry = _SetPage(PageAddress);
+ _WritePageEntry(pageEntry, _SetPage(PageAddress));
}
}
@@ -1734,7 +1760,7 @@ gckMMU_DumpPageTableEntry(
* gcdMMU_STLB_4K_ENTRY_NUM
+ stlb;
- gcmkPRINT(" Page table entry = 0x%08X", pageTable[index]);
+ gcmkPRINT(" Page table entry = 0x%08X", _ReadPageEntry(pageTable + index));
}
gcmkFOOTER_NO();
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
index d49aa6463296..8a442a2c4b0b 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
@@ -1027,7 +1027,8 @@ gckVIDMEM_AllocateLinear(
)
{
/* The left memory is for small memory.*/
- gcmkONERROR(gcvSTATUS_OUT_OF_MEMORY);
+ status = gcvSTATUS_OUT_OF_MEMORY;
+ goto OnError;
}
#endif
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h
index 496276e29f2c..06eea79447bc 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h
@@ -227,7 +227,8 @@ gcoOS_GetDisplayInfoEx(
);
gceSTATUS
-gcoOS_GetNextDisplayInfoEx(
+gcoOS_GetNextDisplayInfoExByIndex(
+ IN gctINT Index,
IN HALNativeDisplayType Display,
IN HALNativeWindowType Window,
IN gctUINT DisplayInfoSize,
@@ -274,15 +275,15 @@ gcoOS_SetDisplayVirtualEx(
gceSTATUS
gcoOS_SetSwapInterval(
- IN HALNativeDisplayType Display,
- IN gctINT Interval
+ IN HALNativeDisplayType Display,
+ IN gctINT Interval
);
gceSTATUS
gcoOS_GetSwapInterval(
- IN HALNativeDisplayType Display,
- IN gctINT_PTR Min,
- IN gctINT_PTR Max
+ IN HALNativeDisplayType Display,
+ IN gctINT_PTR Min,
+ IN gctINT_PTR Max
);
gceSTATUS
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h
index d441d1d152a1..249b61b2a48f 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h
@@ -1430,6 +1430,16 @@ typedef enum _gceTEXTURE_FACE
}
gceTEXTURE_FACE;
+#if gcdFORCE_MIPMAP
+typedef enum
+{
+ gcvForceMipDisabled = 0,
+ gcvForceMipEnable = 1,
+ gcvForceMipGenerated = 2,
+ gcvForceMipNever = 3,
+}gceFORCE_MIPMAP;
+#endif
+
typedef struct _gcsTEXTURE
{
/* Addressing modes. */
@@ -1446,6 +1456,10 @@ typedef struct _gcsTEXTURE
gceTEXTURE_FILTER mipFilter;
gctUINT anisoFilter;
gctBOOL forceTopLevel;
+ gctBOOL autoMipmap;
+#if gcdFORCE_MIPMAP
+ gceFORCE_MIPMAP forceMipmap;
+#endif
/* Level of detail. */
gctFIXED_POINT lodBias;
gctFIXED_POINT lodMin;
@@ -1479,7 +1493,18 @@ gceSTATUS
gcoTEXTURE_Destroy(
IN gcoTEXTURE Texture
);
+#if gcdFORCE_MIPMAP
+gceSTATUS
+gcoTEXTURE_DestroyForceMipmap(
+ IN gcoTEXTURE Texture
+ );
+gceSTATUS
+gcoTEXTURE_GetMipLevels(
+ IN gcoTEXTURE Texture,
+ OUT gctINT * levels
+ );
+#endif
/* Replace a mipmap in gcoTEXTURE object. */
gceSTATUS
gcoTEXTURE_ReplaceMipMap(
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
index 86e91337ca1c..afe83d08c2d4 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
@@ -114,6 +114,30 @@
#define COMMAND_PROCESSOR_VERSION 1
/*
+ gcdDUMP_KEY
+
+ Set this to a string that appears in 'cat /proc/<pid>/cmdline'. E.g. 'camera'.
+ HAL will create dumps for the processes matching this key.
+*/
+#ifndef gcdDUMP_KEY
+# define gcdDUMP_KEY "process"
+#endif
+
+/*
+ gcdDUMP_PATH
+
+ The dump file location. Some processes cannot write to the sdcard.
+ Try apps' data dir, e.g. /data/data/com.android.launcher
+*/
+#ifndef gcdDUMP_PATH
+#if defined(ANDROID)
+# define gcdDUMP_PATH "/mnt/sdcard/"
+#else
+# define gcdDUMP_PATH "./"
+#endif
+#endif
+
+/*
gcdDUMP
When set to 1, a dump of all states and memory uploads, as well as other
@@ -342,6 +366,17 @@
#endif
/*
+ gcdUSER_HEAP_ALLOCATOR
+
+ Set to 1 to enable user mode heap allocator for fast memory allocation
+ and destroying. Otherwise, memory allocation/destroying in user mode
+ will be directly managed by system. Only for linux for now.
+*/
+#ifndef gcdUSER_HEAP_ALLOCATOR
+# define gcdUSER_HEAP_ALLOCATOR 1
+#endif
+
+/*
gcdHEAP_SIZE
Set the allocation size for the internal heaps. Each time a heap is
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h
index 28816043a0be..808fde05f685 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h
@@ -28,7 +28,7 @@
#define gcvVERSION_PATCH 9
-#define gcvVERSION_BUILD 1210
+#define gcvVERSION_BUILD 4651
#define gcvVERSION_DATE __DATE__
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
index 4e3819ce9897..2ed3d0e1fc8f 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
@@ -663,7 +663,7 @@ static int drv_mmap(
#if !gcdPAGED_MEMORY_CACHEABLE
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
- vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND;
+ vma->vm_flags |= gcdVM_FLAGS;
#endif
vma->vm_pgoff = 0;
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
index 9c0bcd506a67..3c148f6e3323 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
@@ -73,6 +73,12 @@
#define GetPageCount(size, offset) ((((size) + ((offset) & ~PAGE_CACHE_MASK)) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION (3,7,0)
+#define gcdVM_FLAGS (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_DONTDUMP)
+#else
+#define gcdVM_FLAGS (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED)
+#endif
+
static inline gctINT
GetOrder(
IN gctINT numPages
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
index c07ded8f54a0..9c2bae63da7a 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
@@ -869,6 +869,60 @@ _UnmapUserLogical(
#endif
}
+gceSTATUS
+_QueryProcessPageTable(
+ IN gctPOINTER Logical,
+ OUT gctUINT32 * Address
+ )
+{
+ spinlock_t *lock;
+ gctUINTPTR_T logical = (gctUINTPTR_T)Logical;
+ pgd_t *pgd;
+ pud_t *pud;
+ pmd_t *pmd;
+ pte_t *pte;
+
+ if (!current->mm)
+ {
+ return gcvSTATUS_NOT_FOUND;
+ }
+
+ pgd = pgd_offset(current->mm, logical);
+ if (pgd_none(*pgd) || pgd_bad(*pgd))
+ {
+ return gcvSTATUS_NOT_FOUND;
+ }
+
+ pud = pud_offset(pgd, logical);
+ if (pud_none(*pud) || pud_bad(*pud))
+ {
+ return gcvSTATUS_NOT_FOUND;
+ }
+
+ pmd = pmd_offset(pud, logical);
+ if (pmd_none(*pmd) || pmd_bad(*pmd))
+ {
+ return gcvSTATUS_NOT_FOUND;
+ }
+
+ pte = pte_offset_map_lock(current->mm, pmd, logical, &lock);
+ if (!pte)
+ {
+ return gcvSTATUS_NOT_FOUND;
+ }
+
+ if (!pte_present(*pte))
+ {
+ pte_unmap_unlock(pte, lock);
+ return gcvSTATUS_NOT_FOUND;
+ }
+
+ *Address = (pte_pfn(*pte) << PAGE_SHIFT) | (logical & ~PAGE_MASK);
+ pte_unmap_unlock(pte, lock);
+
+ return gcvSTATUS_OK;
+}
+
/*******************************************************************************
**
** gckOS_Construct
@@ -1106,6 +1160,9 @@ _CreateKernelVirtualMapping(
numPages,
0,
PAGE_KERNEL);
+
+ /* Trigger a page fault. */
+ memset(addr, 0, numPages * PAGE_SIZE);
}
#else
struct page ** pages;
@@ -1136,6 +1193,9 @@ _CreateKernelVirtualMapping(
/* ioremap() can't work on system memory since 2.6.38. */
addr = vmap(pages, numPages, 0, gcmkNONPAGED_MEMROY_PROT(PAGE_KERNEL));
+ /* Trigger a page fault. */
+ memset(addr, 0, numPages * PAGE_SIZE);
+
if (free)
{
kfree(pages);
@@ -1540,7 +1600,7 @@ gckOS_MapMemory(
#else
#if !gcdPAGED_MEMORY_CACHEABLE
mdlMap->vma->vm_page_prot = gcmkPAGED_MEMROY_PROT(mdlMap->vma->vm_page_prot);
- mdlMap->vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED;
+ mdlMap->vma->vm_flags |= gcdVM_FLAGS;
# endif
mdlMap->vma->vm_pgoff = 0;
@@ -1987,7 +2047,7 @@ gckOS_AllocateNonPagedMemory(
}
#else
mdlMap->vma->vm_page_prot = gcmkNONPAGED_MEMROY_PROT(mdlMap->vma->vm_page_prot);
- mdlMap->vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED;
+ mdlMap->vma->vm_flags |= gcdVM_FLAGS;
mdlMap->vma->vm_pgoff = 0;
if (remap_pfn_range(mdlMap->vma,
@@ -2367,12 +2427,18 @@ gckOS_GetPhysicalAddress(
gcmkVERIFY_OBJECT(Os, gcvOBJ_OS);
gcmkVERIFY_ARGUMENT(Address != gcvNULL);
- /* Get current process ID. */
- processID = _GetProcessID();
+ /* Query page table of current process first. */
+ status = _QueryProcessPageTable(Logical, Address);
- /* Route through other function. */
- gcmkONERROR(
- gckOS_GetPhysicalAddressProcess(Os, Logical, processID, Address));
+ if (gcmIS_ERROR(status))
+ {
+ /* Get current process ID. */
+ processID = _GetProcessID();
+
+ /* Route through other function. */
+ gcmkONERROR(
+ gckOS_GetPhysicalAddressProcess(Os, Logical, processID, Address));
+ }
/* Success. */
gcmkFOOTER_ARG("*Address=0x%08x", *Address);
@@ -4139,7 +4205,7 @@ gckOS_LockPages(
return gcvSTATUS_OUT_OF_RESOURCES;
}
- mdlMap->vma->vm_flags |= VM_RESERVED;
+ mdlMap->vma->vm_flags |= gcdVM_FLAGS;
#if !gcdPAGED_MEMORY_CACHEABLE
if (Cacheable == gcvFALSE)
{
diff --git a/drivers/mxc/ipu3/ipu_common.c b/drivers/mxc/ipu3/ipu_common.c
index 9c47cd91ff3f..563d5320cc9d 100644
--- a/drivers/mxc/ipu3/ipu_common.c
+++ b/drivers/mxc/ipu3/ipu_common.c
@@ -250,6 +250,10 @@ static int __devinit ipu_probe(struct platform_device *pdev)
ipu->dev = &pdev->dev;
+ if (!plat_data->bypass_reset)
+ if (plat_data->init)
+ plat_data->init(pdev->id);
+
ipu->irq_err = platform_get_irq(pdev, 0);
ipu->irq_sync = platform_get_irq(pdev, 1);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -335,9 +339,6 @@ static int __devinit ipu_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ipu);
if (!plat_data->bypass_reset) {
- if (plat_data->init)
- plat_data->init(pdev->id);
-
ipu_reset(ipu);
ipu_disp_init(ipu);
diff --git a/drivers/mxc/pmic/core/pmic_core_i2c.c b/drivers/mxc/pmic/core/pmic_core_i2c.c
index 09172b387b0e..0bfad1ac5414 100644
--- a/drivers/mxc/pmic/core/pmic_core_i2c.c
+++ b/drivers/mxc/pmic/core/pmic_core_i2c.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -256,7 +256,7 @@ static int __devinit pmic_probe(struct i2c_client *client,
/* Set and install PMIC IRQ handler */
- set_irq_type(pmic_irq, IRQF_TRIGGER_HIGH);
+ irq_set_irq_type(pmic_irq, IRQF_TRIGGER_HIGH);
ret =
request_irq(pmic_irq, pmic_irq_handler, 0, "PMIC_IRQ",
diff --git a/drivers/mxc/pmic/core/pmic_core_spi.c b/drivers/mxc/pmic/core/pmic_core_spi.c
index f02b42749791..4c7f541f5d0b 100644
--- a/drivers/mxc/pmic/core/pmic_core_spi.c
+++ b/drivers/mxc/pmic/core/pmic_core_spi.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -198,7 +198,7 @@ static int __devinit pmic_probe(struct spi_device *spi)
}
/* Set and install PMIC IRQ handler */
- set_irq_type(spi->irq, IRQF_TRIGGER_HIGH);
+ irq_set_irq_type(spi->irq, IRQF_TRIGGER_HIGH);
ret = request_irq(spi->irq, pmic_irq_handler, 0, "PMIC_IRQ", 0);
if (ret) {
kfree(spi_get_drvdata(spi));