* [U-Boot] [PATCH] poplar: fix boot failure caused by serial driver change
@ 2018-12-12 7:24 Shawn Guo
2018-12-12 8:24 ` Igor Opaniuk
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Shawn Guo @ 2018-12-12 7:24 UTC (permalink / raw)
To: u-boot
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>
---
arch/arm/dts/hi3798cv200-u-boot.dtsi | 10 ++--------
board/hisilicon/poplar/poplar.c | 2 ++
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/arm/dts/hi3798cv200-u-boot.dtsi b/arch/arm/dts/hi3798cv200-u-boot.dtsi
index 709ae1cbc9f3..7844c5208c5d 100644
--- a/arch/arm/dts/hi3798cv200-u-boot.dtsi
+++ b/arch/arm/dts/hi3798cv200-u-boot.dtsi
@@ -17,12 +17,6 @@
};
&uart0 {
- status = "disabled";
+ clock = <75000000>;
+ status = "okay";
};
-
-/{
- chosen {
- stdout-path = "";
- };
-};
-
diff --git a/board/hisilicon/poplar/poplar.c b/board/hisilicon/poplar/poplar.c
index 9e8eac78388b..8adc750962a1 100644
--- a/board/hisilicon/poplar/poplar.c
+++ b/board/hisilicon/poplar/poplar.c
@@ -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)
{
--
2.18.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] poplar: fix boot failure caused by serial driver change
2018-12-12 7:24 [U-Boot] [PATCH] poplar: fix boot failure caused by serial driver change Shawn Guo
@ 2018-12-12 8:24 ` Igor Opaniuk
2018-12-12 12:54 ` Bin Meng
2018-12-17 12:11 ` [U-Boot] " Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Igor Opaniuk @ 2018-12-12 8:24 UTC (permalink / raw)
To: u-boot
Hi Shawn,
Thanks, that fixes the problem!
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Tested-by: Igor Opaniuk <igor.opaniuk@linaro.org>
On Wed, 12 Dec 2018 at 09:25, Shawn Guo <shawn.guo@linaro.org> wrote:
>
> 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>
> ---
> arch/arm/dts/hi3798cv200-u-boot.dtsi | 10 ++--------
> board/hisilicon/poplar/poplar.c | 2 ++
> 2 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/dts/hi3798cv200-u-boot.dtsi b/arch/arm/dts/hi3798cv200-u-boot.dtsi
> index 709ae1cbc9f3..7844c5208c5d 100644
> --- a/arch/arm/dts/hi3798cv200-u-boot.dtsi
> +++ b/arch/arm/dts/hi3798cv200-u-boot.dtsi
> @@ -17,12 +17,6 @@
> };
>
> &uart0 {
> - status = "disabled";
> + clock = <75000000>;
> + status = "okay";
> };
> -
> -/{
> - chosen {
> - stdout-path = "";
> - };
> -};
> -
> diff --git a/board/hisilicon/poplar/poplar.c b/board/hisilicon/poplar/poplar.c
> index 9e8eac78388b..8adc750962a1 100644
> --- a/board/hisilicon/poplar/poplar.c
> +++ b/board/hisilicon/poplar/poplar.c
> @@ -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)
> {
> --
> 2.18.0
>
--
Regards,
Igor Opaniuk
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] poplar: fix boot failure caused by serial driver change
2018-12-12 7:24 [U-Boot] [PATCH] poplar: fix boot failure caused by serial driver change Shawn Guo
2018-12-12 8:24 ` Igor Opaniuk
@ 2018-12-12 12:54 ` Bin Meng
2018-12-17 12:11 ` [U-Boot] " Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Bin Meng @ 2018-12-12 12:54 UTC (permalink / raw)
To: u-boot
Hi Shawn,
On Wed, Dec 12, 2018 at 3:25 PM Shawn Guo <shawn.guo@linaro.org> wrote:
>
> 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>
> ---
> arch/arm/dts/hi3798cv200-u-boot.dtsi | 10 ++--------
> board/hisilicon/poplar/poplar.c | 2 ++
> 2 files changed, 4 insertions(+), 8 deletions(-)
>
Thanks for the fix! It looks good to me.
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Regards,
Bin
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] poplar: fix boot failure caused by serial driver change
2018-12-12 7:24 [U-Boot] [PATCH] poplar: fix boot failure caused by serial driver change Shawn Guo
2018-12-12 8:24 ` Igor Opaniuk
2018-12-12 12:54 ` Bin Meng
@ 2018-12-17 12:11 ` Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2018-12-17 12:11 UTC (permalink / raw)
To: u-boot
On Wed, Dec 12, 2018 at 03:24:44PM +0800, Shawn Guo wrote:
> 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>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181217/11c487af/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-17 12:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-12 7:24 [U-Boot] [PATCH] poplar: fix boot failure caused by serial driver change Shawn Guo
2018-12-12 8:24 ` Igor Opaniuk
2018-12-12 12:54 ` Bin Meng
2018-12-17 12:11 ` [U-Boot] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox