poplar: fix boot failure caused by serial driver change
authorShawn Guo <shawn.guo@linaro.org>
Wed, 12 Dec 2018 07:24:44 +0000 (15:24 +0800)
committerTom Rini <trini@konsulko.com>
Sat, 15 Dec 2018 16:49:56 +0000 (11:49 -0500)
Commit 4687919684e0 ("serial: Remove DM_FLAG_PRE_RELOC flag in various
drivers") essentially drops flag DM_FLAG_PRE_RELOC from serial_pl01x
driver for Poplar platform, because the platform falls into the
following strategy category made by the commit.

  Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
  drivers that support both statically declared devices and
  configuration from device tree

Before the commit lands, Poplar platform works by statically declaring
pl011 serial device via U_BOOT_DEVICE() with DM_FLAG_PRE_RELOC flag set
in the driver.  But since Poplar also supports device configuration from
device tree, the commit practically drops the flag for Poplar, and hence
breaks the platform from booting.

This patch changes platform code and device tree to initiate pl011
serial device from device tree rather than static declaration, so that
above strategy about DM_FLAG_PRE_RELOC applies to Poplar, and therefore
the reported boot failure gets fixed.

Reported-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Fixes: 4687919684e0 ("serial: Remove DM_FLAG_PRE_RELOC flag in various drivers")
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/arm/dts/hi3798cv200-u-boot.dtsi
board/hisilicon/poplar/poplar.c

index 709ae1cbc9f3e614d8e399475402adc3a0161f07..7844c5208c5d4e5a8083c51d3e04288b8b70b3a9 100644 (file)
 };
 
 &uart0 {
-       status = "disabled";
+       clock = <75000000>;
+       status = "okay";
 };
-
-/{
-       chosen {
-               stdout-path = "";
-       };
-};
-
index 9e8eac78388b215dd3571759b90373f27f93ffe6..8adc750962a10f35626d778eb31394bc98ed3223 100644 (file)
@@ -35,6 +35,7 @@ static struct mm_region poplar_mem_map[] = {
 
 struct mm_region *mem_map = poplar_mem_map;
 
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct pl01x_serial_platdata serial_platdata = {
        .base = REG_BASE_UART0,
        .type = TYPE_PL010,
@@ -45,6 +46,7 @@ U_BOOT_DEVICE(poplar_serial) = {
        .name = "serial_pl01x",
        .platdata = &serial_platdata,
 };
+#endif
 
 int checkboard(void)
 {