diff options
author | Paul Fertser <fercerpav@gmail.com> | 2011-08-30 10:30:51 +0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-09-21 09:43:44 +0200 |
commit | 8c1f388d88c78b260e881c93ad21b4fe894300c6 (patch) | |
tree | 56cfcc27b767ca62990e8788cd52b56587c75d5e /arch | |
parent | b360d7ed5b34a7a04dcc83c6ad6022b1537f4024 (diff) | |
download | barebox-8c1f388d88c78b260e881c93ad21b4fe894300c6.tar.gz barebox-8c1f388d88c78b260e881c93ad21b4fe894300c6.tar.xz |
imx25: imx_spi: support CSPI v0.7 as found on i.MX25
Based on the Linux driver. Tested with m25p80 with CS in GPIO mode.
Clock setting support is ad-hoc as the corresponding mach is not using
the generic clock infrastructure.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/include/mach/clock.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/include/mach/devices-imx25.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-imx/include/mach/imx25-regs.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/speed-imx25.c | 5 |
4 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/include/mach/clock.h b/arch/arm/mach-imx/include/mach/clock.h index 5b590a251e..10821782fe 100644 --- a/arch/arm/mach-imx/include/mach/clock.h +++ b/arch/arm/mach-imx/include/mach/clock.h @@ -29,6 +29,7 @@ ulong imx_get_uartclk(void); ulong imx_get_lcdclk(void); ulong imx_get_i2cclk(void); ulong imx_get_mmcclk(void); +ulong imx_get_cspiclk(void); int imx_clko_set_div(int div); void imx_clko_set_src(int src); diff --git a/arch/arm/mach-imx/include/mach/devices-imx25.h b/arch/arm/mach-imx/include/mach/devices-imx25.h index 87f5ba0e5e..eff59773f7 100644 --- a/arch/arm/mach-imx/include/mach/devices-imx25.h +++ b/arch/arm/mach-imx/include/mach/devices-imx25.h @@ -6,6 +6,11 @@ static inline struct device_d *imx25_add_i2c0(struct i2c_platform_data *pdata) return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata); } +static inline struct device_d *imx25_add_spi0(struct spi_imx_master *pdata) +{ + return imx_add_spi((void *)IMX_CSPI1_BASE, 0, pdata); +} + static inline struct device_d *imx25_add_uart0(void) { return imx_add_uart((void *)IMX_UART1_BASE, 0); diff --git a/arch/arm/mach-imx/include/mach/imx25-regs.h b/arch/arm/mach-imx/include/mach/imx25-regs.h index 78ec0cdbf1..73307c452e 100644 --- a/arch/arm/mach-imx/include/mach/imx25-regs.h +++ b/arch/arm/mach-imx/include/mach/imx25-regs.h @@ -47,6 +47,7 @@ #define IMX_NFC_BASE 0xBB000000 #define IMX_FEC_BASE 0x50038000 #define IMX_I2C1_BASE 0x43F80000 +#define IMX_CSPI1_BASE 0x43FA4000 /* * Clock Controller Module (CCM) diff --git a/arch/arm/mach-imx/speed-imx25.c b/arch/arm/mach-imx/speed-imx25.c index 68b50e943b..150adb28ba 100644 --- a/arch/arm/mach-imx/speed-imx25.c +++ b/arch/arm/mach-imx/speed-imx25.c @@ -87,6 +87,11 @@ unsigned long imx_get_mmcclk(void) return imx_get_perclk(3); } +unsigned long imx_get_cspiclk(void) +{ + return imx_get_ipgclk(); +} + void imx_dump_clocks(void) { printf("mpll: %10ld Hz\n", imx_get_mpllclk()); |