text A618 LEGACY HFI KGSL PROTOCOL DIFF 5 views
A618 LEGACY HFI — KGSL PROTOCOL CROSSCHECK
Generated: 2026-11-26T21:20:41

========== DARWIN: C:\Users\qwertyhorik\Desktop\Ios\SWEETGPU_RESEARCH\UPSTREAM_READONLY\UNIXNU_SWEET_DARWIN23-d3dd6fdf9e88\kits\AdrenoFirmware\AdrenoHfi.c ==========
/* SPDX-License-Identifier: BSD-2-Clause-Patent */
/* HFI wire facts from the source pinned by the umbrella. No Linux runtime. */
#include "AdrenoHfi.h"
#if !defined(__aarch64__) || __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
#error GMU HFI transport requires little-endian AArch64
#endif
#define WORDS 1024u
static void acquire(void){__asm__ volatile("dmb oshld":::"memory");}
static void publish(void){__asm__ volatile("dsb oshst":::"memory");}
static void complete(void){__asm__ volatile("dmb osh":::"memory");}
static AdrenoHfiStatus poison(AdrenoHfi *h,AdrenoHfiStatus status)
{h->poisoned=1;return status;}
static AdrenoHfiStatus valid(AdrenoHfi *h,unsigned q,volatile uint32_t **header,
    volatile uint32_t **data,uint32_t *read,uint32_t *write)
{
    if(!h || !h->shared || !h->notify || !h->iova || (h->iova&4095) ||
        ((uintptr_t)h->shared&4095))return AdrenoHfiInvalid;
    if(h->poisoned)return AdrenoHfiPoisoned;
    volatile uint32_t *m=h->shared;acquire();
    if(h->legacy>1 || q>1)return poison(h,AdrenoHfiCorrupt);
    const unsigned queues=h->legacy?2:3;
    if(m[0]!=0 || m[1]!=(24+48*queues) || m[2]!=6 || m[3]!=12 || m[4]!=queues || m[5]!=queues)
        return poison(h,AdrenoHfiCorrupt);
    volatile uint32_t *v=m+6+12*q;
    const unsigned queue_id=(h->legacy && q==1)?4:q;
    if(v[0]!=1 || v[1]!=h->iova+(q+1)*4096 || v[2]!=(0xa00|queue_id) ||
        v[3]!=WORDS || v[4]!=0)return poison(h,AdrenoHfiCorrupt);
    *read=v[10];*write=v[11];acquire();
    if(*read>=WORDS || *write>=WORDS || (!h->legacy && ((*read&3) || (*write&3))))return poison(h,AdrenoHfiCorrupt);
    *header=v;*data=m+(q+1)*WORDS;return AdrenoHfiSuccess;
}
static AdrenoHfiStatus initialize(AdrenoHfi *h,volatile uint32_t *shared,
    size_t bytes,uint64_t iova,void *cookie,int (*notify)(void *),unsigned legacy)
{
    if(!h || !shared || !notify || bytes!=16384 || ((uintptr_t)shared&4095) ||
        (uintptr_t)shared>UINTPTR_MAX-16383 || !iova || (iova&4095) || iova>UINT32_MAX-16383)
        return AdrenoHfiInvalid;
    for(unsigned i=0;i<4096;++i)shared[i]=0;
    const unsigned queues=legacy?2:3;
    shared[1]=24+48*queues;shared[2]=6;shared[3]=12;shared[4]=queues;shared[5]=queues;
    for(unsigned q=0;q<queues;++q) {
        volatile uint32_t *v=shared+6+12*q;
        const unsigned queue_id=(legacy && q==1)?4:q;
        v[0]=1;v[1]=(uint32_t)iova+(q+1)*4096;v[2]=0xa00|queue_id;v[3]=WORDS;
        v[6]=1;v[7]=1;v[8]=1;
    }
    publish();
    *h=(AdrenoHfi){shared,(uint32_t)iova,0,0,0,cookie,notify,0,0,0,0,legacy};
    return AdrenoHfiSuccess;
}
AdrenoHfiStatus AdrenoHfiInitializeStopped(AdrenoHfi *h,volatile uint32_t *shared,
    size_t bytes,uint64_t iova,void *cookie,int (*notify)(void *))
{return initialize(h,shared,bytes,iova,cookie,notify,0);}
AdrenoHfiStatus AdrenoHfiInitializeLegacyStopped(AdrenoHfi *h,volatile uint32_t *shared,
    size_t bytes,uint64_t iova,void *cookie,int (*notify)(void *))
{return initialize(h,shared,bytes,iova,cookie,notify,1);}
AdrenoHfiStatus AdrenoHfiSend(AdrenoHfi *h,unsigned id,const uint32_t *payload,
    size_t words,uint32_t *wire_header)
{
    if(!wire_header || id>255 || words>254 || (words && !payload))return AdrenoHfiInvalid;
    volatile uint32_t *v,*data;uint32_t read,write;
    AdrenoHfiStatus status=valid(h,0,&v,&data,&read,&write);
    if(status!=AdrenoHfiSuccess)return status;
    if(h->pending_header)return AdrenoHfiBusy;
    unsigned count=(unsigned)words+1,padded=h->legacy?count:(count+3)&~3u;
    if(((read-write-1)&(WORDS-1))<padded)return AdrenoHfiNoSpace;
    uint32_t sequence=(h->sequence+1)%4095;
    uint32_t header=(sequence<<20)|(count<<8)|id;
    data[write]=header;
    for(unsigned i=0;i<words;++i)data[(write+1+i)&(WORDS-1)]=payload[i];
    for(unsigned i=count;i<padded;++i)data[(write+i)&(WORDS-1)]=UINT32_C(0xfafafafa);
    publish();v[11]=(write+padded)&(WORDS-1);publish();
    h->pending_header=header;h->sequence=sequence;*wire_header=header;
    if(h->notify(h->cookie))return poison(h,AdrenoHfiNotifyError);
    return AdrenoHfiSuccess;
}
AdrenoHfiStatus AdrenoHfiPoll(AdrenoHfi *h,uint32_t *payload,size_t capacity,
    size_t *payload_words,uint32_t *error)
{
    if(!payload || capacity<16 || !payload_words || !error)return AdrenoHfiInvalid;
    *payload_words=0;*error=0;
    volatile uint32_t *v,*data;uint32_t read,write;
    AdrenoHfiStatus status=valid(h,1,&v,&data,&read,&write);
    if(status!=AdrenoHfiSuccess)return status;
    if(!h->pending_header)return AdrenoHfiInvalid;
    /* Legacy skipped packets have at least two words; modern packets occupy
     * multiples of four. Bound consumption even if the peer keeps writing. */
    for(unsigned pass=0;pass<WORDS/(h->legacy?2:4);++pass) {
        if(read==write) {v[8]=1;publish();return AdrenoHfiEmpty;}
        uint32_t packet[19];uint32_t header=data[read];unsigned count=(header>>8)&255;
        unsigned available=(write-read)&(WORDS-1),padded=h->legacy?count:(count+3)&~3u;
        if(!count || count>19 || padded>available)return poison(h,AdrenoHfiCorrupt);
        for(unsigned i=0;i<count;++i)packet[i]=data[(read+i)&(WORDS-1)];
        complete();
        const int firmware_error=(header&255)==100;
        const int match=!firmware_error && count>=3 && (packet[1]>>20)==(h->pending_header>>20);
        if(!match) {
            if(count<2)return poison(h,AdrenoHfiCorrupt);
            if(!h->skipped++) {h->skipped_header=header;h->skipped_ret=packet[1];h->skipped_code=count>2?packet[2]:0;}
            read=(read+padded)&(WORDS-1);v[10]=read;publish();
            continue;
        }
        if(packet[2]) {*error=packet[2];return poison(h,AdrenoHfiFirmwareError);}
        /* Copy only the checked matching response, never padding. This is not
         * cryptographic authentication of firmware or its response. */
        for(unsigned i=3;i<count;++i)payload[i-3]=packet[i];
        complete();v[10]=(read+padded)&(WORDS-1);publish();
        h->pending_header=0;*payload_words=count-3;return AdrenoHfiSuccess;
    }
    return poison(h,AdrenoHfiCorrupt);
}
AdrenoHfiStatus AdrenoHfiExchange(AdrenoHfi *h,unsigned id,const uint32_t *input,
    size_t words,unsigned budget,int (*wait_once)(void *),uint32_t *output,
    size_t capacity,size_t *count,uint32_t *error)
{
    if(!budget || budget>1048576 || !output || capacity<16 || !count || !error)
        return AdrenoHfiInvalid;
    *count=0;*error=0;uint32_t header;
    AdrenoHfiStatus status=AdrenoHfiSend(h,id,input,words,&header);
    if(status!=AdrenoHfiSuccess)return status;
    for(unsigned i=0;i<budget;++i) {
        status=AdrenoHfiPoll(h,output,capacity,count,error);
        if(status!=AdrenoHfiEmpty)return status;
        if(i+1<budget && wait_once && wait_once(h->cookie))return poison(h,AdrenoHfiWaitError);
    }
    return poison(h,AdrenoHfiTimeout);
}


========== DARWIN: C:\Users\qwertyhorik\Desktop\Ios\SWEETGPU_RESEARCH\UPSTREAM_READONLY\UNIXNU_SWEET_DARWIN23-d3dd6fdf9e88\kits\AdrenoFirmware\AdrenoHfi.h ==========
/* SPDX-License-Identifier: BSD-2-Clause-Patent */
#ifndef ADRENO_HFI_H
#define ADRENO_HFI_H
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
    AdrenoHfiSuccess,AdrenoHfiInvalid,AdrenoHfiBusy,AdrenoHfiNoSpace,
    AdrenoHfiEmpty,AdrenoHfiCorrupt,AdrenoHfiUnexpected,AdrenoHfiFirmwareError,
    AdrenoHfiNotifyError,AdrenoHfiWaitError,AdrenoHfiTimeout,AdrenoHfiPoisoned
} AdrenoHfiStatus;
typedef struct {
    volatile uint32_t *shared;
    uint32_t iova,sequence,pending_header,poisoned;
    void *cookie;
    int (*notify)(void *); /* real HOST2GMU interrupt write, 0=success */
    /* Diagnostics of skipped response packets (a6xx_hfi_wait_for_ack skips firmware error messages and replies to
     * another sequence number): their count and the first one's header, return header and code. */
    uint32_t skipped,skipped_header,skipped_ret,skipped_code;
    uint32_t legacy; /* set only by the stopped initializer; immutable thereafter */
} AdrenoHfi;
/* Caller owns an exclusive, 16KiB extent
 * mapped with four native4K pages, coherent for CPU and GMU, and a valid 32bit
 * GMU IOVA. Coherence, ownership and active mappings are platform obligations,
 * not established by this API. The GMU MUST be stopped and unable to access
 * this extent during initialization. No reset of a running queue is allowed.
 * AArch64 little-endian; real outer-shareable barriers, no fake ACKs.
 * All calls on an instance are serialized by the caller. Shared memory,
 * object and message/output storage must be disjoint and remain owned.
 * Never free/reuse shared storage until an external real stop+TLB drain is
 * proved. Poison/timeout/notify failure do not establish safe release. */
AdrenoHfiStatus AdrenoHfiInitializeStopped(AdrenoHfi *,volatile uint32_t *,
    size_t shared_bytes,uint64_t iova,void *cookie,int (*notify)(void *));
/* A618/a630_gmu.bin legacy profile: two queues, response type 0xa04,
 * byte-size 120 table, word-granular ring indexes, no four-word padding.
 * The same stopped/coherent/exclusive storage requirements apply. This
 * initializes wire data only: it never powers, releases or resets a GMU. */
AdrenoHfiStatus AdrenoHfiInitializeLegacyStopped(AdrenoHfi *,volatile uint32_t *,
    size_t shared_bytes,uint64_t iova,void *cookie,int (*notify)(void *));
/* payload excludes the wire header. One command may be outstanding. A failed
 * notify after publishing is indeterminate: poisons the session, no retry.
 * NoSpace/Busy refuse before publishing. No firmware readiness is inferred. */
AdrenoHfiStatus AdrenoHfiSend(AdrenoHfi *,unsigned id,const uint32_t *payload,
    size_t payload_words,uint32_t *wire_header);
/* Poll the response queue. As a6xx_hfi_wait_for_ack: the reply whose return
 * header carries the pending command's sequence number completes it (error=0
 * succeeds, otherwise FirmwareError); F2H error messages and replies to other
 * sequence numbers are consumed, counted and skipped. payload_words reports
 * actual returned words; output remains untouched on failure. Capacity must be
 * >=16, the protocol's maximum ACK payload. Empty keeps the pending command.
 * Malformed queues or packets poison the session; no success or queue reset is
 * synthesized. Debug queue not drained. */
AdrenoHfiStatus AdrenoHfiPoll(AdrenoHfi *,uint32_t *payload,size_t capacity,
    size_t *payload_words,uint32_t *firmware_error);
/* Serialized command + bounded response polling. Poll budget limits software
 * iterations, not hardware elapsed microseconds. Optional wait callback must
 * return promptly; an error poisons the session. Timeout also poisons it.
 * This transport alone performs no power/firmware/performance-table startup. */
AdrenoHfiStatus AdrenoHfiExchange(AdrenoHfi *,unsigned id,const uint32_t *,size_t,
    unsigned poll_budget,int (*wait_once)(void *),uint32_t *,size_t,
    size_t *,uint32_t *firmware_error);
#ifdef __cplusplus
}
#endif
#endif


========== DARWIN: C:\Users\qwertyhorik\Desktop\Ios\SWEETGPU_RESEARCH\UPSTREAM_READONLY\UNIXNU_SWEET_DARWIN23-d3dd6fdf9e88\kits\AdrenoFirmware\AdrenoHfiStartup.c ==========
/* SPDX-License-Identifier: BSD-2-Clause-Patent */
/* Independent serialization from the pinned modern HFI wire contract. */
#include "AdrenoHfiStartup.h"
static int zero(const uint32_t *v,size_t n)
{for(size_t i=0;i<n;++i)if(v[i])return 0;return 1;}
static int levels(const AdrenoHfiPerformanceLevel *v,unsigned n,unsigned max)
{
    if(n<2 || n>max || v[0].hz)return 0;
    for(unsigned i=0;i<n;++i)
        if(v[i].hz%1000 || v[i].hz/1000>UINT32_MAX || (i && v[i].hz<=v[i-1].hz))return 0;
    for(unsigned i=n;i<max;++i)if(v[i].hz || v[i].vote)return 0;
    return 1;
}
static int addresses(const uint32_t *v,unsigned n,unsigned max)
{
    if(!n || n>max)return 0;
    for(unsigned i=0;i<n;++i) {
        if(!v[i] || (v[i]&3))return 0;
        for(unsigned j=0;j<i;++j)if(v[i]==v[j])return 0;
    }
    return zero(v+n,max-n);
}
AdrenoHfiStartupStatus AdrenoHfiStartupValidate(const AdrenoHfiStartupConfig *c)
{
    if(!c || !levels(c->gpu,c->gpu_count,16) || !levels(c->gmu,c->gmu_count,4) ||
        !c->bandwidth_count || c->bandwidth_count>16 || c->enable_ifpc>1 ||
        !addresses(c->cnoc_addresses,c->cnoc_count,6) ||
        !addresses(c->ddr_addresses,c->ddr_count,8))return AdrenoHfiStartupInvalid;
    if(c->cnoc_wait_mask>>c->cnoc_count || c->ddr_wait_mask>>c->ddr_count)return AdrenoHfiStartupInvalid;
    for(unsigned i=0;i<c->cnoc_count;++i)
        for(unsigned j=0;j<c->ddr_count;++j)if(c->cnoc_addresses[i]==c->ddr_addresses[j])return AdrenoHfiStartupInvalid;
    for(unsigned i=0;i<2;++i)if(!zero(c->cnoc_data[i]+c->cnoc_count,6-c->cnoc_count))return AdrenoHfiStartupInvalid;
    for(unsigned i=0;i<16;++i)
        if(!zero(c->ddr_data[i]+(i<c->bandwidth_count?c->ddr_count:0),
            8-(i<c->bandwidth_count?c->ddr_count:0)))return AdrenoHfiStartupInvalid;
    if(!c->acd_enable_mask) {
        if(c->acd_version || c->acd_stride || c->acd_count || !zero(c->acd_data,32))return AdrenoHfiStartupInvalid;
    } else {
        if(c->acd_version!=1 || c->acd_stride!=1 || (c->acd_enable_mask&1) ||
            c->acd_enable_mask>>c->gpu_count)return AdrenoHfiStartupInvalid;
        unsigned count=0;
        for(uint32_t bits=c->acd_enable_mask;bits;bits>>=1)count+=bits&1;
        if(c->acd_count!=count || !zero(c->acd_data+count,32-count))return AdrenoHfiStartupInvalid;
    }
    return AdrenoHfiStartupSuccess;
}
AdrenoHfiStartupStatus AdrenoHfiStartupEncode(const AdrenoHfiStartupConfig *c,
    AdrenoHfiStartupStage stage,uint32_t *id,uint32_t *p,size_t capacity,size_t *count)
{
    if(!count)return AdrenoHfiStartupInvalid;
    *count=0;
    if(!id || !p || capacity<159 || AdrenoHfiStartupValidate(c)!=AdrenoHfiStartupSuccess ||
        stage<AdrenoHfiStagePerformance || stage>AdrenoHfiStageStart ||
        ((stage==AdrenoHfiStageAcdEnable || stage==AdrenoHfiStageAcdTable) && !c->acd_enable_mask) ||
        (stage==AdrenoHfiStageIfpc && !c->enable_ifpc))return AdrenoHfiStartupInvalid;
    size_t n=0;unsigned message=0;
    switch(stage) {
    case AdrenoHfiStagePerformance:
        message=4;n=58;
        for(size_t i=0;i<n;++i)p[i]=0;
        p[0]=c->gpu_count;p[1]=c->gmu_count;
        for(unsigned i=0;i<c->gpu_count;++i) {
            p[2+3*i]=c->gpu[i].vote;p[3+3*i]=UINT32_MAX;p[4+3*i]=(uint32_t)(c->gpu[i].hz/1000);
        }
        for(unsigned i=0;i<c->gmu_count;++i) {
            p[50+2*i]=c->gmu[i].vote;p[51+2*i]=(uint32_t)(c->gmu[i].hz/1000);
        }
        break;
    case AdrenoHfiStageBandwidth:
        message=3;n=159;
        p[0]=c->bandwidth_count;p[1]=c->cnoc_count;p[2]=c->ddr_count;
        p[3]=c->cnoc_wait_mask;p[4]=c->ddr_wait_mask;
        for(unsigned i=0;i<6;++i)p[5+i]=c->cnoc_addresses[i];
        for(unsigned i=0;i<12;++i)p[11+i]=c->cnoc_data[i/6][i%6];
        for(unsigned i=0;i<8;++i)p[23+i]=c->ddr_addresses[i];
        for(unsigned i=0;i<128;++i)p[31+i]=c->ddr_data[i/8][i%8];
        break;
    case AdrenoHfiStageAcdEnable:message=11;n=3;p[0]=12;p[1]=1;p[2]=0;break;
    case AdrenoHfiStageAcdTable:
        message=7;n=36;p[0]=c->acd_version;p[1]=c->acd_enable_mask;p[2]=c->acd_stride;p[3]=c->acd_count;
        for(unsigned i=0;i<32;++i)p[4+i]=c->acd_data[i];
        break;
    case AdrenoHfiStageIfpc:message=11;n=3;p[0]=9;p[1]=1;p[2]=0x1680;break;
    case AdrenoHfiStageCoreStart:message=14;n=1;p[0]=0;break;
    case AdrenoHfiStageStart:message=10;n=0;break;
    default:return AdrenoHfiStartupInvalid;
    }
    *id=message;*count=n;return AdrenoHfiStartupSuccess;
}
AdrenoHfiStartupStatus AdrenoHfiStartupValidateServices(const AdrenoHfiStartupServices *s)
{
    if(!s || !s->now_us || !s->wait_us || !s->check_health ||
        !s->polls_per_command || s->polls_per_command>1048576 ||
        !s->wait_interval_us || s->wait_interval_us>1000000 ||
        !s->command_timeout_us || s->command_timeout_us>10000000 ||
        s->total_timeout_us<s->command_timeout_us || s->total_timeout_us>60000000)
        return AdrenoHfiStartupInvalid;
    return AdrenoHfiStartupSuccess;
}
static AdrenoHfiStartupStatus clock_check(const AdrenoHfiStartupServices *s,
    uint64_t begin,uint64_t command,uint64_t *last,AdrenoHfiStartupResult *r)
{
    uint64_t now;
    if(s->now_us(s->cookie,&now) || now<*last)return AdrenoHfiStartupClockError;
    *last=now;r->elapsed_us=now-begin;
    if(now-begin>=s->total_timeout_us || now-command>=s->command_timeout_us)return AdrenoHfiStartupTimeout;
    return AdrenoHfiStartupSuccess;
}
AdrenoHfiStartupStatus AdrenoHfiStartupRun(AdrenoHfiStartup *state,AdrenoHfi *h,
    const AdrenoHfiStartupConfig *c,const AdrenoHfiStartupServices *s,AdrenoHfiStartupResult *r)
{
    if(!r)return AdrenoHfiStartupInvalid;
    *r=(AdrenoHfiStartupResult){0};r->resources_must_retain=1;
    if(!state || !h || h->legacy || AdrenoHfiStartupValidateServices(s)!=AdrenoHfiStartupSuccess ||
        AdrenoHfiStartupValidate(c)!=AdrenoHfiStartupSuccess)return AdrenoHfiStartupInvalid;
    if(state->poisoned || h->poisoned)return AdrenoHfiStartupPoisoned;
    if(state->attempted || state->completed || h->pending_header)return AdrenoHfiStartupBusy;
    uint64_t begin,last,command;
    if(s->now_us(s->cookie,&begin))return AdrenoHfiStartupClockError;
    last=begin;
    if(s->check_health(s->cookie))return AdrenoHfiStartupPlatformFault;
    state->attempted=1;
    AdrenoHfiStartupStatus status=AdrenoHfiStartupSuccess;
    uint32_t payload[159],output[16],id;size_t words,returned;
    for(unsigned step=AdrenoHfiStagePerformance;step<=AdrenoHfiStageStart;++step) {
        if((step==AdrenoHfiStageAcdEnable || step==AdrenoHfiStageAcdTable) && !c->acd_enable_mask)continue;
        if(step==AdrenoHfiStageIfpc && !c->enable_ifpc)continue;
        r->stage=(AdrenoHfiStartupStage)step;command=last;
        status=clock_check(s,begin,command,&last,r);if(status)goto failed;
        if(s->check_health(s->cookie)) {status=AdrenoHfiStartupPlatformFault;goto failed;}
        status=AdrenoHfiStartupEncode(c,r->stage,&id,payload,159,&words);if(status)goto failed;
        r->wire_header=0;
        r->transport_status=AdrenoHfiSend(h,id,payload,words,&r->wire_header);
        if(r->wire_header)++r->published_commands;
        if(r->transport_status!=AdrenoHfiSuccess) {status=AdrenoHfiStartupTransportError;goto failed;}
        unsigned acknowledged=0;
        for(unsigned i=0;i<s->polls_per_command;++i) {
            status=clock_check(s,begin,command,&last,r);if(status)goto failed;
            if(s->check_health(s->cookie)) {status=AdrenoHfiStartupPlatformFault;goto failed;}
            ++r->poll_reads;
            r->transport_status=AdrenoHfiPoll(h,output,16,&returned,&r->firmware_error);
            if(r->transport_status==AdrenoHfiSuccess) {
                status=clock_check(s,begin,command,&last,r);if(status)goto failed;
                if(s->check_health(s->cookie)) {status=AdrenoHfiStartupPlatformFault;goto failed;}
                r->acknowledged_stages|=1u<<step;acknowledged=1;break;
            }
            if(r->transport_status!=AdrenoHfiEmpty) {status=AdrenoHfiStartupTransportError;goto failed;}
            if(i+1<s->polls_per_command && s->wait_us(s->cookie,s->wait_interval_us)) {
                status=AdrenoHfiStartupWaitError;goto failed;
            }
        }
        if(!acknowledged) {status=AdrenoHfiStartupTimeout;goto failed;}
    }
    state->completed=1;r->stage=AdrenoHfiStageComplete;return AdrenoHfiStartupSuccess;
failed:
    state->poisoned=1;h->poisoned=1;return status;
}


========== DARWIN: C:\Users\qwertyhorik\Desktop\Ios\SWEETGPU_RESEARCH\UPSTREAM_READONLY\UNIXNU_SWEET_DARWIN23-d3dd6fdf9e88\kits\AdrenoFirmware\AdrenoHfiStartup.h ==========
/* SPDX-License-Identifier: BSD-2-Clause-Patent */
#ifndef ADRENO_HFI_STARTUP_H
#define ADRENO_HFI_STARTUP_H
#include "AdrenoHfi.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Modern A6xx/A7xx wire profile. Legacy and A8xx table formats are excluded. */
typedef struct {uint64_t hz;uint32_t vote;} AdrenoHfiPerformanceLevel;
typedef struct {
    unsigned gpu_count,gmu_count;
    AdrenoHfiPerformanceLevel gpu[16],gmu[4];
    unsigned bandwidth_count,cnoc_count,ddr_count;
    uint32_t cnoc_wait_mask,ddr_wait_mask;
    uint32_t cnoc_addresses[6],cnoc_data[2][6];
    uint32_t ddr_addresses[8],ddr_data[16][8];
    uint32_t acd_version,acd_enable_mask,acd_stride,acd_count,acd_data[32];
    unsigned enable_ifpc;
} AdrenoHfiStartupConfig;
typedef enum {
    AdrenoHfiStageNone,AdrenoHfiStagePerformance,AdrenoHfiStageBandwidth,
    AdrenoHfiStageAcdEnable,AdrenoHfiStageAcdTable,AdrenoHfiStageIfpc,
    AdrenoHfiStageCoreStart,AdrenoHfiStageStart,AdrenoHfiStageComplete
} AdrenoHfiStartupStage;
typedef enum {
    AdrenoHfiStartupSuccess,AdrenoHfiStartupInvalid,AdrenoHfiStartupBusy,
    AdrenoHfiStartupPoisoned,AdrenoHfiStartupClockError,AdrenoHfiStartupWaitError,
    AdrenoHfiStartupTimeout,AdrenoHfiStartupPlatformFault,AdrenoHfiStartupTransportError
} AdrenoHfiStartupStatus;
typedef struct {
    void *cookie;
    int (*now_us)(void *,uint64_t *);
    int (*wait_us)(void *,unsigned);
    int (*check_health)(void *); /* real platform fault/ownership checks */
    unsigned polls_per_command,wait_interval_us;
    uint64_t command_timeout_us,total_timeout_us;
} AdrenoHfiStartupServices;
typedef struct {unsigned attempted,poisoned,completed;} AdrenoHfiStartup;
typedef struct {
    AdrenoHfiStartupStage stage;
    AdrenoHfiStatus transport_status;
    uint32_t firmware_error,wire_header,acknowledged_stages;
    unsigned published_commands,poll_reads,resources_must_retain;
    uint64_t elapsed_us;
} AdrenoHfiStartupResult;
/* Validate every input before any queue publication. Frequencies include the
 * zero/off entry, are strictly ascending, exactly representable in wire kHz.
 * Votes and command-db addresses are trusted platform inputs, never guessed
 * by this library. ACD entries are packed for each enabled GPU level; AOSS
 * notification and IFPC power prerequisites must already be established.
 * Unused fixed-capacity slots must be zero. This prevents silently ignoring
 * unsupported or malformed configuration. No input is authenticated here. */
