netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] MIPS: BCM63XX: add and use clkdev lookup support
@ 2017-08-02  9:34 Jonas Gorski
  2017-08-02  9:34 ` [PATCH 1/8] MIPS: BCM63XX: add " Jonas Gorski
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Jonas Gorski @ 2017-08-02  9:34 UTC (permalink / raw)
  To: linux-mips, linux-arm-kernel, linux-serial, devicetree, netdev
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli, bcm-kernel-feedback-list, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

This patchset adds and uses clckdev lookup support to name input clocks
in various drivers more closely to their functions, or simplify their
usage.

Since most of these patches touch arch/mips, it probably makes most
sense to go through the MIPS tree.

The HSSPI driver was already updated previously to support a "pll"
input with ff18e1ef04e2 ("spi/bcm63xx-hsspi: allow providing clock rate
through a second clock"), so there is no need to touch it.

This patch series is part of an effort to modernize BCM63XX and clean up
its drivers to eventually make them usable with BMIPS and device tree.

Jonas Gorski (8):
  MIPS: BCM63XX: add clkdev lookup support
  MIPS: BCM63XX: provide periph clock as refclk for uart
  tty/bcm63xx_uart: use refclk for the expected clock name
  tty/bcm63xx_uart: allow naming clock in device tree
  MIPS: BCM63XX: provide enet clocks as "enet" to the ethernet devices
  bcm63xx_enet: just use "enet" as the clock name
  MIPS: BCM63XX: move the HSSPI PLL HZ into its own clock
  MIPS: BMIPS: name the refclk clock for uart

 .../bindings/serial/brcm,bcm6345-uart.txt          |   6 +
 arch/mips/Kconfig                                  |   1 +
 arch/mips/bcm63xx/clk.c                            | 181 ++++++++++++++++-----
 arch/mips/boot/dts/brcm/bcm3368.dtsi               |   2 +
 arch/mips/boot/dts/brcm/bcm63268.dtsi              |   2 +
 arch/mips/boot/dts/brcm/bcm6328.dtsi               |   2 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi               |   2 +
 arch/mips/boot/dts/brcm/bcm6362.dtsi               |   2 +
 arch/mips/boot/dts/brcm/bcm6368.dtsi               |   2 +
 drivers/net/ethernet/broadcom/bcm63xx_enet.c       |   5 +-
 drivers/tty/serial/bcm63xx_uart.c                  |   6 +-
 11 files changed, 168 insertions(+), 43 deletions(-)

-- 
2.13.2

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/8] MIPS: BCM63XX: add clkdev lookup support
  2017-08-02  9:34 [PATCH 0/8] MIPS: BCM63XX: add and use clkdev lookup support Jonas Gorski
@ 2017-08-02  9:34 ` Jonas Gorski
  2017-08-02  9:34 ` [PATCH 2/8] MIPS: BCM63XX: provide periph clock as refclk for uart Jonas Gorski
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Jonas Gorski @ 2017-08-02  9:34 UTC (permalink / raw)
  To: linux-mips, linux-arm-kernel, linux-serial, devicetree, netdev
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli, bcm-kernel-feedback-list, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

Enable clkdev lookup support to allow us providing clocks under
different names to devices more easily, so we don't need to care
about clock name clashes anymore.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 arch/mips/Kconfig       |   1 +
 arch/mips/bcm63xx/clk.c | 150 +++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 116 insertions(+), 35 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8dd20358464f..1bc4c5e1fc8e 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -275,6 +275,7 @@ config BCM63XX
 	select GPIOLIB
 	select HAVE_CLK
 	select MIPS_L1_CACHE_SHIFT_4
+	select CLKDEV_LOOKUP
 	help
 	 Support for BCM63XX based boards
 
diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index 73626040e4d6..eb1cb0bf930b 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -11,6 +11,7 @@
 #include <linux/mutex.h>
 #include <linux/err.h>
 #include <linux/clk.h>
+#include <linux/clkdev.h>
 #include <linux/delay.h>
 #include <bcm63xx_cpu.h>
 #include <bcm63xx_io.h>
@@ -356,44 +357,103 @@ long clk_round_rate(struct clk *clk, unsigned long rate)
 }
 EXPORT_SYMBOL_GPL(clk_round_rate);
 
-struct clk *clk_get(struct device *dev, const char *id)
-{
-	if (!strcmp(id, "enet0"))
-		return &clk_enet0;
-	if (!strcmp(id, "enet1"))
-		return &clk_enet1;
-	if (!strcmp(id, "enetsw"))
-		return &clk_enetsw;
-	if (!strcmp(id, "ephy"))
-		return &clk_ephy;
-	if (!strcmp(id, "usbh"))
-		return &clk_usbh;
-	if (!strcmp(id, "usbd"))
-		return &clk_usbd;
-	if (!strcmp(id, "spi"))
-		return &clk_spi;
-	if (!strcmp(id, "hsspi"))
-		return &clk_hsspi;
-	if (!strcmp(id, "xtm"))
-		return &clk_xtm;
-	if (!strcmp(id, "periph"))
-		return &clk_periph;
-	if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm"))
-		return &clk_pcm;
-	if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec"))
-		return &clk_ipsec;
-	if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie"))
-		return &clk_pcie;
-	return ERR_PTR(-ENOENT);
-}
+static struct clk_lookup bcm3368_clks[] = {
+	/* fixed rate clocks */
+	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	/* gated clocks */
+	CLKDEV_INIT(NULL, "enet0", &clk_enet0),
+	CLKDEV_INIT(NULL, "enet1", &clk_enet1),
+	CLKDEV_INIT(NULL, "ephy", &clk_ephy),
+	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+	CLKDEV_INIT(NULL, "spi", &clk_spi),
+	CLKDEV_INIT(NULL, "pcm", &clk_pcm),
+};
 
-EXPORT_SYMBOL(clk_get);
+static struct clk_lookup bcm6328_clks[] = {
+	/* fixed rate clocks */
+	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	/* gated clocks */
+	CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
+	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+	CLKDEV_INIT(NULL, "hsspi", &clk_hsspi),
+	CLKDEV_INIT(NULL, "pcie", &clk_pcie),
+};
 
-void clk_put(struct clk *clk)
-{
-}
+static struct clk_lookup bcm6338_clks[] = {
+	/* fixed rate clocks */
+	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	/* gated clocks */
+	CLKDEV_INIT(NULL, "enet0", &clk_enet0),
+	CLKDEV_INIT(NULL, "enet1", &clk_enet1),
+	CLKDEV_INIT(NULL, "ephy", &clk_ephy),
+	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+	CLKDEV_INIT(NULL, "spi", &clk_spi),
+};
+
+static struct clk_lookup bcm6345_clks[] = {
+	/* fixed rate clocks */
+	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	/* gated clocks */
+	CLKDEV_INIT(NULL, "enet0", &clk_enet0),
+	CLKDEV_INIT(NULL, "enet1", &clk_enet1),
+	CLKDEV_INIT(NULL, "ephy", &clk_ephy),
+	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+	CLKDEV_INIT(NULL, "spi", &clk_spi),
+};
+
+static struct clk_lookup bcm6348_clks[] = {
+	/* fixed rate clocks */
+	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	/* gated clocks */
+	CLKDEV_INIT(NULL, "enet0", &clk_enet0),
+	CLKDEV_INIT(NULL, "enet1", &clk_enet1),
+	CLKDEV_INIT(NULL, "ephy", &clk_ephy),
+	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+	CLKDEV_INIT(NULL, "spi", &clk_spi),
+};
 
-EXPORT_SYMBOL(clk_put);
+static struct clk_lookup bcm6358_clks[] = {
+	/* fixed rate clocks */
+	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	/* gated clocks */
+	CLKDEV_INIT(NULL, "enet0", &clk_enet0),
+	CLKDEV_INIT(NULL, "enet1", &clk_enet1),
+	CLKDEV_INIT(NULL, "ephy", &clk_ephy),
+	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+	CLKDEV_INIT(NULL, "spi", &clk_spi),
+	CLKDEV_INIT(NULL, "pcm", &clk_pcm),
+};
+
+static struct clk_lookup bcm6362_clks[] = {
+	/* fixed rate clocks */
+	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	/* gated clocks */
+	CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
+	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+	CLKDEV_INIT(NULL, "spi", &clk_spi),
+	CLKDEV_INIT(NULL, "hsspi", &clk_hsspi),
+	CLKDEV_INIT(NULL, "pcie", &clk_pcie),
+	CLKDEV_INIT(NULL, "ipsec", &clk_ipsec),
+};
+
+static struct clk_lookup bcm6368_clks[] = {
+	/* fixed rate clocks */
+	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	/* gated clocks */
+	CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
+	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
+	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
+	CLKDEV_INIT(NULL, "spi", &clk_spi),
+	CLKDEV_INIT(NULL, "xtm", &clk_xtm),
+	CLKDEV_INIT(NULL, "ipsec", &clk_ipsec),
+};
 
 #define HSSPI_PLL_HZ_6328	133333333
 #define HSSPI_PLL_HZ_6362	400000000
@@ -401,11 +461,31 @@ EXPORT_SYMBOL(clk_put);
 static int __init bcm63xx_clk_init(void)
 {
 	switch (bcm63xx_get_cpu_id()) {
+	case BCM3368_CPU_ID:
+		clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks));
+		break;
 	case BCM6328_CPU_ID:
 		clk_hsspi.rate = HSSPI_PLL_HZ_6328;
+		clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks));
+		break;
+	case BCM6338_CPU_ID:
+		clkdev_add_table(bcm6338_clks, ARRAY_SIZE(bcm6338_clks));
+		break;
+	case BCM6345_CPU_ID:
+		clkdev_add_table(bcm6345_clks, ARRAY_SIZE(bcm6345_clks));
+		break;
+	case BCM6348_CPU_ID:
+		clkdev_add_table(bcm6348_clks, ARRAY_SIZE(bcm6348_clks));
+		break;
+	case BCM6358_CPU_ID:
+		clkdev_add_table(bcm6358_clks, ARRAY_SIZE(bcm6358_clks));
 		break;
 	case BCM6362_CPU_ID:
 		clk_hsspi.rate = HSSPI_PLL_HZ_6362;
+		clkdev_add_table(bcm6362_clks, ARRAY_SIZE(bcm6362_clks));
+		break;
+	case BCM6368_CPU_ID:
+		clkdev_add_table(bcm6368_clks, ARRAY_SIZE(bcm6368_clks));
 		break;
 	}
 
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/8] MIPS: BCM63XX: provide periph clock as refclk for uart
  2017-08-02  9:34 [PATCH 0/8] MIPS: BCM63XX: add and use clkdev lookup support Jonas Gorski
  2017-08-02  9:34 ` [PATCH 1/8] MIPS: BCM63XX: add " Jonas Gorski
