PCLK is the source for the SPI clock. As per bootup msgs and source structs:
S3C24XX Clocks, Copyright 2004 Simtec Electronics
CPU: MPLL on 800.000 MHz, cpu 400.000 MHz, mem 133.333 MHz, pclk 66.666 MHz
CPU: EPLL on 96.000 MHz, usb-bus 48.000 MHz
///
struct s3c_cpufreq_info s3c2440_cpufreq_info = {
.max = {
.fclk = 400000000,
.hclk = 133333333,
.pclk = 66666666,
},
///
The desired baud rate is software selectable, however, without the source for the user mode app, we can't be certain what value is selected.
baud_rate = PCLK / (2 * ( prescaler + 1) )
ie:
if PCLK = 50000000, and desired baud_rate = 2500000 ( 2.5Mbps is the hantek default for spi fgpa config) ==> the prescaler = 9
The prescaler works out to a nice even number. This is not the case for PCLK = 66666666 as it yields 12.333, however the setting in the driver is the *maximum*, so it could well be the the user mode app is selecting any smaller value. Lets examine the observed baud rate of 16.666667Mhz:
if PCLK = 66666666 , and desired baud_rate = 16666666 ( 16.67Mbps ) ==> the prescaler = 1
However if we desire a baudrate = 33333333, then the prescaler becomes 0
Assuming 0 is a valid value, then this is the max baud rate with the given PCLK of 66.67Mhz.
If we utilized the EPLL = 96Mhz source clock instead, then the max baud rate, with a 0 value prescaler, becomes 48Mbps.
I believe this clock is termed S3C2416_SPI_SRCCLK_48M within the source:
CPU S3C2416/S3C2450 (id 0x32450003)
#define S3C2416_SPI_SRCCLK_PCLK 0
#define S3C2416_SPI_SRCCLK_SPIBUS 1
#define S3C2416_SPI_SRCCLK_48M 2
static char *spi_src_clks[] = {
[S3C2416_SPI_SRCCLK_PCLK] = "pclk",
[S3C2416_SPI_SRCCLK_SPIBUS] = "spi-bus",
[S3C2416_SPI_SRCCLK_48M] = "spi_48m",
};
...
s3c64xx_spi_set_info(0,0,2);
...
void __init s3c64xx_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
{
struct s3c64xx_spi_info *pd;
/* Reject invalid configuration */
if (!num_cs || src_clk_nr < 0
|| src_clk_nr > S3C2416_SPI_SRCCLK_48M) {
printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
return;
}
pd = &s3c64xx_spi0_pdata;
pd->num_cs = num_cs;
pd->src_clk_nr = src_clk_nr;
pd->src_clk_name = spi_src_clks[src_clk_nr];
}