AdrenoHfiStartupStatus AdrenoHfiStartupValidate(const AdrenoHfiStartupConfig *);
AdrenoHfiStartupStatus AdrenoHfiStartupValidateServices(const AdrenoHfiStartupServices *);
/* Payload excludes header. All output storage must be disjoint from inputs.
 * Encodes one selected stage; unused optional stages refuse. Failure leaves
 * payload/header outputs untouched except word_count=0. Capacity >=159. */
AdrenoHfiStartupStatus AdrenoHfiStartupEncode(const AdrenoHfiStartupConfig *,
    AdrenoHfiStartupStage,uint32_t *id,uint32_t *payload,size_t capacity,size_t *word_count);
/* Single attempt, serialized, caller-owned zero-initialized state. Requires
 * a real ready GMU, exclusive coherent HFI allocation and active native4K GMU
 * mappings. Only matching actual ACKs advance the startup sequence. All
 * commands and the whole sequence have monotonic-time AND iteration bounds.
 * Callback operations must themselves be bounded. On any attempted-sequence
 * failure the transport is poisoned; no replay, synthetic ACK or implicit
 * stop occurs. Even success does not authorize resource release or prove GPU
 * execution, power/coherence/SMMU readiness, shader submission or a desktop.
 * Input, state, services, transport, result and shared queues must remain
 * disjoint and pinned; config remains immutable throughout the sequence. */
AdrenoHfiStartupStatus AdrenoHfiStartupRun(AdrenoHfiStartup *,AdrenoHfi *,
    const AdrenoHfiStartupConfig *,const AdrenoHfiStartupServices *,AdrenoHfiStartupResult *);
#ifdef __cplusplus
}
#endif
#endif


========== DARWIN: C:\Users\qwertyhorik\Desktop\Ios\SWEETGPU_RESEARCH\UPSTREAM_READONLY\UNIXNU_SWEET_DARWIN23-d3dd6fdf9e88\kits\AdrenoFirmware\AdrenoHfiVotes.c ==========
/* SPDX-License-Identifier: BSD-2-Clause-Patent */
#include "AdrenoHfiVotes.h"
static uint16_t le16(const uint8_t *p){return (uint16_t)(p[0]|(uint16_t)p[1]<<8);}
static uint32_t le32(const uint8_t *p){return le16(p)|(uint32_t)le16(p+2)<<16;}
static int rail(const uint8_t *p,size_t bytes)
{
    if(!p || !bytes || (bytes&1) || bytes>512 || le16(p))return 0;
    unsigned padding=0;uint16_t last=0;
    for(size_t i=2;i<bytes;i+=2) {
        uint16_t value=le16(p+i);
        if(!value)padding=1;
        else if(padding || value<last)return 0;
        last=value;
    }
    return 1;
}
AdrenoHfiStartupStatus AdrenoHfiArcVotes(const uint32_t *levels,size_t count,
    const uint8_t *primary,size_t primary_bytes,const uint8_t *secondary,size_t secondary_bytes,
    uint32_t *votes,size_t capacity)
{
    if(!levels || !votes || !count || count>16 || capacity<count || levels[0] ||
        !rail(primary,primary_bytes) || !rail(secondary,secondary_bytes))return AdrenoHfiStartupInvalid;
    uint32_t result[16];
    for(size_t i=0;i<count;++i) {
        if(levels[i]>UINT16_MAX || (i && levels[i]<levels[i-1]))return AdrenoHfiStartupInvalid;
        size_t p=0,s=0;
        while(p<primary_bytes/2 && le16(primary+2*p)<levels[i])++p;
        if(p==primary_bytes/2)return AdrenoHfiStartupInvalid;
        for(size_t j=0;j<secondary_bytes/2;++j) {
            uint16_t value=le16(secondary+2*j);
            if(value>=levels[i]) {s=j;break;}
            if(value)s=j;
        }
        result[i]=(uint32_t)le16(primary+2*p)<<16 | (uint32_t)s<<8 | (uint32_t)p;
    }
    for(size_t i=0;i<count;++i)votes[i]=result[i];
    return AdrenoHfiStartupSuccess;
}
AdrenoHfiStartupStatus AdrenoHfiBcmAux(AdrenoHfiBcm *b,const uint8_t *p,size_t bytes)
{
    if(!b || !p || bytes!=8 || p[7])return AdrenoHfiStartupInvalid;
    b->unit=le32(p);b->width=le16(p+4);b->vcd=p[6];return AdrenoHfiStartupSuccess;
}
static int address(uint32_t a){return a && !(a&3);}
AdrenoHfiStartupStatus AdrenoHfiBuildBandwidth(const uint32_t *kbps,size_t count,
    const AdrenoHfiBcm *bcms,size_t n,uint32_t cn0,AdrenoHfiStartupConfig *c)
{
    if(!c || !kbps || !bcms || !count || count>16 || kbps[0] || !n || n>3 || !address(cn0))
        return AdrenoHfiStartupInvalid;
    for(size_t i=1;i<count;++i)if(kbps[i]<=kbps[i-1])return AdrenoHfiStartupInvalid;
    for(size_t j=0;j<n;++j) {
        const AdrenoHfiBcm *b=bcms+j;
        if(!address(b->address) || b->address==cn0 || b->fixed>1 || b->perfmode>0x3fff ||
            (!b->fixed && (!b->unit || !b->width || !b->buswidth || b->perfmode || b->perfmode_kbps)))
            return AdrenoHfiStartupInvalid;
        for(size_t k=0;k<j;++k)if(b->address==bcms[k].address)return AdrenoHfiStartupInvalid;
    }
    /* All input validation is finished before changing caller storage. */
    c->bandwidth_count=(unsigned)count;c->cnoc_count=1;c->ddr_count=(unsigned)n;
    c->cnoc_wait_mask=1;c->ddr_wait_mask=0;
    for(size_t i=0;i<6;++i) {
        c->cnoc_addresses[i]=i?0:cn0;c->cnoc_data[0][i]=i?0:0x40000000;
        c->cnoc_data[1][i]=i?0:0x60000001;
    }
    for(size_t j=0;j<8;++j) {
        c->ddr_addresses[j]=j<n?bcms[j].address:0;
        unsigned commit=j<n && (j+1==n || bcms[j].vcd!=bcms[j+1].vcd);
        if(commit)c->ddr_wait_mask|=1u<<j;
        for(size_t i=0;i<16;++i) {
            uint32_t data=0;
            if(i<count && j<n) {
                const AdrenoHfiBcm *b=bcms+j;data=commit?0x40000000:0;
                if(kbps[i]) {
                    data|=0x20000000;
                    if(b->fixed) {
                        if(b->perfmode_kbps && kbps[i]>=b->perfmode_kbps)data|=b->perfmode;
                    } else {
                        uint64_t peak=(uint64_t)kbps[i]*b->width/b->buswidth;
                        peak=peak*1000/b->unit;
                        uint32_t vote=peak>0x3fff?0x3fff:peak?(uint32_t)peak:1;
                        data|=vote<<14|vote;
                    }
                }
            }
            c->ddr_data[i][j]=data;
        }
    }
    return AdrenoHfiStartupSuccess;
}


========== DARWIN: C:\Users\qwertyhorik\Desktop\Ios\SWEETGPU_RESEARCH\UPSTREAM_READONLY\UNIXNU_SWEET_DARWIN23-d3dd6fdf9e88\kits\AdrenoFirmware\AdrenoHfiVotes.h ==========
/* SPDX-License-Identifier: BSD-2-Clause-Patent */
#ifndef ADRENO_HFI_VOTES_H
#define ADRENO_HFI_VOTES_H
#include "AdrenoHfiStartup.h"
#ifdef __cplusplus
extern "C" {
#endif
/* CPU-side generation only, no RPMh transaction or power transition.
 * Input levels are from exact enabled OPPs (including off=0), not frequencies
 * or voltages. Rail byte spans are original little-endian cmd-db aux data.
 * Caller selects actual primary/secondary rails (including GMxC discovery).
 * Rail profile: off at entry zero, ascending active levels (duplicates allowed),
 * optional zero padding at the end. Other profiles explicitly refuse.
 * Supports <=256 rail entries, <=16 OPPs; no truncation or guessed fallback.
 * Output remains unchanged on failure. Inputs/outputs must be disjoint and
 * immutable during calls. Successful arithmetic does not authenticate inputs. */
AdrenoHfiStartupStatus AdrenoHfiArcVotes(const uint32_t *levels,size_t level_count,
    const uint8_t *primary,size_t primary_bytes,const uint8_t *secondary,size_t secondary_bytes,
    uint32_t *votes,size_t capacity);
typedef struct {
    uint32_t address,unit;
    uint16_t width,buswidth;
    uint8_t vcd,fixed;
    uint16_t perfmode;
    uint32_t perfmode_kbps;
} AdrenoHfiBcm;
/* Decode exactly eight bytes of BCM aux data; address/buswidth/fixed/perfmode
 * are separately supplied source/platform policy and are preserved. */
AdrenoHfiStartupStatus AdrenoHfiBcmAux(AdrenoHfiBcm *,const uint8_t *,size_t);
/* A7xx BCM arithmetic and modern HFI bandwidth layout. Off=0, then strictly
 * ascending KB/s OPP bandwidths, <=16. Up to three platform-ordered BCMs;
 * CN0 address must come from command-db. No source fallback address exists.
 * Unit/width come from BCM aux; buswidth/fixed/perfmode from target catalog.
 * Fills only bandwidth-related config fields, preserving performance/features.
 * Failure leaves the entire config unchanged. Success requires no HFI/device.
 * Does not validate actual rail/BCM ownership, limits, speed bin or power. */
AdrenoHfiStartupStatus AdrenoHfiBuildBandwidth(const uint32_t *kbps,size_t level_count,
    const AdrenoHfiBcm *bcms,size_t bcm_count,uint32_t cn0_address,AdrenoHfiStartupConfig *);
#ifdef __cplusplus
}
#endif
#endif


========== DARWIN: C:\Users\qwertyhorik\Desktop\Ios\SWEETGPU_RESEARCH\UPSTREAM_READONLY\UNIXNU_SWEET_DARWIN23-d3dd6fdf9e88\kits\AdrenoFirmware\test_hfi.c ==========
/* SPDX-License-Identifier: BSD-2-Clause-Patent */
/* All peers below are software fixtures; no firmware/device is executed. */
#include "AdrenoHfi.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define CHECK(x) do {if(!(x)){fprintf(stderr,"line %d: %s\n",__LINE__,#x);exit(1);}}while(0)
static _Alignas(4096) uint32_t shared[4096],before[4096];
static AdrenoHfi h;static unsigned notified,notify_fail,auto_reply,waits,reply_at;
static uint32_t input[254],output[16];
#ifdef SOURCE_ORACLE
static _Alignas(4096) uint32_t reference[4096];
extern void source_initialize(uint32_t *,uint32_t);
extern int source_write(uint32_t *,uint32_t,uint32_t *,uint32_t);
#endif
static void response(unsigned count,unsigned id,uint32_t ret,uint32_t error)
{
    uint32_t *v=shared+18;unsigned at=v[11];
    CHECK(count && count<=255);
    for(unsigned i=0;i<count;++i)shared[2048+((at+i)&1023)]=i<3?0:0xfeed0000+i;
    shared[2048+at]=(1u<<16)|(count<<8)|id;
    if(count>1)shared[2048+((at+1)&1023)]=ret;
    if(count>2)shared[2048+((at+2)&1023)]=error;
    v[11]=(at+((count+3)&~3u))&1023;
}
static int notify(void *cookie)
{
    CHECK(cookie==&h);++notified;
    if(auto_reply)response(4,126,h.pending_header,0);
    return notify_fail;
}
static int wait_once(void *cookie)
{CHECK(cookie==&h);if(++waits==reply_at)response(4,126,h.pending_header,0);return 0;}
static int failed_wait(void *cookie)
{CHECK(cookie==&h);++waits;return 1;}
static void reset(void)
{
    notified=notify_fail=auto_reply=waits=reply_at=0;
    memset(&h,0,sizeof(h));memset(shared,0xa5,sizeof(shared));
    CHECK(AdrenoHfiInitializeStopped(&h,shared,sizeof(shared),0x60000000,&h,notify)==AdrenoHfiSuccess);
    CHECK(shared[1]==168 && shared[2]==6 && shared[3]==12 && shared[4]==3 && shared[5]==3);
    for(unsigned q=0;q<3;++q) {
        uint32_t *v=shared+6+12*q;
        CHECK(v[0]==1 && v[1]==0x60000000+(q+1)*4096 && v[2]==(0xa00|q) && v[3]==1024);
        CHECK(v[4]==0 && v[5]==0 && v[6]==1 && v[7]==1 && v[8]==1 && v[9]==0 && !v[10] && !v[11]);
    }
#ifdef SOURCE_ORACLE
    memset(reference,0,sizeof(reference));source_initialize(reference,h.iova);
    CHECK(!memcmp(shared,reference,sizeof(shared)));
#endif
}
static void untouched_output(void)
{for(unsigned i=0;i<16;++i)CHECK(output[i]==0x5a5a5a5a);}
int main(void)
{
    for(unsigned i=0;i<254;++i)input[i]=0xabcdef00+i;
    size_t count;uint32_t error,header;unsigned cases=0;
    for(unsigned wrap=0;wrap<2;++wrap)for(unsigned words=0;words<255;++words) {
        reset();unsigned at=wrap?1020:0;shared[16]=shared[17]=at;
        CHECK(AdrenoHfiSend(&h,14,input,words,&header)==AdrenoHfiSuccess && notified==1);
        CHECK(header==((1u<<20)|((words+1)<<8)|14) && h.pending_header==header);
        CHECK(shared[1024+at]==header);
        for(unsigned i=0;i<words;++i)CHECK(shared[1024+((at+1+i)&1023)]==input[i]);
        unsigned padded=(words+4)&~3u;
        for(unsigned i=words+1;i<padded;++i)CHECK(shared[1024+((at+i)&1023)]==0xfafafafa);
        CHECK(shared[17]==((at+padded)&1023));
#ifdef SOURCE_ORACLE
        reference[16]=reference[17]=at;
        uint32_t message[255];message[0]=header;for(unsigned i=0;i<words;++i)message[i+1]=input[i];
        CHECK(!source_write(reference,h.iova,message,words+1));
        CHECK(!memcmp(shared,reference,sizeof(shared)));
#endif
        CHECK(AdrenoHfiSend(&h,10,NULL,0,&header)==AdrenoHfiBusy && notified==1);
        shared[28]=shared[29]=at;unsigned returned=words%17;
        response(3+returned,126,h.pending_header,0);memset(output,0x5a,sizeof(output));
        CHECK(AdrenoHfiPoll(&h,output,16,&count,&error)==AdrenoHfiSuccess);
        CHECK(count==returned && !error && !h.pending_header && !h.poisoned);
        for(unsigned i=0;i<returned;++i)CHECK(output[i]==0xfeed0003+i);
        for(unsigned i=returned;i<16;++i)CHECK(output[i]==0x5a5a5a5a);
        CHECK(shared[28]==shared[29]);++cases;
    }
    reset();shared[16]=4;memcpy(before,shared,sizeof(shared));
    /* Reserve the complete four-word packet including padding and sentinel. */
    CHECK(AdrenoHfiSend(&h,10,NULL,0,&header)==AdrenoHfiNoSpace);
    CHECK(!memcmp(before,shared,sizeof(shared)) && !notified && !h.pending_header);
    reset();notify_fail=1;
    CHECK(AdrenoHfiSend(&h,14,NULL,0,&header)==AdrenoHfiNotifyError);
    CHECK(h.poisoned && h.pending_header && shared[17]==4);
    CHECK(AdrenoHfiSend(&h,14,NULL,0,&header)==AdrenoHfiPoisoned && notified==1);
    for(unsigned fault=0;fault<11;++fault) {
        reset();CHECK(AdrenoHfiSend(&h,14,NULL,0,&header)==AdrenoHfiSuccess);
        response(4,126,header,0);memset(output,0x5a,sizeof(output));
        AdrenoHfiStatus expected=AdrenoHfiCorrupt;
        switch(fault) {
            case 0:shared[2048]&=~0xff00u;break; /* zero length */
            case 1:shared[2048]=(20u<<8)|126;break;
            case 2:shared[29]=2;break; /* unaligned producer */
            case 3:shared[28]=1024;break;
            case 4:shared[21]=2048;break; /* untrusted ring size */
            case 5:shared[2048]=(1u<<8)|100;break; /* error message without a code */
            case 6:shared[2048]=(2u<<8)|126;expected=AdrenoHfiEmpty;break; /* too short to match: skipped */
            case 7:shared[2050]=7;expected=AdrenoHfiFirmwareError;break;
            case 8:shared[2048]=(20u<<8)|100;break;
            case 9:shared[2048]=(5u<<8)|126;break; /* incomplete packet */
            case 10:shared[1]=42;break;
        }
        uint32_t read=shared[28];
        CHECK(AdrenoHfiPoll(&h,output,16,&count,&error)==expected);
        if(fault==6) {CHECK(!count && !h.poisoned && h.pending_header && h.skipped==1);untouched_output();continue;}
        CHECK(!count && h.poisoned && h.pending_header && shared[28]==read);untouched_output();
    }
    /* a6xx_hfi_wait_for_ack: a firmware error message and a reply to another sequence number are consumed and
     * skipped, the first one recorded; the matching reply then completes. The GMU may change the echoed header's
     * other fields: only the sequence number is compared. */
    reset();CHECK(AdrenoHfiSend(&h,4,input,58,&header)==AdrenoHfiSuccess && header==0x103b04);
    response(2,100,77,0);
    response(4,126,(header&~0xfffff000u)|(9u<<20),0);
    memset(output,0x5a,sizeof(output));
    CHECK(AdrenoHfiPoll(&h,output,16,&count,&error)==AdrenoHfiEmpty && !h.poisoned && h.pending_header==header);
    CHECK(h.skipped==2 && h.skipped_header==((1u<<16)|(2u<<8)|100) && h.skipped_ret==77 && shared[28]==shared[29]);
    untouched_output();
    response(4,126,(header&0xfff00000u)|(1u<<16)|0x3b05,0);
    CHECK(AdrenoHfiPoll(&h,output,16,&count,&error)==AdrenoHfiSuccess && count==1 && output[0]==0xfeed0003);
    CHECK(!h.pending_header && !h.poisoned && h.skipped==2);
    /* a reply that matches by sequence number but reports an error fails as before */
    reset();CHECK(AdrenoHfiSend(&h,4,NULL,0,&header)==AdrenoHfiSuccess);
    response(4,126,header,5);
    CHECK(AdrenoHfiPoll(&h,output,16,&count,&error)==AdrenoHfiFirmwareError && error==5 && h.poisoned);
    reset();memset(output,0x5a,sizeof(output));
    CHECK(AdrenoHfiExchange(&h,14,NULL,0,3,wait_once,output,16,&count,&error)==AdrenoHfiTimeout);
    CHECK(waits==2 && h.poisoned && h.pending_header && !count);untouched_output();
    reset();
    CHECK(AdrenoHfiExchange(&h,14,NULL,0,3,failed_wait,output,16,&count,&error)==AdrenoHfiWaitError);
    CHECK(waits==1 && notified==1 && h.poisoned && h.pending_header && !count);untouched_output();
    reset();reply_at=2;
    CHECK(AdrenoHfiExchange(&h,14,NULL,0,3,wait_once,output,16,&count,&error)==AdrenoHfiSuccess);
    CHECK(waits==2 && count==1 && output[0]==0xfeed0003 && !h.pending_header);
    reset();auto_reply=1;
    for(unsigned i=0;i<4100;++i) {
        /* Software peer consumes the outgoing packet, then produces its ACK. */
        shared[16]=shared[17];
        CHECK(AdrenoHfiExchange(&h,10,NULL,0,1,NULL,output,16,&count,&error)==AdrenoHfiSuccess);
        CHECK(h.sequence==(i+1)%4095);
    }
    reset();memcpy(before,shared,sizeof(shared));
    CHECK(AdrenoHfiInitializeStopped(&h,shared,16383,0x60000000,&h,notify)==AdrenoHfiInvalid);
    CHECK(AdrenoHfiInitializeStopped(&h,shared,16384,0xffffd000,&h,notify)==AdrenoHfiInvalid);
    CHECK(AdrenoHfiInitializeStopped(&h,shared+1,16384,0x60000000,&h,notify)==AdrenoHfiInvalid);
    CHECK(!memcmp(before,shared,sizeof(shared)));
    CHECK(AdrenoHfiSend(&h,256,NULL,0,&header)==AdrenoHfiInvalid);
    CHECK(AdrenoHfiSend(&h,14,input,255,&header)==AdrenoHfiInvalid && !notified);
    CHECK(AdrenoHfiExchange(&h,14,NULL,0,0,NULL,output,16,&count,&error)==AdrenoHfiInvalid && !notified);
    printf("PASS: %u modern HFI wrapped command/response cases, 4100 sequence exchanges, padded-space guard, malformed/stale/error/timeout quarantine\n",cases);
    puts("Software peer only; no actual GMU ACK, firmware startup, MMIO or GPU execution");
}


========== DARWIN: C:\Users\qwertyhorik\Desktop\Ios\SWEETGPU_RESEARCH\UPSTREAM_READONLY\UNIXNU_SWEET_DARWIN23-d3dd6fdf9e88\tests\test_hfi_legacy.c ==========
/* SPDX-License-Identifier: BSD-2-Clause-Patent */
/* A software peer. No actual GMU, device, DMA or firmware is executed. */
#include "AdrenoHfi.h"
#include "AdrenoHfiStartup.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>

static _Alignas(4096) uint32_t shared[4096], before[4096];
static AdrenoHfi h;
static unsigned notifications, fail_notify, reply_immediately;

static void reply(unsigned words, uint32_t sequence, uint32_t error)
{
    uint32_t *queue = shared + 18;
    unsigned at = queue[11];
    shared[2048 + at] = (2u << 16) | ((words + 3) << 8) | 126;
    shared[2048 + ((at + 1) & 1023)] = sequence;
    shared[2048 + ((at + 2) & 1023)] = error;
    for (unsigned index = 0; index < words; ++index)
        shared[2048 + ((at + 3 + index) & 1023)] = 0xabc00000 + index;
    queue[11] = (at + 3 + words) & 1023;
}

static int notify(void *cookie)
{
    assert(cookie == &h);
    ++notifications;
    if (reply_immediately) reply(0, h.pending_header, 0);
    return fail_notify;
}

static void reset(void)
{
    notifications = fail_notify = reply_immediately = 0;
    memset(&h, 0, sizeof(h));
    memset(shared, 0xa5, sizeof(shared));
    assert(AdrenoHfiInitializeLegacyStopped(&h, shared, sizeof(shared),
                                         0x60009000, &h, notify) == AdrenoHfiSuccess);
    assert(h.legacy == 1);
}

int main(void)
{
    uint32_t input[254], output[16], header, error;
    size_t returned;
    for (unsigned index = 0; index < 254; ++index) input[index] = 0xdead0000 + index;
    reset();
    const uint32_t table[] = {0, 120, 6, 12, 2, 2};
    assert(!memcmp(shared, table, sizeof(table)));
    for (unsigned index = 0; index < 2; ++index) {
        const uint32_t expected[] = {1, 0x6000a000 + index * 4096,
                                    index ? 0xa04 : 0xa00, 1024, 0, 0, 1, 1, 1, 0, 0, 0};
        assert(!memcmp(shared + 6 + index * 12, expected, sizeof(expected)));
    }
    for (unsigned index = 30; index < 4096; ++index) assert(!shared[index]);

    unsigned cases = 0;
    const unsigned positions[] = {0, 1, 2, 3, 1019, 1020, 1021, 1022, 1023};
    for (unsigned position = 0; position < sizeof(positions) / sizeof(positions[0]); ++position) {
        for (unsigned words = 0; words < 255; ++words) {
            reset();
            unsigned at = positions[position];
            shared[16] = shared[17] = at;
            assert(AdrenoHfiSend(&h, 1, input, words, &header) == AdrenoHfiSuccess);
            assert(notifications == 1 && header == (0x100000 | ((words + 1) << 8) | 1));
            assert(shared[1024 + at] == header);
            for (unsigned index = 0; index < words; ++index)
                assert(shared[1024 + ((at + 1 + index) & 1023)] == input[index]);
            assert(shared[17] == ((at + words + 1) & 1023));
            // The next word is not modern-protocol padding.
            assert(shared[1024 + shared[17]] == 0);
            shared[28] = shared[29] = at;
            const unsigned response_words = words % 17;
            reply(response_words, header, 0);
            memset(output, 0x5a, sizeof(output));
            assert(AdrenoHfiPoll(&h, output, 16, &returned, &error) == AdrenoHfiSuccess);
            assert(returned == response_words && !error && !h.pending_header && !h.poisoned);
            assert(shared[28] == ((at + 3 + response_words) & 1023));
            for (unsigned index = 0; index < 16; ++index)
                assert(output[index] == (index < returned ? 0xabc00000 + index : 0x5a5a5a5a));
            ++cases;
        }
    }
    reset(); shared[16] = 1;
    memcpy(before, shared, sizeof(shared));
    assert(AdrenoHfiSend(&h, 1, NULL, 0, &header) == AdrenoHfiNoSpace);
    assert(!memcmp(shared, before, sizeof(shared)) && !notifications);
    reset(); shared[16] = 2;
    assert(AdrenoHfiSend(&h, 1, NULL, 0, &header) == AdrenoHfiSuccess && shared[17] == 1);

    reset(); fail_notify = 1;
    assert(AdrenoHfiSend(&h, 1, NULL, 0, &header) == AdrenoHfiNotifyError);
    assert(h.poisoned && h.pending_header && shared[17] == 1);
    assert(AdrenoHfiSend(&h, 1, NULL, 0, &header) == AdrenoHfiPoisoned && notifications == 1);

    for (unsigned fault = 0; fault < 7; ++fault) {
        reset();
        assert(AdrenoHfiSend(&h, 1, NULL, 0, &header) == AdrenoHfiSuccess);
        reply(0, header, 0);
        switch (fault) {
            case 0: shared[1] = 168; break;
            case 1: shared[4] = 3; break;
            case 2: shared[20] = 0xa01; break;
            case 3: shared[28] = 1024; break;
            case 4: shared[2048] = (4u << 8) | 126; break; // incomplete
            case 5: shared[2048] &= ~0xff00u; break;
            case 6: h.legacy = 2; break;
        }
        memset(output, 0x5a, sizeof(output));
        assert(AdrenoHfiPoll(&h, output, 16, &returned, &error) == AdrenoHfiCorrupt);
        assert(h.poisoned && h.pending_header && returned == 0);
        for (unsigned index = 0; index < 16; ++index) assert(output[index] == 0x5a5a5a5a);
    }
    reset();
    assert(AdrenoHfiSend(&h, 1, NULL, 0, &header) == AdrenoHfiSuccess);
    reply(0, header + (1u << 20), 0);
    reply(0, header, 0);
    assert(AdrenoHfiPoll(&h, output, 16, &returned, &error) == AdrenoHfiSuccess && h.skipped == 1);
    reset();
    assert(AdrenoHfiSend(&h, 1, NULL, 0, &header) == AdrenoHfiSuccess);
    reply(0, header, 7);
    assert(AdrenoHfiPoll(&h, output, 16, &returned, &error) == AdrenoHfiFirmwareError && error == 7);
    reset();
    assert(AdrenoHfiExchange(&h, 1, NULL, 0, 2, NULL, output, 16, &returned, &error) == AdrenoHfiTimeout);
    assert(h.poisoned && notifications == 1);
    reset(); reply_immediately = 1;
    for (unsigned index = 0; index < 4100; ++index) {
        shared[16] = shared[17];
        assert(AdrenoHfiExchange(&h, 1, NULL, 0, 1, NULL, output, 16, &returned, &error) == AdrenoHfiSuccess);
        assert(h.sequence == (index + 1) % 4095);
    }
    reset();
    AdrenoHfiStartup state = {0};
    AdrenoHfiStartupResult result;
    assert(AdrenoHfiStartupRun(&state, &h, NULL, NULL, &result) == AdrenoHfiStartupInvalid);
    assert(!notifications && !state.attempted && !h.pending_header);
    assert(cases == 2295);
    printf("PASS: %u legacy HFI ring/response cases, 4100 sequence exchanges, failure quarantine\n", cases);
    puts("Software peer only; no real firmware ACK or GPU execution");
    return 0;
}


