[meta-rockchip][PATCH 1/4] centralize console settings


Trevor Woerner
 

The console settings (baud and device) are scrambled and spread throughout the
MACHINE configurations. Consolidate them and set defaults which are then
overridden only as required.

Signed-off-by: Trevor Woerner <twoerner@...>
---
conf/machine/include/nanopi-m4.inc | 2 --
conf/machine/include/rk3066.inc | 1 +
conf/machine/include/rk3188.inc | 3 +++
conf/machine/include/rk3288.inc | 2 +-
conf/machine/include/rk3328.inc | 2 --
conf/machine/include/rk3399.inc | 2 --
conf/machine/include/rock-pi-4.inc | 2 --
conf/machine/include/rockchip-defaults.inc | 3 +++
conf/machine/marsboard-rk3066.conf | 1 -
conf/machine/radxarock.conf | 1 -
10 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/conf/machine/include/nanopi-m4.inc b/conf/machine/include/nanopi-m4.inc
index a14b705..8a7c1d9 100644
--- a/conf/machine/include/nanopi-m4.inc
+++ b/conf/machine/include/nanopi-m4.inc
@@ -21,5 +21,3 @@ WKS_FILE_DEPENDS ?= " \
IMAGE_BOOT_FILES ?= "\
${KERNEL_IMAGETYPE} \
"
-
-SERIAL_CONSOLES = "1500000;ttyS2"
diff --git a/conf/machine/include/rk3066.inc b/conf/machine/include/rk3066.inc
index dffbee0..76744ee 100644
--- a/conf/machine/include/rk3066.inc
+++ b/conf/machine/include/rk3066.inc
@@ -7,5 +7,6 @@ require conf/machine/include/tune-cortexa9.inc
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc

+RK_CONSOLE_BAUD = "115200"
KBUILD_DEFCONFIG = "multi_v7_defconfig"
KERNEL_IMAGETYPE = "zImage"
diff --git a/conf/machine/include/rk3188.inc b/conf/machine/include/rk3188.inc
index 59e65d1..e21bbf7 100644
--- a/conf/machine/include/rk3188.inc
+++ b/conf/machine/include/rk3188.inc
@@ -9,3 +9,6 @@ require conf/machine/include/rockchip-defaults.inc

KBUILD_DEFCONFIG = "multi_v7_defconfig"
KERNEL_IMAGETYPE = "zImage"
+
+RK_CONSOLE_BAUD = "115200"
+RK_CONSOLE_DEVICE = "ttyFIQ0"
diff --git a/conf/machine/include/rk3288.inc b/conf/machine/include/rk3288.inc
index 480e250..2715e73 100644
--- a/conf/machine/include/rk3288.inc
+++ b/conf/machine/include/rk3288.inc
@@ -10,7 +10,7 @@ require conf/machine/include/rockchip-defaults.inc
KBUILD_DEFCONFIG ?= "multi_v7_defconfig"
KERNEL_IMAGETYPE = "zImage"

-SERIAL_CONSOLES = "115200;ttyS2"
+RK_CONSOLE_BAUD = "115200"

PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
SPL_BINARY ?= "idbloader.img"
diff --git a/conf/machine/include/rk3328.inc b/conf/machine/include/rk3328.inc
index a4bbc5d..5b11868 100644
--- a/conf/machine/include/rk3328.inc
+++ b/conf/machine/include/rk3328.inc
@@ -19,7 +19,5 @@ TFA_BUILD_TARGET = "bl31"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"

-SERIAL_CONSOLES = "1500000;ttyS2"
-
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
SPL_BINARY ?= "idbloader.img"
diff --git a/conf/machine/include/rk3399.inc b/conf/machine/include/rk3399.inc
index f6b7826..9f9f474 100644
--- a/conf/machine/include/rk3399.inc
+++ b/conf/machine/include/rk3399.inc
@@ -19,8 +19,6 @@ TFA_BUILD_TARGET = "bl31"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"

