• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE]Overclocking NAND Devices with PLL2

Search This thread

cute_prince

Inactive Recognized Developer
May 19, 2012
782
4,300
Trivandrum
/**** THIS GUIDE IS ONLY FOR ADVANCED USERS, WHO KNOW HOW TO COMPILE AND MAKE MODIFICATIONS TO KERNEL AND MODIFYING VARIOUS PARAMETERS IN RAMDISK ****/

Hello guys, here I am giving you a detailed tutorial for Overclocking devices that comes with NAND and having only PLL2 support.
Although this guide is written for HTC Explorer, the method can also be applied on similar devices.
So, before we begin you should understand the difference between OCing with PLL4 and OCing with PLL2.

XDA user @rootdefyxt320 has written an excellent post that tells the exact difference between PLL4 OC and PLL2 OC. I am quoting it:


PLL2 overclock can be compared to FSB overclocking in computers i.e locked multiplier overclocking in the BIOS. FSB overclocking involves overclocking of the PC buses such as the Memory Bus, PCI/ PCI-Express bus and AGP buses (older computers) and the CPU. It works out by XXXXMHz multiplied by X multiplier and that will give the CPU speed. PLL2 overclock does the same thing because PLL2 controls the bus speeds (exists in the SOC). It overclocks the memory buses, SOC clock, internal storage (database IO) speed and of course the CPU. It works out by XX multiplied by 19/2 and that gives the CPU speed. That's why PLL2 on 800MHz is faster in performance than PLL4 on 800MHz . Therefore that's the reason why people complain of burnt NANDs on HTC Explorer and Motorola Defy Mini XT320/321.

PLL4 overclock can be compared to unlocked multiplier overclocking where you adjust the multiplier in the BIOS and it will automatically adjust the clock speed depending on the multiplier of the CPU. Therefore this only overclocks the CPU. PLL4 overclock only overclocks the CPU and NOT the buses so it can go at much higher frequencies than PLL2 overclock. PLL4 overclock does NOT adjust bus speeds so therefore it is much safer to overclock and it doesn't burn out your SOC.

In case of HTC Explorer, it uses Qualcomm MSM7225A chipset. This chipset does not have PLL4 support. So the only way to overclock is by OC'ing PLL2. But OC'ing PLL2 causes not only the CPU but also everything connected to the board to OC as well. This includes the External Bus Interface (EBI). Our NAND is connected to EBI and when OC happens the Write access through NAND becomes so high causing every block in those partitions which are mounted as RW to become Bad. This is what we call "NAND BURN".

The partitions in NAND that are affected by OC are /data and /cache. This is because only these two partitons are mounted with RW access. As I mentioned above the increased Write access during OC is what causing the blocks to corrupt. All other partitions including /misc, /devlog, /boot, /system and /recovery are mounted as Read-Only and therefore are not affected.

The Workaround for this dilemma is to disable both /data and /cache partitions ( By disable, I mean not even mounting them ) in NAND and use a portion of your SDcard to act as /data and /cache. This is what we are going to do.


/* FOLLOWING PROCEDURE IS FOR AOSP ROMS ONLY */


THE PROCEDURE
================


The procedure consists of four parts. They are listed below:

  • Preparing The SDcard
  • Kernel Level Changes
  • Setting Up RamDisk
  • Removing Memory Increasing Script

Detailed description of each part is given below:


PART 1 : Preparing The SDcard
==========================


********YOU MUST USE CLASS 10 OR ATLEAST CLASS 6 SDCARD WITH MINIMUM 8GB CAPACITY*******

CLASS 4 and CLASS 2 SDcards will definitely cause slow responsiveness because /data/data is on SDcard. Furthermore these SDcards can't handle OC at high frequencies and will die out quickly.

SO PROCEED ONLY IF YOU ARE HAVING CLASS 6 OR CLASS 10 SDCARD. YOU CAN TRY CLASS 4 SDCARD BUT YOU CAN'T OVERCLOCK ABOVE A CERTAIN LIMIT AND NO GUARANTEE ABOUT HOW LONG THE CARD WILL LAST.

We are going to create two EXT4 partitions ( First one for replacing /data and second one for replacing /cache in NAND ) on the SDcard, in addition to the normal FAT32 partition.

Using MiniTool Partition Wizard, create two EXT4 partitions as shown in following figure:

image.png