========== KGSL: C:\Users\qwertyhorik\Desktop\Ios\GPU_TRANSFER_2026-11-26\external\qualcomm-kgsl\adreno_a6xx_hfi.c ==========
--- LINE 17 ---

#include "adreno.h"
#include "adreno_a6xx.h"
#include "adreno_a6xx_hfi.h"
#include "kgsl_device.h"
#include "kgsl_trace.h"

/* Below section is for all structures related to HFI queues */
#define HFI_QUEUE_MAX HFI_QUEUE_DEFAULT_CNT

/* Total header sizes + queue sizes + 16 for alignment */
#define HFIMEM_SIZE (sizeof(struct hfi_queue_table) + 16 + \
		(HFI_QUEUE_SIZE * HFI_QUEUE_MAX))

struct a6xx_hfi *to_a6xx_hfi(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);

	return &gmu->hfi;
}

/* Size in below functions are in unit of dwords */
int a6xx_hfi_queue_read(struct a6xx_gmu_device *gmu, uint32_t queue_idx,
--- LINE 21 ---
#include "kgsl_device.h"
#include "kgsl_trace.h"

/* Below section is for all structures related to HFI queues */
#define HFI_QUEUE_MAX HFI_QUEUE_DEFAULT_CNT

/* Total header sizes + queue sizes + 16 for alignment */
#define HFIMEM_SIZE (sizeof(struct hfi_queue_table) + 16 + \
		(HFI_QUEUE_SIZE * HFI_QUEUE_MAX))

struct a6xx_hfi *to_a6xx_hfi(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);

	return &gmu->hfi;
}

/* Size in below functions are in unit of dwords */
int a6xx_hfi_queue_read(struct a6xx_gmu_device *gmu, uint32_t queue_idx,
		unsigned int *output, unsigned int max_size)
{
	struct kgsl_device *device = KGSL_DEVICE(a6xx_gmu_to_adreno(gmu));
	struct kgsl_memdesc *mem_addr = gmu->hfi.hfi_mem;
--- LINE 37 ---

/* Size in below functions are in unit of dwords */
int a6xx_hfi_queue_read(struct a6xx_gmu_device *gmu, uint32_t queue_idx,
		unsigned int *output, unsigned int max_size)
{
	struct kgsl_device *device = KGSL_DEVICE(a6xx_gmu_to_adreno(gmu));
	struct kgsl_memdesc *mem_addr = gmu->hfi.hfi_mem;
	struct hfi_queue_table *tbl = mem_addr->hostptr;
	struct hfi_queue_header *hdr = &tbl->qhdr[queue_idx];
	uint32_t *queue;
	uint32_t msg_hdr;
	uint32_t i, read;
	uint32_t size;
	int result = 0;

	if (hdr->status == HFI_QUEUE_STATUS_DISABLED)
		return -EINVAL;

	if (hdr->read_index == hdr->write_index)
		return -ENODATA;

	/* Clear the output data before populating */
	memset(output, 0, max_size);
--- LINE 44 ---
	struct hfi_queue_table *tbl = mem_addr->hostptr;
	struct hfi_queue_header *hdr = &tbl->qhdr[queue_idx];
	uint32_t *queue;
	uint32_t msg_hdr;
	uint32_t i, read;
	uint32_t size;
	int result = 0;

	if (hdr->status == HFI_QUEUE_STATUS_DISABLED)
		return -EINVAL;

	if (hdr->read_index == hdr->write_index)
		return -ENODATA;

	/* Clear the output data before populating */
	memset(output, 0, max_size);

	queue = HOST_QUEUE_START_ADDR(mem_addr, queue_idx);
	msg_hdr = queue[hdr->read_index];
	size = MSG_HDR_GET_SIZE(msg_hdr);

	if (size > (max_size >> 2)) {
		dev_err(GMU_PDEV_DEV(device),
--- LINE 85 ---
			hdr->read_index, hdr->queue_size);
		result = -ENODATA;
	}

	if (GMU_VER_MAJOR(device->gmu_core.ver.hfi) >= 2)
		read = ALIGN(read, SZ_4) % hdr->queue_size;

	/* For acks, trace the packet for which this ack was sent */
	if (MSG_HDR_GET_TYPE(msg_hdr) == HFI_MSG_ACK)
		trace_kgsl_hfi_receive(MSG_HDR_GET_ID(output[1]),
			MSG_HDR_GET_SIZE(output[1]),
			MSG_HDR_GET_SEQNUM(output[1]));
	else
		trace_kgsl_hfi_receive(MSG_HDR_GET_ID(msg_hdr),
			MSG_HDR_GET_SIZE(msg_hdr), MSG_HDR_GET_SEQNUM(msg_hdr));

	hfi_update_read_idx(hdr, read);

done:
	return result;
}

/* Size in below functions are in unit of dwords */
--- LINE 106 ---

/* Size in below functions are in unit of dwords */
int a6xx_hfi_queue_write(struct adreno_device *adreno_dev, uint32_t queue_idx,
		uint32_t *msg, u32 size_bytes)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct hfi_queue_table *tbl = gmu->hfi.hfi_mem->hostptr;
	struct hfi_queue_header *hdr = &tbl->qhdr[queue_idx];
	uint32_t *queue;
	uint32_t i, write_idx, read_idx, empty_space;
	uint32_t size_dwords = size_bytes >> 2;
	u32 align_size = ALIGN(size_dwords, SZ_4);
	uint32_t id = MSG_HDR_GET_ID(*msg);

	if (hdr->status == HFI_QUEUE_STATUS_DISABLED || !IS_ALIGNED(size_bytes, sizeof(u32)))
		return -EINVAL;

	queue = HOST_QUEUE_START_ADDR(gmu->hfi.hfi_mem, queue_idx);

	write_idx = hdr->write_index;
	read_idx = hdr->read_index;

--- LINE 113 ---
	struct hfi_queue_table *tbl = gmu->hfi.hfi_mem->hostptr;
	struct hfi_queue_header *hdr = &tbl->qhdr[queue_idx];
	uint32_t *queue;
	uint32_t i, write_idx, read_idx, empty_space;
	uint32_t size_dwords = size_bytes >> 2;
	u32 align_size = ALIGN(size_dwords, SZ_4);
	uint32_t id = MSG_HDR_GET_ID(*msg);

	if (hdr->status == HFI_QUEUE_STATUS_DISABLED || !IS_ALIGNED(size_bytes, sizeof(u32)))
		return -EINVAL;

	queue = HOST_QUEUE_START_ADDR(gmu->hfi.hfi_mem, queue_idx);

	write_idx = hdr->write_index;
	read_idx = hdr->read_index;

	empty_space = (write_idx >= read_idx) ?
			(hdr->queue_size - (write_idx - read_idx))
			: (read_idx - write_idx);

	if (empty_space <= align_size)
		return -ENOSPC;

--- LINE 148 ---

	trace_kgsl_hfi_send(id, size_dwords, MSG_HDR_GET_SEQNUM(*msg));

	hfi_update_write_idx(&hdr->write_index, write_idx);

	return 0;
}

int a6xx_hfi_cmdq_write(struct adreno_device *adreno_dev, u32 *msg, u32 size_bytes)
{
	int ret;

	ret = a6xx_hfi_queue_write(adreno_dev, HFI_CMD_ID, msg, size_bytes);

	/*
	 * Memory barrier to make sure packet and write index are written before
	 * an interrupt is raised
	 */
	wmb();

	/* Send interrupt to GMU to receive the message */
	if (!ret)
		gmu_core_regwrite(KGSL_DEVICE(adreno_dev),
--- LINE 152 ---

	return 0;
}

int a6xx_hfi_cmdq_write(struct adreno_device *adreno_dev, u32 *msg, u32 size_bytes)
{
	int ret;

	ret = a6xx_hfi_queue_write(adreno_dev, HFI_CMD_ID, msg, size_bytes);

	/*
	 * Memory barrier to make sure packet and write index are written before
	 * an interrupt is raised
	 */
	wmb();

	/* Send interrupt to GMU to receive the message */
	if (!ret)
		gmu_core_regwrite(KGSL_DEVICE(adreno_dev),
			A6XX_GMU_HOST2GMU_INTR_SET,
			0x1);

	return ret;
--- LINE 163 ---
	 * Memory barrier to make sure packet and write index are written before
	 * an interrupt is raised
	 */
	wmb();

	/* Send interrupt to GMU to receive the message */
	if (!ret)
		gmu_core_regwrite(KGSL_DEVICE(adreno_dev),
			A6XX_GMU_HOST2GMU_INTR_SET,
			0x1);

	return ret;
}

/* Sizes of the queue and message are in unit of dwords */
static void init_queues(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_memdesc *mem_addr = gmu->hfi.hfi_mem;
	int i;
	struct hfi_queue_table *tbl;
	struct hfi_queue_header *hdr;
	struct {
--- LINE 176 ---

/* Sizes of the queue and message are in unit of dwords */
static void init_queues(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_memdesc *mem_addr = gmu->hfi.hfi_mem;
	int i;
	struct hfi_queue_table *tbl;
	struct hfi_queue_header *hdr;
	struct {
		unsigned int idx;
		unsigned int pri;
		unsigned int status;
	} queue[HFI_QUEUE_MAX] = {
		{ HFI_CMD_IDX, HFI_CMD_PRI, HFI_QUEUE_STATUS_ENABLED },
		{ HFI_MSG_IDX, HFI_MSG_PRI, HFI_QUEUE_STATUS_ENABLED },
		{ HFI_DBG_IDX, HFI_DBG_PRI, HFI_QUEUE_STATUS_ENABLED },
	};

	/*
	 * Overwrite the queue IDs for A630, A615 and A616 as they use
	 * legacy firmware. Legacy firmware has different queue IDs for
	 * message, debug and dispatch queues (dispatch queues aren't used
--- LINE 182 ---
	int i;
	struct hfi_queue_table *tbl;
	struct hfi_queue_header *hdr;
	struct {
		unsigned int idx;
		unsigned int pri;
		unsigned int status;
	} queue[HFI_QUEUE_MAX] = {
		{ HFI_CMD_IDX, HFI_CMD_PRI, HFI_QUEUE_STATUS_ENABLED },
		{ HFI_MSG_IDX, HFI_MSG_PRI, HFI_QUEUE_STATUS_ENABLED },
		{ HFI_DBG_IDX, HFI_DBG_PRI, HFI_QUEUE_STATUS_ENABLED },
	};

	/*
	 * Overwrite the queue IDs for A630, A615 and A616 as they use
	 * legacy firmware. Legacy firmware has different queue IDs for
	 * message, debug and dispatch queues (dispatch queues aren't used
	 * on these targets so the queue idx value update is not needed).
	 */
	if (adreno_is_a630(adreno_dev) || adreno_is_a615_family(adreno_dev)) {
		queue[HFI_MSG_ID].idx = HFI_MSG_IDX_LEGACY;
		queue[HFI_DBG_ID].idx = HFI_DBG_IDX_LEGACY;
	}
--- LINE 183 ---
	struct hfi_queue_table *tbl;
	struct hfi_queue_header *hdr;
	struct {
		unsigned int idx;
		unsigned int pri;
		unsigned int status;
	} queue[HFI_QUEUE_MAX] = {
		{ HFI_CMD_IDX, HFI_CMD_PRI, HFI_QUEUE_STATUS_ENABLED },
		{ HFI_MSG_IDX, HFI_MSG_PRI, HFI_QUEUE_STATUS_ENABLED },
		{ HFI_DBG_IDX, HFI_DBG_PRI, HFI_QUEUE_STATUS_ENABLED },
	};

	/*
	 * Overwrite the queue IDs for A630, A615 and A616 as they use
	 * legacy firmware. Legacy firmware has different queue IDs for
	 * message, debug and dispatch queues (dispatch queues aren't used
	 * on these targets so the queue idx value update is not needed).
	 */
	if (adreno_is_a630(adreno_dev) || adreno_is_a615_family(adreno_dev)) {
		queue[HFI_MSG_ID].idx = HFI_MSG_IDX_LEGACY;
		queue[HFI_DBG_ID].idx = HFI_DBG_IDX_LEGACY;
	}

--- LINE 184 ---
	struct hfi_queue_header *hdr;
	struct {
		unsigned int idx;
		unsigned int pri;
		unsigned int status;
	} queue[HFI_QUEUE_MAX] = {
		{ HFI_CMD_IDX, HFI_CMD_PRI, HFI_QUEUE_STATUS_ENABLED },
		{ HFI_MSG_IDX, HFI_MSG_PRI, HFI_QUEUE_STATUS_ENABLED },
		{ HFI_DBG_IDX, HFI_DBG_PRI, HFI_QUEUE_STATUS_ENABLED },
	};

	/*
	 * Overwrite the queue IDs for A630, A615 and A616 as they use
	 * legacy firmware. Legacy firmware has different queue IDs for
	 * message, debug and dispatch queues (dispatch queues aren't used
	 * on these targets so the queue idx value update is not needed).
	 */
	if (adreno_is_a630(adreno_dev) || adreno_is_a615_family(adreno_dev)) {
		queue[HFI_MSG_ID].idx = HFI_MSG_IDX_LEGACY;
		queue[HFI_DBG_ID].idx = HFI_DBG_IDX_LEGACY;
	}

	/* Fill Table Header */
--- LINE 194 ---

	/*
	 * Overwrite the queue IDs for A630, A615 and A616 as they use
	 * legacy firmware. Legacy firmware has different queue IDs for
	 * message, debug and dispatch queues (dispatch queues aren't used
	 * on these targets so the queue idx value update is not needed).
	 */
	if (adreno_is_a630(adreno_dev) || adreno_is_a615_family(adreno_dev)) {
		queue[HFI_MSG_ID].idx = HFI_MSG_IDX_LEGACY;
		queue[HFI_DBG_ID].idx = HFI_DBG_IDX_LEGACY;
	}

	/* Fill Table Header */
	tbl = mem_addr->hostptr;
	tbl->qtbl_hdr.version = 0;
	tbl->qtbl_hdr.size = sizeof(struct hfi_queue_table) >> 2;
	tbl->qtbl_hdr.qhdr0_offset = sizeof(struct hfi_queue_table_header) >> 2;
	tbl->qtbl_hdr.qhdr_size = sizeof(struct hfi_queue_header) >> 2;
	tbl->qtbl_hdr.num_q = HFI_QUEUE_MAX;
	tbl->qtbl_hdr.num_active_q = HFI_QUEUE_MAX;

	memset(&tbl->qhdr[0], 0, sizeof(tbl->qhdr));

--- LINE 203 ---
		queue[HFI_DBG_ID].idx = HFI_DBG_IDX_LEGACY;
	}

	/* Fill Table Header */
	tbl = mem_addr->hostptr;
	tbl->qtbl_hdr.version = 0;
	tbl->qtbl_hdr.size = sizeof(struct hfi_queue_table) >> 2;
	tbl->qtbl_hdr.qhdr0_offset = sizeof(struct hfi_queue_table_header) >> 2;
	tbl->qtbl_hdr.qhdr_size = sizeof(struct hfi_queue_header) >> 2;
	tbl->qtbl_hdr.num_q = HFI_QUEUE_MAX;
	tbl->qtbl_hdr.num_active_q = HFI_QUEUE_MAX;

	memset(&tbl->qhdr[0], 0, sizeof(tbl->qhdr));

	/* Fill Individual Queue Headers */
	for (i = 0; i < HFI_QUEUE_MAX; i++) {
		hdr = &tbl->qhdr[i];
		hdr->start_addr = GMU_QUEUE_START_ADDR(mem_addr->gmuaddr, i);
		hdr->type = QUEUE_HDR_TYPE(queue[i].idx, queue[i].pri, 0,  0);
		hdr->status = queue[i].status;
		hdr->queue_size = HFI_QUEUE_SIZE >> 2; /* convert to dwords */
	}
}
--- LINE 215 ---
	memset(&tbl->qhdr[0], 0, sizeof(tbl->qhdr));

	/* Fill Individual Queue Headers */
	for (i = 0; i < HFI_QUEUE_MAX; i++) {
		hdr = &tbl->qhdr[i];
		hdr->start_addr = GMU_QUEUE_START_ADDR(mem_addr->gmuaddr, i);
		hdr->type = QUEUE_HDR_TYPE(queue[i].idx, queue[i].pri, 0,  0);
		hdr->status = queue[i].status;
		hdr->queue_size = HFI_QUEUE_SIZE >> 2; /* convert to dwords */
	}
}

int a6xx_hfi_init(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct a6xx_hfi *hfi = &gmu->hfi;

	/* Allocates & maps memory for HFI */
	if (IS_ERR_OR_NULL(hfi->hfi_mem)) {
		hfi->hfi_mem = gmu_core_reserve_kernel_block(KGSL_DEVICE(adreno_dev), 0,
			HFIMEM_SIZE, GMU_NONCACHED_KERNEL, 0);
		if (!IS_ERR(hfi->hfi_mem))
			init_queues(adreno_dev);
--- LINE 262 ---
		"HFI ACK: Cannot find sender for 0x%8.8x Waiter: 0x%8.8x\n",
		req_hdr, ret_cmd->sent_hdr);

	gmu_core_fault_snapshot(device, GMU_FAULT_HFI_RECIVE_ACK);

	return -ENODEV;
}

static int a6xx_hfi_send_cmd_wait_inline(struct adreno_device *adreno_dev,
	void *data, u32 size_bytes, struct pending_cmd *ret_cmd)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	int rc;
	uint32_t *cmd = data;
	struct a6xx_hfi *hfi = &gmu->hfi;
	unsigned int seqnum = atomic_inc_return(&hfi->seqnum);

	*cmd = MSG_HDR_SET_SEQNUM_SIZE(*cmd, seqnum, size_bytes >> 2);
	if (ret_cmd == NULL)
		return a6xx_hfi_cmdq_write(adreno_dev, cmd, size_bytes);

	ret_cmd->sent_hdr = cmd[0];
--- LINE 274 ---
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	int rc;
	uint32_t *cmd = data;
	struct a6xx_hfi *hfi = &gmu->hfi;
	unsigned int seqnum = atomic_inc_return(&hfi->seqnum);

	*cmd = MSG_HDR_SET_SEQNUM_SIZE(*cmd, seqnum, size_bytes >> 2);
	if (ret_cmd == NULL)
		return a6xx_hfi_cmdq_write(adreno_dev, cmd, size_bytes);

	ret_cmd->sent_hdr = cmd[0];

	rc = a6xx_hfi_cmdq_write(adreno_dev, cmd, size_bytes);
	if (rc)
		return rc;

	rc = gmu_core_timed_poll_check(device, A6XX_GMU_GMU2HOST_INTR_INFO,
			HFI_IRQ_MSGQ_MASK, HFI_RSP_TIMEOUT, HFI_IRQ_MSGQ_MASK);

	if (rc) {
		dev_err(GMU_PDEV_DEV(device),
		"Timed out waiting on ack for 0x%8.8x (id %d, sequence %d)\n",
		cmd[0], MSG_HDR_GET_ID(*cmd), MSG_HDR_GET_SEQNUM(*cmd));
--- LINE 278 ---
	unsigned int seqnum = atomic_inc_return(&hfi->seqnum);

	*cmd = MSG_HDR_SET_SEQNUM_SIZE(*cmd, seqnum, size_bytes >> 2);
	if (ret_cmd == NULL)
		return a6xx_hfi_cmdq_write(adreno_dev, cmd, size_bytes);

	ret_cmd->sent_hdr = cmd[0];

	rc = a6xx_hfi_cmdq_write(adreno_dev, cmd, size_bytes);
	if (rc)
		return rc;

	rc = gmu_core_timed_poll_check(device, A6XX_GMU_GMU2HOST_INTR_INFO,
			HFI_IRQ_MSGQ_MASK, HFI_RSP_TIMEOUT, HFI_IRQ_MSGQ_MASK);

	if (rc) {
		dev_err(GMU_PDEV_DEV(device),
		"Timed out waiting on ack for 0x%8.8x (id %d, sequence %d)\n",
		cmd[0], MSG_HDR_GET_ID(*cmd), MSG_HDR_GET_SEQNUM(*cmd));
		gmu_core_fault_snapshot(device, GMU_FAULT_SEND_CMD_WAIT_INLINE);
		return rc;
	}

--- LINE 282 ---
		return a6xx_hfi_cmdq_write(adreno_dev, cmd, size_bytes);

	ret_cmd->sent_hdr = cmd[0];

	rc = a6xx_hfi_cmdq_write(adreno_dev, cmd, size_bytes);
	if (rc)
		return rc;

	rc = gmu_core_timed_poll_check(device, A6XX_GMU_GMU2HOST_INTR_INFO,
			HFI_IRQ_MSGQ_MASK, HFI_RSP_TIMEOUT, HFI_IRQ_MSGQ_MASK);

	if (rc) {
		dev_err(GMU_PDEV_DEV(device),
		"Timed out waiting on ack for 0x%8.8x (id %d, sequence %d)\n",
		cmd[0], MSG_HDR_GET_ID(*cmd), MSG_HDR_GET_SEQNUM(*cmd));
		gmu_core_fault_snapshot(device, GMU_FAULT_SEND_CMD_WAIT_INLINE);
		return rc;
	}

	/* Clear the interrupt */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR,
		HFI_IRQ_MSGQ_MASK);

--- LINE 283 ---

	ret_cmd->sent_hdr = cmd[0];

	rc = a6xx_hfi_cmdq_write(adreno_dev, cmd, size_bytes);
	if (rc)
		return rc;

	rc = gmu_core_timed_poll_check(device, A6XX_GMU_GMU2HOST_INTR_INFO,
			HFI_IRQ_MSGQ_MASK, HFI_RSP_TIMEOUT, HFI_IRQ_MSGQ_MASK);

	if (rc) {
		dev_err(GMU_PDEV_DEV(device),
		"Timed out waiting on ack for 0x%8.8x (id %d, sequence %d)\n",
		cmd[0], MSG_HDR_GET_ID(*cmd), MSG_HDR_GET_SEQNUM(*cmd));
		gmu_core_fault_snapshot(device, GMU_FAULT_SEND_CMD_WAIT_INLINE);
		return rc;
	}

	/* Clear the interrupt */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR,
		HFI_IRQ_MSGQ_MASK);

	rc = a6xx_hfi_process_queue(gmu, HFI_MSG_ID, ret_cmd);
--- LINE 294 ---
		dev_err(GMU_PDEV_DEV(device),
		"Timed out waiting on ack for 0x%8.8x (id %d, sequence %d)\n",
		cmd[0], MSG_HDR_GET_ID(*cmd), MSG_HDR_GET_SEQNUM(*cmd));
		gmu_core_fault_snapshot(device, GMU_FAULT_SEND_CMD_WAIT_INLINE);
		return rc;
	}

	/* Clear the interrupt */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR,
		HFI_IRQ_MSGQ_MASK);

	rc = a6xx_hfi_process_queue(gmu, HFI_MSG_ID, ret_cmd);

	return rc;
}

int a6xx_hfi_send_generic_req(struct adreno_device *adreno_dev, void *cmd, u32 size_bytes)
{
	struct pending_cmd ret_cmd;
	int rc;

	memset(&ret_cmd, 0, sizeof(ret_cmd));

--- LINE 295 ---
		"Timed out waiting on ack for 0x%8.8x (id %d, sequence %d)\n",
		cmd[0], MSG_HDR_GET_ID(*cmd), MSG_HDR_GET_SEQNUM(*cmd));
		gmu_core_fault_snapshot(device, GMU_FAULT_SEND_CMD_WAIT_INLINE);
		return rc;
	}

	/* Clear the interrupt */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR,
		HFI_IRQ_MSGQ_MASK);

	rc = a6xx_hfi_process_queue(gmu, HFI_MSG_ID, ret_cmd);

	return rc;
}

int a6xx_hfi_send_generic_req(struct adreno_device *adreno_dev, void *cmd, u32 size_bytes)
{
	struct pending_cmd ret_cmd;
	int rc;

	memset(&ret_cmd, 0, sizeof(ret_cmd));

	rc = a6xx_hfi_send_cmd_wait_inline(adreno_dev, cmd, size_bytes, &ret_cmd);
--- LINE 297 ---
		gmu_core_fault_snapshot(device, GMU_FAULT_SEND_CMD_WAIT_INLINE);
		return rc;
	}

	/* Clear the interrupt */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR,
		HFI_IRQ_MSGQ_MASK);

	rc = a6xx_hfi_process_queue(gmu, HFI_MSG_ID, ret_cmd);

	return rc;
}

int a6xx_hfi_send_generic_req(struct adreno_device *adreno_dev, void *cmd, u32 size_bytes)
{
	struct pending_cmd ret_cmd;
	int rc;

	memset(&ret_cmd, 0, sizeof(ret_cmd));

	rc = a6xx_hfi_send_cmd_wait_inline(adreno_dev, cmd, size_bytes, &ret_cmd);
	if (rc)
		return rc;
--- LINE 302 ---
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR,
		HFI_IRQ_MSGQ_MASK);

	rc = a6xx_hfi_process_queue(gmu, HFI_MSG_ID, ret_cmd);

	return rc;
}

int a6xx_hfi_send_generic_req(struct adreno_device *adreno_dev, void *cmd, u32 size_bytes)
{
	struct pending_cmd ret_cmd;
	int rc;

	memset(&ret_cmd, 0, sizeof(ret_cmd));

	rc = a6xx_hfi_send_cmd_wait_inline(adreno_dev, cmd, size_bytes, &ret_cmd);
	if (rc)
		return rc;

	if (ret_cmd.results[2]) {
		struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

		dev_err(GMU_PDEV_DEV(KGSL_DEVICE(adreno_dev)),
--- LINE 309 ---

int a6xx_hfi_send_generic_req(struct adreno_device *adreno_dev, void *cmd, u32 size_bytes)
{
	struct pending_cmd ret_cmd;
	int rc;

	memset(&ret_cmd, 0, sizeof(ret_cmd));

	rc = a6xx_hfi_send_cmd_wait_inline(adreno_dev, cmd, size_bytes, &ret_cmd);
	if (rc)
		return rc;

	if (ret_cmd.results[2]) {
		struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

		dev_err(GMU_PDEV_DEV(KGSL_DEVICE(adreno_dev)),
				"HFI ACK failure: Req=0x%8.8X, Result=0x%8.8X\n",
				ret_cmd.results[1],
				ret_cmd.results[2]);
		gmu_core_fault_snapshot(device, GMU_FAULT_HFI_SEND_GENERIC_REQ);
		return -EINVAL;
	}

--- LINE 327 ---
				ret_cmd.results[2]);
		gmu_core_fault_snapshot(device, GMU_FAULT_HFI_SEND_GENERIC_REQ);
		return -EINVAL;
	}

	return 0;
}

static int a6xx_hfi_send_gmu_init(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct hfi_gmu_init_cmd cmd = {
		.seg_id = 0,
		.dbg_buffer_addr = (unsigned int) gmu->dump_mem->gmuaddr,
		.dbg_buffer_size = (unsigned int) gmu->dump_mem->size,
		.boot_state = 0x1,
	};
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_INIT);
	if (ret)
		return ret;

--- LINE 342 ---
		.boot_state = 0x1,
	};
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_INIT);
	if (ret)
		return ret;

	return a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
}

