All of lore.kernel.org
 help / color / mirror / Atom feed
From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine
Date: Mon, 7 Nov 2011 23:06:42 +0100	[thread overview]
Message-ID: <201111072306.43015.marek.vasut@gmail.com> (raw)
In-Reply-To: <4EB854BC.8020203@gmail.com>

> On 11/07/2011 03:31 PM, Marek Vasut wrote:
> > I use the Voipac PXA270 board for PXA DT conversion. This board is a
> > helper for the conversion to go smoothly and the testing to be easy.
> > 
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > Cc: Rob Herring <robherring2@gmail.com>
> > ---
> > 
> >  arch/arm/mach-pxa/Kconfig      |   15 +++++++
> >  arch/arm/mach-pxa/Makefile     |    3 +
> >  arch/arm/mach-pxa/vpac270-dt.c |   82
> >  ++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-pxa/vpac270.c   
> >  |    2 +
> >  4 files changed, 102 insertions(+), 0 deletions(-)
> >  create mode 100644 arch/arm/mach-pxa/vpac270-dt.c
> > 
> > diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
> > index 61d3c72..a9bba3d 100644
> > --- a/arch/arm/mach-pxa/Kconfig
> > +++ b/arch/arm/mach-pxa/Kconfig
> > @@ -616,6 +616,21 @@ config MACH_ZIPIT2
> > 
> >  	bool "Zipit Z2 Handheld"
> >  	select PXA27x
> >  	select HAVE_PWM
> 
> Add a blank line.
> 
> > +config MACH_VPAC_DT
> > +	bool "PXA (Voipac270) FDT Machine"
> 
> This should be more generic to be all PXA DT machines.

I need an initial porting machine, isn't it explicit enough ... the description 
below I mean.

> 
> > +	select PXA27x
> > +	select OF
> > +	depends on !MACH_VPAC270 && EXPERIMENTAL
> 
> Drop these depends.

Nope
> 
> > +	help
> > +	  PXA Device Tree Machine.
> > +	  This is to be a generic machine which probes all of it's drivers
> > +	  using the Flattened Device Tree blob. This is work-in-progress
> > +	  so don't expect much yet. We selected the Voipac PXA270 device
> > +	  as a base device to test support along the way.
> > +
> > +	  NOTE: This platform is mutually exclusive with the original!
> 
> It shouldn't need to be.

I want it that way ... eventually, this will be renamed to PXA_DT, but not now.
> 
> > +	  NOTE: Use only if you know what you're doing!!
> > +
> > 
> >  endif
> >  endmenu
> > 
> > diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
> > index be0f7df..2b80829 100644
> > --- a/arch/arm/mach-pxa/Makefile
> > +++ b/arch/arm/mach-pxa/Makefile
> > @@ -104,3 +104,6 @@ led-$(CONFIG_ARCH_PXA_IDP)	+= leds-idp.o
> > 
> >  obj-$(CONFIG_LEDS)		+= $(led-y)
> >  
> >  obj-$(CONFIG_TOSA_BT)		+= tosa-bt.o
> > 
> > +
> > +# PXA FDT board
> > +obj-$(CONFIG_MACH_VPAC_DT)	+= vpac270-dt.o
> > diff --git a/arch/arm/mach-pxa/vpac270-dt.c
> > b/arch/arm/mach-pxa/vpac270-dt.c new file mode 100644
> > index 0000000..dc9a6dd
> > --- /dev/null
> > +++ b/arch/arm/mach-pxa/vpac270-dt.c
> > @@ -0,0 +1,82 @@
> > +/*
> > + * Hardware definitions for Voipac PXA270 driven by FDT
> > + *
> > + * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
> > + *
> > + * NOTE: This is an ongoing effort of preparing generic FDT-based board
> > + *       for PXA machines. This particular device allows us to test the
> > + *       support for breakage.
> > + *
> > + * 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/of_platform.h>
> > +#include <linux/irqdomain.h>
> > +#include "vpac270.c"
> > +
> > +/***********************************************************************
> > ******* + * Machine init
> > +
> > ************************************************************************
> > ******/ +static const struct of_device_id pxairq_of_match[] __initconst =
> > { +	{ .compatible = "marvell,pxa-irq", },
> > +	{},
> > +};
> > +
> > +static void __init pxa_dt_init_irq(void)
> > +{
> > +	irq_domain_generate_simple(pxairq_of_match, 0x40d00000, 0);
> > +	pxa27x_init_irq();
> 
> Ideally the interrupt controller itself would be converted over to
> support domains and DT init.

That's the long-term plan.
> 
> > +}
> > +
> > +static struct of_device_id pxa_dt_match_table[] __initdata = {
> > +	{ .compatible = "simple-bus", },
> > +	{}
> > +};
> 
> Any reason you can't use the default table?

What default table?
> 
> > +
> > +static const struct of_dev_auxdata pxa_dt_auxdata_table[] __initconst =
> > { +	OF_DEV_AUXDATA("marvell,pxa2xx-uart", 0x40100000, "pxa2xx-uart.0",
> > NULL), +	OF_DEV_AUXDATA("marvell,pxa2xx-uart", 0x40200000,
> > "pxa2xx-uart.1", NULL), +	OF_DEV_AUXDATA("marvell,pxa2xx-uart",
> > 0x40700000, "pxa2xx-uart.2", NULL), +};
> 
> Is this for clkdev? If so, you can just add additional lookups using the
> DT device name.

