[Galaxy Y GT-S5360 Android Development] Master_Key:
Hi there, many of you would know me. :)

I am back after a short while, well actually I am here just to help you guys with overclocking. Neither do I have any resource such as high end cpu or hdd space to compile a kernel nor do I have a stable galaxy y as of NOW.

Now all the mathematics and programming geniuses, I need you all here. I am inviting all the developers who can ACTUALLY help. No questions from someone who has just started or something like that. For them I suggest you read a lot about processors first.

The overclock that developers till now have achieved as you all know, DOES NOT INCREASE MFLOPS.

After studying a lot about the arm11 processors. I know that the freq values we set are only the freq which are visible to users in apps. They are just registered so that users can view them as working.

ONLY PROCEED BELOW IF YOU KNOW ABOUT PROGRAMMING.

People who know about programming but not about ARM architecture visit this link : http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0328e/CHDEHCAB.html

Now there are two critical values which define the val, they are m_set and n_set.

The freq table that we create is just an imposture to the real clock. If you study msm boards then you'll notice they feed in the values as *speed->clk=x 000 (converts to mhz). We don't have a clock-21553.c in that manner.

Rather we have this.

long bcm21553_uart_find_m_n(unsigned long freq_val, long *m_set, long *n_set)

{

long factor = 0;	/* = m/n */

long eq_2_val = MAX_UART_M_VAL + MAX_UART_N_VAL;

long n_val = 0;

long long n_iter = 0;

long long m_iter = 0;

long long left = 0;

long long right = 0;

long long diff = 0;

long long least_diff = 0;

long long least_diff_m_iter = 1;

long long least_diff_n_iter = 1;

long long val = 0;

long ret_val;

/* Formula : Freq = (156MHz * n) / m. */

if (freq_val > FREQ_MHZ(156)) {	/* Can't have freq greater than 156MHz. */

return -EINVAL;

} else if (freq_val == FREQ_MHZ(156)) {

*m_set = *n_set = 1;

return FREQ_MHZ(156);

}

*m_set = 0;

*n_set = 0;

factor = FREQ_MHZ(156) / freq_val;

/* range of m : 0 <= m <= 0x1ff */

/* range of n : 0 <= n <= 0x1ff */

/* Equation 1 : factor = m /n. */

/* so m = (factor * n). */

/* Equation 2 : m + n <= 0x1ff + 0x1ff. */

/* m + n <= (2 * 0x1ff) ; Let's call (2 * 0x1ff) as eq_2_val. */

/* so m + n <= eq_2_val. */

/* Substiture eq1 in eq2. */

/* (factor * n) + n <= eq_2_val. */

/* taking n common : */

/* (factor + 1) * n <= eq_2_val. */

/* so n <= eq_2_val / (factor + 1). <==== This is a very important conclusion. */

/* Now the logic is to iterate(iter) till n, and

* find a value of m, where m = 156MHz * iter / val. */

n_val = eq_2_val / (factor + 1);

pr_info("n_val = %ld, eq_2_val = %ld, factor = %ld\n", n_val, eq_2_val,

factor);

n_iter = 0;

diff = 1;

least_diff = 0xffffffff;

val = freq_val;

while ((n_iter <= n_val) && (diff != 0)) {

n_iter++;

left = FREQ_MHZ(156) * n_iter;

m_iter = 0;

while ((m_iter <= MAX_UART_M_VAL) && (diff != 0)) {

m_iter++;

right = val * m_iter;

/* Always left side must be greater than right. So diff has to be positive. */

diff = left - right;

if ((diff > 0) && (diff < least_diff)) {

least_diff = diff;

least_diff_m_iter = m_iter;

least_diff_n_iter = n_iter;

}

/* pr_info("n_iter = %lld, m_iter = %lld, left = %lld, \

right = %lld, diff = %lld, least_diff = %lld, \

least_diff_m_iter = %lld, \

least_diff_n_iter = %lld\n",

n_iter, m_iter, left, right, diff, least_diff,

least_diff_m_iter, least_diff_n_iter); */

}

}

/* if diff == 0, it means we found a perfect, m, and n value. */

if (diff == 0) {

/* pr_info("We found the correct, m, n values. \

m = %lld, n= %lld\n", m_iter, n_iter); */

*m_set = m_iter;

*n_set = n_iter;

return val;

} else {

/* This means we didn't find a good m,n value. */

*m_set = least_diff_m_iter;

*n_set = least_diff_n_iter;

ret_val = (((FREQ_MHZ(156) / *m_set)) * *n_set);

/* pr_info("Didn't find a perfect m, n value, but will given \

the nearest possible value. m = %lld, n = %lld, \

freq = %ld\n", least_diff_m_iter,

least_diff_n_iter, ret_val) ; */

return ret_val;

}

}

NO SPAMMING IN THIS THREAD.

Stakes were high, time was taken but finally the work is completed, goal achieved.

Now might be a good time to say that we are a COMMUNITY, we help each other to make one device better.

Also could be a good time to take a new initiative, to take up something new as a project.