static int a6xx_hfi_get_fw_version(struct adreno_device *adreno_dev,
		uint32_t expected_ver, uint32_t *ver)
{
	struct hfi_fw_version_cmd cmd = {
		.supported_ver = expected_ver,
	};
	int rc;
	struct pending_cmd ret_cmd;

	rc = CMD_MSG_HDR(cmd, H2F_MSG_FW_VER);
	if (rc)
		return rc;
--- LINE 360 ---
	struct pending_cmd ret_cmd;

	rc = CMD_MSG_HDR(cmd, H2F_MSG_FW_VER);
	if (rc)
		return rc;

	memset(&ret_cmd, 0, sizeof(ret_cmd));

	rc = a6xx_hfi_send_cmd_wait_inline(adreno_dev, &cmd, sizeof(cmd), &ret_cmd);
	if (rc)
		return rc;

	rc = ret_cmd.results[2];
	if (!rc)
		*ver = ret_cmd.results[3];
	else
		dev_err(GMU_PDEV_DEV(KGSL_DEVICE(adreno_dev)),
			"gmu get fw ver failed with error=%d\n", rc);

	return rc;
}

int a6xx_hfi_send_core_fw_start(struct adreno_device *adreno_dev)
--- LINE 374 ---
		*ver = ret_cmd.results[3];
	else
		dev_err(GMU_PDEV_DEV(KGSL_DEVICE(adreno_dev)),
			"gmu get fw ver failed with error=%d\n", rc);

	return rc;
}

int a6xx_hfi_send_core_fw_start(struct adreno_device *adreno_dev)
{
	struct hfi_core_fw_start_cmd cmd = {
		.handle = 0x0,
	};
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_CORE_FW_START);
	if (ret)
		return ret;

	return a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
}

int a6xx_hfi_send_feature_ctrl(struct adreno_device *adreno_dev,
--- LINE 385 ---
		.handle = 0x0,
	};
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_CORE_FW_START);
	if (ret)
		return ret;

	return a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
}

int a6xx_hfi_send_feature_ctrl(struct adreno_device *adreno_dev,
	uint32_t feature, uint32_t enable, uint32_t data)
{
	struct hfi_feature_ctrl_cmd cmd = {
		.feature = feature,
		.enable = enable,
		.data = data,
	};
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_FEATURE_CTRL);
	if (ret)
--- LINE 388 ---

	ret = CMD_MSG_HDR(cmd, H2F_MSG_CORE_FW_START);
	if (ret)
		return ret;

	return a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
}

int a6xx_hfi_send_feature_ctrl(struct adreno_device *adreno_dev,
	uint32_t feature, uint32_t enable, uint32_t data)
{
	struct hfi_feature_ctrl_cmd cmd = {
		.feature = feature,
		.enable = enable,
		.data = data,
	};
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_FEATURE_CTRL);
	if (ret)
		return ret;

	ret = a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
--- LINE 402 ---
		.data = data,
	};
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_FEATURE_CTRL);
	if (ret)
		return ret;

	ret = a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
	if (ret)
		dev_err(GMU_PDEV_DEV(KGSL_DEVICE(adreno_dev)), "Unable to %s feature %s (%d)\n",
			enable ? "enable" : "disable", hfi_feature_to_string(feature), feature);
	return ret;
}

int a6xx_hfi_send_set_value(struct adreno_device *adreno_dev,
		u32 type, u32 subtype, u32 data)
{
	struct hfi_set_value_cmd cmd = {
		.type = type,
		.subtype = subtype,
		.data = data,
	};
--- LINE 409 ---

	ret = a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
	if (ret)
		dev_err(GMU_PDEV_DEV(KGSL_DEVICE(adreno_dev)), "Unable to %s feature %s (%d)\n",
			enable ? "enable" : "disable", hfi_feature_to_string(feature), feature);
	return ret;
}

int a6xx_hfi_send_set_value(struct adreno_device *adreno_dev,
		u32 type, u32 subtype, u32 data)
{
	struct hfi_set_value_cmd cmd = {
		.type = type,
		.subtype = subtype,
		.data = data,
	};
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_SET_VALUE);
	if (ret)
		return ret;

	ret = a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
--- LINE 423 ---
		.data = data,
	};
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_SET_VALUE);
	if (ret)
		return ret;

	ret = a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
	if (ret)
		dev_err(GMU_PDEV_DEV(KGSL_DEVICE(adreno_dev)),
			"Unable to set HFI Value %d, %d to %d, error = %d\n",
			type, subtype, data, ret);
	return ret;
}

static int a6xx_hfi_send_dcvstbl_v1(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct hfi_dcvstable_cmd *table = &gmu->hfi.dcvs_table;
	struct hfi_dcvstable_v1_cmd cmd = {
		.gpu_level_num = table->gpu_level_num,
		.gmu_level_num = table->gmu_level_num,
--- LINE 431 ---
	ret = a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
	if (ret)
		dev_err(GMU_PDEV_DEV(KGSL_DEVICE(adreno_dev)),
			"Unable to set HFI Value %d, %d to %d, error = %d\n",
			type, subtype, data, ret);
	return ret;
}

static int a6xx_hfi_send_dcvstbl_v1(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct hfi_dcvstable_cmd *table = &gmu->hfi.dcvs_table;
	struct hfi_dcvstable_v1_cmd cmd = {
		.gpu_level_num = table->gpu_level_num,
		.gmu_level_num = table->gmu_level_num,
	};
	int i, ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_PERF_TBL);
	if (ret)
		return ret;

	for (i = 0; i < table->gpu_level_num; i++) {
--- LINE 455 ---
		cmd.gx_votes[i].freq = table->gx_votes[i].freq;
	}

	cmd.cx_votes[0].vote = table->cx_votes[0].vote;
	cmd.cx_votes[0].freq = table->cx_votes[0].freq;
	cmd.cx_votes[1].vote = table->cx_votes[1].vote;
	cmd.cx_votes[1].freq = table->cx_votes[1].freq;

	return a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
}

static int a6xx_hfi_send_test(struct adreno_device *adreno_dev)
{
	struct hfi_test_cmd cmd;
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_TEST);
	if (ret)
		return ret;

	cmd.data = 0;

	return a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
--- LINE 458 ---
	cmd.cx_votes[0].vote = table->cx_votes[0].vote;
	cmd.cx_votes[0].freq = table->cx_votes[0].freq;
	cmd.cx_votes[1].vote = table->cx_votes[1].vote;
	cmd.cx_votes[1].freq = table->cx_votes[1].freq;

	return a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
}

static int a6xx_hfi_send_test(struct adreno_device *adreno_dev)
{
	struct hfi_test_cmd cmd;
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_TEST);
	if (ret)
		return ret;

	cmd.data = 0;

	return a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
}

void adreno_a6xx_receive_err_req(struct a6xx_gmu_device *gmu, void *rcvd)
--- LINE 469 ---
	int ret;

	ret = CMD_MSG_HDR(cmd, H2F_MSG_TEST);
	if (ret)
		return ret;

	cmd.data = 0;

	return a6xx_hfi_send_generic_req(adreno_dev, &cmd, sizeof(cmd));
}

void adreno_a6xx_receive_err_req(struct a6xx_gmu_device *gmu, void *rcvd)
{
	struct kgsl_device *device = KGSL_DEVICE(a6xx_gmu_to_adreno(gmu));
	const struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(ADRENO_DEVICE(device));
	u64 ticks = gpudev->read_alwayson(ADRENO_DEVICE(device));
	struct hfi_err_cmd *cmd = rcvd;

	dev_err(GMU_PDEV_DEV(device), "HFI Error Received: %d %d %.16s\n",
			((cmd->error_code >> 16) & 0xFFFF),
			(cmd->error_code & 0xFFFF),
			(char *) cmd->data);

--- LINE 537 ---
	while (a6xx_hfi_queue_read(gmu, queue_idx, rcvd, sizeof(rcvd)) > 0) {
		/* Special case if we're v1 */
		if (GMU_VER_MAJOR(device->gmu_core.ver.hfi) < 2) {
			a6xx_hfi_v1_receiver(gmu, rcvd, ret_cmd);
			continue;
		}

		/* V2 ACK Handler */
		if (MSG_HDR_GET_TYPE(rcvd[0]) == HFI_MSG_ACK) {
			int ret = a6xx_receive_ack_cmd(gmu, rcvd, ret_cmd);

			if (ret)
				return ret;
			continue;
		}

		/* V2 Request Handler */
		switch (MSG_HDR_GET_ID(rcvd[0])) {
		case F2H_MSG_ERR: /* No Reply */
			adreno_a6xx_receive_err_req(gmu, rcvd);
			break;
		case F2H_MSG_DEBUG: /* No Reply */
			adreno_a6xx_receive_debug_req(gmu, rcvd);
--- LINE 604 ---
				GMU_VER_MINOR(ver), minor);

	/* Save the gmu version information */
	device->gmu_core.ver.core = ver;

	return 0;
}

int a6xx_hfi_send_bcl_feature_ctrl(struct adreno_device *adreno_dev)
{
	int ret;

	if (!adreno_dev->bcl_enabled)
		return 0;

	ret = a6xx_hfi_send_feature_ctrl(adreno_dev, HFI_FEATURE_BCL, 1, 0);

	return ret;
}

int a6xx_hfi_send_lm_feature_ctrl(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
--- LINE 611 ---

int a6xx_hfi_send_bcl_feature_ctrl(struct adreno_device *adreno_dev)
{
	int ret;

	if (!adreno_dev->bcl_enabled)
		return 0;

	ret = a6xx_hfi_send_feature_ctrl(adreno_dev, HFI_FEATURE_BCL, 1, 0);

	return ret;
}

int a6xx_hfi_send_lm_feature_ctrl(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct hfi_set_value_cmd req;
	u32 slope = 0;
	int ret;

	if (!adreno_dev->lm_enabled)
		return 0;

--- LINE 616 ---
	if (!adreno_dev->bcl_enabled)
		return 0;

	ret = a6xx_hfi_send_feature_ctrl(adreno_dev, HFI_FEATURE_BCL, 1, 0);

	return ret;
}

int a6xx_hfi_send_lm_feature_ctrl(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct hfi_set_value_cmd req;
	u32 slope = 0;
	int ret;

	if (!adreno_dev->lm_enabled)
		return 0;

	memset(&req, 0, sizeof(req));

	nvmem_cell_read_u32(&device->pdev->dev, "isense_slope", &slope);

	ret = CMD_MSG_HDR(req, H2F_MSG_SET_VALUE);
--- LINE 638 ---
	ret = CMD_MSG_HDR(req, H2F_MSG_SET_VALUE);
	if (ret)
		return ret;

	req.type = HFI_VALUE_LM_CS0;
	req.subtype = 0;
	req.data = slope;

	ret = a6xx_hfi_send_feature_ctrl(adreno_dev, HFI_FEATURE_LM, 1,
			device->pwrctrl.throttle_mask);

	if (!ret)
		ret = a6xx_hfi_send_generic_req(adreno_dev, &req, sizeof(req));

	return ret;
}

int a6xx_hfi_send_acd_feature_ctrl(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	int ret = 0;

	if (adreno_dev->acd_enabled) {
--- LINE 642 ---
	req.type = HFI_VALUE_LM_CS0;
	req.subtype = 0;
	req.data = slope;

	ret = a6xx_hfi_send_feature_ctrl(adreno_dev, HFI_FEATURE_LM, 1,
			device->pwrctrl.throttle_mask);

	if (!ret)
		ret = a6xx_hfi_send_generic_req(adreno_dev, &req, sizeof(req));

	return ret;
}

int a6xx_hfi_send_acd_feature_ctrl(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	int ret = 0;

	if (adreno_dev->acd_enabled) {
		ret = a6xx_hfi_send_generic_req(adreno_dev,
			&gmu->hfi.acd_table, sizeof(gmu->hfi.acd_table));
		if (!ret)
			ret = a6xx_hfi_send_feature_ctrl(adreno_dev,
--- LINE 647 ---
			device->pwrctrl.throttle_mask);

	if (!ret)
		ret = a6xx_hfi_send_generic_req(adreno_dev, &req, sizeof(req));

	return ret;
}

int a6xx_hfi_send_acd_feature_ctrl(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	int ret = 0;

	if (adreno_dev->acd_enabled) {
		ret = a6xx_hfi_send_generic_req(adreno_dev,
			&gmu->hfi.acd_table, sizeof(gmu->hfi.acd_table));
		if (!ret)
			ret = a6xx_hfi_send_feature_ctrl(adreno_dev,
				HFI_FEATURE_ACD, 1, 0);
	}

	return ret;
}
--- LINE 653 ---
}

int a6xx_hfi_send_acd_feature_ctrl(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	int ret = 0;

	if (adreno_dev->acd_enabled) {
		ret = a6xx_hfi_send_generic_req(adreno_dev,
			&gmu->hfi.acd_table, sizeof(gmu->hfi.acd_table));
		if (!ret)
			ret = a6xx_hfi_send_feature_ctrl(adreno_dev,
				HFI_FEATURE_ACD, 1, 0);
	}

	return ret;
}

static void reset_hfi_queues(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_memdesc *mem_addr = gmu->hfi.hfi_mem;
	struct hfi_queue_table *tbl = mem_addr->hostptr;
--- LINE 656 ---
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	int ret = 0;

	if (adreno_dev->acd_enabled) {
		ret = a6xx_hfi_send_generic_req(adreno_dev,
			&gmu->hfi.acd_table, sizeof(gmu->hfi.acd_table));
		if (!ret)
			ret = a6xx_hfi_send_feature_ctrl(adreno_dev,
				HFI_FEATURE_ACD, 1, 0);
	}

	return ret;
}

static void reset_hfi_queues(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_memdesc *mem_addr = gmu->hfi.hfi_mem;
	struct hfi_queue_table *tbl = mem_addr->hostptr;
	struct hfi_queue_header *hdr;
	unsigned int i;

--- LINE 668 ---
	return ret;
}

static void reset_hfi_queues(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_memdesc *mem_addr = gmu->hfi.hfi_mem;
	struct hfi_queue_table *tbl = mem_addr->hostptr;
	struct hfi_queue_header *hdr;
	unsigned int i;

	/* Flush HFI queues */
	for (i = 0; i < HFI_QUEUE_MAX; i++) {
		hdr = &tbl->qhdr[i];

		if (hdr->status == HFI_QUEUE_STATUS_DISABLED)
			continue;

		hdr->read_index = hdr->write_index;
	}
}

int a6xx_hfi_start(struct adreno_device *adreno_dev)
--- LINE 675 ---
	struct hfi_queue_table *tbl = mem_addr->hostptr;
	struct hfi_queue_header *hdr;
	unsigned int i;

	/* Flush HFI queues */
	for (i = 0; i < HFI_QUEUE_MAX; i++) {
		hdr = &tbl->qhdr[i];

		if (hdr->status == HFI_QUEUE_STATUS_DISABLED)
			continue;

		hdr->read_index = hdr->write_index;
	}
}

int a6xx_hfi_start(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	int result;

	reset_hfi_queues(adreno_dev);

--- LINE 682 ---

		if (hdr->status == HFI_QUEUE_STATUS_DISABLED)
			continue;

		hdr->read_index = hdr->write_index;
	}
}

int a6xx_hfi_start(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	int result;

	reset_hfi_queues(adreno_dev);

	/* This is legacy HFI message for A630 and A615 family firmware */
	if (adreno_is_a630(adreno_dev) || adreno_is_a615_family(adreno_dev)) {
		result = a6xx_hfi_send_gmu_init(adreno_dev);
		if (result)
			goto err;
	}

--- LINE 692 ---
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	int result;

	reset_hfi_queues(adreno_dev);

	/* This is legacy HFI message for A630 and A615 family firmware */
	if (adreno_is_a630(adreno_dev) || adreno_is_a615_family(adreno_dev)) {
		result = a6xx_hfi_send_gmu_init(adreno_dev);
		if (result)
			goto err;
	}

	result = a6xx_hfi_verify_fw_version(adreno_dev);
	if (result)
		goto err;

	if (GMU_VER_MAJOR(device->gmu_core.ver.hfi) < 2)
		result = a6xx_hfi_send_dcvstbl_v1(adreno_dev);
	else
		result = a6xx_hfi_send_generic_req(adreno_dev,
			&gmu->hfi.dcvs_table, sizeof(gmu->hfi.dcvs_table));
	if (result)
--- LINE 702 ---
			goto err;
	}

	result = a6xx_hfi_verify_fw_version(adreno_dev);
	if (result)
		goto err;

	if (GMU_VER_MAJOR(device->gmu_core.ver.hfi) < 2)
		result = a6xx_hfi_send_dcvstbl_v1(adreno_dev);
	else
		result = a6xx_hfi_send_generic_req(adreno_dev,
			&gmu->hfi.dcvs_table, sizeof(gmu->hfi.dcvs_table));
	if (result)
		goto err;

	result = a6xx_hfi_send_generic_req(adreno_dev, &gmu->hfi.bw_table,
			sizeof(gmu->hfi.bw_table));
	if (result)
		goto err;

	/*
	 * If quirk is enabled send H2F_MSG_TEST and tell the GMU
	 * we are sending no more HFIs until the next boot otherwise
--- LINE 704 ---

	result = a6xx_hfi_verify_fw_version(adreno_dev);
	if (result)
		goto err;

	if (GMU_VER_MAJOR(device->gmu_core.ver.hfi) < 2)
		result = a6xx_hfi_send_dcvstbl_v1(adreno_dev);
	else
		result = a6xx_hfi_send_generic_req(adreno_dev,
			&gmu->hfi.dcvs_table, sizeof(gmu->hfi.dcvs_table));
	if (result)
		goto err;

	result = a6xx_hfi_send_generic_req(adreno_dev, &gmu->hfi.bw_table,
			sizeof(gmu->hfi.bw_table));
	if (result)
		goto err;

	/*
	 * If quirk is enabled send H2F_MSG_TEST and tell the GMU
	 * we are sending no more HFIs until the next boot otherwise
	 * send H2F_MSG_CORE_FW_START and features for A640 devices
	 */
--- LINE 709 ---
	if (GMU_VER_MAJOR(device->gmu_core.ver.hfi) < 2)
		result = a6xx_hfi_send_dcvstbl_v1(adreno_dev);
	else
		result = a6xx_hfi_send_generic_req(adreno_dev,
			&gmu->hfi.dcvs_table, sizeof(gmu->hfi.dcvs_table));
	if (result)
		goto err;

	result = a6xx_hfi_send_generic_req(adreno_dev, &gmu->hfi.bw_table,
			sizeof(gmu->hfi.bw_table));
	if (result)
		goto err;

	/*
	 * If quirk is enabled send H2F_MSG_TEST and tell the GMU
	 * we are sending no more HFIs until the next boot otherwise
	 * send H2F_MSG_CORE_FW_START and features for A640 devices
	 */
	if (GMU_VER_MAJOR(device->gmu_core.ver.hfi) >= 2) {
		result = a6xx_hfi_send_acd_feature_ctrl(adreno_dev);
		if (result)
			goto err;

--- LINE 720 ---
		goto err;

	/*
	 * If quirk is enabled send H2F_MSG_TEST and tell the GMU
	 * we are sending no more HFIs until the next boot otherwise
	 * send H2F_MSG_CORE_FW_START and features for A640 devices
	 */
	if (GMU_VER_MAJOR(device->gmu_core.ver.hfi) >= 2) {
		result = a6xx_hfi_send_acd_feature_ctrl(adreno_dev);
		if (result)
			goto err;

		result = a6xx_hfi_send_lm_feature_ctrl(adreno_dev);
		if (result)
			goto err;

		result = a6xx_hfi_send_bcl_feature_ctrl(adreno_dev);
		if (result)
			goto err;

		result = a6xx_hfi_send_core_fw_start(adreno_dev);
		if (result)
			goto err;
--- LINE 724 ---
	 * we are sending no more HFIs until the next boot otherwise
	 * send H2F_MSG_CORE_FW_START and features for A640 devices
	 */
	if (GMU_VER_MAJOR(device->gmu_core.ver.hfi) >= 2) {
		result = a6xx_hfi_send_acd_feature_ctrl(adreno_dev);
		if (result)
			goto err;

		result = a6xx_hfi_send_lm_feature_ctrl(adreno_dev);
		if (result)
			goto err;

		result = a6xx_hfi_send_bcl_feature_ctrl(adreno_dev);
		if (result)
			goto err;

		result = a6xx_hfi_send_core_fw_start(adreno_dev);
		if (result)
			goto err;
	} else {
		if (ADRENO_QUIRK(adreno_dev, ADRENO_QUIRK_HFI_USE_REG)) {
			result = a6xx_hfi_send_test(adreno_dev);
			if (result)
--- LINE 728 ---
		result = a6xx_hfi_send_acd_feature_ctrl(adreno_dev);
		if (result)
			goto err;

		result = a6xx_hfi_send_lm_feature_ctrl(adreno_dev);
		if (result)
			goto err;

		result = a6xx_hfi_send_bcl_feature_ctrl(adreno_dev);
		if (result)
			goto err;

		result = a6xx_hfi_send_core_fw_start(adreno_dev);
		if (result)
			goto err;
	} else {
		if (ADRENO_QUIRK(adreno_dev, ADRENO_QUIRK_HFI_USE_REG)) {
			result = a6xx_hfi_send_test(adreno_dev);
			if (result)
				goto err;
		}
	}

--- LINE 732 ---
		result = a6xx_hfi_send_lm_feature_ctrl(adreno_dev);
		if (result)
			goto err;

		result = a6xx_hfi_send_bcl_feature_ctrl(adreno_dev);
		if (result)
			goto err;

		result = a6xx_hfi_send_core_fw_start(adreno_dev);
		if (result)
			goto err;
	} else {
		if (ADRENO_QUIRK(adreno_dev, ADRENO_QUIRK_HFI_USE_REG)) {
			result = a6xx_hfi_send_test(adreno_dev);
			if (result)
				goto err;
		}
	}

	set_bit(GMU_PRIV_HFI_STARTED, &gmu->flags);

	result = kgsl_pwrctrl_setup_default_votes(device);

--- LINE 737 ---
		if (result)
			goto err;

		result = a6xx_hfi_send_core_fw_start(adreno_dev);
		if (result)
			goto err;
	} else {
		if (ADRENO_QUIRK(adreno_dev, ADRENO_QUIRK_HFI_USE_REG)) {
			result = a6xx_hfi_send_test(adreno_dev);
			if (result)
				goto err;
		}
	}

	set_bit(GMU_PRIV_HFI_STARTED, &gmu->flags);

	result = kgsl_pwrctrl_setup_default_votes(device);

err:
	if (result)
		a6xx_hfi_stop(adreno_dev);

	return result;
--- LINE 749 ---
	}

	set_bit(GMU_PRIV_HFI_STARTED, &gmu->flags);

	result = kgsl_pwrctrl_setup_default_votes(device);

err:
	if (result)
		a6xx_hfi_stop(adreno_dev);

	return result;

}

void a6xx_hfi_stop(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	kgsl_pwrctrl_axi(device, false);

	clear_bit(GMU_PRIV_HFI_STARTED, &gmu->flags);
}
--- LINE 755 ---
err:
	if (result)
		a6xx_hfi_stop(adreno_dev);

	return result;

}

void a6xx_hfi_stop(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	kgsl_pwrctrl_axi(device, false);

	clear_bit(GMU_PRIV_HFI_STARTED, &gmu->flags);
}

/* HFI interrupt handler */
irqreturn_t a6xx_hfi_irq_handler(int irq, void *data)
{
	struct kgsl_device *device = data;
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(ADRENO_DEVICE(device));
--- LINE 766 ---
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	kgsl_pwrctrl_axi(device, false);

	clear_bit(GMU_PRIV_HFI_STARTED, &gmu->flags);
}

/* HFI interrupt handler */
irqreturn_t a6xx_hfi_irq_handler(int irq, void *data)
{
	struct kgsl_device *device = data;
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(ADRENO_DEVICE(device));
	unsigned int status = 0;

	gmu_core_regread(device, A6XX_GMU_GMU2HOST_INTR_INFO, &status);
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, HFI_IRQ_MASK);

	if (status & HFI_IRQ_DBGQ_MASK)
		a6xx_hfi_process_queue(gmu, HFI_DBG_ID, NULL);
	if (status & HFI_IRQ_CM3_FAULT_MASK) {
		dev_err_ratelimited(GMU_PDEV_DEV(device),
				"GMU CM3 fault interrupt received\n");
		atomic_set(&gmu->cm3_fault, 1);
--- LINE 772 ---

/* HFI interrupt handler */
irqreturn_t a6xx_hfi_irq_handler(int irq, void *data)
{
	struct kgsl_device *device = data;
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(ADRENO_DEVICE(device));
	unsigned int status = 0;

	gmu_core_regread(device, A6XX_GMU_GMU2HOST_INTR_INFO, &status);
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, HFI_IRQ_MASK);

	if (status & HFI_IRQ_DBGQ_MASK)
		a6xx_hfi_process_queue(gmu, HFI_DBG_ID, NULL);
	if (status & HFI_IRQ_CM3_FAULT_MASK) {
		dev_err_ratelimited(GMU_PDEV_DEV(device),
				"GMU CM3 fault interrupt received\n");
		atomic_set(&gmu->cm3_fault, 1);

		/* make sure other CPUs see the update */
		smp_wmb();
	}
	if (status & ~HFI_IRQ_MASK)
		dev_err_ratelimited(GMU_PDEV_DEV(device),
--- LINE 773 ---
/* HFI interrupt handler */
irqreturn_t a6xx_hfi_irq_handler(int irq, void *data)
{
	struct kgsl_device *device = data;
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(ADRENO_DEVICE(device));
	unsigned int status = 0;

	gmu_core_regread(device, A6XX_GMU_GMU2HOST_INTR_INFO, &status);
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, HFI_IRQ_MASK);

	if (status & HFI_IRQ_DBGQ_MASK)
		a6xx_hfi_process_queue(gmu, HFI_DBG_ID, NULL);
	if (status & HFI_IRQ_CM3_FAULT_MASK) {
		dev_err_ratelimited(GMU_PDEV_DEV(device),
				"GMU CM3 fault interrupt received\n");
		atomic_set(&gmu->cm3_fault, 1);

		/* make sure other CPUs see the update */
		smp_wmb();
	}
	if (status & ~HFI_IRQ_MASK)
		dev_err_ratelimited(GMU_PDEV_DEV(device),
				"Unhandled HFI interrupts 0x%lx\n",
--- LINE 775 ---
{
	struct kgsl_device *device = data;
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(ADRENO_DEVICE(device));
	unsigned int status = 0;

	gmu_core_regread(device, A6XX_GMU_GMU2HOST_INTR_INFO, &status);
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, HFI_IRQ_MASK);

	if (status & HFI_IRQ_DBGQ_MASK)
		a6xx_hfi_process_queue(gmu, HFI_DBG_ID, NULL);
	if (status & HFI_IRQ_CM3_FAULT_MASK) {
		dev_err_ratelimited(GMU_PDEV_DEV(device),
				"GMU CM3 fault interrupt received\n");
		atomic_set(&gmu->cm3_fault, 1);

		/* make sure other CPUs see the update */
		smp_wmb();
	}
	if (status & ~HFI_IRQ_MASK)
		dev_err_ratelimited(GMU_PDEV_DEV(device),
				"Unhandled HFI interrupts 0x%lx\n",
				status & ~HFI_IRQ_MASK);

--- LINE 777 ---
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(ADRENO_DEVICE(device));
	unsigned int status = 0;

	gmu_core_regread(device, A6XX_GMU_GMU2HOST_INTR_INFO, &status);
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, HFI_IRQ_MASK);

	if (status & HFI_IRQ_DBGQ_MASK)
		a6xx_hfi_process_queue(gmu, HFI_DBG_ID, NULL);
	if (status & HFI_IRQ_CM3_FAULT_MASK) {
		dev_err_ratelimited(GMU_PDEV_DEV(device),
				"GMU CM3 fault interrupt received\n");
		atomic_set(&gmu->cm3_fault, 1);

		/* make sure other CPUs see the update */
		smp_wmb();
	}
	if (status & ~HFI_IRQ_MASK)
		dev_err_ratelimited(GMU_PDEV_DEV(device),
				"Unhandled HFI interrupts 0x%lx\n",
				status & ~HFI_IRQ_MASK);

	return IRQ_HANDLED;
}
--- LINE 785 ---
	if (status & HFI_IRQ_CM3_FAULT_MASK) {
		dev_err_ratelimited(GMU_PDEV_DEV(device),
				"GMU CM3 fault interrupt received\n");
		atomic_set(&gmu->cm3_fault, 1);

		/* make sure other CPUs see the update */
		smp_wmb();
	}
	if (status & ~HFI_IRQ_MASK)
		dev_err_ratelimited(GMU_PDEV_DEV(device),
				"Unhandled HFI interrupts 0x%lx\n",
				status & ~HFI_IRQ_MASK);

	return IRQ_HANDLED;
}
--- LINE 788 ---
		atomic_set(&gmu->cm3_fault, 1);

		/* make sure other CPUs see the update */
		smp_wmb();
	}
	if (status & ~HFI_IRQ_MASK)
		dev_err_ratelimited(GMU_PDEV_DEV(device),
				"Unhandled HFI interrupts 0x%lx\n",
				status & ~HFI_IRQ_MASK);

	return IRQ_HANDLED;
}

