All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-rockchip][PATCH] trusted-firmware-a: use 1500000 baud for serial console
@ 2021-04-06 23:47 Yann Dirson
  2021-04-07  4:07 ` [yocto] " Zoran
  2021-04-07 13:27 ` Joshua Watt
  0 siblings, 2 replies; 6+ messages in thread
From: Yann Dirson @ 2021-04-06 23:47 UTC (permalink / raw)
  To: yocto; +Cc: twoerner, Yann Dirson

From: Yann Dirson <yann@blade-group.com>

TF-A runs between two u-boot stages which both uses 1500000 baud, it
just makes no sense to use the same UART at a different rate.

Here is a sample session with the successive stages, with TF-A artificially
separated for emphasis:

 [20210406-175438.135934] U-Boot TPL 2021.01 (Jan 11 2021 - 18:11:43)
 [20210406-175438.135956] Channel 0: DDR3, 933MHz
 [20210406-175438.236974] BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
 [20210406-175438.237000] Channel 1: DDR3, 933MHz
 [20210406-175438.237004] BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
 [20210406-175438.237008] 256B stride
 [20210406-175438.237012] Trying to boot from BOOTROM
 [20210406-175438.237015] Returning to boot ROM...
 [20210406-175438.237018]
 [20210406-175438.573394] U-Boot SPL 2021.01 (Jan 11 2021 - 18:11:43 +0000)
 [20210406-175438.573431] Trying to boot from MMC1

 [20210406-175438.589254] NOTICE:  BL31: v2.3():v2.3-dirty
 [20210406-175440.534055] NOTICE:  BL31: Built : 15:56:43, Apr 20 2020

 [20210406-175441.393423] U-Boot 2021.01 (Jan 11 2021 - 18:11:43 +0000)
 [20210406-175441.393429]
 [20210406-175441.393433] SoC: Rockchip rk3399

Signed-off-by: Yann Dirson <yann@blade-group.com>
---
 .../files/serial-console-baudrate.patch       | 35 +++++++++++++++++++
 .../trusted-firmware-a_%.bbappend             |  5 +++
 2 files changed, 40 insertions(+)
 create mode 100644 recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch

diff --git a/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch b/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
new file mode 100644
index 0000000..10b5a2b
--- /dev/null
+++ b/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
@@ -0,0 +1,35 @@
+From 840d6b6420e1fd8cdf6e4de7fa58a6f8de151622 Mon Sep 17 00:00:00 2001
+From: Yann Dirson <yann@blade-group.com>
+Date: Tue, 6 Apr 2021 17:28:45 +0200
+Subject: [PATCH] Set serial console baudrate back to 1500000.
+
+TF-A runs between two u-boot stages which both uses 1500000 baud, it
+just makes no sense to use the same UART at a different rate.
+
+This effectively reverts part of 0c05748bdebfad9fa43a80962186438bb8fbce62.
+Main reason for that change stated in https://developer.trustedfirmware.org/T762
+is ChromeOS compatibility.
+
+Looks like this patch may become unnecessary in the future, when
+u-boot and TF-A get to communicate this value.
+
+---
+ plat/rockchip/rk3399/rk3399_def.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plat/rockchip/rk3399/rk3399_def.h b/plat/rockchip/rk3399/rk3399_def.h
+index ba83242eb..8d6ecfbe6 100644
+--- a/plat/rockchip/rk3399/rk3399_def.h
++++ b/plat/rockchip/rk3399/rk3399_def.h
+@@ -17,7 +17,7 @@
+ /**************************************************************************
+  * UART related constants
+  **************************************************************************/
+-#define RK3399_BAUDRATE			115200
++#define RK3399_BAUDRATE			1500000
+ #define RK3399_UART_CLOCK		24000000
+ 
+ /******************************************************************************
+-- 
+2.30.2
+
diff --git a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
index 442dee8..1942c17 100644
--- a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
+++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
@@ -4,3 +4,8 @@ DEPENDS_append_rk3399 = " virtual/arm-none-eabi-gcc-native"
 
 COMPATIBLE_MACHINE_append_rk3399 = "|rk3399"
 COMPATIBLE_MACHINE_append_rk3328 = "|rk3328"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI += "\
+    file://serial-console-baudrate.patch \
+"
-- 
2.30.2


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

* Re: [yocto] [meta-rockchip][PATCH] trusted-firmware-a: use 1500000 baud for serial console
  2021-04-06 23:47 [meta-rockchip][PATCH] trusted-firmware-a: use 1500000 baud for serial console Yann Dirson
@ 2021-04-07  4:07 ` Zoran
  2021-04-07  8:54   ` Yann Dirson
  2021-04-07 13:27 ` Joshua Watt
  1 sibling, 1 reply; 6+ messages in thread
From: Zoran @ 2021-04-07  4:07 UTC (permalink / raw)
  To: Yann Dirson; +Cc: Yocto Project, twoerner, Yann Dirson

> +-#define RK3399_BAUDRATE                       115200
> ++#define RK3399_BAUDRATE                       1500000
> + #define RK3399_UART_CLOCK             24000000

Interesting... For years (a few decades) everybody has used 115200 as
the standard setup for UART, as global definition.

Why suddenly somebody changed the UART baud rate to be non-standard?
From the speed point of view???

Don't think so.

Should U-Boot be adjusted to the standard baud rate of 115200 for RK3399?

My two cent addendum/thinking,
Zee
_______


On Wed, Apr 7, 2021 at 1:47 AM Yann Dirson <yann.dirson@blade-group.com> wrote:
>
> From: Yann Dirson <yann@blade-group.com>
>
> TF-A runs between two u-boot stages which both uses 1500000 baud, it
> just makes no sense to use the same UART at a different rate.
>
> Here is a sample session with the successive stages, with TF-A artificially
> separated for emphasis:
>
>  [20210406-175438.135934] U-Boot TPL 2021.01 (Jan 11 2021 - 18:11:43)
>  [20210406-175438.135956] Channel 0: DDR3, 933MHz
>  [20210406-175438.236974] BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
>  [20210406-175438.237000] Channel 1: DDR3, 933MHz
>  [20210406-175438.237004] BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
>  [20210406-175438.237008] 256B stride
>  [20210406-175438.237012] Trying to boot from BOOTROM
>  [20210406-175438.237015] Returning to boot ROM...
>  [20210406-175438.237018]
>  [20210406-175438.573394] U-Boot SPL 2021.01 (Jan 11 2021 - 18:11:43 +0000)
>  [20210406-175438.573431] Trying to boot from MMC1
>
>  [20210406-175438.589254] NOTICE:  BL31: v2.3():v2.3-dirty
>  [20210406-175440.534055] NOTICE:  BL31: Built : 15:56:43, Apr 20 2020
>
>  [20210406-175441.393423] U-Boot 2021.01 (Jan 11 2021 - 18:11:43 +0000)
>  [20210406-175441.393429]
>  [20210406-175441.393433] SoC: Rockchip rk3399
>
> Signed-off-by: Yann Dirson <yann@blade-group.com>
> ---
>  .../files/serial-console-baudrate.patch       | 35 +++++++++++++++++++
>  .../trusted-firmware-a_%.bbappend             |  5 +++
>  2 files changed, 40 insertions(+)
>  create mode 100644 recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
>
> diff --git a/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch b/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
> new file mode 100644
> index 0000000..10b5a2b
> --- /dev/null
> +++ b/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
> @@ -0,0 +1,35 @@
> +From 840d6b6420e1fd8cdf6e4de7fa58a6f8de151622 Mon Sep 17 00:00:00 2001
> +From: Yann Dirson <yann@blade-group.com>
> +Date: Tue, 6 Apr 2021 17:28:45 +0200
> +Subject: [PATCH] Set serial console baudrate back to 1500000.
> +
> +TF-A runs between two u-boot stages which both uses 1500000 baud, it
> +just makes no sense to use the same UART at a different rate.
> +
> +This effectively reverts part of 0c05748bdebfad9fa43a80962186438bb8fbce62.
> +Main reason for that change stated in https://developer.trustedfirmware.org/T762
> +is ChromeOS compatibility.
> +
> +Looks like this patch may become unnecessary in the future, when
> +u-boot and TF-A get to communicate this value.
> +
> +---
> + plat/rockchip/rk3399/rk3399_def.h | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/plat/rockchip/rk3399/rk3399_def.h b/plat/rockchip/rk3399/rk3399_def.h
> +index ba83242eb..8d6ecfbe6 100644
> +--- a/plat/rockchip/rk3399/rk3399_def.h
> ++++ b/plat/rockchip/rk3399/rk3399_def.h
> +@@ -17,7 +17,7 @@
> + /**************************************************************************
> +  * UART related constants
> +  **************************************************************************/
> +-#define RK3399_BAUDRATE                       115200
> ++#define RK3399_BAUDRATE                       1500000
> + #define RK3399_UART_CLOCK             24000000
> +
> + /******************************************************************************
> +--
> +2.30.2
> +
> diff --git a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> index 442dee8..1942c17 100644
> --- a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> +++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> @@ -4,3 +4,8 @@ DEPENDS_append_rk3399 = " virtual/arm-none-eabi-gcc-native"
>
>  COMPATIBLE_MACHINE_append_rk3399 = "|rk3399"
>  COMPATIBLE_MACHINE_append_rk3328 = "|rk3328"
> +
> +FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
> +SRC_URI += "\
> +    file://serial-console-baudrate.patch \
> +"
> --
> 2.30.2
>
>
> 
>

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

* Re: [yocto] [meta-rockchip][PATCH] trusted-firmware-a: use 1500000 baud for serial console
  2021-04-07  4:07 ` [yocto] " Zoran
@ 2021-04-07  8:54   ` Yann Dirson
  2021-04-07  9:33     ` Zoran
  0 siblings, 1 reply; 6+ messages in thread
From: Yann Dirson @ 2021-04-07  8:54 UTC (permalink / raw)
  To: Zoran Stojsavljevic; +Cc: Yocto Project, Trevor Woerner, Yann Dirson

Le mer. 7 avr. 2021 à 06:07, Zoran Stojsavljevic
<zoran.stojsavljevic@gmail.com> a écrit :
>
> > +-#define RK3399_BAUDRATE                       115200
> > ++#define RK3399_BAUDRATE                       1500000
> > + #define RK3399_UART_CLOCK             24000000
>
> Interesting... For years (a few decades) everybody has used 115200 as
> the standard setup for UART, as global definition.

Sure it is awkward when all tools have come to default to 115200, but then
is the situation so different form when we transitionned from, say, 9600 ?

> Why suddenly somebody changed the UART baud rate to be non-standard?
> From the speed point of view???
>
> Don't think so.

Hopefully someone from Rockchip will answer :)

> Should U-Boot be adjusted to the standard baud rate of 115200 for RK3399?

When working on this platform everyone now has his tools setup for 1500000,
because that's the vendor BSP settings.  Would we have good technical reasons
to switch back ?


>
> My two cent addendum/thinking,
> Zee
> _______
>
>
> On Wed, Apr 7, 2021 at 1:47 AM Yann Dirson <yann.dirson@blade-group.com> wrote:
> >
> > From: Yann Dirson <yann@blade-group.com>
> >
> > TF-A runs between two u-boot stages which both uses 1500000 baud, it
> > just makes no sense to use the same UART at a different rate.
> >
> > Here is a sample session with the successive stages, with TF-A artificially
> > separated for emphasis:
> >
> >  [20210406-175438.135934] U-Boot TPL 2021.01 (Jan 11 2021 - 18:11:43)
> >  [20210406-175438.135956] Channel 0: DDR3, 933MHz
> >  [20210406-175438.236974] BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
> >  [20210406-175438.237000] Channel 1: DDR3, 933MHz
> >  [20210406-175438.237004] BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
> >  [20210406-175438.237008] 256B stride
> >  [20210406-175438.237012] Trying to boot from BOOTROM
> >  [20210406-175438.237015] Returning to boot ROM...
> >  [20210406-175438.237018]
> >  [20210406-175438.573394] U-Boot SPL 2021.01 (Jan 11 2021 - 18:11:43 +0000)
> >  [20210406-175438.573431] Trying to boot from MMC1
> >
> >  [20210406-175438.589254] NOTICE:  BL31: v2.3():v2.3-dirty
> >  [20210406-175440.534055] NOTICE:  BL31: Built : 15:56:43, Apr 20 2020
> >
> >  [20210406-175441.393423] U-Boot 2021.01 (Jan 11 2021 - 18:11:43 +0000)
> >  [20210406-175441.393429]
> >  [20210406-175441.393433] SoC: Rockchip rk3399
> >
> > Signed-off-by: Yann Dirson <yann@blade-group.com>
> > ---
> >  .../files/serial-console-baudrate.patch       | 35 +++++++++++++++++++
> >  .../trusted-firmware-a_%.bbappend             |  5 +++
> >  2 files changed, 40 insertions(+)
> >  create mode 100644 recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
> >
> > diff --git a/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch b/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
> > new file mode 100644
> > index 0000000..10b5a2b
> > --- /dev/null
> > +++ b/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
> > @@ -0,0 +1,35 @@
> > +From 840d6b6420e1fd8cdf6e4de7fa58a6f8de151622 Mon Sep 17 00:00:00 2001
> > +From: Yann Dirson <yann@blade-group.com>
> > +Date: Tue, 6 Apr 2021 17:28:45 +0200
> > +Subject: [PATCH] Set serial console baudrate back to 1500000.
> > +
> > +TF-A runs between two u-boot stages which both uses 1500000 baud, it
> > +just makes no sense to use the same UART at a different rate.
> > +
> > +This effectively reverts part of 0c05748bdebfad9fa43a80962186438bb8fbce62.
> > +Main reason for that change stated in https://developer.trustedfirmware.org/T762
> > +is ChromeOS compatibility.
> > +
> > +Looks like this patch may become unnecessary in the future, when
> > +u-boot and TF-A get to communicate this value.
> > +
> > +---
> > + plat/rockchip/rk3399/rk3399_def.h | 2 +-
> > + 1 file changed, 1 insertion(+), 1 deletion(-)
> > +
> > +diff --git a/plat/rockchip/rk3399/rk3399_def.h b/plat/rockchip/rk3399/rk3399_def.h
> > +index ba83242eb..8d6ecfbe6 100644
> > +--- a/plat/rockchip/rk3399/rk3399_def.h
> > ++++ b/plat/rockchip/rk3399/rk3399_def.h
> > +@@ -17,7 +17,7 @@
> > + /**************************************************************************
> > +  * UART related constants
> > +  **************************************************************************/
> > +-#define RK3399_BAUDRATE                       115200
> > ++#define RK3399_BAUDRATE                       1500000
> > + #define RK3399_UART_CLOCK             24000000
> > +
> > + /******************************************************************************
> > +--
> > +2.30.2
> > +
> > diff --git a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> > index 442dee8..1942c17 100644
> > --- a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> > +++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> > @@ -4,3 +4,8 @@ DEPENDS_append_rk3399 = " virtual/arm-none-eabi-gcc-native"
> >
> >  COMPATIBLE_MACHINE_append_rk3399 = "|rk3399"
> >  COMPATIBLE_MACHINE_append_rk3328 = "|rk3328"
> > +
> > +FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
> > +SRC_URI += "\
> > +    file://serial-console-baudrate.patch \
> > +"
> > --
> > 2.30.2
> >
> >
> > 
> >



-- 
Yann Dirson <yann@blade-group.com>
Blade / Shadow -- http://shadow.tech

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

* Re: [yocto] [meta-rockchip][PATCH] trusted-firmware-a: use 1500000 baud for serial console
  2021-04-07  8:54   ` Yann Dirson
@ 2021-04-07  9:33     ` Zoran
  0 siblings, 0 replies; 6+ messages in thread
From: Zoran @ 2021-04-07  9:33 UTC (permalink / raw)
  To: Yann Dirson; +Cc: Yocto Project, Trevor Woerner, Yann Dirson

> Sure it is awkward when all tools have come to default
> to 115200, but then is the situation so different from
> when we transitioned from, say, 9600?

These are historical reasons. It started as 600, 1200, then quickly
jumped to 9600 (4x), stayed some time there, and then transitioned via
19600 to final 115200. But I also see baud rates of 57600.

115200/9600 = 12 The serial speed transmission was the issue here.

> Hopefully someone from Rockchip will answer :)

Could not agree more with you on the statement. Hopefully! ;)

> When working on this platform everyone now has his tools setup
> for 1500000, because that's the vendor BSP settings.  Would we
> have good technical reasons to switch back ?

Since most of them use 115200. And clock divisors are adjusted to that
baud rate, my best guess.

Maybe the reason for that is that the base clocking tree frequency for
Rockchip could not derive 115200, rather 150000?!

Zee
_______

On Wed, Apr 7, 2021 at 10:55 AM Yann Dirson <yann.dirson@blade-group.com> wrote:
>
> Le mer. 7 avr. 2021 à 06:07, Zoran Stojsavljevic
> <zoran.stojsavljevic@gmail.com> a écrit :
> >
> > > +-#define RK3399_BAUDRATE                       115200
> > > ++#define RK3399_BAUDRATE                       1500000
> > > + #define RK3399_UART_CLOCK             24000000
> >
> > Interesting... For years (a few decades) everybody has used 115200 as
> > the standard setup for UART, as global definition.
>
> Sure it is awkward when all tools have come to default to 115200, but then
> is the situation so different form when we transitionned from, say, 9600 ?
>
> > Why suddenly somebody changed the UART baud rate to be non-standard?
> > From the speed point of view???
> >
> > Don't think so.
>
> Hopefully someone from Rockchip will answer :)
>
> > Should U-Boot be adjusted to the standard baud rate of 115200 for RK3399?
>
> When working on this platform everyone now has his tools setup for 1500000,
> because that's the vendor BSP settings.  Would we have good technical reasons
> to switch back ?
>
>
> >
> > My two cent addendum/thinking,
> > Zee
> > _______
> >
> >
> > On Wed, Apr 7, 2021 at 1:47 AM Yann Dirson <yann.dirson@blade-group.com> wrote:
> > >
> > > From: Yann Dirson <yann@blade-group.com>
> > >
> > > TF-A runs between two u-boot stages which both uses 1500000 baud, it
> > > just makes no sense to use the same UART at a different rate.
> > >
> > > Here is a sample session with the successive stages, with TF-A artificially
> > > separated for emphasis:
> > >
> > >  [20210406-175438.135934] U-Boot TPL 2021.01 (Jan 11 2021 - 18:11:43)
> > >  [20210406-175438.135956] Channel 0: DDR3, 933MHz
> > >  [20210406-175438.236974] BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
> > >  [20210406-175438.237000] Channel 1: DDR3, 933MHz
> > >  [20210406-175438.237004] BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
> > >  [20210406-175438.237008] 256B stride
> > >  [20210406-175438.237012] Trying to boot from BOOTROM
> > >  [20210406-175438.237015] Returning to boot ROM...
> > >  [20210406-175438.237018]
> > >  [20210406-175438.573394] U-Boot SPL 2021.01 (Jan 11 2021 - 18:11:43 +0000)
> > >  [20210406-175438.573431] Trying to boot from MMC1
> > >
> > >  [20210406-175438.589254] NOTICE:  BL31: v2.3():v2.3-dirty
> > >  [20210406-175440.534055] NOTICE:  BL31: Built : 15:56:43, Apr 20 2020
> > >
> > >  [20210406-175441.393423] U-Boot 2021.01 (Jan 11 2021 - 18:11:43 +0000)
> > >  [20210406-175441.393429]
> > >  [20210406-175441.393433] SoC: Rockchip rk3399
> > >
> > > Signed-off-by: Yann Dirson <yann@blade-group.com>
> > > ---
> > >  .../files/serial-console-baudrate.patch       | 35 +++++++++++++++++++
> > >  .../trusted-firmware-a_%.bbappend             |  5 +++
> > >  2 files changed, 40 insertions(+)
> > >  create mode 100644 recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
> > >
> > > diff --git a/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch b/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
> > > new file mode 100644
> > > index 0000000..10b5a2b
> > > --- /dev/null
> > > +++ b/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
> > > @@ -0,0 +1,35 @@
> > > +From 840d6b6420e1fd8cdf6e4de7fa58a6f8de151622 Mon Sep 17 00:00:00 2001
> > > +From: Yann Dirson <yann@blade-group.com>
> > > +Date: Tue, 6 Apr 2021 17:28:45 +0200
> > > +Subject: [PATCH] Set serial console baudrate back to 1500000.
> > > +
> > > +TF-A runs between two u-boot stages which both uses 1500000 baud, it
> > > +just makes no sense to use the same UART at a different rate.
> > > +
> > > +This effectively reverts part of 0c05748bdebfad9fa43a80962186438bb8fbce62.
> > > +Main reason for that change stated in https://developer.trustedfirmware.org/T762
> > > +is ChromeOS compatibility.
> > > +
> > > +Looks like this patch may become unnecessary in the future, when
> > > +u-boot and TF-A get to communicate this value.
> > > +
> > > +---
> > > + plat/rockchip/rk3399/rk3399_def.h | 2 +-
> > > + 1 file changed, 1 insertion(+), 1 deletion(-)
> > > +
> > > +diff --git a/plat/rockchip/rk3399/rk3399_def.h b/plat/rockchip/rk3399/rk3399_def.h
> > > +index ba83242eb..8d6ecfbe6 100644
> > > +--- a/plat/rockchip/rk3399/rk3399_def.h
> > > ++++ b/plat/rockchip/rk3399/rk3399_def.h
> > > +@@ -17,7 +17,7 @@
> > > + /**************************************************************************
> > > +  * UART related constants
> > > +  **************************************************************************/
> > > +-#define RK3399_BAUDRATE                       115200
> > > ++#define RK3399_BAUDRATE                       1500000
> > > + #define RK3399_UART_CLOCK             24000000
> > > +
> > > + /******************************************************************************
> > > +--
> > > +2.30.2
> > > +
> > > diff --git a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> > > index 442dee8..1942c17 100644
> > > --- a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> > > +++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> > > @@ -4,3 +4,8 @@ DEPENDS_append_rk3399 = " virtual/arm-none-eabi-gcc-native"
> > >
> > >  COMPATIBLE_MACHINE_append_rk3399 = "|rk3399"
> > >  COMPATIBLE_MACHINE_append_rk3328 = "|rk3328"
> > > +
> > > +FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
> > > +SRC_URI += "\
> > > +    file://serial-console-baudrate.patch \
> > > +"
> > > --
> > > 2.30.2
> > >
> > >
> > > 
> > >
>
>
>
> --
> Yann Dirson <yann@blade-group.com>
> Blade / Shadow -- http://shadow.tech

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

* Re: [yocto] [meta-rockchip][PATCH] trusted-firmware-a: use 1500000 baud for serial console
  2021-04-06 23:47 [meta-rockchip][PATCH] trusted-firmware-a: use 1500000 baud for serial console Yann Dirson
  2021-04-07  4:07 ` [yocto] " Zoran
@ 2021-04-07 13:27 ` Joshua Watt
  2021-04-07 13:45   ` Trevor Woerner
  1 sibling, 1 reply; 6+ messages in thread
From: Joshua Watt @ 2021-04-07 13:27 UTC (permalink / raw)
  To: Yann Dirson, yocto; +Cc: twoerner, Yann Dirson

[-- Attachment #1: Type: text/plain, Size: 4284 bytes --]


On 4/6/21 6:47 PM, Yann Dirson wrote:
> From: Yann Dirson <yann@blade-group.com>
>
> TF-A runs between two u-boot stages which both uses 1500000 baud, it
> just makes no sense to use the same UART at a different rate.
>
> Here is a sample session with the successive stages, with TF-A artificially
> separated for emphasis:
>
>   [20210406-175438.135934] U-Boot TPL 2021.01 (Jan 11 2021 - 18:11:43)
>   [20210406-175438.135956] Channel 0: DDR3, 933MHz
>   [20210406-175438.236974] BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
>   [20210406-175438.237000] Channel 1: DDR3, 933MHz
>   [20210406-175438.237004] BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
>   [20210406-175438.237008] 256B stride
>   [20210406-175438.237012] Trying to boot from BOOTROM
>   [20210406-175438.237015] Returning to boot ROM...
>   [20210406-175438.237018]
>   [20210406-175438.573394] U-Boot SPL 2021.01 (Jan 11 2021 - 18:11:43 +0000)
>   [20210406-175438.573431] Trying to boot from MMC1
>
>   [20210406-175438.589254] NOTICE:  BL31: v2.3():v2.3-dirty
>   [20210406-175440.534055] NOTICE:  BL31: Built : 15:56:43, Apr 20 2020
>
>   [20210406-175441.393423] U-Boot 2021.01 (Jan 11 2021 - 18:11:43 +0000)
>   [20210406-175441.393429]
>   [20210406-175441.393433] SoC: Rockchip rk3399

Very good. TF-A should work "out of the box" in meta-rockchip, so I 
think changing it's baudrate to 1500000 makes sense at this point (at 
least until u-boot can pass the DTB)

>
> Signed-off-by: Yann Dirson <yann@blade-group.com>
> ---
>   .../files/serial-console-baudrate.patch       | 35 +++++++++++++++++++
>   .../trusted-firmware-a_%.bbappend             |  5 +++
>   2 files changed, 40 insertions(+)
>   create mode 100644 recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
>
> diff --git a/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch b/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
> new file mode 100644
> index 0000000..10b5a2b
> --- /dev/null
> +++ b/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
> @@ -0,0 +1,35 @@
> +From 840d6b6420e1fd8cdf6e4de7fa58a6f8de151622 Mon Sep 17 00:00:00 2001
> +From: Yann Dirson <yann@blade-group.com>
> +Date: Tue, 6 Apr 2021 17:28:45 +0200
> +Subject: [PATCH] Set serial console baudrate back to 1500000.
> +
> +TF-A runs between two u-boot stages which both uses 1500000 baud, it
> +just makes no sense to use the same UART at a different rate.
> +
> +This effectively reverts part of 0c05748bdebfad9fa43a80962186438bb8fbce62.
> +Main reason for that change stated in https://developer.trustedfirmware.org/T762
> +is ChromeOS compatibility.
> +
> +Looks like this patch may become unnecessary in the future, when
> +u-boot and TF-A get to communicate this value.

Please add Upstream-Status:


> +
> +---
> + plat/rockchip/rk3399/rk3399_def.h | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/plat/rockchip/rk3399/rk3399_def.h b/plat/rockchip/rk3399/rk3399_def.h
> +index ba83242eb..8d6ecfbe6 100644
> +--- a/plat/rockchip/rk3399/rk3399_def.h
> ++++ b/plat/rockchip/rk3399/rk3399_def.h
> +@@ -17,7 +17,7 @@
> + /**************************************************************************
> +  * UART related constants
> +  **************************************************************************/
> +-#define RK3399_BAUDRATE			115200
> ++#define RK3399_BAUDRATE			1500000
> + #define RK3399_UART_CLOCK		24000000
> +
> + /******************************************************************************
> +--
> +2.30.2
> +
> diff --git a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> index 442dee8..1942c17 100644
> --- a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> +++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> @@ -4,3 +4,8 @@ DEPENDS_append_rk3399 = " virtual/arm-none-eabi-gcc-native"
>   
>   COMPATIBLE_MACHINE_append_rk3399 = "|rk3399"
>   COMPATIBLE_MACHINE_append_rk3328 = "|rk3328"
> +
> +FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
> +SRC_URI += "\
> +    file://serial-console-baudrate.patch \
> +"
>
> 
>

[-- Attachment #2: Type: text/html, Size: 5364 bytes --]

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

* Re: [yocto] [meta-rockchip][PATCH] trusted-firmware-a: use 1500000 baud for serial console
  2021-04-07 13:27 ` Joshua Watt
@ 2021-04-07 13:45   ` Trevor Woerner
  0 siblings, 0 replies; 6+ messages in thread
From: Trevor Woerner @ 2021-04-07 13:45 UTC (permalink / raw)
  To: Joshua Watt; +Cc: Yann Dirson, Yocto discussion list, Yann Dirson

On Wed, Apr 7, 2021 at 9:27 AM Joshua Watt <jpewhacker@gmail.com> wrote:
> Please add Upstream-Status:

https://wiki.yoctoproject.org/wiki/Best_Known_Methods_(BKMs)_for_Package_Updating#Patch_Upstreaming

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

end of thread, other threads:[~2021-04-07 13:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 23:47 [meta-rockchip][PATCH] trusted-firmware-a: use 1500000 baud for serial console Yann Dirson
2021-04-07  4:07 ` [yocto] " Zoran
2021-04-07  8:54   ` Yann Dirson
2021-04-07  9:33     ` Zoran
2021-04-07 13:27 ` Joshua Watt
2021-04-07 13:45   ` Trevor Woerner

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.