SGY Kernel Patch

Search This thread

vivekkalady

Inactive Recognized Developer
Aug 11, 2009
1,433
1,761
Trivandrum
This way we can add more frequencies.But anyone confirmed that this intermediate frequency is properly working??

Note : the picture in the first post shows that 832 is never used.please play some High games on your phone for testing that the clock reaches the 832 Mhz
 
Last edited:
  • Like
Reactions: mai77

irfanbagus

Senior Member
Mar 12, 2012
307
498
that is right but posting CPU spy with 832 frequency used will be good

that cpu freq profile based on SetCPU usage with performance gov max 624mhz by default and powersave gov min 312mhz when screen off. i use SetCPU because bcm21553 gov still not aware about 624mhz and ondemand still not working, so no dynamic governor can working on 624mhz. cpu only working in 832mhz while boot process (before SetCPU running).

btw here is my linpack result :

312Mhz - 5.535 MFLOPS
624Mhz - 7.946 MFLOPS
832Mhz - 10.158 MFLOPS

what strange with that number is, all test now result higher number. 2 days a go on 832mhz my result only 10.0xx mflops and on 312mhz 4.0xx mflops. i don't know why, but yesterday i did update 9 apps in my phone. so maybe that update make my phone performance better, because some of them running as service. maybe someone with stock kernel can confirm that.
 
  • Like
Reactions: mai77

mai77

Senior Member
Nov 16, 2011
1,429
580
it may make sense to benchmark only with the charger plugged in on DC power supply ?
 

Maroc-OS

Retired Recognized Developer
Mar 16, 2012
886
3,631
Casablanca
www.merruk.com
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
 

mai77

Senior Member
Nov 16, 2011
1,429
580
ideally one would wish no-frills would set any available value without complaining after reboot. currently no-frills keeps complaining.
 

Maroc-OS

Retired Recognized Developer
Mar 16, 2012
886
3,631
Casablanca
www.merruk.com
ideally one would wish no-frills would set any available value without complaining after reboot. currently no-frills keeps complaining.

if you see that about this hook, that's because the 624 has no correct voltage in this patch ;)

am not tried the patch but when i give you the cwm a will continues working.

BTW: i created a repo for the kernel need only the cwm and i upload ;) i hope the team are ready :)
 
  • Like
Reactions: whitexp

irfanbagus

Senior Member
Mar 12, 2012
307
498
@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 ?
 

mai77

Senior Member
Nov 16, 2011
1,429
580
gdb

to debug the kernel in the emulator:

Configure the kernel by hand to include debugging symbols:

cd kernel
make menuconfig

Select Kernel hacking or whatever it is called and select the item which says to compile the kernel with debugging info.

make
cd ..

When starting the emulator use sth. like: (but change the openbsd refs to linux)

out/host/openbsd-x86_64/bin/emulator -show-kernel -system out/target/product/generic -kernel kernel/arch/arm/boot/zImage -logcat *:v -qemu -monitor telnet::4444,server -s

then it will sit waiting for you to prepare your gdb session:

prebuilt/openbsd-x86_64/toolchain/arm-eabi-4.2.1/bin/arm-eabi-gdb kernel/vmlinux
(gdb) br sys_execve (or some other place you want to gain control)
(gdb) target remote localhost:1234

and then, in another window, release qemu by attaching to its monitor:

telnet localhost 4444
(qemu) cont
 
Last edited:

irfanbagus

Senior Member
Mar 12, 2012
307
498
thanks mai, unfortunately emulator (qemu) not going help in this case. unless broadcom release bcm21533 emulator :D

i have good and bad news. good news : the patch is work, means my assumption about freq control in bcm21533 maybe right. bad news : we stuck in 832MHz, at lest until got new data/info. 832MHz already use biggest mode and pll divider register is read-only (at least from software)

other 'bad' news is, look like under clock will not give big boost in battery performance. look at my attached image, that's cpu freq state from my phone after more than 2 days (data off, wifi on when screen on, 624MHz performance while screen on, 312MHz performance while screen off). for normal usage (text,phone,light game/browsing) the phone spend more than 50% in deep sleep. add improvement to cpufreq will not help much and maybe event make it worse (search about "race-to-idle").
 

Attachments

  • SC20120330-192511.png
    SC20120330-192511.png
    24.5 KB · Views: 208

irfanbagus

Senior Member
Mar 12, 2012
307
498

there is no such number. :p
f is biggest notation in hexadecimal. next to 0xf is 0x10, but i don't think that mode exist. the kernel even explicitly cut mode to 0xf. but that's just my opinion, i don't try yet, so if you want to try please do it and let me and others know the result.

the fact that pll divider register/memory is expose maybe show that value can be change. but maybe only can change with set some flag bit or only possible using hardware programmer. without more info/doc almost impossible to know.

hmm this phone's chipset is not really flexible i think..

from price/features stand point, bcm21533 is good deal. it have usb-otg, and (possibility) build-in audio equalizer. the problems is samsung (and broadcom) don't use all the features and don't even release any documentation about it.
 

ARVolutionz

Senior Member
Mar 12, 2012
163
48
27
lol i thought that was a "legit" variable.. :D
the phone sets to 832 (maybe) only when 624 mhz is running at 80% usage.. so thats just a maybe to me..
 

irfanbagus

Senior Member
Mar 12, 2012
307
498

i did, and no kernel source for 1ghz. and some micro have non changeable register/memory. it's like fuse, once written they store the value forever, or if possible can change use special programmer (usually using jtag). if this is what we got, good bye overclock :D

What is this bro???? another kernel besides maroc?

not 'complete' kernel, just patch. please read first post.
 

championswimmer

Inactive Recognized Developer
Oct 22, 2011
5,018
8,446
New Delhi
android.championswimmer.tk
hi friend

i notice we have already got overclock on 5360 ...
but i'm currently trying to work on S6120 (i.e. Galaxy Y Duos)

it uses same processor bcm-21553

so overclocking and enabling 624mhz etc should work here too

i just want to know what changes are need to clock-21553.c file to get other frequencies working??

i have developed only snapdragon kernels till now and the bcm clock file is giving me headaches

any help will be appreciated


the kernel sources for S6102 i have pushed to github (as of now, without any changes at all made to original sources..totally untouched)

https://github.com/championswimmer/kCernel-S6120
 

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