========== KGSL: C:\Users\qwertyhorik\Desktop\Ios\GPU_TRANSFER_2026-11-26\external\qualcomm-kgsl\adreno_a6xx_hfi.h ==========
--- LINE 32 ---
	struct hfi_bwtable_cmd bw_table;
	struct hfi_acd_table_cmd acd_table;
	/** @dcvs_table: HFI table for gpu dcvs levels */
	struct hfi_dcvstable_cmd dcvs_table;
};

struct a6xx_gmu_device;

/* a6xx_hfi_irq_handler - IRQ handler for HFI interripts */
irqreturn_t a6xx_hfi_irq_handler(int irq, void *data);

/**
 * a6xx_hfi_start - Send the various HFIs during device boot up
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_start(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_start - Send the various HFIs during device boot up
 * @adreno_dev: Pointer to the adreno device
 *
--- LINE 33 ---
	struct hfi_acd_table_cmd acd_table;
	/** @dcvs_table: HFI table for gpu dcvs levels */
	struct hfi_dcvstable_cmd dcvs_table;
};

struct a6xx_gmu_device;

/* a6xx_hfi_irq_handler - IRQ handler for HFI interripts */
irqreturn_t a6xx_hfi_irq_handler(int irq, void *data);

/**
 * a6xx_hfi_start - Send the various HFIs during device boot up
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_start(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_start - Send the various HFIs during device boot up
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
--- LINE 36 ---
};

struct a6xx_gmu_device;

/* a6xx_hfi_irq_handler - IRQ handler for HFI interripts */
irqreturn_t a6xx_hfi_irq_handler(int irq, void *data);

/**
 * a6xx_hfi_start - Send the various HFIs during device boot up
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_start(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_start - Send the various HFIs during device boot up
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
void a6xx_hfi_stop(struct adreno_device *adreno_dev);

--- LINE 41 ---
irqreturn_t a6xx_hfi_irq_handler(int irq, void *data);

/**
 * a6xx_hfi_start - Send the various HFIs during device boot up
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_start(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_start - Send the various HFIs during device boot up
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
void a6xx_hfi_stop(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_init - Initialize hfi resources
 * @adreno_dev: Pointer to the adreno device
 *
 * This function allocates and sets up hfi queues
--- LINE 44 ---
 * a6xx_hfi_start - Send the various HFIs during device boot up
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_start(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_start - Send the various HFIs during device boot up
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
void a6xx_hfi_stop(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_init - Initialize hfi resources
 * @adreno_dev: Pointer to the adreno device
 *
 * This function allocates and sets up hfi queues
 * when a process creates the very first kgsl instance
 *
 * Return: 0 on success or negative error on failure
--- LINE 49 ---
int a6xx_hfi_start(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_start - Send the various HFIs during device boot up
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
void a6xx_hfi_stop(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_init - Initialize hfi resources
 * @adreno_dev: Pointer to the adreno device
 *
 * This function allocates and sets up hfi queues
 * when a process creates the very first kgsl instance
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_init(struct adreno_device *adreno_dev);

/* Helper function to get to a6xx hfi struct from adreno device */
struct a6xx_hfi *to_a6xx_hfi(struct adreno_device *adreno_dev);
--- LINE 101 ---
 * @ret_cmd: Container for the hfi packet for which this ack is received
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_receive_ack_cmd(struct a6xx_gmu_device *gmu, void *rcvd,
	struct pending_cmd *ret_cmd);

/**
 * a6xx_hfi_send_feature_ctrl - Enable gmu feature via hfi
 * @adreno_dev: Pointer to the adreno device
 * @feature: feature to be enabled or disabled
 * enable: Set 1 to enable or 0 to disable a feature
 * @data: payload for the send feature hfi packet
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_feature_ctrl(struct adreno_device *adreno_dev,
	u32 feature, u32 enable, u32 data);

/**
 * a6xx_hfi_send_set_value - Send gmu set_values via hfi
 * @adreno_dev: Pointer to the adreno device
 * @type: GMU set_value type
--- LINE 109 ---
 * a6xx_hfi_send_feature_ctrl - Enable gmu feature via hfi
 * @adreno_dev: Pointer to the adreno device
 * @feature: feature to be enabled or disabled
 * enable: Set 1 to enable or 0 to disable a feature
 * @data: payload for the send feature hfi packet
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_feature_ctrl(struct adreno_device *adreno_dev,
	u32 feature, u32 enable, u32 data);

/**
 * a6xx_hfi_send_set_value - Send gmu set_values via hfi
 * @adreno_dev: Pointer to the adreno device
 * @type: GMU set_value type
 * @subtype: GMU set_value subtype
 * @data: Value to set
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_set_value(struct adreno_device *adreno_dev,
		u32 type, u32 subtype, u32 data);

--- LINE 113 ---
 * @data: payload for the send feature hfi packet
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_feature_ctrl(struct adreno_device *adreno_dev,
	u32 feature, u32 enable, u32 data);

/**
 * a6xx_hfi_send_set_value - Send gmu set_values via hfi
 * @adreno_dev: Pointer to the adreno device
 * @type: GMU set_value type
 * @subtype: GMU set_value subtype
 * @data: Value to set
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_set_value(struct adreno_device *adreno_dev,
		u32 type, u32 subtype, u32 data);

/**
 * a6xx_hfi_send_core_fw_start - Send the core fw start hfi
 * @adreno_dev: Pointer to the adreno device
 *
--- LINE 121 ---
 * a6xx_hfi_send_set_value - Send gmu set_values via hfi
 * @adreno_dev: Pointer to the adreno device
 * @type: GMU set_value type
 * @subtype: GMU set_value subtype
 * @data: Value to set
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_set_value(struct adreno_device *adreno_dev,
		u32 type, u32 subtype, u32 data);

/**
 * a6xx_hfi_send_core_fw_start - Send the core fw start hfi
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_core_fw_start(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_acd_feature_ctrl - Send the acd table and acd feature
 * @adreno_dev: Pointer to the adreno device
 *
--- LINE 125 ---
 * @data: Value to set
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_set_value(struct adreno_device *adreno_dev,
		u32 type, u32 subtype, u32 data);

/**
 * a6xx_hfi_send_core_fw_start - Send the core fw start hfi
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_core_fw_start(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_acd_feature_ctrl - Send the acd table and acd feature
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_acd_feature_ctrl(struct adreno_device *adreno_dev);

--- LINE 130 ---
		u32 type, u32 subtype, u32 data);

/**
 * a6xx_hfi_send_core_fw_start - Send the core fw start hfi
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_core_fw_start(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_acd_feature_ctrl - Send the acd table and acd feature
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_acd_feature_ctrl(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_lm_feature_ctrl -  Send the lm feature hfi packet
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
--- LINE 133 ---
 * a6xx_hfi_send_core_fw_start - Send the core fw start hfi
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_core_fw_start(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_acd_feature_ctrl - Send the acd table and acd feature
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_acd_feature_ctrl(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_lm_feature_ctrl -  Send the lm feature hfi packet
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_lm_feature_ctrl(struct adreno_device *adreno_dev);

--- LINE 138 ---
int a6xx_hfi_send_core_fw_start(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_acd_feature_ctrl - Send the acd table and acd feature
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_acd_feature_ctrl(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_lm_feature_ctrl -  Send the lm feature hfi packet
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_lm_feature_ctrl(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_generic_req -  Send a generic hfi packet
 * @adreno_dev: Pointer to the adreno device
 * @cmd: Pointer to the hfi packet header and data
 * @size_bytes: Size of the command in bytes
--- LINE 141 ---
 * a6xx_hfi_send_acd_feature_ctrl - Send the acd table and acd feature
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_acd_feature_ctrl(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_lm_feature_ctrl -  Send the lm feature hfi packet
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_lm_feature_ctrl(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_generic_req -  Send a generic hfi packet
 * @adreno_dev: Pointer to the adreno device
 * @cmd: Pointer to the hfi packet header and data
 * @size_bytes: Size of the command in bytes
 *
 * Return: 0 on success or negative error on failure
 */
--- LINE 146 ---
int a6xx_hfi_send_acd_feature_ctrl(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_lm_feature_ctrl -  Send the lm feature hfi packet
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_lm_feature_ctrl(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_generic_req -  Send a generic hfi packet
 * @adreno_dev: Pointer to the adreno device
 * @cmd: Pointer to the hfi packet header and data
 * @size_bytes: Size of the command in bytes
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_generic_req(struct adreno_device *adreno_dev, void *cmd, u32 size_bytes);

/**
 * a6xx_hfi_send_bcl_feature_ctrl -  Send the bcl feature hfi packet
 * @adreno_dev: Pointer to the adreno device
--- LINE 149 ---
 * a6xx_hfi_send_lm_feature_ctrl -  Send the lm feature hfi packet
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_lm_feature_ctrl(struct adreno_device *adreno_dev);

/**
 * a6xx_hfi_send_generic_req -  Send a generic hfi packet
 * @adreno_dev: Pointer to the adreno device
 * @cmd: Pointer to the hfi packet header and data
 * @size_bytes: Size of the command in bytes
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_generic_req(struct adreno_device *adreno_dev, void *cmd, u32 size_bytes);

/**
 * a6xx_hfi_send_bcl_feature_ctrl -  Send the bcl feature hfi packet
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
--- LINE 156 ---
/**
 * a6xx_hfi_send_generic_req -  Send a generic hfi packet
 * @adreno_dev: Pointer to the adreno device
 * @cmd: Pointer to the hfi packet header and data
 * @size_bytes: Size of the command in bytes
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_generic_req(struct adreno_device *adreno_dev, void *cmd, u32 size_bytes);

/**
 * a6xx_hfi_send_bcl_feature_ctrl -  Send the bcl feature hfi packet
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_bcl_feature_ctrl(struct adreno_device *adreno_dev);

/*
 * a6xx_hfi_process_queue - Check hfi queue for messages from gmu
 * @gmu: Pointer to the a6xx gmu device
 * @queue_idx: queue id to be processed
 * @ret_cmd: Container for data needed for waiting for the ack
--- LINE 159 ---
 * @cmd: Pointer to the hfi packet header and data
 * @size_bytes: Size of the command in bytes
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_generic_req(struct adreno_device *adreno_dev, void *cmd, u32 size_bytes);

/**
 * a6xx_hfi_send_bcl_feature_ctrl -  Send the bcl feature hfi packet
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_bcl_feature_ctrl(struct adreno_device *adreno_dev);

/*
 * a6xx_hfi_process_queue - Check hfi queue for messages from gmu
 * @gmu: Pointer to the a6xx gmu device
 * @queue_idx: queue id to be processed
 * @ret_cmd: Container for data needed for waiting for the ack
 *
 * Return: 0 on success or negative error on failure
 */
--- LINE 164 ---
int a6xx_hfi_send_generic_req(struct adreno_device *adreno_dev, void *cmd, u32 size_bytes);

/**
 * a6xx_hfi_send_bcl_feature_ctrl -  Send the bcl feature hfi packet
 * @adreno_dev: Pointer to the adreno device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_send_bcl_feature_ctrl(struct adreno_device *adreno_dev);

/*
 * a6xx_hfi_process_queue - Check hfi queue for messages from gmu
 * @gmu: Pointer to the a6xx gmu device
 * @queue_idx: queue id to be processed
 * @ret_cmd: Container for data needed for waiting for the ack
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_process_queue(struct a6xx_gmu_device *gmu,
	u32 queue_idx, struct pending_cmd *ret_cmd);

/**
 * a6xx_hfi_cmdq_write - Write a command to command queue
--- LINE 178 ---
 * @ret_cmd: Container for data needed for waiting for the ack
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_process_queue(struct a6xx_gmu_device *gmu,
	u32 queue_idx, struct pending_cmd *ret_cmd);

/**
 * a6xx_hfi_cmdq_write - Write a command to command queue
 * @adreno_dev: Pointer to the adreno device
 * @msg: Data to be written to the queue
 * @size_bytes: Size of the command in bytes
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_cmdq_write(struct adreno_device *adreno_dev, u32 *msg, u32 size_bytes);
void adreno_a6xx_receive_err_req(struct a6xx_gmu_device *gmu, void *rcvd);
void adreno_a6xx_receive_debug_req(struct a6xx_gmu_device *gmu, void *rcvd);
#endif
--- LINE 185 ---
/**
 * a6xx_hfi_cmdq_write - Write a command to command queue
 * @adreno_dev: Pointer to the adreno device
 * @msg: Data to be written to the queue
 * @size_bytes: Size of the command in bytes
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_hfi_cmdq_write(struct adreno_device *adreno_dev, u32 *msg, u32 size_bytes);
void adreno_a6xx_receive_err_req(struct a6xx_gmu_device *gmu, void *rcvd);
void adreno_a6xx_receive_debug_req(struct a6xx_gmu_device *gmu, void *rcvd);
#endif

========== KGSL: C:\Users\qwertyhorik\Desktop\Ios\GPU_TRANSFER_2026-11-26\external\qualcomm-kgsl\adreno_a6xx_gmu.c ==========
--- LINE 935 ---
				oob_to_str(req));
			return -EINVAL;
		}

		set = BIT(30 - req * 2);
		check = BIT(31 - req);
	}

	gmu_core_regwrite(device, A6XX_GMU_HOST2GMU_INTR_SET, set);

	if (gmu_core_timed_poll_check(device, A6XX_GMU_GMU2HOST_INTR_INFO,
				check, GPU_START_TIMEOUT, check)) {
		if (req == oob_perfcntr)
			gmu->num_oob_perfcntr--;
		ret = -ETIMEDOUT;
		WARN(1, "OOB request %s timed out\n", oob_to_str(req));
		gmu_core_fault_snapshot(device, GMU_FAULT_OOB_SET);
		trigger_reset_recovery(adreno_dev, req);
	}

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, check);

	trace_kgsl_gmu_oob_set(set);
--- LINE 937 ---
		}

		set = BIT(30 - req * 2);
		check = BIT(31 - req);
	}

	gmu_core_regwrite(device, A6XX_GMU_HOST2GMU_INTR_SET, set);

	if (gmu_core_timed_poll_check(device, A6XX_GMU_GMU2HOST_INTR_INFO,
				check, GPU_START_TIMEOUT, check)) {
		if (req == oob_perfcntr)
			gmu->num_oob_perfcntr--;
		ret = -ETIMEDOUT;
		WARN(1, "OOB request %s timed out\n", oob_to_str(req));
		gmu_core_fault_snapshot(device, GMU_FAULT_OOB_SET);
		trigger_reset_recovery(adreno_dev, req);
	}

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, check);

	trace_kgsl_gmu_oob_set(set);
	return ret;
}
--- LINE 947 ---
		if (req == oob_perfcntr)
			gmu->num_oob_perfcntr--;
		ret = -ETIMEDOUT;
		WARN(1, "OOB request %s timed out\n", oob_to_str(req));
		gmu_core_fault_snapshot(device, GMU_FAULT_OOB_SET);
		trigger_reset_recovery(adreno_dev, req);
	}

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, check);

	trace_kgsl_gmu_oob_set(set);
	return ret;
}

void a6xx_gmu_oob_clear(struct kgsl_device *device,
		enum oob_request req)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	int clear;

	if (req == oob_perfcntr && --gmu->num_oob_perfcntr)
		return;
--- LINE 974 ---
		clear = BIT(31 - req * 2);
		if (req >= oob_boot_slumber) {
			dev_err(GMU_PDEV_DEV(device), "Unsupported OOB clear %s\n",
				oob_to_str(req));
			return;
		}
	}

	gmu_core_regwrite(device, A6XX_GMU_HOST2GMU_INTR_SET, clear);
	trace_kgsl_gmu_oob_clear(clear);
}

void a6xx_gmu_irq_enable(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct a6xx_hfi *hfi = &gmu->hfi;

	/* Clear pending IRQs and Unmask needed IRQs */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, 0xffffffff);
	gmu_core_regwrite(device, A6XX_GMU_AO_HOST_INTERRUPT_CLR, 0xffffffff);

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_MASK,
--- LINE 985 ---

void a6xx_gmu_irq_enable(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct a6xx_hfi *hfi = &gmu->hfi;

	/* Clear pending IRQs and Unmask needed IRQs */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, 0xffffffff);
	gmu_core_regwrite(device, A6XX_GMU_AO_HOST_INTERRUPT_CLR, 0xffffffff);

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_MASK,
		(unsigned int)~HFI_IRQ_MASK);
	gmu_core_regwrite(device, A6XX_GMU_AO_HOST_INTERRUPT_MASK,
		(unsigned int)~GMU_AO_INT_MASK);


	/* Enable all IRQs on host */
	enable_irq(hfi->irq);
	enable_irq(gmu->irq);
}

void a6xx_gmu_irq_disable(struct adreno_device *adreno_dev)
--- LINE 988 ---
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct a6xx_hfi *hfi = &gmu->hfi;

	/* Clear pending IRQs and Unmask needed IRQs */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, 0xffffffff);
	gmu_core_regwrite(device, A6XX_GMU_AO_HOST_INTERRUPT_CLR, 0xffffffff);

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_MASK,
		(unsigned int)~HFI_IRQ_MASK);
	gmu_core_regwrite(device, A6XX_GMU_AO_HOST_INTERRUPT_MASK,
		(unsigned int)~GMU_AO_INT_MASK);


	/* Enable all IRQs on host */
	enable_irq(hfi->irq);
	enable_irq(gmu->irq);
}

void a6xx_gmu_irq_disable(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
--- LINE 989 ---
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct a6xx_hfi *hfi = &gmu->hfi;

	/* Clear pending IRQs and Unmask needed IRQs */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, 0xffffffff);
	gmu_core_regwrite(device, A6XX_GMU_AO_HOST_INTERRUPT_CLR, 0xffffffff);

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_MASK,
		(unsigned int)~HFI_IRQ_MASK);
	gmu_core_regwrite(device, A6XX_GMU_AO_HOST_INTERRUPT_MASK,
		(unsigned int)~GMU_AO_INT_MASK);


	/* Enable all IRQs on host */
	enable_irq(hfi->irq);
	enable_irq(gmu->irq);
}

void a6xx_gmu_irq_disable(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct a6xx_hfi *hfi = &gmu->hfi;
--- LINE 1010 ---
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct a6xx_hfi *hfi = &gmu->hfi;

	/* Disable all IRQs on host */
	disable_irq(gmu->irq);
	disable_irq(hfi->irq);

	/* Mask all IRQs and clear pending IRQs */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_MASK, 0xffffffff);
	gmu_core_regwrite(device, A6XX_GMU_AO_HOST_INTERRUPT_MASK, 0xffffffff);

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, 0xffffffff);
	gmu_core_regwrite(device, A6XX_GMU_AO_HOST_INTERRUPT_CLR, 0xffffffff);

}

static int a6xx_gmu_hfi_start_msg(struct adreno_device *adreno_dev)
{
	struct hfi_start_cmd req;

	/*
	 * This HFI was not supported in legacy firmware and this quirk
	 * serves as a better means to identify targets that depend on
--- LINE 1013 ---
	/* Disable all IRQs on host */
	disable_irq(gmu->irq);
	disable_irq(hfi->irq);

	/* Mask all IRQs and clear pending IRQs */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_MASK, 0xffffffff);
	gmu_core_regwrite(device, A6XX_GMU_AO_HOST_INTERRUPT_MASK, 0xffffffff);

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR, 0xffffffff);
	gmu_core_regwrite(device, A6XX_GMU_AO_HOST_INTERRUPT_CLR, 0xffffffff);

}

