Samsung releases Galaxy S4 Kernel source – GT-I9500, GT-I9505 & SGH-I337M

Search This thread

AndreiLux

Senior Member
Jul 9, 2011
3,209
14,598
I will be updating in this thread shortly about proper information about the last unknown things concerning the phones...

Edit: How big is this thing?!

Edit: 372mB, they included various new things in their platform sources, seems they released the source for the Samsung Browser which seems to be the bulk of the increased size.

The 5410 now has proper independent power-gating in its CPUIdle driver.

The CPUFreq driver is populated from 200MHz up until 1300MHz for the A7 cores and 2000MHz for the A15 cores in 100MHz steps.

The shipping CPU already is in its second revision REV_2_0.

The shipping frequencies are 500MHz to 1200MHz for the A7 cores, 800MHz to 1600MHz for the A15 cores.

EDIT: When the IKS is active, which means at all times, then the CPU is set up to run in "turbo"-like configurations, if 1 A15 is active, max frequency is 1800, 2 are active, it is 1700, if all >2 big CPUs are on, 1600MHz is the maximum frequency. I'm still reading through the max index they setup there so I can't confirm this behaviour yet, but it's there in the code.

EDIT: The above logic seems to be disabled any only valid once the CPU was actually set to 1800MHz as maximum, there is no turbo at max of 1600MHz. This probably explains the previous benchmarks and so on of it showing 1800, but never reaching those frequencies.

Hotplugging seems to be DEAD! Finally!

The GPU _is_ running at 532MHz. There is a define for to ommit the last frequency step in the driver and limit it to 480MHz, however, in the released source this is not used and the frequency is 532MHz.
Code:
	#define DOWN_STEP_OLD		1100000
	#define DOWN_STEP_NEW		600000
	#define UP_STEP_OLD		550000
	#define UP_STEP_NEW		600000
	#define STEP_LEVEL_CA7_MAX	600000
	#define STEP_LEVEL_CA15_MIN	800000

	if (freqs[cur]->old <= UP_STEP_OLD  && target_freq > UP_STEP_NEW)
		target_freq = STEP_LEVEL_CA7_MAX;

	if (freqs[cur]->old >= DOWN_STEP_OLD && target_freq < DOWN_STEP_NEW) {
		if (strcmp(policy->governor->name, "ondemand") == 0)
			target_freq = STEP_LEVEL_CA15_MIN;
		else
			target_freq = STEP_LEVEL_CA7_MAX;
	}

	if (cur == CA15 && target_freq < freq_min[CA15]) {
		do_switch = 1;	/* Switch to Little */
	} else if (cur == CA7 && user_set_eagle_count > get_num_CA15()
			&& target_freq > freq_max[CA7]) {
		do_switch = 1;	/* Switch from LITTLE to big */
		if (count > 0 && count < 4 &&
			target_freq > exynos_info[cur]->max_op_freqs[count + 1])
				later = true;
	}
This is basically the switching logic. The A7 cores are mapped to the A15 frequency at half speed, the frequency table as such means it's 1:1 A15 clocks up until 1200MHz.

There are two conditions to switching from A15's to A7's:

An A15 core will need to be above 1100MHz (real) for the previous sampling period, and the new (current target) virtual frequency to be below 600MHz (1200MHz A7) to trigger an override of the CPUFreq logic and initiate a jump from A15 to A7's, however it doesn't directly switch: Ondemand is the default governor, so what it seems to be doing is to have a stop-over at the minimum A15 frequency / 800MHz for a frequency period and let the next sample decide what to do.

An A7 core will need to be at 550 virtual (1100MHz A7) for its previous sampling period, and over 600 virtual (1200MHz A7) to switch to an A15 core, however again, this is not the actual switching, it's sitting again for another sample at 1200MHz real frequency before it lets the next sample decide.

The actual switching is simple: if frequency reaches 800MHz, we go to A7's, if it goes to 650 (1300 == freq_max[CA7]) it goes to A15.

The whole thing is a bit shenanigans in logic, but I suppose they do it so that the cores don't do too much fine-grained switching and the above logic flattens out the frequency jumps.

EDIT: There's plenty of evidence of a global LTE enabled 5410 device, the kernel even has the usual modem drivers for it and GPIO board definitions.

I think most of the more interesting stuff is already cleared up now.
 
Last edited:

prodigyX

Senior Member
Jul 19, 2011
283
89
Durban
Does this mean that i9500 owners will be able to clock up to 1.8 to keep up with those fancy Koreans? :D
 

Turbotab

Senior Member
May 2, 2011
902
819
I will be updating in this thread shortly about proper information about the last unknown things concerning the phones...

Edit: How big is this thing?!

Edit: 372mB, they included various new things in their platform sources, seems they released the source for the Samsung Browser which seems to be the bulk of the increased size.

The 5410 now has proper independent power-gating in its CPUIdle driver.

The CPUFreq driver is populated from 200MHz up until 1300MHz for the A7 cores and 2000MHz for the A15 cores in 100MHz steps.

The shipping CPU already is in its second revision REV_2_0.

