devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Simek <monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Cc: John Williams <john.williams-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org>
Subject: Early printk baudrate initialization DTS description
Date: Tue, 26 Jun 2012 13:16:42 +0200	[thread overview]
Message-ID: <4FE99A1A.4040908@monstr.eu> (raw)

Hi,

we are trying to solve one problem with early printk initialization
on Microblaze uart16550. I have also checked arm bootup code and
the situation is the same there (NOTE: This IP is possible to use on Zynq too).

The problem is about baudrate initialization. Current code just expect
that early console is initialized by previous bootloader/firmware (in our case u-boot).
But if there is not initialization and directly elf is loaded there is no initialization
done and kernel bootlog is shown when regular serial driver is probed.

I have create a solution which add baudrate initialization to Microblaze early printk code.
And also two options how to load baudrate setting from device-tree.

Code expects that early console is specified in chosen node.

chosen {
	linux,stdout-path = "/axi@0/serial@40400000";
} ;

Code finds out which IP it is and based on that initialize early printk driver.
Baudrate setting is counted from clock-frequency and current-speed defined directly in uart node.

RS232_Uart_1: serial@40400000 {
	clock-frequency = <50000000>;
	compatible = "xlnx,axi-uart16550-1.01.a", "xlnx,xps-uart16550-2.00.a", "ns16550a";
	current-speed = <115200>;
	device_type = "serial";
	reg = < 0x40400000 0x10000 >;
	reg-offset = <0x1000>;
	reg-shift = <2>;
	...irq, etc
} ;

This was the first version which is working but using current-speed is probably not the best solution.

I have also create version where baudrate is directly specified in chosen node. Clock frequency is still
loaded directly from the node.

chosen {
	linux,stdout-path = "/axi@0/serial@40400000,115200";
} ;

What solution is more compatible with device-tree?


Thanks for you comments,
Michal


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian

             reply	other threads:[~2012-06-26 11:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26 11:16 Michal Simek [this message]
     [not found] ` <4FE99A1A.4040908-pSz03upnqPeHXe+LvDLADg@public.gmane.org>
2012-06-30  1:41   ` Early printk baudrate initialization DTS description David VomLehn (dvomlehn)
     [not found]     ` <7A9214B0DEB2074FBCA688B30B04400D04C05241-2KNrN6/GZtCQwNoRDPPJJaBKnGwkPULj@public.gmane.org>
2012-07-06 10:06       ` Michal Simek

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=4FE99A1A.4040908@monstr.eu \
    --to=monstr-psz03upnqpehxe+lvdladg@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=john.williams-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).