linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Mark Zhan <rongkai.zhan@windriver.com>
To: paulus@samba.org, linuxppc-dev@ozlabs.org
Subject: [PATCH 2/3] 82xx: Parse SMC serial device node in DTS
Date: Mon, 16 Jul 2007 17:01:45 +0800	[thread overview]
Message-ID: <469B33F9.2080604@windriver.com> (raw)

This patch makes 'cpm_uart_of_init' be able to parses SMC serial device node in DTS

Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com>
---
  arch/powerpc/sysdev/fsl_soc.c |   37 ++++++++++++++++++++-----------------
  1 file changed, 20 insertions(+), 17 deletions(-)

Index: linux-powerpc-2.6.x/arch/powerpc/sysdev/fsl_soc.c
===================================================================
--- linux-powerpc-2.6.x.orig/arch/powerpc/sysdev/fsl_soc.c	2007-07-16 15:52:17.000000000 +0800
+++ linux-powerpc-2.6.x/arch/powerpc/sysdev/fsl_soc.c	2007-07-16 16:59:31.000000000 +0800
@@ -757,8 +757,8 @@

  arch_initcall(fs_enet_of_init);

-static const char scc_regs[] = "regs";
-static const char scc_pram[] = "pram";
+static const char cpm_uart_regs[] = "regs";
+static const char cpm_uart_pram[] = "pram";

  static int __init cpm_uart_of_init(void)
  {
@@ -775,6 +775,7 @@
  		const int *id;
  		const char *model;

+		cpm_uart_dev = NULL;
  		memset(r, 0, sizeof(r));
  		memset(&cpm_uart_data, 0, sizeof(cpm_uart_data));

@@ -782,31 +783,35 @@
  		if (ret)
  			goto err;

-		r[0].name = scc_regs;
+		r[0].name = cpm_uart_regs;

  		ret = of_address_to_resource(np, 1, &r[1]);
  		if (ret)
  			goto err;
-		r[1].name = scc_pram;
+		r[1].name = cpm_uart_pram;

  		of_irq_to_resource(np, 0, &r[2]);

-		cpm_uart_dev =
-		    platform_device_register_simple("fsl-cpm-scc:uart", i, &r[0], 3);
-
-		if (IS_ERR(cpm_uart_dev)) {
-			ret = PTR_ERR(cpm_uart_dev);
-			goto err;
-		}
-
  		id = of_get_property(np, "device-id", NULL);
  		cpm_uart_data.fs_no = *id;

  		model = of_get_property(np, "model", NULL);
  		strcpy(cpm_uart_data.fs_type, model);

-		cpm_uart_data.uart_clk = ppc_proc_freq;
+		if (strstr(model, "SMC")) {
+			cpm_uart_dev = platform_device_register_simple("fsl-cpm-smc:uart",
+							i, &r[0], 3);
+		} else if (strstr(model, "SCC")) {
+			cpm_uart_dev = platform_device_register_simple("fsl-cpm-scc:uart",
+							i, &r[0], 3);
+		}

+		if (IS_ERR(cpm_uart_dev)) {
+			ret = PTR_ERR(cpm_uart_dev);
+			goto err;
+		}
+
+		cpm_uart_data.uart_clk = ppc_proc_freq;
  		cpm_uart_data.tx_num_fifo = 4;
  		cpm_uart_data.tx_buf_size = 32;
  		cpm_uart_data.rx_num_fifo = 4;
@@ -816,10 +821,8 @@
  		cpm_uart_data.clk_tx = *((u32 *)of_get_property(np,
  						"tx-clock", NULL));

-		ret =
-		    platform_device_add_data(cpm_uart_dev, &cpm_uart_data,
-					     sizeof(struct
-						    fs_uart_platform_info));
+		ret = platform_device_add_data(cpm_uart_dev, &cpm_uart_data,
+					sizeof(struct fs_uart_platform_info));
  		if (ret)
  			goto unreg;
  	}

             reply	other threads:[~2007-07-16 19:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-16  9:01 Mark Zhan [this message]
2007-07-17  1:02 ` [PATCH 2/3] 82xx: Parse SMC serial device node in DTS Arnd Bergmann
2007-07-17  4:49   ` Mark Zhan
2007-07-17 12:06     ` Arnd Bergmann
2007-07-17 13:53       ` Mark Zhan
2007-07-17 13:06         ` Arnd Bergmann
2007-07-17 14:29           ` Mark Zhan
2007-07-17 14:18             ` Arnd Bergmann
2007-07-17 16:06               ` Scott Wood
2007-07-17 15:12         ` Segher Boessenkool
2007-07-17 15:08       ` Segher Boessenkool
2007-07-17 14:22         ` Arnd Bergmann

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=469B33F9.2080604@windriver.com \
    --to=rongkai.zhan@windriver.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).