* [meta-rockchip][PATCH v3] trusted-firmware-a: replace baudrate with the one specified in machine conf
@ 2021-12-17 11:30 Quentin Schulz
2021-12-17 17:54 ` Khem Raj
2021-12-17 18:11 ` Trevor Woerner
0 siblings, 2 replies; 3+ messages in thread
From: Quentin Schulz @ 2021-12-17 11:30 UTC (permalink / raw)
To: yocto; +Cc: twoerner, raj.khem, Quentin Schulz, Quentin Schulz
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Not all Rockchip boards have their console running at 1500000 baud in
U-Boot and the kernel. Such is the case for puma-haikou RK3399-based
SoM+Carrierboard.
In order to prepare for the addition of puma-haikou to meta-rockchip,
let's replace the baudrate in TF-A by the one defined in the machine
conf file in the RK_CONSOLE_BAUD variable.
Cc: Quentin Schulz <foss+yocto@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
.../files/serial-console-baudrate.patch | 36 -------------------
.../trusted-firmware-a_%.bbappend | 10 +++++-
2 files changed, 9 insertions(+), 37 deletions(-)
delete 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
deleted file mode 100644
index 2d6e9bf..0000000
--- a/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-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.
-Upstream-Status: Inappropriate[other]
-
-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 513cea1..31024ce 100644
--- a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
+++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
@@ -7,7 +7,6 @@ COMPATIBLE_MACHINE:append:rk3328 = "|rk3328"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += "\
- file://serial-console-baudrate.patch \
file://0001-dram-Fix-build-with-gcc-11.patch \
file://0001-plat_macros.S-Use-compatible-.asciz-asm-directive.patch \
file://0001-pmu-Do-not-mark-already-defined-functions-as-weak.patch \
@@ -19,3 +18,12 @@ SRC_URI += "\
# this needs fixing until then use gcc
TOOLCHAIN:rk3399 = "gcc"
+fixup_baudrate() {
+ :
+}
+
+fixup_baudrate:rk3399() {
+ sed -i "s/#define RK3399_BAUDRATE\s\+.*/#define RK3399_BAUDRATE ${RK_CONSOLE_BAUD}/" ${S}/plat/rockchip/rk3399/rk3399_def.h
+}
+
+do_patch[postfuncs] += "fixup_baudrate"
--
2.33.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [meta-rockchip][PATCH v3] trusted-firmware-a: replace baudrate with the one specified in machine conf
2021-12-17 11:30 [meta-rockchip][PATCH v3] trusted-firmware-a: replace baudrate with the one specified in machine conf Quentin Schulz
@ 2021-12-17 17:54 ` Khem Raj
2021-12-17 18:11 ` Trevor Woerner
1 sibling, 0 replies; 3+ messages in thread
From: Khem Raj @ 2021-12-17 17:54 UTC (permalink / raw)
To: Quentin Schulz; +Cc: Yocto-mailing-list, Trevor Woerner, Quentin Schulz
On Fri, Dec 17, 2021 at 3:31 AM Quentin Schulz <foss+yocto@0leil.net> wrote:
>
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> Not all Rockchip boards have their console running at 1500000 baud in
> U-Boot and the kernel. Such is the case for puma-haikou RK3399-based
> SoM+Carrierboard.
>
> In order to prepare for the addition of puma-haikou to meta-rockchip,
> let's replace the baudrate in TF-A by the one defined in the machine
> conf file in the RK_CONSOLE_BAUD variable.
>
> Cc: Quentin Schulz <foss+yocto@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
> .../files/serial-console-baudrate.patch | 36 -------------------
> .../trusted-firmware-a_%.bbappend | 10 +++++-
> 2 files changed, 9 insertions(+), 37 deletions(-)
> delete 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
> deleted file mode 100644
> index 2d6e9bf..0000000
> --- a/recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
> +++ /dev/null
> @@ -1,36 +0,0 @@
> -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.
> -Upstream-Status: Inappropriate[other]
> -
> -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 513cea1..31024ce 100644
> --- a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> +++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
> @@ -7,7 +7,6 @@ COMPATIBLE_MACHINE:append:rk3328 = "|rk3328"
>
> FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
> SRC_URI += "\
> - file://serial-console-baudrate.patch \
> file://0001-dram-Fix-build-with-gcc-11.patch \
> file://0001-plat_macros.S-Use-compatible-.asciz-asm-directive.patch \
> file://0001-pmu-Do-not-mark-already-defined-functions-as-weak.patch \
> @@ -19,3 +18,12 @@ SRC_URI += "\
> # this needs fixing until then use gcc
> TOOLCHAIN:rk3399 = "gcc"
>
> +fixup_baudrate() {
> + :
> +}
> +
> +fixup_baudrate:rk3399() {
> + sed -i "s/#define RK3399_BAUDRATE\s\+.*/#define RK3399_BAUDRATE ${RK_CONSOLE_BAUD}/" ${S}/plat/rockchip/rk3399/rk3399_def.h
> +}
> +
> +do_patch[postfuncs] += "fixup_baudrate"
lgtm. Thanks
> --
> 2.33.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [meta-rockchip][PATCH v3] trusted-firmware-a: replace baudrate with the one specified in machine conf
2021-12-17 11:30 [meta-rockchip][PATCH v3] trusted-firmware-a: replace baudrate with the one specified in machine conf Quentin Schulz
2021-12-17 17:54 ` Khem Raj
@ 2021-12-17 18:11 ` Trevor Woerner
1 sibling, 0 replies; 3+ messages in thread
From: Trevor Woerner @ 2021-12-17 18:11 UTC (permalink / raw)
To: Quentin Schulz; +Cc: yocto, raj.khem, Quentin Schulz
On Fri 2021-12-17 @ 12:30:47 PM, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> Not all Rockchip boards have their console running at 1500000 baud in
> U-Boot and the kernel. Such is the case for puma-haikou RK3399-based
> SoM+Carrierboard.
>
> In order to prepare for the addition of puma-haikou to meta-rockchip,
> let's replace the baudrate in TF-A by the one defined in the machine
> conf file in the RK_CONSOLE_BAUD variable.
>
> Cc: Quentin Schulz <foss+yocto@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
> .../files/serial-console-baudrate.patch | 36 -------------------
> .../trusted-firmware-a_%.bbappend | 10 +++++-
> 2 files changed, 9 insertions(+), 37 deletions(-)
> delete mode 100644 recipes-bsp/trusted-firmware-a/files/serial-console-baudrate.patch
Applied to meta-rockchip master. Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-17 18:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-17 11:30 [meta-rockchip][PATCH v3] trusted-firmware-a: replace baudrate with the one specified in machine conf Quentin Schulz
2021-12-17 17:54 ` Khem Raj
2021-12-17 18:11 ` Trevor Woerner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox