All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart
@ 2012-03-01 23:58 Darren Hart
  2012-03-01 23:58 ` [PATCH 01/11] pch_uart: add missing comment about OKI ML7223 Darren Hart
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

Backport 7 patches bringing pch_uart up to date with required fixes and new
features to support the 4 new patches (from me) enabling the FRI2 serial port.

My patches have been sent to LKML and have received the approval one of the
driver maintainers. They are currently pending review and a pull from Greg KH.

Please apply to yocto/standard/base.

The following changes since commit c578f3a1f357142a6e02a1df4ae9aa16f45094d6:

  Merge branch 'yocto/base' into yocto/standard/base (2012-02-26 00:04:15 -0500)

are available in the git repository at:

  git://git.infradead.org/users/dvhart/linux-yocto-3.0.git dvhart/yocto/standard/pch_uart
  http://git.infradead.org/users/dvhart/linux-yocto-3.0.git/shortlog/refs/heads/dvhart/yocto/standard/pch_uart

Alexander Stein (3):
  pch_uart: add missing comment about OKI ML7223
  pch_uart: Add MSI support
  drivers/tty/serial/pch_uart.c: add console support

Darren Hart (4):
  pch_uart: Use uartclk instead of base_baud
  pch_uart: Add Fish River Island II uart clock quirks
  pch_uart: Add user_uartclk parameter
  pch_uart: Use existing default_baud in setup_console

Jiri Slaby (1):
  TTY: serial, fix includes in some drivers

Tomoya MORINAGA (2):
  pch_uart: Set PCIe bus number using probe parameter
  pch_uart: Change company name OKI SEMICONDUCTOR to LAPIS
    Semiconductor

Uwe Kleine-König (1):
  serial/pch: use global div helper instead of creating a private one

 drivers/tty/serial/Kconfig                  |    9 +
 drivers/tty/serial/apbuart.c                |    1 +
 drivers/tty/serial/cpm_uart/cpm_uart_core.c |    1 +
 drivers/tty/serial/dz.c                     |    1 +
 drivers/tty/serial/ioc3_serial.c            |    1 +
 drivers/tty/serial/ioc4_serial.c            |    1 +
 drivers/tty/serial/m32r_sio.c               |    1 +
 drivers/tty/serial/max3100.c                |    2 +
 drivers/tty/serial/max3107.c                |    2 +
 drivers/tty/serial/mpc52xx_uart.c           |    1 +
 drivers/tty/serial/msm_serial_hs.c          |    2 +
 drivers/tty/serial/mux.c                    |    2 +
 drivers/tty/serial/nwpserial.c              |    1 +
 drivers/tty/serial/pch_uart.c               |  227 ++++++++++++++++++++++++---
 drivers/tty/serial/sb1250-duart.c           |    1 +
 drivers/tty/serial/serial_ks8695.c          |    1 +
 drivers/tty/serial/serial_txx9.c            |    2 +
 drivers/tty/serial/sn_console.c             |    1 +
 drivers/tty/serial/timbuart.c               |    2 +
 drivers/tty/serial/uartlite.c               |    1 +
 drivers/tty/serial/ucc_uart.c               |    4 +-
 drivers/tty/serial/xilinx_uartps.c          |    4 +-
 drivers/tty/serial/zs.c                     |    1 +
 23 files changed, 246 insertions(+), 23 deletions(-)

-- 
1.7.6.5



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

* [PATCH 01/11] pch_uart: add missing comment about OKI ML7223
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
@ 2012-03-01 23:58 ` Darren Hart
  2012-03-01 23:58 ` [PATCH 02/11] pch_uart: Set PCIe bus number using probe parameter Darren Hart
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

From: Alexander Stein <alexander.stein@systec-electronic.com>

commit bff52fd458a1bca06266449b0ab8a43e9a50d240 upstream.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Reviewed-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/tty/serial/pch_uart.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 902588b..394d35a 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -44,6 +44,7 @@ enum {
 /* Set the max number of UART port
  * Intel EG20T PCH: 4 port
  * OKI SEMICONDUCTOR ML7213 IOH: 3 port
+ * OKI SEMICONDUCTOR ML7223 IOH: 2 port
 */
 #define PCH_UART_NR	4
 
-- 
1.7.6.5



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

* [PATCH 02/11] pch_uart: Set PCIe bus number using probe parameter
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
  2012-03-01 23:58 ` [PATCH 01/11] pch_uart: add missing comment about OKI ML7223 Darren Hart
@ 2012-03-01 23:58 ` Darren Hart
  2012-03-01 23:58 ` [PATCH 03/11] TTY: serial, fix includes in some drivers Darren Hart
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

From: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>

commit 6c4b47d243112e98811ce0da7bbb32cc3857dd1a upstream.

Currently, PCIe bus number is set as fixed value "2".
However, PCIe bus number is not always "2".
This patch sets bus number using probe() parameter.

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/tty/serial/pch_uart.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 394d35a..eb676a0 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -603,7 +603,8 @@ static void pch_request_dma(struct uart_port *port)
 	dma_cap_zero(mask);
 	dma_cap_set(DMA_SLAVE, mask);
 
-	dma_dev = pci_get_bus_and_slot(2, PCI_DEVFN(0xa, 0)); /* Get DMA's dev
+	dma_dev = pci_get_bus_and_slot(priv->pdev->bus->number,
+				       PCI_DEVFN(0xa, 0)); /* Get DMA's dev
 								information */
 	/* Set Tx DMA */
 	param = &priv->param_tx;
-- 
1.7.6.5



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

* [PATCH 03/11] TTY: serial, fix includes in some drivers
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
  2012-03-01 23:58 ` [PATCH 01/11] pch_uart: add missing comment about OKI ML7223 Darren Hart
  2012-03-01 23:58 ` [PATCH 02/11] pch_uart: Set PCIe bus number using probe parameter Darren Hart
@ 2012-03-01 23:58 ` Darren Hart
  2012-03-01 23:58 ` [PATCH 04/11] pch_uart: Change company name OKI SEMICONDUCTOR to LAPIS Semiconductor Darren Hart
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

From: Jiri Slaby <jslaby@suse.cz>

commit ee160a38eee357ed2572cf41437d5814ce53c839 upstream.

linux/tty_flip.h is included in linux/serial_core.h. But this may (and
will) change in the future. Then we would get build errors such as:
.../tty/serial/max3107.c: In function ‘put_data_to_circ_buf’:
.../tty/serial/max3107.c:149:2: error: implicit declaration of function ‘tty_insert_flip_string’

So fix all the drviers which call tty flip buffer helpers to really
include linux/tty_flip.h. And also make sure that those include
linux/tty.h when operating with struct tty_struct.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/tty/serial/apbuart.c                |    1 +
 drivers/tty/serial/cpm_uart/cpm_uart_core.c |    1 +
 drivers/tty/serial/dz.c                     |    1 +
 drivers/tty/serial/ioc3_serial.c            |    1 +
 drivers/tty/serial/ioc4_serial.c            |    1 +
 drivers/tty/serial/m32r_sio.c               |    1 +
 drivers/tty/serial/max3100.c                |    2 ++
 drivers/tty/serial/max3107.c                |    2 ++
 drivers/tty/serial/mpc52xx_uart.c           |    1 +
 drivers/tty/serial/msm_serial_hs.c          |    2 ++
 drivers/tty/serial/mux.c                    |    2 ++
 drivers/tty/serial/nwpserial.c              |    1 +
 drivers/tty/serial/pch_uart.c               |    2 ++
 drivers/tty/serial/sb1250-duart.c           |    1 +
 drivers/tty/serial/serial_ks8695.c          |    1 +
 drivers/tty/serial/serial_txx9.c            |    2 ++
 drivers/tty/serial/sn_console.c             |    1 +
 drivers/tty/serial/timbuart.c               |    2 ++
 drivers/tty/serial/uartlite.c               |    1 +
 drivers/tty/serial/ucc_uart.c               |    4 +++-
 drivers/tty/serial/xilinx_uartps.c          |    4 +++-
 drivers/tty/serial/zs.c                     |    1 +
 22 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index 19a9436..77554fd 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -16,6 +16,7 @@
 
 #include <linux/module.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/serial.h>
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
index 9488da7..b418947 100644
--- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
@@ -31,6 +31,7 @@
 
 #include <linux/module.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/serial.h>
diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c
index 57421d7..0345025 100644
--- a/drivers/tty/serial/dz.c
+++ b/drivers/tty/serial/dz.c
@@ -47,6 +47,7 @@
 #include <linux/serial_core.h>
 #include <linux/sysrq.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 
 #include <asm/atomic.h>
 #include <asm/bootinfo.h>
diff --git a/drivers/tty/serial/ioc3_serial.c b/drivers/tty/serial/ioc3_serial.c
index ee43efc..758ff310 100644
--- a/drivers/tty/serial/ioc3_serial.c
+++ b/drivers/tty/serial/ioc3_serial.c
@@ -13,6 +13,7 @@
  */
 #include <linux/errno.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/serial.h>
 #include <linux/circ_buf.h>
 #include <linux/serial_reg.h>
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
index fcfe826..6b36c15 100644
--- a/drivers/tty/serial/ioc4_serial.c
+++ b/drivers/tty/serial/ioc4_serial.c
@@ -14,6 +14,7 @@
  */
 #include <linux/errno.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/serial.h>
 #include <linux/serialP.h>
 #include <linux/circ_buf.h>
diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/m32r_sio.c
index 84db732..7a574c1 100644
--- a/drivers/tty/serial/m32r_sio.c
+++ b/drivers/tty/serial/m32r_sio.c
@@ -32,6 +32,7 @@
 
 #include <linux/module.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/console.h>
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index 7b951ad..2af5aa5 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -47,6 +47,8 @@
 #include <linux/serial.h>
 #include <linux/spi/spi.h>
 #include <linux/freezer.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
 
 #include <linux/serial_max3100.h>
 
diff --git a/drivers/tty/serial/max3107.c b/drivers/tty/serial/max3107.c
index a816460..db00b59 100644
--- a/drivers/tty/serial/max3107.c
+++ b/drivers/tty/serial/max3107.c
@@ -31,6 +31,8 @@
 #include <linux/device.h>
 #include <linux/serial_core.h>
 #include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/freezer.h>
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
index a0bcd8a..c395520 100644
--- a/drivers/tty/serial/mpc52xx_uart.c
+++ b/drivers/tty/serial/mpc52xx_uart.c
@@ -34,6 +34,7 @@
 #include <linux/device.h>
 #include <linux/module.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/serial.h>
 #include <linux/sysrq.h>
 #include <linux/console.h>
diff --git a/drivers/tty/serial/msm_serial_hs.c b/drivers/tty/serial/msm_serial_hs.c
index 624701f..60c6eb8 100644
--- a/drivers/tty/serial/msm_serial_hs.c
+++ b/drivers/tty/serial/msm_serial_hs.c
@@ -30,6 +30,8 @@
 
 #include <linux/serial.h>
 #include <linux/serial_core.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
diff --git a/drivers/tty/serial/mux.c b/drivers/tty/serial/mux.c
index 9711e06..06f6aef 100644
--- a/drivers/tty/serial/mux.c
+++ b/drivers/tty/serial/mux.c
@@ -21,6 +21,8 @@
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/console.h>
 #include <linux/delay.h> /* for udelay */
 #include <linux/device.h>
diff --git a/drivers/tty/serial/nwpserial.c b/drivers/tty/serial/nwpserial.c
index de17367..9beaff1 100644
--- a/drivers/tty/serial/nwpserial.c
+++ b/drivers/tty/serial/nwpserial.c
@@ -15,6 +15,7 @@
 #include <linux/serial_reg.h>
 #include <linux/serial_core.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/irqreturn.h>
 #include <linux/mutex.h>
 #include <linux/of_platform.h>
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index eb676a0..41f4195 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -19,6 +19,8 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/serial_core.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/dmi.h>
diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c
index ea2340b..6718837 100644
--- a/drivers/tty/serial/sb1250-duart.c
+++ b/drivers/tty/serial/sb1250-duart.c
@@ -37,6 +37,7 @@
 #include <linux/spinlock.h>
 #include <linux/sysrq.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/types.h>
 
 #include <asm/atomic.h>