The shipping frequencies are 500MHz to 1300MHz for the A7 cores, 800MHz to 1600MHz for the A15 cores.

I'm trying to DL the 9505 sources atm, 28 KB/s on a 50+ Mb/s line, come on Samsung:crying: On the octa, is the voltage table populated for frequencies over 1600 MHz?, if so is there a big jump?
 

yahyoh

Senior Member
Nov 7, 2011
4,867
1,929
Amman
I'm trying to DL the 9505 sources atm, 28 KB/s on a 50+ Mb/s line, come on Samsung:crying: On the octa, is the voltage table populated for frequencies over 1600 MHz?, if so is there a big jump?

LOL i tried to download the 9500 source but the download speed ridiculously slow ( 20KB - 50KB ) WTF my download speed normally about 1.4MB
they seems only have 1MB LINE for the server :silly::silly::silly:

edit : Andrei how the voltage table, is it much lower than Exynos 4412 ( 32NM vs 28NM ) ? what 1.6GHz voltage ?
and can u check what the DAC model ? is it Wolfson 5102?
:)
 
Last edited:

AndreiLux

Senior Member
Jul 9, 2011
3,209
14,598
I'm trying to DL the 9505 sources atm, 28 KB/s on a 50+ Mb/s line, come on Samsung:crying: On the octa, is the voltage table populated for frequencies over 1600 MHz?, if so is there a big jump?
They're populated, but only with a dummy 1300mV max value.

I got both sources at 900kB/s so I guess I got lucky before everybody and their grandma started downloading them for kicks.
 

shadym1lkman

Senior Member
Aug 19, 2008
100
20
So is this better than with the S3 because everyone was complaining about missing kernels and incomplete source.

samsung seems to have stepped up. the 9500 should be OC'd in short order.

What about the freqcheck, how often is it sampling to change the frequency?
 

pack21

Senior Member
Dec 14, 2009
2,102
227
If this is good....yup.


I never have a Galaxy, so i dont know...lol
 
Last edited:

DubelBoom

Senior Member
Jan 10, 2011
1,832
321
Did Samsung finally release proper sources with documentation?!?!?!?!
If so, I really hope they will do the same with the Note II and S3 quickly!!!!!!
 

CQ7

Senior Member
Mar 18, 2007
335
53
EDIT: There's plenty of evidence of a global LTE enabled 5410 device, the kernel even has the usual modem drivers for it and GPIO board definitions.

I think most of the more interesting stuff is already cleared up now.

Does it means that i9500 could be LTE capable?

Inviato dal mio GT-I9000 con Tapatalk 2
 

Stevemeister

Senior Member
Dec 25, 2011
643
224
Did Samsung finally release proper sources with documentation?!?!?!?!
If so, I really hope they will do the same with the Note II and S3 quickly!!!!!!

I think you should read more into the whole sources and documentation story, you obviously don't get it.
Long story short, these are kernel sources and not the sources the CM team needs.
 
  • Like
Reactions: DubelBoom

DubelBoom

Senior Member
Jan 10, 2011
1,832
321
I think you should read more into the whole sources and documentation story, you obviously don't get it.
Long story short, these are kernel sources and not the sources the CM team needs.

I don't understand the technical info (English is not my mother language, and definitely not at tech things), but I did knew something was missing. Sadly, its not this :(
Thanks!
 

Cali3350

Senior Member
Jan 26, 2011
67
0
I will be updating in this thread shortly about proper information about the last unknown things concerning the phones...

The GPU _is_ running at 532MHz. There is a define for to ommit the last frequency step in the driver and limit it to 480MHz, however, in the released source this is not used and the frequency is 532MHz.
Code:
	#define DOWN_STEP_OLD		1100000
	#define DOWN_STEP_NEW		600000
	#define UP_STEP_OLD		550000
	#define UP_STEP_NEW		600000
	#define STEP_LEVEL_CA7_MAX	600000
	#define STEP_LEVEL_CA15_MIN	800000

	if (freqs[cur]->old <= UP_STEP_OLD  && target_freq > UP_STEP_NEW)
		target_freq = STEP_LEVEL_CA7_MAX;

	if (freqs[cur]->old >= DOWN_STEP_OLD && target_freq < DOWN_STEP_NEW) {
		if (strcmp(policy->governor->name, "ondemand") == 0)
			target_freq = STEP_LEVEL_CA15_MIN;
		else
			target_freq = STEP_LEVEL_CA7_MAX;
	}

	if (cur == CA15 && target_freq < freq_min[CA15]) {
		do_switch = 1;	/* Switch to Little */
	} else if (cur == CA7 && user_set_eagle_count > get_num_CA15()
			&& target_freq > freq_max[CA7]) {
		do_switch = 1;	/* Switch from LITTLE to big */
		if (count > 0 && count < 4 &&
			target_freq > exynos_info[cur]->max_op_freqs[count + 1])
				later = true;
	}

Strcmp? An unbounded string compare Samsung? For Shame.
 

leuk_he

