diff mbox

[LEDE-DEV] Problem with console without console=ttyS0 bootarg

Message ID 4e14b82f-4c6d-3ca5-70fc-fb2c787c2189@gmail.com
State RFC
Headers show

Commit Message

Rafał Miłecki March 14, 2017, 6:37 a.m. UTC
My current DTS file contains following entry:
bootargs = "console=ttyS0,115200"
and it works in a following way:

Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    9.320212] procd: - early -
[    9.323174] procd: - watchdog -
[    9.924724] procd: - ubus -
[    9.986055] procd: - init -
Please press Enter to activate this console.

Comments

Rafał Miłecki May 21, 2017, 8:22 p.m. UTC | #1
On 14 March 2017 at 07:37, Rafał Miłecki <zajec5@gmail.com> wrote:
> My current DTS file contains following entry:
> bootargs = "console=ttyS0,115200"
> and it works in a following way:
>
> Press the [f] key and hit [enter] to enter failsafe mode
> Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
> [    9.320212] procd: - early -
> [    9.323174] procd: - watchdog -
> [    9.924724] procd: - ubus -
> [    9.986055] procd: - init -
> Please press Enter to activate this console.
> === WARNING! =====================================
> There is no root password defined on this device!
> Use the "passwd" command to set up a new password
> in order to prevent unauthorized SSH logins.
> --------------------------------------------------
> root@LEDE:/#
>
>
>
> If I enable "ttylogin" in /etc/config/system it works quite similarly (just
> asks for a login):
>
> Press the [f] key and hit [enter] to enter failsafe mode
> Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
> [    9.362481] procd: - early -
> [    9.365550] procd: - watchdog -
> [    9.983522] procd: - ubus -
> [   10.044877] procd: - init -
> Please press Enter to activate this console.
> LEDE login:
> LEDE login: root
> === WARNING! =====================================
> There is no root password defined on this device!
> Use the "passwd" command to set up a new password
> in order to prevent unauthorized SSH logins.
> --------------------------------------------------
> root@LEDE:~#
>
>
> My problem appears when I drop bootargs and use:
> stdout-path = "/chipcommonA/serial@0300:115200";
> instead (which is a non-deprecated DTS solution).
> In such case I can't login anymore:
>
> Press the [f] key and hit [enter] to enter failsafe mode
> Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
> [    9.340180] procd: - early -
> [    9.343141] procd: - watchdog -
> [    9.944758] procd: - ubus -
> [   10.006092] procd: - init -
>
>
> Do you know what's the reason for this? Can we have a proper console support
> while using upstream preferred syntax for the stdout-path?
> Please note entering failsafe mode it not affected by this.

Since noone got idea how to handle this, I added workaround as for now
in commit 0a05fbd135663 ("bcm53xx: add support for TP-LINK Archer C5
V2")
https://git.lede-project.org/?p=source.git;a=commit;h=0a05fbd1356631a1f903adcd63ffb05550537667

You can find it in the 320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch
diff mbox

Patch

=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@LEDE:/#



If I enable "ttylogin" in /etc/config/system it works quite similarly (just asks for a login):

Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    9.362481] procd: - early -
[    9.365550] procd: - watchdog -
[    9.983522] procd: - ubus -
[   10.044877] procd: - init -
Please press Enter to activate this console.
LEDE login:
LEDE login: root
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@LEDE:~#


My problem appears when I drop bootargs and use:
stdout-path = "/chipcommonA/serial@0300:115200";
instead (which is a non-deprecated DTS solution).
In such case I can't login anymore:

Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    9.340180] procd: - early -
[    9.343141] procd: - watchdog -
[    9.944758] procd: - ubus -
[   10.006092] procd: - init -


Do you know what's the reason for this? Can we have a proper console support
while using upstream preferred syntax for the stdout-path?
Please note entering failsafe mode it not affected by this.
I'm also attaching a diff switching to alias + stdout-path.

diff --git a/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts b/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts
index 36b628b..a5442a9 100644
--- a/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts
+++ b/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts
@@ -17,7 +17,7 @@ 
  	model = "SmartRG SR400ac";

  	chosen {
-		bootargs = "console=ttyS0,115200 earlycon";
+		bootargs = "earlycon";
  	};

  	memory {
diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
index 4fbb089..5a9fa3e 100644
--- a/arch/arm/boot/dts/bcm5301x.dtsi
+++ b/arch/arm/boot/dts/bcm5301x.dtsi
@@ -18,8 +18,12 @@ 
  / {
  	interrupt-parent = <&gic>;

+	aliases {
+		serial0 = &uart0;
+	};
+
  	chosen {
-		stdout-path = &uart0;
+		stdout-path = "serial0:115200n8";
  	};

  	chipcommonA {