linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: Roland Stigge <stigge@antcom.de>
Cc: arm@kernel.org, linux-arm-kernel@lists.infradead.org,
	gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	dmitry.torokhov@gmail.com, axel.lin@gmail.com,
	broonie@opensource.wolfsonmicro.com, marek.vasut@gmail.com,
	devel@driverdev.osuosl.org, kevin.wells@nxp.com,
	srinivas.bakki@nxp.com
Subject: Re: [PATCH v2 8/8] ARM: LPC32xx: Device tree support
Date: Wed, 18 Apr 2012 08:02:30 +0200	[thread overview]
Message-ID: <20120418060230.GC17506@avionic-0098.adnet.avionic-design.de> (raw)
In-Reply-To: <1334682507-15055-9-git-send-email-stigge@antcom.de>

[-- Attachment #1: Type: text/plain, Size: 4495 bytes --]

* Roland Stigge wrote:
> This patch does the actual device tree switch for the LPC32xx SoC.
> 
> Signed-off-by: Roland Stigge <stigge@antcom.de>
> 
> ---
> 
> Applies to v3.4-rc3
> 
>  Documentation/devicetree/bindings/arm/lpc32xx-mic.txt |   38 +++
>  Documentation/devicetree/bindings/arm/lpc32xx.txt     |    8 
>  arch/arm/Kconfig                                      |    1 
>  arch/arm/mach-lpc32xx/Kconfig                         |   26 --
>  arch/arm/mach-lpc32xx/clock.c                         |   77 +++----
>  arch/arm/mach-lpc32xx/common.c                        |  192 ------------------
>  arch/arm/mach-lpc32xx/common.h                        |   14 -
>  arch/arm/mach-lpc32xx/irq.c                           |   78 +++++--

Could this perhaps be split into another patch. Basically this is a
conversion to IRQ domain *and* device tree support. But maybe it isn't worth
the effort.

>  arch/arm/mach-lpc32xx/phy3250.c                       |  146 +++++--------

While at it, this should probably be renamed board-dt.c or something similar
since it is no longer phy3250 specific.

[...]
> --- linux-2.6.orig/arch/arm/mach-lpc32xx/phy3250.c
> +++ linux-2.6/arch/arm/mach-lpc32xx/phy3250.c
[...]
> -static void __init phy3250_board_init(void)
> +static void __init lpc3250_machine_init(void)
>  {
>  	u32 tmp;
> -	int i;
> -
> -	lpc32xx_gpio_init();
> -
> -	/* Register GPIOs used on this board */
> -	if (gpio_request(SPI0_CS_GPIO, "spi0 cs"))
> -		printk(KERN_ERR "Error requesting gpio %u",
> -			SPI0_CS_GPIO);
> -	else if (gpio_direction_output(SPI0_CS_GPIO, 1))
> -		printk(KERN_ERR "Error setting gpio %u to output",
> -			SPI0_CS_GPIO);
> -
> -	/* Setup network interface for RMII mode */
> -	tmp = __raw_readl(LPC32XX_CLKPWR_MACCLK_CTRL);
> -	tmp &= ~LPC32XX_CLKPWR_MACCTRL_PINS_MSK;
> -	tmp |= LPC32XX_CLKPWR_MACCTRL_USE_RMII_PINS;
> -	__raw_writel(tmp, LPC32XX_CLKPWR_MACCLK_CTRL);
>  
>  	/* Setup SLC NAND controller muxing */
>  	__raw_writel(LPC32XX_CLKPWR_NANDCLK_SEL_SLC,
> @@ -300,6 +265,12 @@ static void __init phy3250_board_init(vo
>  	tmp |= LPC32XX_CLKPWR_LCDCTRL_LCDTYPE_TFT16;
>  	__raw_writel(tmp, LPC32XX_CLKPWR_LCDCLK_CTRL);
>  
> +	/* Set up USB power */
> +	tmp = __raw_readl(LPC32XX_CLKPWR_USB_CTRL);
> +	tmp |= LPC32XX_CLKPWR_USBCTRL_HCLK_EN |
> +		LPC32XX_CLKPWR_USBCTRL_USBI2C_EN;
> +	__raw_writel(tmp, LPC32XX_CLKPWR_USB_CTRL);
> +
>  	/* Set up I2C pull levels */
>  	tmp = __raw_readl(LPC32XX_CLKPWR_I2C_CLK_CTRL);
>  	tmp |= LPC32XX_CLKPWR_I2CCLK_USBI2CHI_DRIVE |
> @@ -321,33 +292,35 @@ static void __init phy3250_board_init(vo
>  	/*
>  	 * AMBA peripheral clocks need to be enabled prior to AMBA device
>  	 * detection or a data fault will occur, so enable the clocks
> -	 * here. However, we don't want to enable them if the peripheral
> -	 * isn't included in the image
> +	 * here.
>  	 */
> -#ifdef CONFIG_FB_ARMCLCD
>  	tmp = __raw_readl(LPC32XX_CLKPWR_LCDCLK_CTRL);
>  	__raw_writel((tmp | LPC32XX_CLKPWR_LCDCTRL_CLK_EN),
>  		LPC32XX_CLKPWR_LCDCLK_CTRL);
> -#endif
> -#ifdef CONFIG_SPI_PL022
> +
>  	tmp = __raw_readl(LPC32XX_CLKPWR_SSP_CLK_CTRL);
>  	__raw_writel((tmp | LPC32XX_CLKPWR_SSPCTRL_SSPCLK0_EN),
>  		LPC32XX_CLKPWR_SSP_CLK_CTRL);
> -#endif
>  
> -	platform_add_devices(phy3250_devs, ARRAY_SIZE(phy3250_devs));
> -	for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
> -		struct amba_device *d = amba_devs[i];
> -		amba_device_register(d, &iomem_resource);
> -	}
> +	tmp = __raw_readl(LPC32XX_CLKPWR_DMA_CLK_CTRL);
> +	__raw_writel((tmp | LPC32XX_CLKPWR_DMACLKCTRL_CLK_EN),
> +		     LPC32XX_CLKPWR_DMA_CLK_CTRL);
>  	/* Test clock needed for UDA1380 initial init */
>  	__raw_writel(LPC32XX_CLKPWR_TESTCLK2_SEL_MOSC |
>  		LPC32XX_CLKPWR_TESTCLK_TESTCLK2_EN,
>  		LPC32XX_CLKPWR_TEST_CLK_SEL);

A lot of these seem to be gratuitous here. Can control of these clocks not be
exposed via the clock framework? That would allow the controllers to only
activate them when actually needed. This could also be done in follow up
patches, though.

[...]
> +	/* Register GPIOs used on this board */
> +	if (gpio_request(SPI0_CS_GPIO, "spi0 cs"))
> +		printk(KERN_ERR "Error requesting gpio %u",
> +			SPI0_CS_GPIO);
> +	else if (gpio_direction_output(SPI0_CS_GPIO, 1))
> +		printk(KERN_ERR "Error setting gpio %u to output",
> +			SPI0_CS_GPIO);

This should be initialized based on data from the device tree.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2012-04-18  6:02 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17 17:08 [PATCH v2 0/8] Second patchset for LPC32xx device tree conversion Roland Stigge
2012-04-17 17:08 ` [PATCH v2 1/8] ohci-nxp: Driver cleanup Roland Stigge
2012-04-17 20:36   ` Arnd Bergmann
2012-04-17 21:03     ` Roland Stigge
2012-04-17 20:57   ` Dan Carpenter
2012-04-18  8:23     ` Roland Stigge
2012-04-18  4:55   ` Thierry Reding
2012-04-17 17:08 ` [PATCH v2 2/8] ohci-nxp: Device tree support Roland Stigge
2012-04-17 17:08 ` [PATCH v2 3/8] ARM: LPC32xx: clock.c update Roland Stigge
2012-04-17 21:09   ` Dan Carpenter
2012-04-18  8:33     ` Roland Stigge
2012-04-17 17:08 ` [PATCH v2 4/8] ARM: LPC32xx: Remove obsolete platform Kconfig Roland Stigge
2012-04-17 17:08 ` [PATCH v2 5/8] input: Device tree support for LPC32xx touchscreen Roland Stigge
2012-04-17 17:08 ` [PATCH v2 6/8] iio: lpc32xx-adc: Remove driver conflict due to device tree Roland Stigge
     [not found] ` <1334682507-15055-1-git-send-email-stigge-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org>
2012-04-17 17:08   ` [PATCH v2 7/8] ARM: LPC32xx: DTS files for device tree conversion Roland Stigge
     [not found]     ` <1334682507-15055-8-git-send-email-stigge-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org>
2012-04-18  5:46       ` Thierry Reding
     [not found]         ` <20120418054615.GB17506-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-04-18  8:10           ` Arnd Bergmann
2012-04-18  8:36     ` Arnd Bergmann
2012-04-17 17:08 ` [PATCH v2 8/8] ARM: LPC32xx: Device tree support Roland Stigge
2012-04-18  6:02   ` Thierry Reding [this message]
2012-04-18  8:15     ` Arnd Bergmann
     [not found]     ` <20120418060230.GC17506-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2012-04-18 12:30       ` Roland Stigge
2012-04-18 14:01         ` Arnd Bergmann
2012-04-17 20:50 ` [PATCH v2 0/8] Second patchset for LPC32xx device tree conversion Dan Carpenter
2012-04-18  8:00   ` Roland Stigge
2012-04-18  8:06   ` Arnd Bergmann
2012-04-18  9:36     ` Dan Carpenter
2012-04-18 11:00       ` Arnd Bergmann
2012-04-18 12:14         ` Dan Carpenter
2012-04-18 16:56         ` Mark Brown
2012-04-19 14:21           ` Arnd Bergmann
2012-04-18 10:45     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120418060230.GC17506@avionic-0098.adnet.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=arm@kernel.org \
    --cc=axel.lin@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kevin.wells@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=srinivas.bakki@nxp.com \
    --cc=stigge@antcom.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).