What do you mean?
> 
> > +
> > +static void __init vpac270_dt_init(void)
> > +{
> > +	pxa2xx_mfp_config(ARRAY_AND_SIZE(vpac270_pin_config));
> > +
> > +	of_platform_populate(NULL, pxa_dt_match_table,
> > +				pxa_dt_auxdata_table, NULL);
> > +
> > +	pxa_set_i2c_info(NULL);
> > +	pxa27x_set_i2c_power_info(NULL);
> > +
> > +	vpac270_pmic_init();
> > +	vpac270_lcd_init();
> > +	vpac270_mmc_init();
> > +	vpac270_nor_init();
> > +	vpac270_onenand_init();
> > +	vpac270_leds_init();
> > +	vpac270_keys_init();
> > +	vpac270_uhc_init();
> > +	vpac270_udc_init();
> > +	vpac270_eth_init();
> > +	vpac270_ts_init();
> > +	vpac270_rtc_init();
> > +	vpac270_ide_init();
> 
> Generally, devices get added as they are converted to use DT.

Well the board won't boot purely from DT yet ... and to see it breaks nothing, 
I'm comparing it to non-dt implementation.
> 
> > +}
> > +
> > +static const char *vpac270_dt_board_compat[] __initdata = {
> > +	"voipac,vpac270",
> > +	NULL
> > +};
> > +
> > +DT_MACHINE_START(PXA_DT, "Marvell PXA2xx/PXA3xx (Flattened Device
> > Tree)") +	.map_io		= pxa27x_map_io,
> > +	.init_irq	= pxa_dt_init_irq,
> > +	.handle_irq	= pxa27x_handle_irq,
> > +	.timer		= &pxa_timer,
> > +	.init_machine	= vpac270_dt_init,
> > +	.dt_compat	= vpac270_dt_board_compat,
> > +MACHINE_END
> > diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
> > index a7539a6..339ecdf 100644
> > --- a/arch/arm/mach-pxa/vpac270.c
> > +++ b/arch/arm/mach-pxa/vpac270.c
> > @@ -715,6 +715,7 @@ static void __init vpac270_init(void)
> > 
> >  	vpac270_ide_init();
> >  
> >  }
> > 
> > +#ifndef	CONFIG_MACH_VPAC_DT
> > 
> >  MACHINE_START(VPAC270, "Voipac PXA270")
> >  
> >  	.atag_offset	= 0x100,
> >  	.map_io		= pxa27x_map_io,
> > 
> > @@ -723,3 +724,4 @@ MACHINE_START(VPAC270, "Voipac PXA270")
> > 
> >  	.timer		= &pxa_timer,
> >  	.init_machine	= vpac270_init
> >  
> >  MACHINE_END
> > 
> > +#endif
> 
> You shouldn't need this ifndef.

For some reason, it refuses to boot if I do have both compiled in.

> 
> Rob

M

  reply	other threads:[~2011-11-07 22:06 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 18:32 [PATCH 0/3] Initial PXA DT bindings Marek Vasut
2011-11-01 18:32 ` [PATCH 1/3] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
2011-11-01 20:00   ` Rob Herring
2011-11-01 20:15     ` Marek Vasut
2011-11-02 13:52       ` Rob Herring
2011-11-02 14:30         ` Marek Vasut
2011-11-07 22:24   ` Grant Likely
2011-11-07 22:25     ` Marek Vasut
2011-11-01 18:32 ` [PATCH 2/3] ARM: pxa: Add DT testing machine Marek Vasut
2011-11-07 22:18   ` Grant Likely
2011-11-07 22:24     ` Marek Vasut
2011-11-01 18:32 ` [PATCH 3/3] ARM: pxa: Add basic DTS files for PXA/Vpac270 " Marek Vasut
2011-11-07 21:31 ` [PATCH 0/3 V2] Initial PXA DT bindings Marek Vasut
2011-11-07 21:31   ` [PATCH 1/3 V2] ARM: pxa: Add DT support to pxa2xx-uart Marek Vasut
2011-11-07 21:37     ` Rob Herring
2011-11-07 21:53       ` Marek Vasut
2011-11-10 12:00     ` Russell King - ARM Linux
2011-11-10 16:59       ` Marek Vasut
2011-11-10 17:07         ` Rob Herring
2011-11-07 21:31   ` [PATCH 2/3 RESEND] ARM: pxa: Add DT testing machine Marek Vasut
2011-11-07 21:59     ` Rob Herring
2011-11-07 22:06       ` Marek Vasut [this message]
2011-11-07 22:30         ` Grant Likely
2011-11-07 22:31           ` Marek Vasut
2011-11-07 22:38             ` Rob Herring
2011-11-07 22:32         ` Rob Herring
2011-11-08  1:12           ` Grant Likely
2011-11-07 21:31   ` [PATCH 3/3 V2] ARM: pxa: Add basic DTS files for PXA/Vpac270 " Marek Vasut
2011-11-07 21:45     ` Rob Herring
2011-11-07 21:55       ` Marek Vasut
2011-11-07 22:03         ` Rob Herring
2012-07-17 13:30   ` [PATCH 0/3 V2] Initial PXA DT bindings Daniel Mack
2012-07-17 14:03     ` Arnd Bergmann
2012-07-17 14:47       ` Daniel Mack
2012-07-17 15:31         ` Arnd Bergmann
2012-07-17 18:04           ` Eric Miao
2012-07-17 19:57             ` Daniel Mack
2012-07-17 20:02               ` Eric Miao
2012-07-19  3:11               ` Haojian Zhuang
2012-07-17 19:14           ` Daniel Mack
2012-07-18 12:58             ` Marek Vasut

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=201111072306.43015.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.