linux-mips
[Top] [All Lists]

[PATCH v2 1/4] MIPS: OCTEON: Set proper UART clock in internal device tr

To: linux-mips@linux-mips.org, ralf@linux-mips.org, Jamie Iles <jamie@jamieiles.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jslaby@suse.cz>, linux-serial@vger.kernel.org
Subject: [PATCH v2 1/4] MIPS: OCTEON: Set proper UART clock in internal device trees.
From: David Daney <ddaney.cavm@gmail.com>
Date: Wed, 19 Jun 2013 14:37:26 -0700
Cc: linux-kernel@vger.kernel.org, David Daney <david.daney@cavium.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=/CZaNWY65/oaSW2r7Ff0wWk364zvEAIZM7YJW44bGX8=; b=CzMUo0n3CpTmAkqPvSDDWKW252/AsD2HZmuZH2M2nDwF9hEYiUXciOxW6nVQTWTBdn 7C0+MuqqwrdWk4UzgXsiQbhQsOr4kxwIq45HJkzanUzWahbciYbGaInSoxXMxU40y3DV tD213fHZpXPO21IqOEsbhpYMckD0OcS8M2m60Wc1RlsTGgJq3UBQMeY3wv7w0KKcdtlE B1TAzWGvI0lWlkJFZfA8tt11zTaX2GEa3niTCz8qcBsfXaFHuevtdMk99Ea3pv42fjfy bqNw3UyKTvB6GY0YgtfJWY/CvXtuqxQJVwShIz5QvyjgeFwtYlxm3hMG+Z6lqGHVk+Kh O1Zw==
In-reply-to: <1371677849-23912-1-git-send-email-ddaney.cavm@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1371677849-23912-1-git-send-email-ddaney.cavm@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
From: David Daney <david.daney@cavium.com>

Following patch to use generic 8250 drivers will need proper clock
information.  So when using the internal device tree, populate the
"clock-frequency" property with the correct value.

Signed-off-by: David Daney <david.daney@cavium.com>
---
 arch/mips/cavium-octeon/octeon-platform.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/mips/cavium-octeon/octeon-platform.c 
b/arch/mips/cavium-octeon/octeon-platform.c
index 389512e..7b746e7 100644
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -490,8 +490,15 @@ int __init octeon_prune_device_tree(void)
 
                if (alias_prop) {
                        uart = fdt_path_offset(initial_boot_params, alias_prop);
-                       if (uart_mask & (1 << i))
+                       if (uart_mask & (1 << i)) {
+                               __be32 f;
+
+                               f = cpu_to_be32(octeon_get_io_clock_rate());
+                               fdt_setprop_inplace(initial_boot_params,
+                                                   uart, "clock-frequency",
+                                                   &f, sizeof(f));
                                continue;
+                       }
                        pr_debug("Deleting uart%d\n", i);
                        fdt_nop_node(initial_boot_params, uart);
                        fdt_nop_property(initial_boot_params, aliases,
-- 
1.7.11.7


<Prev in Thread] Current Thread [Next in Thread>