For SD-DATA, you can give whatever size you want. This where the user applications are installed.
For SD-CACHE, around 65MB is enough.

You should keep the order in which partitions are created. Partition Type for both SD-DATA and SD-CACHE should be Primary.

Assuming you have successfully prepared SDcard, lets go the second part:


PART 2 : Kernel Level Changes
==========================


First, you need to replace arch/arm/mach-msm/acpuclock-7201 with this one: https://dl.dropboxusercontent.com/u/95625633/acpuclock-7201.c
This contains the overclocked frequencies and logic to dynamically calculate PLL2 values according to different frequencies.

When you look through the overclocked frequencies, you can see I have disabled 900MHz. This is because Class 4 SDcards can't handle data rate at this frequency. Those who have Class 10 SDcards can enable and try whether it is stable for them.

**** DO NOT OC GPU. ITS FAKE AND ACTUALLY DEGRADES PERFORMANCE. REVERT GPU OC IF YOU HAVE ENABLED IT ****

Next, you need to edit the configuration file ( pico_defconfig in my case ) and enable the following option. Its disabled by default so you have to enable it:

Code:
[COLOR="Blue"][B]CONFIG_LBDAF=y[/B][/COLOR]

That's all. Now compile your kernel.


PART 3 : Setting Up RamDisk
========================


Since, we are not using /data and /cache in NAND anymore, the changes must be made in RamDisk.
All modifications are performed on init.rc file.

Open init.rc and perform the following modifications:

1. Find the following line:

Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /data nosuid nodev[/COLOR][/B]

Replace the above line with following:

Code:
[B][COLOR="Blue"]# Mount SD-DATA
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    mount ext4 /dev/block/mmcblk0p2 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR][/B]

2. Now find the following line:

Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /cache nosuid nodev[/COLOR][/B]

Replace the above line with following:

Code:
[B][COLOR="Blue"]# Mount SD-CACHE
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    mount ext4 /dev/block/mmcblk0p3 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR][/B]

3. Since we are extensively using SDcard, we should adjust the read_ahead_kb parameter for maximum performance:
Add the following lines after the line: mount ext4 /dev/block/mmcblk0p3 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue

Code:
[B][COLOR="Blue"]# SDcard read speed boost
    write /sys/block/mmcblk0/bdi/read_ahead_kb 2048[/COLOR][/B]


PART 4 : Removing Memory Increasing Script
=====================================


*** This is very important. You should remove any memory increasing script that you were using. Because /data partition is now on SDcard, using memory increasing script will cause conflict and makes ROM unbootable. ***

That's all, now you can flash your favourite ROM with the new OCed boot image and enjoy overclocking. :)

NOTE: A new Recovery must be made to support the new /SD-CACHE partition.
 
Last edited:

cute_prince

Inactive Recognized Developer
May 19, 2012
782
4,300
Trivandrum
/* FOLLOWING PROCEDURE IS FOR SENSE 4.1 ROM ONLY */


THE PROCEDURE
================


The procedure consists of four parts. They are listed below:

  • Preparing The SDcard
  • Kernel Level Changes
  • Setting Up RamDisk
  • Removing Memory Increasing Script

Detailed description of each part is given below:


PART 1 : Preparing The SDcard
==========================


********YOU MUST USE CLASS 10 OR ATLEAST CLASS 6 SDCARD WITH MINIMUM 8GB CAPACITY*******

CLASS 4 and CLASS 2 SDcards will definitely cause slow responsiveness because /data/data is on SDcard. Furthermore these SDcards can't handle OC at high frequencies and will die out quickly.

SO PROCEED ONLY IF YOU ARE HAVING CLASS 6 OR CLASS 10 SDCARD. YOU CAN TRY CLASS 4 SDCARD BUT YOU CAN'T OVERCLOCK ABOVE A CERTAIN LIMIT AND NO GUARANTEE ABOUT HOW LONG THE CARD WILL LAST.

We are going to create three EXT4 partitions ( First one for /sd-ext, second one for replacing /data and third one for replacing /cache in NAND ) on the SDcard, in addition to the normal FAT32 partition.

Using MiniTool Partition Wizard, create three EXT4 partitions as shown in following figure:

image.png



For SD-EXT, around 512MB is enough. It contains only system files.
For SD-DATA, you can give whatever size you want. This where the user applications are installed.
For SD-CACHE, around 65MB is enough.

You should keep the order in which partitions are created. Partition Type for SD-EXT, SD-DATA and SD-CACHE should be Primary.

Assuming you have successfully prepared SDcard, lets go the second part:


PART 2 : Kernel Level Changes
==========================


First, you need to replace arch/arm/mach-msm/acpuclock-7201 with this one: https://dl.dropboxusercontent.com/u/95625633/acpuclock-7201.c
This contains the overclocked frequencies and logic to dynamically calculate PLL2 values according to different frequencies.

When you look through the overclocked frequencies, you can see I have disabled 900MHz. This is because Class 4 SDcards can't handle data rate at this frequency. Those who have Class 10 SDcards can enable and try whether it is stable for them.

**** DO NOT OC GPU. ITS FAKE AND ACTUALLY DEGRADES PERFORMANCE. REVERT GPU OC IF YOU HAVE ENABLED IT ****

Next, you need to edit the configuration file ( pico_defconfig in my case ) and enable the following option. Its disabled by default so you have to enable it:

Code:
[COLOR="Blue"][B]CONFIG_LBDAF=y[/B][/COLOR]

That's all. Now compile your kernel.


PART 3 : Setting Up RamDisk
========================


Since, we are not using /data and /cache in NAND anymore, the changes must be made in RamDisk.
All modifications are performed on init.rc file.

Open init.rc and perform the following modifications:

1. Find the following line:

Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /data nosuid nodev[/COLOR][/B]

Replace the above line with following:

Code:
[B][COLOR="Blue"]
# Mount SD-EXT
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    mount ext4 /dev/block/mmcblk0p2 /sd-ext nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue

# Mount SD-DATA
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
[/COLOR][/B]

2. Now find the following line:

Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /cache nosuid nodev[/COLOR][/B]

Replace the above line with following:

Code:
[B][COLOR="Blue"]# Mount SD-CACHE
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR][/B]

3. Since we are extensively using SDcard, we should adjust the read_ahead_kb parameter for maximum performance:
Add the following lines after this line: mount yaffs2 [email protected] /persist nosuid nodev

Code:
[B][COLOR="Blue"]# SDcard read speed boost
    write /sys/block/mmcblk0/bdi/read_ahead_kb 2048[/COLOR][/B]


PART 4 : Removing Memory Increasing Script
=====================================


*** This is very important. You should remove any memory increasing script that you were using. Because /data partition is now on SDcard, using memory increasing script will cause conflict and makes ROM unbootable. ***

That's all, now you can flash your favourite ROM with the new OCed boot image and enjoy overclocking. :)

NOTE: A new Recovery must be made to support the new /SD-DATA and /SD-CACHE partitions.
 
Last edited:

abhinavthms

Senior Member
Aug 4, 2012
372
262
Kanhangad
/* FOLLOWING PROCEDURE IS FOR SENSE 4.0a AND DERIVED ROMS ONLY */


THE PROCEDURE
================


The procedure consists of four parts. They are listed below:

  • Preparing The SDcard
  • Kernel Level Changes
  • Setting Up RamDisk
  • Removing Memory Increasing Script

Detailed description of each part is given below:


PART 1 : Preparing The SDcard
==========================


********YOU MUST USE CLASS 10 OR ATLEAST CLASS 6 SDCARD WITH MINIMUM 8GB CAPACITY*******

CLASS 4 and CLASS 2 SDcards will definitely cause slow responsiveness because /data/data is on SDcard. Furthermore these SDcards can't handle OC at high frequencies and will die out quickly.

SO PROCEED ONLY IF YOU ARE HAVING CLASS 6 OR CLASS 10 SDCARD. YOU CAN TRY CLASS 4 SDCARD BUT YOU CAN'T OVERCLOCK ABOVE A CERTAIN LIMIT AND NO GUARANTEE ABOUT HOW LONG THE CARD WILL LAST.

We are going to create three ext2 partitions ( First one for /sd-ext, second one for replacing /data and third one for replacing /cache in NAND ) on the SDcard, in addition to the normal FAT32 partition.

Using MiniTool Partition Wizard, create three ext2 partitions as shown in following figure:

image.png



For SD-EXT, around 512MB is enough. It contains only system files.
For SD-DATA, you can give whatever size you want. This where the user applications are installed.
For SD-CACHE, around 65MB is enough.