static int a6xx_gmu_hfi_start_msg(struct adreno_device *adreno_dev)
{
	struct hfi_start_cmd req;

	/*
	 * This HFI was not supported in legacy firmware and this quirk
	 * serves as a better means to identify targets that depend on
	 * legacy firmware.
	 */
	if (!ADRENO_QUIRK(adreno_dev, ADRENO_QUIRK_HFI_USE_REG)) {
--- LINE 1034 ---
	 */
	if (!ADRENO_QUIRK(adreno_dev, ADRENO_QUIRK_HFI_USE_REG)) {
		int ret;

		ret = CMD_MSG_HDR(req, H2F_MSG_START);
		if (ret)
			return ret;

		return a6xx_hfi_send_generic_req(adreno_dev, &req, sizeof(req));
	}

	return 0;

}

#define FREQ_VOTE(idx, ack) (((idx) & 0xFF) | (((ack) & 0xF) << 28))
#define BW_VOTE(idx) ((((idx) & 0xFFF) << 12) | ((idx) & 0xFFF))

#define CLKSET_OPTION_ATLEAST 3

/*
 * a6xx_gmu_dcvs_nohfi() - request GMU to do DCVS without using HFI
 * @device: Pointer to KGSL device
--- LINE 1264 ---
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	u32 perf_idx = gmu->hfi.dcvs_table.gpu_level_num -
		pwr->default_pwrlevel - 1;
	u32 default_opp = gmu->hfi.dcvs_table.gx_votes[perf_idx].vote;

	gmu_core_regwrite(device, A6XX_GMU_BOOT_SLUMBER_OPTION,
			OOB_BOOT_OPTION);
	gmu_core_regwrite(device, A6XX_GMU_GX_VOTE_IDX,
			ARC_VOTE_GET_PRI(default_opp));
	gmu_core_regwrite(device, A6XX_GMU_MX_VOTE_IDX,
			ARC_VOTE_GET_SEC(default_opp));

	gmu_core_rdpm_mx_freq_update(device, gmu->hfi.dcvs_table.gx_votes[perf_idx].freq);

	return a6xx_gmu_oob_set(device, oob_boot_slumber);
}

static bool idle_trandition_complete(unsigned int idle_level,
	unsigned int gmu_power_reg,
	unsigned int sptprac_clk_reg)
--- LINE 1681 ---
	const struct adreno_a6xx_core *a6xx_core = to_a6xx_core(adreno_dev);
	struct device *gmu_pdev_dev = GMU_PDEV_DEV(KGSL_DEVICE(adreno_dev));
	struct gmu_block_header *blk;
	int ret, offset = 0;

	/* GMU fw already saved and verified so do nothing new */
	if (!gmu->fw_image) {

		if (a6xx_core->gmufw_name == NULL)
			return -EINVAL;

		ret = adreno_request_firmware(&gmu->fw_image, a6xx_core->gmufw_name,
				gmu_pdev_dev, true);
		if (ret)
			return ret;
	}

	/*
	 * Zero payload fw blocks contain metadata and are
	 * guaranteed to precede fw load data. Parse the
	 * metadata blocks.
	 */
	while (offset < gmu->fw_image->size) {
--- LINE 1684 ---
	int ret, offset = 0;

	/* GMU fw already saved and verified so do nothing new */
	if (!gmu->fw_image) {

		if (a6xx_core->gmufw_name == NULL)
			return -EINVAL;

		ret = adreno_request_firmware(&gmu->fw_image, a6xx_core->gmufw_name,
				gmu_pdev_dev, true);
		if (ret)
			return ret;
	}

	/*
	 * Zero payload fw blocks contain metadata and are
	 * guaranteed to precede fw load data. Parse the
	 * metadata blocks.
	 */
	while (offset < gmu->fw_image->size) {
		blk = (struct gmu_block_header *)&gmu->fw_image->data[offset];

		if (offset + sizeof(*blk) > gmu->fw_image->size) {
--- LINE 1887 ---
	if (!ADRENO_QUIRK(adreno_dev, ADRENO_QUIRK_HFI_USE_REG)) {
		struct hfi_prep_slumber_cmd req = {
			.freq = perf_idx,
			.bw = bus_level,
		};

		ret = CMD_MSG_HDR(req, H2F_MSG_PREPARE_SLUMBER);
		if (!ret)
			ret = a6xx_hfi_send_generic_req(adreno_dev, &req, sizeof(req));

		goto out;
	}

	gmu_core_regwrite(device, A6XX_GMU_BOOT_SLUMBER_OPTION,
			OOB_SLUMBER_OPTION);
	gmu_core_regwrite(device, A6XX_GMU_GX_VOTE_IDX, perf_idx);
	gmu_core_regwrite(device, A6XX_GMU_MX_VOTE_IDX, bus_level);

	ret = a6xx_gmu_oob_set(device, oob_boot_slumber);
	a6xx_gmu_oob_clear(device, oob_boot_slumber);

	if (!ret) {
		gmu_core_regread(device,
--- LINE 1892 ---

		ret = CMD_MSG_HDR(req, H2F_MSG_PREPARE_SLUMBER);
		if (!ret)
			ret = a6xx_hfi_send_generic_req(adreno_dev, &req, sizeof(req));

		goto out;
	}

	gmu_core_regwrite(device, A6XX_GMU_BOOT_SLUMBER_OPTION,
			OOB_SLUMBER_OPTION);
	gmu_core_regwrite(device, A6XX_GMU_GX_VOTE_IDX, perf_idx);
	gmu_core_regwrite(device, A6XX_GMU_MX_VOTE_IDX, bus_level);

	ret = a6xx_gmu_oob_set(device, oob_boot_slumber);
	a6xx_gmu_oob_clear(device, oob_boot_slumber);

	if (!ret) {
		gmu_core_regread(device,
			A6XX_GPU_GMU_CX_GMU_RPMH_POWER_STATE, &state);
		if (state != GPU_HW_SLUMBER) {
			dev_err(GMU_PDEV_DEV(device),
					"Failed to prepare for slumber: 0x%x\n",
					state);
--- LINE 1987 ---

	ret = CMD_MSG_HDR(req, H2F_MSG_GX_BW_PERF_VOTE);
	if (ret)
		return ret;

	if (ADRENO_QUIRK(adreno_dev, ADRENO_QUIRK_HFI_USE_REG))
		ret = a6xx_gmu_dcvs_nohfi(device, req.freq, req.bw);
	else
		ret = a6xx_hfi_send_generic_req(adreno_dev, &req, sizeof(req));

	if (ret) {
		dev_err_ratelimited(GMU_PDEV_DEV(device),
			"Failed to set GPU perf idx %u, bw idx %u\n",
			req.freq, req.bw);

		/*
		 * If this was a dcvs request along side an active gpu, request
		 * dispatcher based reset and recovery.
		 */
		if (test_bit(GMU_PRIV_GPU_STARTED, &gmu->flags))
			adreno_scheduler_fault(adreno_dev, ADRENO_GMU_FAULT |
				ADRENO_GMU_FAULT_SKIP_SNAPSHOT);
	}
--- LINE 2088 ---

	gmu_core_regread(device, A6XX_GMU_CM3_FW_INIT_RESULT, &val);

	if (val & 0xE00)
		return;

nmi:
	/* Mask so there's no interrupt caused by NMI */
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_MASK, 0xFFFFFFFF);

	/* Make sure the interrupt is masked before causing it */
	wmb();
	if (ADRENO_QUIRK(adreno_dev, ADRENO_QUIRK_HFI_USE_REG))
		gmu_core_regwrite(device,
			A6XX_GMU_NMI_CONTROL_STATUS, 0);

	/* This will cause the GMU to save it's internal state to ddr */
	gmu_core_regread(device, A6XX_GMU_CM3_CFG, &val);
	val |=  BIT(9);
	gmu_core_regwrite(device, A6XX_GMU_CM3_CFG, val);

	/* Make sure the NMI is invoked before we proceed*/
	wmb();
--- LINE 2116 ---
	KGSL_GMU_CORE_FORCE_PANIC(device->gmu_core.gf_panic, GMU_PDEV(device), ticks, gf_policy);
}

static void a6xx_gmu_cooperative_reset(struct kgsl_device *device)
{
	unsigned int result;

	gmu_core_regwrite(device, A6XX_GMU_CX_GMU_WDOG_CTRL, 0);
	gmu_core_regwrite(device, A6XX_GMU_HOST2GMU_INTR_SET, BIT(17));

	/*
	 * After triggering graceful death wait for snapshot ready
	 * indication from GMU.
	 */
	if (!gmu_core_timed_poll_check(device, A6XX_GMU_CM3_FW_INIT_RESULT,
				0x800, 2, 0x800))
		return;

	gmu_core_regread(device, A6XX_GMU_CM3_FW_INIT_RESULT, &result);
	dev_err(GMU_PDEV_DEV(device),
		"GMU cooperative reset timed out 0x%x\n", result);
	/*
	 * If we dont get a snapshot ready from GMU, trigger NMI
--- LINE 2229 ---
	struct kgsl_snapshot *snapshot)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	a6xx_gmu_device_snapshot(device, snapshot);

	a6xx_snapshot(adreno_dev, snapshot);

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR,
		0xffffffff);
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_MASK,
		HFI_IRQ_MASK);

}

void a6xx_gmu_aop_send_acd_state(struct a6xx_gmu_device *gmu, bool flag)
{
	struct kgsl_device *device = KGSL_DEVICE(a6xx_gmu_to_adreno(gmu));
	char msg_buf[36];
	u32 size;
	int ret;

	if (IS_ERR_OR_NULL(gmu->qmp) && IS_ERR_OR_NULL(gmu->mailbox.channel))
--- LINE 2231 ---
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	a6xx_gmu_device_snapshot(device, snapshot);

	a6xx_snapshot(adreno_dev, snapshot);

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR,
		0xffffffff);
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_MASK,
		HFI_IRQ_MASK);

}

void a6xx_gmu_aop_send_acd_state(struct a6xx_gmu_device *gmu, bool flag)
{
	struct kgsl_device *device = KGSL_DEVICE(a6xx_gmu_to_adreno(gmu));
	char msg_buf[36];
	u32 size;
	int ret;

	if (IS_ERR_OR_NULL(gmu->qmp) && IS_ERR_OR_NULL(gmu->mailbox.channel))
		return;

--- LINE 2232 ---

	a6xx_gmu_device_snapshot(device, snapshot);

	a6xx_snapshot(adreno_dev, snapshot);

	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_CLR,
		0xffffffff);
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_MASK,
		HFI_IRQ_MASK);

}

void a6xx_gmu_aop_send_acd_state(struct a6xx_gmu_device *gmu, bool flag)
{
	struct kgsl_device *device = KGSL_DEVICE(a6xx_gmu_to_adreno(gmu));
	char msg_buf[36];
	u32 size;
	int ret;

	if (IS_ERR_OR_NULL(gmu->qmp) && IS_ERR_OR_NULL(gmu->mailbox.channel))
		return;

	size = scnprintf(msg_buf, sizeof(msg_buf),
--- LINE 2371 ---
		if (ret)
			goto err;
	}

	ret = a6xx_gmu_hfi_start(adreno_dev);
	if (ret)
		goto err;

	ret = a6xx_hfi_start(adreno_dev);
	if (ret)
		goto err;

	icc_set_bw(pwr->icc_path, 0, 0);

	device->gmu_fault = false;

	kgsl_pwrctrl_set_state(device, KGSL_STATE_AWARE);

	return 0;

err:
	a6xx_gmu_irq_disable(adreno_dev);

--- LINE 2402 ---
gdsc_off:
	a6xx_gmu_disable_gdsc(adreno_dev);

	gmu_core_rdpm_cx_freq_update(device, 0);

	return ret;
}

static int a6xx_gmu_boot(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	int ret = 0;

	kgsl_pwrctrl_request_state(device, KGSL_STATE_AWARE);

	ret = kgsl_pwrctrl_enable_cx_gdsc(device);
	if (ret)
		return ret;

	ret = gmu_core_enable_clks(device, 0);
	if (ret)
		goto gdsc_off;
--- LINE 2455 ---
		if (ret)
			goto err;
	}

	ret = a6xx_gmu_hfi_start(adreno_dev);
	if (ret)
		goto err;

	ret = a6xx_hfi_start(adreno_dev);
	if (ret)
		goto err;

	device->gmu_fault = false;

	kgsl_pwrctrl_set_state(device, KGSL_STATE_AWARE);

	return 0;

err:
	a6xx_gmu_irq_disable(adreno_dev);

	if (device->gmu_fault) {
		a6xx_gmu_suspend(adreno_dev, false);
--- LINE 2596 ---
	struct kgsl_pwrlevel *pwrlevel =
			&pwr->pwrlevels[pwr->num_pwrlevels - 1];
	struct hfi_acd_table_cmd *cmd = &gmu->hfi.acd_table;
	int ret, i, cmd_idx = 0;

	if (!ADRENO_FEATURE(adreno_dev, ADRENO_ACD))
		return 0;

	cmd->hdr = CREATE_MSG_HDR(H2F_MSG_ACD_TBL, HFI_MSG_CMD);

	cmd->version = 1;
	cmd->stride = 1;
	cmd->enable_by_level = 0;

	/*
	 * Iterate through each gpu power level and generate a mask for GMU
	 * firmware for ACD enabled levels and store the corresponding control
	 * register configurations to the acd_table structure.
	 */
	for (i = 0; i < pwr->num_pwrlevels; i++) {
		if (pwrlevel->acd_level) {
			cmd->enable_by_level |= (1 << (i + 1));
			cmd->data[cmd_idx++] = pwrlevel->acd_level;
--- LINE 2871 ---
	if (!adreno_is_a630(adreno_dev)) {
		ret = a6xx_halt_gbif(adreno_dev);
		/* De-assert the halts */
		kgsl_regwrite(device, A6XX_GBIF_HALT, 0x0);
	}

	a6xx_gmu_irq_disable(adreno_dev);

	a6xx_hfi_stop(adreno_dev);

	gmu_core_disable_clks(device);

	a6xx_gmu_disable_gdsc(adreno_dev);

	gmu_core_rdpm_cx_freq_update(device, 0);

	kgsl_pwrctrl_set_state(device, KGSL_STATE_NONE);

	return ret;

error:
	a6xx_gmu_irq_disable(adreno_dev);
	a6xx_hfi_stop(adreno_dev);
--- LINE 2885 ---
	gmu_core_rdpm_cx_freq_update(device, 0);

	kgsl_pwrctrl_set_state(device, KGSL_STATE_NONE);

	return ret;

error:
	a6xx_gmu_irq_disable(adreno_dev);
	a6xx_hfi_stop(adreno_dev);
	a6xx_gmu_suspend(adreno_dev, false);

	return ret;
}

void a6xx_enable_gpu_irq(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	kgsl_pwrctrl_irq(device, true);

	adreno_irqctrl(adreno_dev, 1);
}

--- LINE 3034 ---
		return 0;

	kgsl_pwrctrl_request_state(device, KGSL_STATE_ACTIVE);

	if (IS_ENABLED(CONFIG_QCOM_KGSL_HIBERNATION) &&
		!test_bit(GMU_PRIV_PDC_RSC_LOADED, &gmu->flags))
		ret = a6xx_gmu_first_boot(adreno_dev);
	else
		ret = a6xx_gmu_boot(adreno_dev);
	if (ret)
		return ret;

	ret = a6xx_gpu_boot(adreno_dev);
	if (ret)
		return ret;

	kgsl_start_idle_timer(device);

	kgsl_pwrscale_wake(device);

	set_bit(GMU_PRIV_GPU_STARTED, &gmu->flags);

	device->pwrctrl.last_stat_updated = ktime_get();
--- LINE 3394 ---
		!test_bit(GMU_PRIV_FIRST_BOOT_DONE, &gmu->flags))
		return;

	if (test_bit(GMU_PRIV_GPU_STARTED, &gmu->flags))
		goto done;

	kgsl_pwrctrl_request_state(device, KGSL_STATE_ACTIVE);

	ret = a6xx_gmu_boot(adreno_dev);
	if (ret)
		return;

	ret = a6xx_gpu_boot(adreno_dev);
	if (ret)
		return;

	kgsl_pwrscale_wake(device);

	set_bit(GMU_PRIV_GPU_STARTED, &gmu->flags);

	device->pwrctrl.last_stat_updated = ktime_get();

	kgsl_pwrctrl_set_state(device, KGSL_STATE_ACTIVE);
--- LINE 3485 ---
int a6xx_gmu_reset(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);

	a6xx_disable_gpu_irq(adreno_dev);

	a6xx_gmu_irq_disable(adreno_dev);

	a6xx_hfi_stop(adreno_dev);

	/* Hard reset the gmu and gpu */
	a6xx_gmu_suspend(adreno_dev, true);

	a6xx_reset_preempt_records(adreno_dev);

	adreno_llcc_slice_deactivate(adreno_dev);

	clear_bit(GMU_PRIV_GPU_STARTED, &gmu->flags);

	/* Attempt to reboot the gmu and gpu */
	return a6xx_boot(adreno_dev);
}

--- LINE 3506 ---
}

int a6xx_gmu_hfi_probe(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct a6xx_hfi *hfi = &gmu->hfi;
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	/* Try with "hfi" irq first. Use Fallback legacy name "kgsl_hfi_irq" if not found. */
	hfi->irq = kgsl_request_irq(GMU_PDEV(device), "hfi", "kgsl_hfi_irq", -EINVAL,
		a6xx_hfi_irq_handler, KGSL_DEVICE(adreno_dev));

	return hfi->irq < 0 ? hfi->irq : 0;
}

int a6xx_gmu_add_to_minidump(struct adreno_device *adreno_dev)
{
	struct a6xx_device *a6xx_dev = container_of(adreno_dev,
					struct a6xx_device, adreno_dev);
	int ret;

	ret = kgsl_add_va_to_minidump(adreno_dev->dev.dev, KGSL_A6XX_DEVICE,
			(void *)(a6xx_dev), sizeof(struct a6xx_device));
--- LINE 3507 ---

int a6xx_gmu_hfi_probe(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct a6xx_hfi *hfi = &gmu->hfi;
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	/* Try with "hfi" irq first. Use Fallback legacy name "kgsl_hfi_irq" if not found. */
	hfi->irq = kgsl_request_irq(GMU_PDEV(device), "hfi", "kgsl_hfi_irq", -EINVAL,
		a6xx_hfi_irq_handler, KGSL_DEVICE(adreno_dev));

	return hfi->irq < 0 ? hfi->irq : 0;
}

int a6xx_gmu_add_to_minidump(struct adreno_device *adreno_dev)
{
	struct a6xx_device *a6xx_dev = container_of(adreno_dev,
					struct a6xx_device, adreno_dev);
	int ret;

	ret = kgsl_add_va_to_minidump(adreno_dev->dev.dev, KGSL_A6XX_DEVICE,
			(void *)(a6xx_dev), sizeof(struct a6xx_device));
	if (ret)
--- LINE 3508 ---
int a6xx_gmu_hfi_probe(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct a6xx_hfi *hfi = &gmu->hfi;
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	/* Try with "hfi" irq first. Use Fallback legacy name "kgsl_hfi_irq" if not found. */
	hfi->irq = kgsl_request_irq(GMU_PDEV(device), "hfi", "kgsl_hfi_irq", -EINVAL,
		a6xx_hfi_irq_handler, KGSL_DEVICE(adreno_dev));

	return hfi->irq < 0 ? hfi->irq : 0;
}

int a6xx_gmu_add_to_minidump(struct adreno_device *adreno_dev)
{
	struct a6xx_device *a6xx_dev = container_of(adreno_dev,
					struct a6xx_device, adreno_dev);
	int ret;

	ret = kgsl_add_va_to_minidump(adreno_dev->dev.dev, KGSL_A6XX_DEVICE,
			(void *)(a6xx_dev), sizeof(struct a6xx_device));
	if (ret)
		return ret;

========== KGSL: C:\Users\qwertyhorik\Desktop\Ios\GPU_TRANSFER_2026-11-26\external\qualcomm-kgsl\adreno_a6xx_gmu.h ==========

========== KGSL: C:\Users\qwertyhorik\Desktop\Ios\GPU_TRANSFER_2026-11-26\external\qualcomm-kgsl\kgsl_gmu_core.c ==========

========== KGSL: C:\Users\qwertyhorik\Desktop\Ios\GPU_TRANSFER_2026-11-26\external\qualcomm-kgsl\adreno-gpulist.h ==========
--- LINE 153 ---
		.highest_bank_bit = 15,
	},
	.gpmu_tsens = 0x00060007,
	.max_power = 5448,
	.pm4fw_name = "a530_pm4.fw",
	.pfpfw_name = "a530_pfp.fw",
	.gpmufw_name = "a530_gpmu.fw2",
	.regfw_name = "a530v2_seq.fw2",
	.zap_name = "a530_zap.mdt",
	.hwcg = a530_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a530_hwcg_regs),
	.vbif = a530_vbif_regs,
	.vbif_count = ARRAY_SIZE(a530_vbif_regs),
};

static const struct adreno_a5xx_core adreno_gpu_core_a530v3 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A530, 5, 3, 0, ANY_ID),
		.features = ADRENO_SPTP_PC | ADRENO_LM |
			ADRENO_PREEMPTION |
			ADRENO_CONTENT_PROTECTION,
		.gpudev = &adreno_a5xx_gpudev,
		.perfcounters = &adreno_a5xx_perfcounters,
--- LINE 180 ---
		.highest_bank_bit = 15,
	},
	.gpmu_tsens = 0x00060007,
	.max_power = 5448,
	.pm4fw_name = "a530_pm4.fw",
	.pfpfw_name = "a530_pfp.fw",
	.gpmufw_name = "a530v3_gpmu.fw2",
	.regfw_name = "a530v3_seq.fw2",
	.zap_name = "a530_zap.mdt",
	.hwcg = a530_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a530_hwcg_regs),
	.vbif = a530_vbif_regs,
	.vbif_count = ARRAY_SIZE(a530_vbif_regs),
};

/* For a505, a506 and a508 */
static const struct kgsl_regmap_list a50x_hwcg_regs[] = {
	{A5XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
	{A5XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A5XX_RBBM_CLOCK_HYST_SP0, 0x0000F3CF},
	{A5XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
	{A5XX_RBBM_CLOCK_CNTL_TP0, 0x22222222},
	{A5XX_RBBM_CLOCK_CNTL2_TP0, 0x22222222},
--- LINE 263 ---
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = (SZ_128K + SZ_8K),
		.bus_width = 16,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.pm4fw_name = "a530_pm4.fw",
	.pfpfw_name = "a530_pfp.fw",
	.zap_name = "a506_zap.mdt",
	.hwcg = a50x_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a50x_hwcg_regs),
	.vbif = a530_vbif_regs,
	.vbif_count = ARRAY_SIZE(a530_vbif_regs),
};

static const struct kgsl_regmap_list a510_hwcg_regs[] = {
	{A5XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
	{A5XX_RBBM_CLOCK_CNTL_SP1, 0x02222222},
	{A5XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A5XX_RBBM_CLOCK_CNTL2_SP1, 0x02222220},
	{A5XX_RBBM_CLOCK_HYST_SP0, 0x0000F3CF},
	{A5XX_RBBM_CLOCK_HYST_SP1, 0x0000F3CF},
	{A5XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
--- LINE 471 ---
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 15,
	},
	.gpmu_tsens = 0x000c000d,
	.max_power = 5448,
	.pm4fw_name = "a530_pm4.fw",
	.pfpfw_name = "a530_pfp.fw",
	.gpmufw_name = "a540_gpmu.fw2",
	.zap_name = "a540_zap.mdt",
	.hwcg = a540_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a540_hwcg_regs),
	.vbif = a540_vbif_regs,
	.vbif_count = ARRAY_SIZE(a540_vbif_regs),
};

static const struct kgsl_regmap_list a512_hwcg_regs[] = {
	{A5XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
	{A5XX_RBBM_CLOCK_CNTL_SP1, 0x02222222},
	{A5XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A5XX_RBBM_CLOCK_CNTL2_SP1, 0x02222220},
	{A5XX_RBBM_CLOCK_HYST_SP0, 0x0000F3CF},
	{A5XX_RBBM_CLOCK_HYST_SP1, 0x0000F3CF},
	{A5XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
--- LINE 552 ---
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = (SZ_256K + SZ_16K),
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.pm4fw_name = "a530_pm4.fw",
	.pfpfw_name = "a530_pfp.fw",
	.zap_name = "a512_zap.mdt",
	.hwcg = a512_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a512_hwcg_regs),
};

static const struct adreno_a5xx_core adreno_gpu_core_a508 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A508, 5, 0, 8, ANY_ID),
		.features = ADRENO_PREEMPTION |
			ADRENO_CONTENT_PROTECTION | ADRENO_CPZ_RETENTION,
		.gpudev = &adreno_a5xx_gpudev,
		.perfcounters = &adreno_a5xx_perfcounters,
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = (SZ_128K + SZ_8K),
		.bus_width = 32,
--- LINE 572 ---
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = (SZ_128K + SZ_8K),
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.pm4fw_name = "a530_pm4.fw",
	.pfpfw_name = "a530_pfp.fw",
	.zap_name = "a508_zap.mdt",
	.hwcg = a50x_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a50x_hwcg_regs),
	.vbif = a530_vbif_regs,
	.vbif_count = ARRAY_SIZE(a530_vbif_regs),
};

DEFINE_DEPRECATED_CORE(a630v1, ADRENO_REV_A630, 6, 3, 0, 0);

static const struct kgsl_regmap_list a630_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
	{A6XX_RBBM_CLOCK_CNTL_SP1, 0x02222222},
	{A6XX_RBBM_CLOCK_CNTL_SP2, 0x02222222},
	{A6XX_RBBM_CLOCK_CNTL_SP3, 0x02222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02022220},
--- LINE 748 ---
		.gmem_size = SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 3,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a630_zap.mdt",
	.hwcg = a630_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a630_hwcg_regs),
	.vbif = a630_vbif_regs,
	.vbif_count = ARRAY_SIZE(a630_vbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
};

/* For a615, a616, a618 and a619 */
static const struct kgsl_regmap_list a615_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0,  0x02222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
--- LINE 749 ---
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 3,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a630_zap.mdt",
	.hwcg = a630_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a630_hwcg_regs),
	.vbif = a630_vbif_regs,
	.vbif_count = ARRAY_SIZE(a630_vbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
};

/* For a615, a616, a618 and a619 */
static const struct kgsl_regmap_list a615_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0,  0x02222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A6XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
--- LINE 750 ---
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 3,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a630_zap.mdt",
	.hwcg = a630_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a630_hwcg_regs),
	.vbif = a630_vbif_regs,
	.vbif_count = ARRAY_SIZE(a630_vbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
};

/* For a615, a616, a618 and a619 */
static const struct kgsl_regmap_list a615_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0,  0x02222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A6XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
	{A6XX_RBBM_CLOCK_HYST_SP0,  0x0000F3CF},
--- LINE 848 ---
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 3,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a618 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A618, 6, 1, 8, ANY_ID),
		.features = ADRENO_PREEMPTION |
--- LINE 849 ---
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 3,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a618 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A618, 6, 1, 8, ANY_ID),
		.features = ADRENO_PREEMPTION |
			ADRENO_CONTENT_PROTECTION | ADRENO_IFPC |
--- LINE 850 ---
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 3,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a618 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A618, 6, 1, 8, ANY_ID),
		.features = ADRENO_PREEMPTION |
			ADRENO_CONTENT_PROTECTION | ADRENO_IFPC |
			ADRENO_IOCOHERENT,
--- LINE 859 ---
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a618 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A618, 6, 1, 8, ANY_ID),
		.features = ADRENO_PREEMPTION |
			ADRENO_CONTENT_PROTECTION | ADRENO_IFPC |
			ADRENO_IOCOHERENT,
		.gpudev = &adreno_a630_gpudev.base,
		.perfcounters = &adreno_a6xx_legacy_perfcounters,
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
--- LINE 876 ---
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 7,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a619 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A619, 6, 1, 9, ANY_ID),
		.features = ADRENO_PREEMPTION |
--- LINE 877 ---
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 7,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a619 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A619, 6, 1, 9, ANY_ID),
		.features = ADRENO_PREEMPTION |
			ADRENO_CONTENT_PROTECTION | ADRENO_IFPC |
--- LINE 878 ---
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 7,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a619 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A619, 6, 1, 9, ANY_ID),
		.features = ADRENO_PREEMPTION |
			ADRENO_CONTENT_PROTECTION | ADRENO_IFPC |
			ADRENO_IOCOHERENT,
--- LINE 904 ---
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 9,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a619_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a619_variant = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A619, 6, 1, 9, ANY_ID),
		.compatible = "qcom,adreno-gpu-a619-holi",
--- LINE 905 ---
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 9,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a619_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a619_variant = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A619, 6, 1, 9, ANY_ID),
		.compatible = "qcom,adreno-gpu-a619-holi",
		.features =  ADRENO_PREEMPTION | ADRENO_CONTENT_PROTECTION,
--- LINE 906 ---
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 9,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a619_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a619_variant = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A619, 6, 1, 9, ANY_ID),
		.compatible = "qcom,adreno-gpu-a619-holi",
		.features =  ADRENO_PREEMPTION | ADRENO_CONTENT_PROTECTION,
		.gpudev = &adreno_a619_holi_gpudev,
--- LINE 929 ---
		.perfcounters = &adreno_a6xx_legacy_perfcounters,
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.sqefw_name = "a630_sqe.fw",
	.zap_name = "gen6_3_25_0_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
	.gx_cpr_toggle = true,
};

static const struct kgsl_regmap_list a620_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A6XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
--- LINE 930 ---
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.sqefw_name = "a630_sqe.fw",
	.zap_name = "gen6_3_25_0_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
	.gx_cpr_toggle = true,
};

static const struct kgsl_regmap_list a620_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A6XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
	{A6XX_RBBM_CLOCK_HYST_SP0, 0x0000F3CF},
--- LINE 1063 ---
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a650_gmu.bin",
	.zap_name = "a620_zap.mdt",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
};

static const struct adreno_a6xx_core adreno_gpu_core_a621 = {
	.base = {
--- LINE 1064 ---
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a650_gmu.bin",
	.zap_name = "a620_zap.mdt",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
};

static const struct adreno_a6xx_core adreno_gpu_core_a621 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A621, 6, 2, 1, ANY_ID),
--- LINE 1065 ---
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a650_gmu.bin",
	.zap_name = "a620_zap.mdt",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
};

static const struct adreno_a6xx_core adreno_gpu_core_a621 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A621, 6, 2, 1, ANY_ID),
		.compatible = "qcom,adreno-gpu-a621",
--- LINE 1094 ---
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 13,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a621_gmu.bin",
	.zap_name = "a620_zap.mdt",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
	.gmu_hub_clk_freq = 200000000,
};

--- LINE 1095 ---
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 13,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a621_gmu.bin",
	.zap_name = "a620_zap.mdt",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
	.gmu_hub_clk_freq = 200000000,
};

static const struct adreno_a6xx_core adreno_gpu_core_a622 = {
--- LINE 1096 ---
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 13,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a621_gmu.bin",
	.zap_name = "a620_zap.mdt",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
	.gmu_hub_clk_freq = 200000000,
};

static const struct adreno_a6xx_core adreno_gpu_core_a622 = {
	.base = {
--- LINE 1127 ---
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a622_gmu.bin",
	.zap_name = "a622_zap.mdt",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
	.gmu_hub_clk_freq = 200000000,
};

--- LINE 1128 ---
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a622_gmu.bin",
	.zap_name = "a622_zap.mdt",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
	.gmu_hub_clk_freq = 200000000,
};

static const struct kgsl_regmap_list a640_hwcg_regs[] = {
--- LINE 1129 ---
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a622_gmu.bin",
	.zap_name = "a622_zap.mdt",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
	.gmu_hub_clk_freq = 200000000,
};

static const struct kgsl_regmap_list a640_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
--- LINE 1271 ---
		.gmem_size = SZ_1M, //Verified 1MB
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00200000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a640_gmu.bin",
	.zap_name = "a640_zap.mdt",
	.hwcg = a640_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a640_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
	.disable_tseskip = true,
};

static const struct kgsl_regmap_list a650_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
--- LINE 1272 ---
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00200000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a640_gmu.bin",
	.zap_name = "a640_zap.mdt",
	.hwcg = a640_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a640_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
	.disable_tseskip = true,
};

static const struct kgsl_regmap_list a650_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A6XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
--- LINE 1273 ---
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00200000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a640_gmu.bin",
	.zap_name = "a640_zap.mdt",
	.hwcg = a640_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a640_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
	.disable_tseskip = true,
};

static const struct kgsl_regmap_list a650_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A6XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
	{A6XX_RBBM_CLOCK_HYST_SP0, 0x0000F3CF},
--- LINE 1351 ---
		.gmem_size = SZ_1M + SZ_128K, /* verified 1152kB */
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a650_gmu.bin",
	.zap_name = "a650_zap.mdt",
	.hwcg = a650_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a650_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
};

static const struct adreno_a6xx_core adreno_gpu_core_a650v2 = {
--- LINE 1352 ---
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a650_gmu.bin",
	.zap_name = "a650_zap.mdt",
	.hwcg = a650_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a650_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
};

static const struct adreno_a6xx_core adreno_gpu_core_a650v2 = {
	.base = {
--- LINE 1353 ---
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a650_gmu.bin",
	.zap_name = "a650_zap.mdt",
	.hwcg = a650_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a650_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
};

static const struct adreno_a6xx_core adreno_gpu_core_a650v2 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A650, 6, 5, 0, ANY_ID),
--- LINE 1382 ---
		.gmem_size = SZ_1M + SZ_128K, /* verified 1152kB */
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a650_gmu.bin",
	.zap_name = "a650_zap.mdt",
	.hwcg = a650_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a650_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
};

static const struct adreno_a6xx_core adreno_gpu_core_a680 = {
--- LINE 1383 ---
		.bus_width = 32,
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a650_gmu.bin",
	.zap_name = "a650_zap.mdt",
	.hwcg = a650_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a650_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
};

