* [PATCH v2] Add of helper for linux,stdout-path
@ 2012-10-05 16:12 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:12 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, Rob Herring,
linux-kernel, devicetree-discuss, linux-arm-kernel
This adds a helper function to match the linux,stdout-path property
against a struct device and adds support for this property to the i.MX
serial driver.
Sascha
----------------------------------------------------------------
Sascha Hauer (3):
serial_core: Add helper for matching against linux,stdout-path
serial: i.MX: Make console support non optional
serial: i.MX: evaluate linux,stdout-path property
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 11 ++++-------
drivers/tty/serial/serial_core.c | 30 ++++++++++++++++++++++++++++++
include/linux/serial_core.h | 3 +++
4 files changed, 38 insertions(+), 22 deletions(-)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2] Add of helper for linux,stdout-path
@ 2012-10-05 16:12 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:12 UTC (permalink / raw)
To: linux-arm-kernel
This adds a helper function to match the linux,stdout-path property
against a struct device and adds support for this property to the i.MX
serial driver.
Sascha
----------------------------------------------------------------
Sascha Hauer (3):
serial_core: Add helper for matching against linux,stdout-path
serial: i.MX: Make console support non optional
serial: i.MX: evaluate linux,stdout-path property
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 11 ++++-------
drivers/tty/serial/serial_core.c | 30 ++++++++++++++++++++++++++++++
include/linux/serial_core.h | 3 +++
4 files changed, 38 insertions(+), 22 deletions(-)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2] Add of helper for linux,stdout-path
@ 2012-10-05 16:12 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:12 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, Rob Herring,
linux-kernel, devicetree-discuss, linux-arm-kernel
This adds a helper function to match the linux,stdout-path property
against a struct device and adds support for this property to the i.MX
serial driver.
Sascha
----------------------------------------------------------------
Sascha Hauer (3):
serial_core: Add helper for matching against linux,stdout-path
serial: i.MX: Make console support non optional
serial: i.MX: evaluate linux,stdout-path property
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 11 ++++-------
drivers/tty/serial/serial_core.c | 30 ++++++++++++++++++++++++++++++
include/linux/serial_core.h | 3 +++
4 files changed, 38 insertions(+), 22 deletions(-)
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 1/3] serial_core: Add helper for matching against linux,stdout-path
2012-10-05 16:12 ` Sascha Hauer
(?)
@ 2012-10-05 16:12 ` Sascha Hauer
-1 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:12 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, Rob Herring,
linux-kernel, devicetree-discuss, linux-arm-kernel, Sascha Hauer
devicetrees may have a linux,stdout-path property in the chosen
node describing the console device. This adds a helper function
to match a device against this property so a driver can call
add_preferred_console for a matching device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/serial_core.c | 30 ++++++++++++++++++++++++++++++
include/linux/serial_core.h | 3 +++
2 files changed, 33 insertions(+)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index a21dc8e..f4a9f26 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -33,6 +33,7 @@
#include <linux/serial_core.h>
#include <linux/delay.h>
#include <linux/mutex.h>
+#include <linux/of.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
@@ -2540,6 +2541,35 @@ void uart_insert_char(struct uart_port *port, unsigned int status,
}
EXPORT_SYMBOL_GPL(uart_insert_char);
+#ifdef CONFIG_OF
+/**
+ * of_uart_is_stdoutpath - check if this device matches the linux,stdout-path
+ * property
+ *
+ * Check if this device matches the linux,stdout-path property
+ * in the chosen node. return true if yes, false otherwise.
+ */
+int of_uart_is_stdoutpath(struct device *dev)
+{
+ struct device_node *dn;
+ const char *name;
+
+ name = of_get_property(of_chosen, "linux,stdout-path", NULL);
+ if (name == NULL)
+ return 0;
+
+ dn = of_find_node_by_path(name);
+ if (!dn)
+ return 0;
+
+ if (dn == dev->of_node)
+ return 1;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(of_uart_is_stdoutpath);
+#endif
+
EXPORT_SYMBOL(uart_write_wakeup);
EXPORT_SYMBOL(uart_register_driver);
EXPORT_SYMBOL(uart_unregister_driver);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 0253c20..35a61f6 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -560,6 +560,9 @@ static inline int uart_handle_break(struct uart_port *port)
(cflag) & CRTSCTS || \
!((cflag) & CLOCAL))
+/* check if a device matches the linux,stdout-path property */
+int of_uart_is_stdoutpath(struct device *dev);
+
#endif
#endif /* LINUX_SERIAL_CORE_H */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 1/3] serial_core: Add helper for matching against linux, stdout-path
@ 2012-10-05 16:12 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:12 UTC (permalink / raw)
To: linux-arm-kernel
devicetrees may have a linux,stdout-path property in the chosen
node describing the console device. This adds a helper function
to match a device against this property so a driver can call
add_preferred_console for a matching device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/serial_core.c | 30 ++++++++++++++++++++++++++++++
include/linux/serial_core.h | 3 +++
2 files changed, 33 insertions(+)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index a21dc8e..f4a9f26 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -33,6 +33,7 @@
#include <linux/serial_core.h>
#include <linux/delay.h>
#include <linux/mutex.h>
+#include <linux/of.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
@@ -2540,6 +2541,35 @@ void uart_insert_char(struct uart_port *port, unsigned int status,
}
EXPORT_SYMBOL_GPL(uart_insert_char);
+#ifdef CONFIG_OF
+/**
+ * of_uart_is_stdoutpath - check if this device matches the linux,stdout-path
+ * property
+ *
+ * Check if this device matches the linux,stdout-path property
+ * in the chosen node. return true if yes, false otherwise.
+ */
+int of_uart_is_stdoutpath(struct device *dev)
+{
+ struct device_node *dn;
+ const char *name;
+
+ name = of_get_property(of_chosen, "linux,stdout-path", NULL);
+ if (name == NULL)
+ return 0;
+
+ dn = of_find_node_by_path(name);
+ if (!dn)
+ return 0;
+
+ if (dn == dev->of_node)
+ return 1;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(of_uart_is_stdoutpath);
+#endif
+
EXPORT_SYMBOL(uart_write_wakeup);
EXPORT_SYMBOL(uart_register_driver);
EXPORT_SYMBOL(uart_unregister_driver);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 0253c20..35a61f6 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -560,6 +560,9 @@ static inline int uart_handle_break(struct uart_port *port)
(cflag) & CRTSCTS || \
!((cflag) & CLOCAL))
+/* check if a device matches the linux,stdout-path property */
+int of_uart_is_stdoutpath(struct device *dev);
+
#endif
#endif /* LINUX_SERIAL_CORE_H */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 1/3] serial_core: Add helper for matching against linux,stdout-path
@ 2012-10-05 16:12 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:12 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, Rob Herring,
linux-kernel, devicetree-discuss, linux-arm-kernel, Sascha Hauer
devicetrees may have a linux,stdout-path property in the chosen
node describing the console device. This adds a helper function
to match a device against this property so a driver can call
add_preferred_console for a matching device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/serial_core.c | 30 ++++++++++++++++++++++++++++++
include/linux/serial_core.h | 3 +++
2 files changed, 33 insertions(+)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index a21dc8e..f4a9f26 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -33,6 +33,7 @@
#include <linux/serial_core.h>
#include <linux/delay.h>
#include <linux/mutex.h>
+#include <linux/of.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
@@ -2540,6 +2541,35 @@ void uart_insert_char(struct uart_port *port, unsigned int status,
}
EXPORT_SYMBOL_GPL(uart_insert_char);
+#ifdef CONFIG_OF
+/**
+ * of_uart_is_stdoutpath - check if this device matches the linux,stdout-path
+ * property
+ *
+ * Check if this device matches the linux,stdout-path property
+ * in the chosen node. return true if yes, false otherwise.
+ */
+int of_uart_is_stdoutpath(struct device *dev)
+{
+ struct device_node *dn;
+ const char *name;
+
+ name = of_get_property(of_chosen, "linux,stdout-path", NULL);
+ if (name == NULL)
+ return 0;
+
+ dn = of_find_node_by_path(name);
+ if (!dn)
+ return 0;
+
+ if (dn == dev->of_node)
+ return 1;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(of_uart_is_stdoutpath);
+#endif
+
EXPORT_SYMBOL(uart_write_wakeup);
EXPORT_SYMBOL(uart_register_driver);
EXPORT_SYMBOL(uart_unregister_driver);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 0253c20..35a61f6 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -560,6 +560,9 @@ static inline int uart_handle_break(struct uart_port *port)
(cflag) & CRTSCTS || \
!((cflag) & CLOCAL))
+/* check if a device matches the linux,stdout-path property */
+int of_uart_is_stdoutpath(struct device *dev);
+
#endif
#endif /* LINUX_SERIAL_CORE_H */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 1/3] serial_core: Add helper for matching against linux,stdout-path
2012-10-05 16:12 ` [PATCH 1/3] serial_core: Add helper for matching against linux,stdout-path Sascha Hauer
@ 2012-10-05 16:43 ` Rob Herring
-1 siblings, 0 replies; 19+ messages in thread
From: Rob Herring @ 2012-10-05 16:43 UTC (permalink / raw)
To: Sascha Hauer
Cc: linux-serial, Alan Cox, Greg Kroah-Hartman, Grant Likely,
linux-kernel, devicetree-discuss, linux-arm-kernel
On 10/05/2012 11:12 AM, Sascha Hauer wrote:
> devicetrees may have a linux,stdout-path property in the chosen
> node describing the console device. This adds a helper function
> to match a device against this property so a driver can call
> add_preferred_console for a matching device.
Consoles can be on devices other than uarts, so this should really be
of_device_is_stdout_path() and in the DT core.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> drivers/tty/serial/serial_core.c | 30 ++++++++++++++++++++++++++++++
> include/linux/serial_core.h | 3 +++
> 2 files changed, 33 insertions(+)
>
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index a21dc8e..f4a9f26 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -33,6 +33,7 @@
> #include <linux/serial_core.h>
> #include <linux/delay.h>
> #include <linux/mutex.h>
> +#include <linux/of.h>
>
> #include <asm/irq.h>
> #include <asm/uaccess.h>
> @@ -2540,6 +2541,35 @@ void uart_insert_char(struct uart_port *port, unsigned int status,
> }
> EXPORT_SYMBOL_GPL(uart_insert_char);
>
> +#ifdef CONFIG_OF
> +/**
> + * of_uart_is_stdoutpath - check if this device matches the linux,stdout-path
> + * property
> + *
> + * Check if this device matches the linux,stdout-path property
> + * in the chosen node. return true if yes, false otherwise.
> + */
> +int of_uart_is_stdoutpath(struct device *dev)
> +{
> + struct device_node *dn;
> + const char *name;
> +
> + name = of_get_property(of_chosen, "linux,stdout-path", NULL);
> + if (name == NULL)
> + return 0;
> +
> + dn = of_find_node_by_path(name);
> + if (!dn)
> + return 0;
> +
> + if (dn == dev->of_node)
I know I said use struct device, but since only device_node ptr is
needed you should just use that. Then the function is usable if you only
have the device_node ptr.
> + return 1;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(of_uart_is_stdoutpath);
> +#endif
> +
> EXPORT_SYMBOL(uart_write_wakeup);
> EXPORT_SYMBOL(uart_register_driver);
> EXPORT_SYMBOL(uart_unregister_driver);
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 0253c20..35a61f6 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -560,6 +560,9 @@ static inline int uart_handle_break(struct uart_port *port)
> (cflag) & CRTSCTS || \
> !((cflag) & CLOCAL))
>
> +/* check if a device matches the linux,stdout-path property */
> +int of_uart_is_stdoutpath(struct device *dev);
Need an empty version for !CONFIG_OF?
Rob
> +
> #endif
>
> #endif /* LINUX_SERIAL_CORE_H */
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 1/3] serial_core: Add helper for matching against linux, stdout-path
@ 2012-10-05 16:43 ` Rob Herring
0 siblings, 0 replies; 19+ messages in thread
From: Rob Herring @ 2012-10-05 16:43 UTC (permalink / raw)
To: linux-arm-kernel
On 10/05/2012 11:12 AM, Sascha Hauer wrote:
> devicetrees may have a linux,stdout-path property in the chosen
> node describing the console device. This adds a helper function
> to match a device against this property so a driver can call
> add_preferred_console for a matching device.
Consoles can be on devices other than uarts, so this should really be
of_device_is_stdout_path() and in the DT core.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> drivers/tty/serial/serial_core.c | 30 ++++++++++++++++++++++++++++++
> include/linux/serial_core.h | 3 +++
> 2 files changed, 33 insertions(+)
>
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index a21dc8e..f4a9f26 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -33,6 +33,7 @@
> #include <linux/serial_core.h>
> #include <linux/delay.h>
> #include <linux/mutex.h>
> +#include <linux/of.h>
>
> #include <asm/irq.h>
> #include <asm/uaccess.h>
> @@ -2540,6 +2541,35 @@ void uart_insert_char(struct uart_port *port, unsigned int status,
> }
> EXPORT_SYMBOL_GPL(uart_insert_char);
>
> +#ifdef CONFIG_OF
> +/**
> + * of_uart_is_stdoutpath - check if this device matches the linux,stdout-path
> + * property
> + *
> + * Check if this device matches the linux,stdout-path property
> + * in the chosen node. return true if yes, false otherwise.
> + */
> +int of_uart_is_stdoutpath(struct device *dev)
> +{
> + struct device_node *dn;
> + const char *name;
> +
> + name = of_get_property(of_chosen, "linux,stdout-path", NULL);
> + if (name == NULL)
> + return 0;
> +
> + dn = of_find_node_by_path(name);
> + if (!dn)
> + return 0;
> +
> + if (dn == dev->of_node)
I know I said use struct device, but since only device_node ptr is
needed you should just use that. Then the function is usable if you only
have the device_node ptr.
> + return 1;
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(of_uart_is_stdoutpath);
> +#endif
> +
> EXPORT_SYMBOL(uart_write_wakeup);
> EXPORT_SYMBOL(uart_register_driver);
> EXPORT_SYMBOL(uart_unregister_driver);
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 0253c20..35a61f6 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -560,6 +560,9 @@ static inline int uart_handle_break(struct uart_port *port)
> (cflag) & CRTSCTS || \
> !((cflag) & CLOCAL))
>
> +/* check if a device matches the linux,stdout-path property */
> +int of_uart_is_stdoutpath(struct device *dev);
Need an empty version for !CONFIG_OF?
Rob
> +
> #endif
>
> #endif /* LINUX_SERIAL_CORE_H */
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 2/3] serial: i.MX: Make console support non optional
2012-10-05 16:12 ` Sascha Hauer
(?)
@ 2012-10-05 16:13 ` Sascha Hauer
-1 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:13 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, Rob Herring,
linux-kernel, devicetree-discuss, linux-arm-kernel, Sascha Hauer
Traditionally console support is optional for serial drivers. This
makes it non optional for the i.MX driver since it's not worth
asking questions for a feature virtually every user of this driver
wants to have.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 8 +-------
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 4720b4b..920dd0d 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -515,26 +515,12 @@ config SERIAL_IMX
bool "IMX serial port support"
depends on ARCH_MXC
select SERIAL_CORE
+ select SERIAL_CORE_CONSOLE
select RATIONAL
help
If you have a machine based on a Motorola IMX CPU you
can enable its onboard serial port by enabling this option.
-config SERIAL_IMX_CONSOLE
- bool "Console on IMX serial port"
- depends on SERIAL_IMX
- select SERIAL_CORE_CONSOLE
- help
- If you have enabled the serial port on the Motorola IMX
- CPU you can make it the console by answering Y to this option.
-
- Even if you say Y here, the currently visible virtual console
- (/dev/tty0) will still be used as the system console by default, but
- you can alter that using a kernel command line option such as
- "console=ttySA0". (Try "man bootparam" or see the documentation of
- your boot loader (lilo or loadlin) about how to pass options to the
- kernel at boot time.)
-
config SERIAL_UARTLITE
tristate "Xilinx uartlite serial port support"
depends on PPC32 || MICROBLAZE || MFD_TIMBERDALE
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index e309e8b..3a9337e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1192,7 +1192,6 @@ static struct uart_ops imx_pops = {
static struct imx_port *imx_ports[UART_NR];
-#ifdef CONFIG_SERIAL_IMX_CONSOLE
static void imx_console_putchar(struct uart_port *port, int ch)
{
struct imx_port *sport = (struct imx_port *)port;
@@ -1348,11 +1347,6 @@ static struct console imx_console = {
.data = &imx_reg,
};
-#define IMX_CONSOLE &imx_console
-#else
-#define IMX_CONSOLE NULL
-#endif
-
static struct uart_driver imx_reg = {
.owner = THIS_MODULE,
.driver_name = DRIVER_NAME,
@@ -1360,7 +1354,7 @@ static struct uart_driver imx_reg = {
.major = SERIAL_IMX_MAJOR,
.minor = MINOR_START,
.nr = ARRAY_SIZE(imx_ports),
- .cons = IMX_CONSOLE,
+ .cons = &imx_console,
};
static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/3] serial: i.MX: Make console support non optional
@ 2012-10-05 16:13 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:13 UTC (permalink / raw)
To: linux-arm-kernel
Traditionally console support is optional for serial drivers. This
makes it non optional for the i.MX driver since it's not worth
asking questions for a feature virtually every user of this driver
wants to have.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 8 +-------
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 4720b4b..920dd0d 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -515,26 +515,12 @@ config SERIAL_IMX
bool "IMX serial port support"
depends on ARCH_MXC
select SERIAL_CORE
+ select SERIAL_CORE_CONSOLE
select RATIONAL
help
If you have a machine based on a Motorola IMX CPU you
can enable its onboard serial port by enabling this option.
-config SERIAL_IMX_CONSOLE
- bool "Console on IMX serial port"
- depends on SERIAL_IMX
- select SERIAL_CORE_CONSOLE
- help
- If you have enabled the serial port on the Motorola IMX
- CPU you can make it the console by answering Y to this option.
-
- Even if you say Y here, the currently visible virtual console
- (/dev/tty0) will still be used as the system console by default, but
- you can alter that using a kernel command line option such as
- "console=ttySA0". (Try "man bootparam" or see the documentation of
- your boot loader (lilo or loadlin) about how to pass options to the
- kernel at boot time.)
-
config SERIAL_UARTLITE
tristate "Xilinx uartlite serial port support"
depends on PPC32 || MICROBLAZE || MFD_TIMBERDALE
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index e309e8b..3a9337e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1192,7 +1192,6 @@ static struct uart_ops imx_pops = {
static struct imx_port *imx_ports[UART_NR];
-#ifdef CONFIG_SERIAL_IMX_CONSOLE
static void imx_console_putchar(struct uart_port *port, int ch)
{
struct imx_port *sport = (struct imx_port *)port;
@@ -1348,11 +1347,6 @@ static struct console imx_console = {
.data = &imx_reg,
};
-#define IMX_CONSOLE &imx_console
-#else
-#define IMX_CONSOLE NULL
-#endif
-
static struct uart_driver imx_reg = {
.owner = THIS_MODULE,
.driver_name = DRIVER_NAME,
@@ -1360,7 +1354,7 @@ static struct uart_driver imx_reg = {
.major = SERIAL_IMX_MAJOR,
.minor = MINOR_START,
.nr = ARRAY_SIZE(imx_ports),
- .cons = IMX_CONSOLE,
+ .cons = &imx_console,
};
static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/3] serial: i.MX: Make console support non optional
@ 2012-10-05 16:13 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:13 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, Rob Herring,
linux-kernel, devicetree-discuss, linux-arm-kernel, Sascha Hauer
Traditionally console support is optional for serial drivers. This
makes it non optional for the i.MX driver since it's not worth
asking questions for a feature virtually every user of this driver
wants to have.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 8 +-------
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 4720b4b..920dd0d 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -515,26 +515,12 @@ config SERIAL_IMX
bool "IMX serial port support"
depends on ARCH_MXC
select SERIAL_CORE
+ select SERIAL_CORE_CONSOLE
select RATIONAL
help
If you have a machine based on a Motorola IMX CPU you
can enable its onboard serial port by enabling this option.
-config SERIAL_IMX_CONSOLE
- bool "Console on IMX serial port"
- depends on SERIAL_IMX
- select SERIAL_CORE_CONSOLE
- help
- If you have enabled the serial port on the Motorola IMX
- CPU you can make it the console by answering Y to this option.
-
- Even if you say Y here, the currently visible virtual console
- (/dev/tty0) will still be used as the system console by default, but
- you can alter that using a kernel command line option such as
- "console=ttySA0". (Try "man bootparam" or see the documentation of
- your boot loader (lilo or loadlin) about how to pass options to the
- kernel at boot time.)
-
config SERIAL_UARTLITE
tristate "Xilinx uartlite serial port support"
depends on PPC32 || MICROBLAZE || MFD_TIMBERDALE
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index e309e8b..3a9337e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1192,7 +1192,6 @@ static struct uart_ops imx_pops = {
static struct imx_port *imx_ports[UART_NR];
-#ifdef CONFIG_SERIAL_IMX_CONSOLE
static void imx_console_putchar(struct uart_port *port, int ch)
{
struct imx_port *sport = (struct imx_port *)port;
@@ -1348,11 +1347,6 @@ static struct console imx_console = {
.data = &imx_reg,
};
-#define IMX_CONSOLE &imx_console
-#else
-#define IMX_CONSOLE NULL
-#endif
-
static struct uart_driver imx_reg = {
.owner = THIS_MODULE,
.driver_name = DRIVER_NAME,
@@ -1360,7 +1354,7 @@ static struct uart_driver imx_reg = {
.major = SERIAL_IMX_MAJOR,
.minor = MINOR_START,
.nr = ARRAY_SIZE(imx_ports),
- .cons = IMX_CONSOLE,
+ .cons = &imx_console,
};
static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 3/3] serial: i.MX: evaluate linux,stdout-path property
2012-10-05 16:12 ` Sascha Hauer
(?)
@ 2012-10-05 16:13 ` Sascha Hauer
-1 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:13 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, Rob Herring,
linux-kernel, devicetree-discuss, linux-arm-kernel, Sascha Hauer
devicetrees may have the linux,stdout-path property to specify the
console. This patch adds support to the i.MX serial driver for this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/imx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 3a9337e..bc8a7bfa 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1421,6 +1421,9 @@ static int serial_imx_probe_dt(struct imx_port *sport,
sport->devdata = of_id->data;
+ if (of_uart_is_stdoutpath(&pdev->dev))
+ add_preferred_console(imx_reg.cons->name, sport->port.line, 0);
+
return 0;
}
#else
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 3/3] serial: i.MX: evaluate linux,stdout-path property
@ 2012-10-05 16:13 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:13 UTC (permalink / raw)
To: linux-arm-kernel
devicetrees may have the linux,stdout-path property to specify the
console. This patch adds support to the i.MX serial driver for this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/imx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 3a9337e..bc8a7bfa 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1421,6 +1421,9 @@ static int serial_imx_probe_dt(struct imx_port *sport,
sport->devdata = of_id->data;
+ if (of_uart_is_stdoutpath(&pdev->dev))
+ add_preferred_console(imx_reg.cons->name, sport->port.line, 0);
+
return 0;
}
#else
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 3/3] serial: i.MX: evaluate linux,stdout-path property
@ 2012-10-05 16:13 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-10-05 16:13 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, Rob Herring,
linux-kernel, devicetree-discuss, linux-arm-kernel, Sascha Hauer
devicetrees may have the linux,stdout-path property to specify the
console. This patch adds support to the i.MX serial driver for this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/imx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 3a9337e..bc8a7bfa 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1421,6 +1421,9 @@ static int serial_imx_probe_dt(struct imx_port *sport,
sport->devdata = of_id->data;
+ if (of_uart_is_stdoutpath(&pdev->dev))
+ add_preferred_console(imx_reg.cons->name, sport->port.line, 0);
+
return 0;
}
#else
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v3] linux,stdout-path helper
@ 2012-11-02 9:48 Sascha Hauer
2012-11-02 9:48 ` Sascha Hauer
0 siblings, 1 reply; 19+ messages in thread
From: Sascha Hauer @ 2012-11-02 9:48 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, linux-kernel,
devicetree-discuss, linux-arm-kernel, kernel
The following adds a helper for matching the linux,stdout-path property
in the chosen node and makes use of it in the i.MX serial driver.
changes since v2:
- move helper to OF core and make it independent of serial devices
changes since v1:
- move it out of the i.MX serial driver and make it generic for serial
devices.
----------------------------------------------------------------
Sascha Hauer (3):
OF: Add helper for matching against linux,stdout-path
serial: i.MX: Make console support non optional
serial: i.MX: evaluate linux,stdout-path property
drivers/of/Kconfig | 3 +++
drivers/of/Makefile | 1 +
drivers/of/of_stdout.c | 27 +++++++++++++++++++++++++++
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 12 +++++-------
include/linux/of_stdout.h | 24 ++++++++++++++++++++++++
6 files changed, 61 insertions(+), 22 deletions(-)
create mode 100644 drivers/of/of_stdout.c
create mode 100644 include/linux/of_stdout.h
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 2/3] serial: i.MX: Make console support non optional
2012-11-02 9:48 [PATCH v3] linux,stdout-path helper Sascha Hauer
@ 2012-11-02 9:48 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-11-02 9:48 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, linux-kernel,
devicetree-discuss, linux-arm-kernel, kernel, Sascha Hauer
Traditionally console support is optional for serial drivers. This
makes it non optional for the i.MX driver since it's not worth
asking questions for a feature virtually every user of this driver
wants to have.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 8 +-------
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 4720b4b..920dd0d 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -515,26 +515,12 @@ config SERIAL_IMX
bool "IMX serial port support"
depends on ARCH_MXC
select SERIAL_CORE
+ select SERIAL_CORE_CONSOLE
select RATIONAL
help
If you have a machine based on a Motorola IMX CPU you
can enable its onboard serial port by enabling this option.
-config SERIAL_IMX_CONSOLE
- bool "Console on IMX serial port"
- depends on SERIAL_IMX
- select SERIAL_CORE_CONSOLE
- help
- If you have enabled the serial port on the Motorola IMX
- CPU you can make it the console by answering Y to this option.
-
- Even if you say Y here, the currently visible virtual console
- (/dev/tty0) will still be used as the system console by default, but
- you can alter that using a kernel command line option such as
- "console=ttySA0". (Try "man bootparam" or see the documentation of
- your boot loader (lilo or loadlin) about how to pass options to the
- kernel at boot time.)
-
config SERIAL_UARTLITE
tristate "Xilinx uartlite serial port support"
depends on PPC32 || MICROBLAZE || MFD_TIMBERDALE
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index e309e8b..3a9337e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1192,7 +1192,6 @@ static struct uart_ops imx_pops = {
static struct imx_port *imx_ports[UART_NR];
-#ifdef CONFIG_SERIAL_IMX_CONSOLE
static void imx_console_putchar(struct uart_port *port, int ch)
{
struct imx_port *sport = (struct imx_port *)port;
@@ -1348,11 +1347,6 @@ static struct console imx_console = {
.data = &imx_reg,
};
-#define IMX_CONSOLE &imx_console
-#else
-#define IMX_CONSOLE NULL
-#endif
-
static struct uart_driver imx_reg = {
.owner = THIS_MODULE,
.driver_name = DRIVER_NAME,
@@ -1360,7 +1354,7 @@ static struct uart_driver imx_reg = {
.major = SERIAL_IMX_MAJOR,
.minor = MINOR_START,
.nr = ARRAY_SIZE(imx_ports),
- .cons = IMX_CONSOLE,
+ .cons = &imx_console,
};
static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/3] serial: i.MX: Make console support non optional
@ 2012-11-02 9:48 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-11-02 9:48 UTC (permalink / raw)
To: linux-arm-kernel
Traditionally console support is optional for serial drivers. This
makes it non optional for the i.MX driver since it's not worth
asking questions for a feature virtually every user of this driver
wants to have.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 8 +-------
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 4720b4b..920dd0d 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -515,26 +515,12 @@ config SERIAL_IMX
bool "IMX serial port support"
depends on ARCH_MXC
select SERIAL_CORE
+ select SERIAL_CORE_CONSOLE
select RATIONAL
help
If you have a machine based on a Motorola IMX CPU you
can enable its onboard serial port by enabling this option.
-config SERIAL_IMX_CONSOLE
- bool "Console on IMX serial port"
- depends on SERIAL_IMX
- select SERIAL_CORE_CONSOLE
- help
- If you have enabled the serial port on the Motorola IMX
- CPU you can make it the console by answering Y to this option.
-
- Even if you say Y here, the currently visible virtual console
- (/dev/tty0) will still be used as the system console by default, but
- you can alter that using a kernel command line option such as
- "console=ttySA0". (Try "man bootparam" or see the documentation of
- your boot loader (lilo or loadlin) about how to pass options to the
- kernel at boot time.)
-
config SERIAL_UARTLITE
tristate "Xilinx uartlite serial port support"
depends on PPC32 || MICROBLAZE || MFD_TIMBERDALE
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index e309e8b..3a9337e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1192,7 +1192,6 @@ static struct uart_ops imx_pops = {
static struct imx_port *imx_ports[UART_NR];
-#ifdef CONFIG_SERIAL_IMX_CONSOLE
static void imx_console_putchar(struct uart_port *port, int ch)
{
struct imx_port *sport = (struct imx_port *)port;
@@ -1348,11 +1347,6 @@ static struct console imx_console = {
.data = &imx_reg,
};
-#define IMX_CONSOLE &imx_console
-#else
-#define IMX_CONSOLE NULL
-#endif
-
static struct uart_driver imx_reg = {
.owner = THIS_MODULE,
.driver_name = DRIVER_NAME,
@@ -1360,7 +1354,7 @@ static struct uart_driver imx_reg = {
.major = SERIAL_IMX_MAJOR,
.minor = MINOR_START,
.nr = ARRAY_SIZE(imx_ports),
- .cons = IMX_CONSOLE,
+ .cons = &imx_console,
};
static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v4] linux,stdout-path helper
@ 2012-11-15 9:31 Sascha Hauer
2012-11-15 9:31 ` Sascha Hauer
0 siblings, 1 reply; 19+ messages in thread
From: Sascha Hauer @ 2012-11-15 9:31 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, linux-kernel,
devicetree-discuss, linux-arm-kernel, kernel
The following adds a helper for matching the linux,stdout-path property
in the chosen node and makes use of it in the i.MX serial driver.
changes since v3:
- move code from separate files to drivers/of/base.c and include/linux/of.h
changes since v2:
- move helper to OF core and make it independent of serial devices
changes since v1:
- move it out of the i.MX serial driver and make it generic for serial
devices.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 2/3] serial: i.MX: Make console support non optional
@ 2012-11-15 9:31 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-11-15 9:31 UTC (permalink / raw)
To: linux-serial
Cc: Alan Cox, Greg Kroah-Hartman, Grant Likely, linux-kernel,
devicetree-discuss, linux-arm-kernel, kernel, Sascha Hauer
Traditionally console support is optional for serial drivers. This
makes it non optional for the i.MX driver since it's not worth
asking questions for a feature virtually every user of this driver
wants to have.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 8 +-------
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 2a53be5..919b243 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -541,26 +541,12 @@ config SERIAL_IMX
bool "IMX serial port support"
depends on ARCH_MXC
select SERIAL_CORE
+ select SERIAL_CORE_CONSOLE
select RATIONAL
help
If you have a machine based on a Motorola IMX CPU you
can enable its onboard serial port by enabling this option.
-config SERIAL_IMX_CONSOLE
- bool "Console on IMX serial port"
- depends on SERIAL_IMX
- select SERIAL_CORE_CONSOLE
- help
- If you have enabled the serial port on the Motorola IMX
- CPU you can make it the console by answering Y to this option.
-
- Even if you say Y here, the currently visible virtual console
- (/dev/tty0) will still be used as the system console by default, but
- you can alter that using a kernel command line option such as
- "console=ttySA0". (Try "man bootparam" or see the documentation of
- your boot loader (lilo or loadlin) about how to pass options to the
- kernel at boot time.)
-
config SERIAL_UARTLITE
tristate "Xilinx uartlite serial port support"
depends on PPC32 || MICROBLAZE || MFD_TIMBERDALE
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 5981912..07a8ca1 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1192,7 +1192,6 @@ static struct uart_ops imx_pops = {
static struct imx_port *imx_ports[UART_NR];
-#ifdef CONFIG_SERIAL_IMX_CONSOLE
static void imx_console_putchar(struct uart_port *port, int ch)
{
struct imx_port *sport = (struct imx_port *)port;
@@ -1348,11 +1347,6 @@ static struct console imx_console = {
.data = &imx_reg,
};
-#define IMX_CONSOLE &imx_console
-#else
-#define IMX_CONSOLE NULL
-#endif
-
static struct uart_driver imx_reg = {
.owner = THIS_MODULE,
.driver_name = DRIVER_NAME,
@@ -1360,7 +1354,7 @@ static struct uart_driver imx_reg = {
.major = SERIAL_IMX_MAJOR,
.minor = MINOR_START,
.nr = ARRAY_SIZE(imx_ports),
- .cons = IMX_CONSOLE,
+ .cons = &imx_console,
};
static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/3] serial: i.MX: Make console support non optional
@ 2012-11-15 9:31 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-11-15 9:31 UTC (permalink / raw)
To: linux-arm-kernel
Traditionally console support is optional for serial drivers. This
makes it non optional for the i.MX driver since it's not worth
asking questions for a feature virtually every user of this driver
wants to have.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 8 +-------
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 2a53be5..919b243 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -541,26 +541,12 @@ config SERIAL_IMX
bool "IMX serial port support"
depends on ARCH_MXC
select SERIAL_CORE
+ select SERIAL_CORE_CONSOLE
select RATIONAL
help
If you have a machine based on a Motorola IMX CPU you
can enable its onboard serial port by enabling this option.
-config SERIAL_IMX_CONSOLE
- bool "Console on IMX serial port"
- depends on SERIAL_IMX
- select SERIAL_CORE_CONSOLE
- help
- If you have enabled the serial port on the Motorola IMX
- CPU you can make it the console by answering Y to this option.
-
- Even if you say Y here, the currently visible virtual console
- (/dev/tty0) will still be used as the system console by default, but
- you can alter that using a kernel command line option such as
- "console=ttySA0". (Try "man bootparam" or see the documentation of
- your boot loader (lilo or loadlin) about how to pass options to the
- kernel at boot time.)
-
config SERIAL_UARTLITE
tristate "Xilinx uartlite serial port support"
depends on PPC32 || MICROBLAZE || MFD_TIMBERDALE
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 5981912..07a8ca1 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1192,7 +1192,6 @@ static struct uart_ops imx_pops = {
static struct imx_port *imx_ports[UART_NR];
-#ifdef CONFIG_SERIAL_IMX_CONSOLE
static void imx_console_putchar(struct uart_port *port, int ch)
{
struct imx_port *sport = (struct imx_port *)port;
@@ -1348,11 +1347,6 @@ static struct console imx_console = {
.data = &imx_reg,
};
-#define IMX_CONSOLE &imx_console
-#else
-#define IMX_CONSOLE NULL
-#endif
-
static struct uart_driver imx_reg = {
.owner = THIS_MODULE,
.driver_name = DRIVER_NAME,
@@ -1360,7 +1354,7 @@ static struct uart_driver imx_reg = {
.major = SERIAL_IMX_MAJOR,
.minor = MINOR_START,
.nr = ARRAY_SIZE(imx_ports),
- .cons = IMX_CONSOLE,
+ .cons = &imx_console,
};
static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/3] serial: i.MX: Make console support non optional
@ 2012-11-15 9:31 ` Sascha Hauer
0 siblings, 0 replies; 19+ messages in thread
From: Sascha Hauer @ 2012-11-15 9:31 UTC (permalink / raw)
To: linux-serial-u79uwXL29TY76Z2rM5mHXA
Cc: Greg Kroah-Hartman, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ, Sascha Hauer,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Alan Cox
Traditionally console support is optional for serial drivers. This
makes it non optional for the i.MX driver since it's not worth
asking questions for a feature virtually every user of this driver
wants to have.
Signed-off-by: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
drivers/tty/serial/Kconfig | 16 +---------------
drivers/tty/serial/imx.c | 8 +-------
2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 2a53be5..919b243 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -541,26 +541,12 @@ config SERIAL_IMX
bool "IMX serial port support"
depends on ARCH_MXC
select SERIAL_CORE
+ select SERIAL_CORE_CONSOLE
select RATIONAL
help
If you have a machine based on a Motorola IMX CPU you
can enable its onboard serial port by enabling this option.
-config SERIAL_IMX_CONSOLE
- bool "Console on IMX serial port"
- depends on SERIAL_IMX
- select SERIAL_CORE_CONSOLE
- help
- If you have enabled the serial port on the Motorola IMX
- CPU you can make it the console by answering Y to this option.
-
- Even if you say Y here, the currently visible virtual console
- (/dev/tty0) will still be used as the system console by default, but
- you can alter that using a kernel command line option such as
- "console=ttySA0". (Try "man bootparam" or see the documentation of
- your boot loader (lilo or loadlin) about how to pass options to the
- kernel at boot time.)
-
config SERIAL_UARTLITE
tristate "Xilinx uartlite serial port support"
depends on PPC32 || MICROBLAZE || MFD_TIMBERDALE
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 5981912..07a8ca1 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1192,7 +1192,6 @@ static struct uart_ops imx_pops = {
static struct imx_port *imx_ports[UART_NR];
-#ifdef CONFIG_SERIAL_IMX_CONSOLE
static void imx_console_putchar(struct uart_port *port, int ch)
{
struct imx_port *sport = (struct imx_port *)port;
@@ -1348,11 +1347,6 @@ static struct console imx_console = {
.data = &imx_reg,
};
-#define IMX_CONSOLE &imx_console
-#else
-#define IMX_CONSOLE NULL
-#endif
-
static struct uart_driver imx_reg = {
.owner = THIS_MODULE,
.driver_name = DRIVER_NAME,
@@ -1360,7 +1354,7 @@ static struct uart_driver imx_reg = {
.major = SERIAL_IMX_MAJOR,
.minor = MINOR_START,
.nr = ARRAY_SIZE(imx_ports),
- .cons = IMX_CONSOLE,
+ .cons = &imx_console,
};
static int serial_imx_suspend(struct platform_device *dev, pm_message_t state)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
end of thread, other threads:[~2012-11-15 9:31 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-05 16:12 [PATCH v2] Add of helper for linux,stdout-path Sascha Hauer
2012-10-05 16:12 ` Sascha Hauer
2012-10-05 16:12 ` Sascha Hauer
2012-10-05 16:12 ` [PATCH 1/3] serial_core: Add helper for matching against linux,stdout-path Sascha Hauer
2012-10-05 16:12 ` [PATCH 1/3] serial_core: Add helper for matching against linux, stdout-path Sascha Hauer
2012-10-05 16:12 ` [PATCH 1/3] serial_core: Add helper for matching against linux,stdout-path Sascha Hauer
2012-10-05 16:43 ` Rob Herring
2012-10-05 16:43 ` [PATCH 1/3] serial_core: Add helper for matching against linux, stdout-path Rob Herring
2012-10-05 16:13 ` [PATCH 2/3] serial: i.MX: Make console support non optional Sascha Hauer
2012-10-05 16:13 ` Sascha Hauer
2012-10-05 16:13 ` Sascha Hauer
2012-10-05 16:13 ` [PATCH 3/3] serial: i.MX: evaluate linux,stdout-path property Sascha Hauer
2012-10-05 16:13 ` Sascha Hauer
2012-10-05 16:13 ` Sascha Hauer
2012-11-02 9:48 [PATCH v3] linux,stdout-path helper Sascha Hauer
2012-11-02 9:48 ` [PATCH 2/3] serial: i.MX: Make console support non optional Sascha Hauer
2012-11-02 9:48 ` Sascha Hauer
2012-11-15 9:31 [PATCH v4] linux,stdout-path helper Sascha Hauer
2012-11-15 9:31 ` [PATCH 2/3] serial: i.MX: Make console support non optional Sascha Hauer
2012-11-15 9:31 ` Sascha Hauer
2012-11-15 9:31 ` Sascha Hauer
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.