You should keep the order in which partitions are created. Partition Type for SD-EXT, SD-DATA and SD-CACHE should be Primary.

Assuming you have successfully prepared SDcard, lets go the second part:


PART 2 : Kernel Level Changes
==========================


First, you need to replace arch/arm/mach-msm/acpuclock-7201 with this one: https://dl.dropboxusercontent.com/u/95625633/acpuclock-7201.c
This contains the overclocked frequencies and logic to dynamically calculate PLL2 values according to different frequencies.

When you look through the overclocked frequencies, you can see I have disabled 900MHz. This is because Class 4 SDcards can't handle data rate at this frequency. Those who have Class 10 SDcards can enable and try whether it is stable for them.

**** DO NOT OC GPU. ITS FAKE AND ACTUALLY DEGRADES PERFORMANCE. REVERT GPU OC IF YOU HAVE ENABLED IT ****

Next, you need to edit the configuration file ( pico_defconfig in my case ) and enable the following option. Its disabled by default so you have to enable it:

Code:
[COLOR="Blue"][B]CONFIG_LBDAF=y[/B][/COLOR]

That's all. Now compile your kernel.


PART 3 : Setting Up RamDisk
========================


Since, we are not using /data and /cache in NAND anymore, the changes must be made in RamDisk.
All modifications are performed on init.rc file.

Open init.rc and perform the following modifications:

1. Find the following line:

Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /data nosuid nodev[/COLOR][/B]

Replace the above line with following:

Code:
[B][COLOR="Blue"]
# Mount SD-EXT
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    mount ext2 /dev/block/mmcblk0p2 /sd-ext nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue

# Mount SD-DATA
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    mount ext2 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
[/COLOR][/B]

2. Now find the following line:

Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /cache nosuid nodev[/COLOR][/B]

Replace the above line with following:

Code:
[B][COLOR="Blue"]# Mount SD-CACHE
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    mount ext2 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR][/B]

3. Since we are extensively using SDcard, we should adjust the read_ahead_kb parameter for maximum performance:
Add the following lines after this line: mount yaffs2 [email protected] /persist nosuid nodev

Code:
[B][COLOR="Blue"]# SDcard read speed boost
    write /sys/block/mmcblk0/bdi/read_ahead_kb 2048[/COLOR][/B]


PART 4 : Removing Memory Increasing Script
=====================================


We are going to remove the memory scripts in the rom.But sense 4 roms have some of their system folder mounted to sd-ext.So to remove it we have to make some changes to the updater script

1.Find and remove all lines in the updater script with sd-ext in them.

2.Next paste the following lines just after the line "package_extract_dir("system", "/system");"

Code:
[B][COLOR="Blue"]
	ui_print("Mounting sd-ext");
	ui_print("------------------");
	run_program("/sbin/mkdir", "/sd-ext");
	run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/sd-ext");

	ui_print("Preparing sd-ext for flashing");
	ui_print("------------------");
 
	run_program("/sbin/mkdir","/sd-ext/app_s");

	set_progress(0.25);
 
	ui_print("Flashing stuff to sd-ext");
	ui_print("------------------");
 
	package_extract_dir("sd-ext/app_s", "/sd-ext/app_s");
	set_perm_recursive(0, 0, 0755, 0644, "/sd-ext/app_s");
	
	ui_print("Linking /sd-ext contents to /system");
	ui_print("-----------------------------------");

	symlink("/sd-ext/app_s", "/system/app");[/COLOR][/B]

3.(Rom dependend):Some Sense 4 roms have more folders in sd-ext.To know that just check in the sd-ext folder of your rom.zip.Then add the required lines under right sections.

Code:
[B][COLOR="Blue"]
	ui_print("Preparing sd-ext for flashing");
	ui_print("------------------");
 
	run_program("/sbin/mkdir","/sd-ext/system_s");
	run_program("/sbin/mkdir","/sd-ext/usr_s");
	run_program("/sbin/mkdir","/sd-ext/media_s");
	
	ui_print("Flashing stuff to sd-ext");
	ui_print("------------------");
 
	package_extract_dir("sd-ext/media_s", "/sd-ext/media_s");
	package_extract_dir("sd-ext/usr_s", "/sd-ext/usr_s");
	package_extract_dir("sd-ext/system_s", "/sd-ext/system_s");
	set_perm_recursive(0, 0, 0755, 0644, "/sd-ext/media_s");
	set_perm_recursive(0, 0, 0755, 0644, "/sd-ext/usr_s");
	set_perm_recursive(0, 0, 0755, 0644, "/sd-ext/system_s");
	package_extract_dir("bootanimation", "/sd-ext/media_s");
	
	ui_print("Linking /sd-ext contents to /system");
	ui_print("-----------------------------------");
	symlink("/sd-ext/usr_s", "/system/usr");
	symlink("/sd-ext/system_s", "/system/app");
	symlink("/sd-ext/media_s", "/system/media");[/COLOR][/B]


