SGY Kernel Patch

Search This thread

irfanbagus

Senior Member
Mar 12, 2012
307
498
from README file :

CpuFreq Patch for Samsung Galaxy Y (S5360)
==========================================

what this patch do
------------------
1. add additional freq to cpufreq 624mhz, make it have 3 freq scaling
(312,624,832 mhz)
2. fix bug while reading
"/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies"
that bug make cpu spy not working.

Apply patch
-----------
1. copy all patch files outside kernel source dir. dir should be like this

kernel/common/
kernel/modules/
bcm_cpufreq.c.patch
clock-21553.c.patch
device.c.patch

2. goto kernel/common

$cd kernel/common

3. apply patch

$patch -p2 < ../../bcm_cpufreq.c.patch
$patch -p2 < ../../clock-21553.c.patch
$patch -p2 < ../../device.c.patch

4. build kernel

Note
----
this patch work using clock mode betwen 0xC (312mhz) and 0xF (832mhz) in
file "clock-21553.c". 0xD and 0xE working on same frequency 624mhz. don't
know yet whitch one to use (i use 0xE), so please contact me if you have
more information. right now this patch only effectife if you using
performance (or powersave) with app to control it (like setcpu). not
limitation of patch, but bcm21553 governor look like
ignore scaling_{min|max}_freq.

if you capable, please review my patch. scaling_available_frequencies
related is pretty safe. if you only interested to that part, get it from
file "bcm_cpufreq.c.patch" which call "cpufreq_frequency_table_get_attr"
and "cpufreq_frequency_table_put_attr". the other i am not sure yet. i am
still test it about 2-3 days.

i am not experiance creating patch file, so check file before apply and
tell me if i do it wrong. but patch is so small, apply it manually not
going to hurt you :D

i include test build (boot-sgy.tar). flash it with odin (pda) if you want
to try. it close to stock kernel only with patch and powersave governor
enable. and like usual, i am not responsible if some thing bad (or good)
happen to you device.

additional note :
- this patch for samsung's GT-S5360_GB_Opensource_Update2.zip kernel source
- this thread is about patch, not custom kernel. i include kernel test build only to make easy if someone need test it. so please don't request features like a2sd, cwm,etc.
- this patch is alpha quality. i already testing (>2 days) before submit here. but some of patch work on low level system and maybe effect on long term usage. until it fully tested, use only for testing purpose and remove from your device when done.
- i make small mistake in "apply kernel" part on README file inside archive. i already corrected the one in this thread. sorry.

Link
http://www.mediafire.com/download.php?08gwuw8et04bg4r
 

Attachments

  • SC20120328-225447.png
    SC20120328-225447.png
    24.9 KB · Views: 1,998
Last edited:

mai77

Senior Member
Nov 16, 2011
1,429
580
pretty decent

wow. excellent patch.

for tapatalk users it may come in handy to have the kernel available as attachment to run KernelUpdate on.

don't miss out on CPU-spy app.
 

Attachments

  • boot.img
    4.3 MB · Views: 108

PREMOLIKES

Senior Member
Mar 23, 2009
1,202
105
Imphal
What Iam saying, if the kernel is Oc to 1Ghz, and uc to 200 Mhz.Do I have to modify for every kernel, And do we open boot.img and put it there.
 

mai77

Senior Member
Nov 16, 2011
1,429
580
no. instead of patching a binary, we patch the kernel source code.

with this kernel we should be able to find out, whether clockspeed changes are working.

for that purpose, some PROPER and accurate benchmarking may be performed.
 

irfanbagus

Senior Member
Mar 12, 2012
307
498
What Iam saying, if the kernel is Oc to 1Ghz, and uc to 200 Mhz.Do I have to modify for every kernel, And do we open boot.img and put it there.

you need apply patch to kernel source and rebuild. that source patch, not binary patch. but you can't make sgy work on 200Mhz or 1Ghz. 312,624,832 is not random number, it's multiple of 26mhz (or 13mhz) which is base frequency of sgy.
 

mai77

Senior Member
Nov 16, 2011
1,429
580
so maybe it is not 200.000 MHz precisely, but a multiple of a base frequency

clock frequency can be changed at intervals only

---------- Post added at 05:39 AM ---------- Previous post was at 05:37 AM ----------

cpu tuner seems to be at ease with this kernel, btw

---------- Post added at 05:49 AM ---------- Previous post was at 05:39 AM ----------

"benchmark & tuning trial" app also displays the percentage of total time spent at a given f, like cpu spy
 

sasan258

Senior Member
Feb 14, 2012
71
9
Cebu
i'll try this later..

i hope this thread will not be deleted.. this is a great help for our device
 

ronnieryan

Senior Member
Jan 9, 2012
2,280
939
Dumaguete
@whitexp : just a favor ,buddy can you run linpack test and see if the freq 624 works?
i will try it later today, but am still doin some stuff, looking for reference books.:D
 

mai77

Senior Member
Nov 16, 2011
1,429
580
at some point we might also look at this "cpu spy" app. it is open source. maybe we should rack our brains whether that app can be improved on in some way.
 

ronnieryan

Senior Member
Jan 9, 2012
2,280
939
Dumaguete
So all we have to do is flash boot.img via SGYbiCWM,

BTW the boot.img is a stock kernel of what? Based on what firmware? (what i mean for example is that is it a stock kernel of DDLA1?)
 
Last edited:

mai77

Senior Member
Nov 16, 2011
1,429
580
it's in the post#1. very close to stock kernel of that samsung update file.
focus is on setting clockspeed.

