* [PATCH 0/5] my imx patches for 2.6.39 @ 2011-02-18 21:30 Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 1/5] ARM: mxs: free dma_mask in error path Uwe Kleine-König ` (6 more replies) 0 siblings, 7 replies; 12+ messages in thread From: Uwe Kleine-König @ 2011-02-18 21:30 UTC (permalink / raw) To: linux-arm-kernel Hello Sascha, apart from the patches below there is another patch not yet applied. That's "mxs: irq_data conversion" that was already sent on this list. Because I assumed that it belongs to Russells domain I sent it to the patch system as http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6744/1 . If you prefer, I can add it to this series; just tell me. The following changes since commit b807afe41ceefef11a0d965cd9970142afc53d25: ARM: imx50: correct iomux-mx50.h wrong daisy chain settings (2011-02-18 11:01:34 +0100) are available in the git repository at: git://git.pengutronix.de/git/ukl/linux-2.6.git imx-for-2.6.39 Lothar Wa?mann (2): ARM: mxs: free dma_mask in error path ARM: mxs: add a dma mask to fec devices Sascha Hauer (1): ARM: mxs: Add pwm clocks and device registration Uwe Kleine-K?nig (2): ARM: mxc: free dma_mask in error path ARM: mxc: add a dma mask to fec devices arch/arm/mach-mxs/Kconfig | 2 ++ arch/arm/mach-mxs/clock-mx23.c | 6 +++++- arch/arm/mach-mxs/clock-mx28.c | 9 ++++++++- arch/arm/mach-mxs/devices-mx23.h | 2 ++ arch/arm/mach-mxs/devices-mx28.h | 2 ++ arch/arm/mach-mxs/devices.c | 2 ++ arch/arm/mach-mxs/devices/Kconfig | 3 +++ arch/arm/mach-mxs/devices/Makefile | 1 + arch/arm/mach-mxs/devices/platform-fec.c | 5 +++-- arch/arm/mach-mxs/devices/platform-mxs-pwm.c | 22 ++++++++++++++++++++++ arch/arm/mach-mxs/include/mach/devices-common.h | 4 ++++ arch/arm/plat-mxc/devices.c | 2 ++ arch/arm/plat-mxc/devices/platform-fec.c | 4 ++-- 13 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 arch/arm/mach-mxs/devices/platform-mxs-pwm.c I will follow up with the patches as reply to this mail. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/5] ARM: mxs: free dma_mask in error path 2011-02-18 21:30 [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König @ 2011-02-18 21:30 ` Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 2/5] ARM: mxc: " Uwe Kleine-König ` (5 subsequent siblings) 6 siblings, 0 replies; 12+ messages in thread From: Uwe Kleine-König @ 2011-02-18 21:30 UTC (permalink / raw) To: linux-arm-kernel From: Lothar Wa?mann <LW@KARO-electronics.de> This fixes a small memory leak that was only hit in very unlikely error paths. Signed-off-by: Lothar Wa?mann <LW@KARO-electronics.de> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> --- arch/arm/mach-mxs/devices.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mxs/devices.c b/arch/arm/mach-mxs/devices.c index c20d547..cfdb6b2 100644 --- a/arch/arm/mach-mxs/devices.c +++ b/arch/arm/mach-mxs/devices.c @@ -66,6 +66,8 @@ struct platform_device *__init mxs_add_platform_device_dmamask( ret = platform_device_add(pdev); if (ret) { err: + if (dmamask) + kfree(pdev->dev.dma_mask); platform_device_put(pdev); return ERR_PTR(ret); } -- 1.7.2.3 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/5] ARM: mxc: free dma_mask in error path 2011-02-18 21:30 [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 1/5] ARM: mxs: free dma_mask in error path Uwe Kleine-König @ 2011-02-18 21:30 ` Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 3/5] ARM: mxs: add a dma mask to fec devices Uwe Kleine-König ` (4 subsequent siblings) 6 siblings, 0 replies; 12+ messages in thread From: Uwe Kleine-König @ 2011-02-18 21:30 UTC (permalink / raw) To: linux-arm-kernel This fixes a small memory leak that was only hit in very unlikely error paths Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> --- arch/arm/plat-mxc/devices.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-mxc/devices.c b/arch/arm/plat-mxc/devices.c index e9bcefe..eee1b60 100644 --- a/arch/arm/plat-mxc/devices.c +++ b/arch/arm/plat-mxc/devices.c @@ -81,6 +81,8 @@ struct platform_device *__init imx_add_platform_device_dmamask( ret = platform_device_add(pdev); if (ret) { err: + if (dmamask) + kfree(pdev->dev.dma_mask); platform_device_put(pdev); return ERR_PTR(ret); } -- 1.7.2.3 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/5] ARM: mxs: add a dma mask to fec devices 2011-02-18 21:30 [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 1/5] ARM: mxs: free dma_mask in error path Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 2/5] ARM: mxc: " Uwe Kleine-König @ 2011-02-18 21:30 ` Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 4/5] ARM: mxc: " Uwe Kleine-König ` (3 subsequent siblings) 6 siblings, 0 replies; 12+ messages in thread From: Uwe Kleine-König @ 2011-02-18 21:30 UTC (permalink / raw) To: linux-arm-kernel From: Lothar Wa?mann <LW@KARO-electronics.de> This is not strictly necessary but the right thing to do. Signed-off-by: Lothar Wa?mann <LW@KARO-electronics.de> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> --- arch/arm/mach-mxs/devices/platform-fec.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-mxs/devices/platform-fec.c b/arch/arm/mach-mxs/devices/platform-fec.c index c42dff7..9859cf2 100644 --- a/arch/arm/mach-mxs/devices/platform-fec.c +++ b/arch/arm/mach-mxs/devices/platform-fec.c @@ -45,6 +45,7 @@ struct platform_device *__init mxs_add_fec( }, }; - return mxs_add_platform_device("imx28-fec", data->id, - res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); + return mxs_add_platform_device_dmamask("imx28-fec", data->id, + res, ARRAY_SIZE(res), pdata, sizeof(*pdata), + DMA_BIT_MASK(32)); } -- 1.7.2.3 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/5] ARM: mxc: add a dma mask to fec devices 2011-02-18 21:30 [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König ` (2 preceding siblings ...) 2011-02-18 21:30 ` [PATCH 3/5] ARM: mxs: add a dma mask to fec devices Uwe Kleine-König @ 2011-02-18 21:30 ` Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 5/5] ARM: mxs: Add pwm clocks and device registration Uwe Kleine-König ` (2 subsequent siblings) 6 siblings, 0 replies; 12+ messages in thread From: Uwe Kleine-König @ 2011-02-18 21:30 UTC (permalink / raw) To: linux-arm-kernel This is not strictly necessary but the right thing to do. Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> --- arch/arm/plat-mxc/devices/platform-fec.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/plat-mxc/devices/platform-fec.c index 4f52996..6561c9d 100644 --- a/arch/arm/plat-mxc/devices/platform-fec.c +++ b/arch/arm/plat-mxc/devices/platform-fec.c @@ -62,7 +62,7 @@ struct platform_device *__init imx_add_fec( }, }; - return imx_add_platform_device("fec", 0 /* -1? */, + return imx_add_platform_device_dmamask("fec", 0, res, ARRAY_SIZE(res), - pdata, sizeof(*pdata)); + pdata, sizeof(*pdata), DMA_BIT_MASK(32)); } -- 1.7.2.3 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/5] ARM: mxs: Add pwm clocks and device registration 2011-02-18 21:30 [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König ` (3 preceding siblings ...) 2011-02-18 21:30 ` [PATCH 4/5] ARM: mxc: " Uwe Kleine-König @ 2011-02-18 21:30 ` Uwe Kleine-König 2011-02-23 9:12 ` [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König 2011-02-24 21:03 ` [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König 6 siblings, 0 replies; 12+ messages in thread From: Uwe Kleine-König @ 2011-02-18 21:30 UTC (permalink / raw) To: linux-arm-kernel From: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> --- arch/arm/mach-mxs/Kconfig | 2 ++ arch/arm/mach-mxs/clock-mx23.c | 6 +++++- arch/arm/mach-mxs/clock-mx28.c | 9 ++++++++- arch/arm/mach-mxs/devices-mx23.h | 2 ++ arch/arm/mach-mxs/devices-mx28.h | 2 ++ arch/arm/mach-mxs/devices/Kconfig | 3 +++ arch/arm/mach-mxs/devices/Makefile | 1 + arch/arm/mach-mxs/devices/platform-mxs-pwm.c | 22 ++++++++++++++++++++++ arch/arm/mach-mxs/include/mach/devices-common.h | 4 ++++ 9 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-mxs/devices/platform-mxs-pwm.c diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig index 55bf075..836cc81 100644 --- a/arch/arm/mach-mxs/Kconfig +++ b/arch/arm/mach-mxs/Kconfig @@ -8,10 +8,12 @@ config MXS_OCOTP config SOC_IMX23 bool select CPU_ARM926T + select HAVE_PWM config SOC_IMX28 bool select CPU_ARM926T + select HAVE_PWM comment "MXS platforms:" diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c index 7c5dace..38ee1b1 100644 --- a/arch/arm/mach-mxs/clock-mx23.c +++ b/arch/arm/mach-mxs/clock-mx23.c @@ -447,7 +447,11 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK(NULL, "hclk", hbus_clk) _REGISTER_CLOCK(NULL, "usb", usb_clk) _REGISTER_CLOCK(NULL, "audio", audio_clk) - _REGISTER_CLOCK(NULL, "pwm", pwm_clk) + _REGISTER_CLOCK("mxs-pwm.0", NULL, pwm_clk) + _REGISTER_CLOCK("mxs-pwm.1", NULL, pwm_clk) + _REGISTER_CLOCK("mxs-pwm.2", NULL, pwm_clk) + _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk) + _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk) }; static int clk_misc_init(void) diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c index febd787..40726c7 100644 --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c @@ -622,7 +622,14 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK("flexcan.1", NULL, can1_clk) _REGISTER_CLOCK(NULL, "usb0", usb0_clk) _REGISTER_CLOCK(NULL, "usb1", usb1_clk) - _REGISTER_CLOCK(NULL, "pwm", pwm_clk) + _REGISTER_CLOCK("mxs-pwm.0", NULL, pwm_clk) + _REGISTER_CLOCK("mxs-pwm.1", NULL, pwm_clk) + _REGISTER_CLOCK("mxs-pwm.2", NULL, pwm_clk) + _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk) + _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk) + _REGISTER_CLOCK("mxs-pwm.5", NULL, pwm_clk) + _REGISTER_CLOCK("mxs-pwm.6", NULL, pwm_clk) + _REGISTER_CLOCK("mxs-pwm.7", NULL, pwm_clk) _REGISTER_CLOCK(NULL, "lradc", lradc_clk) _REGISTER_CLOCK(NULL, "spdif", spdif_clk) }; diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h index c4d4773..7fb27b1 100644 --- a/arch/arm/mach-mxs/devices-mx23.h +++ b/arch/arm/mach-mxs/devices-mx23.h @@ -19,3 +19,5 @@ extern const struct mxs_auart_data mx23_auart_data[] __initconst; #define mx23_add_auart(id) mxs_add_auart(&mx23_auart_data[id]) #define mx23_add_auart0() mx23_add_auart(0) #define mx23_add_auart1() mx23_add_auart(1) + +#define mx23_add_mxs_pwm(id) mxs_add_mxs_pwm(MX23_PWM_BASE_ADDR, id) diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h index 3b18304..69d19ea 100644 --- a/arch/arm/mach-mxs/devices-mx28.h +++ b/arch/arm/mach-mxs/devices-mx28.h @@ -32,3 +32,5 @@ extern const struct mxs_flexcan_data mx28_flexcan_data[] __initconst; mxs_add_flexcan(&mx28_flexcan_data[id], pdata) #define mx28_add_flexcan0(pdata) mx28_add_flexcan(0, pdata) #define mx28_add_flexcan1(pdata) mx28_add_flexcan(1, pdata) + +#define mx28_add_mxs_pwm(id) mxs_add_mxs_pwm(MX28_PWM_BASE_ADDR, id) diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig index 6c65b67..3aeec24 100644 --- a/arch/arm/mach-mxs/devices/Kconfig +++ b/arch/arm/mach-mxs/devices/Kconfig @@ -11,3 +11,6 @@ config MXS_HAVE_PLATFORM_FEC config MXS_HAVE_PLATFORM_FLEXCAN select HAVE_CAN_FLEXCAN if CAN bool + +config MXS_HAVE_PLATFORM_MXS_PWM + bool diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile index a8dc8d5..978310f 100644 --- a/arch/arm/mach-mxs/devices/Makefile +++ b/arch/arm/mach-mxs/devices/Makefile @@ -2,3 +2,4 @@ obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o obj-$(CONFIG_MXS_HAVE_PLATFORM_AUART) += platform-auart.o obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o +obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_PWM) += platform-mxs-pwm.o diff --git a/arch/arm/mach-mxs/devices/platform-mxs-pwm.c b/arch/arm/mach-mxs/devices/platform-mxs-pwm.c new file mode 100644 index 0000000..680f5a9 --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-mxs-pwm.c @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2010 Pengutronix + * Sascha Hauer <s.hauer@pengutronix.de> + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation. + */ +#include <asm/sizes.h> +#include <mach/devices-common.h> + +struct platform_device *__init mxs_add_mxs_pwm(resource_size_t iobase, int id) +{ + struct resource res = { + .flags = IORESOURCE_MEM, + }; + + res.start = iobase + 0x10 + 0x20 * id; + res.end = res.start + 0x1f; + + return mxs_add_platform_device("mxs-pwm", id, &res, 1, NULL, 0); +} diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h index e7aefb4..d460d30 100644 --- a/arch/arm/mach-mxs/include/mach/devices-common.h +++ b/arch/arm/mach-mxs/include/mach/devices-common.h @@ -63,3 +63,7 @@ struct mxs_flexcan_data { struct platform_device *__init mxs_add_flexcan( const struct mxs_flexcan_data *data, const struct flexcan_platform_data *pdata); + +/* pwm */ +struct platform_device *__init mxs_add_mxs_pwm( + resource_size_t iobase, int id); -- 1.7.2.3 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 0/5] my imx patches for 2.6.39 2011-02-18 21:30 [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König ` (4 preceding siblings ...) 2011-02-18 21:30 ` [PATCH 5/5] ARM: mxs: Add pwm clocks and device registration Uwe Kleine-König @ 2011-02-23 9:12 ` Uwe Kleine-König 2011-02-23 9:13 ` [PATCH] ARM: mx51_defconfig: enable various options Uwe Kleine-König 2011-02-24 21:03 ` [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König 6 siblings, 1 reply; 12+ messages in thread From: Uwe Kleine-König @ 2011-02-23 9:12 UTC (permalink / raw) To: linux-arm-kernel Hello On Fri, Feb 18, 2011 at 10:30:22PM +0100, Uwe Kleine-K?nig wrote: > apart from the patches below there is another patch not yet applied. > That's "mxs: irq_data conversion" that was already sent on this list. > Because I assumed that it belongs to Russells domain I sent it to the > patch system as > http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=6744/1 > . If you prefer, I can add it to this series; just tell me. Russell asked Sascha to ack this patch, so I assume it will not go via Sascha. I found another patch that should be added to .39: Uwe Kleine-K?nig (1): ARM: mx51_defconfig: enable various options Will send this in reply to this mail. > The following changes since commit b807afe41ceefef11a0d965cd9970142afc53d25: > > ARM: imx50: correct iomux-mx50.h wrong daisy chain settings (2011-02-18 11:01:34 +0100) > > are available in the git repository at: > git://git.pengutronix.de/git/ukl/linux-2.6.git imx-for-2.6.39 > > Lothar Wa?mann (2): > ARM: mxs: free dma_mask in error path > ARM: mxs: add a dma mask to fec devices > > Sascha Hauer (1): > ARM: mxs: Add pwm clocks and device registration > > Uwe Kleine-K?nig (2): > ARM: mxc: free dma_mask in error path > ARM: mxc: add a dma mask to fec devices > > arch/arm/mach-mxs/Kconfig | 2 ++ > arch/arm/mach-mxs/clock-mx23.c | 6 +++++- > arch/arm/mach-mxs/clock-mx28.c | 9 ++++++++- > arch/arm/mach-mxs/devices-mx23.h | 2 ++ > arch/arm/mach-mxs/devices-mx28.h | 2 ++ > arch/arm/mach-mxs/devices.c | 2 ++ > arch/arm/mach-mxs/devices/Kconfig | 3 +++ > arch/arm/mach-mxs/devices/Makefile | 1 + > arch/arm/mach-mxs/devices/platform-fec.c | 5 +++-- > arch/arm/mach-mxs/devices/platform-mxs-pwm.c | 22 ++++++++++++++++++++++ > arch/arm/mach-mxs/include/mach/devices-common.h | 4 ++++ > arch/arm/plat-mxc/devices.c | 2 ++ > arch/arm/plat-mxc/devices/platform-fec.c | 4 ++-- > 13 files changed, 58 insertions(+), 6 deletions(-) > create mode 100644 arch/arm/mach-mxs/devices/platform-mxs-pwm.c The new diffstat is: arch/arm/configs/mx51_defconfig | 53 +++++++++++++++++++---- arch/arm/mach-mxs/Kconfig | 2 + arch/arm/mach-mxs/clock-mx23.c | 6 ++- arch/arm/mach-mxs/clock-mx28.c | 9 +++- arch/arm/mach-mxs/devices-mx23.h | 2 + arch/arm/mach-mxs/devices-mx28.h | 2 + arch/arm/mach-mxs/devices.c | 2 + arch/arm/mach-mxs/devices/Kconfig | 3 + arch/arm/mach-mxs/devices/Makefile | 1 + arch/arm/mach-mxs/devices/platform-fec.c | 5 +- arch/arm/mach-mxs/devices/platform-mxs-pwm.c | 22 +++++++++ arch/arm/mach-mxs/include/mach/devices-common.h | 4 ++ arch/arm/plat-mxc/devices.c | 2 + arch/arm/plat-mxc/devices/platform-fec.c | 4 +- 14 files changed, 102 insertions(+), 15 deletions(-) create mode 100644 arch/arm/mach-mxs/devices/platform-mxs-pwm.c (only arch/arm/configs/mx51_defconfig added and a different scale for the other lines) Sascha, I hope that's OK for you. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] ARM: mx51_defconfig: enable various options 2011-02-23 9:12 ` [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König @ 2011-02-23 9:13 ` Uwe Kleine-König 0 siblings, 0 replies; 12+ messages in thread From: Uwe Kleine-König @ 2011-02-23 9:13 UTC (permalink / raw) To: linux-arm-kernel - all currently available machines - MXC_PWM - CAN_MCP251X (not yet available but pending) - MTD_NAND_MXC and UBI - I2C_IMX and SPI_IMX - mc13xxx including regulator, rtc and touch support - SND_IMX_SOC - IMX_SDMA The change CONFIG_LEDS_CLASS=m -> y was needed to fix a kconfig warning arch/arm/configs/mx51_defconfig:113:warning: symbol value 'm' invalid for LEDS_CLASS and was suggested independently by Shawn Guo, too. The other changes are either needed to get the options above or just update noise. Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> --- arch/arm/configs/mx51_defconfig | 53 ++++++++++++++++++++++++++++++++------ 1 files changed, 44 insertions(+), 9 deletions(-) diff --git a/arch/arm/configs/mx51_defconfig b/arch/arm/configs/mx51_defconfig index 9cba68c..11a9904 100644 --- a/arch/arm/configs/mx51_defconfig +++ b/arch/arm/configs/mx51_defconfig @@ -17,6 +17,12 @@ CONFIG_ARCH_MX5=y CONFIG_MACH_MX51_BABBAGE=y CONFIG_MACH_MX51_3DS=y CONFIG_MACH_EUKREA_CPUIMX51=y +CONFIG_MACH_EUKREA_CPUIMX51SD=y +CONFIG_MACH_MX51_EFIKAMX=y +CONFIG_MACH_MX53_EVK=y +CONFIG_MACH_MX53_SMD=y +CONFIG_MACH_MX53_LOCO=y +CONFIG_MXC_PWM=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y CONFIG_PREEMPT_VOLUNTARY=y @@ -41,13 +47,26 @@ CONFIG_IP_PNP_DHCP=y # CONFIG_INET_XFRM_MODE_BEET is not set # CONFIG_INET_LRO is not set # CONFIG_IPV6 is not set +CONFIG_CAN=y +CONFIG_CAN_RAW=y +CONFIG_CAN_DEV=y +CONFIG_CAN_CALC_BITTIMING=y +CONFIG_CAN_MCP251X=y # CONFIG_WIRELESS is not set # CONFIG_STANDALONE is not set CONFIG_CONNECTOR=y +CONFIG_MTD=y +CONFIG_MTD_CONCAT=y +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_MXC=y +CONFIG_MTD_UBI=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=65536 -# CONFIG_MISC_DEVICES is not set CONFIG_SCSI=y # CONFIG_SCSI_PROC_FS is not set CONFIG_BLK_DEV_SD=y @@ -58,6 +77,7 @@ CONFIG_SCSI_SCAN_ASYNC=y # CONFIG_SCSI_LOWLEVEL is not set CONFIG_ATA=m CONFIG_NETDEVICES=y +CONFIG_MII=m CONFIG_MARVELL_PHY=y CONFIG_DAVICOM_PHY=y CONFIG_QSEMI_PHY=y @@ -74,7 +94,6 @@ CONFIG_LSI_ET1011C_PHY=y CONFIG_MDIO_BITBANG=y CONFIG_MDIO_GPIO=y CONFIG_NET_ETHERNET=y -CONFIG_MII=m CONFIG_FEC=y # CONFIG_NETDEV_1000 is not set # CONFIG_NETDEV_10000 is not set @@ -82,10 +101,12 @@ CONFIG_FEC=y CONFIG_INPUT_FF_MEMLESS=m # CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_EVDEV=y -CONFIG_KEYBOARD_GPIO=y CONFIG_INPUT_EVBUG=m +CONFIG_KEYBOARD_GPIO=y CONFIG_MOUSE_PS2=m CONFIG_MOUSE_PS2_ELANTECH=y +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_MC13783=y CONFIG_SERIO_SERPORT=m CONFIG_VT_HW_CONSOLE_BINDING=y # CONFIG_DEVKMEM is not set @@ -100,8 +121,21 @@ CONFIG_I2C_CHARDEV=m CONFIG_I2C_ALGOBIT=m CONFIG_I2C_ALGOPCF=m CONFIG_I2C_ALGOPCA=m +CONFIG_I2C_IMX=y +CONFIG_SPI=y +CONFIG_SPI_IMX=y +CONFIG_SPI_SPIDEV=y CONFIG_GPIO_SYSFS=y # CONFIG_HWMON is not set +CONFIG_MFD_MC13XXX=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_MC13783=y +CONFIG_REGULATOR_MC13892=y +CONFIG_SOUND=y +CONFIG_SND=y +# CONFIG_SND_SUPPORT_OLD_API is not set +CONFIG_SND_SOC=y +CONFIG_SND_IMX_SOC=y # CONFIG_HID_SUPPORT is not set CONFIG_USB=y CONFIG_USB_EHCI_HCD=y @@ -110,9 +144,12 @@ CONFIG_MMC=y CONFIG_MMC_BLOCK=m CONFIG_MMC_SDHCI=m CONFIG_NEW_LEDS=y -CONFIG_LEDS_CLASS=m +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_PWM=y CONFIG_RTC_CLASS=y -CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_DRV_MC13XXX=y +CONFIG_DMADEVICES=y +CONFIG_IMX_SDMA=y CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y @@ -126,7 +163,6 @@ CONFIG_EXT4_FS_SECURITY=y CONFIG_QUOTA=y CONFIG_QUOTA_NETLINK_INTERFACE=y # CONFIG_PRINT_QUOTA_WARNING is not set -CONFIG_AUTOFS_FS=y CONFIG_AUTOFS4_FS=y CONFIG_FUSE_FS=y CONFIG_ISO9660_FS=m @@ -153,14 +189,13 @@ CONFIG_DEBUG_FS=y CONFIG_DEBUG_KERNEL=y # CONFIG_SCHED_DEBUG is not set # CONFIG_DEBUG_BUGVERBOSE is not set -# CONFIG_RCU_CPU_STALL_DETECTOR is not set # CONFIG_FTRACE is not set # CONFIG_ARM_UNWIND is not set CONFIG_DEBUG_LL=y CONFIG_EARLY_PRINTK=y CONFIG_SECURITYFS=y -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_DEFLATE=m +CONFIG_CRYPTO_LZO=m # CONFIG_CRYPTO_ANSI_CPRNG is not set # CONFIG_CRYPTO_HW is not set CONFIG_CRC_CCITT=m -- 1.7.2.3 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 0/5] my imx patches for 2.6.39 2011-02-18 21:30 [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König ` (5 preceding siblings ...) 2011-02-23 9:12 ` [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König @ 2011-02-24 21:03 ` Uwe Kleine-König 2011-02-24 21:04 ` [PATCH] ARM: mxs: Initial support for Ka-Ro TX28 Uwe Kleine-König 6 siblings, 1 reply; 12+ messages in thread From: Uwe Kleine-König @ 2011-02-24 21:03 UTC (permalink / raw) To: linux-arm-kernel Hello Sascha, there is now yet another patch, and as you didn't pull yet (maybe you expected that?) here comes an updated request: The following changes since commit b807afe41ceefef11a0d965cd9970142afc53d25: ARM: imx50: correct iomux-mx50.h wrong daisy chain settings (2011-02-18 11:01:34 +0100) are available in the git repository at: git://git.pengutronix.de/git/ukl/linux-2.6.git imx-for-2.6.39 Lothar Wa?mann (3): ARM: mxs: free dma_mask in error path ARM: mxs: add a dma mask to fec devices ARM: mxs: Initial support for Ka-Ro TX28 Sascha Hauer (2): ARM: mxs: Add pwm clocks and device registration ARM: mxs: Add missing EXPORT_SYMBOL for mxs_reset_block Uwe Kleine-K?nig (3): ARM: mxc: free dma_mask in error path ARM: mxc: add a dma mask to fec devices ARM: mx51_defconfig: enable various options arch/arm/configs/mx51_defconfig | 53 ++++++-- arch/arm/mach-mxs/Kconfig | 14 ++ arch/arm/mach-mxs/Makefile | 2 + arch/arm/mach-mxs/clock-mx23.c | 6 +- arch/arm/mach-mxs/clock-mx28.c | 9 +- arch/arm/mach-mxs/devices-mx23.h | 2 + arch/arm/mach-mxs/devices-mx28.h | 2 + arch/arm/mach-mxs/devices.c | 2 + arch/arm/mach-mxs/devices/Kconfig | 3 + arch/arm/mach-mxs/devices/Makefile | 1 + arch/arm/mach-mxs/devices/platform-fec.c | 5 +- arch/arm/mach-mxs/devices/platform-mxs-pwm.c | 22 +++ arch/arm/mach-mxs/include/mach/devices-common.h | 4 + arch/arm/mach-mxs/include/mach/mxs.h | 9 +- arch/arm/mach-mxs/include/mach/uncompress.h | 1 + arch/arm/mach-mxs/mach-tx28.c | 175 +++++++++++++++++++++++ arch/arm/mach-mxs/module-tx28.c | 131 +++++++++++++++++ arch/arm/mach-mxs/module-tx28.h | 9 ++ arch/arm/mach-mxs/system.c | 2 + arch/arm/plat-mxc/devices.c | 2 + arch/arm/plat-mxc/devices/platform-fec.c | 4 +- 21 files changed, 441 insertions(+), 17 deletions(-) create mode 100644 arch/arm/mach-mxs/devices/platform-mxs-pwm.c create mode 100644 arch/arm/mach-mxs/mach-tx28.c create mode 100644 arch/arm/mach-mxs/module-tx28.c create mode 100644 arch/arm/mach-mxs/module-tx28.h Thanks Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] ARM: mxs: Initial support for Ka-Ro TX28 2011-02-24 21:03 ` [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König @ 2011-02-24 21:04 ` Uwe Kleine-König 2011-02-25 9:00 ` Uwe Kleine-König 2011-02-26 7:50 ` Shawn Guo 0 siblings, 2 replies; 12+ messages in thread From: Uwe Kleine-König @ 2011-02-24 21:04 UTC (permalink / raw) To: linux-arm-kernel From: Lothar Wa?mann <LW@KARO-electronics.de> Based on code created by Lothar Wa?mann, Sascha Hauer, Wolfram Sang and me. Signed-off-by: Lothar Wa?mann <LW@KARO-electronics.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> --- arch/arm/mach-mxs/Kconfig | 12 ++ arch/arm/mach-mxs/Makefile | 2 + arch/arm/mach-mxs/include/mach/mxs.h | 9 +- arch/arm/mach-mxs/include/mach/uncompress.h | 1 + arch/arm/mach-mxs/mach-tx28.c | 175 +++++++++++++++++++++++++++ arch/arm/mach-mxs/module-tx28.c | 131 ++++++++++++++++++++ arch/arm/mach-mxs/module-tx28.h | 9 ++ 7 files changed, 337 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-mxs/mach-tx28.c create mode 100644 arch/arm/mach-mxs/module-tx28.c create mode 100644 arch/arm/mach-mxs/module-tx28.h diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig index 836cc81..895d066 100644 --- a/arch/arm/mach-mxs/Kconfig +++ b/arch/arm/mach-mxs/Kconfig @@ -39,4 +39,16 @@ config MACH_MX28EVK Include support for MX28EVK platform. This includes specific configurations for the board and its peripherals. +config MODULE_TX28 + bool + select SOC_IMX28 + select MXS_HAVE_AMBA_DUART + select MXS_HAVE_PLATFORM_AUART + select MXS_HAVE_PLATFORM_FEC + select MXS_HAVE_PLATFORM_MXS_PWM + +config MACH_TX28 + bool "Ka-Ro TX28 module" + select MODULE_TX28 + endif diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile index 6b26f02..2f1f614 100644 --- a/arch/arm/mach-mxs/Makefile +++ b/arch/arm/mach-mxs/Makefile @@ -9,5 +9,7 @@ obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o +obj-$(CONFIG_MODULE_TX28) += module-tx28.o +obj-$(CONFIG_MACH_TX28) += mach-tx28.o obj-y += devices/ diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h index f186c08..35a89dd 100644 --- a/arch/arm/mach-mxs/include/mach/mxs.h +++ b/arch/arm/mach-mxs/include/mach/mxs.h @@ -28,8 +28,13 @@ /* * MXS CPU types */ -#define cpu_is_mx23() (machine_is_mx23evk()) -#define cpu_is_mx28() (machine_is_mx28evk()) +#define cpu_is_mx23() ( \ + machine_is_mx23evk() || \ + 0) +#define cpu_is_mx28() ( \ + machine_is_mx28evk() || \ + machine_is_tx28() || \ + 0) /* * IO addresses common to MXS-based diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h index a005e76..f12a173 100644 --- a/arch/arm/mach-mxs/include/mach/uncompress.h +++ b/arch/arm/mach-mxs/include/mach/uncompress.h @@ -63,6 +63,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id) mxs_duart_base = MX23_DUART_BASE_ADDR; break; case MACH_TYPE_MX28EVK: + case MACH_TYPE_TX28: mxs_duart_base = MX28_DUART_BASE_ADDR; break; default: diff --git a/arch/arm/mach-mxs/mach-tx28.c b/arch/arm/mach-mxs/mach-tx28.c new file mode 100644 index 0000000..540d6ea --- /dev/null +++ b/arch/arm/mach-mxs/mach-tx28.c @@ -0,0 +1,175 @@ +/* + * Copyright (C) 2010 <LW@KARO-electronics.de> + * + * based on: mach-mx28_evk.c + * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation + */ +#include <linux/kernel.h> +#include <linux/gpio.h> +#include <linux/leds.h> +#include <linux/platform_device.h> +#include <linux/spi/spi.h> +#include <linux/spi/spi_gpio.h> + +#include <asm/mach/arch.h> +#include <asm/mach/time.h> + +#include <mach/common.h> +#include <mach/iomux-mx28.h> + +#include "devices-mx28.h" +#include "module-tx28.h" + +#define TX28_STK5_GPIO_LED MXS_GPIO_NR(4, 10) + +static const iomux_cfg_t tx28_stk5v3_pads[] __initconst = { + /* LED */ + MX28_PAD_ENET0_RXD3__GPIO_4_10 | + MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL, + + /* framebuffer */ +#define LCD_MODE (MXS_PAD_3V3 | MXS_PAD_4MA) + MX28_PAD_LCD_D00__LCD_D0 | LCD_MODE, + MX28_PAD_LCD_D01__LCD_D1 | LCD_MODE, + MX28_PAD_LCD_D02__LCD_D2 | LCD_MODE, + MX28_PAD_LCD_D03__LCD_D3 | LCD_MODE, + MX28_PAD_LCD_D04__LCD_D4 | LCD_MODE, + MX28_PAD_LCD_D05__LCD_D5 | LCD_MODE, + MX28_PAD_LCD_D06__LCD_D6 | LCD_MODE, + MX28_PAD_LCD_D07__LCD_D7 | LCD_MODE, + MX28_PAD_LCD_D08__LCD_D8 | LCD_MODE, + MX28_PAD_LCD_D09__LCD_D9 | LCD_MODE, + MX28_PAD_LCD_D10__LCD_D10 | LCD_MODE, + MX28_PAD_LCD_D11__LCD_D11 | LCD_MODE, + MX28_PAD_LCD_D12__LCD_D12 | LCD_MODE, + MX28_PAD_LCD_D13__LCD_D13 | LCD_MODE, + MX28_PAD_LCD_D14__LCD_D14 | LCD_MODE, + MX28_PAD_LCD_D15__LCD_D15 | LCD_MODE, + MX28_PAD_LCD_D16__LCD_D16 | LCD_MODE, + MX28_PAD_LCD_D17__LCD_D17 | LCD_MODE, + MX28_PAD_LCD_D18__LCD_D18 | LCD_MODE, + MX28_PAD_LCD_D19__LCD_D19 | LCD_MODE, + MX28_PAD_LCD_D20__LCD_D20 | LCD_MODE, + MX28_PAD_LCD_D21__LCD_D21 | LCD_MODE, + MX28_PAD_LCD_D22__LCD_D22 | LCD_MODE, + MX28_PAD_LCD_D23__LCD_D23 | LCD_MODE, + MX28_PAD_LCD_RD_E__LCD_VSYNC | LCD_MODE, + MX28_PAD_LCD_WR_RWN__LCD_HSYNC | LCD_MODE, + MX28_PAD_LCD_RS__LCD_DOTCLK | LCD_MODE, + MX28_PAD_LCD_CS__LCD_CS | LCD_MODE, + MX28_PAD_LCD_VSYNC__LCD_VSYNC | LCD_MODE, + MX28_PAD_LCD_HSYNC__LCD_HSYNC | LCD_MODE, + MX28_PAD_LCD_DOTCLK__LCD_DOTCLK | LCD_MODE, + MX28_PAD_LCD_ENABLE__GPIO_1_31 | LCD_MODE, + MX28_PAD_LCD_RESET__GPIO_3_30 | LCD_MODE, + MX28_PAD_PWM0__PWM_0 | LCD_MODE, + + /* UART1 */ + MX28_PAD_AUART0_CTS__DUART_RX, + MX28_PAD_AUART0_RTS__DUART_TX, + MX28_PAD_AUART0_TX__DUART_RTS, + MX28_PAD_AUART0_RX__DUART_CTS, + + /* UART2 */ + MX28_PAD_AUART1_RX__AUART1_RX, + MX28_PAD_AUART1_TX__AUART1_TX, + MX28_PAD_AUART1_RTS__AUART1_RTS, + MX28_PAD_AUART1_CTS__AUART1_CTS, + + /* CAN */ + MX28_PAD_GPMI_RDY2__CAN0_TX, + MX28_PAD_GPMI_RDY3__CAN0_RX, + + /* I2C */ + MX28_PAD_I2C0_SCL__I2C0_SCL, + MX28_PAD_I2C0_SDA__I2C0_SDA, + + /* TSC2007 */ + MX28_PAD_SAIF0_MCLK__GPIO_3_20 | MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_PULLUP, + + /* MMC0 */ + MX28_PAD_SSP0_DATA0__SSP0_D0 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX28_PAD_SSP0_DATA1__SSP0_D1 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX28_PAD_SSP0_DATA2__SSP0_D2 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX28_PAD_SSP0_DATA3__SSP0_D3 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX28_PAD_SSP0_DATA4__SSP0_D4 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX28_PAD_SSP0_DATA5__SSP0_D5 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX28_PAD_SSP0_DATA6__SSP0_D6 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX28_PAD_SSP0_DATA7__SSP0_D7 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX28_PAD_SSP0_CMD__SSP0_CMD | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), + MX28_PAD_SSP0_SCK__SSP0_SCK | + (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), +}; + +static struct gpio_led tx28_stk5v3_leds[] = { + { + .name = "GPIO-LED", + .default_trigger = "heartbeat", + .gpio = TX28_STK5_GPIO_LED, + }, +}; + +static const struct gpio_led_platform_data tx28_stk5v3_led_data __initconst = { + .leds = tx28_stk5v3_leds, + .num_leds = ARRAY_SIZE(tx28_stk5v3_leds), +}; + +static struct spi_board_info tx28_spi_board_info[] = { +#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) + { + .modalias = "spidev", + .max_speed_hz = 20000000, + .bus_num = 0, + .chip_select = 1, + .controller_data = (void *)SPI_GPIO_NO_CHIPSELECT, + .mode = SPI_MODE_0, + }, +#endif +}; + +static void __init tx28_stk5v3_init(void) +{ + mxs_iomux_setup_multiple_pads(tx28_stk5v3_pads, + ARRAY_SIZE(tx28_stk5v3_pads)); + + mx28_add_duart(); /* UART1 */ + mx28_add_auart(1); /* UART2 */ + + tx28_add_fec0(); + /* spi via ssp will be added when available */ + spi_register_board_info(tx28_spi_board_info, + ARRAY_SIZE(tx28_spi_board_info)); + mxs_add_platform_device("leds-gpio", 0, NULL, 0, + &tx28_stk5v3_led_data, sizeof(tx28_stk5v3_led_data)); +} + +static void __init tx28_timer_init(void) +{ + mx28_clocks_init(); +} + +static struct sys_timer tx28_timer = { + .init = tx28_timer_init, +}; + +MACHINE_START(TX28, "Ka-Ro electronics TX28 module") + .map_io = mx28_map_io, + .init_irq = mx28_init_irq, + .init_machine = tx28_stk5v3_init, + .timer = &tx28_timer, +MACHINE_END diff --git a/arch/arm/mach-mxs/module-tx28.c b/arch/arm/mach-mxs/module-tx28.c new file mode 100644 index 0000000..fa0b154 --- /dev/null +++ b/arch/arm/mach-mxs/module-tx28.c @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2010 <LW@KARO-electronics.de> + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation. + */ + +#include <linux/delay.h> +#include <linux/fec.h> +#include <linux/gpio.h> + +#include <mach/iomux-mx28.h> +#include "../devices-mx28.h" + +#include "module-tx28.h" + +#define TX28_FEC_PHY_POWER MXS_GPIO_NR(3, 29) +#define TX28_FEC_PHY_RESET MXS_GPIO_NR(4, 13) + +static const iomux_cfg_t tx28_fec_gpio_pads[] __initconst = { + /* PHY POWER */ + MX28_PAD_PWM4__GPIO_3_29 | + MXS_PAD_4MA | MXS_PAD_NOPULL | MXS_PAD_3V3, + /* PHY RESET */ + MX28_PAD_ENET0_RX_CLK__GPIO_4_13 | + MXS_PAD_4MA | MXS_PAD_NOPULL | MXS_PAD_3V3, + /* Mode strap pins 0-2 */ + MX28_PAD_ENET0_RXD0__GPIO_4_3 | + MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3, + MX28_PAD_ENET0_RXD1__GPIO_4_4 | + MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3, + MX28_PAD_ENET0_RX_EN__GPIO_4_2 | + MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3, + /* nINT */ + MX28_PAD_ENET0_TX_CLK__GPIO_4_5 | + MXS_PAD_4MA | MXS_PAD_NOPULL | MXS_PAD_3V3, + + MX28_PAD_ENET0_MDC__GPIO_4_0, + MX28_PAD_ENET0_MDIO__GPIO_4_1, + MX28_PAD_ENET0_TX_EN__GPIO_4_6, + MX28_PAD_ENET0_TXD0__GPIO_4_7, + MX28_PAD_ENET0_TXD1__GPIO_4_8, + MX28_PAD_ENET_CLK__GPIO_4_16, +}; + +#define FEC_MODE (MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3) +static const iomux_cfg_t tx28_fec_pads[] __initconst = { + MX28_PAD_ENET0_MDC__ENET0_MDC | FEC_MODE, + MX28_PAD_ENET0_MDIO__ENET0_MDIO | FEC_MODE, + MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | FEC_MODE, + MX28_PAD_ENET0_RXD0__ENET0_RXD0 | FEC_MODE, + MX28_PAD_ENET0_RXD1__ENET0_RXD1 | FEC_MODE, + MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | FEC_MODE, + MX28_PAD_ENET0_TXD0__ENET0_TXD0 | FEC_MODE, + MX28_PAD_ENET0_TXD1__ENET0_TXD1 | FEC_MODE, + MX28_PAD_ENET_CLK__CLKCTRL_ENET | FEC_MODE, +}; + +static const struct fec_platform_data tx28_fec_data __initconst = { + .phy = PHY_INTERFACE_MODE_RMII, +}; + +int __init tx28_add_fec0(void) +{ + int i, ret; + + pr_debug("%s: Switching FEC PHY power off\n", __func__); + ret = mxs_iomux_setup_multiple_pads(tx28_fec_gpio_pads, + ARRAY_SIZE(tx28_fec_gpio_pads)); + for (i = 0; i < ARRAY_SIZE(tx28_fec_gpio_pads); i++) { + unsigned int gpio = MXS_GPIO_NR(PAD_BANK(tx28_fec_gpio_pads[i]), + PAD_PIN(tx28_fec_gpio_pads[i])); + + ret = gpio_request(gpio, "FEC"); + if (ret) { + pr_err("Failed to request GPIO_%d_%d: %d\n", + PAD_BANK(tx28_fec_gpio_pads[i]), + PAD_PIN(tx28_fec_gpio_pads[i]), ret); + goto free_gpios; + } + ret = gpio_direction_output(gpio, 0); + if (ret) { + pr_err("Failed to set direction of GPIO_%d_%d to output: %d\n", + gpio / 32 + 1, gpio % 32, ret); + goto free_gpios; + } + } + + /* Power up fec phy */ + pr_debug("%s: Switching FEC PHY power on\n", __func__); + ret = gpio_direction_output(TX28_FEC_PHY_POWER, 1); + if (ret) { + pr_err("Failed to power on PHY: %d\n", ret); + goto free_gpios; + } + mdelay(26); /* 25ms according to data sheet */ + + /* nINT */ + gpio_direction_input(MXS_GPIO_NR(4, 5)); + /* Mode strap pins */ + gpio_direction_output(MXS_GPIO_NR(4, 2), 1); + gpio_direction_output(MXS_GPIO_NR(4, 3), 1); + gpio_direction_output(MXS_GPIO_NR(4, 4), 1); + + udelay(100); /* minimum assertion time for nRST */ + + pr_debug("%s: Deasserting FEC PHY RESET\n", __func__); + gpio_set_value(TX28_FEC_PHY_RESET, 1); + + ret = mxs_iomux_setup_multiple_pads(tx28_fec_pads, + ARRAY_SIZE(tx28_fec_pads)); + if (ret) { + pr_debug("%s: mxs_iomux_setup_multiple_pads() failed with rc: %d\n", + __func__, ret); + goto free_gpios; + } + pr_debug("%s: Registering FEC device\n", __func__); + mx28_add_fec(0, &tx28_fec_data); + return 0; + +free_gpios: + while (--i >= 0) { + unsigned int gpio = MXS_GPIO_NR(PAD_BANK(tx28_fec_gpio_pads[i]), + PAD_PIN(tx28_fec_gpio_pads[i])); + + gpio_free(gpio); + } + + return ret; +} diff --git a/arch/arm/mach-mxs/module-tx28.h b/arch/arm/mach-mxs/module-tx28.h new file mode 100644 index 0000000..df9e1b6 --- /dev/null +++ b/arch/arm/mach-mxs/module-tx28.h @@ -0,0 +1,9 @@ +/* + * Copyright (C) 2010 Pengutronix + * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation. + */ +int __init tx28_add_fec0(void); -- 1.7.2.3 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] ARM: mxs: Initial support for Ka-Ro TX28 2011-02-24 21:04 ` [PATCH] ARM: mxs: Initial support for Ka-Ro TX28 Uwe Kleine-König @ 2011-02-25 9:00 ` Uwe Kleine-König 2011-02-26 7:50 ` Shawn Guo 1 sibling, 0 replies; 12+ messages in thread From: Uwe Kleine-König @ 2011-02-25 9:00 UTC (permalink / raw) To: linux-arm-kernel Hello, as requested by Sascha I squashed the following patch in: diff --git a/arch/arm/mach-mxs/mach-tx28.c b/arch/arm/mach-mxs/mach-tx28.c index 540d6ea..b609b84 100644 --- a/arch/arm/mach-mxs/mach-tx28.c +++ b/arch/arm/mach-mxs/mach-tx28.c @@ -130,7 +130,6 @@ static const struct gpio_led_platform_data tx28_stk5v3_led_data __initconst = { }; static struct spi_board_info tx28_spi_board_info[] = { -#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) { .modalias = "spidev", .max_speed_hz = 20000000, @@ -139,7 +138,6 @@ static struct spi_board_info tx28_spi_board_info[] = { .controller_data = (void *)SPI_GPIO_NO_CHIPSELECT, .mode = SPI_MODE_0, }, -#endif }; static void __init tx28_stk5v3_init(void) The branch in my public repository is updated. Thanks Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] ARM: mxs: Initial support for Ka-Ro TX28 2011-02-24 21:04 ` [PATCH] ARM: mxs: Initial support for Ka-Ro TX28 Uwe Kleine-König 2011-02-25 9:00 ` Uwe Kleine-König @ 2011-02-26 7:50 ` Shawn Guo 1 sibling, 0 replies; 12+ messages in thread From: Shawn Guo @ 2011-02-26 7:50 UTC (permalink / raw) To: linux-arm-kernel On Thu, Feb 24, 2011 at 10:04:40PM +0100, Uwe Kleine-K?nig wrote: > From: Lothar Wa?mann <LW@KARO-electronics.de> > > Based on code created by Lothar Wa?mann, Sascha Hauer, Wolfram Sang and > me. > > Signed-off-by: Lothar Wa?mann <LW@KARO-electronics.de> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> > Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> > --- > arch/arm/mach-mxs/Kconfig | 12 ++ > arch/arm/mach-mxs/Makefile | 2 + > arch/arm/mach-mxs/include/mach/mxs.h | 9 +- > arch/arm/mach-mxs/include/mach/uncompress.h | 1 + > arch/arm/mach-mxs/mach-tx28.c | 175 +++++++++++++++++++++++++++ > arch/arm/mach-mxs/module-tx28.c | 131 ++++++++++++++++++++ > arch/arm/mach-mxs/module-tx28.h | 9 ++ > 7 files changed, 337 insertions(+), 2 deletions(-) > create mode 100644 arch/arm/mach-mxs/mach-tx28.c > create mode 100644 arch/arm/mach-mxs/module-tx28.c > create mode 100644 arch/arm/mach-mxs/module-tx28.h > > diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig > index 836cc81..895d066 100644 > --- a/arch/arm/mach-mxs/Kconfig > +++ b/arch/arm/mach-mxs/Kconfig > @@ -39,4 +39,16 @@ config MACH_MX28EVK > Include support for MX28EVK platform. This includes specific > configurations for the board and its peripherals. > > +config MODULE_TX28 > + bool > + select SOC_IMX28 > + select MXS_HAVE_AMBA_DUART > + select MXS_HAVE_PLATFORM_AUART > + select MXS_HAVE_PLATFORM_FEC > + select MXS_HAVE_PLATFORM_MXS_PWM > + > +config MACH_TX28 > + bool "Ka-Ro TX28 module" > + select MODULE_TX28 > + > endif > diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile > index 6b26f02..2f1f614 100644 > --- a/arch/arm/mach-mxs/Makefile > +++ b/arch/arm/mach-mxs/Makefile > @@ -9,5 +9,7 @@ obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o > > obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o > obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o > +obj-$(CONFIG_MODULE_TX28) += module-tx28.o > +obj-$(CONFIG_MACH_TX28) += mach-tx28.o > > obj-y += devices/ > diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h > index f186c08..35a89dd 100644 > --- a/arch/arm/mach-mxs/include/mach/mxs.h > +++ b/arch/arm/mach-mxs/include/mach/mxs.h > @@ -28,8 +28,13 @@ > /* > * MXS CPU types > */ > -#define cpu_is_mx23() (machine_is_mx23evk()) > -#define cpu_is_mx28() (machine_is_mx28evk()) > +#define cpu_is_mx23() ( \ > + machine_is_mx23evk() || \ > + 0) > +#define cpu_is_mx28() ( \ > + machine_is_mx28evk() || \ > + machine_is_tx28() || \ > + 0) > > /* > * IO addresses common to MXS-based > diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h > index a005e76..f12a173 100644 > --- a/arch/arm/mach-mxs/include/mach/uncompress.h > +++ b/arch/arm/mach-mxs/include/mach/uncompress.h > @@ -63,6 +63,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id) > mxs_duart_base = MX23_DUART_BASE_ADDR; > break; > case MACH_TYPE_MX28EVK: > + case MACH_TYPE_TX28: > mxs_duart_base = MX28_DUART_BASE_ADDR; > break; > default: > diff --git a/arch/arm/mach-mxs/mach-tx28.c b/arch/arm/mach-mxs/mach-tx28.c > new file mode 100644 > index 0000000..540d6ea > --- /dev/null > +++ b/arch/arm/mach-mxs/mach-tx28.c > @@ -0,0 +1,175 @@ > +/* > + * Copyright (C) 2010 <LW@KARO-electronics.de> > + * > + * based on: mach-mx28_evk.c mach-mx28evk.c? > + * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License > + * version 2 as published by the Free Software Foundation > + */ -- Regards, Shawn ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-02-26 7:50 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-02-18 21:30 [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 1/5] ARM: mxs: free dma_mask in error path Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 2/5] ARM: mxc: " Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 3/5] ARM: mxs: add a dma mask to fec devices Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 4/5] ARM: mxc: " Uwe Kleine-König 2011-02-18 21:30 ` [PATCH 5/5] ARM: mxs: Add pwm clocks and device registration Uwe Kleine-König 2011-02-23 9:12 ` [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König 2011-02-23 9:13 ` [PATCH] ARM: mx51_defconfig: enable various options Uwe Kleine-König 2011-02-24 21:03 ` [PATCH 0/5] my imx patches for 2.6.39 Uwe Kleine-König 2011-02-24 21:04 ` [PATCH] ARM: mxs: Initial support for Ka-Ro TX28 Uwe Kleine-König 2011-02-25 9:00 ` Uwe Kleine-König 2011-02-26 7:50 ` Shawn Guo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).