diff --git a/drivers/tty/serial/serial_ks8695.c b/drivers/tty/serial/serial_ks8695.c
index 2430319..5551f7a 100644
--- a/drivers/tty/serial/serial_ks8695.c
+++ b/drivers/tty/serial/serial_ks8695.c
@@ -13,6 +13,7 @@
  */
 #include <linux/module.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/serial.h>
diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c
index 8e3fc19..34bd345 100644
--- a/drivers/tty/serial/serial_txx9.c
+++ b/drivers/tty/serial/serial_txx9.c
@@ -28,6 +28,8 @@
 #include <linux/pci.h>
 #include <linux/serial_core.h>
 #include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
 
 #include <asm/io.h>
 
diff --git a/drivers/tty/serial/sn_console.c b/drivers/tty/serial/sn_console.c
index 377ae74..7320507 100644
--- a/drivers/tty/serial/sn_console.c
+++ b/drivers/tty/serial/sn_console.c
@@ -39,6 +39,7 @@
 
 #include <linux/interrupt.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/serial.h>
 #include <linux/console.h>
 #include <linux/module.h>
diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c
index 1f36b7e..a4b63bf 100644
--- a/drivers/tty/serial/timbuart.c
+++ b/drivers/tty/serial/timbuart.c
@@ -23,6 +23,8 @@
 #include <linux/pci.h>
 #include <linux/interrupt.h>
 #include <linux/serial_core.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/ioport.h>
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index 8af1ed8..b908615 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -15,6 +15,7 @@
 #include <linux/serial.h>
 #include <linux/serial_core.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index c327218..97b6724 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -20,8 +20,10 @@
 
 #include <linux/module.h>
 #include <linux/serial.h>
-#include <linux/slab.h>
 #include <linux/serial_core.h>
+#include <linux/slab.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/io.h>
 #include <linux/of_platform.h>
 #include <linux/dma-mapping.h>
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 19cc1e8..8c03b12 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -12,9 +12,11 @@
  */
 
 #include <linux/platform_device.h>
+#include <linux/serial.h>
 #include <linux/serial_core.h>
+#include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/console.h>
-#include <linux/serial.h>
 #include <linux/irq.h>
 #include <linux/io.h>
 #include <linux/of.h>
diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c
index 1a7fd3e..d417201 100644
--- a/drivers/tty/serial/zs.c
+++ b/drivers/tty/serial/zs.c
@@ -63,6 +63,7 @@
 #include <linux/spinlock.h>
 #include <linux/sysrq.h>
 #include <linux/tty.h>
+#include <linux/tty_flip.h>
 #include <linux/types.h>
 
 #include <asm/atomic.h>
-- 
1.7.6.5



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

* [PATCH 04/11] pch_uart: Change company name OKI SEMICONDUCTOR to LAPIS Semiconductor
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
                   ` (2 preceding siblings ...)
  2012-03-01 23:58 ` [PATCH 03/11] TTY: serial, fix includes in some drivers Darren Hart
@ 2012-03-01 23:58 ` Darren Hart
  2012-03-01 23:58 ` [PATCH 05/11] pch_uart: Add MSI support Darren Hart
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

From: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>

commit eca9dfa846a3d0eeb865e290851f4bfe4fb34fdd upstream.

On October 1 in 2011,
OKI SEMICONDUCTOR Co., Ltd. changed the company name in to LAPIS Semiconductor Co., Ltd.

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/tty/serial/pch_uart.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 41f4195..81d262e 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1,5 +1,5 @@
 /*
- *Copyright (C) 2010 OKI SEMICONDUCTOR CO., LTD.
+ *Copyright (C) 2011 LAPIS Semiconductor Co., Ltd.
  *
  *This program is free software; you can redistribute it and/or modify
  *it under the terms of the GNU General Public License as published by
@@ -45,8 +45,8 @@ enum {
 
 /* Set the max number of UART port
  * Intel EG20T PCH: 4 port
- * OKI SEMICONDUCTOR ML7213 IOH: 3 port
- * OKI SEMICONDUCTOR ML7223 IOH: 2 port
+ * LAPIS Semiconductor ML7213 IOH: 3 port
+ * LAPIS Semiconductor ML7223 IOH: 2 port
 */
 #define PCH_UART_NR	4
 
-- 
1.7.6.5



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

* [PATCH 05/11] pch_uart: Add MSI support
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
                   ` (3 preceding siblings ...)
  2012-03-01 23:58 ` [PATCH 04/11] pch_uart: Change company name OKI SEMICONDUCTOR to LAPIS Semiconductor Darren Hart
@ 2012-03-01 23:58 ` Darren Hart
  2012-03-01 23:58 ` [PATCH 06/11] drivers/tty/serial/pch_uart.c: add console support Darren Hart
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

From: Alexander Stein <alexander.stein@systec-electronic.com>

commit e463595fd9c752fa4bf06b47df93ef9ade3c7cf0 upstream.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/tty/serial/pch_uart.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 81d262e..c124011 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1438,6 +1438,8 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 		goto init_port_hal_free;
 	}
 
+	pci_enable_msi(pdev);
+
 	iobase = pci_resource_start(pdev, 0);
 	mapbase = pci_resource_start(pdev, 1);
 	priv->mapbase = mapbase;
@@ -1494,6 +1496,8 @@ static void pch_uart_pci_remove(struct pci_dev *pdev)
 	struct eg20t_port *priv;
 
 	priv = (struct eg20t_port *)pci_get_drvdata(pdev);
+
+	pci_disable_msi(pdev);
 	pch_uart_exit_port(priv);
 	pci_disable_device(pdev);
 	kfree(priv);
@@ -1581,6 +1585,7 @@ static int __devinit pch_uart_pci_probe(struct pci_dev *pdev,
 	return ret;
 
 probe_disable_device:
+	pci_disable_msi(pdev);
 	pci_disable_device(pdev);
 probe_error:
 	return ret;
-- 
1.7.6.5



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

* [PATCH 06/11] drivers/tty/serial/pch_uart.c: add console support
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
                   ` (4 preceding siblings ...)
  2012-03-01 23:58 ` [PATCH 05/11] pch_uart: Add MSI support Darren Hart
@ 2012-03-01 23:58 ` Darren Hart
  2012-03-01 23:58 ` [PATCH 07/11] serial/pch: use global div helper instead of creating a private one Darren Hart
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

From: Alexander Stein <alexander.stein@systec-electronic.com>

commit e30f867d402d6dcc2d03d8dd5da3863f7c83572a upstream.

Add console support to pch_uart.  To enable append e.g.
console=ttyPCH0,115200 to your kernel command line.

This is not expected work on CM-iTC boards due to their having a different
clock.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/tty/serial/Kconfig    |    9 +++
 drivers/tty/serial/pch_uart.c |  160 ++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 168 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 9789293..89e6eac 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1600,6 +1600,15 @@ config SERIAL_PCH_UART
 	  ML7213/ML7223/ML7831 is companion chip for Intel Atom E6xx series.
 	  ML7213/ML7223/ML7831 is completely compatible for Intel EG20T PCH.
 
+config SERIAL_PCH_UART_CONSOLE
+	bool "Support for console on Intel EG20T PCH UART/OKI SEMICONDUCTOR ML7213 IOH"
+	depends on SERIAL_PCH_UART=y
+	select SERIAL_CORE_CONSOLE
+	help
+	  Say Y here if you wish to use the PCH UART as the system console
+	  (the system  console is the device which receives all kernel messages and
+	  warnings and which allows logins in single user mode).
+
 config SERIAL_MSM_SMD
 	bool "Enable tty device interface for some SMD ports"
 	default n
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index c124011..bd829dd 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -24,6 +24,9 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/dmi.h>
+#include <linux/console.h>
+#include <linux/nmi.h>
+#include <linux/delay.h>
 
 #include <linux/dmaengine.h>
 #include <linux/pch_dma.h>
@@ -199,6 +202,10 @@ enum {
 
 #define PCI_VENDOR_ID_ROHM		0x10DB
 
+#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
+
+#define DEFAULT_BAUD_RATE 1843200 /* 1.8432MHz */
+
 struct pch_uart_buffer {
 	unsigned char *buf;
 	int size;
@@ -277,6 +284,9 @@ static struct pch_uart_driver_data drv_dat[] = {
 	[pch_ml7831_uart1] = {PCH_UART_2LINE, 1},
 };
 
+#ifdef CONFIG_SERIAL_PCH_UART_CONSOLE
+static struct eg20t_port *pch_uart_ports[PCH_UART_NR];
+#endif
 static unsigned int default_baud = 9600;
 static const int trigger_level_256[4] = { 1, 64, 128, 224 };
 static const int trigger_level_64[4] = { 1, 16, 32, 56 };
@@ -1386,6 +1396,143 @@ static struct uart_ops pch_uart_ops = {
 	.verify_port = pch_uart_verify_port
 };
 
+#ifdef CONFIG_SERIAL_PCH_UART_CONSOLE
+
+/*
+ *	Wait for transmitter & holding register to empty
+ */
+static void wait_for_xmitr(struct eg20t_port *up, int bits)
+{
+	unsigned int status, tmout = 10000;
+
+	/* Wait up to 10ms for the character(s) to be sent. */
+	for (;;) {
+		status = ioread8(up->membase + UART_LSR);
+
+		if ((status & bits) == bits)
+			break;
+		if (--tmout == 0)
+			break;
+		udelay(1);
+	}
+
+	/* Wait up to 1s for flow control if necessary */
+	if (up->port.flags & UPF_CONS_FLOW) {
+		unsigned int tmout;
+		for (tmout = 1000000; tmout; tmout--) {
+			unsigned int msr = ioread8(up->membase + UART_MSR);
+			if (msr & UART_MSR_CTS)
+				break;
+			udelay(1);
+			touch_nmi_watchdog();
+		}
+	}
+}
+
+static void pch_console_putchar(struct uart_port *port, int ch)
+{
+	struct eg20t_port *priv =
+		container_of(port, struct eg20t_port, port);
+
+	wait_for_xmitr(priv, UART_LSR_THRE);
+	iowrite8(ch, priv->membase + PCH_UART_THR);
+}
+
+/*
+ *	Print a string to the serial port trying not to disturb
+ *	any possible real use of the port...
+ *
+ *	The console_lock must be held when we get here.
+ */
+static void
+pch_console_write(struct console *co, const char *s, unsigned int count)
+{
+	struct eg20t_port *priv;
+
+	unsigned long flags;
+	u8 ier;
+	int locked = 1;
+
+	priv = pch_uart_ports[co->index];
+
+	touch_nmi_watchdog();
+
+	local_irq_save(flags);
+	if (priv->port.sysrq) {
+		/* serial8250_handle_port() already took the lock */
+		locked = 0;
+	} else if (oops_in_progress) {
+		locked = spin_trylock(&priv->port.lock);
+	} else
+		spin_lock(&priv->port.lock);
+
+	/*
+	 *	First save the IER then disable the interrupts
+	 */
+	ier = ioread8(priv->membase + UART_IER);
+
+	pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_ALL_INT);
+
+	uart_console_write(&priv->port, s, count, pch_console_putchar);
+
+	/*
+	 *	Finally, wait for transmitter to become empty
+	 *	and restore the IER
+	 */
+	wait_for_xmitr(priv, BOTH_EMPTY);
+	iowrite8(ier, priv->membase + UART_IER);
+
+	if (locked)
+		spin_unlock(&priv->port.lock);
+	local_irq_restore(flags);
+}
+
+static int __init pch_console_setup(struct console *co, char *options)
+{
+	struct uart_port *port;
+	int baud = 9600;
+	int bits = 8;
+	int parity = 'n';
+	int flow = 'n';
+
+	/*
+	 * Check whether an invalid uart number has been specified, and
+	 * if so, search for the first available port that does have
+	 * console support.
+	 */
+	if (co->index >= PCH_UART_NR)
+		co->index = 0;
+	port = &pch_uart_ports[co->index]->port;
+
+	if (!port || (!port->iobase && !port->membase))
+		return -ENODEV;
+
+	/* setup uartclock */
+	port->uartclk = DEFAULT_BAUD_RATE;
+
+	if (options)
+		uart_parse_options(options, &baud, &parity, &bits, &flow);
+
+	return uart_set_options(port, co, baud, parity, bits, flow);
+}
+
+static struct uart_driver pch_uart_driver;
+
+static struct console pch_console = {
+	.name		= PCH_UART_DRIVER_DEVICE,
+	.write		= pch_console_write,
+	.device		= uart_console_device,
+	.setup		= pch_console_setup,
+	.flags		= CON_PRINTBUFFER | CON_ANYTIME,
+	.index		= -1,
+	.data		= &pch_uart_driver,
+};
+
+#define PCH_CONSOLE	(&pch_console)
+#else
+#define PCH_CONSOLE	NULL
+#endif
+
 static struct uart_driver pch_uart_driver = {
 	.owner = THIS_MODULE,
 	.driver_name = KBUILD_MODNAME,
@@ -1393,6 +1540,7 @@ static struct uart_driver pch_uart_driver = {
 	.major = 0,
 	.minor = 0,
 	.nr = PCH_UART_NR,
+	.cons = PCH_CONSOLE,
 };
 
 static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
@@ -1419,7 +1567,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	if (!rxbuf)
 		goto init_port_free_txbuf;
 
-	base_baud = 1843200; /* 1.8432MHz */
+	base_baud = DEFAULT_BAUD_RATE;
 
 	/* quirk for CM-iTC board */
 	board_name = dmi_get_system_info(DMI_BOARD_NAME);
@@ -1469,6 +1617,9 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	pci_set_drvdata(pdev, priv);
 	pch_uart_hal_request(pdev, fifosize, base_baud);
 
+#ifdef CONFIG_SERIAL_PCH_UART_CONSOLE
+	pch_uart_ports[board->line_no] = priv;
+#endif
 	ret = uart_add_one_port(&pch_uart_driver, &priv->port);
 	if (ret < 0)
 		goto init_port_hal_free;
@@ -1476,6 +1627,9 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	return priv;
 
 init_port_hal_free:
+#ifdef CONFIG_SERIAL_PCH_UART_CONSOLE
+	pch_uart_ports[board->line_no] = NULL;
+#endif
 	free_page((unsigned long)rxbuf);
 init_port_free_txbuf:
 	kfree(priv);
@@ -1498,6 +1652,10 @@ static void pch_uart_pci_remove(struct pci_dev *pdev)
 	priv = (struct eg20t_port *)pci_get_drvdata(pdev);
 
 	pci_disable_msi(pdev);
+
+#ifdef CONFIG_SERIAL_PCH_UART_CONSOLE
+	pch_uart_ports[priv->port.line] = NULL;
+#endif
 	pch_uart_exit_port(priv);
 	pci_disable_device(pdev);
 	kfree(priv);
-- 
1.7.6.5



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

* [PATCH 07/11] serial/pch: use global div helper instead of creating a private one
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
                   ` (5 preceding siblings ...)
  2012-03-01 23:58 ` [PATCH 06/11] drivers/tty/serial/pch_uart.c: add console support Darren Hart
@ 2012-03-01 23:58 ` Darren Hart
  2012-03-01 23:58 ` [PATCH 08/11] pch_uart: Use uartclk instead of base_baud Darren Hart
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

commit 0e2adc06843a9b5a28af4ca5f796240297907897 upstream.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Alan Cox  <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/tty/serial/pch_uart.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index bd829dd..de0f613 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -14,6 +14,7 @@
  *along with this program; if not, write to the Free Software
  *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
  */
+#include <linux/kernel.h>
 #include <linux/serial_reg.h>
 #include <linux/slab.h>
 #include <linux/module.h>
@@ -143,8 +144,6 @@ enum {
 #define PCH_UART_DLL		0x00
 #define PCH_UART_DLM		0x01
 
-#define DIV_ROUND(a, b)	(((a) + ((b)/2)) / (b))
-
 #define PCH_UART_IID_RLS	(PCH_UART_IIR_REI)
 #define PCH_UART_IID_RDR	(PCH_UART_IIR_RRI)
 #define PCH_UART_IID_RDR_TO	(PCH_UART_IIR_RRI | PCH_UART_IIR_TOI)
@@ -333,7 +332,7 @@ static int pch_uart_hal_set_line(struct eg20t_port *priv, int baud,
 	unsigned int dll, dlm, lcr;
 	int div;
 
-	div = DIV_ROUND(priv->base_baud / 16, baud);
+	div = DIV_ROUND_CLOSEST(priv->base_baud / 16, baud);
 	if (div < 0 || USHRT_MAX <= div) {
 		dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div);
 		return -EINVAL;
-- 
1.7.6.5



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

* [PATCH 08/11] pch_uart: Use uartclk instead of base_baud
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
                   ` (6 preceding siblings ...)
  2012-03-01 23:58 ` [PATCH 07/11] serial/pch: use global div helper instead of creating a private one Darren Hart
@ 2012-03-01 23:58 ` Darren Hart
  2012-03-01 23:58 ` [PATCH 09/11] pch_uart: Add Fish River Island II uart clock quirks Darren Hart
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

The term "base baud" refers to the fastest baud rate the device can communicate
at. This is clock/16. pch_uart is using base_baud as the clock itself. Rename
the variables to be semantically correct.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Tomoya MORINAGA <tomoya.rohm@gmail.com>
CC: Feng Tang <feng.tang@intel.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Alan Cox <alan@linux.intel.com>
CC: linux-serial@vger.kernel.org
---
 drivers/tty/serial/pch_uart.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index de0f613..fd5d6df 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -203,7 +203,7 @@ enum {
 
 #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
 
-#define DEFAULT_BAUD_RATE 1843200 /* 1.8432MHz */
+#define DEFAULT_UARTCLK 1843200 /* 1.8432MHz */
 
 struct pch_uart_buffer {
 	unsigned char *buf;
@@ -218,7 +218,7 @@ struct eg20t_port {
 	unsigned int iobase;
 	struct pci_dev *pdev;
 	int fifo_size;
-	int base_baud;
+	int uartclk;
 	int start_tx;
 	int start_rx;
 	int tx_empty;
@@ -293,7 +293,7 @@ static const int trigger_level_16[4] = { 1, 4, 8, 14 };
 static const int trigger_level_1[4] = { 1, 1, 1, 1 };
 
 static void pch_uart_hal_request(struct pci_dev *pdev, int fifosize,
-				 int base_baud)
+				 int uartclk)
 {
 	struct eg20t_port *priv = pci_get_drvdata(pdev);
 
@@ -332,7 +332,7 @@ static int pch_uart_hal_set_line(struct eg20t_port *priv, int baud,
 	unsigned int dll, dlm, lcr;
 	int div;
 
-	div = DIV_ROUND_CLOSEST(priv->base_baud / 16, baud);
+	div = DIV_ROUND_CLOSEST(priv->uartclk / 16, baud);
 	if (div < 0 || USHRT_MAX <= div) {
 		dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div);
 		return -EINVAL;
@@ -1153,9 +1153,9 @@ static int pch_uart_startup(struct uart_port *port)
 	priv->tx_empty = 1;
 
 	if (port->uartclk)
-		priv->base_baud = port->uartclk;
+		priv->uartclk = port->uartclk;
 	else
-		port->uartclk = priv->base_baud;
+		port->uartclk = priv->uartclk;
 
 	pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_ALL_INT);
 	ret = pch_uart_hal_set_line(priv, default_baud,
@@ -1507,7 +1507,7 @@ static int __init pch_console_setup(struct console *co, char *options)
 		return -ENODEV;
 
 	/* setup uartclock */
-	port->uartclk = DEFAULT_BAUD_RATE;
+	port->uartclk = DEFAULT_UARTCLK;
 
 	if (options)
 		uart_parse_options(options, &baud, &parity, &bits, &flow);
@@ -1550,7 +1550,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	unsigned int iobase;
 	unsigned int mapbase;
 	unsigned char *rxbuf;
-	int fifosize, base_baud;
+	int fifosize, uartclk;
 	int port_type;
 	struct pch_uart_driver_data *board;
 	const char *board_name;
@@ -1566,12 +1566,12 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	if (!rxbuf)
 		goto init_port_free_txbuf;
 
-	base_baud = DEFAULT_BAUD_RATE;
+	uartclk = DEFAULT_UARTCLK;
 
 	/* quirk for CM-iTC board */
 	board_name = dmi_get_system_info(DMI_BOARD_NAME);
 	if (board_name && strstr(board_name, "CM-iTC"))
-		base_baud = 192000000; /* 192.0MHz */
+		uartclk = 192000000; /* 192.0MHz */
 
 	switch (port_type) {
 	case PORT_UNKNOWN:
@@ -1597,7 +1597,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	priv->rxbuf.size = PAGE_SIZE;
 
 	priv->fifo_size = fifosize;
-	priv->base_baud = base_baud;
+	priv->uartclk = uartclk;
 	priv->port_type = PORT_MAX_8250 + port_type + 1;
 	priv->port.dev = &pdev->dev;
 	priv->port.iobase = iobase;
@@ -1614,7 +1614,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	spin_lock_init(&priv->port.lock);
 
 	pci_set_drvdata(pdev, priv);
-	pch_uart_hal_request(pdev, fifosize, base_baud);
+	pch_uart_hal_request(pdev, fifosize, uartclk);
 
 #ifdef CONFIG_SERIAL_PCH_UART_CONSOLE
 	pch_uart_ports[board->line_no] = priv;
-- 
1.7.6.5



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

* [PATCH 09/11] pch_uart: Add Fish River Island II uart clock quirks
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
                   ` (7 preceding siblings ...)
  2012-03-01 23:58 ` [PATCH 08/11] pch_uart: Use uartclk instead of base_baud Darren Hart
@ 2012-03-01 23:58 ` Darren Hart
  2012-03-01 23:58 ` [PATCH 10/11] pch_uart: Add user_uartclk parameter Darren Hart
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

Add support for the Fish River Island II (FRI2) UART clock following the CM-iTC
quirk handling mechanism. Depending on the firmware installed on the device, the
FRI2 uses a 48MHz or a 64MHz UART clock. This is detected with DMI strings.

Add similar UART clock quirk handling to the pch_console_setup() function to
enable kernel messages on boards with non-standard UART clocks.

Per Alan's suggestion, abstract out UART clock selection into
pch_uart_get_uartclk() to avoid code duplication.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Tomoya MORINAGA <tomoya.rohm@gmail.com>
CC: Feng Tang <feng.tang@intel.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Alan Cox <alan@linux.intel.com>
CC: linux-serial@vger.kernel.org
---
 drivers/tty/serial/pch_uart.c |   42 +++++++++++++++++++++++++++-------------
 1 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index fd5d6df..1706169 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -203,7 +203,10 @@ enum {
 
 #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
 
-#define DEFAULT_UARTCLK 1843200 /* 1.8432MHz */
+#define DEFAULT_UARTCLK   1843200 /*   1.8432 MHz */
+#define CMITC_UARTCLK   192000000 /* 192.0000 MHz */
+#define FRI2_64_UARTCLK  64000000 /*  64.0000 MHz */
+#define FRI2_48_UARTCLK  48000000 /*  48.0000 MHz */
 
 struct pch_uart_buffer {
 	unsigned char *buf;
@@ -292,6 +295,26 @@ static const int trigger_level_64[4] = { 1, 16, 32, 56 };
 static const int trigger_level_16[4] = { 1, 4, 8, 14 };
 static const int trigger_level_1[4] = { 1, 1, 1, 1 };
 
+/* Return UART clock, checking for board specific clocks. */
+static int pch_uart_get_uartclk(void)
+{
+	const char *cmp;
+
+	cmp = dmi_get_system_info(DMI_BOARD_NAME);
+	if (cmp && strstr(cmp, "CM-iTC"))
+		return CMITC_UARTCLK;
+
+	cmp = dmi_get_system_info(DMI_BIOS_VERSION);
+	if (cmp && strnstr(cmp, "FRI2", 4))
+		return FRI2_64_UARTCLK;
+
+	cmp = dmi_get_system_info(DMI_PRODUCT_NAME);
+	if (cmp && strstr(cmp, "Fish River Island II"))
+		return FRI2_48_UARTCLK;
+
+	return DEFAULT_UARTCLK;
+}
+
 static void pch_uart_hal_request(struct pci_dev *pdev, int fifosize,
 				 int uartclk)
 {
@@ -1506,8 +1529,7 @@ static int __init pch_console_setup(struct console *co, char *options)
 	if (!port || (!port->iobase && !port->membase))
 		return -ENODEV;
 
-	/* setup uartclock */
-	port->uartclk = DEFAULT_UARTCLK;
+	port->uartclk = pch_uart_get_uartclk();
 
 	if (options)
 		uart_parse_options(options, &baud, &parity, &bits, &flow);
@@ -1550,10 +1572,9 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	unsigned int iobase;
 	unsigned int mapbase;
 	unsigned char *rxbuf;
-	int fifosize, uartclk;
+	int fifosize;
 	int port_type;
 	struct pch_uart_driver_data *board;
-	const char *board_name;
 
 	board = &drv_dat[id->driver_data];
 	port_type = board->port_type;
@@ -1566,13 +1587,6 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	if (!rxbuf)
 		goto init_port_free_txbuf;
 
-	uartclk = DEFAULT_UARTCLK;
-
-	/* quirk for CM-iTC board */
-	board_name = dmi_get_system_info(DMI_BOARD_NAME);
-	if (board_name && strstr(board_name, "CM-iTC"))
-		uartclk = 192000000; /* 192.0MHz */
-
 	switch (port_type) {
 	case PORT_UNKNOWN:
 		fifosize = 256; /* EG20T/ML7213: UART0 */
@@ -1597,7 +1611,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	priv->rxbuf.size = PAGE_SIZE;
 
 	priv->fifo_size = fifosize;
-	priv->uartclk = uartclk;
+	priv->uartclk = pch_uart_get_uartclk();
 	priv->port_type = PORT_MAX_8250 + port_type + 1;
 	priv->port.dev = &pdev->dev;
 	priv->port.iobase = iobase;
@@ -1614,7 +1628,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	spin_lock_init(&priv->port.lock);
 
 	pci_set_drvdata(pdev, priv);
-	pch_uart_hal_request(pdev, fifosize, uartclk);
+	pch_uart_hal_request(pdev, fifosize, priv->uartclk);
 
 #ifdef CONFIG_SERIAL_PCH_UART_CONSOLE
 	pch_uart_ports[board->line_no] = priv;
-- 
1.7.6.5



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

* [PATCH 10/11] pch_uart: Add user_uartclk parameter
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
                   ` (8 preceding siblings ...)
  2012-03-01 23:58 ` [PATCH 09/11] pch_uart: Add Fish River Island II uart clock quirks Darren Hart
@ 2012-03-01 23:58 ` Darren Hart
  2012-03-01 23:58 ` [PATCH 11/11] pch_uart: Use existing default_baud in setup_console Darren Hart
  2012-03-02 21:03 ` [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Bruce Ashfield
  11 siblings, 0 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

For cases where boards with non-default clocks are not yet added to the kernel
or when the clock varies across hardware revisions, it is useful to be
able to specify the UART clock on the kernel command line.

Add the user_uartclk parameter and prefer it, if set, to the default and
board specific UART clock settings. Specify user_uartclock on the command-line
with "pch_uart.user_uartclk=48000000".

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Tomoya MORINAGA <tomoya.rohm@gmail.com>
CC: Feng Tang <feng.tang@intel.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Alan Cox <alan@linux.intel.com>
CC: linux-serial@vger.kernel.org
---
 drivers/tty/serial/pch_uart.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 1706169..2233e31 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -290,6 +290,7 @@ static struct pch_uart_driver_data drv_dat[] = {
 static struct eg20t_port *pch_uart_ports[PCH_UART_NR];
 #endif
 static unsigned int default_baud = 9600;
+static unsigned int user_uartclk = 0;
 static const int trigger_level_256[4] = { 1, 64, 128, 224 };
 static const int trigger_level_64[4] = { 1, 16, 32, 56 };
 static const int trigger_level_16[4] = { 1, 4, 8, 14 };
@@ -300,6 +301,9 @@ static int pch_uart_get_uartclk(void)
 {
 	const char *cmp;
 
+	if (user_uartclk)
+		return user_uartclk;
+
 	cmp = dmi_get_system_info(DMI_BOARD_NAME);
 	if (cmp && strstr(cmp, "CM-iTC"))
 		return CMITC_UARTCLK;
@@ -1799,3 +1803,4 @@ module_exit(pch_uart_module_exit);
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("Intel EG20T PCH UART PCI Driver");
 module_param(default_baud, uint, S_IRUGO);
+module_param(user_uartclk, uint, S_IRUGO);
-- 
1.7.6.5



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

* [PATCH 11/11] pch_uart: Use existing default_baud in setup_console
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
                   ` (9 preceding siblings ...)
  2012-03-01 23:58 ` [PATCH 10/11] pch_uart: Add user_uartclk parameter Darren Hart
@ 2012-03-01 23:58 ` Darren Hart
  2012-03-02 21:03 ` [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Bruce Ashfield
  11 siblings, 0 replies; 13+ messages in thread
From: Darren Hart @ 2012-03-01 23:58 UTC (permalink / raw)
  To: Yocto Project, Bruce Ashfield, Tom Zanussi

Rather than hardcode 9600, use the existing default_baud parameter (which
also defaults to 9600).

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Tomoya MORINAGA <tomoya.rohm@gmail.com>
CC: Feng Tang <feng.tang@intel.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Alan Cox <alan@linux.intel.com>
CC: linux-serial@vger.kernel.org
---
 drivers/tty/serial/pch_uart.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 2233e31..4be4c90 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1516,7 +1516,7 @@ pch_console_write(struct console *co, const char *s, unsigned int count)
 static int __init pch_console_setup(struct console *co, char *options)
 {
 	struct uart_port *port;
-	int baud = 9600;
+	int baud = default_baud;
 	int bits = 8;
 	int parity = 'n';
 	int flow = 'n';
-- 
1.7.6.5



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

* Re: [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart
  2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
                   ` (10 preceding siblings ...)
  2012-03-01 23:58 ` [PATCH 11/11] pch_uart: Use existing default_baud in setup_console Darren Hart
@ 2012-03-02 21:03 ` Bruce Ashfield
  11 siblings, 0 replies; 13+ messages in thread
From: Bruce Ashfield @ 2012-03-02 21:03 UTC (permalink / raw)
  To: Darren Hart; +Cc: Yocto Project

On 12-03-01 06:58 PM, Darren Hart wrote:
> Backport 7 patches bringing pch_uart up to date with required fixes and new
> features to support the 4 new patches (from me) enabling the FRI2 serial port.
>
> My patches have been sent to LKML and have received the approval one of the
> driver maintainers. They are currently pending review and a pull from Greg KH.

Grabbed and merged these. Will push them out later today, along with
my 3.0.23 + rt updates.

Bruce

>
> Please apply to yocto/standard/base.
>
> The following changes since commit c578f3a1f357142a6e02a1df4ae9aa16f45094d6:
>
>    Merge branch 'yocto/base' into yocto/standard/base (2012-02-26 00:04:15 -0500)
>
> are available in the git repository at:
>
>    git://git.infradead.org/users/dvhart/linux-yocto-3.0.git dvhart/yocto/standard/pch_uart
>    http://git.infradead.org/users/dvhart/linux-yocto-3.0.git/shortlog/refs/heads/dvhart/yocto/standard/pch_uart
>
> Alexander Stein (3):
>    pch_uart: add missing comment about OKI ML7223
>    pch_uart: Add MSI support
>    drivers/tty/serial/pch_uart.c: add console support
>
> Darren Hart (4):
>    pch_uart: Use uartclk instead of base_baud
>    pch_uart: Add Fish River Island II uart clock quirks
>    pch_uart: Add user_uartclk parameter
>    pch_uart: Use existing default_baud in setup_console
>
> Jiri Slaby (1):
>    TTY: serial, fix includes in some drivers
>
> Tomoya MORINAGA (2):
>    pch_uart: Set PCIe bus number using probe parameter
>    pch_uart: Change company name OKI SEMICONDUCTOR to LAPIS
>      Semiconductor
>
> Uwe Kleine-König (1):
>    serial/pch: use global div helper instead of creating a private one
>
>   drivers/tty/serial/Kconfig                  |    9 +
>   drivers/tty/serial/apbuart.c                |    1 +
>   drivers/tty/serial/cpm_uart/cpm_uart_core.c |    1 +
>   drivers/tty/serial/dz.c                     |    1 +
>   drivers/tty/serial/ioc3_serial.c            |    1 +
>   drivers/tty/serial/ioc4_serial.c            |    1 +
>   drivers/tty/serial/m32r_sio.c               |    1 +
>   drivers/tty/serial/max3100.c                |    2 +
>   drivers/tty/serial/max3107.c                |    2 +
>   drivers/tty/serial/mpc52xx_uart.c           |    1 +
>   drivers/tty/serial/msm_serial_hs.c          |    2 +
>   drivers/tty/serial/mux.c                    |    2 +
>   drivers/tty/serial/nwpserial.c              |    1 +
>   drivers/tty/serial/pch_uart.c               |  227 ++++++++++++++++++++++++---
>   drivers/tty/serial/sb1250-duart.c           |    1 +
>   drivers/tty/serial/serial_ks8695.c          |    1 +
>   drivers/tty/serial/serial_txx9.c            |    2 +
>   drivers/tty/serial/sn_console.c             |    1 +
>   drivers/tty/serial/timbuart.c               |    2 +
>   drivers/tty/serial/uartlite.c               |    1 +
>   drivers/tty/serial/ucc_uart.c               |    4 +-
>   drivers/tty/serial/xilinx_uartps.c          |    4 +-
>   drivers/tty/serial/zs.c                     |    1 +
>   23 files changed, 246 insertions(+), 23 deletions(-)
>



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

end of thread, other threads:[~2012-03-02 21:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 23:58 [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Darren Hart
2012-03-01 23:58 ` [PATCH 01/11] pch_uart: add missing comment about OKI ML7223 Darren Hart
2012-03-01 23:58 ` [PATCH 02/11] pch_uart: Set PCIe bus number using probe parameter Darren Hart
2012-03-01 23:58 ` [PATCH 03/11] TTY: serial, fix includes in some drivers Darren Hart
2012-03-01 23:58 ` [PATCH 04/11] pch_uart: Change company name OKI SEMICONDUCTOR to LAPIS Semiconductor Darren Hart
2012-03-01 23:58 ` [PATCH 05/11] pch_uart: Add MSI support Darren Hart
2012-03-01 23:58 ` [PATCH 06/11] drivers/tty/serial/pch_uart.c: add console support Darren Hart
2012-03-01 23:58 ` [PATCH 07/11] serial/pch: use global div helper instead of creating a private one Darren Hart
2012-03-01 23:58 ` [PATCH 08/11] pch_uart: Use uartclk instead of base_baud Darren Hart
2012-03-01 23:58 ` [PATCH 09/11] pch_uart: Add Fish River Island II uart clock quirks Darren Hart
2012-03-01 23:58 ` [PATCH 10/11] pch_uart: Add user_uartclk parameter Darren Hart
2012-03-01 23:58 ` [PATCH 11/11] pch_uart: Use existing default_baud in setup_console Darren Hart
2012-03-02 21:03 ` [PATCH 00/11][linux-yocto-3.0] Backport fixes and add FRI2 support to pch_uart Bruce Ashfield

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.