static const struct adreno_a6xx_core adreno_gpu_core_a680 = {
	.base = {
--- LINE 1384 ---
		.snapshot_size = 2 * SZ_1M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a650_gmu.bin",
	.zap_name = "a650_zap.mdt",
	.hwcg = a650_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a650_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.veto_fal10 = true,
	.pdc_in_aop = true,
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
};

static const struct adreno_a6xx_core adreno_gpu_core_a680 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A680, 6, 8, 0, ANY_ID),
--- LINE 1412 ---
		.gmem_size = SZ_2M,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00400000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a640_gmu.bin",
	.zap_name = "a640_zap.mdt",
	.hwcg = a680_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a680_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
	.disable_tseskip = true,
};

static const struct kgsl_regmap_list a612_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x22222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
--- LINE 1413 ---
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00400000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a640_gmu.bin",
	.zap_name = "a640_zap.mdt",
	.hwcg = a680_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a680_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
	.disable_tseskip = true,
};

static const struct kgsl_regmap_list a612_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x22222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A6XX_RBBM_CLOCK_DELAY_SP0, 0x00000081},
--- LINE 1414 ---
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00400000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a640_gmu.bin",
	.zap_name = "a640_zap.mdt",
	.hwcg = a680_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a680_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
	.disable_tseskip = true,
};

static const struct kgsl_regmap_list a612_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x22222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A6XX_RBBM_CLOCK_DELAY_SP0, 0x00000081},
	{A6XX_RBBM_CLOCK_HYST_SP0, 0x0000F3CF},
--- LINE 1490 ---
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.chipid = 0x06010200,
		.ubwc_mode = 2,
		.mal = 32,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x00080000,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a612_rgmu.bin",
	.zap_name = "a612_zap.mbn",
	.hwcg = a612_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a612_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a616 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A616, 6, 1, 6, ANY_ID),
		.features = ADRENO_PREEMPTION |
--- LINE 1491 ---
		.snapshot_size = SZ_1M,
		.chipid = 0x06010200,
		.ubwc_mode = 2,
		.mal = 32,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x00080000,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a612_rgmu.bin",
	.zap_name = "a612_zap.mbn",
	.hwcg = a612_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a612_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a616 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A616, 6, 1, 6, ANY_ID),
		.features = ADRENO_PREEMPTION |
			ADRENO_CONTENT_PROTECTION | ADRENO_IFPC |
--- LINE 1492 ---
		.chipid = 0x06010200,
		.ubwc_mode = 2,
		.mal = 32,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x00080000,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a612_rgmu.bin",
	.zap_name = "a612_zap.mbn",
	.hwcg = a612_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a612_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a616 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A616, 6, 1, 6, ANY_ID),
		.features = ADRENO_PREEMPTION |
			ADRENO_CONTENT_PROTECTION | ADRENO_IFPC |
			ADRENO_IOCOHERENT,
--- LINE 1518 ---
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 3,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a610 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A610, 6, 1, 0, ANY_ID),
		.features = ADRENO_CONTENT_PROTECTION |
--- LINE 1519 ---
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 3,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a610 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A610, 6, 1, 0, ANY_ID),
		.features = ADRENO_CONTENT_PROTECTION |
			ADRENO_PREEMPTION,
--- LINE 1520 ---
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x0018000,
	.gmu_major = 1,
	.gmu_minor = 3,
	.sqefw_name = "a630_sqe.fw",
	.gmufw_name = "a630_gmu.bin",
	.zap_name = "a615_zap.mdt",
	.hwcg = a615_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a615_hwcg_regs),
	.vbif = a615_gbif_regs,
	.vbif_count = ARRAY_SIZE(a615_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a610 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A610, 6, 1, 0, ANY_ID),
		.features = ADRENO_CONTENT_PROTECTION |
			ADRENO_PREEMPTION,
		.gpudev = &adreno_a6xx_gpudev,
--- LINE 1543 ---
		.perfcounters = &adreno_a6xx_legacy_perfcounters,
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = (SZ_128K + SZ_4K),
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x00080000,
	.sqefw_name = "a630_sqe.fw",
	.zap_name = "a610_zap.mdt",
	.hwcg = a612_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a612_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a611 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A611, 6, 1, 1, ANY_ID),
		.compatible = "qcom,adreno-gpu-a611",
		.features = ADRENO_CONTENT_PROTECTION |
--- LINE 1544 ---
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = (SZ_128K + SZ_4K),
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x00080000,
	.sqefw_name = "a630_sqe.fw",
	.zap_name = "a610_zap.mdt",
	.hwcg = a612_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a612_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a630_protected_regs,
};

static const struct adreno_a6xx_core adreno_gpu_core_a611 = {
	.base = {
		DEFINE_ADRENO_REV(ADRENO_REV_A611, 6, 1, 1, ANY_ID),
		.compatible = "qcom,adreno-gpu-a611",
		.features = ADRENO_CONTENT_PROTECTION |
			ADRENO_PREEMPTION,
--- LINE 1568 ---
		.perfcounters = &adreno_a6xx_legacy_perfcounters,
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = (SZ_128K + SZ_4K),
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x00080000,
	.sqefw_name = "a630_sqe.fw",
	.zap_name = "a610_zap.mbn",
	.hwcg = a612_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a612_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a630_protected_regs,
};

static const struct kgsl_regmap_list a660_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A6XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
	{A6XX_RBBM_CLOCK_HYST_SP0, 0x0000F3CF},
--- LINE 1569 ---
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = (SZ_128K + SZ_4K),
		.bus_width = 32,
		.snapshot_size = SZ_1M,
		.highest_bank_bit = 14,
	},
	.prim_fifo_threshold = 0x00080000,
	.sqefw_name = "a630_sqe.fw",
	.zap_name = "a610_zap.mbn",
	.hwcg = a612_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a612_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a630_protected_regs,
};

static const struct kgsl_regmap_list a660_hwcg_regs[] = {
	{A6XX_RBBM_CLOCK_CNTL_SP0, 0x02222222},
	{A6XX_RBBM_CLOCK_CNTL2_SP0, 0x02222220},
	{A6XX_RBBM_CLOCK_DELAY_SP0, 0x00000080},
	{A6XX_RBBM_CLOCK_HYST_SP0, 0x0000F3CF},
	{A6XX_RBBM_CLOCK_CNTL_TP0, 0x22222222},
--- LINE 1694 ---
		.gmem_size = SZ_1M + SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

--- LINE 1695 ---
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_a660v2 = {
--- LINE 1696 ---
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_a660v2 = {
	.base = {
--- LINE 1727 ---
		.gmem_size = SZ_1M + SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

--- LINE 1728 ---
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_a660_shima = {
--- LINE 1729 ---
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_a660_shima = {
	.base = {
--- LINE 1760 ---
		.gmem_size = SZ_1M + SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

--- LINE 1761 ---
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_a642l = {
--- LINE 1762 ---
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_a642l = {
	.base = {
--- LINE 1792 ---
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00200000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

--- LINE 1793 ---
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00200000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_a643 = {
--- LINE 1794 ---
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00200000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_a643 = {
	.base = {
--- LINE 1835 ---
		),
		.ubwc_mode = 3,
		.mal = 32,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00200000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mbn",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

--- LINE 1836 ---
		.ubwc_mode = 3,
		.mal = 32,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00200000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mbn",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_a662 = {
--- LINE 1837 ---
		.mal = 32,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00200000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a660_gmu.bin",
	.zap_name = "a660_zap.mbn",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_a662 = {
	.base = {
--- LINE 1868 ---
		.gmem_size = SZ_1M + SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a662_gmu.bin",
	.zap_name = "a662_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

--- LINE 1869 ---
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a662_gmu.bin",
	.zap_name = "a662_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_gen6_3_26_0 = {
--- LINE 1870 ---
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a662_gmu.bin",
	.zap_name = "a662_zap.mdt",
	.hwcg = a660_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a660_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

static const struct adreno_a6xx_core adreno_gpu_core_gen6_3_26_0 = {
	.base = {
--- LINE 1898 ---
		.perfcounters = &adreno_a6xx_legacy_perfcounters,
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = (SZ_128K + SZ_4K),
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00080000,
	.sqefw_name = "a630_sqe.fw",
	.zap_name = "gen6_3_26_0_zap.mdt",
	.hwcg = a612_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a612_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
};

extern const struct gen7_snapshot_block_list gen7_0_0_snapshot_block_list;

static const struct kgsl_regmap_list gen7_0_0_gbif_cx_regs[] = {
	{ GEN7_GBIF_QSB_SIDE0, 0x00071620 },
	{ GEN7_GBIF_QSB_SIDE1, 0x00071620 },
--- LINE 1899 ---
		.uche_gmem_alignment = SZ_1M,
		.gmem_size = (SZ_128K + SZ_4K),
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.prim_fifo_threshold = 0x00080000,
	.sqefw_name = "a630_sqe.fw",
	.zap_name = "gen6_3_26_0_zap.mdt",
	.hwcg = a612_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a612_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3fffff,
	.protected_regs = a630_protected_regs,
};

extern const struct gen7_snapshot_block_list gen7_0_0_snapshot_block_list;

static const struct kgsl_regmap_list gen7_0_0_gbif_cx_regs[] = {
	{ GEN7_GBIF_QSB_SIDE0, 0x00071620 },
	{ GEN7_GBIF_QSB_SIDE1, 0x00071620 },
	{ GEN7_GBIF_QSB_SIDE2, 0x00071620 },
--- LINE 1997 ---
			{ 236, 1 },
			{ 178, 2 },
			{ 142, 3 },
		),
		.ubwc_mode = 1,
		.mal = 64,
	},
	.prim_fifo_threshold = 0x0000c000,
	.sqefw_name = "a702_sqe.fw",
	.zap_name = "a702_zap.mdt",
	.hwcg = a702_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a702_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
};

/* SMMU aperture registers: GC to context bank 0, LPAC disabled */
static const struct kgsl_regmap_list a704_smmu_aperture_regs[] = {
	{ 0x0, 0x000a8000 }, /* GC: CB0 */
	{ 0x2, 0x00000000 }, /* CTRL: GC only */
};
--- LINE 1998 ---
			{ 178, 2 },
			{ 142, 3 },
		),
		.ubwc_mode = 1,
		.mal = 64,
	},
	.prim_fifo_threshold = 0x0000c000,
	.sqefw_name = "a702_sqe.fw",
	.zap_name = "a702_zap.mdt",
	.hwcg = a702_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a702_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
};

/* SMMU aperture registers: GC to context bank 0, LPAC disabled */
static const struct kgsl_regmap_list a704_smmu_aperture_regs[] = {
	{ 0x0, 0x000a8000 }, /* GC: CB0 */
	{ 0x2, 0x00000000 }, /* CTRL: GC only */
};

--- LINE 2032 ---
		.chipid = 0x07000400,
		.ubwc_mode = 2,
		.mal = 32,
		.gpu_model = "Adreno704v1",
		.smmu_aperture = a704_smmu_aperture_regs,
		.smmu_aperture_count = ARRAY_SIZE(a704_smmu_aperture_regs),
	},
	.prim_fifo_threshold = 0x0000c000,
	.sqefw_name = "a702_sqe.fw",
	.zap_name = "a704_zap.mbn",
	.hwcg = a702_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a702_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
};

static const struct kgsl_regmap_list gen7_0_0_hwcg_regs[] = {
	{ GEN7_RBBM_CLOCK_CNTL_SP0, 0x02222222 },
	{ GEN7_RBBM_CLOCK_CNTL2_SP0, 0x02022222 },
	{ GEN7_RBBM_CLOCK_HYST_SP0, 0x0000f3cf },
	{ GEN7_RBBM_CLOCK_DELAY_SP0, 0x00000080 },
--- LINE 2033 ---
		.ubwc_mode = 2,
		.mal = 32,
		.gpu_model = "Adreno704v1",
		.smmu_aperture = a704_smmu_aperture_regs,
		.smmu_aperture_count = ARRAY_SIZE(a704_smmu_aperture_regs),
	},
	.prim_fifo_threshold = 0x0000c000,
	.sqefw_name = "a702_sqe.fw",
	.zap_name = "a704_zap.mbn",
	.hwcg = a702_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a702_hwcg_regs),
	.vbif = a640_vbif_regs,
	.vbif_count = ARRAY_SIZE(a640_vbif_regs),
	.hang_detect_cycles = 0x3ffff,
	.protected_regs = a620_protected_regs,
};

static const struct kgsl_regmap_list gen7_0_0_hwcg_regs[] = {
	{ GEN7_RBBM_CLOCK_CNTL_SP0, 0x02222222 },
	{ GEN7_RBBM_CLOCK_CNTL2_SP0, 0x02022222 },
	{ GEN7_RBBM_CLOCK_HYST_SP0, 0x0000f3cf },
	{ GEN7_RBBM_CLOCK_DELAY_SP0, 0x00000080 },
	{ GEN7_RBBM_CLOCK_CNTL_TP0, 0x22222220 },
--- LINE 2173 ---
		.perfcounters = &adreno_gen7_perfcounters,
		.uche_gmem_alignment = 0,
		.gmem_size = SZ_2M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 0),
	.sqefw_name = "a730_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.gmufw_bak_name = "c500_gmu.bin",
	.zap_name = "a730_zap.mdt",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_0_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (2860 * SZ_1K),
--- LINE 2174 ---
		.uche_gmem_alignment = 0,
		.gmem_size = SZ_2M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 0),
	.sqefw_name = "a730_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.gmufw_bak_name = "c500_gmu.bin",
	.zap_name = "a730_zap.mdt",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_0_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (2860 * SZ_1K),
	.fast_bus_hint = true,
--- LINE 2176 ---
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 0),
	.sqefw_name = "a730_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.gmufw_bak_name = "c500_gmu.bin",
	.zap_name = "a730_zap.mdt",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_0_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (2860 * SZ_1K),
	.fast_bus_hint = true,
};

--- LINE 2209 ---
		.perfcounters = &adreno_gen7_perfcounters,
		.uche_gmem_alignment = 0,
		.gmem_size = SZ_2M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 0),
	.sqefw_name = "a730_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.gmufw_bak_name = "c500_gmu.bin",
	.zap_name = "a730_zap.mdt",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_0_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (2860 * SZ_1K),
--- LINE 2210 ---
		.uche_gmem_alignment = 0,
		.gmem_size = SZ_2M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 0),
	.sqefw_name = "a730_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.gmufw_bak_name = "c500_gmu.bin",
	.zap_name = "a730_zap.mdt",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_0_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (2860 * SZ_1K),
	.fast_bus_hint = true,
--- LINE 2212 ---
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 0),
	.sqefw_name = "a730_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.gmufw_bak_name = "c500_gmu.bin",
	.zap_name = "a730_zap.mdt",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_0_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (2860 * SZ_1K),
	.fast_bus_hint = true,
};

--- LINE 2429 ---
		.perfcounters = &adreno_gen7_2_0_perfcounters,
		.uche_gmem_alignment = SZ_16M,
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 1, 0),
	.sqefw_name = "a740_sqe.fw",
	.gmufw_name = "gmu_gen70200.bin",
	.zap_name = "a740_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_2_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_2_0_snapshot_block_list,
	.bcl_data = 1,
	.preempt_level = 1,
--- LINE 2430 ---
		.uche_gmem_alignment = SZ_16M,
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 1, 0),
	.sqefw_name = "a740_sqe.fw",
	.gmufw_name = "gmu_gen70200.bin",
	.zap_name = "a740_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_2_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_2_0_snapshot_block_list,
	.bcl_data = 1,
	.preempt_level = 1,
	.ctxt_record_size = (4192 * SZ_1K),
--- LINE 2431 ---
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 1, 0),
	.sqefw_name = "a740_sqe.fw",
	.gmufw_name = "gmu_gen70200.bin",
	.zap_name = "a740_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_2_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_2_0_snapshot_block_list,
	.bcl_data = 1,
	.preempt_level = 1,
	.ctxt_record_size = (4192 * SZ_1K),
	.fast_bus_hint = true,
--- LINE 2466 ---
		.perfcounters = &adreno_gen7_2_0_perfcounters,
		.uche_gmem_alignment = SZ_16M,
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 1, 0),
	.sqefw_name = "a740_sqe.fw",
	.gmufw_name = "gmu_gen70200.bin",
	.zap_name = "a740_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_2_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_2_0_snapshot_block_list,
	.bcl_data = 1,
	.preempt_level = 1,
--- LINE 2467 ---
		.uche_gmem_alignment = SZ_16M,
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 1, 0),
	.sqefw_name = "a740_sqe.fw",
	.gmufw_name = "gmu_gen70200.bin",
	.zap_name = "a740_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_2_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_2_0_snapshot_block_list,
	.bcl_data = 1,
	.preempt_level = 1,
	.ctxt_record_size = (4192 * SZ_1K),
--- LINE 2468 ---
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 1, 0),
	.sqefw_name = "a740_sqe.fw",
	.gmufw_name = "gmu_gen70200.bin",
	.zap_name = "a740_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_2_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_2_0_snapshot_block_list,
	.bcl_data = 1,
	.preempt_level = 1,
	.ctxt_record_size = (4192 * SZ_1K),
	.fast_bus_hint = true,
--- LINE 2502 ---
		.perfcounters = &adreno_gen7_no_cb_perfcounters,
		.uche_gmem_alignment = SZ_16M,
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 0),
	.sqefw_name = "a710_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.zap_name = "a710_zap.mdt",
	.hwcg = gen7_3_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_3_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_3_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (862 * SZ_1K),
};
--- LINE 2503 ---
		.uche_gmem_alignment = SZ_16M,
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 0),
	.sqefw_name = "a710_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.zap_name = "a710_zap.mdt",
	.hwcg = gen7_3_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_3_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_3_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (862 * SZ_1K),
};

--- LINE 2504 ---
		.gmem_size = SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.highest_bank_bit = 15,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 0),
	.sqefw_name = "a710_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.zap_name = "a710_zap.mdt",
	.hwcg = gen7_3_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_3_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_3_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (862 * SZ_1K),
};

static const struct adreno_gen7_core adreno_gpu_core_gen7_4_0 = {
--- LINE 2536 ---
		.perfcounters = &adreno_gen7_perfcounters,
		.uche_gmem_alignment = 0,
		.gmem_size = SZ_2M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 7),
	.sqefw_name = "a730_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.gmufw_bak_name = "c500_gmu.bin",
	.zap_name = "a730_zap.mdt",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_0_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (2860 * SZ_1K),
--- LINE 2537 ---
		.uche_gmem_alignment = 0,
		.gmem_size = SZ_2M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 7),
	.sqefw_name = "a730_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.gmufw_bak_name = "c500_gmu.bin",
	.zap_name = "a730_zap.mdt",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_0_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (2860 * SZ_1K),
	.fast_bus_hint = true,
--- LINE 2539 ---
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 0, 7),
	.sqefw_name = "a730_sqe.fw",
	.gmufw_name = "gmu_gen70000.bin",
	.gmufw_bak_name = "c500_gmu.bin",
	.zap_name = "a730_zap.mdt",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_0_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (2860 * SZ_1K),
	.fast_bus_hint = true,
};

--- LINE 2590 ---
			{ 232, 3 },
			{ 146, 4 },
		),
		.ubwc_mode = 4,
		.mal = 32,
		.highest_bank_bit = 17,
		.gpu_model = "Adreno X1-85",
	},
	.sqefw_name = "gen70500_sqe.fw",
	.gmufw_name = "gen70500_gmu.bin",
	.zap_name = "gen70500_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_5_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (4192 * SZ_1K),
--- LINE 2591 ---
			{ 146, 4 },
		),
		.ubwc_mode = 4,
		.mal = 32,
		.highest_bank_bit = 17,
		.gpu_model = "Adreno X1-85",
	},
	.sqefw_name = "gen70500_sqe.fw",
	.gmufw_name = "gen70500_gmu.bin",
	.zap_name = "gen70500_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_5_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (4192 * SZ_1K),
	.fast_bus_hint = true,
--- LINE 2592 ---
		),
		.ubwc_mode = 4,
		.mal = 32,
		.highest_bank_bit = 17,
		.gpu_model = "Adreno X1-85",
	},
	.sqefw_name = "gen70500_sqe.fw",
	.gmufw_name = "gen70500_gmu.bin",
	.zap_name = "gen70500_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_5_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = (4192 * SZ_1K),
	.fast_bus_hint = true,
};
--- LINE 2626 ---
		.perfcounters = &adreno_gen7_2_0_perfcounters,
		.uche_gmem_alignment = SZ_16M,
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 1, 9),
	.sqefw_name = "a740v3_sqe.fw",
	.gmufw_name = "gmu_gen70200.bin",
	.zap_name = "a740v3_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_2_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.bcl_data = 1,
	.gen7_snapshot_block_list = &gen7_6_0_snapshot_block_list,
	.qos_value = gen7_6_0_gbif_client_qos_values,
--- LINE 2627 ---
		.uche_gmem_alignment = SZ_16M,
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 1, 9),
	.sqefw_name = "a740v3_sqe.fw",
	.gmufw_name = "gmu_gen70200.bin",
	.zap_name = "a740v3_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_2_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.bcl_data = 1,
	.gen7_snapshot_block_list = &gen7_6_0_snapshot_block_list,
	.qos_value = gen7_6_0_gbif_client_qos_values,
	.preempt_level = 1,
--- LINE 2628 ---
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 1, 9),
	.sqefw_name = "a740v3_sqe.fw",
	.gmufw_name = "gmu_gen70200.bin",
	.zap_name = "a740v3_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_2_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.bcl_data = 1,
	.gen7_snapshot_block_list = &gen7_6_0_snapshot_block_list,
	.qos_value = gen7_6_0_gbif_client_qos_values,
	.preempt_level = 1,
	.ctxt_record_size = (4192 * SZ_1K),
--- LINE 2720 ---
		.uche_gmem_alignment = SZ_16M,
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen70900_aqe.fw",
	.sqefw_name = "gen70900_sqe.fw",
	.gmufw_name = "gmu_gen70900.bin",
	.zap_name = "gen70900_zap.mbn",
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_9_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_9_0_snapshot_block_list,
	.bcl_data = 1,
	.acv_perfmode_vote = BIT(2),
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.ctxt_record_size = (4208 * SZ_1K),
--- LINE 2721 ---
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen70900_aqe.fw",
	.sqefw_name = "gen70900_sqe.fw",
	.gmufw_name = "gmu_gen70900.bin",
	.zap_name = "gen70900_zap.mbn",
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_9_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_9_0_snapshot_block_list,
	.bcl_data = 1,
	.acv_perfmode_vote = BIT(2),
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.ctxt_record_size = (4208 * SZ_1K),
	.preempt_level = 1,
--- LINE 2722 ---
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen70900_aqe.fw",
	.sqefw_name = "gen70900_sqe.fw",
	.gmufw_name = "gmu_gen70900.bin",
	.zap_name = "gen70900_zap.mbn",
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_9_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_9_0_snapshot_block_list,
	.bcl_data = 1,
	.acv_perfmode_vote = BIT(2),
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.ctxt_record_size = (4208 * SZ_1K),
	.preempt_level = 1,
	.fast_bus_hint = true,
--- LINE 2759 ---
		.uche_gmem_alignment = SZ_16M,
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen70900_aqe.fw",
	.sqefw_name = "gen70900_sqe.fw",
	.gmufw_name = "gmu_gen70900.bin",
	.zap_name = "gen70900_zap.mbn",
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_9_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_9_0_snapshot_block_list,
	.bcl_data = 1,
	.acv_perfmode_vote = BIT(2),
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.ctxt_record_size = (4208 * SZ_1K),
--- LINE 2760 ---
		.gmem_size = 3 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen70900_aqe.fw",
	.sqefw_name = "gen70900_sqe.fw",
	.gmufw_name = "gmu_gen70900.bin",
	.zap_name = "gen70900_zap.mbn",
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_9_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_9_0_snapshot_block_list,
	.bcl_data = 1,
	.acv_perfmode_vote = BIT(2),
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.ctxt_record_size = (4208 * SZ_1K),
	.preempt_level = 1,
--- LINE 2761 ---
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen70900_aqe.fw",
	.sqefw_name = "gen70900_sqe.fw",
	.gmufw_name = "gmu_gen70900.bin",
	.zap_name = "gen70900_zap.mbn",
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_9_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_9_0_snapshot_block_list,
	.bcl_data = 1,
	.acv_perfmode_vote = BIT(2),
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.ctxt_record_size = (4208 * SZ_1K),
	.preempt_level = 1,
	.fast_bus_hint = true,
--- LINE 2804 ---
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
		.chipid = 0x43051701,
		.smmu_aperture = gen7_13_0_smmu_aperture_regs,
		.smmu_aperture_count = ARRAY_SIZE(gen7_13_0_smmu_aperture_regs),
	},
	.sqefw_name = "gen71300_sqe.fw",
	.gmufw_name = "gen71300_gmu.bin",
	.zap_name = "gen71300_zap.mbn",
	.gmu_chipid = 0x70D0000,
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_9_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_13_0_snapshot_block_list,
	.ctxt_record_size = (4208 * SZ_1K),
	.preempt_level = 1,
};
--- LINE 2805 ---
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
		.chipid = 0x43051701,
		.smmu_aperture = gen7_13_0_smmu_aperture_regs,
		.smmu_aperture_count = ARRAY_SIZE(gen7_13_0_smmu_aperture_regs),
	},
	.sqefw_name = "gen71300_sqe.fw",
	.gmufw_name = "gen71300_gmu.bin",
	.zap_name = "gen71300_zap.mbn",
	.gmu_chipid = 0x70D0000,
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_9_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_13_0_snapshot_block_list,
	.ctxt_record_size = (4208 * SZ_1K),
	.preempt_level = 1,
};

--- LINE 2806 ---
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
		.chipid = 0x43051701,
		.smmu_aperture = gen7_13_0_smmu_aperture_regs,
		.smmu_aperture_count = ARRAY_SIZE(gen7_13_0_smmu_aperture_regs),
	},
	.sqefw_name = "gen71300_sqe.fw",
	.gmufw_name = "gen71300_gmu.bin",
	.zap_name = "gen71300_zap.mbn",
	.gmu_chipid = 0x70D0000,
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_9_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_13_0_snapshot_block_list,
	.ctxt_record_size = (4208 * SZ_1K),
	.preempt_level = 1,
};

extern const struct gen7_snapshot_block_list gen7_14_0_snapshot_block_list;
--- LINE 2837 ---
		.gpudev = &adreno_gen7_gmu_gpudev.base,
		.perfcounters = &adreno_gen7_no_cb_perfcounters,
		.uche_gmem_alignment = 0,
		.gmem_size = SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 15,
	},
	.sqefw_name = "gen70e00_sqe.fw",
	.gmufw_name = "gmu_gen70e00.bin",
	.zap_name = "gen70e00_zap.mbn",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_14_0_snapshot_block_list,
	.preempt_level = 1,
	.fast_bus_hint = false,
};
--- LINE 2838 ---
		.perfcounters = &adreno_gen7_no_cb_perfcounters,
		.uche_gmem_alignment = 0,
		.gmem_size = SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 15,
	},
	.sqefw_name = "gen70e00_sqe.fw",
	.gmufw_name = "gmu_gen70e00.bin",
	.zap_name = "gen70e00_zap.mbn",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_14_0_snapshot_block_list,
	.preempt_level = 1,
	.fast_bus_hint = false,
};

--- LINE 2839 ---
		.uche_gmem_alignment = 0,
		.gmem_size = SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.highest_bank_bit = 15,
	},
	.sqefw_name = "gen70e00_sqe.fw",
	.gmufw_name = "gmu_gen70e00.bin",
	.zap_name = "gen70e00_zap.mbn",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_14_0_snapshot_block_list,
	.preempt_level = 1,
	.fast_bus_hint = false,
};

