public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/4] ARM: imx: add initial support for MVF600
Date: Thu, 16 May 2013 12:29:28 +0200	[thread overview]
Message-ID: <5396520.ZTuSn9S4Vd@wuerfel> (raw)
In-Reply-To: <1368684648-20826-3-git-send-email-b35083@freescale.com>

On Thursday 16 May 2013 14:10:46 Jingchang Lu wrote:

> index a402248..b9c01a1 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -835,6 +835,21 @@ config SOC_IMX6SL
>  	help
>  	  This enables support for Freescale i.MX6 SoloLite processor.
>  
> +config SOC_MVF600
> +	bool "Vybrid Family MVF600 support"
> +	select CPU_V7
> +	select ARM_GIC
> +	select CLKSRC_OF
> +	select PINCTRL
> +	select PINCTRL_MVF600
> +	select MVF600_PIT_TIMER
> +	select PL310_ERRATA_588369 if CACHE_PL310
> +	select PL310_ERRATA_727915 if CACHE_PL310
> +	select PL310_ERRATA_769419 if CACHE_PL310
> +
> +	help
> +	  This enable support for Freescale Vybrid MVF600 processor.
> +
>  endif

Shouldn't that 'depends on ARCH_MULTI_V7'?

Can you describe how much Vybrid is actually like MXC? Do you actually
use most of the mach-imx code?

> diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
> index 208e76f..55cdba0 100644
> --- a/arch/arm/mach-imx/common.h
> +++ b/arch/arm/mach-imx/common.h
> @@ -70,6 +70,7 @@ extern int mx51_clocks_init_dt(void);
>  extern int mx53_clocks_init_dt(void);
>  extern int mx6q_clocks_init(void);
>  extern int imx6sl_clocks_init(void);
> +extern int mvf600_clocks_init(void);
>  extern struct platform_device *mxc_register_gpio(char *name, int id,
>  	resource_size_t iobase, resource_size_t iosize, int irq, int irq_high);
>  extern void mxc_set_cpu_type(unsigned int type);

This hunk belongs into the first patch, right?

Actually I think you should move that driver to drivers/clk and use
of_clk_init(NULL) to initialize it.

> +static void __init mvf600_init_machine(void)
> +{
> +	mxc_arch_reset_init_dt();

I don't see the mxc_arch_reset_init_dt function in 3.10-rc1. Where does it
get introduced?

It would be nice if we could integrate that into the watchdog driver,
so that driver just registers a pm_restart function when it gets loaded.
It is a rather small driver, so it would not hurt to always load it.

> +	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> +}

It would be nicer if you could just use the default init_machine.

> +static void __init mvf600_init_irq(void)
> +{
> +	struct device_node *np;
> +	void __iomem *mscm_base;
> +	int i;
> +
> +	l2x0_of_init(0, ~0UL);
> +
> +	np = of_find_compatible_node(NULL, NULL, "fsl,mvf600-mscm");
> +	mscm_base = of_iomap(np, 0);
> +	if (!mscm_base)
> +		return;
> +
> +	/* route all shared peripheral interrupts to CP0 */
> +	for (i = 0; i < 111; i++)
> +		__raw_writew(1, mscm_base + 0x880 + 2 * i);
> +
> +	iounmap(mscm_base);
> +
> +	irqchip_init();
> +}

What is the mscm? Shouldn't the boot loader have set this up correctly?
If you can remove that code from the kernel, you can use the default
irqchip_init call.

> +static void __init mvf600_init_time(void)
> +{
> +	mvf600_clocks_init();
> +	clocksource_of_init();
> +}

I would like to call of_clk_init(NULL) unconditionally on all machines
in 3.11, so this function could also go away.

> +static const char *mvf600_dt_compat[] __initdata = {
> +	"fsl,mvf600",
> +	NULL,
> +};
> +
> +DT_MACHINE_START(VYBRID_VF6XX, "Freescale Vybrid MVF600 (Device Tree)")
> +	.init_irq	= mvf600_init_irq,
> +	.init_time	= mvf600_init_time,
> +	.init_machine   = mvf600_init_machine,
> +	.dt_compat	= mvf600_dt_compat,
> +	.restart	= mxc_restart,
> +MACHINE_END

If we can do all of the above, we can actually remove the entire machine
descriptor here, since all its members are NULL.

	Arnd

  reply	other threads:[~2013-05-16 10:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16  6:10 [PATCH v3 0/4] Add initial Freescale Vybrid MVF600 support Jingchang Lu
2013-05-16  6:10 ` [PATCH v3 1/4] ARM: imx: add MVF600 clock support Jingchang Lu
2013-05-16  6:10 ` [PATCH v3 2/4] ARM: imx: add initial support for MVF600 Jingchang Lu
2013-05-16 10:29   ` Arnd Bergmann [this message]
2013-05-17  8:57     ` Shawn Guo
2013-05-17 12:29       ` Arnd Bergmann
2013-05-17 12:31         ` Arnd Bergmann
2013-05-17 13:06         ` Shawn Guo
2013-05-17 13:17           ` Arnd Bergmann
2013-05-17 13:54             ` Shawn Guo
2013-05-21  2:17             ` Shawn Guo
2013-05-17  9:08   ` Shawn Guo
2013-05-18  1:27   ` Shawn Guo
2013-05-16  6:10 ` [PATCH v3 3/4] ARM: dts: add SoC level device tree source " Jingchang Lu
2013-05-19 14:14   ` Shawn Guo
2013-05-16  6:10 ` [PATCH v3 4/4] ARM: dts: add initial MVF600 Tower board dts support Jingchang Lu
2013-05-19 15:29   ` Shawn Guo
2013-05-20  5:01     ` Lu Jingchang-B35083
2013-05-20  5:53       ` Shawn Guo

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=5396520.ZTuSn9S4Vd@wuerfel \
    --to=arnd@arndb.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox