All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>,
	linux-serial@vger.kernel.org, Alan Cox <alan@linux.intel.com>
Subject: [PATCH] atmel_serial: fix internal port num
Date: Tue, 21 Jun 2011 16:31:19 +0200	[thread overview]
Message-ID: <1308666679-12111-1-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1307541740.10626.15.camel@hcegtvedt.norway.atmel.com>

the atmel_ports is link to the console number and not the device id

this was not detected on at91 as we always register the dbgu on the console
as ttyS0

tested on at91sam9263 by setting the dbgu as ttyS1 and use as console

diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 70e5646..9b8a14f 100644
- a/arch/arm/mach-at91/board-sam9263ek.c
+ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -58,14 +58,14 @@ static void __init ek_init_early(void)
        /* Initialize processor: 16.367 MHz crystal */
        at91_initialize(16367660);

-       /* DBGU on ttyS0. (Rx & Tx only) */
-       at91_register_uart(0, 0, 0);
+       /* DBGU on ttyS1. (Rx & Tx only) */
+       at91_register_uart(0, 1, 0);

-       /* USART0 on ttyS1. (Rx, Tx, RTS, CTS) */
-       at91_register_uart(AT91SAM9263_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS);
+       /* USART0 on ttyS0. (Rx, Tx, RTS, CTS) */
+       at91_register_uart(AT91SAM9263_ID_US0, 0, ATMEL_UART_CTS | ATMEL_UART_RTS);

-       /* set serial console to ttyS0 (ie, DBGU) */
-       at91_set_serial_console(0);
+       /* set serial console to ttyS1 (ie, DBGU) */
+       at91_set_serial_console(1);
 }

 /*

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
---
 drivers/tty/serial/atmel_serial.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 6d5d6e6..af9b781 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1709,12 +1709,13 @@ static int atmel_serial_resume(struct platform_device *pdev)
 static int __devinit atmel_serial_probe(struct platform_device *pdev)
 {
 	struct atmel_uart_port *port;
+	struct atmel_uart_data *pdata = pdev->dev.platform_data;
 	void *data;
 	int ret;
 
 	BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
 
-	port = &atmel_ports[pdev->id];
+	port = &atmel_ports[pdata->num];
 	port->backup_imr = 0;
 
 	atmel_init_port(port, pdev);
-- 
1.7.4.1

WARNING: multiple messages have this Message-ID (diff)
From: plagnioj@jcrosoft.com (Jean-Christophe PLAGNIOL-VILLARD)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] atmel_serial: fix internal port num
Date: Tue, 21 Jun 2011 16:31:19 +0200	[thread overview]
Message-ID: <1308666679-12111-1-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1307541740.10626.15.camel@hcegtvedt.norway.atmel.com>

the atmel_ports is link to the console number and not the device id

this was not detected on at91 as we always register the dbgu on the console
as ttyS0

tested on at91sam9263 by setting the dbgu as ttyS1 and use as console

diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 70e5646..9b8a14f 100644
- a/arch/arm/mach-at91/board-sam9263ek.c
+ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -58,14 +58,14 @@ static void __init ek_init_early(void)
        /* Initialize processor: 16.367 MHz crystal */
        at91_initialize(16367660);

-       /* DBGU on ttyS0. (Rx & Tx only) */
-       at91_register_uart(0, 0, 0);
+       /* DBGU on ttyS1. (Rx & Tx only) */
+       at91_register_uart(0, 1, 0);

-       /* USART0 on ttyS1. (Rx, Tx, RTS, CTS) */
-       at91_register_uart(AT91SAM9263_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS);
+       /* USART0 on ttyS0. (Rx, Tx, RTS, CTS) */
+       at91_register_uart(AT91SAM9263_ID_US0, 0, ATMEL_UART_CTS | ATMEL_UART_RTS);

-       /* set serial console to ttyS0 (ie, DBGU) */
-       at91_set_serial_console(0);
+       /* set serial console to ttyS1 (ie, DBGU) */
+       at91_set_serial_console(1);
 }

 /*

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
---
 drivers/tty/serial/atmel_serial.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 6d5d6e6..af9b781 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1709,12 +1709,13 @@ static int atmel_serial_resume(struct platform_device *pdev)
 static int __devinit atmel_serial_probe(struct platform_device *pdev)
 {
 	struct atmel_uart_port *port;
+	struct atmel_uart_data *pdata = pdev->dev.platform_data;
 	void *data;
 	int ret;
 
 	BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
 
-	port = &atmel_ports[pdev->id];
+	port = &atmel_ports[pdata->num];
 	port->backup_imr = 0;
 
 	atmel_init_port(port, pdev);
-- 
1.7.4.1

  parent reply	other threads:[~2011-06-21 14:31 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-13 19:47 [PATCH] atmel_serial: keep the platform_device unchanged Jean-Christophe PLAGNIOL-VILLARD
2011-04-13 19:47 ` Jean-Christophe PLAGNIOL-VILLARD
2011-04-13 21:58 ` Alan Cox
2011-04-13 21:58   ` Alan Cox
2011-04-15 19:02   ` Jean-Christophe PLAGNIOL-VILLARD
2011-04-15 19:02     ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-08  8:45 ` Hans-Christian Egtvedt
2011-06-08  8:45   ` Hans-Christian Egtvedt
2011-06-08 13:47   ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-08 13:47     ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-08 13:47     ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-08 14:02     ` Hans-Christian Egtvedt
2011-06-08 14:02       ` Hans-Christian Egtvedt
2011-06-17  3:06       ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-17  3:06         ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-17  3:06         ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-21 14:28       ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-21 14:28         ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-21 14:28         ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-21 14:31       ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2011-06-21 14:31         ` [PATCH] atmel_serial: fix internal port num Jean-Christophe PLAGNIOL-VILLARD
2011-08-08 15:10         ` [PATCH] atmel_serial: fix atmel_default_console_device Nikolaus Voss
2011-08-09 11:41           ` Sergei Shtylyov
2011-08-09 14:16             ` Voss, Nikolaus
2011-08-09 14:16               ` Voss, Nikolaus
2011-08-09 14:17             ` Voss, Nikolaus
2011-08-10 11:13               ` Sergei Shtylyov
2011-08-10 12:02                 ` [PATCH v2] " Voss, Nikolaus
2011-08-10 12:02                   ` Voss, Nikolaus

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=1308666679-12111-1-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=alan@linux.intel.com \
    --cc=hans-christian.egtvedt@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    /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.