devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, arc-linux-dev@synopsys.com,
	devicetree@vger.kernel.org, Vineet.Gupta1@synopsys.com
Subject: [PATCH 2/4] ARC: [axs101] support early 8250 uart
Date: Thu, 14 May 2015 15:48:42 +0300	[thread overview]
Message-ID: <1431607724-9142-3-git-send-email-abrodkin@synopsys.com> (raw)
In-Reply-To: <1431607724-9142-1-git-send-email-abrodkin@synopsys.com>

From: Vineet Gupta <vgupta@synopsys.com>

Earlycon calculates UART clock as "BASE_BAUD * 16". In case of ARC
"BASE_BAUD" is calculated dynamically in runtime, basically it is an
alias to arc_early_base_baud(), which in turn just does
"arc_base_baud/16".

8250 UART on AXS/SDP board uses 33.3MHz clock source which is set in
"arc_base_baud" with this change.

Additional compatibility string "snps,arc-sdp" is introduced as well
because there're different flavours of AXS boards but they all share the
same motherboard and so it's possible to re-use the same code for
motherbord even if CPU daughterboard changes.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
 Documentation/devicetree/bindings/arc/axs10x.txt | 2 +-
 arch/arc/boot/dts/axs101.dts                     | 4 ++--
 arch/arc/kernel/devtree.c                        | 2 ++
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/arc/axs10x.txt b/Documentation/devicetree/bindings/arc/axs10x.txt
index dcbb834..9021ab7 100644
--- a/Documentation/devicetree/bindings/arc/axs10x.txt
+++ b/Documentation/devicetree/bindings/arc/axs10x.txt
@@ -4,4 +4,4 @@ Synopsys DesignWare ARC Software Development Platforms Device Tree Bindings
 SDP boards with Synopsys ARC700 core shall have the following properties.
 
 Required root node properties:
-    - compatible = "snps,axs101";
+    - compatible = "snps,axs101", "snps,arc-sdp";
diff --git a/arch/arc/boot/dts/axs101.dts b/arch/arc/boot/dts/axs101.dts
index 6c3391d..3f9b058 100644
--- a/arch/arc/boot/dts/axs101.dts
+++ b/arch/arc/boot/dts/axs101.dts
@@ -13,9 +13,9 @@
 /include/ "axs10x_mb.dtsi"
 
 / {
-	compatible = "snps,axs101";
+	compatible = "snps,axs101", "snps,arc-sdp";
 
 	chosen {
-		bootargs = "console=tty0 console=ttyS3,115200n8 consoleblank=0";
+		bootargs = "earlycon=uart8250,mmio32,0xe0022000,115200n8 console=tty0 console=ttyS3,115200n8 consoleblank=0";
 	};
 };
diff --git a/arch/arc/kernel/devtree.c b/arch/arc/kernel/devtree.c
index e32b54a..f801d46 100644
--- a/arch/arc/kernel/devtree.c
+++ b/arch/arc/kernel/devtree.c
@@ -32,6 +32,8 @@ static void __init arc_set_early_base_baud(unsigned long dt_root)
 
 	if (of_flat_dt_is_compatible(dt_root, "abilis,arc-tb10x"))
 		arc_base_baud = core_clk/3;
+	else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp"))
+		arc_base_baud = 33333333;	/* Fixed 33MHz clk */
 	else
 		arc_base_baud = core_clk;
 }
-- 
2.1.0

  parent reply	other threads:[~2015-05-14 12:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 12:48 [PATCH 0/4] arc: add AXS101 board support Alexey Brodkin
2015-05-14 12:48 ` [PATCH 1/4] ARC: [axs101] Add support for AXS101 SDP (software development platform) Alexey Brodkin
2015-05-14 12:48 ` Alexey Brodkin [this message]
2015-05-14 12:53   ` [PATCH 2/4] ARC: [axs101] support early 8250 uart Arnd Bergmann
2015-05-14 13:04     ` Vineet Gupta
2015-06-05  5:02       ` Vineet Gupta
2015-06-05 13:01         ` console setting via stdout-path vs console=xxx (was Re: [PATCH 2/4] ARC: [axs101] support early 8250 uart) Vineet Gupta
2015-05-14 12:48 ` [PATCH 3/4] ARC: [axs101] Tweak DDR port aperture mappings for performance Alexey Brodkin
2015-05-14 12:48 ` [PATCH 4/4] ARC: [axs101] STAR 9000799830: Fix SD cards support Alexey Brodkin
2015-06-05 14:13 ` [PATCH 0/4] arc: add AXS101 board support Vineet Gupta

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=1431607724-9142-3-git-send-email-abrodkin@synopsys.com \
    --to=alexey.brodkin@synopsys.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=arc-linux-dev@synopsys.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).