earlycon support for arm64 systems |
||||||
Issue description
We support enabling the kernel console to be output on a serial port with the --enable_serial option, and we turn on earlyprintk at the same time. However, arm64 does not support earlyprintk; it uses earlycon instead (a somewhat more arch-independent mechanism).
This bug will track a few missing items:
(a) missing earlycon support for designware uarts, such as those on rk3399
(b) construction of the kernel command line (e.g., in the build_image script) to support 'earlycon'
I found a series of upstream patches for (a) that I plan to backport to our 4.4 kernel. And I think (b) will be as simple as just adding an extra (possibly redundant) parameter to the growing list in build_kernel_image.sh:
---
cat <<EOF > "${config}"
earlyprintk=${console}
console=tty1
console=${console}
EOF
else
cat <<EOF > "${config}"
console=
EOF
---
BTW, do we still really need that 'console=tty1' hanging around? Is that non-frecon legacy?
Also, from the looks of it, Mediatek has support for earlycon already in 3.18. So presumably Oak/Elm would benefit from (b) above?
,
Aug 10 2016
Kernel 4.4 backports: https://chromium-review.googlesource.com/367910 UPSTREAM: serial: support 16-bit register interface for console https://chromium-review.googlesource.com/367911 UPSTREAM: of: earlycon: of_setup_earlycon() requires CONFIG_OF_EARLY_FLATTREE https://chromium-review.googlesource.com/367912 UPSTREAM: earlycon: Use common framework for earlycon declarations https://chromium-review.googlesource.com/367913 UPSTREAM: serial: earlycon: Fixup earlycon console name and index https://chromium-review.googlesource.com/367914 UPSTREAM: of: earlycon: Fixup earlycon console name and index https://chromium-review.googlesource.com/367915 UPSTREAM: of: earlycon: Add options string handling https://chromium-review.googlesource.com/367916 UPSTREAM: of: earlycon: Initialize port fields from DT properties https://chromium-review.googlesource.com/367917 UPSTREAM: of: earlycon: Move address translation to of_setup_earlycon() https://chromium-review.googlesource.com/367918 UPSTREAM: of: earlycon: Log more helpful message if stdout-path node not found https://chromium-review.googlesource.com/367919 BACKPORT: serial: 8250_early: Add earlycon support for Synopsys DesignWare ... https://chromium-review.googlesource.com/367920 CHROMIUM: arm64: dts: add stdout-path to gru Technically, we only need a smaller subset of those, like: https://chromium-review.googlesource.com/367916 UPSTREAM: of: earlycon: Initialize port fields from DT properties https://chromium-review.googlesource.com/367919 BACKPORT: serial: 8250_early: Add earlycon support for Synopsys DesignWare ... https://chromium-review.googlesource.com/367920 CHROMIUM: arm64: dts: add stdout-path to gru But it's a bit more difficult to tease out the exact changes. Unless somebody volunteers, I'll pick reviewers soon.
,
Aug 11 2016
BTW, Stefan Agner wrote up a lovely explanation of earlycon here: https://falstaff.agner.ch/2015/10/17/linux-earlyprintkearlycon-support-on-arm/
,
Aug 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/3a95facfe6844c18aac837f066ed06ffc0ca2890 commit 3a95facfe6844c18aac837f066ed06ffc0ca2890 Author: Masahiro Yamada <yamada.masahiro@socionext.com> Date: Wed Oct 28 03:46:05 2015 UPSTREAM: serial: support 16-bit register interface for console Currently, 8-bit (MMIO) and 32-bit (MMIO32) register interfaces are supported for the 8250 console, but the 16-bit (MMIO16) is not. The 8250 UART device on my board is connected to a 16-bit bus and my main motivation is to use earlycon with it. (Refer to arch/arm/boot/dts/uniphier-support-card.dtsi) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit bd94c4077a0b2ecc35562c294f80f3659ecd8499) BUG= chromium:636585 TEST=see early prints on rk3399 with earlycon in kernel cmdline Change-Id: Ic2cb71e778e0c019ba8aaa2c82bf76828b481445 Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367910 Reviewed-by: Guenter Roeck <groeck@chromium.org> [modify] https://crrev.com/3a95facfe6844c18aac837f066ed06ffc0ca2890/drivers/tty/serial/8250/8250_core.c [modify] https://crrev.com/3a95facfe6844c18aac837f066ed06ffc0ca2890/drivers/tty/serial/of_serial.c [modify] https://crrev.com/3a95facfe6844c18aac837f066ed06ffc0ca2890/drivers/tty/serial/8250/8250_early.c [modify] https://crrev.com/3a95facfe6844c18aac837f066ed06ffc0ca2890/drivers/tty/serial/earlycon.c [modify] https://crrev.com/3a95facfe6844c18aac837f066ed06ffc0ca2890/drivers/tty/serial/8250/8250_port.c [modify] https://crrev.com/3a95facfe6844c18aac837f066ed06ffc0ca2890/include/linux/serial_core.h [modify] https://crrev.com/3a95facfe6844c18aac837f066ed06ffc0ca2890/Documentation/kernel-parameters.txt [modify] https://crrev.com/3a95facfe6844c18aac837f066ed06ffc0ca2890/include/uapi/linux/serial.h [modify] https://crrev.com/3a95facfe6844c18aac837f066ed06ffc0ca2890/drivers/tty/serial/serial_core.c
,
Aug 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/c66645656cb2ffe37f6cc6d07ef224b9a14d148c commit c66645656cb2ffe37f6cc6d07ef224b9a14d148c Author: Peter Hurley <peter@hurleysoftware.com> Date: Sat Jan 16 23:23:38 2016 UPSTREAM: of: earlycon: of_setup_earlycon() requires CONFIG_OF_EARLY_FLATTREE DT earlycon is only supported for CONFIG_OF_EARLY_FLATTREE=y; exclude of_setup_earlycon() if not defined. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 8477614d9f7c5ce0e871e1aa200d9060a6b8749e) BUG= chromium:636585 TEST=see early prints on rk3399 with earlycon in kernel cmdline Change-Id: I54ea095cf2e10c04a6ddee56e6edf685c90d769a Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367911 Reviewed-by: Guenter Roeck <groeck@chromium.org> [modify] https://crrev.com/c66645656cb2ffe37f6cc6d07ef224b9a14d148c/drivers/tty/serial/earlycon.c
,
Aug 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/51963b1180861e3042a9eea85cb4e62e3e57509d commit 51963b1180861e3042a9eea85cb4e62e3e57509d Author: Peter Hurley <peter@hurleysoftware.com> Date: Sat Jan 16 23:23:39 2016 UPSTREAM: earlycon: Use common framework for earlycon declarations Use a single common table of struct earlycon_id for both command line and devicetree. Re-define OF_EARLYCON_DECLARE() macro to instance a unique earlycon declaration (the declaration is only guaranteed to be unique within a compilation unit; separate compilation units must still use unique earlycon names). The semantics of OF_EARLYCON_DECLARE() is different; it declares an earlycon which can matched either on the command line or by devicetree. EARLYCON_DECLARE() is semantically unchanged; it declares an earlycon which is matched by command line only. Remove redundant instances of EARLYCON_DECLARE(). This enables all earlycons to properly initialize struct console with the appropriate name and index, which improves diagnostics and enables direct earlycon-to-console handoff. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 2eaa790989e03900298ad24f77f1086dbbc1aebd) BUG= chromium:636585 TEST=see early prints on rk3399 with earlycon in kernel cmdline Change-Id: I1c43f2ffeadc19b7a16a6406593af73540d924b2 Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367912 Reviewed-by: Guenter Roeck <groeck@chromium.org> [modify] https://crrev.com/51963b1180861e3042a9eea85cb4e62e3e57509d/drivers/tty/serial/amba-pl011.c [modify] https://crrev.com/51963b1180861e3042a9eea85cb4e62e3e57509d/drivers/tty/serial/samsung.c [modify] https://crrev.com/51963b1180861e3042a9eea85cb4e62e3e57509d/drivers/tty/serial/msm_serial.c [modify] https://crrev.com/51963b1180861e3042a9eea85cb4e62e3e57509d/drivers/tty/serial/earlycon.c [modify] https://crrev.com/51963b1180861e3042a9eea85cb4e62e3e57509d/include/linux/serial_core.h [modify] https://crrev.com/51963b1180861e3042a9eea85cb4e62e3e57509d/include/asm-generic/vmlinux.lds.h [modify] https://crrev.com/51963b1180861e3042a9eea85cb4e62e3e57509d/drivers/tty/serial/arc_uart.c [modify] https://crrev.com/51963b1180861e3042a9eea85cb4e62e3e57509d/drivers/of/fdt.c [modify] https://crrev.com/51963b1180861e3042a9eea85cb4e62e3e57509d/drivers/tty/serial/sprd_serial.c
,
Aug 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/3e7a310fc945f781d84195ebf4fbd5f1d6d1478d commit 3e7a310fc945f781d84195ebf4fbd5f1d6d1478d Author: Peter Hurley <peter@hurleysoftware.com> Date: Sat Jan 16 23:23:40 2016 UPSTREAM: serial: earlycon: Fixup earlycon console name and index Properly initialize the struct console 'name' and 'index' fields for the registering earlycon. For earlycons w/o trailing numerals, the index is set to 0; otherwise, the index is set to the value of the trailing numeral. For example, the 'exynos4210' earlycon name == "exynos" and index == 4210. Earlycons with embedded numerals will have all non-trailing numerals as part of the name; for example, the 's3c2412' earlycon name == "s3c" and index == 2412. This ackward scheme was initially added for the uart8250 earlycon; adopt this scheme for the other earlycon "drivers". Introduce earlycon_init() which performs the string scanning and initializes the name and index fields; encapsulate the other console field initializations within. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit cda64e68240265752c6db22a75f28707dfaf6563) BUG= chromium:636585 TEST=see early prints on rk3399 with earlycon in kernel cmdline Change-Id: I66aa779504fd51a6519de93afb39d605f325aaec Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367913 Reviewed-by: Guenter Roeck <groeck@chromium.org> [modify] https://crrev.com/3e7a310fc945f781d84195ebf4fbd5f1d6d1478d/drivers/tty/serial/earlycon.c
,
Aug 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/cd9356ad8b085399505534e466f2a5b87a93573b commit cd9356ad8b085399505534e466f2a5b87a93573b Author: Peter Hurley <peter@hurleysoftware.com> Date: Sat Jan 16 23:23:41 2016 UPSTREAM: of: earlycon: Fixup earlycon console name and index Use the console name embedded in the OF earlycon table by the OF_EARLYCON_DECLARE() macro to initialize the struct console 'name' and 'index' fields. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 05d961320ba624c98b16d72b32f947307674b341) BUG= chromium:636585 TEST=see early prints on rk3399 with earlycon in kernel cmdline Change-Id: I2912918e54a4db7f361e202a578126b3b6dbae12 Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367914 Reviewed-by: Guenter Roeck <groeck@chromium.org> [modify] https://crrev.com/cd9356ad8b085399505534e466f2a5b87a93573b/include/linux/serial_core.h [modify] https://crrev.com/cd9356ad8b085399505534e466f2a5b87a93573b/drivers/tty/serial/earlycon.c [modify] https://crrev.com/cd9356ad8b085399505534e466f2a5b87a93573b/drivers/of/fdt.c
,
Aug 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/acfa88f35ca8419835be403c05ab750ec40f3565 commit acfa88f35ca8419835be403c05ab750ec40f3565 Author: Peter Hurley <peter@hurleysoftware.com> Date: Sat Jan 16 23:23:42 2016 UPSTREAM: of: earlycon: Add options string handling Pass-through any options string in the 'stdout-path' property to the earlycon "driver" setup. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 4d118c9a866590850dad8689262a95345d2c6e09) BUG= chromium:636585 TEST=see early prints on rk3399 with earlycon in kernel cmdline Change-Id: I6e75de9ab06aec086f64c26c794fccbeae76e8ca Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367915 Reviewed-by: Guenter Roeck <groeck@chromium.org> [modify] https://crrev.com/acfa88f35ca8419835be403c05ab750ec40f3565/include/linux/serial_core.h [modify] https://crrev.com/acfa88f35ca8419835be403c05ab750ec40f3565/drivers/tty/serial/earlycon.c [modify] https://crrev.com/acfa88f35ca8419835be403c05ab750ec40f3565/drivers/of/fdt.c
,
Aug 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/053370f58e4c4ca1c0acf686a060ac6a58abd991 commit 053370f58e4c4ca1c0acf686a060ac6a58abd991 Author: Peter Hurley <peter@hurleysoftware.com> Date: Sat Jan 16 23:23:43 2016 UPSTREAM: of: earlycon: Initialize port fields from DT properties Read the optional "reg-offset", "reg-shift", "reg-io-width" and endianness properties and initialize the respective struct uart_port field if found. NB: These bindings are common to several drivers and the values merely indicate the default value; the registering earlycon setup() method can simply override the values if required. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 088da2a17619cf0113b62a76ad38c6a14470ffa6) BUG= chromium:636585 TEST=see early prints on rk3399 with earlycon in kernel cmdline Change-Id: I33bfa17b8daae31a81a13b944971356f2c087c2c Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367916 Reviewed-by: Guenter Roeck <groeck@chromium.org> [modify] https://crrev.com/053370f58e4c4ca1c0acf686a060ac6a58abd991/include/linux/serial_core.h [modify] https://crrev.com/053370f58e4c4ca1c0acf686a060ac6a58abd991/drivers/tty/serial/earlycon.c [modify] https://crrev.com/053370f58e4c4ca1c0acf686a060ac6a58abd991/drivers/of/fdt.c
,
Aug 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/560a98ba00cdc1bf0dbf318c84c7e6d9020386ac commit 560a98ba00cdc1bf0dbf318c84c7e6d9020386ac Author: Peter Hurley <peter@hurleysoftware.com> Date: Sat Jan 16 23:23:44 2016 UPSTREAM: of: earlycon: Move address translation to of_setup_earlycon() Cleanup the early DT/earlycon separation; remove the 'addr' parameter from of_setup_earlycon() and get the uart phys addr directly with a new wrapper function, of_flat_dt_translate_addr(). Limit fdt_translate_address() to file scope. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit c90fe9c0394b068ceca16f66e9f35bcd8d948295) BUG= chromium:636585 TEST=see early prints on rk3399 with earlycon in kernel cmdline Change-Id: I5b09b2a1875018339c03a8f33a853562e94c7a36 Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367917 Reviewed-by: Guenter Roeck <groeck@chromium.org> [modify] https://crrev.com/560a98ba00cdc1bf0dbf318c84c7e6d9020386ac/drivers/of/fdt_address.c [modify] https://crrev.com/560a98ba00cdc1bf0dbf318c84c7e6d9020386ac/include/linux/serial_core.h [modify] https://crrev.com/560a98ba00cdc1bf0dbf318c84c7e6d9020386ac/drivers/tty/serial/earlycon.c [modify] https://crrev.com/560a98ba00cdc1bf0dbf318c84c7e6d9020386ac/drivers/of/fdt.c [modify] https://crrev.com/560a98ba00cdc1bf0dbf318c84c7e6d9020386ac/include/linux/of_fdt.h
,
Aug 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/1266a4566c7b5eaf2078db43c4074d22b0a206f1 commit 1266a4566c7b5eaf2078db43c4074d22b0a206f1 Author: Peter Hurley <peter@hurleysoftware.com> Date: Sat Jan 16 23:23:48 2016 UPSTREAM: of: earlycon: Log more helpful message if stdout-path node not found Earlycon may fail to initialize for a variety of reasons, most of which log the default early param message. If the stdout-path node is not found, log the path which was not found (and suppress the default early param message). Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 0fcc286f6a952d6ec40f74f26fd9cd5d63c25f9e) BUG= chromium:636585 TEST=see early prints on rk3399 with earlycon in kernel cmdline Change-Id: Ie0f4adf535322eac0f8cd460b4bbfa668c6465f4 Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367918 Reviewed-by: Guenter Roeck <groeck@chromium.org> [modify] https://crrev.com/1266a4566c7b5eaf2078db43c4074d22b0a206f1/drivers/of/fdt.c
,
Aug 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/2a8ad3d914495e708abe6be81f969ed0a246dce7 commit 2a8ad3d914495e708abe6be81f969ed0a246dce7 Author: Kefeng Wang <wangkefeng.wang@huawei.com> Date: Wed May 11 06:06:01 2016 BACKPORT: serial: 8250_early: Add earlycon support for Synopsys DesignWare ABP UART Some board like Hisilicon D02 uses Synopsys DesignWare ABP UART, declare an OF early console for it, so early console device can be enabled with comand line "earlycon"(without option) via the "stdout-path" property in device-tree. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Tested-by: Jon Mason <jon.mason@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 01e4d273559715ee6a8b1cfbe07ceda6c8e1a515) Conflicts: drivers/tty/serial/8250/8250_early.c [Trivial context conflicts] BUG= chromium:636585 TEST=see early prints on rk3399 with earlycon in kernel cmdline Change-Id: I2d9b1ce1095e6454238fd4533ab19eb05680a544 Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367919 Reviewed-by: Guenter Roeck <groeck@chromium.org> [modify] https://crrev.com/2a8ad3d914495e708abe6be81f969ed0a246dce7/drivers/tty/serial/8250/8250_early.c
,
Aug 16 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/kernel/+/13ec6b7d50dbbe21f343fb64d18410e824b70459 commit 13ec6b7d50dbbe21f343fb64d18410e824b70459 Author: Brian Norris <briannorris@chromium.org> Date: Wed Aug 10 21:38:17 2016 CHROMIUM: arm64: dts: add stdout-path to gru BUG= chromium:636585 TEST=see early prints on rk3399 with 'earlycon' in kernel cmdline Change-Id: I196528a53faf34da771368c529587ce8542f6c7c Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367920 Reviewed-by: Guenter Roeck <groeck@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> [modify] https://crrev.com/13ec6b7d50dbbe21f343fb64d18410e824b70459/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
,
Aug 17 2016
Just to update on the status here: earlycon should work on rk3399 now (just add the word 'earlycon' to your boot cmdline). The following CL would make this seamless with the build_image --enable_serial` options, but it's still in limbo, since it seems to break systems that have earlycon support built in, but don't have it configured properly (e.g., on veyron): https://chromium-review.googlesource.com/#/c/368003/
,
Feb 17 2017
,
Mar 18 2017
Activating. Please assign to the right owner and the appropriate priority.
,
Aug 19 2017
,
Mar 1 2018
OK, I can declare this "fixed" with no additional work :) Technically, earlycon was already supported as of my last CLs above. This is looking to add a build_image flag for it: http://crosreview.com/941722 So ./build_image --enable_serial ttyXX --earlyserial="earlycon" Thanks Dan. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by briannorris@chromium.org
, Aug 10 2016