[Q] Build Kernel MT6577 - Can't boot after build

Search This thread

khan_frd2002

Senior Member
Nov 9, 2011
1,884
4,525
Aurangabad
Hi Khan ;)

Yeah, must be either the lens_sensor, or camera #AF50F, etc.

Can you post your compiled kernel error (if any) ?

Maybe we can help you ;)

B.Regards

thanks bro.....
actually i m very noob :p in kernel compiling but for trying some time i able to compile kernel everything works perfect except camera on 4.2 rom
i think because we port 5mp phone rom :confused:

now again trying with aquila-dev kernel source project.config as this give camera on 4.2 rom to c2 and its different as compared to both acer and wiko configs.....
Hope this time i get it Camera :fingers-crossed:
 
  • Like
Reactions: kashifmin

kashifmin

Senior Member
Oct 25, 2012
281
1,356
Mangalore
tip2tricks.com
thanks bro.....
actually i m very noob :p in kernel compiling but for trying some time i able to compile kernel everything works perfect except camera on 4.2 rom
i think because we port 5mp phone rom :confused:

now again trying with aquila-dev kernel source project.config as this give camera on 4.2 rom to c2 and its different as compared to both acer and wiko configs.....
Hope this time i get it Camera :fingers-crossed:

Hi,
Were you able to fix camera?
I'm having the same problem with wiko cink 5 sources. I've tried many things like setting correct sensors in ProjectConfig.mk but that didn't work.
If you are able to fix it then please share how to do it.
Thanks.
 

khan_frd2002

Senior Member
Nov 9, 2011
1,884
4,525
Aurangabad
anyone any idea about this error.....i search the whole kernel source but didnt find it


Code:
/home/khantastic/Desktop/Kernel/google/kernel/mediatek/custom/out/s9081/kernel/magnetometer/bmm050.c:49:30: fatal error: mach/mt6577_devs.h: No such file or directory

/home/khantastic/Desktop/Kernel/google/kernel/drivers/usb/gadget/android.c:
make[4]: *** [mediatek/custom/out/s9081/kernel/magnetometer/bmm050.o] Error 1
make[3]: *** [mediatek/custom/out/s9081/kernel] Error 2
make[2]: *** [sub-make] Error 2
 

Allwinn-id

Member
Feb 10, 2013
12
2
anyone any idea about this error.....i search the whole kernel source but didnt find it


Code:
/home/khantastic/Desktop/Kernel/google/kernel/mediatek/custom/out/s9081/kernel/magnetometer/bmm050.c:49:30: fatal error: mach/mt6577_devs.h: No such file or directory

/home/khantastic/Desktop/Kernel/google/kernel/drivers/usb/gadget/android.c:
make[4]: *** [mediatek/custom/out/s9081/kernel/magnetometer/bmm050.o] Error 1
make[3]: *** [mediatek/custom/out/s9081/kernel] Error 2
make[2]: *** [sub-make] Error 2

Open your <source_vendor>/mediatek/custom/common/magnetometer/bmm050/bmm050.c and <source_vendor>/kernel/mediatek/custom/out/s9081/kernel/magnetometer/bmm050.c
search line 49
#include <mach/mt6577_devs.h>
#include <mach/mt6577_typedefs.h>
#include <mach/mt6577_gpio.h>
#include <mach/mt6577_pm_ldo.h>

remove 6577 each line, to be

#include <mach/mt_devs.h>
#include <mach/mt_typedefs.h>
#include <mach/mt_gpio.h>
#include <mach/mt_pm_ldo.h>

Compiled again...
 
Last edited:
  • Like
Reactions: khan_frd2002

Dr-Shadow

Inactive Recognized Developer
Sep 15, 2013
454
560
NANTES
Open your <source_vendor>/mediatek/custom/common/magnetometer and <source_vendor>/kernel/mediatek/custom/out/s9081/kernel/magnetometer/bmm050.c
search line 49
#include <mach/mt6577_devs.h>
#include <mach/mt6577_typedefs.h>
#include <mach/mt6577_gpio.h>
#include <mach/mt6577_pm_ldo.h>

remove 6577 each line, to be

#include <mach/mt_devs.h>
#include <mach/mt_typedefs.h>
#include <mach/mt_gpio.h>
#include <mach/mt_pm_ldo.h>

Compiled again...

Or better just symlink it ln -s mt6577_devs.h mt_devs.h
 
  • Like
Reactions: khan_frd2002

taufik.arka

Member
Nov 17, 2012
7
0
jakarta
Hi all can you help me about this error message :( ,
Code:
  LD      arch/arm/mm/built-in.o
  LD      arch/arm/kernel/built-in.o
  CC      arch/arm/common/gic.o
  LD      arch/arm/net/built-in.o
  CC      mediatek/platform/mt6577/kernel/core/core.o
In file included from /home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:10:
/home/opick/IQ440/kernel/../mediatek/platform/mt6577/kernel/core/include/mach/io.h:4:1: warning: "IO_SPACE_LIMIT" redefined
In file included from /home/opick/IQ440/kernel/arch/arm/include/asm/mach/map.h:12,
                 from /home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:4:
/home/opick/IQ440/kernel/arch/arm/include/asm/io.h:142:1: warning: this is the location of the previous definition
In file included from /home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:10:
/home/opick/IQ440/kernel/../mediatek/platform/mt6577/kernel/core/include/mach/io.h:6:1: warning: "__io" redefined
In file included from /home/opick/IQ440/kernel/arch/arm/include/asm/mach/map.h:12,
                 from /home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:4:
/home/opick/IQ440/kernel/arch/arm/include/asm/io.h:122:1: warning: this is the location of the previous definition
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c: In function 'mt6577_init':
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:18: warning: unused variable 'tmp'
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c: At top level:
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:47: error: implicit declaration of function 'IO_VIRT_TO_PHYS'
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:47: error: 'PAGE_SHIFT' undeclared here (not in a function)
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:71: error: implicit declaration of function 'IO_ABB_MDSYS_VIRT_TO_PHYS'
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:89: error: implicit declaration of function 'IO_VER_VIRT_TO_PHYS'
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c: In function 'mt6577_map_io':
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:103: error: implicit declaration of function 'BUILD_BUG_ON_ZERO'
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c: At top level:
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:107: error: unknown field 'boot_params' specified in initializer
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:113: warning: initialization from incompatible pointer type
make[4]: *** [mediatek/platform/mt6577/kernel/core/core.o] Error 1
make[3]: *** [mediatek/platform/mt6577/kernel/core] Error 2
make[3]: *** Waiting for unfinished jobs....
  AS      arch/arm/common/fiq_glue.o
  CC      arch/arm/common/fiq_glue_setup.o
  CC      arch/arm/common/fiq_debugger.o
  LD      arch/arm/common/built-in.o
make[2]: *** [sub-make] Error 2

i try to build JB for MTK6577 devices, this is source actually take from IQ fly 440 devices
i'm using Ubuntu 10.04 LTS
sorry for my bad english
 

khan_frd2002

Senior Member
Nov 9, 2011
1,884
4,525
Aurangabad
Hi all can you help me about this error message :( ,
Code:
  LD      arch/arm/mm/built-in.o
  LD      arch/arm/kernel/built-in.o
  CC      arch/arm/common/gic.o
  LD      arch/arm/net/built-in.o
  CC      mediatek/platform/mt6577/kernel/core/core.o
In file included from /home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:10:
/home/opick/IQ440/kernel/../mediatek/platform/mt6577/kernel/core/include/mach/io.h:4:1: warning: "IO_SPACE_LIMIT" redefined
In file included from /home/opick/IQ440/kernel/arch/arm/include/asm/mach/map.h:12,
                 from /home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:4:
/home/opick/IQ440/kernel/arch/arm/include/asm/io.h:142:1: warning: this is the location of the previous definition
In file included from /home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:10:
/home/opick/IQ440/kernel/../mediatek/platform/mt6577/kernel/core/include/mach/io.h:6:1: warning: "__io" redefined
In file included from /home/opick/IQ440/kernel/arch/arm/include/asm/mach/map.h:12,
                 from /home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:4:
/home/opick/IQ440/kernel/arch/arm/include/asm/io.h:122:1: warning: this is the location of the previous definition
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c: In function 'mt6577_init':
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:18: warning: unused variable 'tmp'
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c: At top level:
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:47: error: implicit declaration of function 'IO_VIRT_TO_PHYS'
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:47: error: 'PAGE_SHIFT' undeclared here (not in a function)
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:71: error: implicit declaration of function 'IO_ABB_MDSYS_VIRT_TO_PHYS'
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:89: error: implicit declaration of function 'IO_VER_VIRT_TO_PHYS'
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c: In function 'mt6577_map_io':
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:103: error: implicit declaration of function 'BUILD_BUG_ON_ZERO'
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c: At top level:
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:107: error: unknown field 'boot_params' specified in initializer
/home/opick/IQ440/kernel/mediatek/platform/mt6577/kernel/core/core.c:113: warning: initialization from incompatible pointer type
make[4]: *** [mediatek/platform/mt6577/kernel/core/core.o] Error 1
make[3]: *** [mediatek/platform/mt6577/kernel/core] Error 2
make[3]: *** Waiting for unfinished jobs....
  AS      arch/arm/common/fiq_glue.o
  CC      arch/arm/common/fiq_glue_setup.o
  CC      arch/arm/common/fiq_debugger.o
  LD      arch/arm/common/built-in.o
make[2]: *** [sub-make] Error 2

i try to build JB for MTK6577 devices, this is source actually take from IQ fly 440 devices
i'm using Ubuntu 10.04 LTS
sorry for my bad english
that core error make me sick too.....it due to corrupted/bad source
from where did you get the source.....github one are always corrupted for me
 

khan_frd2002

Senior Member
Nov 9, 2011
1,884
4,525
Aurangabad
There is no defconfig for MTK devices

Please read posts and do you have source of your device ?
Bro I m getting this Error......any idea about this

/home/khantastic/Desktop/Kernel/google/kernel/mediatek/custom/out/s9081/kernel/alsps/cust_alsps.c:41:5: error: unknown field 'polling_mode' specified in initializer
make[3]: *** [mediatek/custom/out/s9081/kernel] Error 2
make[2]: *** [sub-make] Error 2
 

Dr-Shadow

Inactive Recognized Developer
Sep 15, 2013
454
560
NANTES
Bro I m getting this Error......any idea about this

/home/khantastic/Desktop/Kernel/google/kernel/mediatek/custom/out/s9081/kernel/alsps/cust_alsps.c:41:5: error: unknown field 'polling_mode' specified in initializer
make[3]: *** [mediatek/custom/out/s9081/kernel] Error 2
make[2]: *** [sub-make] Error 2

You need to learn some C ^-^

How did you get this error ? Which files did you use ?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    actually JB kernel source (3.4.0) is more complete than ICS kernel source (3.0.13). some of ICS source only "dummy".
    yes there are some missing/broken code in ICS and JB kernel source, but still have a lot of usefull stuff.

    i've successfully compile both kernel 3.0.13 and 3.4.0 for IMO S88 (mt6577), and we've using it for months, its quite stable and all feature are working (sensors, USB OTG, tv out etc). (google "IMO S88 custom kernel", you will find kernel compiled by me)

    i use wiko peax kernel source, the only reason i use wiko peax because my touchscreen driver available only in wiko peax source, but before that i've succesfully compile and boot using several source from alcatel and others wiko source, but missing touchscreen driver.
    basically all the source are similar, just use the most complete driver for your device (sensors, touchscreen, LCM etc).

    here is usefull reading for understanding mediatek source and customizing/compiling mediatek kernel : https://docs.google.com/file/d/0B0l94YEroUNjMFBpVnpNT2Flb1k/edit?usp=sharing

    here is what i did to build my kernel.
    1. record device hardware type, accelerometer, ALSPS, compass, touchscreen, main image sensor, sub image sensor, LCM etc.
    find the kernel source with the most complete driver for your device.

    2. customizing kernel source, edit both projectconfig.mk in /mediatek/config/common and /mediatek /config/"project-name",
    edit the line CUSTOM_KERNEL... to device type as recorded in step 1.
    edit LCM_HEIGHT and LCM_WIDTH to your device resolution
    edit combo driver (6620/6628) as used by your device.
    beware some wrong settings in projectconfig.mk will prevent the kernel from booting, like config OTP, its related with dumchar driver. most of alcatel device/source use OTP partition. FAN5405 related wih powersupply driver, disable it if dont use fan5405.
    both projectconfig.mk will be merge and the customized source code will be in /mediatek/custom/out

    some of kernel source have files in /kernel/mediatek, these are already customized for others phone.
    some of kernel source have only symlink in /kernel/mediatek.
    i prefer to delete files in /kernel/mediatek and change in with symlink, so it will compile my customized source in /mediatek/custom/out

    3. edit kernel config, as we know mtk stock kernel didn't build with config.gz, it is like walk in the dark to edit kernel config.
    the kernel config is located in /mediatek/config/common/autoconfig, and /mediatek/config/project-name/autoconfig, both config will be merge to /mediatek/config/out/autoconfig and will be copied to /kernel/mediatek-config
    some of compiled module can not be use, so edit kernel config as necessary to get old modules working with your compiled kernel.

    4. build kernel using "makemtk", why using makemtk?
    because makemtk will perform:
    - customizing source code as i mention above
    - merging/autoconfig kernel config
    - patch zImage file
    of couse we can compile using "make" but we have to customizing the source manually and zImage file have to be patch using mkimage (find mkimage file in /mediatek/build/tools) before packing it to boot.img

    all your needed files (makemtk, mbldenv.sh etc) can be find here : https://github.com/trizet

    happy compiling
    12
    Will give this method a try, thanks for sharing it

    Sent from my H100 using xda app-developers app

    you're wellcome.


    the thread is clean now, i can continue writing some tips.

    "No. 1, record device hardware type"
    Mediatek device looks similar in specification, but there are a lot of different things behind, LCM (LCD), touchscreen, sensors, etc. even with same model the sensors can be different.

    what you need to know (record) about your device:
    - LCM type
    - Touchscreen type
    - Main image sensor type
    - Sub Image sensor type
    - Accelerometer type
    - ALSPS type (Light/Proximity sensor)
    - Magnetic sensor type (if any)
    - Gyroscope sensor type (if any)

    how to get all these hardware type?

    - LCM
    connect phone to PC, use MTK droid tools, there is an option to check LCD/LCM type
    if you have original/backup uboot.bin, open it using hex editor, find string "LCM", you will get LCM type compiled to uboot.
    LCM type read by MTK droid tools may be different with LCM type in uboot, because usually kernel compiled with 2 type LCM (auto detect) while uboot compiled with single LCM.
    you can compile kernel with dual LCM or single LCM,

    - Touchscreen and sensors
    Check all devices connected too i2c adapter.
    open root explorer, open file "/sys/devices/platform/mt-i2c.0/i2c-0/0-00XX/name"
    "/sys/devices/platform/mt-i2c.0/i2c-0/0-00XX/name" is for example, the point is you have to checked all device name in i2c0, i2c1 and i2c2
    for example on my phone "/sys/devices/platform/mt-i2c.0/i2c-0/0-000c/name" is "ak8975"

    now checked your kernel source, which one accelerometer, which one ALSPS,etc, does it complete or missing driver.
    usually the driver will located under 2 folder (for example accelerometer BMA250)
    /mediatek/custom/common/kernel/accelerometer/BMA250
    /mediatek/custom/"project-name"/kernel/accelerometer/BMA250

    if you dont have required driver in "/mediatek/custom/"project-name"/kernel/accelerometer" probably you will get compiled error. this part consist of customization such as accelerometer attachment direction/orientation.

    - Main and Sub image sensor.
    honestly i forgot how did i get this sensor type on ICS/kernel 3.0.13
    but i you have running JB rom/kernel 3.4.0 you can get these sensors type using mtk engineering tool.
    6
    TouchPanel Fixed gt9xx_config ^_^ Special Thanks To Lingfude...

    Hello Brother, Just Wanted To Thank You... i Fixed My TouchPanel Problem With a Trick... And The App You Shared Played a Big Roll in it... i Am Very Thankful to You For Helping And Taking Your Time To Reply Me :) My Device TouchPanel is Working Agian Just Because Of You... And Now i Found The Real Reason That Caused TouchPanel Malfunctioning issue... And Here is The Story...

    My Device Uses "GT915" TouchPanel Driver... But i Compiled My Kernel Having GT9xx Driver in it... This Driver Can Be Used For All Devices Using GT9xx Drivers, But We Have To Modify it According gt9xx_config File Which We Can Get From Our Device Using This Command
    adb pull /proc/gt9xx_config C:\

    And Here i Made a Mistake, Before Compiling My Custom Kernel i Didnt Knew This File
    /mediatek/custom/[My_Project]/touchpanel/GT9XX/tpd_custom_gt9xx.h

    Should Be Moded According To My Device TouchPanel Configs (gt9xx_config)... So i Didnt Moded This File (tpd_custom_gt9xx.h) Which Was Having Bad TouchPanel Configs in it, And i Compiled My Kernel And Then Right After First Bootup, Those Bad TouchPanel Configs in My Kernel Automatically Got Permanently Flashed in TouchPanel FLASH Area Of My Device, Which Cannot Be Reverted... And Then i Found The Reason Why it Happend To My Device, And Why it Didnt Happend To Your Device, Because When You Restored Stock Boot.img in Your Device, Your TouchPanel Started Working Fine Again, But Even After Flashing Stock Boot.img My Device TouchPanel Didnt Worked...

    Why it Happend To My Device? Here is The Answer i Discovered...
    Third And Fourth Number in The Very First Line Of "gt9xx_config" is The Version Number Of This Config File in Hexadecimal Form (41)... Which is Equal To 65 in Decimal Form... This Was The Version Number Of Config File (gt9xx_config) in My Stock Kernel...

    Have a Look At The Content Of My Stock Kernel's "gt9xx_config" File...
    /proc/gt9xx_config
    0x41 0xD0 0x02 0x00 0x05 0x05 0x35 0x01
    0x01 0x0F 0x28 0x06 0x50 0x37 0x03 0x04
    0x00 0x00 0x00 0x00 0x00 0x00 0x05 0x0B
    0x0D 0x11 0x0A 0x8B 0x0A 0x0B 0x52 0x50
    0x7F 0x08 0x00 0x00 0x00 0x9A 0x03 0x1D
    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    0x00 0x00 0x00 0x2E 0x5C 0x94 0xD5 0x01
    0x05 0x00 0x00 0x04 0xBB 0x31 0x00 0xA6
    0x38 0x00 0x91 0x41 0x00 0x81 0x4A 0x00
    0x71 0x56 0x00 0x71 0x10 0x30 0x50 0x00
    0x56 0x50 0x35 0x99 0x99 0x37 0x00 0x00
    0x00 0x00 0x0A 0x01 0x02 0x14 0x0A 0x14
    0xE8 0x03 0x00 0x00 0x00 0x00 0x00 0x00
    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    0x02 0x04 0x06 0x08 0x0A 0x0C 0x0E 0x10
    0x12 0x14 0x16 0xFF 0xFF 0xFF 0x00 0x00
    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    0x00 0x00 0x00 0x00 0x00 0x00 0x24 0x22
    0x21 0x20 0x1F 0x1E 0x1D 0x1C 0x18 0x16
    0x00 0x02 0x04 0x06 0x08 0x0A 0x0C 0x0F
    0x10 0x12 0x13 0xFF 0xFF 0xFF 0xFF 0xFF
    0x00 0x00 0x00 0xFF 0xFF 0xFF 0xFF 0xFF
    0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
    0x84 0x01


    Now Have a Look At The Bad Configs Which Were Present in This File "tpd_custom_gt9xx.h" in My Custom Kernel Source... Third And Fourth Number is The Version Number Of These Bad Configs in Hexadecimal Form (46)... Which is Equal To 70 in Decimal Form...
    0x46,0xD0,0x02,0x00,0x05,0x05,0x34,0x06,\
    0x02,0xCC,0x19,0x05,0x64,0x3C,0x05,0x04,\
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,\
    0x1A,0x1E,0x14,0x94,0x00,0x0C,0x58,0x2C,\
    0x6F,0x13,0x00,0x00,0x00,0x02,0x02,0x2D,\
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
    0x00,0x00,0x00,0x64,0xE1,0x99,0x85,0x02,\
    0x05,0x00,0x00,0x28,0x0A,0x53,0x80,0x0C,\
    0x50,0x9F,0x0F,0x4D,0xF8,0x11,0x50,0x50,\
    0x14,0x54,0x00,0x00,0x00,0x00,0x00,0x00,\
    0x57,0x50,0x30,0xFF,0xFF,0x06,0x00,0x00,\
    0x00,0x00,0x00,0x01,0x0F,0x19,0x0F,0x1E,\
    0x0A,0x00,0x02,0x00,0x00,0x00,0x00,0x00,\
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
    0x16,0x18,0x12,0x14,0x0E,0x10,0x0A,0x0C,\
    0x06,0x08,0x02,0x04,0xFF,0xFF,0xFF,0xFF,\
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x28,0x25,\
    0x22,0x1F,0x1D,0x0E,0x1E,0x20,0x24,0x26,\
    0x0A,0x08,0x06,0x02,0x00,0x01,0x04,0x07,\
    0x09,0x0C,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\
    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\
    0xD0,0x01,\


    And Due To This Flag in "tpd_custom_gt9xx.h" File in My Kernel Source...
    #define GTP_AUTO_UPDATE 1 //update FW to TP FLASH

    At The Very First Bootup, Kernel Checks For The Version Number Of Configs in TouchPanel FLASH Area Of Our Phone, And Then it Checks For Version Number Of TouchPanel Configs in Our Newly Flashed Kernel.... if That Version Number in Kernel is Greater Than The Version Number in TouchPanel FLASH Area, Then it Automatically Transfer New Configs From Kernel to TouchPanel FLASH Area Of Our Phone... And Once This Process is Done... We Cant Get Back To The Lower Version... So Even After i Flashed My Stock Boot.img (Having Lower Version) Those Configs in The TouchPanel FLASH Area Remain Same (Bad) Because They Were Updated To Higher Version Number Due To Bad TouchPanel Configs in My Custom Kernel, And Higher Version Number Cannot Revert Back To Lower Version Number Even if We Flash Stock Boot.img... And Your Phone Probably Started To Work Again Normally After Flashing Stock Boot.img Because The Version Number Of Bad Configs in Your Custom Kernel Was Smaller Than The Version Number Of Configs in Your Device TouchPanel FLASH Area... Or Probably TouchPanel Driver in Your Custom Kernel Was Having This Flag, So it Didnt Got Updated into TouchPanel Flash Area Of Your Device...
    #define GTP_AUTO_UPDATE 0 //update FW to TP FLASH
    And Your Were Lucky Your Mobile Remain Safe...

    So How i Fixed This issue? i Used The App (GtpTool.apk) You Shared, And Loaded My Stock Kernel TouchPanel Configs into it... There i Saw a Version Number... Which Was 65... i Tried Restoring My Stock Configs, But Every Time it Showed Me a Error, That The Configs i Loaded Have Smaller Version Than The Configs Already Available in My TouchPanel FLASH Area... And Then i Took Those Bad Configs From Kernel Driver Source, Converted Then into gt9xx_config Format... And Then i Loaded Them into The App You Shared, Then i Found its Version Number Was 70... Then i Cracked The Whole Story... What And Why Did This Happen To My Device... Then a Trick Came in My Mind... i Loaded My Stock Configs into That App, Luckily That App Allowed Me To Change Version Number... And Then i Just increased The Version Number Of My Stock Configs From 65 To 71 Which Was Higher Than The Version Number Of Bad Configs in My Device TouchPanel FLASH Area... And Then i Tried Flashing My Stock Configs Having Fake Higher Version Number... Boom! it Worked ^_^ All Because Of You Brother @lingfude i Was Thinking Of Going To Service Center... The App You Shared Was My Last Hope... And it Worked... Then i Fixed Those Configs in My Kernel TouchPanel Driver Too... Now TouchPanel is Working Perfectly Fine in My Custom Kernel Too... But TouchPanel Keys Are Still Not Working in My Custom Kernel... Trying To Fix Them... Tried Your instructions From Your Previous Post, But No Luck Till Now... Now i Have To Fix Display Driver... it Works Partially, Shows The Display When i Open Any Popup Menu Like Power Menu...

    Special Thanks To @lingfude And @Dr-Shadow For Helping Me, For Being Such a Nice Person And Taking Your Time To Reply Me... Thanks Alot Brothers... <3
    6
    OK :( Just One More Question... is There Any Way To Find Driver Names Used in Stock Kernel?
    i Saw a Guy @vizhigal... Here Knows How To Extract Details From Stock Kernel... i Also Wanted To Learn How To Extract Hardware Related Details From Stock Kernel... if Anyone Knows Then Please Share With Us... Thank You

    This is possible by extracting zImage to Image and then open it with Notepad++

    I never did this but this should be interesting to do... ahah

    First, we need to extract boot.img to ramdisk and zImage, use your extraction tool for mtk boot.img

    Actually default compression is GZIP for kernel but we need to extract the part which is a gzip archive. We don't need to care about the mtk header (which is a uboot header)

    Code:
    od -Ad -x -w2 boot.img-kernel.img | grep 8b1f | head
    Results were for me :
    0018984 8b1f
    0031590 8b1f
    0209574 8b1f
    0587924 8b1f
    0744032 8b1f
    0883498 8b1f
    0910136 8b1f
    0914160 8b1f
    0965692 8b1f
    1001240 8b1f

    You need the first line for next command :

    Code:
    dd if=boot.img-kernel.img of=piggy.gz bs=1 skip=18984
    gunzip piggy.gz

    Then you can navigate in piggy (gunzip extracted piggy.gz to piggy) with a notepad or use command :

    Code:
    strings piggy

    EDIT : So I found my drivers by navigating in strings, for example :

    ov12830mipiraw
    s5k4e1gamipiraw
    ov5648mipi

    My advice : go to end of strings and then scroll up to search imgsensors :)
    4
    Touchpanel config for GT818B driver (may work with others)

    With stock kernel installed
    1. Search and dump file "/proc/gt818_config" (driver config)

    2. Search and dump file "/sys/board_properties/virtualkeys.mtk-tpd" (buttons/touch keys coordinates)
    File content explanation:
    Code:
    0x01:139:108:1006:40:40:0x01:172:216:1006:40:40:0x01:158:324:1006:40:40:0x01:217:432:1006:40:40
    
    0x01:139: - key1 code
    108:1006:40:40: - key1 coordinates:width:height
    0x01:172: - key2 code
    216:1006:40:40: - key2 coordinates:width:height
    0x01:158: - key3 code
    324:1006:40:40: - key3 coordinates:width:height
    0x01:217: - key4 code
    432:1006:40:40 - key4 coordinates:width:height

    3. Search and dump file "/sys/module/tpd_settings/parameters/tpd_calmat" (calibration matrix settings)

    Custom kernel driver (GT818B) config file
    4. Edit file "/mediatek/custom/[your project]/kernel/touchpanel/GT818B/tp_custom_GT818B.h"

    5. Change line:
    "#define TPD_CALIBRATION_MATRIX {1082,0,0,0,1920,0,0,0};" with values from previous step 3 where "1082=LCM width*2+2" and "1920=LCM Heigth*2".

    6. Change line:
    "#define TPD_VIRTUAL_KEY_MAX (4)" to number of keys of your phone.

    7. Change line:
    "#define TPD_KEY_COUNT 4" to number of keys of your phone.

    8. Change line:
    "#define TPD_KEYS {KEY_MENU, KEY_HOMEPAGE, KEY_BACK, KEY_SEARCH}" to your keys.

    9. Change line:
    "#define TPD_KEYS_DIM {{108,1006,40,40},{216,1006,40,40},{324,1006,40,40},{432,1006,40,40}}" with values from previous step 2.

    10. Change lines:
    "#define TPD_X_RES (540)" to your LCM width
    "#define TPD_Y_RES (960)" to your LCM heigth.

    11. Edit file "gt818_config" and replace all spaces with commas "," except last space if exist just like this:
    Code:
        ==== GT818 config init value====
        0x12,0x10,0x0E,0x0C,0x0A,0x08,0x06,0x04,
        0x02,0x00,0x03,0x33,0x13,0x33,0x23,0x33,
        0x33,0x33,0x43,0x33,0x53,0x33,0x63,0x33,
        0x73,0x33,0x83,0x33,0x93,0x33,0xA3,0x33,
        0xB3,0x33,0xC3,0x33,0xD3,0x33,0xE3,0x33,
        0xF3,0x33,0x17,0x13,0xB0,0xB0,0xB0,0x2A,
        0x2A,0x2A,0x10,0x0F,0x0A,0x50,0x40,0x4D,
        0x03,0x00,0x05,0x1C,0x02,0xC0,0x03,0x00,
        0x00,0x5C,0x56,0x60,0x59,0x00,0x00,0x26,
        0x14,0x25,0x08,0x00,0x00,0x00,0x00,0x00,
        0x18,0x14,0xC3,0x03,0x00,0x00,0x00,0x00,
        0x00,0x00,0x1D,0x45,0x6B,0x93,0x0D,0x50,
        0x40,0x35,0x25,0x00,0x00,0x00,0x00,0x00,
        0x00,0x01

    11.a. Replace hexadecimal code after line "static u8 cfg_data_version_d[] =" with code in section "==== GT818 config init value====" from step 11.

    11.b. Replace hexadecimal code after line "static u8 cfg_data_with_charger_version_d[] =" with code in section "==== GT818 charger init config====" from step 11.

    12. If you experience mirror effect on Y Axis (tap on top and click happens down or vice-versa) change line:
    "#define TPD_WARP_Y(y) ( y )" to "#define TPD_WARP_Y(y) ( TPD_Y_RES - 1 - y )"

    12.a. If you experience mirror effect on X Axis (tap on left and click happens right or vice-versa) change line:
    "#define TPD_WARP_X(x) ( x )" to "#define TPD_WARP_X(x) ( TPD_X_RES - 1 - x )"

    Custom kernel Touchpanel driver config
    13. Edit file "/mediatek/custom/common/kernel/touchpanel/src/tp_setting.c"

    14. Change lines:
    "int TPD_RES_X = 540;" to your LCM width
    "int TPD_RES_Y = 960;" to your LCM heigth.

    15. Change lines:
    "int tpd_mode_min = 480;" where 480 is you LCM heigth/2
    "int tpd_mode_max = 960;" where 960 is your LCM height

    16. Change line:
    "int tpd_mode_keypad_tolerance = 540*540/1600;" where 540 is your LCM width

    17. Test and pray to work. :fingers-crossed:

    The above configuration is for my phone and it works. :victory:
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone