From ccfe30a7c8329e85ae426813a1060e27e2547dd1 Mon Sep 17 00:00:00 2001 From: Holger Schurig Date: Thu, 29 Jan 2009 10:07:50 +0100 Subject: arm/imx2x: new IOMUX definitions * removed iomux-mx1-mx2.h completely * distributes the former contents to four different files (iomux-mx1.h, iomux-mx21.h, iomux-mx27.h and the file iomux-mx2x.h, which is common to both i.MX21 and i.MX27). * adds all documented IOMUX definitions for i.MX21 and i.MX27 * fixes a few that were wrong (PD14_AOUT_FEC_CLR, PE16_AF_RTCK). * don't silenly include * and fixes all collateral damage from above Signed-off-by: Holger Schurig Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/pcm038.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-mx2/pcm038.c') diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c index dfd4156da7d5..534fd9a4ff9f 100644 --- a/arch/arm/mach-mx2/pcm038.c +++ b/arch/arm/mach-mx2/pcm038.c @@ -20,11 +20,12 @@ #include #include #include +#include #include #include #include #include -#include +#include #include #include #include @@ -170,7 +171,7 @@ static int mxc_fec_pins[] = { PD11_AOUT_FEC_TX_CLK, PD12_AOUT_FEC_RXD0, PD13_AOUT_FEC_RX_DV, - PD14_AOUT_FEC_CLR, + PD14_AOUT_FEC_RX_CLK, PD15_AOUT_FEC_COL, PD16_AIN_FEC_TX_ER, PF23_AIN_FEC_TX_EN @@ -217,7 +218,7 @@ static void __init pcm038_init(void) mxc_register_device(&mxc_uart_device1, &uart_pdata[1]); mxc_register_device(&mxc_uart_device2, &uart_pdata[2]); - mxc_gpio_mode(PE16_AF_RTCK); /* OWIRE */ + mxc_gpio_mode(PE16_AF_OWIRE); mxc_register_device(&mxc_nand_device, &pcm038_nand_board_info); platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); -- cgit v1.2.2 From 30c730f8f90b08d77a73998d2ee34cf1f56e95cc Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 16 Feb 2009 14:36:49 +0100 Subject: [ARM] MXC: rework timer/clock initialisation - rename mxc_clocks_init to architecture specific versions. This allows us to have more than one architecture compiled in. - call mxc_timer_init from clock initialisation instead from board code Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/pcm038.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/arm/mach-mx2/pcm038.c') diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c index 534fd9a4ff9f..63cdef8565db 100644 --- a/arch/arm/mach-mx2/pcm038.c +++ b/arch/arm/mach-mx2/pcm038.c @@ -230,8 +230,7 @@ static void __init pcm038_init(void) static void __init pcm038_timer_init(void) { - mxc_clocks_init(26000000); - mxc_timer_init("gpt_clk.0"); + mx27_clocks_init(26000000); } struct sys_timer pcm038_timer = { -- cgit v1.2.2 From 058b7a6f465bebd87c1f295afdd56cc6a33dffbd Mon Sep 17 00:00:00 2001 From: Holger Schurig Date: Mon, 26 Jan 2009 16:34:51 +0100 Subject: arm/imx2x: removes a bunch of sparse-warnings Here are some of the warnings that get fixed by this: > 200 times: warning: cast adds address space to expression () twelve times: warning: symbol 'xxx' was not declared. Should it be static two times: warning: symbol 'clock' shadows an earlier one five times: warning: incorrect type in initializer (different address spaces) Signed-off-by: Holger Schurig Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/pcm038.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-mx2/pcm038.c') diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c index 63cdef8565db..2942d59b5709 100644 --- a/arch/arm/mach-mx2/pcm038.c +++ b/arch/arm/mach-mx2/pcm038.c @@ -233,7 +233,7 @@ static void __init pcm038_timer_init(void) mx27_clocks_init(26000000); } -struct sys_timer pcm038_timer = { +static struct sys_timer pcm038_timer = { .init = pcm038_timer_init, }; -- cgit v1.2.2 From 41a1d91e7e7b08a13d78e03e67dcd7634f2d5cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 21 Jan 2009 21:25:02 +0100 Subject: remove unused static function gpio_fec_inactive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... from both mx27ads.c and pcm038.c Signed-off-by: Uwe Kleine-König Signed-off-by: Sascha Hauer Cc: Holger Schurig Cc: Russell King Cc: Sascha Hauer Cc: Martin Fuzzey --- arch/arm/mach-mx2/pcm038.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'arch/arm/mach-mx2/pcm038.c') diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c index 2942d59b5709..58552a01c0d3 100644 --- a/arch/arm/mach-mx2/pcm038.c +++ b/arch/arm/mach-mx2/pcm038.c @@ -183,12 +183,6 @@ static void gpio_fec_active(void) ARRAY_SIZE(mxc_fec_pins), "FEC"); } -static void gpio_fec_inactive(void) -{ - mxc_gpio_release_multiple_pins(mxc_fec_pins, - ARRAY_SIZE(mxc_fec_pins)); -} - static struct mxc_nand_platform_data pcm038_nand_board_info = { .width = 1, .hw_ecc = 1, -- cgit v1.2.2 From 879fea1b486d2b6fa399c40b8aed172b0dfdedb9 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 26 Jan 2009 17:26:02 +0100 Subject: [ARM] MX2: Add FEC platform device The in kernel FEC driver has recently been ported to a platform driver. Add a platform_device for it and register it for pcm038 and mx27ads. Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/pcm038.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-mx2/pcm038.c') diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c index 58552a01c0d3..d246eb1bb3ce 100644 --- a/arch/arm/mach-mx2/pcm038.c +++ b/arch/arm/mach-mx2/pcm038.c @@ -191,6 +191,7 @@ static struct mxc_nand_platform_data pcm038_nand_board_info = { static struct platform_device *platform_devices[] __initdata = { &pcm038_nor_mtd_device, &mxc_w1_master_device, + &mxc_fec_device, &pcm038_sram_mtd_device, }; -- cgit v1.2.2 From a4e9a65a1f90e94eca3af1a69b42d039054ef9de Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 28 Jan 2009 13:07:11 +0100 Subject: [ARM] PCM038 board: Add I2C support Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/pcm038.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'arch/arm/mach-mx2/pcm038.c') diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c index d246eb1bb3ce..7d935e17aa1c 100644 --- a/arch/arm/mach-mx2/pcm038.c +++ b/arch/arm/mach-mx2/pcm038.c @@ -21,11 +21,17 @@ #include #include #include +#include +#include + #include #include #include #include #include +#ifdef CONFIG_I2C_IMX +#include +#endif #include #include #include @@ -204,6 +210,51 @@ static void __init pcm038_init_sram(void) __raw_writel(0x22220a00, CSCR_A(1)); } +#ifdef CONFIG_I2C_IMX +static int mxc_i2c1_pins[] = { + PC5_PF_I2C2_SDA, + PC6_PF_I2C2_SCL +}; + +static int pcm038_i2c_1_init(struct device *dev) +{ + return mxc_gpio_setup_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins), + "I2C1"); +} + +static void pcm038_i2c_1_exit(struct device *dev) +{ + mxc_gpio_release_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins)); +} + +static struct imxi2c_platform_data pcm038_i2c_1_data = { + .bitrate = 100000, + .init = pcm038_i2c_1_init, + .exit = pcm038_i2c_1_exit, +}; + +static struct at24_platform_data board_eeprom = { + .byte_len = 4096, + .page_size = 32, + .flags = AT24_FLAG_ADDR16, +}; + +static struct i2c_board_info pcm038_i2c_devices[] = { + [0] = { + I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ + .platform_data = &board_eeprom, + }, + [1] = { + I2C_BOARD_INFO("rtc-pcf8563", 0x51), + .type = "pcf8563" + }, + [2] = { + I2C_BOARD_INFO("lm75", 0x4a), + .type = "lm75" + } +}; +#endif + static void __init pcm038_init(void) { gpio_fec_active(); @@ -216,6 +267,14 @@ static void __init pcm038_init(void) mxc_gpio_mode(PE16_AF_OWIRE); mxc_register_device(&mxc_nand_device, &pcm038_nand_board_info); +#ifdef CONFIG_I2C_IMX + /* only the i2c master 1 is used on this CPU card */ + i2c_register_board_info(1, pcm038_i2c_devices, + ARRAY_SIZE(pcm038_i2c_devices)); + + mxc_register_device(&mxc_i2c_device1, &pcm038_i2c_1_data); +#endif + platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); #ifdef CONFIG_MACH_PCM970_BASEBOARD -- cgit v1.2.2 From 9a51157bab06ab54d6ee442e34fe9574ff14c8c3 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 9 Feb 2009 11:00:03 +0100 Subject: [ARM] pcm038: Fix pins for UART3 The UART3 had a copy-paste bug. instead of claiming rxd, txd, rts and cts pins, cts and rts were claimed twice Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/pcm038.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-mx2/pcm038.c') diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c index 7d935e17aa1c..aa4eaa61d1b5 100644 --- a/arch/arm/mach-mx2/pcm038.c +++ b/arch/arm/mach-mx2/pcm038.c @@ -128,10 +128,10 @@ static int uart_mxc_port1_exit(struct platform_device *pdev) return 0; } -static int mxc_uart2_pins[] = { PE10_PF_UART3_CTS, +static int mxc_uart2_pins[] = { PE8_PF_UART3_TXD, PE9_PF_UART3_RXD, PE10_PF_UART3_CTS, - PE9_PF_UART3_RXD }; + PE11_PF_UART3_RTS }; static int uart_mxc_port2_init(struct platform_device *pdev) { -- cgit v1.2.2