Skip to contentSkip to conversation

env: ti: boot: Use ttyS2 instead of ttyO2

PATCH New Sam Protsenko 3 participants 5 messages Jul 12, 2019 – Jul 28, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 env: ti: boot: Use ttyS2 instead of ttyO2

ttyO2 console enables legacy CONFIG_SERIAL_OMAP driver in kernel. Nowadays it's preferred to use the generic CONFIG_SERIAL_8250_OMAP driver, which being enabled via ttyS2 console. Both drivers are enabled in multi_v7_defconfig and in omap2plus_defconfig, for compatibility reasons. Let's switch to ttyS2 console, to be sure that standard 8250 serial driver is used.

Similar behavior can be also achieved by enabling CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP option in kernel, but it's better not to rely on that, as it can be disabled or removed after transitional period.

Right now on DRA7/AM57x platforms the 8250-omap driver is being probed first, and omap-serial driver is only probed if the first one failed. It can be seen from uart3 definition in arch/arm/boot/dts/dra7-l4.dtsi:

    compatible = "ti,dra742-uart", "ti,omap4-uart";

So the kernel already uses 8250 driver. This change basically allows kernel developers to throw away the omap-serial driver and associated compatibility options. Similar discussions [1,2] have started several years ago, so it should be safe to do that now.

[1] https://patchwork.kernel.org/patch/6198471/
[2] http://processors.wiki.ti.com/index.php/Sitara_Linux_UART_-_Switching_to_8250_Driver

---
Changes in v2:
- use ttyS also in AM57x EVM and in DRA7xx EVM configs

 include/configs/am57xx_evm.h  | 2 +-
 include/configs/dra7xx_evm.h  | 4 ++--
 include/environment/ti/boot.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
include/configs/am57xx_evm.h +1 -1
index 45fd21878c..e181b30564 100644
@@ -24,7 +24,7 @@
 
 #define CONFIG_SYS_BOOTM_LEN		SZ_64M
 
-#define CONSOLEDEV			"ttyO2"
+#define CONSOLEDEV			"ttyS2"
 #define CONFIG_SYS_NS16550_COM1		UART1_BASE	/* Base EVM has UART0 */
 #define CONFIG_SYS_NS16550_COM2		UART2_BASE	/* UART2 */
 #define CONFIG_SYS_NS16550_COM3		UART3_BASE	/* UART3 */
include/configs/dra7xx_evm.h +2 -2
index 9c8141de2e..7ec6e691c7 100644
@@ -26,9 +26,9 @@
 #endif
 
 #if (CONFIG_CONS_INDEX == 1)
-#define CONSOLEDEV			"ttyO0"
+#define CONSOLEDEV			"ttyS0"
 #elif (CONFIG_CONS_INDEX == 3)
-#define CONSOLEDEV			"ttyO2"
+#define CONSOLEDEV			"ttyS2"
 #endif
 #define CONFIG_SYS_NS16550_COM1		UART1_BASE	/* Base EVM has UART0 */
 #define CONFIG_SYS_NS16550_COM2		UART2_BASE	/* UART2 */
include/environment/ti/boot.h +1 -1
index 01b2981c5b..22206b9467 100644
@@ -10,7 +10,7 @@
 #define __TI_BOOT_H
 
 #ifndef CONSOLEDEV
-#define CONSOLEDEV "ttyO2"
+#define CONSOLEDEV "ttyS2"
 #endif
 
 #define VBMETA_PART_SIZE		(64 * 1024)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 env: ti: boot: Use ttyS2 instead of ttyO2

Quoted 54 lines · Sam Protsenko

ttyO2 console enables legacy CONFIG_SERIAL_OMAP driver in kernel. Nowadays it's preferred to use the generic CONFIG_SERIAL_8250_OMAP driver, which being enabled via ttyS2 console. Both drivers are enabled in multi_v7_defconfig and in omap2plus_defconfig, for compatibility reasons. Let's switch to ttyS2 console, to be sure that standard 8250 serial driver is used.

Similar behavior can be also achieved by enabling CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP option in kernel, but it's better not to rely on that, as it can be disabled or removed after transitional period.

Right now on DRA7/AM57x platforms the 8250-omap driver is being probed first, and omap-serial driver is only probed if the first one failed. It can be seen from uart3 definition in arch/arm/boot/dts/dra7-l4.dtsi:

    compatible = "ti,dra742-uart", "ti,omap4-uart";

So the kernel already uses 8250 driver. This change basically allows kernel developers to throw away the omap-serial driver and associated compatibility options. Similar discussions [1,2] have started several years ago, so it should be safe to do that now.

