ECSPI driver for kernel 2.6.35.3?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ECSPI driver for kernel 2.6.35.3?

852 Views
Rooney
Contributor III

Is there an ECSPI driver for kernel 2.6.35.3 available?

Currently I'm using the CSPI driver mxc_spi.c, but unfortunately the SPI clock is limited to about 12MBit. According to the datasheet ECSPI should work up to 60MBit.

Regards,

Rooney

Tags (1)
0 Kudos
1 Reply

421 Views
Rooney
Contributor III

Well, found a solution!!

The ECSPI is already implemented in mxc_spi.c. To select the correct SPI implementation the following spi_version has to be set.

static struct mxc_spi_master mxcspi1_data = {
    .maxchipselect = 2,
    .spi_version = 23,
    .chipselect_active = mx53_ft_gpio_spi_chipselect_active,
    .chipselect_inactive = mx53_ft_gpio_spi_chipselect_inactive,
};

Nevertheless the SPI clock frequency is still limited to 12MBit. Looking through the source code I found function mx53_clocks_init() in arch/arm/mach-mx5/clock.c.

The parent clock for the SPI Modul is set to the 24MHz input oscillator frequency.

clk_set_parent(&cspi_main_clk, &lp_apm_clk);
clk_set_rate(&cspi_main_clk, 12000000);

To get higher baudrate change these two lines to:

clk_set_parent(&cspi_main_clk, &pll3_sw_clk);
clk_set_rate(&cspi_main_clk, 60000000);

0 Kudos