@ 2017-08-02  9:34 ` Jonas Gorski
       [not found] ` <20170802093429.12572-1-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Jonas Gorski @ 2017-08-02  9:34 UTC (permalink / raw)
  To: linux-mips, linux-arm-kernel, linux-serial, devicetree, netdev
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli, bcm-kernel-feedback-list, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

Add a lookup as "refclk" to describe its function for the uarts.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 arch/mips/bcm63xx/clk.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index eb1cb0bf930b..0b898e5e4c5b 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -360,6 +360,8 @@ EXPORT_SYMBOL_GPL(clk_round_rate);
 static struct clk_lookup bcm3368_clks[] = {
 	/* fixed rate clocks */
 	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
 	/* gated clocks */
 	CLKDEV_INIT(NULL, "enet0", &clk_enet0),
 	CLKDEV_INIT(NULL, "enet1", &clk_enet1),
@@ -373,6 +375,8 @@ static struct clk_lookup bcm3368_clks[] = {
 static struct clk_lookup bcm6328_clks[] = {
 	/* fixed rate clocks */
 	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
 	/* gated clocks */
 	CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
 	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
@@ -384,6 +388,7 @@ static struct clk_lookup bcm6328_clks[] = {
 static struct clk_lookup bcm6338_clks[] = {
 	/* fixed rate clocks */
 	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
 	/* gated clocks */
 	CLKDEV_INIT(NULL, "enet0", &clk_enet0),
 	CLKDEV_INIT(NULL, "enet1", &clk_enet1),
@@ -396,6 +401,7 @@ static struct clk_lookup bcm6338_clks[] = {
 static struct clk_lookup bcm6345_clks[] = {
 	/* fixed rate clocks */
 	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
 	/* gated clocks */
 	CLKDEV_INIT(NULL, "enet0", &clk_enet0),
 	CLKDEV_INIT(NULL, "enet1", &clk_enet1),
@@ -408,6 +414,7 @@ static struct clk_lookup bcm6345_clks[] = {
 static struct clk_lookup bcm6348_clks[] = {
 	/* fixed rate clocks */
 	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
 	/* gated clocks */
 	CLKDEV_INIT(NULL, "enet0", &clk_enet0),
 	CLKDEV_INIT(NULL, "enet1", &clk_enet1),
@@ -420,6 +427,8 @@ static struct clk_lookup bcm6348_clks[] = {
 static struct clk_lookup bcm6358_clks[] = {
 	/* fixed rate clocks */
 	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
 	/* gated clocks */
 	CLKDEV_INIT(NULL, "enet0", &clk_enet0),
 	CLKDEV_INIT(NULL, "enet1", &clk_enet1),
@@ -433,6 +442,8 @@ static struct clk_lookup bcm6358_clks[] = {
 static struct clk_lookup bcm6362_clks[] = {
 	/* fixed rate clocks */
 	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
 	/* gated clocks */
 	CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
 	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
@@ -446,6 +457,8 @@ static struct clk_lookup bcm6362_clks[] = {
 static struct clk_lookup bcm6368_clks[] = {
 	/* fixed rate clocks */
 	CLKDEV_INIT(NULL, "periph", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
+	CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
 	/* gated clocks */
 	CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
 	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/8] tty/bcm63xx_uart: use refclk for the expected clock name
       [not found] ` <20170802093429.12572-1-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-08-02  9:34   ` Jonas Gorski
       [not found]     ` <20170802093429.12572-4-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2017-08-02  9:34   ` [PATCH 6/8] bcm63xx_enet: just use "enet" as the " Jonas Gorski
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 16+ messages in thread
From: Jonas Gorski @ 2017-08-02  9:34 UTC (permalink / raw)
  To: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli,
	bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

We now have the clock available under refclk, so use that.

Signed-off-by: Jonas Gorski <jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/tty/serial/bcm63xx_uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index 583c9a0c7ecc..a2b9376ec861 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
@@ -842,7 +842,7 @@ static int bcm_uart_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) :
-				  clk_get(&pdev->dev, "periph");
+				  clk_get(&pdev->dev, "refclk");
 	if (IS_ERR(clk))
 		return -ENODEV;
 
-- 
2.13.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/8] tty/bcm63xx_uart: allow naming clock in device tree
  2017-08-02  9:34 [PATCH 0/8] MIPS: BCM63XX: add and use clkdev lookup support Jonas Gorski
                   ` (2 preceding siblings ...)
       [not found] ` <20170802093429.12572-1-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-08-02  9:34 ` Jonas Gorski
  2017-08-10 16:25   ` Rob Herring
       [not found]   ` <20170802093429.12572-5-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2017-08-02  9:34 ` [PATCH 5/8] MIPS: BCM63XX: provide enet clocks as "enet" to the ethernet devices Jonas Gorski
  2017-08-02  9:34 ` [PATCH 7/8] MIPS: BCM63XX: move the HSSPI PLL HZ into its own clock Jonas Gorski
  5 siblings, 2 replies; 16+ messages in thread
From: Jonas Gorski @ 2017-08-02  9:34 UTC (permalink / raw)
  To: linux-mips, linux-arm-kernel, linux-serial, devicetree, netdev
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli, bcm-kernel-feedback-list, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

Codify using a named clock for the refclk of the uart. This makes it
easier if we might need to add a gating clock (like present on the
BCM6345).

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt | 6 ++++++
 drivers/tty/serial/bcm63xx_uart.c                              | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
index 5c52e5eef16d..8b2b0460259a 100644
--- a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
+++ b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
@@ -11,6 +11,11 @@ Required properties:
 - clocks: Clock driving the hardware; used to figure out the baud rate
   divisor.
 
+
+Optional properties:
+
+- clock-names: Should be "refclk".
+
 Example:
 
 	uart0: serial@14e00520 {
@@ -19,6 +24,7 @@ Example:
 		interrupt-parent = <&periph_intc>;
 		interrupts = <2>;
 		clocks = <&periph_clk>;
+		clock-names = "refclk";
 	};
 
 	clocks {
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index a2b9376ec861..f227eff28d3a 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
@@ -841,8 +841,10 @@ static int bcm_uart_probe(struct platform_device *pdev)
 	if (!res_irq)
 		return -ENODEV;
 
-	clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) :
-				  clk_get(&pdev->dev, "refclk");
+	clk = clk_get(&pdev->dev, "refclk");
+	if (IS_ERR(clk) && pdev->dev.of_node)
+		clk = of_clk_get(pdev->dev.of_node, 0);
+
 	if (IS_ERR(clk))
 		return -ENODEV;
 
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 5/8] MIPS: BCM63XX: provide enet clocks as "enet" to the ethernet devices
  2017-08-02  9:34 [PATCH 0/8] MIPS: BCM63XX: add and use clkdev lookup support Jonas Gorski
                   ` (3 preceding siblings ...)
  2017-08-02  9:34 ` [PATCH 4/8] tty/bcm63xx_uart: allow naming clock in device tree Jonas Gorski
@ 2017-08-02  9:34 ` Jonas Gorski
  2017-08-02  9:34 ` [PATCH 7/8] MIPS: BCM63XX: move the HSSPI PLL HZ into its own clock Jonas Gorski
  5 siblings, 0 replies; 16+ messages in thread
From: Jonas Gorski @ 2017-08-02  9:34 UTC (permalink / raw)
  To: linux-mips, linux-arm-kernel, linux-serial, devicetree, netdev
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli, bcm-kernel-feedback-list, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

Add lookups to provide the appropriate enetX clocks as just "enet" to
the ethernet devices.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 arch/mips/bcm63xx/clk.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index 0b898e5e4c5b..8a089a92e029 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -370,6 +370,8 @@ static struct clk_lookup bcm3368_clks[] = {
 	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
 	CLKDEV_INIT(NULL, "spi", &clk_spi),
 	CLKDEV_INIT(NULL, "pcm", &clk_pcm),
+	CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0),
+	CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1),
 };
 
 static struct clk_lookup bcm6328_clks[] = {
@@ -396,6 +398,7 @@ static struct clk_lookup bcm6338_clks[] = {
 	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
 	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
 	CLKDEV_INIT(NULL, "spi", &clk_spi),
+	CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc),
 };
 
 static struct clk_lookup bcm6345_clks[] = {
@@ -409,6 +412,7 @@ static struct clk_lookup bcm6345_clks[] = {
 	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
 	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
 	CLKDEV_INIT(NULL, "spi", &clk_spi),
+	CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc),
 };
 
 static struct clk_lookup bcm6348_clks[] = {
@@ -422,6 +426,8 @@ static struct clk_lookup bcm6348_clks[] = {
 	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
 	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
 	CLKDEV_INIT(NULL, "spi", &clk_spi),
+	CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc),
+	CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet_misc),
 };
 
 static struct clk_lookup bcm6358_clks[] = {
@@ -437,6 +443,8 @@ static struct clk_lookup bcm6358_clks[] = {
 	CLKDEV_INIT(NULL, "usbd", &clk_usbd),
 	CLKDEV_INIT(NULL, "spi", &clk_spi),
 	CLKDEV_INIT(NULL, "pcm", &clk_pcm),
+	CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0),
+	CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1),
 };
 
 static struct clk_lookup bcm6362_clks[] = {
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 6/8] bcm63xx_enet: just use "enet" as the clock name
       [not found] ` <20170802093429.12572-1-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2017-08-02  9:34   ` [PATCH 3/8] tty/bcm63xx_uart: use refclk for the expected clock name Jonas Gorski
@ 2017-08-02  9:34   ` Jonas Gorski
  2017-09-06 11:00     ` Jonas Gorski
  2017-08-02  9:34   ` [PATCH 8/8] MIPS: BMIPS: name the refclk clock for uart Jonas Gorski
  2017-08-15 16:20   ` [PATCH 0/8] MIPS: BCM63XX: add and use clkdev lookup support Florian Fainelli
  3 siblings, 1 reply; 16+ messages in thread
From: Jonas Gorski @ 2017-08-02  9:34 UTC (permalink / raw)
  To: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli,
	bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

Now that we have the individual clocks available as "enet" we
don't need to rely on the device id for them anymore.

Signed-off-by: Jonas Gorski <jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 61a88b64bd39..d6844923a1c0 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1718,7 +1718,6 @@ static int bcm_enet_probe(struct platform_device *pdev)
 	struct bcm63xx_enet_platform_data *pd;
 	struct resource *res_mem, *res_irq, *res_irq_rx, *res_irq_tx;
 	struct mii_bus *bus;
-	const char *clk_name;
 	int i, ret;
 
 	/* stop if shared driver failed, assume driver->probe will be
@@ -1761,14 +1760,12 @@ static int bcm_enet_probe(struct platform_device *pdev)
 	if (priv->mac_id == 0) {
 		priv->rx_chan = 0;
 		priv->tx_chan = 1;
-		clk_name = "enet0";
 	} else {
 		priv->rx_chan = 2;
 		priv->tx_chan = 3;
-		clk_name = "enet1";
 	}
 
-	priv->mac_clk = clk_get(&pdev->dev, clk_name);
+	priv->mac_clk = clk_get(&pdev->dev, "enet");
 	if (IS_ERR(priv->mac_clk)) {
 		ret = PTR_ERR(priv->mac_clk);
 		goto out;
-- 
2.13.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 7/8] MIPS: BCM63XX: move the HSSPI PLL HZ into its own clock
  2017-08-02  9:34 [PATCH 0/8] MIPS: BCM63XX: add and use clkdev lookup support Jonas Gorski
                   ` (4 preceding siblings ...)
  2017-08-02  9:34 ` [PATCH 5/8] MIPS: BCM63XX: provide enet clocks as "enet" to the ethernet devices Jonas Gorski
@ 2017-08-02  9:34 ` Jonas Gorski
  5 siblings, 0 replies; 16+ messages in thread
From: Jonas Gorski @ 2017-08-02  9:34 UTC (permalink / raw)
  To: linux-mips, linux-arm-kernel, linux-serial, devicetree, netdev
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli, bcm-kernel-feedback-list, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

Split up the HSSPL clock into rate and a gate clock, to more closely
match the actual hardware.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 arch/mips/bcm63xx/clk.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index 8a089a92e029..884099de097f 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -248,6 +248,10 @@ static struct clk clk_hsspi = {
 	.set	= hsspi_set,
 };
 
+/*
+ * HSSPI PLL
+ */
+static struct clk clk_hsspi_pll;
 
 /*
  * XTM clock
@@ -379,6 +383,7 @@ static struct clk_lookup bcm6328_clks[] = {
 	CLKDEV_INIT(NULL, "periph", &clk_periph),
 	CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
 	CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
+	CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll),
 	/* gated clocks */
 	CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
 	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
@@ -452,6 +457,7 @@ static struct clk_lookup bcm6362_clks[] = {
 	CLKDEV_INIT(NULL, "periph", &clk_periph),
 	CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
 	CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
+	CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll),
 	/* gated clocks */
 	CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
 	CLKDEV_INIT(NULL, "usbh", &clk_usbh),
@@ -486,7 +492,7 @@ static int __init bcm63xx_clk_init(void)
 		clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks));
 		break;
 	case BCM6328_CPU_ID:
-		clk_hsspi.rate = HSSPI_PLL_HZ_6328;
+		clk_hsspi_pll.rate = HSSPI_PLL_HZ_6328;
 		clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks));
 		break;
 	case BCM6338_CPU_ID:
@@ -502,7 +508,7 @@ static int __init bcm63xx_clk_init(void)
 		clkdev_add_table(bcm6358_clks, ARRAY_SIZE(bcm6358_clks));
 		break;
 	case BCM6362_CPU_ID:
-		clk_hsspi.rate = HSSPI_PLL_HZ_6362;
+		clk_hsspi_pll.rate = HSSPI_PLL_HZ_6362;
 		clkdev_add_table(bcm6362_clks, ARRAY_SIZE(bcm6362_clks));
 		break;
 	case BCM6368_CPU_ID:
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 8/8] MIPS: BMIPS: name the refclk clock for uart
       [not found] ` <20170802093429.12572-1-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2017-08-02  9:34   ` [PATCH 3/8] tty/bcm63xx_uart: use refclk for the expected clock name Jonas Gorski
  2017-08-02  9:34   ` [PATCH 6/8] bcm63xx_enet: just use "enet" as the " Jonas Gorski
@ 2017-08-02  9:34   ` Jonas Gorski
  2017-08-15 16:20   ` [PATCH 0/8] MIPS: BCM63XX: add and use clkdev lookup support Florian Fainelli
  3 siblings, 0 replies; 16+ messages in thread
From: Jonas Gorski @ 2017-08-02  9:34 UTC (permalink / raw)
  To: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli,
	bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

Add the clock name to the uart nodes, to name the input clock
properly.

Signed-off-by: Jonas Gorski <jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 arch/mips/boot/dts/brcm/bcm3368.dtsi  | 2 ++
 arch/mips/boot/dts/brcm/bcm63268.dtsi | 2 ++
 arch/mips/boot/dts/brcm/bcm6328.dtsi  | 2 ++
 arch/mips/boot/dts/brcm/bcm6358.dtsi  | 2 ++
 arch/mips/boot/dts/brcm/bcm6362.dtsi  | 2 ++
 arch/mips/boot/dts/brcm/bcm6368.dtsi  | 2 ++
 6 files changed, 12 insertions(+)

diff --git a/arch/mips/boot/dts/brcm/bcm3368.dtsi b/arch/mips/boot/dts/brcm/bcm3368.dtsi
index bee855cb8073..772fb42b7730 100644
--- a/arch/mips/boot/dts/brcm/bcm3368.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm3368.dtsi
@@ -82,6 +82,7 @@
 			interrupts = <2>;
 
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 
 			status = "disabled";
 		};
@@ -94,6 +95,7 @@
 			interrupts = <3>;
 
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 
 			status = "disabled";
 		};
diff --git a/arch/mips/boot/dts/brcm/bcm63268.dtsi b/arch/mips/boot/dts/brcm/bcm63268.dtsi
index 7e6bf2cc0287..b033a23b5e13 100644
--- a/arch/mips/boot/dts/brcm/bcm63268.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm63268.dtsi
@@ -83,6 +83,7 @@
 			interrupts = <5>;
 
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 
 			status = "disabled";
 		};
@@ -95,6 +96,7 @@
 			interrupts = <34>;
 
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 
 			status = "disabled";
 		};
diff --git a/arch/mips/boot/dts/brcm/bcm6328.dtsi b/arch/mips/boot/dts/brcm/bcm6328.dtsi
index 5633b9d90f55..7c3061ba6d38 100644
--- a/arch/mips/boot/dts/brcm/bcm6328.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm6328.dtsi
@@ -68,6 +68,7 @@
 			interrupt-parent = <&periph_intc>;
 			interrupts = <28>;
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 			status = "disabled";
 		};
 
@@ -77,6 +78,7 @@
 			interrupt-parent = <&periph_intc>;
 			interrupts = <39>;
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 			status = "disabled";
 		};
 
diff --git a/arch/mips/boot/dts/brcm/bcm6358.dtsi b/arch/mips/boot/dts/brcm/bcm6358.dtsi
index f9d8d392162b..ab9d6c268a84 100644
--- a/arch/mips/boot/dts/brcm/bcm6358.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm6358.dtsi
@@ -92,6 +92,7 @@
 			interrupts = <2>;
 
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 
 			status = "disabled";
 		};
@@ -104,6 +105,7 @@
 			interrupts = <3>;
 
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 
 			status = "disabled";
 		};
diff --git a/arch/mips/boot/dts/brcm/bcm6362.dtsi b/arch/mips/boot/dts/brcm/bcm6362.dtsi
index c507da594f2f..ca93c9a6f23f 100644
--- a/arch/mips/boot/dts/brcm/bcm6362.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm6362.dtsi
@@ -83,6 +83,7 @@
 			interrupts = <3>;
 
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 
 			status = "disabled";
 		};
@@ -95,6 +96,7 @@
 			interrupts = <4>;
 
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 
 			status = "disabled";
 		};
diff --git a/arch/mips/boot/dts/brcm/bcm6368.dtsi b/arch/mips/boot/dts/brcm/bcm6368.dtsi
index d0e3a70b32e2..da4ec89710fd 100644
--- a/arch/mips/boot/dts/brcm/bcm6368.dtsi
+++ b/arch/mips/boot/dts/brcm/bcm6368.dtsi
@@ -89,6 +89,7 @@
 			interrupt-parent = <&periph_intc>;
 			interrupts = <2>;
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 			status = "disabled";
 		};
 
@@ -98,6 +99,7 @@
 			interrupt-parent = <&periph_intc>;
 			interrupts = <3>;
 			clocks = <&periph_clk>;
+			clock-names = "refclk";
 			status = "disabled";
 		};
 
-- 
2.13.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/8] tty/bcm63xx_uart: allow naming clock in device tree
  2017-08-02  9:34 ` [PATCH 4/8] tty/bcm63xx_uart: allow naming clock in device tree Jonas Gorski
@ 2017-08-10 16:25   ` Rob Herring
       [not found]   ` <20170802093429.12572-5-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  1 sibling, 0 replies; 16+ messages in thread
From: Rob Herring @ 2017-08-10 16:25 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: linux-mips, linux-arm-kernel, linux-serial, devicetree, netdev,
	Greg Kroah-Hartman, Mark Rutland, Ralf Baechle, Florian Fainelli,
	bcm-kernel-feedback-list, Kevin Cernekee, Jiri Slaby,
	David S. Miller, Russell King

On Wed, Aug 02, 2017 at 11:34:25AM +0200, Jonas Gorski wrote:
> Codify using a named clock for the refclk of the uart. This makes it
> easier if we might need to add a gating clock (like present on the
> BCM6345).
> 
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
> ---
>  Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt | 6 ++++++
>  drivers/tty/serial/bcm63xx_uart.c                              | 6 ++++--
>  2 files changed, 10 insertions(+), 2 deletions(-)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/8] MIPS: BCM63XX: add and use clkdev lookup support
       [not found] ` <20170802093429.12572-1-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
                     ` (2 preceding siblings ...)
  2017-08-02  9:34   ` [PATCH 8/8] MIPS: BMIPS: name the refclk clock for uart Jonas Gorski
@ 2017-08-15 16:20   ` Florian Fainelli
  3 siblings, 0 replies; 16+ messages in thread
From: Florian Fainelli @ 2017-08-15 16:20 UTC (permalink / raw)
  To: Jonas Gorski, linux-mips-6z/3iImG2C8G8FEW9MqTrA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King



On 08/02/2017 02:34 AM, Jonas Gorski wrote:
> This patchset adds and uses clckdev lookup support to name input clocks
> in various drivers more closely to their functions, or simplify their
> usage.
> 
> Since most of these patches touch arch/mips, it probably makes most
> sense to go through the MIPS tree.
> 
> The HSSPI driver was already updated previously to support a "pll"
> input with ff18e1ef04e2 ("spi/bcm63xx-hsspi: allow providing clock rate
> through a second clock"), so there is no need to touch it.
> 
> This patch series is part of an effort to modernize BCM63XX and clean up
> its drivers to eventually make them usable with BMIPS and device tree.

For this entire series:

Reviewed-by: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Thanks!

> 
> Jonas Gorski (8):
>   MIPS: BCM63XX: add clkdev lookup support
>   MIPS: BCM63XX: provide periph clock as refclk for uart
>   tty/bcm63xx_uart: use refclk for the expected clock name
>   tty/bcm63xx_uart: allow naming clock in device tree
>   MIPS: BCM63XX: provide enet clocks as "enet" to the ethernet devices
>   bcm63xx_enet: just use "enet" as the clock name
>   MIPS: BCM63XX: move the HSSPI PLL HZ into its own clock
>   MIPS: BMIPS: name the refclk clock for uart
> 
>  .../bindings/serial/brcm,bcm6345-uart.txt          |   6 +
>  arch/mips/Kconfig                                  |   1 +
>  arch/mips/bcm63xx/clk.c                            | 181 ++++++++++++++++-----
>  arch/mips/boot/dts/brcm/bcm3368.dtsi               |   2 +
>  arch/mips/boot/dts/brcm/bcm63268.dtsi              |   2 +
>  arch/mips/boot/dts/brcm/bcm6328.dtsi               |   2 +
>  arch/mips/boot/dts/brcm/bcm6358.dtsi               |   2 +
>  arch/mips/boot/dts/brcm/bcm6362.dtsi               |   2 +
>  arch/mips/boot/dts/brcm/bcm6368.dtsi               |   2 +
>  drivers/net/ethernet/broadcom/bcm63xx_enet.c       |   5 +-
>  drivers/tty/serial/bcm63xx_uart.c                  |   6 +-
>  11 files changed, 168 insertions(+), 43 deletions(-)
> 

-- 
Florian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/8] tty/bcm63xx_uart: use refclk for the expected clock name
       [not found]     ` <20170802093429.12572-4-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-08-28 12:51       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 16+ messages in thread
From: Greg Kroah-Hartman @ 2017-08-28 12:51 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	Rob Herring, Mark Rutland, Ralf Baechle, Florian Fainelli,
	bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

On Wed, Aug 02, 2017 at 11:34:24AM +0200, Jonas Gorski wrote:
> We now have the clock available under refclk, so use that.
> 
> Signed-off-by: Jonas Gorski <jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Acked-by: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 6/8] bcm63xx_enet: just use "enet" as the clock name
  2017-08-02  9:34   ` [PATCH 6/8] bcm63xx_enet: just use "enet" as the " Jonas Gorski
@ 2017-09-06 11:00     ` Jonas Gorski
  0 siblings, 0 replies; 16+ messages in thread
From: Jonas Gorski @ 2017-09-06 11:00 UTC (permalink / raw)
  To: MIPS Mailing List, linux-arm-kernel, linux-serial, devicetree,
	Network Development
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli, bcm-kernel-feedback-list, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

Hi David,

On 2 August 2017 at 11:34, Jonas Gorski <jonas.gorski@gmail.com> wrote:
> Now that we have the individual clocks available as "enet" we
> don't need to rely on the device id for them anymore.
>
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>

Could I please get a (N)Ack so Ralf can add this patch to his tree?


Regards
Jonas

> ---
>  drivers/net/ethernet/broadcom/bcm63xx_enet.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> index 61a88b64bd39..d6844923a1c0 100644
> --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> @@ -1718,7 +1718,6 @@ static int bcm_enet_probe(struct platform_device *pdev)
>         struct bcm63xx_enet_platform_data *pd;
>         struct resource *res_mem, *res_irq, *res_irq_rx, *res_irq_tx;
>         struct mii_bus *bus;
> -       const char *clk_name;
>         int i, ret;
>
>         /* stop if shared driver failed, assume driver->probe will be
> @@ -1761,14 +1760,12 @@ static int bcm_enet_probe(struct platform_device *pdev)
>         if (priv->mac_id == 0) {
>                 priv->rx_chan = 0;
>                 priv->tx_chan = 1;
> -               clk_name = "enet0";
>         } else {
>                 priv->rx_chan = 2;
>                 priv->tx_chan = 3;
> -               clk_name = "enet1";
>         }
>
> -       priv->mac_clk = clk_get(&pdev->dev, clk_name);
> +       priv->mac_clk = clk_get(&pdev->dev, "enet");
>         if (IS_ERR(priv->mac_clk)) {
>                 ret = PTR_ERR(priv->mac_clk);
>                 goto out;
> --
> 2.13.2
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/8] tty/bcm63xx_uart: allow naming clock in device tree
       [not found]   ` <20170802093429.12572-5-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-09-06 11:01     ` Jonas Gorski
  2017-09-06 12:17       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 16+ messages in thread
From: Jonas Gorski @ 2017-09-06 11:01 UTC (permalink / raw)
  To: MIPS Mailing List,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Network Development
  Cc: Greg Kroah-Hartman, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli, bcm-kernel-feedback-list, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

Hi Greg,

On 2 August 2017 at 11:34, Jonas Gorski <jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Codify using a named clock for the refclk of the uart. This makes it
> easier if we might need to add a gating clock (like present on the
> BCM6345).
>
> Signed-off-by: Jonas Gorski <jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Could I please get a (N)Ack so Ralf can add this patch to his tree?


Regards
Jonas


> ---
>  Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt | 6 ++++++
>  drivers/tty/serial/bcm63xx_uart.c                              | 6 ++++--
>  2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
> index 5c52e5eef16d..8b2b0460259a 100644
> --- a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
> +++ b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
> @@ -11,6 +11,11 @@ Required properties:
>  - clocks: Clock driving the hardware; used to figure out the baud rate
>    divisor.
>
> +
> +Optional properties:
> +
> +- clock-names: Should be "refclk".
> +
>  Example:
>
>         uart0: serial@14e00520 {
> @@ -19,6 +24,7 @@ Example:
>                 interrupt-parent = <&periph_intc>;
>                 interrupts = <2>;
>                 clocks = <&periph_clk>;
> +               clock-names = "refclk";
>         };
>
>         clocks {
> diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
> index a2b9376ec861..f227eff28d3a 100644
> --- a/drivers/tty/serial/bcm63xx_uart.c
> +++ b/drivers/tty/serial/bcm63xx_uart.c
> @@ -841,8 +841,10 @@ static int bcm_uart_probe(struct platform_device *pdev)
>         if (!res_irq)
>                 return -ENODEV;
>
> -       clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) :
> -                                 clk_get(&pdev->dev, "refclk");
> +       clk = clk_get(&pdev->dev, "refclk");
> +       if (IS_ERR(clk) && pdev->dev.of_node)
> +               clk = of_clk_get(pdev->dev.of_node, 0);
> +
>         if (IS_ERR(clk))
>                 return -ENODEV;
>
> --
> 2.13.2
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/8] tty/bcm63xx_uart: allow naming clock in device tree
  2017-09-06 11:01     ` Jonas Gorski
@ 2017-09-06 12:17       ` Greg Kroah-Hartman
       [not found]         ` <20170906121715.GA27869-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Greg Kroah-Hartman @ 2017-09-06 12:17 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: MIPS Mailing List, linux-arm-kernel, linux-serial, devicetree,
	Network Development, Rob Herring, Mark Rutland, Ralf Baechle,
	Florian Fainelli, bcm-kernel-feedback-list, Kevin Cernekee,
	Jiri Slaby, David S. Miller, Russell King

On Wed, Sep 06, 2017 at 01:01:32PM +0200, Jonas Gorski wrote:
> Hi Greg,
> 
> On 2 August 2017 at 11:34, Jonas Gorski <jonas.gorski@gmail.com> wrote:
> > Codify using a named clock for the refclk of the uart. This makes it
> > easier if we might need to add a gating clock (like present on the
> > BCM6345).
> >
> > Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
> 
> Could I please get a (N)Ack so Ralf can add this patch to his tree?
> 
> 
> Regards
> Jonas
> 
> 
> > ---
> >  Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt | 6 ++++++
> >  drivers/tty/serial/bcm63xx_uart.c                              | 6 ++++--
> >  2 files changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
> > index 5c52e5eef16d..8b2b0460259a 100644
> > --- a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
> > +++ b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
> > @@ -11,6 +11,11 @@ Required properties:
> >  - clocks: Clock driving the hardware; used to figure out the baud rate
> >    divisor.
> >
> > +
> > +Optional properties:
> > +
> > +- clock-names: Should be "refclk".
> > +
> >  Example:
> >
> >         uart0: serial@14e00520 {
> > @@ -19,6 +24,7 @@ Example:
> >                 interrupt-parent = <&periph_intc>;
> >                 interrupts = <2>;
> >                 clocks = <&periph_clk>;
> > +               clock-names = "refclk";
> >         };
> >
> >         clocks {

I don't ack devtree changes :)

> > diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
> > index a2b9376ec861..f227eff28d3a 100644
> > --- a/drivers/tty/serial/bcm63xx_uart.c
> > +++ b/drivers/tty/serial/bcm63xx_uart.c
> > @@ -841,8 +841,10 @@ static int bcm_uart_probe(struct platform_device *pdev)
> >         if (!res_irq)
> >                 return -ENODEV;
> >
> > -       clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) :
> > -                                 clk_get(&pdev->dev, "refclk");
> > +       clk = clk_get(&pdev->dev, "refclk");
> > +       if (IS_ERR(clk) && pdev->dev.of_node)
> > +               clk = of_clk_get(pdev->dev.of_node, 0);
> > +
> >         if (IS_ERR(clk))
> >                 return -ENODEV;
> >

This part is fine with me:

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/8] tty/bcm63xx_uart: allow naming clock in device tree
       [not found]         ` <20170906121715.GA27869-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
@ 2017-09-06 12:37           ` Jonas Gorski
  0 siblings, 0 replies; 16+ messages in thread
From: Jonas Gorski @ 2017-09-06 12:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: MIPS Mailing List,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Network Development,
	Rob Herring, Mark Rutland, Ralf Baechle, Florian Fainelli,
	bcm-kernel-feedback-list, Kevin Cernekee, Jiri Slaby,
	David S. Miller, Russell King

On 6 September 2017 at 14:17, Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org> wrote:
> On Wed, Sep 06, 2017 at 01:01:32PM +0200, Jonas Gorski wrote:
>> Hi Greg,
>>
>> On 2 August 2017 at 11:34, Jonas Gorski <jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> > Codify using a named clock for the refclk of the uart. This makes it
>> > easier if we might need to add a gating clock (like present on the
>> > BCM6345).
>> >
>> > Signed-off-by: Jonas Gorski <jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>
>> Could I please get a (N)Ack so Ralf can add this patch to his tree?
>>
>>
>> Regards
>> Jonas
>>
>>
>> > ---
>> >  Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt | 6 ++++++
>> >  drivers/tty/serial/bcm63xx_uart.c                              | 6 ++++--
>> >  2 files changed, 10 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
>> > index 5c52e5eef16d..8b2b0460259a 100644
>> > --- a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
>> > +++ b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
>> > @@ -11,6 +11,11 @@ Required properties:
>> >  - clocks: Clock driving the hardware; used to figure out the baud rate
>> >    divisor.
>> >
>> > +
>> > +Optional properties:
>> > +
>> > +- clock-names: Should be "refclk".
>> > +
>> >  Example:
>> >
>> >         uart0: serial@14e00520 {
>> > @@ -19,6 +24,7 @@ Example:
>> >                 interrupt-parent = <&periph_intc>;
>> >                 interrupts = <2>;
>> >                 clocks = <&periph_clk>;
>> > +               clock-names = "refclk";
>> >         };
>> >
>> >         clocks {
>
> I don't ack devtree changes :)
>
>> > diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
>> > index a2b9376ec861..f227eff28d3a 100644
>> > --- a/drivers/tty/serial/bcm63xx_uart.c
>> > +++ b/drivers/tty/serial/bcm63xx_uart.c
>> > @@ -841,8 +841,10 @@ static int bcm_uart_probe(struct platform_device *pdev)
>> >         if (!res_irq)
>> >                 return -ENODEV;
>> >
>> > -       clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) :
>> > -                                 clk_get(&pdev->dev, "refclk");
>> > +       clk = clk_get(&pdev->dev, "refclk");
>> > +       if (IS_ERR(clk) && pdev->dev.of_node)
>> > +               clk = of_clk_get(pdev->dev.of_node, 0);
>> > +
>> >         if (IS_ERR(clk))
>> >                 return -ENODEV;
>> >
>
> This part is fine with me:

That's all I wanted :)
>
> Acked-by: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>

Thank you!


Jonas
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-09-06 12:37 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-02  9:34 [PATCH 0/8] MIPS: BCM63XX: add and use clkdev lookup support Jonas Gorski
2017-08-02  9:34 ` [PATCH 1/8] MIPS: BCM63XX: add " Jonas Gorski
2017-08-02  9:34 ` [PATCH 2/8] MIPS: BCM63XX: provide periph clock as refclk for uart Jonas Gorski
     [not found] ` <20170802093429.12572-1-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-08-02  9:34   ` [PATCH 3/8] tty/bcm63xx_uart: use refclk for the expected clock name Jonas Gorski
     [not found]     ` <20170802093429.12572-4-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-08-28 12:51       ` Greg Kroah-Hartman
2017-08-02  9:34   ` [PATCH 6/8] bcm63xx_enet: just use "enet" as the " Jonas Gorski
2017-09-06 11:00     ` Jonas Gorski
2017-08-02  9:34   ` [PATCH 8/8] MIPS: BMIPS: name the refclk clock for uart Jonas Gorski
2017-08-15 16:20   ` [PATCH 0/8] MIPS: BCM63XX: add and use clkdev lookup support Florian Fainelli
2017-08-02  9:34 ` [PATCH 4/8] tty/bcm63xx_uart: allow naming clock in device tree Jonas Gorski
2017-08-10 16:25   ` Rob Herring
     [not found]   ` <20170802093429.12572-5-jonas.gorski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-09-06 11:01     ` Jonas Gorski
2017-09-06 12:17       ` Greg Kroah-Hartman
     [not found]         ` <20170906121715.GA27869-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2017-09-06 12:37           ` Jonas Gorski
2017-08-02  9:34 ` [PATCH 5/8] MIPS: BCM63XX: provide enet clocks as "enet" to the ethernet devices Jonas Gorski
2017-08-02  9:34 ` [PATCH 7/8] MIPS: BCM63XX: move the HSSPI PLL HZ into its own clock Jonas Gorski

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).