[1] https://patchwork.kernel.org/patch/6198471/
[2] http://processors.wiki.ti.com/index.php/Sitara_Linux_UART_-_Switching_to_8250_Driver

---
Changes in v2:
- use ttyS also in AM57x EVM and in DRA7xx EVM configs

 include/configs/am57xx_evm.h  | 2 +-
 include/configs/dra7xx_evm.h  | 4 ++--
 include/environment/ti/boot.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
include/configs/am57xx_evm.h +1 -1
index 45fd21878c..e181b30564 100644
@@ -24,7 +24,7 @@
 
 #define CONFIG_SYS_BOOTM_LEN		SZ_64M
 
-#define CONSOLEDEV			"ttyO2"
+#define CONSOLEDEV			"ttyS2"
 #define CONFIG_SYS_NS16550_COM1		UART1_BASE	/* Base EVM has UART0 */
 #define CONFIG_SYS_NS16550_COM2		UART2_BASE	/* UART2 */
 #define CONFIG_SYS_NS16550_COM3		UART3_BASE	/* UART3 */
include/configs/dra7xx_evm.h +0 -0
index 9c8141de2e..7ec6e691c7 100644

include/configs/dra7xx_evm.h line 28

Quoted 3 lines
include/configs/dra7xx_evm.h +0 -0
@@ -26,9 +26,9 @@
 #endif
 
 #if (CONFIG_CONS_INDEX == 1)

This CONFIG_CONS_INDEX is not enabled for this platform, meaning the non-default console is chosen by default, it's not caused by this patch but while you are here could you fix that up?

Just set:

#define CONSOLEDEV "ttyS0"

and drop all the #ifdef stuff, makes things a bit more clean. (and prevents a conflict with a patch I was going to send for the same)

Andrew

Quoted 22 lines
include/configs/dra7xx_evm.h +2 -2
-#define CONSOLEDEV			"ttyO0"
+#define CONSOLEDEV			"ttyS0"
 #elif (CONFIG_CONS_INDEX == 3)
-#define CONSOLEDEV			"ttyO2"
+#define CONSOLEDEV			"ttyS2"
 #endif
 #define CONFIG_SYS_NS16550_COM1		UART1_BASE	/* Base EVM has UART0 */
 #define CONFIG_SYS_NS16550_COM2		UART2_BASE	/* UART2 */
include/environment/ti/boot.h +1 -1
index 01b2981c5b..22206b9467 100644
@@ -10,7 +10,7 @@
 #define __TI_BOOT_H
 
 #ifndef CONSOLEDEV
-#define CONSOLEDEV "ttyO2"
+#define CONSOLEDEV "ttyS2"
 #endif
 
 #define VBMETA_PART_SIZE		(64 * 1024)
#2 lore raw

PATCH 1/1 env: ti: boot: Use ttyS2 instead of ttyO2

Hi Andrew,

Quoted 64 lines · Andrew F. Davis
Quoted 54 lines · Sam Protsenko

ttyO2 console enables legacy CONFIG_SERIAL_OMAP driver in kernel. Nowadays it's preferred to use the generic CONFIG_SERIAL_8250_OMAP driver, which being enabled via ttyS2 console. Both drivers are enabled in multi_v7_defconfig and in omap2plus_defconfig, for compatibility reasons. Let's switch to ttyS2 console, to be sure that standard 8250 serial driver is used.

Similar behavior can be also achieved by enabling CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP option in kernel, but it's better not to rely on that, as it can be disabled or removed after transitional period.

Right now on DRA7/AM57x platforms the 8250-omap driver is being probed first, and omap-serial driver is only probed if the first one failed. It can be seen from uart3 definition in arch/arm/boot/dts/dra7-l4.dtsi:

    compatible = "ti,dra742-uart", "ti,omap4-uart";

So the kernel already uses 8250 driver. This change basically allows kernel developers to throw away the omap-serial driver and associated compatibility options. Similar discussions [1,2] have started several years ago, so it should be safe to do that now.

[1] https://patchwork.kernel.org/patch/6198471/
[2] http://processors.wiki.ti.com/index.php/Sitara_Linux_UART_-_Switching_to_8250_Driver

---
Changes in v2:
- use ttyS also in AM57x EVM and in DRA7xx EVM configs

 include/configs/am57xx_evm.h  | 2 +-
 include/configs/dra7xx_evm.h  | 4 ++--
 include/environment/ti/boot.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
include/configs/am57xx_evm.h +1 -1
index 45fd21878c..e181b30564 100644
@@ -24,7 +24,7 @@
 
 #define CONFIG_SYS_BOOTM_LEN         SZ_64M
 
-#define CONSOLEDEV                   "ttyO2"
+#define CONSOLEDEV                   "ttyS2"
 #define CONFIG_SYS_NS16550_COM1              UART1_BASE      /* Base EVM has UART0 */
 #define CONFIG_SYS_NS16550_COM2              UART2_BASE      /* UART2 */
 #define CONFIG_SYS_NS16550_COM3              UART3_BASE      /* UART3 */
include/configs/dra7xx_evm.h +0 -0
index 9c8141de2e..7ec6e691c7 100644

include/configs/dra7xx_evm.h line 28

Quoted 3 lines
include/configs/dra7xx_evm.h +0 -0
@@ -26,9 +26,9 @@
 #endif
 
 #if (CONFIG_CONS_INDEX == 1)

This CONFIG_CONS_INDEX is not enabled for this platform, meaning the non-default console is chosen by default, it's not caused by this patch but while you are here could you fix that up?

Quoted 7 lines

Just set:

#define CONSOLEDEV "ttyS0"

and drop all the #ifdef stuff, makes things a bit more clean. (and prevents a conflict with a patch I was going to send for the same)

It's not that simple. Please look at commits [1,2]. Seems like that #if selector you mentioned was implemented for a reason and serves the purpose of using uart3, chosen via menuconfig, for UART boot mode. I suggest we keep this patch as is, I really want it to be an atomical change, as it's a big change as it is. If you still want to remove that #if and only leave ttyS0, it can be done in the separate patch, mentioning [1,2] and explaining, why do we want to get rid of UART boot feature for DRA7.

So if you are ok with my reasoning, please add your R-b tag here.

Thanks!

[1] https://gitlab.denx.de/u-boot/u-boot/commit/a13cbf5f208b59797d08199604f2701b6c3b9f64
[2] https://gitlab.denx.de/u-boot/u-boot/commit/cfd921f7cc8cb54320e2b2ac4dc9ec13fc4f96c3

Quoted 24 lines

Andrew

Quoted 22 lines
include/configs/dra7xx_evm.h +2 -2
-#define CONSOLEDEV                   "ttyO0"
+#define CONSOLEDEV                   "ttyS0"
 #elif (CONFIG_CONS_INDEX == 3)
-#define CONSOLEDEV                   "ttyO2"
+#define CONSOLEDEV                   "ttyS2"
 #endif
 #define CONFIG_SYS_NS16550_COM1              UART1_BASE      /* Base EVM has UART0 */
 #define CONFIG_SYS_NS16550_COM2              UART2_BASE      /* UART2 */
include/environment/ti/boot.h +1 -1
index 01b2981c5b..22206b9467 100644
@@ -10,7 +10,7 @@
 #define __TI_BOOT_H
 
 #ifndef CONSOLEDEV
-#define CONSOLEDEV "ttyO2"
+#define CONSOLEDEV "ttyS2"
 #endif
 
 #define VBMETA_PART_SIZE             (64 * 1024)
#3 lore raw

PATCH 1/1 env: ti: boot: Use ttyS2 instead of ttyO2

Quoted 84 lines · Sam Protsenko

Hi Andrew,

Quoted 64 lines · Andrew F. Davis
Quoted 54 lines · Sam Protsenko

ttyO2 console enables legacy CONFIG_SERIAL_OMAP driver in kernel. Nowadays it's preferred to use the generic CONFIG_SERIAL_8250_OMAP driver, which being enabled via ttyS2 console. Both drivers are enabled in multi_v7_defconfig and in omap2plus_defconfig, for compatibility reasons. Let's switch to ttyS2 console, to be sure that standard 8250 serial driver is used.

Similar behavior can be also achieved by enabling CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP option in kernel, but it's better not to rely on that, as it can be disabled or removed after transitional period.

Right now on DRA7/AM57x platforms the 8250-omap driver is being probed first, and omap-serial driver is only probed if the first one failed. It can be seen from uart3 definition in arch/arm/boot/dts/dra7-l4.dtsi:

    compatible = "ti,dra742-uart", "ti,omap4-uart";

So the kernel already uses 8250 driver. This change basically allows kernel developers to throw away the omap-serial driver and associated compatibility options. Similar discussions [1,2] have started several years ago, so it should be safe to do that now.

[1] https://patchwork.kernel.org/patch/6198471/
[2] http://processors.wiki.ti.com/index.php/Sitara_Linux_UART_-_Switching_to_8250_Driver

---
Changes in v2:
- use ttyS also in AM57x EVM and in DRA7xx EVM configs

 include/configs/am57xx_evm.h  | 2 +-
 include/configs/dra7xx_evm.h  | 4 ++--
 include/environment/ti/boot.h | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
include/configs/am57xx_evm.h +1 -1
index 45fd21878c..e181b30564 100644
@@ -24,7 +24,7 @@
 
 #define CONFIG_SYS_BOOTM_LEN         SZ_64M
 
-#define CONSOLEDEV                   "ttyO2"
+#define CONSOLEDEV                   "ttyS2"
 #define CONFIG_SYS_NS16550_COM1              UART1_BASE      /* Base EVM has UART0 */
 #define CONFIG_SYS_NS16550_COM2              UART2_BASE      /* UART2 */
 #define CONFIG_SYS_NS16550_COM3              UART3_BASE      /* UART3 */
include/configs/dra7xx_evm.h +0 -0
index 9c8141de2e..7ec6e691c7 100644

include/configs/dra7xx_evm.h line 28

Quoted 3 lines
include/configs/dra7xx_evm.h +0 -0
@@ -26,9 +26,9 @@
 #endif
 
 #if (CONFIG_CONS_INDEX == 1)

This CONFIG_CONS_INDEX is not enabled for this platform, meaning the non-default console is chosen by default, it's not caused by this patch but while you are here could you fix that up?

Quoted 7 lines

Just set:

#define CONSOLEDEV "ttyS0"

and drop all the #ifdef stuff, makes things a bit more clean. (and prevents a conflict with a patch I was going to send for the same)

It's not that simple. Please look at commits [1,2]. Seems like that #if selector you mentioned was implemented for a reason and serves the purpose of using uart3, chosen via menuconfig, for UART boot mode. I suggest we keep this patch as is, I really want it to be an atomical change, as it's a big change as it is. If you still want to remove that #if and only leave ttyS0, it can be done in the separate patch, mentioning [1,2] and explaining, why do we want to get rid of UART boot feature for DRA7.

Quoted 1 line

So if you are ok with my reasoning, please add your R-b tag here.

A DRA7x EVM using UART2 doesn't exist, no reason to support it anymore than a AM57x with UART5 wired out.

But it can be a separate patch, this patch as-is:

Quoted 30 lines

Thanks!

[1] https://gitlab.denx.de/u-boot/u-boot/commit/a13cbf5f208b59797d08199604f2701b6c3b9f64
[2] https://gitlab.denx.de/u-boot/u-boot/commit/cfd921f7cc8cb54320e2b2ac4dc9ec13fc4f96c3

Quoted 24 lines

Andrew

Quoted 22 lines
include/configs/dra7xx_evm.h +2 -2
-#define CONSOLEDEV                   "ttyO0"
+#define CONSOLEDEV                   "ttyS0"
 #elif (CONFIG_CONS_INDEX == 3)
-#define CONSOLEDEV                   "ttyO2"
+#define CONSOLEDEV                   "ttyS2"
 #endif
 #define CONFIG_SYS_NS16550_COM1              UART1_BASE      /* Base EVM has UART0 */
 #define CONFIG_SYS_NS16550_COM2              UART2_BASE      /* UART2 */
include/environment/ti/boot.h +1 -1
index 01b2981c5b..22206b9467 100644
@@ -10,7 +10,7 @@
 #define __TI_BOOT_H
 
 #ifndef CONSOLEDEV
-#define CONSOLEDEV "ttyO2"
+#define CONSOLEDEV "ttyS2"
 #endif
 
 #define VBMETA_PART_SIZE             (64 * 1024)
#4 lore raw

PATCH 1/1 env: ti: boot: Use ttyS2 instead of ttyO2

In reply to Sam Protsenko
Quoted 23 lines · Sam Protsenko

ttyO2 console enables legacy CONFIG_SERIAL_OMAP driver in kernel. Nowadays it's preferred to use the generic CONFIG_SERIAL_8250_OMAP driver, which being enabled via ttyS2 console. Both drivers are enabled in multi_v7_defconfig and in omap2plus_defconfig, for compatibility reasons. Let's switch to ttyS2 console, to be sure that standard 8250 serial driver is used.

Similar behavior can be also achieved by enabling CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP option in kernel, but it's better not to rely on that, as it can be disabled or removed after transitional period.

Right now on DRA7/AM57x platforms the 8250-omap driver is being probed first, and omap-serial driver is only probed if the first one failed. It can be seen from uart3 definition in arch/arm/boot/dts/dra7-l4.dtsi:

    compatible = "ti,dra742-uart", "ti,omap4-uart";

So the kernel already uses 8250 driver. This change basically allows kernel developers to throw away the omap-serial driver and associated compatibility options. Similar discussions [1,2] have started several years ago, so it should be safe to do that now.

Quoted 5 lines

[1] https://patchwork.kernel.org/patch/6198471/
[2] http://processors.wiki.ti.com/index.php/Sitara_Linux_UART_-_Switching_to_8250_Driver

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190728/87a945e7/attachment.sig>