Skip to contentSkip to conversation

x86: add a user configurable Kconfig option for the NS16550 UART

PATCH In review Derek Straka 3 participants 9 messages Sep 19, 2016 – Sep 20, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 x86: add a user configurable Kconfig option for the NS16550 UART

Allows for the conditional inclusion of NS16550 UART driver rather than having it always enabled.

The default configuration for the CONFIG_NS16550 option remains 'y', so the behavior out of the box remains unchanged. The addition of the option allows advanced users to enable/disable the inclusion of the NS16550 UART driver.

---
 xen/drivers/char/Kconfig  | 5 +++++
 xen/drivers/char/Makefile | 2 +-
 xen/include/xen/serial.h  | 7 ++++++-
 3 files changed, 12 insertions(+), 2 deletions(-)
xen/drivers/char/Kconfig +5 -0
index 51343d0..1d894a7 100644
@@ -1,6 +1,11 @@
 config HAS_NS16550
 	bool
 	default y
+
+config NS16550
+	bool "NS16550 UART" if EXPERT = "y"
+	default y
+	depends on HAS_NS16550
 	help
 	  This selects the 16550-series UART support. For most systems, say Y.
 
xen/drivers/char/Makefile +1 -1
index aa169d7..0afadaf 100644
@@ -1,5 +1,5 @@
 obj-y += console.o
-obj-$(CONFIG_HAS_NS16550) += ns16550.o
+obj-$(CONFIG_NS16550) += ns16550.o
 obj-$(CONFIG_HAS_CADENCE_UART) += cadence-uart.o
 obj-$(CONFIG_HAS_PL011) += pl011.o
 obj-$(CONFIG_HAS_EXYNOS4210) += exynos4210-uart.o
xen/include/xen/serial.h +6 -1
index 1212a12..46edff8 100644
@@ -167,9 +167,14 @@ struct ns16550_defaults {
     int irq;       /* default irq */
     unsigned long io_base; /* default io_base address */
 };
+
+#ifdef CONFIG_NS16550
 void ns16550_init(int index, struct ns16550_defaults *defaults);
-void ehci_dbgp_init(void);
+#else
+static inline void ns16550_init(int index, struct ns16550_defaults *defaults) {}
+#endif
 
+void ehci_dbgp_init(void);
 void arm_uart_init(void);
 
 struct physdev_dbgp_op;
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

PATCH v2 2/2 x86: add a user configurable Kconfig option for the EHCI debug port

Allows for the conditional inclusion of EHCI debug port driver on the x86 platform rather than having it always enabled.

The default configuration for the CONFIG_EHCI option remains 'y' on x86, so the behavior out of the box remains unchanged. The addition of the option allows advanced users to enable/disable the inclusion of the EHCI debug port driver.

---
 xen/drivers/char/Kconfig  |  5 +++++
 xen/drivers/char/Makefile |  2 +-
 xen/include/xen/serial.h  | 12 +++++++++---
 3 files changed, 15 insertions(+), 4 deletions(-)
xen/drivers/char/Kconfig +5 -0
index 1d894a7..1c5400f 100644
@@ -51,6 +51,11 @@ config HAS_SCIF
 
 config HAS_EHCI
 	bool
+
+config EHCI
+	bool "EHCI debug port" if EXPERT = "y"
+	default y
+	depends on HAS_EHCI
 	help
 	  This selects the USB based EHCI debug port to be used as a UART. If
 	  you have an x86 based system with USB, say Y.
xen/drivers/char/Makefile +1 -1
index 0afadaf..40c193b 100644
@@ -5,6 +5,6 @@ obj-$(CONFIG_HAS_PL011) += pl011.o
 obj-$(CONFIG_HAS_EXYNOS4210) += exynos4210-uart.o
 obj-$(CONFIG_HAS_OMAP) += omap-uart.o
 obj-$(CONFIG_HAS_SCIF) += scif-uart.o
-obj-$(CONFIG_HAS_EHCI) += ehci-dbgp.o
+obj-$(CONFIG_EHCI) += ehci-dbgp.o
 obj-$(CONFIG_ARM) += arm-uart.o
 obj-y += serial.o
xen/include/xen/serial.h +9 -3
index 46edff8..5c6cbe9 100644
@@ -174,11 +174,17 @@ void ns16550_init(int index, struct ns16550_defaults *defaults);
 static inline void ns16550_init(int index, struct ns16550_defaults *defaults) {}
 #endif
 
-void ehci_dbgp_init(void);
-void arm_uart_init(void);
-
 struct physdev_dbgp_op;
+
+#ifdef CONFIG_EHCI
 int dbgp_op(const struct physdev_dbgp_op *);
+void ehci_dbgp_init(void);
+#else
+static inline void ehci_dbgp_init(void) {}
+static inline int dbgp_op(const struct physdev_dbgp_op *op) { return 0; }
+#endif
+
+void arm_uart_init(void);
 
 /* Baud rate was pre-configured before invoking the UART driver. */
 #define BAUD_AUTO (-1)
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#2 lore raw

Re: [PATCH v2 2/2] x86: add a user configurable Kconfig option for the EHCI debug port

Hello,

Quoted 47 lines · Derek Straka

Allows for the conditional inclusion of EHCI debug port driver on the x86 platform rather than having it always enabled.

The default configuration for the CONFIG_EHCI option remains 'y' on x86, so the behavior out of the box remains unchanged. The addition of the option allows advanced users to enable/disable the inclusion of the EHCI debug port driver.

---
 xen/drivers/char/Kconfig  |  5 +++++
 xen/drivers/char/Makefile |  2 +-
 xen/include/xen/serial.h  | 12 +++++++++---
 3 files changed, 15 insertions(+), 4 deletions(-)
xen/drivers/char/Kconfig +5 -0
index 1d894a7..1c5400f 100644
@@ -51,6 +51,11 @@ config HAS_SCIF
 
 config HAS_EHCI
 	bool
+
+config EHCI
+	bool "EHCI debug port" if EXPERT = "y"
+	default y
+	depends on HAS_EHCI
 	help
 	  This selects the USB based EHCI debug port to be used as a UART. If
 	  you have an x86 based system with USB, say Y.
xen/drivers/char/Makefile +1 -1
index 0afadaf..40c193b 100644
@@ -5,6 +5,6 @@ obj-$(CONFIG_HAS_PL011) += pl011.o
 obj-$(CONFIG_HAS_EXYNOS4210) += exynos4210-uart.o
 obj-$(CONFIG_HAS_OMAP) += omap-uart.o
 obj-$(CONFIG_HAS_SCIF) += scif-uart.o
-obj-$(CONFIG_HAS_EHCI) += ehci-dbgp.o
+obj-$(CONFIG_EHCI) += ehci-dbgp.o
 obj-$(CONFIG_ARM) += arm-uart.o
 obj-y += serial.o
xen/include/xen/serial.h +0 -0
index 46edff8..5c6cbe9 100644

xen/include/xen/serial.h void ns16550_init(int index, struct ns16550_defaults *defaults); · line 178

Quoted 5 lines
xen/include/xen/serial.h +0 -2
@@ -174,11 +174,17 @@ void ns16550_init(int index, struct ns16550_defaults *defaults);
 static inline void ns16550_init(int index, struct ns16550_defaults *defaults) {}
 #endif
 
-void ehci_dbgp_init(void);
-void arm_uart_init(void);

Why did you move arm_uart_init? It does not seem related to this patch...

Quoted 6 lines
xen/include/xen/serial.h +2 -1
-
 struct physdev_dbgp_op;
+
+#ifdef CONFIG_EHCI
 int dbgp_op(const struct physdev_dbgp_op *);

xen/include/xen/serial.h void ns16550_init(int index, struct ns16550_defaults *defaults); · line 190

Quoted 10 lines
xen/include/xen/serial.h +7 -0
+void ehci_dbgp_init(void);
+#else
+static inline void ehci_dbgp_init(void) {}
+static inline int dbgp_op(const struct physdev_dbgp_op *op) { return 0; }
+#endif
+
+void arm_uart_init(void);
 
 /* Baud rate was pre-configured before invoking the UART driver. */
 #define BAUD_AUTO (-1)

Regards,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#3 lore raw

Re: [PATCH v2 2/2] x86: add a user configurable Kconfig option for the EHCI debug port

Julien,

Quoted 60 lines · Julien Grall

Hello,

Quoted 56 lines · Derek Straka

Allows for the conditional inclusion of EHCI debug port driver on the x86 platform rather than having it always enabled.

The default configuration for the CONFIG_EHCI option remains 'y' on x86, so the
behavior out of the box remains unchanged. The addition of the option allows
advanced users to enable/disable the inclusion of the EHCI debug port driver.

---
 xen/drivers/char/Kconfig  |  5 +++++
 xen/drivers/char/Makefile |  2 +-
 xen/include/xen/serial.h  | 12 +++++++++---
 3 files changed, 15 insertions(+), 4 deletions(-)
xen/drivers/char/Kconfig +5 -0
index 1d894a7..1c5400f 100644
@@ -51,6 +51,11 @@ config HAS_SCIF
 
 config HAS_EHCI
        bool
+
+config EHCI
+       bool "EHCI debug port" if EXPERT = "y"
+       default y
+       depends on HAS_EHCI
        help
          This selects the USB based EHCI debug port to be used as a

UART. If
you have an x86 based system with USB, say Y.

xen/drivers/char/Makefile +1 -1
index 0afadaf..40c193b 100644
@@ -5,6 +5,6 @@ obj-$(CONFIG_HAS_PL011) += pl011.o
 obj-$(CONFIG_HAS_EXYNOS4210) += exynos4210-uart.o
 obj-$(CONFIG_HAS_OMAP) += omap-uart.o
 obj-$(CONFIG_HAS_SCIF) += scif-uart.o
-obj-$(CONFIG_HAS_EHCI) += ehci-dbgp.o
+obj-$(CONFIG_EHCI) += ehci-dbgp.o
 obj-$(CONFIG_ARM) += arm-uart.o
 obj-y += serial.o
xen/include/xen/serial.h +0 -0
index 46edff8..5c6cbe9 100644
@@ -174,11 +174,17 @@ void ns16550_init(int index, struct
 ns16550_defaults *defaults);
 static inline void ns16550_init(int index, struct ns16550_defaults
 *defaults) {}
 #endif
 
Quoted 6 lines

xen/include/xen/serial.h void ns16550_init(int index, struct ns16550_defaults *defaults); · line 188

Quoted 3 lines
xen/include/xen/serial.h +0 -2
-void ehci_dbgp_init(void);
-void arm_uart_init(void);
 

Why did you move arm_uart_init? It does not seem related to this patch...

I moved the EHCI code above the arm_uart_init since ehci_dbgp_init preceded the arm code originally, but I can certainly move the ECHI declarations after if you'd prefer.

Quoted 14 lines

-

Quoted 12 lines
xen/include/xen/serial.h +9 -0
 struct physdev_dbgp_op;
+
+#ifdef CONFIG_EHCI
 int dbgp_op(const struct physdev_dbgp_op *);
+void ehci_dbgp_init(void);
+#else
+static inline void ehci_dbgp_init(void) {}
+static inline int dbgp_op(const struct physdev_dbgp_op *op) { return 0; }
+#endif
+
+void arm_uart_init(void);
Quoted 8 lines
Quoted 4 lines

/* Baud rate was pre-configured before invoking the UART driver. */ #define BAUD_AUTO (-1)

Regards,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#4 lore raw

Re: [PATCH v2 2/2] x86: add a user configurable Kconfig option for the EHCI debug port

Quoted 74 lines · Derek Straka

Julien,

On Mon, Sep 19, 2016 at 10:56 AM, Julien Grall <[email protected] <mailto:[email protected]>> wrote:

    Hello,

    On 19/09/2016 16:51, Derek Straka wrote:

        Allows for the conditional inclusion of EHCI debug port driver
        on the x86
        platform rather than having it always enabled.

        The default configuration for the CONFIG_EHCI option remains 'y'
        on x86, so the
        behavior out of the box remains unchanged.  The addition of the
        option allows
        advanced users to enable/disable the inclusion of the EHCI debug
        port driver.

        Signed-off-by: Derek Straka <[email protected]
        <mailto:[email protected]>>
        ---
         xen/drivers/char/Kconfig  |  5 +++++
         xen/drivers/char/Makefile |  2 +-
         xen/include/xen/serial.h  | 12 +++++++++---
         3 files changed, 15 insertions(+), 4 deletions(-)

        diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig
        index 1d894a7..1c5400f 100644
        --- a/xen/drivers/char/Kconfig
        +++ b/xen/drivers/char/Kconfig
        @@ -51,6 +51,11 @@ config HAS_SCIF

         config HAS_EHCI
                bool
        +
        +config EHCI
        +       bool "EHCI debug port" if EXPERT = "y"
        +       default y
        +       depends on HAS_EHCI
                help
                  This selects the USB based EHCI debug port to be used
        as a UART. If
                  you have an x86 based system with USB, say Y.
        diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
        index 0afadaf..40c193b 100644
        --- a/xen/drivers/char/Makefile
        +++ b/xen/drivers/char/Makefile
        @@ -5,6 +5,6 @@ obj-$(CONFIG_HAS_PL011) += pl011.o
         obj-$(CONFIG_HAS_EXYNOS4210) += exynos4210-uart.o
         obj-$(CONFIG_HAS_OMAP) += omap-uart.o
         obj-$(CONFIG_HAS_SCIF) += scif-uart.o
        -obj-$(CONFIG_HAS_EHCI) += ehci-dbgp.o
        +obj-$(CONFIG_EHCI) += ehci-dbgp.o
         obj-$(CONFIG_ARM) += arm-uart.o
         obj-y += serial.o
        diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
        index 46edff8..5c6cbe9 100644
        --- a/xen/include/xen/serial.h
        +++ b/xen/include/xen/serial.h
        @@ -174,11 +174,17 @@ void ns16550_init(int index, struct
        ns16550_defaults *defaults);
         static inline void ns16550_init(int index, struct
        ns16550_defaults *defaults) {}
         #endif

        -void ehci_dbgp_init(void);
        -void arm_uart_init(void);


    Why did you move arm_uart_init? It does not seem related to this
    patch...
Quoted 3 lines

I moved the EHCI code above the arm_uart_init since ehci_dbgp_init preceded the arm code originally, but I can certainly move the ECHI declarations after if you'd prefer.

I don't think we ever ordered code in the header files based on the addition date. In general, we try to minimize the changes to make the patch simpler and avoid been distract by meaningless things.

Anyway, I am not the maintainers of this code. So I will let Andrew and Jan deciding.

Regards,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#5 lore raw

Re: [PATCH v2 2/2] x86: add a user configurable Kconfig option for the EHCI debug port

Quoted 3 lines
Quoted 1 line
Quoted 1 line · On 20.09.16 at 09:42, <[email protected]> wrote:

Anyway, I am not the maintainers of this code. So I will let Andrew and Jan deciding.

I'm in general against needless moving around of code, but for the one line in question here I don't think it matters all that much where exactly it lives.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#6 lore raw

Re: [PATCH v2 2/2] x86: add a user configurable Kconfig option for the EHCI debug port

In reply to Julien Grall
Quoted 74 lines · Derek Straka
Quoted 69 lines

On Mon, Sep 19, 2016 at 10:56 AM, Julien Grall <[email protected] <mailto:[email protected]>> wrote:

    On 19/09/2016 16:51, Derek Straka wrote:

        Allows for the conditional inclusion of EHCI debug port driver
        on the x86
        platform rather than having it always enabled.

        The default configuration for the CONFIG_EHCI option remains 'y'
        on x86, so the
        behavior out of the box remains unchanged.  The addition of the
        option allows
        advanced users to enable/disable the inclusion of the EHCI debug
        port driver.

        Signed-off-by: Derek Straka <[email protected] 
        <mailto:[email protected]>>
        ---
         xen/drivers/char/Kconfig  |  5 +++++
         xen/drivers/char/Makefile |  2 +-
         xen/include/xen/serial.h  | 12 +++++++++---
         3 files changed, 15 insertions(+), 4 deletions(-)

        diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig
        index 1d894a7..1c5400f 100644
        --- a/xen/drivers/char/Kconfig
        +++ b/xen/drivers/char/Kconfig
        @@ -51,6 +51,11 @@ config HAS_SCIF

         config HAS_EHCI
                bool
        +
        +config EHCI
        +       bool "EHCI debug port" if EXPERT = "y"
        +       default y
        +       depends on HAS_EHCI
                help
                  This selects the USB based EHCI debug port to be used
        as a UART. If
                  you have an x86 based system with USB, say Y.
        diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
        index 0afadaf..40c193b 100644
        --- a/xen/drivers/char/Makefile
        +++ b/xen/drivers/char/Makefile
        @@ -5,6 +5,6 @@ obj-$(CONFIG_HAS_PL011) += pl011.o
         obj-$(CONFIG_HAS_EXYNOS4210) += exynos4210-uart.o
         obj-$(CONFIG_HAS_OMAP) += omap-uart.o
         obj-$(CONFIG_HAS_SCIF) += scif-uart.o
        -obj-$(CONFIG_HAS_EHCI) += ehci-dbgp.o
        +obj-$(CONFIG_EHCI) += ehci-dbgp.o
         obj-$(CONFIG_ARM) += arm-uart.o
         obj-y += serial.o
        diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
        index 46edff8..5c6cbe9 100644
        --- a/xen/include/xen/serial.h
        +++ b/xen/include/xen/serial.h
        @@ -174,11 +174,17 @@ void ns16550_init(int index, struct
        ns16550_defaults *defaults);
         static inline void ns16550_init(int index, struct
        ns16550_defaults *defaults) {}
         #endif

        -void ehci_dbgp_init(void);
        -void arm_uart_init(void);


    Why did you move arm_uart_init? It does not seem related to this
    patch...
Quoted 3 lines

I moved the EHCI code above the arm_uart_init since ehci_dbgp_init preceded the arm code originally, but I can certainly move the ECHI declarations after if you'd prefer.

Quoted 6 lines

I don't think we ever ordered code in the header files based on the addition date. In general, we try to minimize the changes to make the patch simpler and avoid been distract by meaningless things.

Anyway, I am not the maintainers of this code. So I will let Andrew and Jan deciding.

Having looked a second time, I actually prefer the movement: I consider it sub-optimal for arm_uart_init() to originally have got placed in the middle between the two dbgp declarations.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#7 lore raw

Re: [PATCH v2 2/2] x86: add a user configurable Kconfig option for the EHCI debug port

In reply to Derek Straka

xen/drivers/char/Kconfig config HAS_SCIF · line 58

Quoted 12 lines
Quoted 1 line
Quoted 1 line · On 19.09.16 at 16:51, <[email protected]> wrote:
xen/drivers/char/Kconfig +5 -0
@@ -51,6 +51,11 @@ config HAS_SCIF
 
 config HAS_EHCI
 	bool
+
+config EHCI
+	bool "EHCI debug port" if EXPERT = "y"
+	default y
+	depends on HAS_EHCI

While here HAS_EHCI doesn't get left completely useless, I'd still prefer for it to be dropped, and the select(s) converted to ordinary dependencies put here. Also please name the variable e.g. EHCI_DBGP, as there's no full EHCI support in Xen (this was not really of interest for HAS_EHCI).

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#8 lore raw
In reply to Derek Straka
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 19.09.16 at 16:51, <[email protected]> wrote:

xen/drivers/char/Kconfig line 10

Quoted 10 lines
xen/drivers/char/Kconfig +5 -0
@@ -1,6 +1,11 @@
 config HAS_NS16550
 	bool
 	default y
+
+config NS16550
+	bool "NS16550 UART" if EXPERT = "y"
+	default y
+	depends on HAS_NS16550
 	help
 	  This selects the 16550-series UART support. For most systems, say Y.

May I please ask to avoid sending new patch versions without fully taking care of earlier comments? I'm still missing the overview mail as indicated in reply to the VGA sibling of these two patches. And I did clearly say "rename" when talking about the aspects of HAS_* Kconfig variables - you're leaving HAS_NS16550 as a completely pointless variable around the way you've done it.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel