All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: Matteo Facchinetti <matteo.facchinetti@sirius-es.it>
Cc: gregkh@linuxfoundation.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 3/3] powerpc/mpc512x: add platform code for MPC5125.
Date: Sat, 30 Mar 2013 23:32:41 +0100	[thread overview]
Message-ID: <20130330233241.25846714@crub> (raw)
In-Reply-To: <1363801314-16967-4-git-send-email-matteo.facchinetti@sirius-es.it>

On Wed, 20 Mar 2013 18:41:54 +0100
Matteo Facchinetti <matteo.facchinetti@sirius-es.it> wrote:
...
> diff --git a/arch/powerpc/boot/dts/mpc5125twr.dts b/arch/powerpc/boot/dts/mpc5125twr.dts
> new file mode 100644
> index 0000000..afcad7a
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/mpc5125twr.dts
...
> +
> +		diu@2100 {
> +			device_type = "display";

device_type is deprecated (for nodes other than cpu and memory).

...
> +		serial@11100 {
> +			device_type = "serial";
> +			compatible = "fsl,mpc5125-psc-uart", "fsl,mpc5125-psc";
> +			port-number = <0>;

port-number property is not used anywhere, please remove.
Remove device_type property, too.

...
> +		// PSC9 uart1 aka ttyPSC1
> +		serial@11900 {
> +			device_type = "serial";
> +			compatible = "fsl,mpc5125-psc-uart", "fsl,mpc5125-psc";
> +			port-number = <1>;

drop device_type and port-number properties.


> diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
> index 52d57d2..a8987dc2 100644
> --- a/arch/powerpc/platforms/512x/clock.c
> +++ b/arch/powerpc/platforms/512x/clock.c
> @@ -29,6 +29,8 @@
>  #include <asm/mpc5121.h>
>  #include <asm/clk_interface.h>
>  
> +#include "mpc512x.h"
> +
>  #undef CLK_DEBUG
>  
>  static int clocks_initialized;
> @@ -683,8 +685,13 @@ static void psc_clks_init(void)
>  	struct device_node *np;
>  	struct platform_device *ofdev;
>  	u32 reg;
> +	char *psc_compat;

it should be const char *.

...
> diff --git a/arch/powerpc/platforms/512x/mpc512x.h b/arch/powerpc/platforms/512x/mpc512x.h
> index c32b399..2b97622 100644
> --- a/arch/powerpc/platforms/512x/mpc512x.h
> +++ b/arch/powerpc/platforms/512x/mpc512x.h
> @@ -15,6 +15,7 @@ extern void __init mpc512x_init_IRQ(void);
>  extern void __init mpc512x_init(void);
>  extern int __init mpc5121_clk_init(void);
>  void __init mpc512x_declare_of_platform_devices(void);
> +extern char *mpc512x_select_psc_compat(void);

const char *.

...
> diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
> index d30235b..fbf67e9 100644
> --- a/arch/powerpc/platforms/512x/mpc512x_shared.c
> +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
> @@ -350,6 +350,21 @@ void __init mpc512x_declare_of_platform_devices(void)
>  
>  #define DEFAULT_FIFO_SIZE 16
>  
> +char *mpc512x_select_psc_compat(void)

const char *.

> +{
> +	char *psc_compats[] = {
> +		"fsl,mpc5121-psc",
> +		"fsl,mpc5125-psc"
> +	};
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(psc_compats); i++)
> +		if (of_find_compatible_node(NULL, NULL, psc_compats[i]))
> +			return psc_compats[i];

I don't like this, better would be to use something like:

        if (of_machine_is_compatible("fsl,mpc5121"))
                return "fsl,mpc5121-psc";

        if (of_machine_is_compatible("fsl,mpc5125"))
                return "fsl,mpc5125-psc";

but note that it will only work if we add these compatibles
to the compatible list of the root nodes in 5121 and 5125
device trees.

Thanks,

Anatolij

  reply	other threads:[~2013-03-30 22:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 17:41 [PATCH 0/3] Add MPC5125 platform support Matteo Facchinetti
2013-03-20 17:41 ` [PATCH 1/3] powerpc/512x: move mpc5121_generic platform to mpc512x_generic Matteo Facchinetti
2013-03-30 22:01   ` Anatolij Gustschin
2013-03-20 17:41 ` [PATCH 2/3] serial/mpc52xx_uart: add PSC UART support for MPC5125 platforms Matteo Facchinetti
2013-04-17 21:21   ` [PATCH v2 1/2] serial/mpc52xx_uart: prepare for adding MPC5125 PSC UART support Anatolij Gustschin
2013-04-17 21:21     ` Anatolij Gustschin
2013-04-17 21:21     ` [PATCH v2 2/2] serial/mpc52xx_uart: add MPC5125 PSC support Anatolij Gustschin
2013-04-17 21:21       ` Anatolij Gustschin
2013-05-24 17:49     ` [PATCH v2 1/2] serial/mpc52xx_uart: prepare for adding MPC5125 PSC UART support Anatolij Gustschin
2013-05-24 17:49       ` Anatolij Gustschin
2013-05-24 17:57       ` Greg Kroah-Hartman
2013-05-24 17:57         ` Greg Kroah-Hartman
2013-04-17 21:24   ` [PATCH 2/3] serial/mpc52xx_uart: add PSC UART support for MPC5125 platforms Anatolij Gustschin
2013-03-20 17:41 ` [PATCH 3/3] powerpc/mpc512x: add platform code for MPC5125 Matteo Facchinetti
2013-03-30 22:32   ` Anatolij Gustschin [this message]
2013-04-02  9:49     ` Matteo Facchinetti
2013-04-02 10:38       ` Anatolij Gustschin

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=20130330233241.25846714@crub \
    --to=agust@denx.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=matteo.facchinetti@sirius-es.it \
    /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.