-SERIAL_CONSOLES = "115200;ttyS2"
-
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
SPL_BINARY ?= "idbloader.img"

diff --git a/conf/machine/include/rock-pi-4.inc b/conf/machine/include/rock-pi-4.inc
index 9c21084..a3e60c7 100644
--- a/conf/machine/include/rock-pi-4.inc
+++ b/conf/machine/include/rock-pi-4.inc
@@ -17,6 +17,4 @@ IMAGE_BOOT_FILES ?= "\
${KERNEL_IMAGETYPE} \
"

-SERIAL_CONSOLES = "1500000;ttyS2"
-
MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
diff --git a/conf/machine/include/rockchip-defaults.inc b/conf/machine/include/rockchip-defaults.inc
index a4e2a2c..fe4052e 100644
--- a/conf/machine/include/rockchip-defaults.inc
+++ b/conf/machine/include/rockchip-defaults.inc
@@ -21,6 +21,9 @@ XSERVER = " \
"

# misc
+RK_CONSOLE_DEVICE ?= "ttyS2"
+RK_CONSOLE_BAUD ?= "1500000"
+SERIAL_CONSOLES = "${RK_CONSOLE_BAUD};${RK_CONSOLE_DEVICE}"
IMAGE_FSTYPES += "ext4"

# boot device (sd-card/emmc)
diff --git a/conf/machine/marsboard-rk3066.conf b/conf/machine/marsboard-rk3066.conf
index 09414bc..52fd256 100644
--- a/conf/machine/marsboard-rk3066.conf
+++ b/conf/machine/marsboard-rk3066.conf
@@ -8,5 +8,4 @@

require conf/machine/include/rk3066.inc

-SERIAL_CONSOLES = "115200;ttyS2"
KERNEL_DEVICETREE = "rk3066a-marsboard.dtb"
diff --git a/conf/machine/radxarock.conf b/conf/machine/radxarock.conf
index 2036f6a..42d8848 100644
--- a/conf/machine/radxarock.conf
+++ b/conf/machine/radxarock.conf
@@ -9,5 +9,4 @@

require conf/machine/include/rk3188.inc

-SERIAL_CONSOLES = "115200;ttyFIQ0"
KERNEL_DEVICETREE = "rk3188-radxarock.dtb"
--
2.30.0.rc0


Khem Raj
 

On Wed, Jun 23, 2021 at 8:25 AM Trevor Woerner <twoerner@...> wrote:

The console settings (baud and device) are scrambled and spread throughout the
MACHINE configurations. Consolidate them and set defaults which are then
overridden only as required.

Signed-off-by: Trevor Woerner <twoerner@...>
---
conf/machine/include/nanopi-m4.inc | 2 --
conf/machine/include/rk3066.inc | 1 +
conf/machine/include/rk3188.inc | 3 +++
conf/machine/include/rk3288.inc | 2 +-
conf/machine/include/rk3328.inc | 2 --
conf/machine/include/rk3399.inc | 2 --
conf/machine/include/rock-pi-4.inc | 2 --
conf/machine/include/rockchip-defaults.inc | 3 +++
conf/machine/marsboard-rk3066.conf | 1 -
conf/machine/radxarock.conf | 1 -
10 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/conf/machine/include/nanopi-m4.inc b/conf/machine/include/nanopi-m4.inc
index a14b705..8a7c1d9 100644
--- a/conf/machine/include/nanopi-m4.inc
+++ b/conf/machine/include/nanopi-m4.inc
@@ -21,5 +21,3 @@ WKS_FILE_DEPENDS ?= " \
IMAGE_BOOT_FILES ?= "\
${KERNEL_IMAGETYPE} \
"
-
-SERIAL_CONSOLES = "1500000;ttyS2"
diff --git a/conf/machine/include/rk3066.inc b/conf/machine/include/rk3066.inc
index dffbee0..76744ee 100644
--- a/conf/machine/include/rk3066.inc
+++ b/conf/machine/include/rk3066.inc
@@ -7,5 +7,6 @@ require conf/machine/include/tune-cortexa9.inc
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc

+RK_CONSOLE_BAUD = "115200"
KBUILD_DEFCONFIG = "multi_v7_defconfig"
KERNEL_IMAGETYPE = "zImage"
diff --git a/conf/machine/include/rk3188.inc b/conf/machine/include/rk3188.inc
index 59e65d1..e21bbf7 100644
--- a/conf/machine/include/rk3188.inc
+++ b/conf/machine/include/rk3188.inc
@@ -9,3 +9,6 @@ require conf/machine/include/rockchip-defaults.inc

KBUILD_DEFCONFIG = "multi_v7_defconfig"
KERNEL_IMAGETYPE = "zImage"
+
+RK_CONSOLE_BAUD = "115200"
+RK_CONSOLE_DEVICE = "ttyFIQ0"
while I appreciate this change, it does have an effect of removing the
users away from
BSP variables that core metadata layers have, e.g. SERIAL_CONSOLES is
a well defined
and documented variable and if we synthesize it then its hidden which
is fine if we document
the new variables equally well although that means every BSP will
invent these kind of
variables so if a person was doing RPI and comes to work on rockchip
boards he has more
learnings to do.

diff --git a/conf/machine/include/rk3288.inc b/conf/machine/include/rk3288.inc
index 480e250..2715e73 100644
--- a/conf/machine/include/rk3288.inc
+++ b/conf/machine/include/rk3288.inc
@@ -10,7 +10,7 @@ require conf/machine/include/rockchip-defaults.inc
KBUILD_DEFCONFIG ?= "multi_v7_defconfig"
KERNEL_IMAGETYPE = "zImage"

-SERIAL_CONSOLES = "115200;ttyS2"
+RK_CONSOLE_BAUD = "115200"

PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
SPL_BINARY ?= "idbloader.img"
diff --git a/conf/machine/include/rk3328.inc b/conf/machine/include/rk3328.inc
index a4bbc5d..5b11868 100644
--- a/conf/machine/include/rk3328.inc
+++ b/conf/machine/include/rk3328.inc
@@ -19,7 +19,5 @@ TFA_BUILD_TARGET = "bl31"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"

-SERIAL_CONSOLES = "1500000;ttyS2"
-
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
SPL_BINARY ?= "idbloader.img"
diff --git a/conf/machine/include/rk3399.inc b/conf/machine/include/rk3399.inc
index f6b7826..9f9f474 100644
--- a/conf/machine/include/rk3399.inc
+++ b/conf/machine/include/rk3399.inc
@@ -19,8 +19,6 @@ TFA_BUILD_TARGET = "bl31"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"

-SERIAL_CONSOLES = "115200;ttyS2"
-
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
SPL_BINARY ?= "idbloader.img"

diff --git a/conf/machine/include/rock-pi-4.inc b/conf/machine/include/rock-pi-4.inc
index 9c21084..a3e60c7 100644
--- a/conf/machine/include/rock-pi-4.inc
+++ b/conf/machine/include/rock-pi-4.inc
@@ -17,6 +17,4 @@ IMAGE_BOOT_FILES ?= "\
${KERNEL_IMAGETYPE} \
"

-SERIAL_CONSOLES = "1500000;ttyS2"
-
MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
diff --git a/conf/machine/include/rockchip-defaults.inc b/conf/machine/include/rockchip-defaults.inc
index a4e2a2c..fe4052e 100644
--- a/conf/machine/include/rockchip-defaults.inc
+++ b/conf/machine/include/rockchip-defaults.inc
@@ -21,6 +21,9 @@ XSERVER = " \
"

# misc
+RK_CONSOLE_DEVICE ?= "ttyS2"
+RK_CONSOLE_BAUD ?= "1500000"
+SERIAL_CONSOLES = "${RK_CONSOLE_BAUD};${RK_CONSOLE_DEVICE}"
IMAGE_FSTYPES += "ext4"

# boot device (sd-card/emmc)
diff --git a/conf/machine/marsboard-rk3066.conf b/conf/machine/marsboard-rk3066.conf
index 09414bc..52fd256 100644
--- a/conf/machine/marsboard-rk3066.conf
+++ b/conf/machine/marsboard-rk3066.conf
@@ -8,5 +8,4 @@

require conf/machine/include/rk3066.inc

-SERIAL_CONSOLES = "115200;ttyS2"
KERNEL_DEVICETREE = "rk3066a-marsboard.dtb"
diff --git a/conf/machine/radxarock.conf b/conf/machine/radxarock.conf
index 2036f6a..42d8848 100644
--- a/conf/machine/radxarock.conf
+++ b/conf/machine/radxarock.conf
@@ -9,5 +9,4 @@

require conf/machine/include/rk3188.inc

-SERIAL_CONSOLES = "115200;ttyFIQ0"
KERNEL_DEVICETREE = "rk3188-radxarock.dtb"
--
2.30.0.rc0




Yann Dirson
 

----- Mail original -----
De: "Khem Raj" <raj.khem@...>
À: "Trevor Woerner" <twoerner@...>
Cc: "Yocto-mailing-list" <yocto@...>
Envoyé: Mercredi 23 Juin 2021 11:32:57
Objet: Re: [yocto] [meta-rockchip][PATCH 1/4] centralize console settings

On Wed, Jun 23, 2021 at 8:25 AM Trevor Woerner <twoerner@...>
wrote:

The console settings (baud and device) are scrambled and spread
throughout the
MACHINE configurations. Consolidate them and set defaults which are
then
overridden only as required.

Signed-off-by: Trevor Woerner <twoerner@...>
---
conf/machine/include/nanopi-m4.inc | 2 --
conf/machine/include/rk3066.inc | 1 +
conf/machine/include/rk3188.inc | 3 +++
conf/machine/include/rk3288.inc | 2 +-
conf/machine/include/rk3328.inc | 2 --
conf/machine/include/rk3399.inc | 2 --
conf/machine/include/rock-pi-4.inc | 2 --
conf/machine/include/rockchip-defaults.inc | 3 +++
conf/machine/marsboard-rk3066.conf | 1 -
conf/machine/radxarock.conf | 1 -
10 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/conf/machine/include/nanopi-m4.inc
b/conf/machine/include/nanopi-m4.inc
index a14b705..8a7c1d9 100644
--- a/conf/machine/include/nanopi-m4.inc
+++ b/conf/machine/include/nanopi-m4.inc
@@ -21,5 +21,3 @@ WKS_FILE_DEPENDS ?= " \
IMAGE_BOOT_FILES ?= "\
${KERNEL_IMAGETYPE} \
"
-
-SERIAL_CONSOLES = "1500000;ttyS2"
diff --git a/conf/machine/include/rk3066.inc
b/conf/machine/include/rk3066.inc
index dffbee0..76744ee 100644
--- a/conf/machine/include/rk3066.inc
+++ b/conf/machine/include/rk3066.inc
@@ -7,5 +7,6 @@ require conf/machine/include/tune-cortexa9.inc
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc

+RK_CONSOLE_BAUD = "115200"
KBUILD_DEFCONFIG = "multi_v7_defconfig"
KERNEL_IMAGETYPE = "zImage"
diff --git a/conf/machine/include/rk3188.inc
b/conf/machine/include/rk3188.inc
index 59e65d1..e21bbf7 100644
--- a/conf/machine/include/rk3188.inc
+++ b/conf/machine/include/rk3188.inc
@@ -9,3 +9,6 @@ require conf/machine/include/rockchip-defaults.inc

KBUILD_DEFCONFIG = "multi_v7_defconfig"
KERNEL_IMAGETYPE = "zImage"
+
+RK_CONSOLE_BAUD = "115200"
+RK_CONSOLE_DEVICE = "ttyFIQ0"
while I appreciate this change, it does have an effect of removing
the
users away from
BSP variables that core metadata layers have, e.g. SERIAL_CONSOLES is
a well defined
and documented variable and if we synthesize it then its hidden which
is fine if we document
the new variables equally well although that means every BSP will
invent these kind of
variables so if a person was doing RPI and comes to work on rockchip
boards he has more
learnings to do.
What about making this change at the poky level, then ?


diff --git a/conf/machine/include/rk3288.inc
b/conf/machine/include/rk3288.inc
index 480e250..2715e73 100644
--- a/conf/machine/include/rk3288.inc
+++ b/conf/machine/include/rk3288.inc
@@ -10,7 +10,7 @@ require
conf/machine/include/rockchip-defaults.inc
KBUILD_DEFCONFIG ?= "multi_v7_defconfig"
KERNEL_IMAGETYPE = "zImage"

-SERIAL_CONSOLES = "115200;ttyS2"
+RK_CONSOLE_BAUD = "115200"

PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
SPL_BINARY ?= "idbloader.img"
diff --git a/conf/machine/include/rk3328.inc
b/conf/machine/include/rk3328.inc
index a4bbc5d..5b11868 100644
--- a/conf/machine/include/rk3328.inc
+++ b/conf/machine/include/rk3328.inc
@@ -19,7 +19,5 @@ TFA_BUILD_TARGET = "bl31"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"

-SERIAL_CONSOLES = "1500000;ttyS2"
-
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
SPL_BINARY ?= "idbloader.img"
diff --git a/conf/machine/include/rk3399.inc
b/conf/machine/include/rk3399.inc
index f6b7826..9f9f474 100644
--- a/conf/machine/include/rk3399.inc
+++ b/conf/machine/include/rk3399.inc
@@ -19,8 +19,6 @@ TFA_BUILD_TARGET = "bl31"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"

-SERIAL_CONSOLES = "115200;ttyS2"
-
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
SPL_BINARY ?= "idbloader.img"

diff --git a/conf/machine/include/rock-pi-4.inc
b/conf/machine/include/rock-pi-4.inc
index 9c21084..a3e60c7 100644
--- a/conf/machine/include/rock-pi-4.inc
+++ b/conf/machine/include/rock-pi-4.inc
@@ -17,6 +17,4 @@ IMAGE_BOOT_FILES ?= "\
${KERNEL_IMAGETYPE} \
"

-SERIAL_CONSOLES = "1500000;ttyS2"
-
MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
diff --git a/conf/machine/include/rockchip-defaults.inc
b/conf/machine/include/rockchip-defaults.inc
index a4e2a2c..fe4052e 100644
--- a/conf/machine/include/rockchip-defaults.inc
+++ b/conf/machine/include/rockchip-defaults.inc
@@ -21,6 +21,9 @@ XSERVER = " \
"

# misc
+RK_CONSOLE_DEVICE ?= "ttyS2"
+RK_CONSOLE_BAUD ?= "1500000"
+SERIAL_CONSOLES = "${RK_CONSOLE_BAUD};${RK_CONSOLE_DEVICE}"
IMAGE_FSTYPES += "ext4"

# boot device (sd-card/emmc)
diff --git a/conf/machine/marsboard-rk3066.conf
b/conf/machine/marsboard-rk3066.conf
index 09414bc..52fd256 100644
--- a/conf/machine/marsboard-rk3066.conf
+++ b/conf/machine/marsboard-rk3066.conf
@@ -8,5 +8,4 @@

require conf/machine/include/rk3066.inc

-SERIAL_CONSOLES = "115200;ttyS2"
KERNEL_DEVICETREE = "rk3066a-marsboard.dtb"
diff --git a/conf/machine/radxarock.conf
b/conf/machine/radxarock.conf
index 2036f6a..42d8848 100644
--- a/conf/machine/radxarock.conf
+++ b/conf/machine/radxarock.conf
@@ -9,5 +9,4 @@

require conf/machine/include/rk3188.inc

-SERIAL_CONSOLES = "115200;ttyFIQ0"
KERNEL_DEVICETREE = "rk3188-radxarock.dtb"
--
2.30.0.rc0







Trevor Woerner
 

On Wed 2021-06-23 @ 08:10:07 PM, ydirson@... wrote:
De: "Khem Raj" <raj.khem@...>
À: "Trevor Woerner" <twoerner@...>
Cc: "Yocto-mailing-list" <yocto@...>
Envoyé: Mercredi 23 Juin 2021 11:32:57
Objet: Re: [yocto] [meta-rockchip][PATCH 1/4] centralize console settings
+RK_CONSOLE_BAUD = "115200"
+RK_CONSOLE_DEVICE = "ttyFIQ0"
while I appreciate this change, it does have an effect of removing
the
users away from
BSP variables that core metadata layers have, e.g. SERIAL_CONSOLES is
a well defined
and documented variable and if we synthesize it then its hidden which
is fine if we document
the new variables equally well although that means every BSP will
invent these kind of
variables so if a person was doing RPI and comes to work on rockchip
boards he has more
learnings to do.
Good point, thanks for mentioning it.

What about making this change at the poky level, then ?
I suspect it would break things in all sorts of unimaginable ways ;-)

For example, SERIAL_CONSOLES (note: plural) can contain more than one
baud+device pair so if we try to break out the baud and device then we'd need
an array (?) so we could break out multiple baud and device pairs (?), and
then that would get messy... ugh!


Yann Dirson
 

De: "Trevor Woerner" <twoerner@...>
À: ydirson@...
Cc: "Khem Raj" <raj.khem@...>, "Yocto-mailing-list" <yocto@...>
Envoyé: Mercredi 23 Juin 2021 14:51:39
Objet: Re: [yocto] [meta-rockchip][PATCH 1/4] centralize console settings

On Wed 2021-06-23 @ 08:10:07 PM, ydirson@... wrote:
De: "Khem Raj" <raj.khem@...>
À: "Trevor Woerner" <twoerner@...>
Cc: "Yocto-mailing-list" <yocto@...>
Envoyé: Mercredi 23 Juin 2021 11:32:57
Objet: Re: [yocto] [meta-rockchip][PATCH 1/4] centralize console
settings
+RK_CONSOLE_BAUD = "115200"
+RK_CONSOLE_DEVICE = "ttyFIQ0"
while I appreciate this change, it does have an effect of
removing
the
users away from
BSP variables that core metadata layers have, e.g.
SERIAL_CONSOLES is
a well defined
and documented variable and if we synthesize it then its hidden
which
is fine if we document
the new variables equally well although that means every BSP will
invent these kind of
variables so if a person was doing RPI and comes to work on
rockchip
boards he has more
learnings to do.
Good point, thanks for mentioning it.

What about making this change at the poky level, then ?
I suspect it would break things in all sorts of unimaginable ways ;-)

For example, SERIAL_CONSOLES (note: plural) can contain more than one
baud+device pair so if we try to break out the baud and device then
we'd need
an array (?) so we could break out multiple baud and device pairs
(?), and
then that would get messy... ugh!
Damned that makes things more complicated :)

That could push us along the following lines ?

CONSOLE_DEVICES = "/dev/ttyS2 /dev/tty1"
CONSOLE_BAUD_ttyS2 = "1500000"
CONSOLE_BAUD_tty1 = "115200"

(well, with /dev/ being what it is, CONSOLE_DEVICES = "ttyS2 tty1" could
even be decided as sufficient, removing any possibility for syntactic
ambiguities)

or maybe even this ?

CONSOLE_BAUD = <default value>
CONSOLE_BAUD[/dev/ttyS2] = <overriden value>