Member
May 12, 2011
36
10
I did not download the source, but it clearly says "kernel"source. Isn't the issue that the drivers in the SGIII were not open sourced, yes, the Exynos non-support was an issue, but is there enough in this source release?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 31
    I will be updating in this thread shortly about proper information about the last unknown things concerning the phones...

    Edit: How big is this thing?!

    Edit: 372mB, they included various new things in their platform sources, seems they released the source for the Samsung Browser which seems to be the bulk of the increased size.

    The 5410 now has proper independent power-gating in its CPUIdle driver.

    The CPUFreq driver is populated from 200MHz up until 1300MHz for the A7 cores and 2000MHz for the A15 cores in 100MHz steps.

    The shipping CPU already is in its second revision REV_2_0.

    The shipping frequencies are 500MHz to 1200MHz for the A7 cores, 800MHz to 1600MHz for the A15 cores.

    EDIT: When the IKS is active, which means at all times, then the CPU is set up to run in "turbo"-like configurations, if 1 A15 is active, max frequency is 1800, 2 are active, it is 1700, if all >2 big CPUs are on, 1600MHz is the maximum frequency. I'm still reading through the max index they setup there so I can't confirm this behaviour yet, but it's there in the code.

    EDIT: The above logic seems to be disabled any only valid once the CPU was actually set to 1800MHz as maximum, there is no turbo at max of 1600MHz. This probably explains the previous benchmarks and so on of it showing 1800, but never reaching those frequencies.

    Hotplugging seems to be DEAD! Finally!

    The GPU _is_ running at 532MHz. There is a define for to ommit the last frequency step in the driver and limit it to 480MHz, however, in the released source this is not used and the frequency is 532MHz.
    Code:
    	#define DOWN_STEP_OLD		1100000
    	#define DOWN_STEP_NEW		600000
    	#define UP_STEP_OLD		550000
    	#define UP_STEP_NEW		600000
    	#define STEP_LEVEL_CA7_MAX	600000
    	#define STEP_LEVEL_CA15_MIN	800000
    
    	if (freqs[cur]->old <= UP_STEP_OLD  && target_freq > UP_STEP_NEW)
    		target_freq = STEP_LEVEL_CA7_MAX;
    
    	if (freqs[cur]->old >= DOWN_STEP_OLD && target_freq < DOWN_STEP_NEW) {
    		if (strcmp(policy->governor->name, "ondemand") == 0)
    			target_freq = STEP_LEVEL_CA15_MIN;
    		else
    			target_freq = STEP_LEVEL_CA7_MAX;
    	}
    
    	if (cur == CA15 && target_freq < freq_min[CA15]) {
    		do_switch = 1;	/* Switch to Little */
    	} else if (cur == CA7 && user_set_eagle_count > get_num_CA15()
    			&& target_freq > freq_max[CA7]) {
    		do_switch = 1;	/* Switch from LITTLE to big */
    		if (count > 0 && count < 4 &&
    			target_freq > exynos_info[cur]->max_op_freqs[count + 1])
    				later = true;
    	}
    This is basically the switching logic. The A7 cores are mapped to the A15 frequency at half speed, the frequency table as such means it's 1:1 A15 clocks up until 1200MHz.

    There are two conditions to switching from A15's to A7's:

    An A15 core will need to be above 1100MHz (real) for the previous sampling period, and the new (current target) virtual frequency to be below 600MHz (1200MHz A7) to trigger an override of the CPUFreq logic and initiate a jump from A15 to A7's, however it doesn't directly switch: Ondemand is the default governor, so what it seems to be doing is to have a stop-over at the minimum A15 frequency / 800MHz for a frequency period and let the next sample decide what to do.

    An A7 core will need to be at 550 virtual (1100MHz A7) for its previous sampling period, and over 600 virtual (1200MHz A7) to switch to an A15 core, however again, this is not the actual switching, it's sitting again for another sample at 1200MHz real frequency before it lets the next sample decide.

    The actual switching is simple: if frequency reaches 800MHz, we go to A7's, if it goes to 650 (1300 == freq_max[CA7]) it goes to A15.

    The whole thing is a bit shenanigans in logic, but I suppose they do it so that the cores don't do too much fine-grained switching and the above logic flattens out the frequency jumps.

    EDIT: There's plenty of evidence of a global LTE enabled 5410 device, the kernel even has the usual modem drivers for it and GPIO board definitions.

    I think most of the more interesting stuff is already cleared up now.
    8
    put the kernel only on github will be nice :)
    I already did that some time ago: AndreiLux/Perseus-UNIVERSAL5410 https://github.com/AndreiLux/Perseus-UNIVERSAL5410
    1
    Did Samsung finally release proper sources with documentation?!?!?!?!
    If so, I really hope they will do the same with the Note II and S3 quickly!!!!!!

    I think you should read more into the whole sources and documentation story, you obviously don't get it.
    Long story short, these are kernel sources and not the sources the CM team needs.
    1
    Strcmp? An unbounded string compare Samsung? For Shame.
    ... so? The whole Linux kernel might have a word or two with you on the matter http://lxr.free-electrons.com/ident?i=strcmp