which stock rom version used that particular version of published source code, I don't know. build timestamp may tell.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    from README file :

    CpuFreq Patch for Samsung Galaxy Y (S5360)
    ==========================================

    what this patch do
    ------------------
    1. add additional freq to cpufreq 624mhz, make it have 3 freq scaling
    (312,624,832 mhz)
    2. fix bug while reading
    "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies"
    that bug make cpu spy not working.

    Apply patch
    -----------
    1. copy all patch files outside kernel source dir. dir should be like this

    kernel/common/
    kernel/modules/
    bcm_cpufreq.c.patch
    clock-21553.c.patch
    device.c.patch

    2. goto kernel/common

    $cd kernel/common

    3. apply patch

    $patch -p2 < ../../bcm_cpufreq.c.patch
    $patch -p2 < ../../clock-21553.c.patch
    $patch -p2 < ../../device.c.patch

    4. build kernel

    Note
    ----
    this patch work using clock mode betwen 0xC (312mhz) and 0xF (832mhz) in
    file "clock-21553.c". 0xD and 0xE working on same frequency 624mhz. don't
    know yet whitch one to use (i use 0xE), so please contact me if you have
    more information. right now this patch only effectife if you using
    performance (or powersave) with app to control it (like setcpu). not
    limitation of patch, but bcm21553 governor look like
    ignore scaling_{min|max}_freq.

    if you capable, please review my patch. scaling_available_frequencies
    related is pretty safe. if you only interested to that part, get it from
    file "bcm_cpufreq.c.patch" which call "cpufreq_frequency_table_get_attr"
    and "cpufreq_frequency_table_put_attr". the other i am not sure yet. i am
    still test it about 2-3 days.

    i am not experiance creating patch file, so check file before apply and
    tell me if i do it wrong. but patch is so small, apply it manually not
    going to hurt you :D

    i include test build (boot-sgy.tar). flash it with odin (pda) if you want
    to try. it close to stock kernel only with patch and powersave governor
    enable. and like usual, i am not responsible if some thing bad (or good)
    happen to you device.

    additional note :
    - this patch for samsung's GT-S5360_GB_Opensource_Update2.zip kernel source
    - this thread is about patch, not custom kernel. i include kernel test build only to make easy if someone need test it. so please don't request features like a2sd, cwm,etc.
    - this patch is alpha quality. i already testing (>2 days) before submit here. but some of patch work on low level system and maybe effect on long term usage. until it fully tested, use only for testing purpose and remove from your device when done.
    - i make small mistake in "apply kernel" part on README file inside archive. i already corrected the one in this thread. sorry.

    Link
    http://www.mediafire.com/download.php?08gwuw8et04bg4r
    4
    @maroc-os
    thank you. i know the voltage to low, but on that value, at least on my phone, still working fine. basically you can change to whatever value as long as supported by regulator and cpu working stable. but i agree if someone need apply this patch, the value need to adjust. and i found that this phone cannot work more than 832mhz without change pll. but once we change pll (if possible) other part of system will oc to.

    @mai
    complaining about what ? working fine in my phone with no-frill and setcpu. the problem with this patch is bcm21553 governor still not aware at all about freq 624mhz so only powersave and performance can work at that freq. but maybe maroc right, the voltage to low for your phone, make it unstable in 624mhz. btw, got my pm ?
    3
    pretty decent

    wow. excellent patch.

    for tapatalk users it may come in handy to have the kernel available as attachment to run KernelUpdate on.

    don't miss out on CPU-spy app.
    3
    What Iam saying, if the kernel is Oc to 1Ghz, and uc to 200 Mhz.Do I have to modify for every kernel, And do we open boot.img and put it there.

    you need apply patch to kernel source and rebuild. that source patch, not binary patch. but you can't make sgy work on 200Mhz or 1Ghz. 312,624,832 is not random number, it's multiple of 26mhz (or 13mhz) which is base frequency of sgy.
    3
    Hey Good Work,

    am stopped working on the OV/UC for a while to finish the cwm version

    You know that the voltage-Frequency mapping is not correct but it can be done look for this frequencies below you can have 7 choises ;)

    #define BCM_CORE_CLK_1GB BCM21553_CORECLK_KHZ_988
    #define BCM_CORE_CLK_936 BCM21553_CORECLK_KHZ_936
    #define BCM_CORECLK_TURBO BCM21553_CORECLK_KHZ_832
    #define BCM_CORE_CLK_624 BCM21553_CORECLK_KHZ_624
    #define BCM_CORE_CLK_507 BCM21553_CORECLK_KHZ_507
    #define BCM_CORE_CLK_NORMAL BCM21553_CORECLK_KHZ_312
    #define BCM_CORE_CLK_251 BCM21553_CORECLK_KHZ_251

    and give them the frequencies in include/arch/bcm21553....

    BCM21553_CORECLK_KHZ_988 = (988U * 1000),
    BCM21553_CORECLK_KHZ_936 = (936U * 1000),
    BCM21553_CORECLK_KHZ_832 = (832U * 1000),
    BCM21553_CORECLK_KHZ_624 = (624U * 1000),
    BCM21553_CORECLK_KHZ_507 = (507U * 1000),
    BCM21553_CORECLK_KHZ_312 = (312U * 1000),
    BCM21553_CORECLK_KHZ_251 = (251U * 1000),

    the voltage-frequencies we have just the correct values for 832 & 312

    try 1390000 for 1GB and 1000000 for 251