extern const struct gen7_snapshot_block_list gen7_11_0_snapshot_block_list;
--- LINE 2873 ---
		.uche_gmem_alignment = SZ_16M,
		.gmem_size = SZ_1M + SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 5, 0),
	.sqefw_name = "gen71100_sqe.fw",
	.gmufw_name = "gen71100_gmu.bin",
	.zap_name = "gen71100_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_11_0_snapshot_block_list,
	.preempt_level = 1,
	.fast_bus_hint = true,
--- LINE 2874 ---
		.gmem_size = SZ_1M + SZ_512K,
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 5, 0),
	.sqefw_name = "gen71100_sqe.fw",
	.gmufw_name = "gen71100_gmu.bin",
	.zap_name = "gen71100_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_11_0_snapshot_block_list,
	.preempt_level = 1,
	.fast_bus_hint = true,
};
--- LINE 2875 ---
		.bus_width = 32,
		.snapshot_size = SZ_4M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.gmu_fw_version = GMU_VERSION(4, 5, 0),
	.sqefw_name = "gen71100_sqe.fw",
	.gmufw_name = "gen71100_gmu.bin",
	.zap_name = "gen71100_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_11_0_snapshot_block_list,
	.preempt_level = 1,
	.fast_bus_hint = true,
};

--- LINE 2919 ---
			{ 263, 2 },
			{ 233, 3 },
			{ 141, 4 },
		),
		.ubwc_mode = 4,
		.mal = 32,
		.gpu_model = "Adreno X1-45",
	},
	.sqefw_name = "gen71500_sqe.fw",
	.gmufw_name = "gen71500_gmu.bin",
	.zap_name = "gen71500_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_15_0_snapshot_block_list,
	.preempt_level = 1,
	.fast_bus_hint = true,
--- LINE 2920 ---
			{ 233, 3 },
			{ 141, 4 },
		),
		.ubwc_mode = 4,
		.mal = 32,
		.gpu_model = "Adreno X1-45",
	},
	.sqefw_name = "gen71500_sqe.fw",
	.gmufw_name = "gen71500_gmu.bin",
	.zap_name = "gen71500_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_15_0_snapshot_block_list,
	.preempt_level = 1,
	.fast_bus_hint = true,
};
--- LINE 2921 ---
			{ 141, 4 },
		),
		.ubwc_mode = 4,
		.mal = 32,
		.gpu_model = "Adreno X1-45",
	},
	.sqefw_name = "gen71500_sqe.fw",
	.gmufw_name = "gen71500_gmu.bin",
	.zap_name = "gen71500_zap.mbn",
	.hwcg = gen7_2_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_2_0_hwcg_regs),
	.ao_hwcg = gen7_9_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_9_0_ao_hwcg_regs),
	.gbif = gen7_2_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_2_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_2_0_protected_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen7_snapshot_block_list = &gen7_15_0_snapshot_block_list,
	.preempt_level = 1,
	.fast_bus_hint = true,
};

--- LINE 2956 ---
		.gmem_size = SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.chipid = 0x43020100,
		.ubwc_mode = 5,
		.mal = 32,
		.highest_bank_bit = 15,
	},
	.sqefw_name = "gen70e00_sqe.fw",
	.gmufw_name = "gen71700_gmu.bin",
	.zap_name = "gen70e00_zap.mbn",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_17_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = 1536 * 1024
};
--- LINE 2957 ---
		.bus_width = 32,
		.snapshot_size = SZ_2M,
		.chipid = 0x43020100,
		.ubwc_mode = 5,
		.mal = 32,
		.highest_bank_bit = 15,
	},
	.sqefw_name = "gen70e00_sqe.fw",
	.gmufw_name = "gen71700_gmu.bin",
	.zap_name = "gen70e00_zap.mbn",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_17_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = 1536 * 1024
};

--- LINE 2958 ---
		.snapshot_size = SZ_2M,
		.chipid = 0x43020100,
		.ubwc_mode = 5,
		.mal = 32,
		.highest_bank_bit = 15,
	},
	.sqefw_name = "gen70e00_sqe.fw",
	.gmufw_name = "gen71700_gmu.bin",
	.zap_name = "gen70e00_zap.mbn",
	.hwcg = gen7_0_0_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(gen7_0_0_hwcg_regs),
	.ao_hwcg = gen7_0_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen7_0_0_ao_hwcg_regs),
	.gbif = gen7_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen7_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen7_0_0_protected_regs,
	.gen7_snapshot_block_list = &gen7_17_0_snapshot_block_list,
	.preempt_level = 1,
	.ctxt_record_size = 1536 * 1024
};

static const struct kgsl_regmap_list a663_hwcg_regs[] = {
--- LINE 3053 ---
		),
		.ubwc_mode = 4,
		.mal = 32,
		.highest_bank_bit = 13,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a663_gmu.bin",
	.zap_name = "a663_zap.mbn",
	.hwcg = a663_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a663_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

--- LINE 3054 ---
		.ubwc_mode = 4,
		.mal = 32,
		.highest_bank_bit = 13,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a663_gmu.bin",
	.zap_name = "a663_zap.mbn",
	.hwcg = a663_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a663_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

extern const struct gen8_snapshot_block_list gen8_0_0_snapshot_block_list;
--- LINE 3055 ---
		.mal = 32,
		.highest_bank_bit = 13,
	},
	.prim_fifo_threshold = 0x00300000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a660_sqe.fw",
	.gmufw_name = "a663_gmu.bin",
	.zap_name = "a663_zap.mbn",
	.hwcg = a663_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a663_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xcfffff,
	.veto_fal10 = true,
	.protected_regs = a660_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

extern const struct gen8_snapshot_block_list gen8_0_0_snapshot_block_list;

--- LINE 3278 ---
		.uche_gmem_alignment = SZ_64M,
		.gmem_size = 12 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80000_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_0_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_0_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = 1,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
--- LINE 3279 ---
		.gmem_size = 12 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80000_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_0_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_0_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = 1,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
--- LINE 3280 ---
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80000_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_0_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_0_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = 1,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.ctxt_record_size = (13536 * SZ_1K),
--- LINE 3336 ---
			{ 221, 4 },
			{ 190, 5 },
		),
		.ubwc_mode = 5,
		.mal = 32,
		.gpu_model = "Adreno830",
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80000_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_0_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_0_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = 1,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
--- LINE 3337 ---
			{ 190, 5 },
		),
		.ubwc_mode = 5,
		.mal = 32,
		.gpu_model = "Adreno830",
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80000_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_0_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_0_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = 1,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
--- LINE 3338 ---
		),
		.ubwc_mode = 5,
		.mal = 32,
		.gpu_model = "Adreno830",
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80000_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_0_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_0_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = 1,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.ctxt_record_size = (13536 * SZ_1K),
--- LINE 3633 ---
		.uche_gmem_alignment = SZ_64M,
		.gmem_size = 18 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80200_aqe.fw",
	.sqefw_name = "gen80200_sqe.fw",
	.gmufw_name = "gen80200_gmu.bin",
	.zap_name = "gen80200_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_2_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_2_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
--- LINE 3634 ---
		.gmem_size = 18 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80200_aqe.fw",
	.sqefw_name = "gen80200_sqe.fw",
	.gmufw_name = "gen80200_gmu.bin",
	.zap_name = "gen80200_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_2_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_2_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
--- LINE 3635 ---
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80200_aqe.fw",
	.sqefw_name = "gen80200_sqe.fw",
	.gmufw_name = "gen80200_gmu.bin",
	.zap_name = "gen80200_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_2_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_2_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
--- LINE 3691 ---
			{ 252, 2 },
			{ 221, 3 },
		),
		.ubwc_mode = 6,
		.mal = 32,
		.gpu_model = "Adreno840",
	},
	.aqefw_name = "gen80200_aqe.fw",
	.sqefw_name = "gen80200_sqe.fw",
	.gmufw_name = "gen80200_gmu.bin",
	.zap_name = "gen80200_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_2_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_2_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
--- LINE 3692 ---
			{ 221, 3 },
		),
		.ubwc_mode = 6,
		.mal = 32,
		.gpu_model = "Adreno840",
	},
	.aqefw_name = "gen80200_aqe.fw",
	.sqefw_name = "gen80200_sqe.fw",
	.gmufw_name = "gen80200_gmu.bin",
	.zap_name = "gen80200_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_2_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_2_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
--- LINE 3693 ---
		),
		.ubwc_mode = 6,
		.mal = 32,
		.gpu_model = "Adreno840",
	},
	.aqefw_name = "gen80200_aqe.fw",
	.sqefw_name = "gen80200_sqe.fw",
	.gmufw_name = "gen80200_gmu.bin",
	.zap_name = "gen80200_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_2_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_2_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
--- LINE 3851 ---
			{ 284, 3 },
		),
		.ubwc_mode = 5,
		.mal = 32,
		.highest_bank_bit = 16,
		.gpu_model = "Adreno X2-90",
	},
	.aqefw_name = "gen80100_aqe.fw",
	.sqefw_name = "gen80100_sqe.fw",
	.gmufw_name = "gen80100_gmu.bin",
	.zap_name = "gen80100_zap.mbn",
	.ao_hwcg = gen8_1_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_1_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_1_0_protected_regs,
	.nonctxt_regs = gen8_1_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_1_0_snapshot_block_list,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
--- LINE 3852 ---
		),
		.ubwc_mode = 5,
		.mal = 32,
		.highest_bank_bit = 16,
		.gpu_model = "Adreno X2-90",
	},
	.aqefw_name = "gen80100_aqe.fw",
	.sqefw_name = "gen80100_sqe.fw",
	.gmufw_name = "gen80100_gmu.bin",
	.zap_name = "gen80100_zap.mbn",
	.ao_hwcg = gen8_1_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_1_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_1_0_protected_regs,
	.nonctxt_regs = gen8_1_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_1_0_snapshot_block_list,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.ctxt_record_size = (23088 * SZ_1K),
--- LINE 3853 ---
		.ubwc_mode = 5,
		.mal = 32,
		.highest_bank_bit = 16,
		.gpu_model = "Adreno X2-90",
	},
	.aqefw_name = "gen80100_aqe.fw",
	.sqefw_name = "gen80100_sqe.fw",
	.gmufw_name = "gen80100_gmu.bin",
	.zap_name = "gen80100_zap.mbn",
	.ao_hwcg = gen8_1_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_1_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_1_0_protected_regs,
	.nonctxt_regs = gen8_1_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_1_0_snapshot_block_list,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.ctxt_record_size = (23088 * SZ_1K),
	.preempt_level = 1,
--- LINE 3891 ---
		.uche_gmem_alignment = SZ_64M,
		.gmem_size = 18 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80200_aqe.fw",
	.sqefw_name = "gen80200_sqe.fw",
	.gmufw_name = "gen80200_gmu.bin",
	.zap_name = "gen80200_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_2_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_2_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
--- LINE 3892 ---
		.gmem_size = 18 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80200_aqe.fw",
	.sqefw_name = "gen80200_sqe.fw",
	.gmufw_name = "gen80200_gmu.bin",
	.zap_name = "gen80200_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_2_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_2_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
--- LINE 3893 ---
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80200_aqe.fw",
	.sqefw_name = "gen80200_sqe.fw",
	.gmufw_name = "gen80200_gmu.bin",
	.zap_name = "gen80200_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_2_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_2_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
--- LINE 4004 ---
		.uche_gmem_alignment = SZ_64M,
		.gmem_size = 12 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80000_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_4_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_0_0_snapshot_block_list,
	.qos_value = gen8_4_0_gbif_client_qos_values,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.bcl_data = 1,
--- LINE 4005 ---
		.gmem_size = 12 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80000_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_4_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_0_0_snapshot_block_list,
	.qos_value = gen8_4_0_gbif_client_qos_values,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.bcl_data = 1,
	.preempt_level = 1,
--- LINE 4006 ---
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80000_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_4_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_0_0_snapshot_block_list,
	.qos_value = gen8_4_0_gbif_client_qos_values,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.bcl_data = 1,
	.preempt_level = 1,
	.ctxt_record_size = (13536 * SZ_1K),
--- LINE 4105 ---
		.perfcounters = &adreno_gen8_perfcounters,
		.uche_gmem_alignment = SZ_64M,
		.gmem_size = (SZ_512K + SZ_64K),
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 2,
		.highest_bank_bit = 15,
	},
	.sqefw_name = "gen80300_sqe.fw",
	.gmufw_name = "gen80300_gmu.bin",
	.zap_name = "gen80300_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_3_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_3_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs, /* Reuse the protected regs list from Gen8_0_0 */
	.nonctxt_regs = gen8_3_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_3_0_snapshot_block_list,
	.ctxt_record_size = (4558 * SZ_1K),
	.preempt_level = 1,
};
--- LINE 4106 ---
		.uche_gmem_alignment = SZ_64M,
		.gmem_size = (SZ_512K + SZ_64K),
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 2,
		.highest_bank_bit = 15,
	},
	.sqefw_name = "gen80300_sqe.fw",
	.gmufw_name = "gen80300_gmu.bin",
	.zap_name = "gen80300_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_3_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_3_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs, /* Reuse the protected regs list from Gen8_0_0 */
	.nonctxt_regs = gen8_3_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_3_0_snapshot_block_list,
	.ctxt_record_size = (4558 * SZ_1K),
	.preempt_level = 1,
};

--- LINE 4107 ---
		.gmem_size = (SZ_512K + SZ_64K),
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 2,
		.highest_bank_bit = 15,
	},
	.sqefw_name = "gen80300_sqe.fw",
	.gmufw_name = "gen80300_gmu.bin",
	.zap_name = "gen80300_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_3_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_3_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs, /* Reuse the protected regs list from Gen8_0_0 */
	.nonctxt_regs = gen8_3_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_3_0_snapshot_block_list,
	.ctxt_record_size = (4558 * SZ_1K),
	.preempt_level = 1,
};

/* GEN8_6_0 noncontext register list */
--- LINE 4206 ---
		.uche_gmem_alignment = SZ_64M,
		.gmem_size = (SZ_2M + SZ_256K + SZ_128K),
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80600_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_3_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_3_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_6_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_6_0_snapshot_block_list,
	.noc_timeout_us = 6800, /* 6.8 msec */
	.ctxt_record_size = (3372 * SZ_1K),
	.preempt_level = 1,
--- LINE 4207 ---
		.gmem_size = (SZ_2M + SZ_256K + SZ_128K),
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80600_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_3_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_3_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_6_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_6_0_snapshot_block_list,
	.noc_timeout_us = 6800, /* 6.8 msec */
	.ctxt_record_size = (3372 * SZ_1K),
	.preempt_level = 1,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
--- LINE 4208 ---
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80000_aqe.fw",
	.sqefw_name = "gen80000_sqe.fw",
	.gmufw_name = "gen80600_gmu.bin",
	.zap_name = "gen80000_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_3_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_3_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs,
	.nonctxt_regs = gen8_6_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_6_0_snapshot_block_list,
	.noc_timeout_us = 6800, /* 6.8 msec */
	.ctxt_record_size = (3372 * SZ_1K),
	.preempt_level = 1,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.bcl_data = 1,
--- LINE 4242 ---
		.perfcounters = &adreno_gen8_perfcounters,
		.uche_gmem_alignment = SZ_64M,
		.gmem_size = (SZ_512K + SZ_64K),
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 1,
		.highest_bank_bit = 14,
	},
	.sqefw_name = "gen80300_sqe.fw",
	.gmufw_name = "gen80800_gmu.bin",
	.zap_name = "gen80300_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_8_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_8_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs, /* Reuse the protected regs list from Gen8_0_0 */
	.nonctxt_regs = gen8_3_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_3_0_snapshot_block_list,
	.ctxt_record_size = (4558 * SZ_1K),
	.preempt_level = 1,
	.noc_timeout_us = 3410, /* 3.41 msec */
--- LINE 4243 ---
		.uche_gmem_alignment = SZ_64M,
		.gmem_size = (SZ_512K + SZ_64K),
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 1,
		.highest_bank_bit = 14,
	},
	.sqefw_name = "gen80300_sqe.fw",
	.gmufw_name = "gen80800_gmu.bin",
	.zap_name = "gen80300_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_8_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_8_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs, /* Reuse the protected regs list from Gen8_0_0 */
	.nonctxt_regs = gen8_3_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_3_0_snapshot_block_list,
	.ctxt_record_size = (4558 * SZ_1K),
	.preempt_level = 1,
	.noc_timeout_us = 3410, /* 3.41 msec */
	.bcl_data = 1,
--- LINE 4244 ---
		.gmem_size = (SZ_512K + SZ_64K),
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 1,
		.highest_bank_bit = 14,
	},
	.sqefw_name = "gen80300_sqe.fw",
	.gmufw_name = "gen80800_gmu.bin",
	.zap_name = "gen80300_zap.mbn",
	.ao_hwcg = gen8_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_ao_hwcg_regs),
	.gbif = gen8_8_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_8_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_0_0_protected_regs, /* Reuse the protected regs list from Gen8_0_0 */
	.nonctxt_regs = gen8_3_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_3_0_snapshot_block_list,
	.ctxt_record_size = (4558 * SZ_1K),
	.preempt_level = 1,
	.noc_timeout_us = 3410, /* 3.41 msec */
	.bcl_data = 1,
};
--- LINE 4342 ---
		.uche_gmem_alignment = SZ_64M,
		.gmem_size = 2432 * SZ_1K,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80900_aqe.fw",
	.sqefw_name = "gen80900_sqe.fw",
	.gmufw_name = "gen80900_gmu.bin",
	.zap_name = "gen80900_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_9_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_9_0_snapshot_block_list,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
--- LINE 4343 ---
		.gmem_size = 2432 * SZ_1K,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80900_aqe.fw",
	.sqefw_name = "gen80900_sqe.fw",
	.gmufw_name = "gen80900_gmu.bin",
	.zap_name = "gen80900_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_9_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_9_0_snapshot_block_list,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
--- LINE 4344 ---
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen80900_aqe.fw",
	.sqefw_name = "gen80900_sqe.fw",
	.gmufw_name = "gen80900_gmu.bin",
	.zap_name = "gen80900_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_2_0_protected_regs,
	.nonctxt_regs = gen8_9_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.gen8_snapshot_block_list = &gen8_9_0_snapshot_block_list,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
	.ctxt_record_size = (3708 * SZ_1K),
--- LINE 4389 ---
		),
		.ubwc_mode = 4,
		.mal = 32,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a623_gmu.bin",
	.zap_name = "a623_zap.mbn",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xc3ffff,
	.veto_fal10 = true,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

--- LINE 4390 ---
		.ubwc_mode = 4,
		.mal = 32,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a623_gmu.bin",
	.zap_name = "a623_zap.mbn",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xc3ffff,
	.veto_fal10 = true,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

extern const struct gen8_snapshot_block_list gen8_10_0_snapshot_block_list;
--- LINE 4391 ---
		.mal = 32,
		.highest_bank_bit = 16,
	},
	.prim_fifo_threshold = 0x0010000,
	.gmu_major = 2,
	.gmu_minor = 0,
	.sqefw_name = "a650_sqe.fw",
	.gmufw_name = "a623_gmu.bin",
	.zap_name = "a623_zap.mbn",
	.hwcg = a620_hwcg_regs,
	.hwcg_count = ARRAY_SIZE(a620_hwcg_regs),
	.vbif = a650_gbif_regs,
	.vbif_count = ARRAY_SIZE(a650_gbif_regs),
	.hang_detect_cycles = 0xc3ffff,
	.veto_fal10 = true,
	.protected_regs = a620_protected_regs,
	.disable_tseskip = true,
	.pdc_in_aop = true,
	.ctxt_record_size = 2496 * 1024,
};

extern const struct gen8_snapshot_block_list gen8_10_0_snapshot_block_list;

--- LINE 4435 ---
			{ 284, 3 },
		),
		.ubwc_mode = 5,
		.mal = 32,
		.highest_bank_bit = 16,
		.gpu_model = "Adreno X2-85",
	},
	.aqefw_name = "gen80100_aqe.fw",
	.sqefw_name = "gen80100_sqe.fw",
	.gmufw_name = "gen80100_gmu.bin",
	.zap_name = "gen80100_zap.mbn",
	.ao_hwcg = gen8_1_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_1_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_1_0_protected_regs,
	.nonctxt_regs = gen8_1_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
--- LINE 4436 ---
		),
		.ubwc_mode = 5,
		.mal = 32,
		.highest_bank_bit = 16,
		.gpu_model = "Adreno X2-85",
	},
	.aqefw_name = "gen80100_aqe.fw",
	.sqefw_name = "gen80100_sqe.fw",
	.gmufw_name = "gen80100_gmu.bin",
	.zap_name = "gen80100_zap.mbn",
	.ao_hwcg = gen8_1_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_1_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_1_0_protected_regs,
	.nonctxt_regs = gen8_1_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
	.ctxt_record_size = (23088 * SZ_1K),
--- LINE 4437 ---
		.ubwc_mode = 5,
		.mal = 32,
		.highest_bank_bit = 16,
		.gpu_model = "Adreno X2-85",
	},
	.aqefw_name = "gen80100_aqe.fw",
	.sqefw_name = "gen80100_sqe.fw",
	.gmufw_name = "gen80100_gmu.bin",
	.zap_name = "gen80100_zap.mbn",
	.ao_hwcg = gen8_1_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_1_0_ao_hwcg_regs),
	.gbif = gen8_0_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_0_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_1_0_protected_regs,
	.nonctxt_regs = gen8_1_0_nonctxt_regs,
	.gmu_hub_clk_freq = 200000000,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
	.ctxt_record_size = (23088 * SZ_1K),
	.bcl_data = 1,
--- LINE 4743 ---
		.uche_gmem_alignment = SZ_64M,
		.gmem_size = 18 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen81100_aqe.fw",
	.sqefw_name = "gen81100_sqe.fw",
	.gmufw_name = "gen81100_gmu.bin",
	.zap_name = "gen81100_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_11_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_11_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_11_0_protected_regs,
	.nonctxt_regs = gen8_11_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_11_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = 1,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
--- LINE 4744 ---
		.gmem_size = 18 * SZ_1M,
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen81100_aqe.fw",
	.sqefw_name = "gen81100_sqe.fw",
	.gmufw_name = "gen81100_gmu.bin",
	.zap_name = "gen81100_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_11_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_11_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_11_0_protected_regs,
	.nonctxt_regs = gen8_11_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_11_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = 1,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
--- LINE 4745 ---
		.bus_width = 32,
		.snapshot_size = SZ_8M,
		.num_ddr_channels = 4,
		.highest_bank_bit = 16,
	},
	.aqefw_name = "gen81100_aqe.fw",
	.sqefw_name = "gen81100_sqe.fw",
	.gmufw_name = "gen81100_gmu.bin",
	.zap_name = "gen81100_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_11_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_11_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_11_0_protected_regs,
	.nonctxt_regs = gen8_11_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_11_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = 1,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(2736, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
--- LINE 4890 ---
			{ 0,   0 },
			{ 284, 2 },
			{ 216, 3 },
		),
		.ubwc_mode = 7,
		.mal = 32,
	},
	.aqefw_name = "gen81100_aqe.fw",
	.sqefw_name = "gen81100_sqe.fw",
	.gmufw_name = "gen81100_gmu.bin",
	.zap_name = "gen81100_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_11_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_11_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_11_0_protected_regs,
	.nonctxt_regs = gen8_11_1_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_11_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(4224, 4),
--- LINE 4891 ---
			{ 284, 2 },
			{ 216, 3 },
		),
		.ubwc_mode = 7,
		.mal = 32,
	},
	.aqefw_name = "gen81100_aqe.fw",
	.sqefw_name = "gen81100_sqe.fw",
	.gmufw_name = "gen81100_gmu.bin",
	.zap_name = "gen81100_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_11_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_11_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_11_0_protected_regs,
	.nonctxt_regs = gen8_11_1_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_11_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(4224, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
--- LINE 4892 ---
			{ 216, 3 },
		),
		.ubwc_mode = 7,
		.mal = 32,
	},
	.aqefw_name = "gen81100_aqe.fw",
	.sqefw_name = "gen81100_sqe.fw",
	.gmufw_name = "gen81100_gmu.bin",
	.zap_name = "gen81100_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_11_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_11_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_11_0_protected_regs,
	.nonctxt_regs = gen8_11_1_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_11_0_snapshot_block_list,
	.fast_bus_hint = true,
	.bcl_data = GEN8_2_X_BCL_DATA,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(4224, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
--- LINE 5034 ---
			{ 0, 0 },
			{ 216, 0 },
			{ 284, 1 },
		),
		.ubwc_mode = 7,
		.mal = 32,
	},
	.aqefw_name = "gen81100_aqe.fw",
	.sqefw_name = "gen81100_sqe.fw",
	.gmufw_name = "gen81400_gmu.bin",
	.zap_name = "gen81100_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_11_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_11_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_11_0_protected_regs,
	.nonctxt_regs = gen8_14_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_11_0_snapshot_block_list,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(4224, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
--- LINE 5035 ---
			{ 216, 0 },
			{ 284, 1 },
		),
		.ubwc_mode = 7,
		.mal = 32,
	},
	.aqefw_name = "gen81100_aqe.fw",
	.sqefw_name = "gen81100_sqe.fw",
	.gmufw_name = "gen81400_gmu.bin",
	.zap_name = "gen81100_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_11_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_11_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_11_0_protected_regs,
	.nonctxt_regs = gen8_14_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_11_0_snapshot_block_list,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(4224, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
--- LINE 5036 ---
			{ 284, 1 },
		),
		.ubwc_mode = 7,
		.mal = 32,
	},
	.aqefw_name = "gen81100_aqe.fw",
	.sqefw_name = "gen81100_sqe.fw",
	.gmufw_name = "gen81400_gmu.bin",
	.zap_name = "gen81100_zap.mbn",
	.ao_hwcg = gen8_2_0_ao_hwcg_regs,
	.ao_hwcg_count = ARRAY_SIZE(gen8_2_0_ao_hwcg_regs),
	.gbif = gen8_11_0_gbif_cx_regs,
	.gbif_count = ARRAY_SIZE(gen8_11_0_gbif_cx_regs),
	.hang_detect_cycles = 0xcfffff,
	.protected_regs = gen8_11_0_protected_regs,
	.nonctxt_regs = gen8_14_0_nonctxt_regs,
	.gmu_hub_clk_freq = 150000000,
	.gen8_snapshot_block_list = &gen8_11_0_snapshot_block_list,
	.fast_bus_hint = true,
	.acv_perfmode_ddr_freq = MHZ_TO_KBPS(4224, 4),
	.noc_timeout_us = 3410, /* 3.41 msec */
	.cl_no_ft_timeout_ms = 6500,
	.ctxt_record_size = (13564 * SZ_1K),
--- LINE 5080 ---
	&adreno_gpu_core_a510.base,
	&adreno_gpu_core_a540v1,	/* Deprecated */
	&adreno_gpu_core_a540v2.base,
	&adreno_gpu_core_a512.base,
	&adreno_gpu_core_a508.base,
	&adreno_gpu_core_a630v1,	/* Deprecated */
	&adreno_gpu_core_a630v2.base,
	&adreno_gpu_core_a615.base,
	&adreno_gpu_core_a618.base,
	&adreno_gpu_core_a619.base,
	&adreno_gpu_core_a619_variant.base,
	&adreno_gpu_core_a620.base,
	&adreno_gpu_core_a621.base,
	&adreno_gpu_core_a622.base,
	&adreno_gpu_core_a623.base,
	&adreno_gpu_core_a640.base,
	&adreno_gpu_core_a642l.base,
	&adreno_gpu_core_a643.base,
	&adreno_gpu_core_a650.base,
	&adreno_gpu_core_a650v2.base,
	&adreno_gpu_core_a660.base,
	&adreno_gpu_core_a660v2.base,
	&adreno_gpu_core_a663.base,