4.Now remove the memory script. Try to find the name of the memory script as it is different for different roms.

*** This is very important. You should remove any memory increasing script that you were using. Because /data partition is now on SDcard, using memory increasing script will cause conflict and makes ROM unbootable. ***



NOTE: A new Recovery must be made to support the new /SD-DATA and /SD-CACHE partitions.
 
Last edited:

satiz

Member
Jul 17, 2012
34
39
If I understand you correctly ,
Will overclocking Burn NAND if I mount /system as RW with Root explorer or adb remount ??
 

cute_prince

Inactive Recognized Developer
May 19, 2012
782
4,300
Trivandrum
Thanks a ton man !!!

btw i tried it on aokp JB and it DOES WORK

i even uploaded a boot.img for the masses to try out... here : http://forum.xda-developers.com/showpost.php?p=42929950&postcount=282

but one thing i've noticed that if we mount the whole data.. but still wouldn't it affect nand some where.. ?
@cute_prince did you try dsmeg ? did it show any bad blocks ?

No it wont affect any Read-Only portions of NAND. I have already told the reason in OP. Seems like you didnt read it ;)
Yes, I regularly checked dmesg and there is no Bad Block.

The partitions in NAND that are affected by OC are /data and /cache. This is because only these two partitons are mounted with RW access. As I mentioned above the increased Write access during OC is what causing the blocks to corrupt. All other partitions including /misc, /devlog, /boot, /system and /recovery are mounted as Read-Only and therefore are not affected.
 
  • Like
Reactions: siddharth1102

ateeq72

Senior Member
Dec 28, 2011
309
298
Chennai
3. Since we are extensively using SDcard, we should adjust the read_ahead_kb parameter for maximum performance:
Add the following lines after this line: mount yaffs2 [email protected] /persist nosuid nodev

Code:
[B][COLOR="Blue"]# SDcard read speed boost
    write /sys/block/mmcblk0/bdi/read_ahead_kb 2048[/COLOR][/B]
Dude i cant find the line you stated below which i have to add read_ahead line
so i randomly added that line and now am stuck at htc screen!
 

<JohnCarter>

Senior Member
Jun 1, 2012
761
1,770
Ranchi
No it wont affect any Read-Only portions of NAND. I have already told the reason in OP. Seems like you didnt read it ;)
Yes, I regularly checked dmesg and there is no Bad Block.

oops sorry my bad.. :angel:
but gr8 work anyway :D ;)

---------- Post added at 06:58 PM ---------- Previous post was at 06:52 PM ----------

here you go bro!


http://www.mediafire.com/download/hhvdsdzcesm6chi/init.rc

try fixing this or else just upload your Ramdisk! and thanks for damn fast reply! :D

hey bro,you can paste that just below the cache mounting..
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 70
    /**** THIS GUIDE IS ONLY FOR ADVANCED USERS, WHO KNOW HOW TO COMPILE AND MAKE MODIFICATIONS TO KERNEL AND MODIFYING VARIOUS PARAMETERS IN RAMDISK ****/

    Hello guys, here I am giving you a detailed tutorial for Overclocking devices that comes with NAND and having only PLL2 support.
    Although this guide is written for HTC Explorer, the method can also be applied on similar devices.
    So, before we begin you should understand the difference between OCing with PLL4 and OCing with PLL2.

    XDA user @rootdefyxt320 has written an excellent post that tells the exact difference between PLL4 OC and PLL2 OC. I am quoting it:


    PLL2 overclock can be compared to FSB overclocking in computers i.e locked multiplier overclocking in the BIOS. FSB overclocking involves overclocking of the PC buses such as the Memory Bus, PCI/ PCI-Express bus and AGP buses (older computers) and the CPU. It works out by XXXXMHz multiplied by X multiplier and that will give the CPU speed. PLL2 overclock does the same thing because PLL2 controls the bus speeds (exists in the SOC). It overclocks the memory buses, SOC clock, internal storage (database IO) speed and of course the CPU. It works out by XX multiplied by 19/2 and that gives the CPU speed. That's why PLL2 on 800MHz is faster in performance than PLL4 on 800MHz . Therefore that's the reason why people complain of burnt NANDs on HTC Explorer and Motorola Defy Mini XT320/321.

    PLL4 overclock can be compared to unlocked multiplier overclocking where you adjust the multiplier in the BIOS and it will automatically adjust the clock speed depending on the multiplier of the CPU. Therefore this only overclocks the CPU. PLL4 overclock only overclocks the CPU and NOT the buses so it can go at much higher frequencies than PLL2 overclock. PLL4 overclock does NOT adjust bus speeds so therefore it is much safer to overclock and it doesn't burn out your SOC.

    In case of HTC Explorer, it uses Qualcomm MSM7225A chipset. This chipset does not have PLL4 support. So the only way to overclock is by OC'ing PLL2. But OC'ing PLL2 causes not only the CPU but also everything connected to the board to OC as well. This includes the External Bus Interface (EBI). Our NAND is connected to EBI and when OC happens the Write access through NAND becomes so high causing every block in those partitions which are mounted as RW to become Bad. This is what we call "NAND BURN".

    The partitions in NAND that are affected by OC are /data and /cache. This is because only these two partitons are mounted with RW access. As I mentioned above the increased Write access during OC is what causing the blocks to corrupt. All other partitions including /misc, /devlog, /boot, /system and /recovery are mounted as Read-Only and therefore are not affected.

    The Workaround for this dilemma is to disable both /data and /cache partitions ( By disable, I mean not even mounting them ) in NAND and use a portion of your SDcard to act as /data and /cache. This is what we are going to do.


    /* FOLLOWING PROCEDURE IS FOR AOSP ROMS ONLY */


    THE PROCEDURE
    ================


    The procedure consists of four parts. They are listed below:

    • Preparing The SDcard
    • Kernel Level Changes
    • Setting Up RamDisk
    • Removing Memory Increasing Script

    Detailed description of each part is given below:


    PART 1 : Preparing The SDcard
    ==========================


    ********YOU MUST USE CLASS 10 OR ATLEAST CLASS 6 SDCARD WITH MINIMUM 8GB CAPACITY*******

    CLASS 4 and CLASS 2 SDcards will definitely cause slow responsiveness because /data/data is on SDcard. Furthermore these SDcards can't handle OC at high frequencies and will die out quickly.

    SO PROCEED ONLY IF YOU ARE HAVING CLASS 6 OR CLASS 10 SDCARD. YOU CAN TRY CLASS 4 SDCARD BUT YOU CAN'T OVERCLOCK ABOVE A CERTAIN LIMIT AND NO GUARANTEE ABOUT HOW LONG THE CARD WILL LAST.

    We are going to create two EXT4 partitions ( First one for replacing /data and second one for replacing /cache in NAND ) on the SDcard, in addition to the normal FAT32 partition.

    Using MiniTool Partition Wizard, create two EXT4 partitions as shown in following figure:

    image.png



    For SD-DATA, you can give whatever size you want. This where the user applications are installed.
    For SD-CACHE, around 65MB is enough.

    You should keep the order in which partitions are created. Partition Type for both SD-DATA and SD-CACHE should be Primary.

    Assuming you have successfully prepared SDcard, lets go the second part:


    PART 2 : Kernel Level Changes
    ==========================


    First, you need to replace arch/arm/mach-msm/acpuclock-7201 with this one: https://dl.dropboxusercontent.com/u/95625633/acpuclock-7201.c
    This contains the overclocked frequencies and logic to dynamically calculate PLL2 values according to different frequencies.

    When you look through the overclocked frequencies, you can see I have disabled 900MHz. This is because Class 4 SDcards can't handle data rate at this frequency. Those who have Class 10 SDcards can enable and try whether it is stable for them.

    **** DO NOT OC GPU. ITS FAKE AND ACTUALLY DEGRADES PERFORMANCE. REVERT GPU OC IF YOU HAVE ENABLED IT ****

    Next, you need to edit the configuration file ( pico_defconfig in my case ) and enable the following option. Its disabled by default so you have to enable it:

    Code:
    [COLOR="Blue"][B]CONFIG_LBDAF=y[/B][/COLOR]

    That's all. Now compile your kernel.


    PART 3 : Setting Up RamDisk
    ========================


    Since, we are not using /data and /cache in NAND anymore, the changes must be made in RamDisk.
    All modifications are performed on init.rc file.

    Open init.rc and perform the following modifications:

    1. Find the following line:

    Code:
    [B][COLOR="Red"]mount yaffs2 [email protected] /data nosuid nodev[/COLOR][/B]

    Replace the above line with following:

    Code:
    [B][COLOR="Blue"]# Mount SD-DATA
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
        mount ext4 /dev/block/mmcblk0p2 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR][/B]

    2. Now find the following line:

    Code:
    [B][COLOR="Red"]mount yaffs2 [email protected] /cache nosuid nodev[/COLOR][/B]

    Replace the above line with following:

    Code:
    [B][COLOR="Blue"]# Mount SD-CACHE
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        mount ext4 /dev/block/mmcblk0p3 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR][/B]

    3. Since we are extensively using SDcard, we should adjust the read_ahead_kb parameter for maximum performance:
    Add the following lines after the line: mount ext4 /dev/block/mmcblk0p3 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue

    Code:
    [B][COLOR="Blue"]# SDcard read speed boost
        write /sys/block/mmcblk0/bdi/read_ahead_kb 2048[/COLOR][/B]


    PART 4 : Removing Memory Increasing Script
    =====================================


    *** This is very important. You should remove any memory increasing script that you were using. Because /data partition is now on SDcard, using memory increasing script will cause conflict and makes ROM unbootable. ***

    That's all, now you can flash your favourite ROM with the new OCed boot image and enjoy overclocking. :)

    NOTE: A new Recovery must be made to support the new /SD-CACHE partition.
    33
    /* FOLLOWING PROCEDURE IS FOR SENSE 4.1 ROM ONLY */


    THE PROCEDURE
    ================


    The procedure consists of four parts. They are listed below:

    • Preparing The SDcard
    • Kernel Level Changes
    • Setting Up RamDisk
    • Removing Memory Increasing Script

    Detailed description of each part is given below:


    PART 1 : Preparing The SDcard
    ==========================


    ********YOU MUST USE CLASS 10 OR ATLEAST CLASS 6 SDCARD WITH MINIMUM 8GB CAPACITY*******

    CLASS 4 and CLASS 2 SDcards will definitely cause slow responsiveness because /data/data is on SDcard. Furthermore these SDcards can't handle OC at high frequencies and will die out quickly.

    SO PROCEED ONLY IF YOU ARE HAVING CLASS 6 OR CLASS 10 SDCARD. YOU CAN TRY CLASS 4 SDCARD BUT YOU CAN'T OVERCLOCK ABOVE A CERTAIN LIMIT AND NO GUARANTEE ABOUT HOW LONG THE CARD WILL LAST.

    We are going to create three EXT4 partitions ( First one for /sd-ext, second one for replacing /data and third one for replacing /cache in NAND ) on the SDcard, in addition to the normal FAT32 partition.

    Using MiniTool Partition Wizard, create three EXT4 partitions as shown in following figure:

    image.png



    For SD-EXT, around 512MB is enough. It contains only system files.
    For SD-DATA, you can give whatever size you want. This where the user applications are installed.
    For SD-CACHE, around 65MB is enough.

    You should keep the order in which partitions are created. Partition Type for SD-EXT, SD-DATA and SD-CACHE should be Primary.

    Assuming you have successfully prepared SDcard, lets go the second part:


    PART 2 : Kernel Level Changes
    ==========================


    First, you need to replace arch/arm/mach-msm/acpuclock-7201 with this one: https://dl.dropboxusercontent.com/u/95625633/acpuclock-7201.c
    This contains the overclocked frequencies and logic to dynamically calculate PLL2 values according to different frequencies.

    When you look through the overclocked frequencies, you can see I have disabled 900MHz. This is because Class 4 SDcards can't handle data rate at this frequency. Those who have Class 10 SDcards can enable and try whether it is stable for them.

    **** DO NOT OC GPU. ITS FAKE AND ACTUALLY DEGRADES PERFORMANCE. REVERT GPU OC IF YOU HAVE ENABLED IT ****

    Next, you need to edit the configuration file ( pico_defconfig in my case ) and enable the following option. Its disabled by default so you have to enable it:

    Code:
    [COLOR="Blue"][B]CONFIG_LBDAF=y[/B][/COLOR]

    That's all. Now compile your kernel.


    PART 3 : Setting Up RamDisk
    ========================


    Since, we are not using /data and /cache in NAND anymore, the changes must be made in RamDisk.
    All modifications are performed on init.rc file.

    Open init.rc and perform the following modifications:

    1. Find the following line:

    Code:
    [B][COLOR="Red"]mount yaffs2 [email protected] /data nosuid nodev[/COLOR][/B]

    Replace the above line with following:

    Code:
    [B][COLOR="Blue"]
    # Mount SD-EXT
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
        mount ext4 /dev/block/mmcblk0p2 /sd-ext nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
    
    # Mount SD-DATA
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
    [/COLOR][/B]

    2. Now find the following line:

    Code:
    [B][COLOR="Red"]mount yaffs2 [email protected] /cache nosuid nodev[/COLOR][/B]

    Replace the above line with following:

    Code:
    [B][COLOR="Blue"]# Mount SD-CACHE
        wait /dev/block/mmcblk0p4
        wait /dev/block/mmcblk0p4
        wait /dev/block/mmcblk0p4
        wait /dev/block/mmcblk0p4
        mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR][/B]

    3. Since we are extensively using SDcard, we should adjust the read_ahead_kb parameter for maximum performance:
    Add the following lines after this line: mount yaffs2 [email protected] /persist nosuid nodev

    Code:
    [B][COLOR="Blue"]# SDcard read speed boost
        write /sys/block/mmcblk0/bdi/read_ahead_kb 2048[/COLOR][/B]


    PART 4 : Removing Memory Increasing Script
    =====================================


    *** This is very important. You should remove any memory increasing script that you were using. Because /data partition is now on SDcard, using memory increasing script will cause conflict and makes ROM unbootable. ***

    That's all, now you can flash your favourite ROM with the new OCed boot image and enjoy overclocking. :)

    NOTE: A new Recovery must be made to support the new /SD-DATA and /SD-CACHE partitions.
    7

    This method is only for Cyanogenmod ROMs. Dont try with Sense ROMs. For Sense ROMs, some modifications are required in the procedure.
    7
    Epic Bump :p

    Now, if you'd see, since CM10.2, the system apps' dalvik-cache became somewhat small to fit into /cache partition. This was the major cause of FC's. Until someone (idk if it was joilaroi, or sakindia123) decided to move this into /data.

    This is done using this line, in build.prop:

    Code:
    dalvik.vm.dexopt-data-only=1

    So, whatever files are created, are created *only* in /data, and /cache partition is totally unused.

    So therefore, we needn't be worrying about frying the /cache partition (it wouldn't happen as we ain't reading it?). Hence, just reverse-mounting the /data partition (using scripts like "int2ext" (not "int2ext+")) is enough. Also, to *not* worry about the /cache partition, we could mount it as RO, by adding a few lines to script ;)
    7
    @artistaditya
    @cute_prince can you tell me why we are using this configuration, what it's use?

    CONFIG_LBDAF=y

    and also tell me how to disable GPU OC?

    LBDAF => Large Block Device And Files. This configuration is required for mounting more than one ext2/3/4 partitions from SDcard. Without this option, you can mount only the very first ext2/3/4 partition (mmcblk0p2).

    To disable GPU OC, open devices-msm7x27a.c and locate the structure static struct kgsl_device_platform_data kgsl_3d0_pdata = { and delete the structure and its body completely. Now add following code there:

    Code:
    static struct kgsl_device_platform_data kgsl_3d0_pdata = {
    	.pwrlevel = {
    		{
    			.gpu_freq = 245760000,
    			.bus_freq = 200000000,
    		},
    		{
    			.gpu_freq = 192000000,
    			.bus_freq = 160000000,
    		},
    		{
    			.gpu_freq = 133330000,
    			.bus_freq = 0,
    		},
    	},
    	.init_level = 0,
    	.num_levels = 3,
    	.set_grp_async = set_grp_xbar_async,
    	.idle_timeout = HZ,
            .strtstp_sleepwake = true,
    	.nap_allowed = false,
    	.clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM,
    };