All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: dm, serial: problem with using ns16550 driver before relocation on mpc83xx
Date: Wed, 5 Feb 2020 10:04:32 +0100	[thread overview]
Message-ID: <e617f766-083b-0cd2-690a-987fad82aaea@denx.de> (raw)

Hello Bin, Simon,

I just porting the mpc83xx based kmcoge5ne board support DTS and got
problems using the serial ns16550 driver.

I need the serial driver before rolcation, so I enabled
"u-boot,dm-pre-reloc;" as usual in the device tree, but board does not
boot ...

I found the commit:

commit 4687919684e0e4390b9fc20d1809ecaa9dc3cb81
Author: Bin Meng <bmeng.cn@gmail.com>
Date:   Wed Oct 24 06:36:36 2018 -0700

     serial: Remove DM_FLAG_PRE_RELOC flag in various drivers

which added to the ns16550 serial driver:

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 04b604fa2c..1e6fc6c668 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -487,7 +487,9 @@ U_BOOT_DRIVER(ns16550_serial) = {
         .priv_auto_alloc_size = sizeof(struct NS16550),
         .probe = ns16550_serial_probe,
         .ops    = &ns16550_serial_ops,
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
         .flags  = DM_FLAG_PRE_RELOC,
+#endif
  };
  #endif
  #endif /* SERIAL_PRESENT */

So, as OF_CONTROL is defined for me, the flag "u-boot,dm-pre-reloc" seems
not working anymore ...

Adding this back:

hs at xmglap:u-boot-secu  [20200205-temp] $ git diff
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 9851663dc5..386ca9cffa 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -528,7 +528,7 @@ U_BOOT_DRIVER(ns16550_serial) = {
         .priv_auto_alloc_size = sizeof(struct NS16550),
         .probe = ns16550_serial_probe,
         .ops    = &ns16550_serial_ops,
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
         .flags  = DM_FLAG_PRE_RELOC,
  #endif
  };

and board boots fine with the flag "u-boot,dm-pre-reloc" in DTS ...

May I do something wrong here? I found in mainline for example
the "arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi" board, which
has the exactly same dts settings than I have now.

@Dirk: Can you check, if this board boots with current mainline?

Shouldn;t be the logic, that in case OF_CONTROL is enabled and if
flag "u-boot,dm-pre-reloc" is set in DTS for the device, the device
should be bound before relocation, and we do not need to check, if
the driver sets DM_FLAG_PRE_RELOC ?

But may I miss here something ...

Any hints?

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

             reply	other threads:[~2020-02-05  9:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  9:04 Heiko Schocher [this message]
2020-02-05 17:59 ` dm, serial: problem with using ns16550 driver before relocation on mpc83xx Simon Glass
2020-02-06  5:19   ` Heiko Schocher
2020-02-06 17:46     ` Simon Glass
2020-02-07  5:53       ` Heiko Schocher
2020-02-07 17:37         ` Simon Glass
2020-02-10  6:16         ` Mario Six
2020-02-10  7:24           ` Heiko Schocher
2020-02-12  6:36           ` Heiko Schocher
2020-02-12 17:14             ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e617f766-083b-0cd2-690a-987fad82aaea@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.