mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] console_simple: set baudrate at register
@ 2013-09-22  6:39 Jean-Christophe PLAGNIOL-VILLARD
  2013-09-22  6:39 ` [PATCH 2/2] serial: do not set default baudrate at init Jean-Christophe PLAGNIOL-VILLARD
  2013-09-22 18:29 ` [PATCH 1/2] console_simple: set baudrate at register Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-22  6:39 UTC (permalink / raw)
  To: barebox

as the console is always enable

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 common/console_simple.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/common/console_simple.c b/common/console_simple.c
index 5c80dcd..e1d4c85 100644
--- a/common/console_simple.c
+++ b/common/console_simple.c
@@ -89,6 +89,11 @@ int console_register(struct console_device *newcdev)
 	console_list.prev = console_list.next = &newcdev->list;
 	newcdev->list.prev = newcdev->list.next = &console_list;
 
+	if (newcdev->setbrg) {
+		newcdev->baudrate = CONFIG_BAUDRATE;
+		newcdev->setbrg(newcdev, newcdev->baudrate);
+	}
+
 	barebox_banner();
 
 	return 0;
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] serial: do not set default baudrate at init
  2013-09-22  6:39 [PATCH 1/2] console_simple: set baudrate at register Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-22  6:39 ` Jean-Christophe PLAGNIOL-VILLARD
  2013-09-22 18:29 ` [PATCH 1/2] console_simple: set baudrate at register Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-22  6:39 UTC (permalink / raw)
  To: barebox

this will be done at activation

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/serial/amba-pl011.c      | 4 ----
 drivers/serial/atmel.c           | 2 --
 drivers/serial/serial_auart.c    | 1 -
 drivers/serial/serial_clps711x.c | 3 ---
 drivers/serial/serial_imx.c      | 1 -
 drivers/serial/serial_ns16550.c  | 2 --
 6 files changed, 13 deletions(-)

diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 0f384e5..fc7723e 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -164,10 +164,6 @@ int pl011_init_port (struct console_device *cdev)
 	uart->uartclk = clk_get_rate(uart->clk);
 
 	/*
-	 * set baud rate
-	 */
-	pl011_setbaudrate(cdev, 115200);
-	/*
 	 ** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled.
 	 */
 	pl011_rlcr(uart, UART01x_LCRH_WLEN_8 | UART01x_LCRH_FEN);
diff --git a/drivers/serial/atmel.c b/drivers/serial/atmel.c
index 6a20eab..c2a5d33 100644
--- a/drivers/serial/atmel.c
+++ b/drivers/serial/atmel.c
@@ -405,8 +405,6 @@ static int atmel_serial_init_port(struct console_device *cdev)
 
 	writel(USART3_BIT(RSTRX) | USART3_BIT(RSTTX), uart->base + USART3_CR);
 
-	atmel_serial_setbaudrate(cdev, 115200);
-
 	writel(USART3_BIT(RXEN) | USART3_BIT(TXEN), uart->base + USART3_CR);
 	writel((USART3_BF(USART_MODE, USART3_USART_MODE_NORMAL)
 			   | USART3_BF(USCLKS, USART3_USCLKS_MCK)
diff --git a/drivers/serial/serial_auart.c b/drivers/serial/serial_auart.c
index 60a701d..1980516 100644
--- a/drivers/serial/serial_auart.c
+++ b/drivers/serial/serial_auart.c
@@ -201,7 +201,6 @@ static int auart_serial_probe(struct device_d *dev)
 		return PTR_ERR(priv->clk);
 
 	auart_serial_init_port(priv);
-	auart_serial_setbaudrate(cdev, CONFIG_BAUDRATE);
 
 	/* Disable RTS/CTS, enable Rx, Tx, UART */
 	writel(BM_UARTAPP_CTRL2_RTSEN | BM_UARTAPP_CTRL2_CTSEN |
diff --git a/drivers/serial/serial_clps711x.c b/drivers/serial/serial_clps711x.c
index 17d4c2e..e43d141 100644
--- a/drivers/serial/serial_clps711x.c
+++ b/drivers/serial/serial_clps711x.c
@@ -58,9 +58,6 @@ static void clps711x_init_port(struct console_device *cdev)
 	tmp |= UBRLCR_FIFOEN | UBRLCR_WRDLEN8; /* FIFO on, 8N1 mode */
 	writel(tmp, s->UBRLCR);
 
-	/* Set default baudrate on initialization */
-	clps711x_setbaudrate(cdev, CONFIG_BAUDRATE);
-
 	/* Enable the UART */
 	writel(readl(SYSCON(s)) | SYSCON_UARTEN, SYSCON(s));
 }
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
index e99dde8..01c7cc7 100644
--- a/drivers/serial/serial_imx.c
+++ b/drivers/serial/serial_imx.c
@@ -337,7 +337,6 @@ static int imx_serial_probe(struct device_d *dev)
 	cdev->setbrg = imx_serial_setbaudrate;
 
 	imx_serial_init_port(cdev);
-	imx_serial_setbaudrate(cdev, 115200);
 
 	/* Enable UART */
 	val = readl(priv->regs + UCR1);
diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
index 5ae2b76..59b509c 100644
--- a/drivers/serial/serial_ns16550.c
+++ b/drivers/serial/serial_ns16550.c
@@ -183,8 +183,6 @@ static void ns16550_serial_init_port(struct console_device *cdev)
 	ns16550_write(cdev, 0x07, mdr1);	/* Disable */
 #endif
 
-	ns16550_setbaudrate(cdev, CONFIG_BAUDRATE);
-
 #ifdef CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS
 	ns16550_write(cdev, 0x00,  mdr1);
 #endif
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] console_simple: set baudrate at register
  2013-09-22  6:39 [PATCH 1/2] console_simple: set baudrate at register Jean-Christophe PLAGNIOL-VILLARD
  2013-09-22  6:39 ` [PATCH 2/2] serial: do not set default baudrate at init Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-22 18:29 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2013-09-22 18:29 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Sun, Sep 22, 2013 at 08:39:55AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> as the console is always enable
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Applied, thanks

Sascha

> ---
>  common/console_simple.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/common/console_simple.c b/common/console_simple.c
> index 5c80dcd..e1d4c85 100644
> --- a/common/console_simple.c
> +++ b/common/console_simple.c
> @@ -89,6 +89,11 @@ int console_register(struct console_device *newcdev)
>  	console_list.prev = console_list.next = &newcdev->list;
>  	newcdev->list.prev = newcdev->list.next = &console_list;
>  
> +	if (newcdev->setbrg) {
> +		newcdev->baudrate = CONFIG_BAUDRATE;
> +		newcdev->setbrg(newcdev, newcdev->baudrate);
> +	}
> +
>  	barebox_banner();
>  
>  	return 0;
> -- 
> 1.8.4.rc3
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-22 18:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-22  6:39 [PATCH 1/2] console_simple: set baudrate at register Jean-Christophe PLAGNIOL-VILLARD
2013-09-22  6:39 ` [PATCH 2/2] serial: do not set default baudrate at init Jean-Christophe PLAGNIOL-VILLARD
2013-09-22 18:29 ` [PATCH 1/2] console_simple: set baudrate at register Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox