From: Jerry Van Baren <gerald.vanbaren@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] cpu/mpc85xx/fdt.c forcing incorrect UART clock into fdt.
Date: Wed, 09 Jul 2008 07:59:31 -0400 [thread overview]
Message-ID: <4874A823.4060004@ge.com> (raw)
In-Reply-To: <20080708214229.GA25621@windriver.com>
Paul Gortmaker wrote:
> I was updating a sbc8560 from u-boot v1.2.0 to git-current, and found
> that I'd loose the kernel serial console when the 8250 driver took over
> from udbg0 when using u-boot 1.3.x (booting via tftp'ing the dtb and
> the uImage separately)
>
> I eventually tracked it down to mpc85xx/fdt.c stomping on the contents
> of the UART clockrate in the dtb. Since the sbc8560 is sort of
> different -- in that it has external UARTs (instead of SOC/CPM), I'm
> guessing few other boards see this problem, because bi_busfreq is
> really their correct UART clk.
>
> I fixed it with this simple patch, but I was wondering whether it would
> be better to alternatively just check if the dtb value is zero, and
Not defined: I would have serious heartburn if the .dts/dtb value were
defined to be zero. Define or define not, there should be no zero (with
apologies to Yoda).
> then only insert a value; otherwise leave it alone...
>
> Paul.
Changing the fixup last parameter (create) from "1" to "0" will prevent
overriding an existing value. Note that this will *not* override a
silly value (e.g. 0), so, if you do this, the dtb must either not have
the clock-frequency defined or have a correct value in that property.
This would have the good effect of allowing the board specific clock to
be defined in the dtb where it belongs, but still support the older
style approach of compiling it in.
This seems like a good improvement (your patch, but changing the "1" to
"0") to me, but I'm not a 85xx expert.
> diff --git a/cpu/mpc85xx/fdt.c b/cpu/mpc85xx/fdt.c
> index 92952e6..bd43073 100644
> --- a/cpu/mpc85xx/fdt.c
> +++ b/cpu/mpc85xx/fdt.c
> @@ -224,7 +224,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
>
> #ifdef CFG_NS16550
> do_fixup_by_compat_u32(blob, "ns16550",
> - "clock-frequency", bd->bi_busfreq, 1);
> + "clock-frequency", CFG_NS16550_CLK, 1);
> #endif
>
> #ifdef CONFIG_CPM2
Best regards,
gvb
next prev parent reply other threads:[~2008-07-09 11:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-08 21:42 [U-Boot-Users] cpu/mpc85xx/fdt.c forcing incorrect UART clock into fdt Paul Gortmaker
2008-07-09 11:59 ` Jerry Van Baren [this message]
2008-07-09 12:52 ` Kumar Gala
2008-07-09 17:08 ` Paul Gortmaker
2008-07-09 17:04 ` Jerry Van Baren
2008-07-09 17:23 ` [U-Boot-Users] [PATCH] 8xxx-fdt: set ns16550 clock from CFG_NS16550_CLK, not bi_busfreq Paul Gortmaker
2008-07-09 18:43 ` Paul Gortmaker
2008-07-09 21:53 ` Kim Phillips
2008-07-15 0:00 ` Andy Fleming
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=4874A823.4060004@ge.com \
--to=gerald.vanbaren@ge.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox